Page 1 of 1

updating switch nodejs sripting capabilities

Posted: Tue Nov 08, 2022 1:36 pm
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 3179 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

Re: updating switch nodejs sripting capabilities

Posted: Tue Nov 08, 2022 2:13 pm
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

Re: updating switch nodejs sripting capabilities

Posted: Tue Nov 08, 2022 3:08 pm
by borisCM
perfect, thanks for your help. it works.