@things-factory/integration-base 7.0.1-rc.10 → 7.0.1-rc.12

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": "7.0.1-rc.10",
3
+ "version": "7.0.1-rc.12",
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.10",
31
- "@things-factory/auth-base": "^7.0.1-rc.10",
32
- "@things-factory/cache-service": "^7.0.1-rc.10",
30
+ "@things-factory/api": "^7.0.1-rc.12",
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.10",
35
- "@things-factory/scheduler-client": "^7.0.1-rc.10",
36
- "@things-factory/shell": "^7.0.1-rc.10",
34
+ "@things-factory/oauth2-client": "^7.0.1-rc.12",
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": "259524f7aeb4368a5a4792aa31e4d11b525dbb28"
47
+ "gitHead": "b2e8166c8d03cc4908965fbf8736146acca6b3e0"
48
48
  }
@@ -138,14 +138,22 @@ export class ConnectionManager {
138
138
  }
139
139
 
140
140
  static getConnectionInstanceEntityByName(domain: Domain, name: string): any {
141
- const entities = ConnectionManager.entities[domain.id]
142
- return entities?.[name]
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(instanceName, variables?: any) {
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, this, { domain: this.domain, user: this.updater, variables })
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(instanceName?) {
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
  }