@things-factory/integration-base 6.1.119 → 6.1.122
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/integration-base",
|
3
|
-
"version": "6.1.
|
3
|
+
"version": "6.1.122",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -26,11 +26,11 @@
|
|
26
26
|
},
|
27
27
|
"dependencies": {
|
28
28
|
"@apollo/client": "^3.6.9",
|
29
|
-
"@things-factory/api": "^6.1.
|
30
|
-
"@things-factory/auth-base": "^6.1.
|
29
|
+
"@things-factory/api": "^6.1.122",
|
30
|
+
"@things-factory/auth-base": "^6.1.122",
|
31
31
|
"@things-factory/env": "^6.1.116",
|
32
|
-
"@things-factory/oauth2-client": "^6.1.
|
33
|
-
"@things-factory/scheduler-client": "^6.1.
|
32
|
+
"@things-factory/oauth2-client": "^6.1.122",
|
33
|
+
"@things-factory/scheduler-client": "^6.1.122",
|
34
34
|
"@things-factory/shell": "^6.1.118",
|
35
35
|
"async-mqtt": "^2.5.0",
|
36
36
|
"chance": "^1.1.11",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"devDependencies": {
|
47
47
|
"@types/cron": "^2.0.1"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "01735af77d98fa26fbcc312e9b982eee1638114d"
|
50
50
|
}
|
@@ -19,6 +19,12 @@ type ProcedureParameterType = {
|
|
19
19
|
maxSize?: number
|
20
20
|
}
|
21
21
|
|
22
|
+
type ValueType = {
|
23
|
+
code?: string
|
24
|
+
procedure?: string
|
25
|
+
parameters?: ProcedureParameterType[]
|
26
|
+
}
|
27
|
+
|
22
28
|
const TYPES = {
|
23
29
|
Number: oracledb?.NUMBER,
|
24
30
|
String: oracledb?.STRING,
|
@@ -39,7 +45,7 @@ async function OracleProcedure(step, context) {
|
|
39
45
|
var { domain, data, variables } = context
|
40
46
|
var { connection: connectionName, params } = step
|
41
47
|
|
42
|
-
var {
|
48
|
+
var { code = '', parameters = [] } = params.parameters as ValueType
|
43
49
|
|
44
50
|
var dbconnection = ConnectionManager.getConnectionInstanceByName(domain, connectionName)
|
45
51
|
|
@@ -51,7 +57,11 @@ async function OracleProcedure(step, context) {
|
|
51
57
|
}
|
52
58
|
})
|
53
59
|
|
54
|
-
|
60
|
+
if (!code) {
|
61
|
+
throw 'procedure code not defined'
|
62
|
+
}
|
63
|
+
|
64
|
+
code = vm.run('`' + code + '`')
|
55
65
|
|
56
66
|
const procedureParameters =
|
57
67
|
parameters &&
|
@@ -81,7 +91,7 @@ async function OracleProcedure(step, context) {
|
|
81
91
|
return sum
|
82
92
|
}, {})
|
83
93
|
|
84
|
-
const result = await dbconnection.execute(
|
94
|
+
const result = await dbconnection.execute(code, procedureParameters)
|
85
95
|
|
86
96
|
var taskResult = {}
|
87
97
|
let paramKeys = Object.keys(procedureParameters)
|
@@ -106,15 +116,10 @@ async function OracleProcedure(step, context) {
|
|
106
116
|
}
|
107
117
|
|
108
118
|
OracleProcedure.parameterSpec = [
|
109
|
-
{
|
110
|
-
type: 'textarea',
|
111
|
-
name: 'procedure',
|
112
|
-
label: 'procedure'
|
113
|
-
},
|
114
119
|
{
|
115
120
|
type: 'procedure-parameters',
|
116
121
|
name: 'parameters',
|
117
|
-
label: '
|
122
|
+
label: ''
|
118
123
|
}
|
119
124
|
]
|
120
125
|
|