profoundjs 7.22.1 → 7.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/setup/call.js CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ "use strict";
4
+
3
5
  async function call() {
4
6
  // Load Profound.js
5
7
  const profoundjs = require("profoundjs");
@@ -273,6 +273,7 @@ Valid arguments for --silent mode:
273
273
  }
274
274
  else {
275
275
  let content = fs.readFileSync(path.join(iutils.getSetupDir(), "config.js"), "utf8");
276
+ // eslint-disable-next-line no-eval
276
277
  eval("config = " + content.substring(content.indexOf("{")));
277
278
  config.port = answers.port;
278
279
  if (answers.connectorLibrary) {
@@ -316,7 +317,8 @@ Valid arguments for --silent mode:
316
317
  }
317
318
 
318
319
  installSamples = answers.installSamples == true;
319
- } else if (IBMi && args.silent === true && args.configure !== true && args.strtcpsvr_svrname) {
320
+ }
321
+ else if (IBMi && args.silent === true && args.configure !== true && args.strtcpsvr_svrname) {
320
322
  if (validateServer(args.strtcpsvr_svrname) === true) {
321
323
  svrname = args.strtcpsvr_svrname;
322
324
  autostart = args.strtcpsvr_autostart;
@@ -4,7 +4,7 @@ const acorn = require("acorn");
4
4
  const estraverse = require("estraverse");
5
5
  const fs = require("fs");
6
6
  const moment = require("moment");
7
- const profound = require("profoundjs");
7
+ require("profoundjs");
8
8
 
9
9
  module.exports = function(file) {
10
10
  let content = fs.readFileSync(file, "utf8");
@@ -152,7 +152,6 @@ module.exports = function(file) {
152
152
  }
153
153
  }
154
154
  const fn = fnStack[fnStack.length - 1];
155
- const scope = scopeMap.get(scopeStack[scopeStack.length - 1]);
156
155
  if (isFunction(node)) {
157
156
  // Update function map entries with function name and name scope.
158
157
  const fnInfo = fnMap.get(node);
@@ -195,6 +194,7 @@ module.exports = function(file) {
195
194
  const internalName = "profound" + getCallName(calleeName.substring(pjsPrefix.length));
196
195
  let fn;
197
196
  try {
197
+ // eslint-disable-next-line no-eval
198
198
  eval("fn = " + internalName);
199
199
  }
200
200
  catch (error) {}
@@ -1,16 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "warnings": [
4
- {
5
- "text": "Git integration is not supported on Node.js versions greater than 16.",
6
- "os": [
7
- "!os400"
8
- ],
9
- "engines": {
10
- "node": "> 16"
11
- }
12
- }
13
- ],
3
+ "warnings": [],
14
4
  "questions": [
15
5
  {
16
6
  "id": "port",
Binary file
@@ -1,84 +1,80 @@
1
+ "use strict";
1
2
 
2
3
  module.exports = {
3
-
4
- name: "Math-Operation",
5
-
6
- // The title that is displayed for this sample plugin on the plugin selection
7
- text: "Math Operation",
8
-
9
- // The plugin category that the sample plugin will be placed into.
10
- // A category will be created if the category name does not currently exist
11
- category: "Sample User Plugins",
12
-
13
- // The help text that is displayed when the help icon is clicked on this plugin's menu
14
- help: `This plugin does a math operation set by the user for 2 different numbers from 2 widget sources`,
15
-
16
- // Specifies if the plugin is a client-side or server-side step. A plugin is server-side by default.
17
- clientSide: true,
18
-
19
- context: "rdf",
20
-
21
- // An array used to generate the plugin questions and assign values set by the user.
22
- questions: [
23
4
 
24
- {
25
- id: "firstNumber",
26
- text: "ID of Widget containing the first number",
27
- required: true,
28
- insertDynamic: true,
29
- dynamicSource: "widgets"
30
- },
5
+ name: "Math-Operation",
31
6
 
32
- {
33
- id: "secondNumber",
34
- text: "ID of Widget containing the second number",
35
- required: true,
36
- insertDynamic: true,
37
- dynamicSource: "widgets"
38
- },
39
-
40
- {
41
- id: "operation",
42
- text: "Math operation",
43
- required: true,
44
- type: "dropdown",
45
- source: ["+","-","*","/"],
46
- required: true
47
- },
48
-
49
- {
50
- id: "result",
51
- text: "ID of Widget where result will be stored",
52
- required: true,
53
- insertDynamic: true,
54
- dynamicSource: "widgets"
55
- }
56
- ],
57
-
58
- // This is where code is generated for the plugin once the questions are answered.
59
- // You can also see this code via the "convert to code" plugin icon.
60
- generator: function(answers) {
61
-
62
- let result = 0;
63
- let code = "";
64
-
65
- switch (answers["operation"]) {
66
-
67
- case "+":
68
- code = 'pui.set( "' + answers.result + '", parseInt( pui.get("' + answers.firstNumber + '") ) + parseInt( pui.get("' + answers.secondNumber + '") ) );';
69
- break;
70
- case "-":
71
- code = 'pui.set( "' + answers.result + '", parseInt( pui.get("' + answers.firstNumber + '") ) - parseInt( pui.get("' + answers.secondNumber + '") ) );';
72
- break;
73
- case "*":
74
- code = 'pui.set( "' + answers.result + '", parseInt( pui.get("' + answers.firstNumber + '") ) * parseInt( pui.get("' + answers.secondNumber + '") ) );';
75
- break;
76
- case "/":
77
- code = 'pui.set( "' + answers.result + '", parseInt( pui.get("' + answers.firstNumber + '") ) / parseInt( pui.get("' + answers.secondNumber + '") ) );';
78
- break;
79
-
80
- }
81
-
82
- return code;
7
+ // The title that is displayed for this sample plugin on the plugin selection
8
+ text: "Math Operation",
9
+
10
+ // The plugin category that the sample plugin will be placed into.
11
+ // A category will be created if the category name does not currently exist
12
+ category: "Sample User Plugins",
13
+
14
+ // The help text that is displayed when the help icon is clicked on this plugin's menu
15
+ help: `This plugin does a math operation set by the user for 2 different numbers from 2 widget sources`,
16
+
17
+ // Specifies if the plugin is a client-side or server-side step. A plugin is server-side by default.
18
+ clientSide: true,
19
+
20
+ context: "rdf",
21
+
22
+ // An array used to generate the plugin questions and assign values set by the user.
23
+ questions: [
24
+
25
+ {
26
+ id: "firstNumber",
27
+ text: "ID of Widget containing the first number",
28
+ required: true,
29
+ insertDynamic: true,
30
+ dynamicSource: "widgets"
31
+ },
32
+
33
+ {
34
+ id: "secondNumber",
35
+ text: "ID of Widget containing the second number",
36
+ required: true,
37
+ insertDynamic: true,
38
+ dynamicSource: "widgets"
39
+ },
40
+
41
+ {
42
+ id: "operation",
43
+ text: "Math operation",
44
+ required: true,
45
+ type: "dropdown",
46
+ source: ["+", "-", "*", "/"]
47
+ },
48
+
49
+ {
50
+ id: "result",
51
+ text: "ID of Widget where result will be stored",
52
+ required: true,
53
+ insertDynamic: true,
54
+ dynamicSource: "widgets"
55
+ }
56
+ ],
57
+
58
+ // This is where code is generated for the plugin once the questions are answered.
59
+ // You can also see this code via the "convert to code" plugin icon.
60
+ generator: function(answers) {
61
+ let code = "";
62
+
63
+ switch (answers["operation"]) {
64
+ case "+":
65
+ code = 'pui.set( "' + answers.result + '", parseInt( pui.get("' + answers.firstNumber + '") ) + parseInt( pui.get("' + answers.secondNumber + '") ) );';
66
+ break;
67
+ case "-":
68
+ code = 'pui.set( "' + answers.result + '", parseInt( pui.get("' + answers.firstNumber + '") ) - parseInt( pui.get("' + answers.secondNumber + '") ) );';
69
+ break;
70
+ case "*":
71
+ code = 'pui.set( "' + answers.result + '", parseInt( pui.get("' + answers.firstNumber + '") ) * parseInt( pui.get("' + answers.secondNumber + '") ) );';
72
+ break;
73
+ case "/":
74
+ code = 'pui.set( "' + answers.result + '", parseInt( pui.get("' + answers.firstNumber + '") ) / parseInt( pui.get("' + answers.secondNumber + '") ) );';
75
+ break;
83
76
  }
84
- }
77
+
78
+ return code;
79
+ }
80
+ };
package/setup/start.js CHANGED
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env node
2
+ "use strict";
2
3
  async function startPJS() {
3
4
  const profoundjs = require("profoundjs");
4
5
  await profoundjs.applyConfig();
5
6
  await profoundjs.server.listen();
6
- var express = profoundjs.server.express;
7
- var app = profoundjs.server.app;
7
+ const express = profoundjs.server.express;
8
+ const app = profoundjs.server.app;
8
9
  app.use(express.json());
9
10
  }
10
11
  startPJS();
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ "use strict";
4
+
3
5
  const profoundjs = require("profoundjs");
4
6
  profoundjs.storeCredentials();
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ "use strict";
4
+
3
5
  const profoundjs = require("profoundjs");
4
6
  profoundjs.storeOptions();