@things-factory/edge-client 7.0.1-beta.9 → 7.0.1-rc.0
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/controllers/connect-connections.d.ts +2 -0
- package/dist-server/controllers/connect-connections.js +1 -2
- package/dist-server/controllers/connect-connections.js.map +1 -1
- package/dist-server/controllers/disconnect-connections.d.ts +2 -0
- package/dist-server/controllers/disconnect-connections.js +1 -2
- package/dist-server/controllers/disconnect-connections.js.map +1 -1
- package/dist-server/controllers/index.d.ts +2 -0
- package/dist-server/controllers/run-task.d.ts +2 -0
- package/dist-server/controllers/run-task.js.map +1 -1
- package/dist-server/controllers/sync-connections.d.ts +2 -0
- package/dist-server/controllers/sync-connections.js +1 -2
- package/dist-server/controllers/sync-connections.js.map +1 -1
- package/dist-server/engine/connector/edge-connector.d.ts +14 -0
- package/dist-server/engine/index.d.ts +1 -0
- package/dist-server/index.d.ts +2 -0
- package/dist-server/service/appliance/edge-client-mutation.d.ts +4 -0
- package/dist-server/service/appliance/edge-client-mutation.js +2 -2
- package/dist-server/service/appliance/edge-client-mutation.js.map +1 -1
- package/dist-server/service/appliance/edge-client-subscription.d.ts +8 -0
- package/dist-server/service/appliance/edge-client-subscription.js +4 -5
- package/dist-server/service/appliance/edge-client-subscription.js.map +1 -1
- package/dist-server/service/appliance/edge-client-type.d.ts +18 -0
- package/dist-server/service/appliance/edge-client-type.js +7 -8
- package/dist-server/service/appliance/edge-client-type.js.map +1 -1
- package/dist-server/service/appliance/index.d.ts +5 -0
- package/dist-server/service/index.d.ts +5 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/server/service/appliance/edge-client-subscription.ts +7 -5
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.connectConnections =
|
|
3
|
+
exports.connectConnections = connectConnections;
|
|
4
4
|
const shell_1 = require("@things-factory/shell");
|
|
5
5
|
async function connectConnections(connections, context) {
|
|
6
6
|
shell_1.pubsub.publish('connect-connections', connections);
|
|
7
7
|
}
|
|
8
|
-
exports.connectConnections = connectConnections;
|
|
9
8
|
//# sourceMappingURL=connect-connections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-connections.js","sourceRoot":"","sources":["../../server/controllers/connect-connections.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connect-connections.js","sourceRoot":"","sources":["../../server/controllers/connect-connections.ts"],"names":[],"mappings":";;AAGA,gDAEC;AALD,iDAA8C;AAGvC,KAAK,UAAU,kBAAkB,CAAC,WAAyB,EAAE,OAAwB;IAC1F,cAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAA;AACpD,CAAC","sourcesContent":["import { pubsub } from '@things-factory/shell'\nimport { Connection } from '@things-factory/integration-base'\n\nexport async function connectConnections(connections: Connection[], context: ResolverContext): Promise<any> {\n pubsub.publish('connect-connections', connections)\n}\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.disconnectConnections =
|
|
3
|
+
exports.disconnectConnections = disconnectConnections;
|
|
4
4
|
const shell_1 = require("@things-factory/shell");
|
|
5
5
|
async function disconnectConnections(connections, context) {
|
|
6
6
|
shell_1.pubsub.publish('disconnect-connections', connections);
|
|
7
7
|
}
|
|
8
|
-
exports.disconnectConnections = disconnectConnections;
|
|
9
8
|
//# sourceMappingURL=disconnect-connections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disconnect-connections.js","sourceRoot":"","sources":["../../server/controllers/disconnect-connections.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"disconnect-connections.js","sourceRoot":"","sources":["../../server/controllers/disconnect-connections.ts"],"names":[],"mappings":";;AAGA,sDAEC;AALD,iDAA8C;AAGvC,KAAK,UAAU,qBAAqB,CAAC,WAAyB,EAAE,OAAwB;IAC7F,cAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE,WAAW,CAAC,CAAA;AACvD,CAAC","sourcesContent":["import { pubsub } from '@things-factory/shell'\nimport { Connection } from '@things-factory/integration-base'\n\nexport async function disconnectConnections(connections: Connection[], context: ResolverContext): Promise<any> {\n pubsub.publish('disconnect-connections', connections)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-task.js","sourceRoot":"","sources":["../../server/controllers/run-task.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAE9C,6DAAkE;AAE3D,MAAM,OAAO,GAAgB,KAAK,EAAE,IAAU,EAAE,eAAwB,EAAE,EAAE;;IACjF,MAAM,EAAE,MAAM,EAAE,GAAoB,eAAe,CAAA;IAEnD,IAAI;
|
|
1
|
+
{"version":3,"file":"run-task.js","sourceRoot":"","sources":["../../server/controllers/run-task.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAE9C,6DAAkE;AAE3D,MAAM,OAAO,GAAgB,KAAK,EAAE,IAAU,EAAE,eAAwB,EAAE,EAAE;;IACjF,MAAM,EAAE,MAAM,EAAE,GAAoB,eAAe,CAAA;IAEnD,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,MAAM,IAAA,yBAAW,GAAE,CAAA;QAE9B,cAAM,CAAC,OAAO,CAAC,UAAU,EAAE;YACzB,EAAE;YACF,IAAI;YACJ,OAAO,EAAE,eAAe;SACzB,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAO,EAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QACpC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAA;QAEzC,IAAI,CAAA,MAAA,MAAM,CAAC,UAAU,0CAAE,MAAM,IAAG,CAAC,EAAE,CAAC;YAClC,8EAA8E;YAC9E,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAA;QACxB,CAAC;QAED,OAAO,GAAG,CAAA;IACZ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;AACH,CAAC,CAAA;AA5BY,QAAA,OAAO,WA4BnB","sourcesContent":["import { pubsub } from '@things-factory/shell'\nimport { Context, Step, TaskHandler } from '@things-factory/integration-base'\nimport { requestLock, tryLock } from '@things-factory/lock-client'\n\nexport const runTask: TaskHandler = async (step: Step, scenarioContext: Context) => {\n const { logger }: { logger: any } = scenarioContext\n\n try {\n const id = await requestLock()\n\n pubsub.publish('run-task', {\n id,\n step,\n context: scenarioContext\n })\n\n const result = await tryLock({ id })\n const { out, logs, error } = result || {}\n\n if (logger.transports?.length > 0) {\n /* 강제로 시나리오 인스턴스가 종료된 경우에는 logger도 닫힌 상태가 된다. 이 경우에는 transports가 설정되지 않게된다. */\n logs && logs.map(log => logger.log(log))\n }\n\n if (error) {\n throw new Error(error)\n }\n\n return out\n } catch (err) {\n throw new Error(err)\n }\n}\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.syncConnections =
|
|
3
|
+
exports.syncConnections = syncConnections;
|
|
4
4
|
const shell_1 = require("@things-factory/shell");
|
|
5
5
|
async function syncConnections(connections, context) {
|
|
6
6
|
shell_1.pubsub.publish('sync-connections', connections);
|
|
7
7
|
}
|
|
8
|
-
exports.syncConnections = syncConnections;
|
|
9
8
|
//# sourceMappingURL=sync-connections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-connections.js","sourceRoot":"","sources":["../../server/controllers/sync-connections.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync-connections.js","sourceRoot":"","sources":["../../server/controllers/sync-connections.ts"],"names":[],"mappings":";;AAGA,0CAEC;AALD,iDAA8C;AAGvC,KAAK,UAAU,eAAe,CAAC,WAAyB,EAAE,OAAwB;IACvF,cAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAA;AACjD,CAAC","sourcesContent":["import { pubsub } from '@things-factory/shell'\nimport { Connection } from '@things-factory/integration-base'\n\nexport async function syncConnections(connections: Connection[], context: ResolverContext): Promise<any> {\n pubsub.publish('sync-connections', connections)\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Connector, InputConnection } from '@things-factory/integration-base';
|
|
2
|
+
/**
|
|
3
|
+
* This connector only serves the role of a tag specifying that a particular step of the task will be performed on the Edge Server,
|
|
4
|
+
* and therefore, contains no special logic.
|
|
5
|
+
*/
|
|
6
|
+
export declare class EdgeConnector implements Connector {
|
|
7
|
+
ready(connectionConfigs: InputConnection[]): Promise<void>;
|
|
8
|
+
connect(connection: InputConnection): Promise<void>;
|
|
9
|
+
disconnect(connection: InputConnection): Promise<void>;
|
|
10
|
+
get parameterSpec(): any[];
|
|
11
|
+
get taskPrefixes(): any[];
|
|
12
|
+
get help(): string;
|
|
13
|
+
get description(): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './connector/edge-connector';
|
|
@@ -13,6 +13,7 @@ let EdgeClientMutation = class EdgeClientMutation {
|
|
|
13
13
|
return true;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
+
exports.EdgeClientMutation = EdgeClientMutation;
|
|
16
17
|
tslib_1.__decorate([
|
|
17
18
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To receive the result of runTask' }),
|
|
18
19
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('result', type => edge_client_type_1.RunTaskCallbackInput)),
|
|
@@ -21,8 +22,7 @@ tslib_1.__decorate([
|
|
|
21
22
|
tslib_1.__metadata("design:paramtypes", [edge_client_type_1.RunTaskCallbackInput, Object]),
|
|
22
23
|
tslib_1.__metadata("design:returntype", Promise)
|
|
23
24
|
], EdgeClientMutation.prototype, "runTaskCallback", null);
|
|
24
|
-
EdgeClientMutation = tslib_1.__decorate([
|
|
25
|
+
exports.EdgeClientMutation = EdgeClientMutation = tslib_1.__decorate([
|
|
25
26
|
(0, type_graphql_1.Resolver)(auth_base_1.Appliance)
|
|
26
27
|
], EdgeClientMutation);
|
|
27
|
-
exports.EdgeClientMutation = EdgeClientMutation;
|
|
28
28
|
//# sourceMappingURL=edge-client-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-client-mutation.js","sourceRoot":"","sources":["../../../server/service/appliance/edge-client-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,yDAAqD;AACrD,6DAAyD;AAEzD,yDAAyD;AAGlD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEvB,AAAN,KAAK,CAAC,eAAe,CAA8C,MAA4B,EAAS,OAAwB;QAC9H,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;QAEvC,MAAM,IAAA,yBAAW,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;QAExD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;
|
|
1
|
+
{"version":3,"file":"edge-client-mutation.js","sourceRoot":"","sources":["../../../server/service/appliance/edge-client-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,yDAAqD;AACrD,6DAAyD;AAEzD,yDAAyD;AAGlD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEvB,AAAN,KAAK,CAAC,eAAe,CAA8C,MAA4B,EAAS,OAAwB;QAC9H,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;QAEvC,MAAM,IAAA,yBAAW,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;QAExD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AATY,gDAAkB;AAEvB;IADL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IAC3D,mBAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,uCAAoB,CAAC,CAAA;IAAgC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAA5B,uCAAoB;;yDAM9F;6BARU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,qBAAS,CAAC;GACP,kBAAkB,CAS9B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\n\nimport { Appliance } from '@things-factory/auth-base'\nimport { releaseLock } from '@things-factory/lock-client'\n\nimport { RunTaskCallbackInput } from './edge-client-type'\n\n@Resolver(Appliance)\nexport class EdgeClientMutation {\n @Mutation(returns => Boolean, { description: 'To receive the result of runTask' })\n async runTaskCallback(@Arg('result', type => RunTaskCallbackInput) result: RunTaskCallbackInput, @Ctx() context: ResolverContext): Promise<boolean> {\n const { id, out, logs, error } = result\n\n await releaseLock({ id, payload: { out, logs, error } })\n\n return true\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Connection } from '@things-factory/integration-base';
|
|
2
|
+
import { RunTaskPayload } from './edge-client-type';
|
|
3
|
+
export declare class EdgeClientSubscription {
|
|
4
|
+
syncConnections(payload: Connection[]): Connection[];
|
|
5
|
+
connectConnections(payload: Connection[]): Connection[];
|
|
6
|
+
disconnectConnections(payload: Connection[]): Connection[];
|
|
7
|
+
runTask(payload: RunTaskPayload): RunTaskPayload;
|
|
8
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a;
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.EdgeClientSubscription = void 0;
|
|
5
4
|
const tslib_1 = require("tslib");
|
|
@@ -29,7 +28,7 @@ let EdgeClientSubscription = class EdgeClientSubscription {
|
|
|
29
28
|
const { id, step, context } = payload;
|
|
30
29
|
const { name, task, description, connection, params } = step;
|
|
31
30
|
return {
|
|
32
|
-
id,
|
|
31
|
+
id, // requestId
|
|
33
32
|
step: {
|
|
34
33
|
name,
|
|
35
34
|
task,
|
|
@@ -41,6 +40,7 @@ let EdgeClientSubscription = class EdgeClientSubscription {
|
|
|
41
40
|
};
|
|
42
41
|
}
|
|
43
42
|
};
|
|
43
|
+
exports.EdgeClientSubscription = EdgeClientSubscription;
|
|
44
44
|
tslib_1.__decorate([
|
|
45
45
|
(0, type_graphql_1.Subscription)(type => [integration_base_1.Connection], {
|
|
46
46
|
subscribe: async ({ args, context, info }) => {
|
|
@@ -161,7 +161,7 @@ tslib_1.__decorate([
|
|
|
161
161
|
}),
|
|
162
162
|
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
163
163
|
tslib_1.__metadata("design:type", Function),
|
|
164
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
164
|
+
tslib_1.__metadata("design:paramtypes", [Array]),
|
|
165
165
|
tslib_1.__metadata("design:returntype", Array)
|
|
166
166
|
], EdgeClientSubscription.prototype, "disconnectConnections", null);
|
|
167
167
|
tslib_1.__decorate([
|
|
@@ -203,8 +203,7 @@ tslib_1.__decorate([
|
|
|
203
203
|
tslib_1.__metadata("design:paramtypes", [edge_client_type_1.RunTaskPayload]),
|
|
204
204
|
tslib_1.__metadata("design:returntype", edge_client_type_1.RunTaskPayload)
|
|
205
205
|
], EdgeClientSubscription.prototype, "runTask", null);
|
|
206
|
-
EdgeClientSubscription = tslib_1.__decorate([
|
|
206
|
+
exports.EdgeClientSubscription = EdgeClientSubscription = tslib_1.__decorate([
|
|
207
207
|
(0, type_graphql_1.Resolver)(auth_base_1.Appliance)
|
|
208
208
|
], EdgeClientSubscription);
|
|
209
|
-
exports.EdgeClientSubscription = EdgeClientSubscription;
|
|
210
209
|
//# sourceMappingURL=edge-client-subscription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-client-subscription.js","sourceRoot":"","sources":["../../../server/service/appliance/edge-client-subscription.ts"],"names":[],"mappings":";;;;;AAAA,+CAA2C;AAC3C,+CAAgE;AAEhE,iDAAqE;AACrE,yDAA2D;AAC3D,uEAAsF;AAEtF,yDAAgE;AAGzD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAqDjC,eAAe,CAAS,OAAqB;QAC3C,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YAC9B,uCACK,UAAU,KACb,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,IAC1C;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IA8CD,kBAAkB,CAAS,OAAqB;QAC9C,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YAC9B,uCACK,UAAU,KACb,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,IAC1C;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IA8CD,qBAAqB,CAAS,OAAmB;QAC/C,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YAC9B,uCACK,UAAU,KACb,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,IAC1C;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IA8CD,OAAO,CAAS,OAAuB;QACrC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAA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from 'type-graphql'\n\nimport { pubsub, getRepository, Domain } from '@things-factory/shell'\nimport { Appliance, User } from '@things-factory/auth-base'\nimport { ConnectionManager, Connection, Step } from '@things-factory/integration-base'\n\nimport { EdgeContext, RunTaskPayload } from './edge-client-type'\n\n@Resolver(Appliance)\nexport class EdgeClientSubscription {\n @Subscription(type => [Connection], {\n subscribe: async ({ args, context, info }) => {\n const { domain, user }: { domain: Domain; user: User } = context.state\n const subdomain = domain?.subdomain\n\n if (!domain) {\n throw new Error('domain required')\n }\n\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n const appliance =\n user.reference &&\n (await getRepository(Appliance).findOne({\n where: {\n id: user.reference\n }\n }))\n\n if (!appliance) {\n throw new Error('Appliance not found')\n }\n\n process.nextTick(async () => {\n const connections = Object.values(ConnectionManager.getConnectionInstanceEntities(domain)).filter(({ edgeId }) => edgeId == appliance.id)\n\n if (connections.length > 0) {\n pubsub.publish('sync-connections', connections)\n }\n })\n\n return pipe(\n pubsub.subscribe('sync-connections'),\n filter(async (payload: Connection[]) => {\n const connections = payload\n const { edgeId } = connections[0]\n\n if (connections.find(connection => connection.domain?.subdomain !== subdomain)) {\n return false\n }\n\n if (!edgeId || appliance?.id !== edgeId) {\n return false\n }\n\n return true\n })\n )\n }\n })\n syncConnections(@Root() payload: Connection[]): Connection[] {\n return payload.map(connection => {\n return {\n ...connection,\n params: JSON.stringify(connection.params)\n }\n })\n }\n\n @Subscription(type => [Connection], {\n subscribe: async ({ args, context, info }) => {\n const { domain, user }: { domain: Domain; user: User } = context.state\n const subdomain = domain?.subdomain\n\n if (!domain) {\n throw new Error('domain required')\n }\n\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n const appliance =\n user.reference &&\n (await getRepository(Appliance).findOne({\n where: {\n id: user.reference\n }\n }))\n\n if (!appliance) {\n throw new Error('Appliance not found')\n }\n\n return pipe(\n pubsub.subscribe('connect-connections'),\n filter(async (payload: Connection[]) => {\n const connections = payload\n const { edgeId } = connections[0]\n\n if (connections.find(connection => connection.domain?.subdomain !== subdomain)) {\n return false\n }\n\n if (!edgeId || appliance?.id !== edgeId) {\n return false\n }\n\n return true\n })\n )\n }\n })\n connectConnections(@Root() payload: Connection[]): Connection[] {\n return payload.map(connection => {\n return {\n ...connection,\n params: JSON.stringify(connection.params)\n }\n })\n }\n\n @Subscription(type => [Connection], {\n subscribe: async ({ args, context, info }) => {\n const { domain, user }: { domain: Domain; user: User } = context.state\n const subdomain = domain?.subdomain\n\n if (!domain) {\n throw new Error('domain required')\n }\n\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n const appliance =\n user.reference &&\n (await getRepository(Appliance).findOne({\n where: {\n id: user.reference\n }\n }))\n\n if (!appliance) {\n throw new Error('Appliance not found')\n }\n\n return pipe(\n pubsub.subscribe('disconnect-connections'),\n filter(async (payload: Connection[]) => {\n const connections = payload\n const { edgeId } = connections[0]\n\n if (connections.find(connection => connection.domain?.subdomain !== subdomain)) {\n return false\n }\n\n if (!edgeId || appliance?.id !== edgeId) {\n return false\n }\n\n return true\n })\n )\n }\n })\n disconnectConnections(@Root() payload: Connection): Connection[] {\n return payload.map(connection => {\n return {\n ...connection,\n params: JSON.stringify(connection.params)\n }\n })\n }\n\n @Subscription({\n subscribe: async ({ args, context, info }) => {\n const { domain, user }: { domain: Domain; user: User } = context.state\n\n const subdomain = domain?.subdomain\n if (!domain) {\n throw new Error('domain required')\n }\n\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n const appliance =\n user.reference &&\n (await getRepository(Appliance).findOne({\n where: {\n id: user.reference\n }\n }))\n\n if (!appliance) {\n throw new Error('Appliance not found')\n }\n return pipe(\n pubsub.subscribe('run-task'),\n filter(async (payload: { id: string; step: Step; context: EdgeContext }) => {\n const { domainId, connection } = payload.step\n\n if (domainId !== domain.id) {\n return false\n }\n\n const { edgeId } = connection && ConnectionManager.getConnectionInstanceEntityByName(domain, connection)\n\n if (!edgeId || appliance?.id !== edgeId) {\n return false\n }\n\n return true\n })\n )\n }\n })\n runTask(@Root() payload: RunTaskPayload): RunTaskPayload {\n const { id, step, context } = payload\n const { name, task, description, connection, params } = step\n\n return {\n id, // requestId\n step: {\n name,\n task,\n description,\n connection,\n params: JSON.stringify(params)\n },\n context\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"edge-client-subscription.js","sourceRoot":"","sources":["../../../server/service/appliance/edge-client-subscription.ts"],"names":[],"mappings":";;;;AAAA,+CAA2C;AAC3C,+CAAgE;AAEhE,iDAAqE;AACrE,yDAA2D;AAC3D,uEAAsF;AAEtF,yDAAgE;AAGzD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAuDjC,eAAe,CAAS,OAAqB;QAC3C,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YAC9B,uCACK,UAAU,KACb,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,IAC1C;QACH,CAAC,CAAQ,CAAA;IACX,CAAC;IA8CD,kBAAkB,CAAS,OAAqB;QAC9C,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YAC9B,uCACK,UAAU,KACb,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,IAC1C;QACH,CAAC,CAAQ,CAAA;IACX,CAAC;IA8CD,qBAAqB,CAAS,OAAqB;QACjD,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YAC9B,uCACK,UAAU,KACb,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MA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I,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,EAAE,MAAK,MAAM,EAAE,CAAC;oBACxC,OAAO,KAAK,CAAA;gBACd,CAAC;gBAED,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CACH,CAAA;QACH,CAAC;KACF,CAAC;IACO,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,iCAAc;4CAAG,iCAAc;qDAevD;iCArOU,sBAAsB;IADlC,IAAA,uBAAQ,EAAC,qBAAS,CAAC;GACP,sBAAsB,CAsOlC","sourcesContent":["import { filter, pipe } from 'graphql-yoga'\nimport { Resolver, Subscription, Root, Arg } from 'type-graphql'\n\nimport { pubsub, getRepository, Domain } from '@things-factory/shell'\nimport { Appliance, User } from '@things-factory/auth-base'\nimport { ConnectionManager, Connection, Step } from '@things-factory/integration-base'\n\nimport { EdgeContext, RunTaskPayload } from './edge-client-type'\n\n@Resolver(Appliance)\nexport class EdgeClientSubscription {\n @Subscription(type => [Connection], {\n subscribe: async ({ args, context, info }) => {\n const { domain, user }: { domain: Domain; user: User } = context.state\n const subdomain = domain?.subdomain\n\n if (!domain) {\n throw new Error('domain required')\n }\n\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n const appliance =\n user.reference &&\n (await getRepository(Appliance).findOne({\n where: {\n id: user.reference\n }\n }))\n\n if (!appliance) {\n throw new Error('Appliance not found')\n }\n\n process.nextTick(async () => {\n const connections = Object.values(ConnectionManager.getConnectionInstanceEntities(domain)).filter(\n ({ edgeId }) => edgeId == appliance.id\n )\n\n if (connections.length > 0) {\n pubsub.publish('sync-connections', connections)\n }\n })\n\n return pipe(\n pubsub.subscribe('sync-connections'),\n filter(async (payload: Connection[]) => {\n const connections = payload\n const { edgeId } = connections[0]\n\n if (connections.find(connection => connection.domain?.subdomain !== subdomain)) {\n return false\n }\n\n if (!edgeId || appliance?.id !== edgeId) {\n return false\n }\n\n return true\n })\n )\n }\n })\n syncConnections(@Root() payload: Connection[]): Connection[] {\n return payload.map(connection => {\n return {\n ...connection,\n params: JSON.stringify(connection.params)\n }\n }) as any\n }\n\n @Subscription(type => [Connection], {\n subscribe: async ({ args, context, info }) => {\n const { domain, user }: { domain: Domain; user: User } = context.state\n const subdomain = domain?.subdomain\n\n if (!domain) {\n throw new Error('domain required')\n }\n\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n const appliance =\n user.reference &&\n (await getRepository(Appliance).findOne({\n where: {\n id: user.reference\n }\n }))\n\n if (!appliance) {\n throw new Error('Appliance not found')\n }\n\n return pipe(\n pubsub.subscribe('connect-connections'),\n filter(async (payload: Connection[]) => {\n const connections = payload\n const { edgeId } = connections[0]\n\n if (connections.find(connection => connection.domain?.subdomain !== subdomain)) {\n return false\n }\n\n if (!edgeId || appliance?.id !== edgeId) {\n return false\n }\n\n return true\n })\n )\n }\n })\n connectConnections(@Root() payload: Connection[]): Connection[] {\n return payload.map(connection => {\n return {\n ...connection,\n params: JSON.stringify(connection.params)\n }\n }) as any\n }\n\n @Subscription(type => [Connection], {\n subscribe: async ({ args, context, info }) => {\n const { domain, user }: { domain: Domain; user: User } = context.state\n const subdomain = domain?.subdomain\n\n if (!domain) {\n throw new Error('domain required')\n }\n\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n const appliance =\n user.reference &&\n (await getRepository(Appliance).findOne({\n where: {\n id: user.reference\n }\n }))\n\n if (!appliance) {\n throw new Error('Appliance not found')\n }\n\n return pipe(\n pubsub.subscribe('disconnect-connections'),\n filter(async (payload: Connection[]) => {\n const connections = payload\n const { edgeId } = connections[0]\n\n if (connections.find(connection => connection.domain?.subdomain !== subdomain)) {\n return false\n }\n\n if (!edgeId || appliance?.id !== edgeId) {\n return false\n }\n\n return true\n })\n )\n }\n })\n disconnectConnections(@Root() payload: Connection[]): Connection[] {\n return payload.map(connection => {\n return {\n ...connection,\n params: JSON.stringify(connection.params)\n }\n }) as any\n }\n\n @Subscription({\n subscribe: async ({ args, context, info }) => {\n const { domain, user }: { domain: Domain; user: User } = context.state\n\n const subdomain = domain?.subdomain\n if (!domain) {\n throw new Error('domain required')\n }\n\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n const appliance =\n user.reference &&\n (await getRepository(Appliance).findOne({\n where: {\n id: user.reference\n }\n }))\n\n if (!appliance) {\n throw new Error('Appliance not found')\n }\n return pipe(\n pubsub.subscribe('run-task'),\n filter(async (payload: { id: string; step: Step; context: EdgeContext }) => {\n const { domainId, connection } = payload.step\n\n if (domainId !== domain.id) {\n return false\n }\n\n const { edgeId } = connection && ConnectionManager.getConnectionInstanceEntityByName(domain, connection)\n\n if (!edgeId || appliance?.id !== edgeId) {\n return false\n }\n\n return true\n })\n )\n }\n })\n runTask(@Root() payload: RunTaskPayload): RunTaskPayload {\n const { id, step, context } = payload\n const { name, task, description, connection, params } = step\n\n return {\n id, // requestId\n step: {\n name,\n task,\n description,\n connection,\n params: JSON.stringify(params)\n },\n context\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Step } from '@things-factory/integration-base';
|
|
2
|
+
export declare class EdgeContext {
|
|
3
|
+
domain: any;
|
|
4
|
+
data: any;
|
|
5
|
+
variables: any;
|
|
6
|
+
lng: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class RunTaskPayload {
|
|
9
|
+
id: string;
|
|
10
|
+
step: Step;
|
|
11
|
+
context: EdgeContext;
|
|
12
|
+
}
|
|
13
|
+
export declare class RunTaskCallbackInput {
|
|
14
|
+
id: string;
|
|
15
|
+
out: any;
|
|
16
|
+
logs: any;
|
|
17
|
+
error: any;
|
|
18
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a;
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.RunTaskCallbackInput = exports.RunTaskPayload = exports.EdgeContext = void 0;
|
|
5
4
|
const tslib_1 = require("tslib");
|
|
@@ -8,6 +7,7 @@ const shell_1 = require("@things-factory/shell");
|
|
|
8
7
|
const integration_base_1 = require("@things-factory/integration-base");
|
|
9
8
|
let EdgeContext = class EdgeContext {
|
|
10
9
|
};
|
|
10
|
+
exports.EdgeContext = EdgeContext;
|
|
11
11
|
tslib_1.__decorate([
|
|
12
12
|
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true }),
|
|
13
13
|
tslib_1.__metadata("design:type", Object)
|
|
@@ -24,30 +24,30 @@ tslib_1.__decorate([
|
|
|
24
24
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
25
25
|
tslib_1.__metadata("design:type", String)
|
|
26
26
|
], EdgeContext.prototype, "lng", void 0);
|
|
27
|
-
EdgeContext = tslib_1.__decorate([
|
|
27
|
+
exports.EdgeContext = EdgeContext = tslib_1.__decorate([
|
|
28
28
|
(0, type_graphql_1.ObjectType)()
|
|
29
29
|
], EdgeContext);
|
|
30
|
-
exports.EdgeContext = EdgeContext;
|
|
31
30
|
let RunTaskPayload = class RunTaskPayload {
|
|
32
31
|
};
|
|
32
|
+
exports.RunTaskPayload = RunTaskPayload;
|
|
33
33
|
tslib_1.__decorate([
|
|
34
34
|
(0, type_graphql_1.Field)(),
|
|
35
35
|
tslib_1.__metadata("design:type", String)
|
|
36
36
|
], RunTaskPayload.prototype, "id", void 0);
|
|
37
37
|
tslib_1.__decorate([
|
|
38
38
|
(0, type_graphql_1.Field)(),
|
|
39
|
-
tslib_1.__metadata("design:type",
|
|
39
|
+
tslib_1.__metadata("design:type", integration_base_1.Step)
|
|
40
40
|
], RunTaskPayload.prototype, "step", void 0);
|
|
41
41
|
tslib_1.__decorate([
|
|
42
42
|
(0, type_graphql_1.Field)(),
|
|
43
43
|
tslib_1.__metadata("design:type", EdgeContext)
|
|
44
44
|
], RunTaskPayload.prototype, "context", void 0);
|
|
45
|
-
RunTaskPayload = tslib_1.__decorate([
|
|
45
|
+
exports.RunTaskPayload = RunTaskPayload = tslib_1.__decorate([
|
|
46
46
|
(0, type_graphql_1.ObjectType)()
|
|
47
47
|
], RunTaskPayload);
|
|
48
|
-
exports.RunTaskPayload = RunTaskPayload;
|
|
49
48
|
let RunTaskCallbackInput = class RunTaskCallbackInput {
|
|
50
49
|
};
|
|
50
|
+
exports.RunTaskCallbackInput = RunTaskCallbackInput;
|
|
51
51
|
tslib_1.__decorate([
|
|
52
52
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
53
53
|
tslib_1.__metadata("design:type", String)
|
|
@@ -64,8 +64,7 @@ tslib_1.__decorate([
|
|
|
64
64
|
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
|
65
65
|
tslib_1.__metadata("design:type", Object)
|
|
66
66
|
], RunTaskCallbackInput.prototype, "error", void 0);
|
|
67
|
-
RunTaskCallbackInput = tslib_1.__decorate([
|
|
67
|
+
exports.RunTaskCallbackInput = RunTaskCallbackInput = tslib_1.__decorate([
|
|
68
68
|
(0, type_graphql_1.InputType)()
|
|
69
69
|
], RunTaskCallbackInput);
|
|
70
|
-
exports.RunTaskCallbackInput = RunTaskCallbackInput;
|
|
71
70
|
//# sourceMappingURL=edge-client-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-client-type.js","sourceRoot":"","sources":["../../../server/service/appliance/edge-client-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"edge-client-type.js","sourceRoot":"","sources":["../../../server/service/appliance/edge-client-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAE3D,iDAA4D;AAC5D,uEAAuD;AAGhD,IAAM,WAAW,GAAjB,MAAM,WAAW;CAYvB,CA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AXC,oBAAoB;IADhC,IAAA,wBAAS,GAAE;GACC,oBAAoB,CAYhC","sourcesContent":["import { InputType, ObjectType, Field } from 'type-graphql'\n\nimport { Domain, ScalarObject } from '@things-factory/shell'\nimport { Step } from '@things-factory/integration-base'\n\n@ObjectType()\nexport class EdgeContext {\n @Field(type => Domain, { nullable: true })\n domain: any\n\n @Field(type => ScalarObject, { nullable: true })\n data: any\n\n @Field(type => ScalarObject, { nullable: true })\n variables: any\n\n @Field({ nullable: true })\n lng: string\n}\n\n@ObjectType()\nexport class RunTaskPayload {\n @Field()\n id: string\n\n @Field()\n step: Step\n\n @Field()\n context: EdgeContext\n}\n\n@InputType()\nexport class RunTaskCallbackInput {\n @Field({ nullable: true })\n id: string\n\n @Field(type => ScalarObject, { nullable: true })\n out: any\n\n @Field(type => ScalarObject, { nullable: true })\n logs: any\n\n @Field(type => ScalarObject, { nullable: true })\n error: any\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EdgeClientMutation } from './edge-client-mutation';
|
|
2
|
+
import { EdgeClientSubscription } from './edge-client-subscription';
|
|
3
|
+
export declare const entities: any[];
|
|
4
|
+
export declare const resolvers: (typeof EdgeClientMutation | typeof EdgeClientSubscription)[];
|
|
5
|
+
export declare const subscribers: any[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const entities: any[];
|
|
2
|
+
export declare const subscribers: any[];
|
|
3
|
+
export declare const schema: {
|
|
4
|
+
resolverClasses: (typeof import("./appliance/edge-client-mutation").EdgeClientMutation | typeof import("./appliance/edge-client-subscription").EdgeClientSubscription)[];
|
|
5
|
+
};
|