updating switch nodejs sripting capabilities

Post Reply
borisCM
Member
Posts: 37
Joined: Mon May 06, 2019 12:23 pm
Location: Netherlands

updating switch nodejs sripting capabilities

Post by borisCM »

hi,
i have some older node js projects.
i can't get the new functionalities working (it creates type errors in visual studio code).
such as
- the json dataset model,
- not having to use the messageParams array []
-...
switch scripting issue.PNG
switch scripting issue.PNG (132.27 KiB) Viewed 2756 times
if i create a project from scratch it is not an issue.

reloading the types from npm is not solving it, is there some documentation about it.
recreating al the older projects is a lot of work
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: updating switch nodejs sripting capabilities

Post by Padawan »

The Switch typings are added by the SwitchScriptingTool when the project is created. To update the typings to version 2022 you can run the following command in the folder of your project:
npm i "https://github.com/enfocus-switch/types ... 0.0.tar.gz"

For future versions, you can get the url from a fresh script project which is created using the latest SwitchScripter. You will find this in package.json:

Code: Select all

  "dependencies": {
    "@types/switch-scripting": "https://github.com/enfocus-switch/types-switch-scripting/archive/22.0.0.tar.gz"
  }
Sidenote: I see you have a script to add private data to a job. There is also a free app which does that:
https://www.enfocus.com/en/appstore/product/data-mapper
borisCM
Member
Posts: 37
Joined: Mon May 06, 2019 12:23 pm
Location: Netherlands

Re: updating switch nodejs sripting capabilities

Post by borisCM »

perfect, thanks for your help. it works.
Post Reply