@things-factory/integration-base 6.1.117 → 6.1.119

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.117",
3
+ "version": "6.1.119",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -26,12 +26,12 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@apollo/client": "^3.6.9",
29
- "@things-factory/api": "^6.1.116",
30
- "@things-factory/auth-base": "^6.1.116",
29
+ "@things-factory/api": "^6.1.118",
30
+ "@things-factory/auth-base": "^6.1.118",
31
31
  "@things-factory/env": "^6.1.116",
32
- "@things-factory/oauth2-client": "^6.1.116",
33
- "@things-factory/scheduler-client": "^6.1.116",
34
- "@things-factory/shell": "^6.1.116",
32
+ "@things-factory/oauth2-client": "^6.1.118",
33
+ "@things-factory/scheduler-client": "^6.1.118",
34
+ "@things-factory/shell": "^6.1.118",
35
35
  "async-mqtt": "^2.5.0",
36
36
  "chance": "^1.1.11",
37
37
  "cross-fetch": "^3.0.4",
@@ -46,5 +46,5 @@
46
46
  "devDependencies": {
47
47
  "@types/cron": "^2.0.1"
48
48
  },
49
- "gitHead": "82d5cb1eab1ce608345fba651a221082c47915f5"
49
+ "gitHead": "a3729089483f19175214666ef9959ad88328d4a6"
50
50
  }
@@ -0,0 +1,33 @@
1
+ import { access } from '@things-factory/utils'
2
+ import { TaskRegistry } from '../task-registry'
3
+
4
+ async function DataAccessor(step, { logger, data }) {
5
+ var {
6
+ params: { target, accessor }
7
+ } = step
8
+
9
+ const input = access(target, data)
10
+ const output = access(accessor, input)
11
+
12
+ return {
13
+ data: output
14
+ }
15
+ }
16
+
17
+ DataAccessor.parameterSpec = [
18
+ {
19
+ type: 'scenario-step-input',
20
+ name: 'target',
21
+ label: 'target'
22
+ },
23
+ {
24
+ type: 'data-accessor',
25
+ name: 'accessor',
26
+ label: 'accessor'
27
+ }
28
+ ]
29
+
30
+ DataAccessor.connectorFree = true
31
+ DataAccessor.help = 'integration/task/data-accessor'
32
+
33
+ TaskRegistry.registerTaskHandler('data-accessor', DataAccessor)
@@ -20,19 +20,19 @@ type ProcedureParameterType = {
20
20
  }
21
21
 
22
22
  const TYPES = {
23
- Number: oracledb.NUMBER,
24
- String: oracledb.STRING,
25
- Date: oracledb.DATE,
26
- Buffer: oracledb.BUFFER,
27
- Blob: oracledb.BLOB,
28
- Clob: oracledb.CLOB,
29
- Cursor: oracledb.CURSOR
23
+ Number: oracledb?.NUMBER,
24
+ String: oracledb?.STRING,
25
+ Date: oracledb?.DATE,
26
+ Buffer: oracledb?.BUFFER,
27
+ Blob: oracledb?.BLOB,
28
+ Clob: oracledb?.CLOB,
29
+ Cursor: oracledb?.CURSOR
30
30
  }
31
31
 
32
32
  const DIR = {
33
- In: oracledb.BIND_IN,
34
- Inout: oracledb.BIND_INOUT,
35
- Out: oracledb.BIND_OUT
33
+ In: oracledb?.BIND_IN,
34
+ Inout: oracledb?.BIND_INOUT,
35
+ Out: oracledb?.BIND_OUT
36
36
  }
37
37
 
38
38
  async function OracleProcedure(step, context) {
@@ -87,8 +87,8 @@ async function OracleProcedure(step, context) {
87
87
  let paramKeys = Object.keys(procedureParameters)
88
88
 
89
89
  for (const paramKey of paramKeys) {
90
- if (procedureParameters[paramKey].dir === oracledb.BIND_OUT) {
91
- if (procedureParameters[paramKey].type === oracledb.CURSOR) {
90
+ if (procedureParameters[paramKey].dir === oracledb?.BIND_OUT) {
91
+ if (procedureParameters[paramKey].type === oracledb?.CURSOR) {
92
92
  const resultSetTemp = result.outBinds[paramKey]
93
93
  taskResult[paramKey] = await resultSetTemp.getRows()
94
94
  await resultSetTemp.close()