@things-factory/integration-base 6.2.158 → 6.2.163

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.2.158",
3
+ "version": "6.2.163",
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.2.158",
30
- "@things-factory/auth-base": "^6.2.158",
29
+ "@things-factory/api": "^6.2.162",
30
+ "@things-factory/auth-base": "^6.2.162",
31
31
  "@things-factory/env": "^6.2.139",
32
- "@things-factory/oauth2-client": "^6.2.158",
33
- "@things-factory/scheduler-client": "^6.2.158",
34
- "@things-factory/shell": "^6.2.158",
32
+ "@things-factory/oauth2-client": "^6.2.162",
33
+ "@things-factory/scheduler-client": "^6.2.162",
34
+ "@things-factory/shell": "^6.2.162",
35
35
  "@things-factory/utils": "^6.2.122",
36
36
  "async-mqtt": "^2.5.0",
37
37
  "chance": "^1.1.11",
@@ -47,5 +47,5 @@
47
47
  "devDependencies": {
48
48
  "@types/cron": "^2.0.1"
49
49
  },
50
- "gitHead": "dbf89f0b30d1ff570e4d1de777ce69f9e48910bb"
50
+ "gitHead": "9709a69dcd717d56fb6d84d0f2c6a92c22d09f0c"
51
51
  }
@@ -121,8 +121,10 @@ export class ConnectionManager {
121
121
 
122
122
  static getConnectionInstances(domain: Domain): { [connectionName: string]: any } {
123
123
  const connections = ConnectionManager.connections[domain.id]
124
+ const parentConnections = domain.parentId && ConnectionManager.connections[domain.parentId]
124
125
 
125
126
  return {
127
+ ...parentConnections,
126
128
  ...connections
127
129
  }
128
130
  }
@@ -94,15 +94,30 @@ export class Scenario {
94
94
  @RelationId((scenario: Scenario) => scenario.updater)
95
95
  updaterId?: string
96
96
 
97
- async start(instanceName, variables?: any) {
97
+ async start(options?: {
98
+ instanceName?: string;
99
+ domain?: Domain;
100
+ user?: User;
101
+ variables?: any;
102
+ }) {
98
103
  try {
99
- await ScenarioEngine.load(instanceName || this.name, this, { domain: this.domain, user: this.updater, variables })
104
+ await ScenarioEngine.load(options?.instanceName || this.name,
105
+ this,
106
+ {
107
+ domain: options?.domain || this.domain,
108
+ user: options?.user || this.updater,
109
+ variables: options?.variables
110
+ })
100
111
  } catch (ex) {}
101
112
  }
102
113
 
103
- async stop(instanceName?) {
114
+ async stop(options?: {
115
+ instanceName?: string;
116
+ domain?: Domain,
117
+ user?: User
118
+ }) {
104
119
  try {
105
- await ScenarioEngine.unload(this.domain, instanceName || this.name)
120
+ await ScenarioEngine.unload(options?.domain || this.domain, options?.instanceName || this.name)
106
121
  } finally {
107
122
  }
108
123
  }