@things-factory/integration-base 8.0.87 → 8.0.89

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": "8.0.87",
3
+ "version": "8.0.89",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -27,14 +27,14 @@
27
27
  "dependencies": {
28
28
  "@apollo/client": "^3.6.9",
29
29
  "@operato/moment-timezone-es": "^8.0.0",
30
- "@things-factory/api": "^8.0.87",
31
- "@things-factory/auth-base": "^8.0.87",
32
- "@things-factory/cache-service": "^8.0.87",
33
- "@things-factory/env": "^8.0.64",
34
- "@things-factory/oauth2-client": "^8.0.87",
35
- "@things-factory/scheduler-client": "^8.0.87",
36
- "@things-factory/shell": "^8.0.86",
37
- "@things-factory/utils": "^8.0.64",
30
+ "@things-factory/api": "^8.0.88",
31
+ "@things-factory/auth-base": "^8.0.88",
32
+ "@things-factory/cache-service": "^8.0.88",
33
+ "@things-factory/env": "^8.0.88",
34
+ "@things-factory/oauth2-client": "^8.0.88",
35
+ "@things-factory/scheduler-client": "^8.0.88",
36
+ "@things-factory/shell": "^8.0.88",
37
+ "@things-factory/utils": "^8.0.88",
38
38
  "async-mqtt": "^2.5.0",
39
39
  "chance": "^1.1.11",
40
40
  "cross-fetch": "^3.0.4",
@@ -44,5 +44,5 @@
44
44
  "readline": "^1.3.0",
45
45
  "ses": "^1.5.0"
46
46
  },
47
- "gitHead": "1804f2446f618e0e5a6978d35130d17e0c22375d"
47
+ "gitHead": "984bd30a606d1e24a66a0685c41bff369c54b779"
48
48
  }
@@ -0,0 +1,32 @@
1
+ import { TaskRegistry } from '../task-registry'
2
+ import { ConnectionManager } from '../connection-manager'
3
+ import { InputStep } from '../../service/step/step-type'
4
+ import { Context } from '../types'
5
+
6
+ async function EchoSendHex(step: InputStep, { logger, domain }: Context) {
7
+ var {
8
+ connection: connectionName,
9
+ params: { message }
10
+ } = step
11
+
12
+ var connection = ConnectionManager.getConnectionInstanceByName(domain, connectionName)
13
+ if (!connection) {
14
+ throw Error(`connection is not found : ${connectionName}`)
15
+ }
16
+
17
+ var data = await connection.write(Buffer.from(message, 'hex'))
18
+
19
+ return {
20
+ data
21
+ }
22
+ }
23
+
24
+ EchoSendHex.parameterSpec = [
25
+ {
26
+ type: 'string',
27
+ name: 'message',
28
+ label: 'message (hex)'
29
+ }
30
+ ]
31
+
32
+ TaskRegistry.registerTaskHandler('echo-send-hex', EchoSendHex)
@@ -1,4 +1,5 @@
1
1
  import './echo-send'
2
+ import './echo-send-hex'
2
3
  import './echo-receive'
3
4
  import './sleep'
4
5
  import './log'