@things-factory/integration-base 7.0.1-rc.10 → 7.0.1-rc.11
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/dist-server/engine/connection-manager.js +10 -3
- package/dist-server/engine/connection-manager.js.map +1 -1
- package/dist-server/service/scenario/scenario.d.ts +11 -2
- package/dist-server/service/scenario/scenario.js +8 -4
- package/dist-server/service/scenario/scenario.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/server/engine/connection-manager.ts +10 -2
- package/server/service/scenario/scenario.ts +19 -4
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/integration-base",
|
3
|
-
"version": "7.0.1-rc.
|
3
|
+
"version": "7.0.1-rc.11",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -27,13 +27,13 @@
|
|
27
27
|
"dependencies": {
|
28
28
|
"@apollo/client": "^3.6.9",
|
29
29
|
"@operato/moment-timezone-es": "^7.0.0-rc",
|
30
|
-
"@things-factory/api": "^7.0.1-rc.
|
31
|
-
"@things-factory/auth-base": "^7.0.1-rc.
|
32
|
-
"@things-factory/cache-service": "^7.0.1-rc.
|
30
|
+
"@things-factory/api": "^7.0.1-rc.11",
|
31
|
+
"@things-factory/auth-base": "^7.0.1-rc.11",
|
32
|
+
"@things-factory/cache-service": "^7.0.1-rc.11",
|
33
33
|
"@things-factory/env": "^7.0.1-rc.8",
|
34
|
-
"@things-factory/oauth2-client": "^7.0.1-rc.
|
35
|
-
"@things-factory/scheduler-client": "^7.0.1-rc.
|
36
|
-
"@things-factory/shell": "^7.0.1-rc.
|
34
|
+
"@things-factory/oauth2-client": "^7.0.1-rc.11",
|
35
|
+
"@things-factory/scheduler-client": "^7.0.1-rc.11",
|
36
|
+
"@things-factory/shell": "^7.0.1-rc.11",
|
37
37
|
"@things-factory/utils": "^7.0.1-rc.7",
|
38
38
|
"async-mqtt": "^2.5.0",
|
39
39
|
"chance": "^1.1.11",
|
@@ -44,5 +44,5 @@
|
|
44
44
|
"readline": "^1.3.0",
|
45
45
|
"ses": "^1.5.0"
|
46
46
|
},
|
47
|
-
"gitHead": "
|
47
|
+
"gitHead": "e5ab2c5ef74aea2195779626c8ffb85bccb4959b"
|
48
48
|
}
|
@@ -138,14 +138,22 @@ export class ConnectionManager {
|
|
138
138
|
}
|
139
139
|
|
140
140
|
static getConnectionInstanceEntityByName(domain: Domain, name: string): any {
|
141
|
-
const
|
142
|
-
|
141
|
+
const connection = ConnectionManager.entities[domain.id]?.[name]
|
142
|
+
if(connection) {
|
143
|
+
return connection
|
144
|
+
}
|
145
|
+
|
146
|
+
if(domain.parentId) {
|
147
|
+
return ConnectionManager.entities[domain.id]?.[name]
|
148
|
+
}
|
143
149
|
}
|
144
150
|
|
145
151
|
static getConnectionInstances(domain: Domain): { [connectionName: string]: any } {
|
146
152
|
const connections = ConnectionManager.connections[domain.id]
|
153
|
+
const parentConnections = domain.parentId && ConnectionManager.connections[domain.parentId]
|
147
154
|
|
148
155
|
return {
|
156
|
+
...parentConnections,
|
149
157
|
...connections
|
150
158
|
}
|
151
159
|
}
|
@@ -98,15 +98,30 @@ export class Scenario {
|
|
98
98
|
@RelationId((scenario: Scenario) => scenario.updater)
|
99
99
|
updaterId?: string
|
100
100
|
|
101
|
-
async start(
|
101
|
+
async start(options?: {
|
102
|
+
instanceName?: string;
|
103
|
+
domain?: Domain;
|
104
|
+
user?: User;
|
105
|
+
variables?: any;
|
106
|
+
}) {
|
102
107
|
try {
|
103
|
-
await ScenarioEngine.load(instanceName || this.name,
|
108
|
+
await ScenarioEngine.load(options?.instanceName || this.name,
|
109
|
+
this,
|
110
|
+
{
|
111
|
+
domain: options?.domain || this.domain,
|
112
|
+
user: options?.user || this.updater,
|
113
|
+
variables: options?.variables
|
114
|
+
})
|
104
115
|
} catch (ex) {}
|
105
116
|
}
|
106
117
|
|
107
|
-
async stop(
|
118
|
+
async stop(options?: {
|
119
|
+
instanceName?: string;
|
120
|
+
domain?: Domain,
|
121
|
+
user?: User
|
122
|
+
}) {
|
108
123
|
try {
|
109
|
-
await ScenarioEngine.unload(this.domain, instanceName || this.name)
|
124
|
+
await ScenarioEngine.unload(options?.domain || this.domain, options?.instanceName || this.name)
|
110
125
|
} finally {
|
111
126
|
}
|
112
127
|
}
|