@things-factory/integration-base 7.0.1-beta.0 → 7.0.1-beta.10
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/index.d.ts +1 -0
- package/dist-server/controllers/scenario-controller.d.ts +4 -0
- package/dist-server/controllers/scenario-controller.js.map +1 -1
- package/dist-server/engine/analyzer/analyze-integration.d.ts +5 -0
- package/dist-server/engine/analyzer/analyze-integration.js.map +1 -1
- package/dist-server/engine/connection-manager.d.ts +35 -0
- package/dist-server/engine/connection-manager.js.map +1 -1
- package/dist-server/engine/connector/echo-back-connector.d.ts +9 -0
- package/dist-server/engine/connector/echo-back-connector.js.map +1 -1
- package/dist-server/engine/connector/echo-back-server.d.ts +8 -0
- package/dist-server/engine/connector/echo-back-server.js.map +1 -1
- package/dist-server/engine/connector/graphql-connector.d.ts +19 -0
- package/dist-server/engine/connector/graphql-connector.js +1 -1
- package/dist-server/engine/connector/graphql-connector.js.map +1 -1
- package/dist-server/engine/connector/http-connector.d.ts +25 -0
- package/dist-server/engine/connector/http-connector.js.map +1 -1
- package/dist-server/engine/connector/index.d.ts +12 -0
- package/dist-server/engine/connector/mqtt-connector.d.ts +14 -0
- package/dist-server/engine/connector/mqtt-connector.js.map +1 -1
- package/dist-server/engine/connector/mssql-connector.d.ts +30 -0
- package/dist-server/engine/connector/mssql-connector.js +20 -4
- package/dist-server/engine/connector/mssql-connector.js.map +1 -1
- package/dist-server/engine/connector/mysql-connector.d.ts +13 -0
- package/dist-server/engine/connector/mysql-connector.js.map +1 -1
- package/dist-server/engine/connector/operato-connector.d.ts +27 -0
- package/dist-server/engine/connector/operato-connector.js +1 -1
- package/dist-server/engine/connector/operato-connector.js.map +1 -1
- package/dist-server/engine/connector/oracle-connector.d.ts +29 -0
- package/dist-server/engine/connector/oracle-connector.js.map +1 -1
- package/dist-server/engine/connector/postgresql-connector.d.ts +14 -0
- package/dist-server/engine/connector/postgresql-connector.js.map +1 -1
- package/dist-server/engine/connector/proxy-connector.d.ts +15 -0
- package/dist-server/engine/connector/socket-server.d.ts +9 -0
- package/dist-server/engine/connector/socket-server.js.map +1 -1
- package/dist-server/engine/connector/sqlite-connector.d.ts +10 -0
- package/dist-server/engine/connector/sqlite-connector.js.map +1 -1
- package/dist-server/engine/edge-client.d.ts +18 -0
- package/dist-server/engine/index.d.ts +8 -0
- package/dist-server/engine/index.js.map +1 -1
- package/dist-server/engine/pending-queue.d.ts +24 -0
- package/dist-server/engine/pending-queue.js.map +1 -1
- package/dist-server/engine/scenario-engine.d.ts +11 -0
- package/dist-server/engine/scenario-engine.js.map +1 -1
- package/dist-server/engine/task/book-up-scenario.d.ts +1 -0
- package/dist-server/engine/task/csv-readline.d.ts +1 -0
- package/dist-server/engine/task/csv-readline.js.map +1 -1
- package/dist-server/engine/task/data-accessor.d.ts +1 -0
- package/dist-server/engine/task/data-mapper.d.ts +1 -0
- package/dist-server/engine/task/data-mapper.js.map +1 -1
- package/dist-server/engine/task/database-query.d.ts +1 -0
- package/dist-server/engine/task/echo-receive.d.ts +1 -0
- package/dist-server/engine/task/echo-send.d.ts +1 -0
- package/dist-server/engine/task/echo-send.js.map +1 -1
- package/dist-server/engine/task/empty-check.d.ts +1 -0
- package/dist-server/engine/task/empty-check.js.map +1 -1
- package/dist-server/engine/task/end.d.ts +1 -0
- package/dist-server/engine/task/floating-point.d.ts +1 -0
- package/dist-server/engine/task/floating-point.js.map +1 -1
- package/dist-server/engine/task/goto.d.ts +1 -0
- package/dist-server/engine/task/graphql-mutate.d.ts +1 -0
- package/dist-server/engine/task/graphql-query.d.ts +1 -0
- package/dist-server/engine/task/headless-post.d.ts +1 -0
- package/dist-server/engine/task/headless-post.js.map +1 -1
- package/dist-server/engine/task/headless-scrap.d.ts +1 -0
- package/dist-server/engine/task/headless-scrap.js.map +1 -1
- package/dist-server/engine/task/http-get.d.ts +1 -0
- package/dist-server/engine/task/http-get.js.map +1 -1
- package/dist-server/engine/task/http-post.d.ts +1 -0
- package/dist-server/engine/task/http-post.js.map +1 -1
- package/dist-server/engine/task/index.d.ts +43 -0
- package/dist-server/engine/task/jsonata.d.ts +1 -0
- package/dist-server/engine/task/local-graphql-mutate.d.ts +1 -0
- package/dist-server/engine/task/local-graphql-mutate.js.map +1 -1
- package/dist-server/engine/task/local-graphql-query.d.ts +1 -0
- package/dist-server/engine/task/local-graphql-query.js.map +1 -1
- package/dist-server/engine/task/log.d.ts +1 -0
- package/dist-server/engine/task/log.js.map +1 -1
- package/dist-server/engine/task/mqtt-publish.d.ts +1 -0
- package/dist-server/engine/task/mqtt-publish.js.map +1 -1
- package/dist-server/engine/task/mqtt-subscribe.d.ts +1 -0
- package/dist-server/engine/task/mqtt-subscribe.js.map +1 -1
- package/dist-server/engine/task/oracle-procedure.d.ts +1 -0
- package/dist-server/engine/task/oracle-procedure.js.map +1 -1
- package/dist-server/engine/task/pick-pending-scenario.d.ts +1 -0
- package/dist-server/engine/task/pick-pending-scenario.js.map +1 -1
- package/dist-server/engine/task/publish.d.ts +1 -0
- package/dist-server/engine/task/publish.js.map +1 -1
- package/dist-server/engine/task/random.d.ts +1 -0
- package/dist-server/engine/task/reset-pending-queue.d.ts +1 -0
- package/dist-server/engine/task/script.d.ts +1 -0
- package/dist-server/engine/task/set-domain.d.ts +1 -0
- package/dist-server/engine/task/set-domain.js.map +1 -1
- package/dist-server/engine/task/sleep.d.ts +1 -0
- package/dist-server/engine/task/sleep.js.map +1 -1
- package/dist-server/engine/task/socket-listener.d.ts +1 -0
- package/dist-server/engine/task/socket-listener.js.map +1 -1
- package/dist-server/engine/task/state-read.d.ts +1 -0
- package/dist-server/engine/task/state-read.js.map +1 -1
- package/dist-server/engine/task/state-write.d.ts +1 -0
- package/dist-server/engine/task/state-write.js.map +1 -1
- package/dist-server/engine/task/stop-scenario.d.ts +1 -0
- package/dist-server/engine/task/sub-scenario.d.ts +1 -0
- package/dist-server/engine/task/switch-goto.d.ts +1 -0
- package/dist-server/engine/task/switch-range-goto.d.ts +1 -0
- package/dist-server/engine/task/switch-range-goto.js.map +1 -1
- package/dist-server/engine/task/switch-range-scenario.d.ts +1 -0
- package/dist-server/engine/task/switch-range-scenario.js.map +1 -1
- package/dist-server/engine/task/switch-range-set.d.ts +1 -0
- package/dist-server/engine/task/switch-range-set.js.map +1 -1
- package/dist-server/engine/task/switch-scenario.d.ts +1 -0
- package/dist-server/engine/task/switch-set.d.ts +1 -0
- package/dist-server/engine/task/throw.d.ts +1 -0
- package/dist-server/engine/task/utils/headless-pool-for-scenario.d.ts +1 -0
- package/dist-server/engine/task/utils/headless-pool-for-scenario.js.map +1 -1
- package/dist-server/engine/task/utils/substitute.d.ts +1 -0
- package/dist-server/engine/task/utils/substitute.js.map +1 -1
- package/dist-server/engine/task/variables.d.ts +1 -0
- package/dist-server/engine/task-registry.d.ts +12 -0
- package/dist-server/engine/types.d.ts +94 -0
- package/dist-server/index.d.ts +6 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/restful/index.d.ts +1 -0
- package/dist-server/restful/unstable/index.d.ts +7 -0
- package/dist-server/restful/unstable/run-scenario.d.ts +1 -0
- package/dist-server/restful/unstable/run-scenario.js.map +1 -1
- package/dist-server/restful/unstable/scenario-instance.d.ts +1 -0
- package/dist-server/restful/unstable/scenario-instances.d.ts +1 -0
- package/dist-server/restful/unstable/scenario.d.ts +1 -0
- package/dist-server/restful/unstable/scenarios.d.ts +1 -0
- package/dist-server/restful/unstable/start-scenario.d.ts +1 -0
- package/dist-server/restful/unstable/stop-scenario.d.ts +1 -0
- package/dist-server/routers/scenario-schedule-callback-router.d.ts +1 -0
- package/dist-server/routers/scenario-schedule-callback-router.js +1 -2
- package/dist-server/routers/scenario-schedule-callback-router.js.map +1 -1
- package/dist-server/routers/scenario-view-router.d.ts +1 -0
- package/dist-server/routers/scenario-view-router.js.map +1 -1
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/analysis/analysis-query.d.ts +3 -0
- package/dist-server/service/analysis/analysis-query.js +2 -2
- package/dist-server/service/analysis/analysis-query.js.map +1 -1
- package/dist-server/service/analysis/index.d.ts +2 -0
- package/dist-server/service/connection/connection-mutation.d.ts +30 -0
- package/dist-server/service/connection/connection-mutation.js +2 -2
- package/dist-server/service/connection/connection-mutation.js.map +1 -1
- package/dist-server/service/connection/connection-query.d.ts +12 -0
- package/dist-server/service/connection/connection-query.js +2 -2
- package/dist-server/service/connection/connection-query.js.map +1 -1
- package/dist-server/service/connection/connection-subscription.d.ts +10 -0
- package/dist-server/service/connection/connection-subscription.js +2 -2
- package/dist-server/service/connection/connection-subscription.js.map +1 -1
- package/dist-server/service/connection/connection-type.d.ts +133 -0
- package/dist-server/service/connection/connection-type.js +11 -11
- package/dist-server/service/connection/connection-type.js.map +1 -1
- package/dist-server/service/connection/index.d.ts +6 -0
- package/dist-server/service/connector/connector-query.d.ts +6 -0
- package/dist-server/service/connector/connector-query.js +2 -2
- package/dist-server/service/connector/connector-query.js.map +1 -1
- package/dist-server/service/connector/connector-type.d.ts +12 -0
- package/dist-server/service/connector/connector-type.js +4 -4
- package/dist-server/service/connector/connector-type.js.map +1 -1
- package/dist-server/service/connector/index.d.ts +3 -0
- package/dist-server/service/index.d.ts +17 -0
- package/dist-server/service/payload-log/index.d.ts +5 -0
- package/dist-server/service/payload-log/payload-log-mutation.d.ts +10 -0
- package/dist-server/service/payload-log/payload-log-mutation.js +2 -2
- package/dist-server/service/payload-log/payload-log-mutation.js.map +1 -1
- package/dist-server/service/payload-log/payload-log-query.d.ts +11 -0
- package/dist-server/service/payload-log/payload-log-query.js +2 -2
- package/dist-server/service/payload-log/payload-log-query.js.map +1 -1
- package/dist-server/service/payload-log/payload-log-type.d.ts +15 -0
- package/dist-server/service/payload-log/payload-log-type.js +6 -6
- package/dist-server/service/payload-log/payload-log-type.js.map +1 -1
- package/dist-server/service/payload-log/payload-log.d.ts +23 -0
- package/dist-server/service/payload-log/payload-log.js +3 -3
- package/dist-server/service/payload-log/payload-log.js.map +1 -1
- package/dist-server/service/property-spec.d.ts +12 -0
- package/dist-server/service/property-spec.js +2 -2
- package/dist-server/service/property-spec.js.map +1 -1
- package/dist-server/service/scenario/index.d.ts +5 -0
- package/dist-server/service/scenario/scenario-mutation.d.ts +13 -0
- package/dist-server/service/scenario/scenario-mutation.js +3 -3
- package/dist-server/service/scenario/scenario-mutation.js.map +1 -1
- package/dist-server/service/scenario/scenario-query.d.ts +18 -0
- package/dist-server/service/scenario/scenario-query.js +2 -2
- package/dist-server/service/scenario/scenario-query.js.map +1 -1
- package/dist-server/service/scenario/scenario-type.d.ts +28 -0
- package/dist-server/service/scenario/scenario-type.js +6 -6
- package/dist-server/service/scenario/scenario-type.js.map +1 -1
- package/dist-server/service/scenario/scenario.d.ts +26 -0
- package/dist-server/service/scenario/scenario.js +2 -2
- package/dist-server/service/scenario/scenario.js.map +1 -1
- package/dist-server/service/scenario-flow/scenario-flow.d.ts +6 -0
- package/dist-server/service/scenario-flow/scenario-flow.js +2 -2
- package/dist-server/service/scenario-flow/scenario-flow.js.map +1 -1
- package/dist-server/service/scenario-instance/index.d.ts +5 -0
- package/dist-server/service/scenario-instance/scenario-instance-mutation.d.ts +6 -0
- package/dist-server/service/scenario-instance/scenario-instance-mutation.js +2 -2
- package/dist-server/service/scenario-instance/scenario-instance-mutation.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-query.d.ts +12 -0
- package/dist-server/service/scenario-instance/scenario-instance-query.js +2 -2
- package/dist-server/service/scenario-instance/scenario-instance-query.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-subscription.d.ts +10 -0
- package/dist-server/service/scenario-instance/scenario-instance-subscription.js +2 -2
- package/dist-server/service/scenario-instance/scenario-instance-subscription.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-type.d.ts +78 -0
- package/dist-server/service/scenario-instance/scenario-instance-type.js +9 -9
- package/dist-server/service/scenario-instance/scenario-instance-type.js.map +1 -1
- package/dist-server/service/scenario-queue/index.d.ts +3 -0
- package/dist-server/service/scenario-queue/scenario-queue-subscription.d.ts +6 -0
- package/dist-server/service/scenario-queue/scenario-queue-subscription.js +2 -2
- package/dist-server/service/scenario-queue/scenario-queue-subscription.js.map +1 -1
- package/dist-server/service/scenario-queue/scenario-queue-type.d.ts +11 -0
- package/dist-server/service/scenario-queue/scenario-queue-type.js +4 -4
- package/dist-server/service/scenario-queue/scenario-queue-type.js.map +1 -1
- package/dist-server/service/state-register/index.d.ts +6 -0
- package/dist-server/service/state-register/state-register-mutation.d.ts +11 -0
- package/dist-server/service/state-register/state-register-mutation.js +2 -2
- package/dist-server/service/state-register/state-register-mutation.js.map +1 -1
- package/dist-server/service/state-register/state-register-query.d.ts +14 -0
- package/dist-server/service/state-register/state-register-query.js +2 -2
- package/dist-server/service/state-register/state-register-query.js.map +1 -1
- package/dist-server/service/state-register/state-register-type.d.ts +23 -0
- package/dist-server/service/state-register/state-register-type.js +6 -6
- package/dist-server/service/state-register/state-register-type.js.map +1 -1
- package/dist-server/service/state-register/state-register.d.ts +22 -0
- package/dist-server/service/state-register/state-register.js +2 -2
- package/dist-server/service/state-register/state-register.js.map +1 -1
- package/dist-server/service/step/index.d.ts +5 -0
- package/dist-server/service/step/step-mutation.d.ts +5 -0
- package/dist-server/service/step/step-mutation.js +2 -2
- package/dist-server/service/step/step-mutation.js.map +1 -1
- package/dist-server/service/step/step-query.d.ts +12 -0
- package/dist-server/service/step/step-query.js +2 -2
- package/dist-server/service/step/step-query.js.map +1 -1
- package/dist-server/service/step/step-type.d.ts +111 -0
- package/dist-server/service/step/step-type.js +6 -6
- package/dist-server/service/step/step-type.js.map +1 -1
- package/dist-server/service/task-type/index.d.ts +3 -0
- package/dist-server/service/task-type/task-type-query.d.ts +6 -0
- package/dist-server/service/task-type/task-type-query.js +2 -2
- package/dist-server/service/task-type/task-type-query.js.map +1 -1
- package/dist-server/service/task-type/task-type-type.d.ts +12 -0
- package/dist-server/service/task-type/task-type-type.js +4 -4
- package/dist-server/service/task-type/task-type-type.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/integration/connector/mssql-connector.ja.md +13 -9
- package/helps/integration/connector/mssql-connector.ko.md +13 -9
- package/helps/integration/connector/mssql-connector.md +13 -9
- package/helps/integration/connector/mssql-connector.ms.md +13 -9
- package/helps/integration/connector/mssql-connector.zh.md +13 -9
- package/helps/integration/connector/operato-connector.ja.md +0 -3
- package/package.json +10 -10
- package/server/engine/connector/mssql-connector.ts +20 -4
- package/server/engine/index.ts +1 -1
- package/server/routers/scenario-schedule-callback-router.ts +1 -1
- package/server/service/step/step-type.ts +20 -20
- package/translations/en.json +2 -1
- package/translations/ja.json +2 -1
- package/translations/ko.json +2 -1
- package/translations/ms.json +2 -1
- package/translations/zh.json +2 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"connection-subscription.js","sourceRoot":"","sources":["../../../server/service/connection/connection-subscription.ts"],"names":[],"mappings":";;;;AAAA,+CAA2C;AAC3C,+CAAgE;AAEhE,iDAAkE;AAElE,wEAAmE;AACnE,uDAAiF;AAEjF,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,oDAAoD,CAAC,CAAA;AAG7E,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAgDjC,eAAe,CAAS,OAA6C,EAAmC,IAAY;QAClH,OAAO,OAAO,CAAC,eAAe,CAAA;IAChC,CAAC;IAuCD,aAAa,CAAS,OAAqB,EAAoC,KAAa;QAC1F,OAAO,OAAO,CAAC,GAAG,CAAA;IACpB,CAAC;CACF,CAAA;
|
1
|
+
{"version":3,"file":"connection-subscription.js","sourceRoot":"","sources":["../../../server/service/connection/connection-subscription.ts"],"names":[],"mappings":";;;;AAAA,+CAA2C;AAC3C,+CAAgE;AAEhE,iDAAkE;AAElE,wEAAmE;AACnE,uDAAiF;AAEjF,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,oDAAo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,CAAA;;;4CAAiB,WAAG;2DAEjG;iCA3FU,sBAAsB;IADlC,IAAA,uBAAQ,EAAC,4BAAU,CAAC;GACR,sBAAsB,CA4FlC","sourcesContent":["import { filter, pipe } from 'graphql-yoga'\nimport { Arg, Resolver, Root, Subscription } from 'type-graphql'\n\nimport { getRepository, Log, pubsub } from '@things-factory/shell'\n\nimport { ConnectionManager } from '../../engine/connection-manager'\nimport { Connection, ConnectionState, ConnectionStatus } from './connection-type'\n\nconst debug = require('debug')('things-factory:integration:connection-subscription')\n\n@Resolver(Connection)\nexport class ConnectionSubscription {\n @Subscription({\n subscribe: ({ args, context, info }) => {\n const { domain, user } = context.state\n const { name } = args\n const subdomain = domain?.subdomain\n\n debug('subscribe', 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 process.nextTick(async () => {\n var where = { domain: { id: domain.id } }\n if (name) {\n where['name'] = name\n }\n\n var connections = await getRepository(Connection).find({\n where,\n relations: ['domain', 'edge']\n })\n\n connections.forEach(connection => {\n pubsub.publish('connection-state', {\n connectionState: {\n ...connection,\n state: ConnectionManager.getConnectionInstance(connection) ? ConnectionStatus.CONNECTED : ConnectionStatus.DISCONNECTED,\n timestamp: new Date()\n }\n })\n })\n })\n\n return pipe(\n pubsub.subscribe('connection-state'),\n filter(async (payload: { connectionState: ConnectionState }) => {\n const { domain: pdomain, name: pname } = payload.connectionState\n\n return (!name || name === pname) && subdomain === pdomain?.subdomain\n })\n )\n }\n })\n connectionState(@Root() payload: { connectionState: ConnectionState }, @Arg('name', { nullable: true }) name: string): ConnectionState {\n return payload.connectionState\n }\n\n @Subscription({\n subscribe: ({ args, context, info }) => {\n const { domain, user } = context.state\n const { level } = args\n\n const subdomain = domain?.subdomain\n\n debug('subscribe', 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 return pipe(\n pubsub.subscribe('connection-log'),\n filter(async (payload: { log: Log }) => {\n // TODO support domain filtering\n const { /* source, */ level: plevel } = payload.log\n // const { domain: pdomain } = source\n\n // if (subdomain !== pdomain?.subdomain) {\n // return false\n // }\n\n if (level && level !== plevel) {\n return false\n }\n\n return true\n })\n )\n }\n })\n connectionLog(@Root() payload: { log: Log }, @Arg('level', { nullable: true }) level: string): Log {\n return payload.log\n }\n}\n"]}
|
@@ -0,0 +1,133 @@
|
|
1
|
+
import { User, Appliance } from '@things-factory/auth-base';
|
2
|
+
import { Domain } from '@things-factory/shell';
|
3
|
+
export declare enum ConnectionStatus {
|
4
|
+
CONNECTED = "CONNECTED",
|
5
|
+
DISCONNECTED = "DISCONNECTED"
|
6
|
+
}
|
7
|
+
export declare class Connection {
|
8
|
+
/**
|
9
|
+
* Unique identifier for the connection, generated in UUID format.
|
10
|
+
*/
|
11
|
+
readonly id: string;
|
12
|
+
/**
|
13
|
+
* Many-to-One relationship with the Domain entity.
|
14
|
+
*/
|
15
|
+
domain: Domain;
|
16
|
+
/**
|
17
|
+
* Stores the ID of the associated Domain.
|
18
|
+
*/
|
19
|
+
domainId: string;
|
20
|
+
/**
|
21
|
+
* The name of the connection.
|
22
|
+
*/
|
23
|
+
name: string;
|
24
|
+
/**
|
25
|
+
* Optional description for the connection.
|
26
|
+
*/
|
27
|
+
description: string;
|
28
|
+
/**
|
29
|
+
* The type of the connection.
|
30
|
+
*/
|
31
|
+
type: string;
|
32
|
+
/**
|
33
|
+
* Many-to-One relationship with the Appliance entity which delegate the connection. Optional field.
|
34
|
+
*/
|
35
|
+
edge: Appliance;
|
36
|
+
/**
|
37
|
+
* Stores the ID of the Appliance who delegate the connection.
|
38
|
+
*/
|
39
|
+
edgeId: string;
|
40
|
+
/**
|
41
|
+
* The endpoint for the connection.
|
42
|
+
*/
|
43
|
+
endpoint: string;
|
44
|
+
/**
|
45
|
+
* Indicates the active status of the connection.
|
46
|
+
*/
|
47
|
+
active: boolean;
|
48
|
+
/**
|
49
|
+
* The status of the connection, using the ConnectionStatus type.
|
50
|
+
*/
|
51
|
+
state: ConnectionStatus;
|
52
|
+
/**
|
53
|
+
* Additional parameters for the connection, stored as a JSON string.
|
54
|
+
*/
|
55
|
+
params: string;
|
56
|
+
/**
|
57
|
+
* The date and time when the connection was created.
|
58
|
+
*/
|
59
|
+
createdAt: Date;
|
60
|
+
/**
|
61
|
+
* The date and time when the connection was last updated.
|
62
|
+
*/
|
63
|
+
updatedAt: Date;
|
64
|
+
/**
|
65
|
+
* Many-to-One relationship with the User entity who created the connection. Optional field.
|
66
|
+
*/
|
67
|
+
creator: User;
|
68
|
+
/**
|
69
|
+
* Stores the ID of the User who created the connection.
|
70
|
+
*/
|
71
|
+
creatorId: string;
|
72
|
+
/**
|
73
|
+
* Many-to-One relationship with the User entity who last updated the connection.
|
74
|
+
* Optional field.
|
75
|
+
*/
|
76
|
+
updater: User;
|
77
|
+
/**
|
78
|
+
* Stores the ID of the User who last updated the connection.
|
79
|
+
*
|
80
|
+
*/
|
81
|
+
updaterId: string;
|
82
|
+
/**
|
83
|
+
* Asynchronous method to establish the connection.
|
84
|
+
*
|
85
|
+
*/
|
86
|
+
connect(): Promise<void>;
|
87
|
+
/**
|
88
|
+
* @brief Asynchronous method to disconnect the connection.
|
89
|
+
*
|
90
|
+
*/
|
91
|
+
disconnect(): Promise<void>;
|
92
|
+
}
|
93
|
+
/**
|
94
|
+
* Connection의 params의 원 타입과 사용 시에 타입 불일치로 인해 임시적으로 생성한 타입으로
|
95
|
+
* 추후, 타입 일치를 통해서 제거할 예정임.
|
96
|
+
*
|
97
|
+
*/
|
98
|
+
export interface InputConnection extends Connection {
|
99
|
+
params: any;
|
100
|
+
}
|
101
|
+
export declare class ConnectionState {
|
102
|
+
domain?: Domain;
|
103
|
+
id?: string;
|
104
|
+
name?: string;
|
105
|
+
description?: string;
|
106
|
+
type?: string;
|
107
|
+
edge?: Appliance;
|
108
|
+
state?: ConnectionStatus;
|
109
|
+
timestamp?: Date;
|
110
|
+
}
|
111
|
+
export declare class NewConnection {
|
112
|
+
name: string;
|
113
|
+
description?: string;
|
114
|
+
type?: string;
|
115
|
+
edge?: Appliance;
|
116
|
+
endpoint?: string;
|
117
|
+
params?: string;
|
118
|
+
}
|
119
|
+
export declare class ConnectionPatch {
|
120
|
+
id: string;
|
121
|
+
name?: string;
|
122
|
+
description?: string;
|
123
|
+
type?: string;
|
124
|
+
edge?: Appliance;
|
125
|
+
endpoint?: string;
|
126
|
+
active?: boolean;
|
127
|
+
params?: string;
|
128
|
+
cuFlag?: string;
|
129
|
+
}
|
130
|
+
export declare class ConnectionList {
|
131
|
+
items: Connection[];
|
132
|
+
total: number;
|
133
|
+
}
|
@@ -13,7 +13,7 @@ var ConnectionStatus;
|
|
13
13
|
(function (ConnectionStatus) {
|
14
14
|
ConnectionStatus["CONNECTED"] = "CONNECTED";
|
15
15
|
ConnectionStatus["DISCONNECTED"] = "DISCONNECTED";
|
16
|
-
})(ConnectionStatus
|
16
|
+
})(ConnectionStatus || (exports.ConnectionStatus = ConnectionStatus = {}));
|
17
17
|
(0, type_graphql_1.registerEnumType)(ConnectionStatus, {
|
18
18
|
name: 'ConnectionStatus',
|
19
19
|
description: 'state enumeration of a connection'
|
@@ -49,6 +49,7 @@ let Connection = class Connection {
|
|
49
49
|
}
|
50
50
|
}
|
51
51
|
};
|
52
|
+
exports.Connection = Connection;
|
52
53
|
tslib_1.__decorate([
|
53
54
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
54
55
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
@@ -161,14 +162,14 @@ tslib_1.__decorate([
|
|
161
162
|
(0, typeorm_1.RelationId)((connection) => connection.updater),
|
162
163
|
tslib_1.__metadata("design:type", String)
|
163
164
|
], Connection.prototype, "updaterId", void 0);
|
164
|
-
Connection = tslib_1.__decorate([
|
165
|
+
exports.Connection = Connection = tslib_1.__decorate([
|
165
166
|
(0, typeorm_1.Entity)(),
|
166
167
|
(0, typeorm_1.Index)('ix_connection_0', (connection) => [connection.domain, connection.name], { unique: true }),
|
167
168
|
(0, type_graphql_1.ObjectType)()
|
168
169
|
], Connection);
|
169
|
-
exports.Connection = Connection;
|
170
170
|
let ConnectionState = class ConnectionState {
|
171
171
|
};
|
172
|
+
exports.ConnectionState = ConnectionState;
|
172
173
|
tslib_1.__decorate([
|
173
174
|
(0, type_graphql_1.Field)(type => shell_1.Domain),
|
174
175
|
tslib_1.__metadata("design:type", shell_1.Domain)
|
@@ -201,12 +202,12 @@ tslib_1.__decorate([
|
|
201
202
|
(0, type_graphql_1.Field)({ nullable: true }),
|
202
203
|
tslib_1.__metadata("design:type", Date)
|
203
204
|
], ConnectionState.prototype, "timestamp", void 0);
|
204
|
-
ConnectionState = tslib_1.__decorate([
|
205
|
+
exports.ConnectionState = ConnectionState = tslib_1.__decorate([
|
205
206
|
(0, type_graphql_1.ObjectType)()
|
206
207
|
], ConnectionState);
|
207
|
-
exports.ConnectionState = ConnectionState;
|
208
208
|
let NewConnection = class NewConnection {
|
209
209
|
};
|
210
|
+
exports.NewConnection = NewConnection;
|
210
211
|
tslib_1.__decorate([
|
211
212
|
(0, type_graphql_1.Field)(),
|
212
213
|
tslib_1.__metadata("design:type", String)
|
@@ -231,12 +232,12 @@ tslib_1.__decorate([
|
|
231
232
|
(0, type_graphql_1.Field)({ nullable: true }),
|
232
233
|
tslib_1.__metadata("design:type", String)
|
233
234
|
], NewConnection.prototype, "params", void 0);
|
234
|
-
NewConnection = tslib_1.__decorate([
|
235
|
+
exports.NewConnection = NewConnection = tslib_1.__decorate([
|
235
236
|
(0, type_graphql_1.InputType)()
|
236
237
|
], NewConnection);
|
237
|
-
exports.NewConnection = NewConnection;
|
238
238
|
let ConnectionPatch = class ConnectionPatch {
|
239
239
|
};
|
240
|
+
exports.ConnectionPatch = ConnectionPatch;
|
240
241
|
tslib_1.__decorate([
|
241
242
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
242
243
|
tslib_1.__metadata("design:type", String)
|
@@ -273,12 +274,12 @@ tslib_1.__decorate([
|
|
273
274
|
(0, type_graphql_1.Field)({ nullable: true }),
|
274
275
|
tslib_1.__metadata("design:type", String)
|
275
276
|
], ConnectionPatch.prototype, "cuFlag", void 0);
|
276
|
-
ConnectionPatch = tslib_1.__decorate([
|
277
|
+
exports.ConnectionPatch = ConnectionPatch = tslib_1.__decorate([
|
277
278
|
(0, type_graphql_1.InputType)()
|
278
279
|
], ConnectionPatch);
|
279
|
-
exports.ConnectionPatch = ConnectionPatch;
|
280
280
|
let ConnectionList = class ConnectionList {
|
281
281
|
};
|
282
|
+
exports.ConnectionList = ConnectionList;
|
282
283
|
tslib_1.__decorate([
|
283
284
|
(0, type_graphql_1.Field)(type => [Connection]),
|
284
285
|
tslib_1.__metadata("design:type", Array)
|
@@ -287,8 +288,7 @@ tslib_1.__decorate([
|
|
287
288
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
288
289
|
tslib_1.__metadata("design:type", Number)
|
289
290
|
], ConnectionList.prototype, "total", void 0);
|
290
|
-
ConnectionList = tslib_1.__decorate([
|
291
|
+
exports.ConnectionList = ConnectionList = tslib_1.__decorate([
|
291
292
|
(0, type_graphql_1.ObjectType)()
|
292
293
|
], ConnectionList);
|
293
|
-
exports.ConnectionList = ConnectionList;
|
294
294
|
//# sourceMappingURL=connection-type.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"connection-type.js","sourceRoot":"","sources":["../../../server/service/connection/connection-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AACtF,qCASgB;AAEhB,yDAA2D;AAC3D,6CAA4C;AAC5C,iDAAyD;AAEzD,yCAAgD;AAChD,4EAAuE;AAEvE,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,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AU,CAAC,CAAC;;6CACT;AAEnB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;AALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B;AANY,wCAAc","sourcesContent":["import { Field, ID, InputType, Int, ObjectType, registerEnumType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User, Appliance } from '@things-factory/auth-base'\nimport { logger } from '@things-factory/env'\nimport { Domain, ObjectRef } from '@things-factory/shell'\n\nimport { ConnectionManager } from '../../engine'\nimport { ProxyConnector } from '../../engine/connector/proxy-connector'\n\nexport enum ConnectionStatus {\n CONNECTED = 'CONNECTED',\n DISCONNECTED = 'DISCONNECTED'\n}\n\nregisterEnumType(ConnectionStatus, {\n name: 'ConnectionStatus',\n description: 'state enumeration of a connection'\n})\n\n@Entity()\n@Index('ix_connection_0', (connection: Connection) => [connection.domain, connection.name], { unique: true })\n@ObjectType()\nexport class Connection {\n /**\n * Unique identifier for the connection, generated in UUID format.\n */\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n /**\n * Many-to-One relationship with the Domain entity.\n */\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain: Domain\n\n /**\n * Stores the ID of the associated Domain.\n */\n @RelationId((connection: Connection) => connection.domain)\n domainId: string\n\n /**\n * The name of the connection.\n */\n @Column()\n @Field()\n name: string\n\n /**\n * Optional description for the connection.\n */\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n /**\n * The type of the connection.\n */\n @Column()\n @Field({ nullable: true })\n type: string\n\n /**\n * Many-to-One relationship with the Appliance entity which delegate the connection. Optional field.\n */\n @ManyToOne(type => Appliance, { nullable: true })\n @Field({ nullable: true })\n edge: Appliance\n\n /**\n * Stores the ID of the Appliance who delegate the connection.\n */\n @RelationId((connection: Connection) => connection.edge)\n edgeId: string\n\n /**\n * The endpoint for the connection.\n */\n @Column()\n @Field({ nullable: true })\n endpoint: string\n\n /**\n * Indicates the active status of the connection.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n active: boolean\n\n /**\n * The status of the connection, using the ConnectionStatus type.\n */\n @Field({ nullable: true })\n state: ConnectionStatus\n\n /**\n * Additional parameters for the connection, stored as a JSON string.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n params: string\n\n /**\n * The date and time when the connection was created.\n */\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n /**\n * The date and time when the connection was last updated.\n */\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n /**\n * Many-to-One relationship with the User entity who created the connection. Optional field.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator: User\n\n /**\n * Stores the ID of the User who created the connection.\n */\n @RelationId((connection: Connection) => connection.creator)\n creatorId: string\n\n /**\n * Many-to-One relationship with the User entity who last updated the connection.\n * Optional field.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater: User\n\n /**\n * Stores the ID of the User who last updated the connection.\n *\n */\n @RelationId((connection: Connection) => connection.updater)\n updaterId: string\n\n /**\n * Asynchronous method to establish the connection.\n *\n */\n async connect() {\n const { type, edge } = this\n const connector = edge ? ProxyConnector.instance : ConnectionManager.getConnector(type)\n var params = {}\n\n try {\n params = JSON.parse(this.params || '{}')\n } catch (ex) {\n logger.error(`connection '${this.name}' params should be JSON format`, ex)\n }\n\n await connector.connect({\n ...this,\n params\n })\n }\n\n /**\n * @brief Asynchronous method to disconnect the connection.\n *\n */\n async disconnect() {\n try {\n const { type, edge } = this\n const connector = edge ? ProxyConnector.instance : ConnectionManager.getConnector(type)\n await connector.disconnect(this)\n } finally {\n }\n }\n}\n\n/**\n * Connection의 params의 원 타입과 사용 시에 타입 불일치로 인해 임시적으로 생성한 타입으로\n * 추후, 타입 일치를 통해서 제거할 예정임.\n *\n */\nexport interface InputConnection extends Connection {\n params: any\n}\n\n@ObjectType()\nexport class ConnectionState {\n @Field(type => Domain)\n domain?: Domain\n\n @Field({ nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field(type => Appliance, { nullable: true })\n edge?: Appliance\n\n @Field({ nullable: true })\n state?: ConnectionStatus\n\n @Field({ nullable: true })\n timestamp?: Date\n}\n\n@InputType()\nexport class NewConnection {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field(type => ObjectRef, { nullable: true })\n edge?: Appliance\n\n @Field({ nullable: true })\n endpoint?: string\n\n @Field({ nullable: true })\n params?: string\n}\n\n@InputType()\nexport class ConnectionPatch {\n @Field(type => ID, { nullable: true })\n id: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field(type => ObjectRef, { nullable: true })\n edge?: Appliance\n\n @Field({ nullable: true })\n endpoint?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ConnectionList {\n @Field(type => [Connection])\n items: Connection[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
1
|
+
{"version":3,"file":"connection-type.js","sourceRoot":"","sources":["../../../server/service/connection/connection-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AACtF,qCASgB;AAEhB,yDAA2D;AAC3D,6CAA4C;AAC5C,iDAAyD;AAEzD,yCAAgD;AAChD,4EAAuE;AAEvE,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,iDAA6B,CAAA;AAC/B,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAA,+BAAgB,EAAC,gBA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CAAC;;6CACN;yBALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B","sourcesContent":["import { Field, ID, InputType, Int, ObjectType, registerEnumType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User, Appliance } from '@things-factory/auth-base'\nimport { logger } from '@things-factory/env'\nimport { Domain, ObjectRef } from '@things-factory/shell'\n\nimport { ConnectionManager } from '../../engine'\nimport { ProxyConnector } from '../../engine/connector/proxy-connector'\n\nexport enum ConnectionStatus {\n CONNECTED = 'CONNECTED',\n DISCONNECTED = 'DISCONNECTED'\n}\n\nregisterEnumType(ConnectionStatus, {\n name: 'ConnectionStatus',\n description: 'state enumeration of a connection'\n})\n\n@Entity()\n@Index('ix_connection_0', (connection: Connection) => [connection.domain, connection.name], { unique: true })\n@ObjectType()\nexport class Connection {\n /**\n * Unique identifier for the connection, generated in UUID format.\n */\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n /**\n * Many-to-One relationship with the Domain entity.\n */\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain: Domain\n\n /**\n * Stores the ID of the associated Domain.\n */\n @RelationId((connection: Connection) => connection.domain)\n domainId: string\n\n /**\n * The name of the connection.\n */\n @Column()\n @Field()\n name: string\n\n /**\n * Optional description for the connection.\n */\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n /**\n * The type of the connection.\n */\n @Column()\n @Field({ nullable: true })\n type: string\n\n /**\n * Many-to-One relationship with the Appliance entity which delegate the connection. Optional field.\n */\n @ManyToOne(type => Appliance, { nullable: true })\n @Field({ nullable: true })\n edge: Appliance\n\n /**\n * Stores the ID of the Appliance who delegate the connection.\n */\n @RelationId((connection: Connection) => connection.edge)\n edgeId: string\n\n /**\n * The endpoint for the connection.\n */\n @Column()\n @Field({ nullable: true })\n endpoint: string\n\n /**\n * Indicates the active status of the connection.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n active: boolean\n\n /**\n * The status of the connection, using the ConnectionStatus type.\n */\n @Field({ nullable: true })\n state: ConnectionStatus\n\n /**\n * Additional parameters for the connection, stored as a JSON string.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n params: string\n\n /**\n * The date and time when the connection was created.\n */\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n /**\n * The date and time when the connection was last updated.\n */\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n /**\n * Many-to-One relationship with the User entity who created the connection. Optional field.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator: User\n\n /**\n * Stores the ID of the User who created the connection.\n */\n @RelationId((connection: Connection) => connection.creator)\n creatorId: string\n\n /**\n * Many-to-One relationship with the User entity who last updated the connection.\n * Optional field.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater: User\n\n /**\n * Stores the ID of the User who last updated the connection.\n *\n */\n @RelationId((connection: Connection) => connection.updater)\n updaterId: string\n\n /**\n * Asynchronous method to establish the connection.\n *\n */\n async connect() {\n const { type, edge } = this\n const connector = edge ? ProxyConnector.instance : ConnectionManager.getConnector(type)\n var params = {}\n\n try {\n params = JSON.parse(this.params || '{}')\n } catch (ex) {\n logger.error(`connection '${this.name}' params should be JSON format`, ex)\n }\n\n await connector.connect({\n ...this,\n params\n })\n }\n\n /**\n * @brief Asynchronous method to disconnect the connection.\n *\n */\n async disconnect() {\n try {\n const { type, edge } = this\n const connector = edge ? ProxyConnector.instance : ConnectionManager.getConnector(type)\n await connector.disconnect(this)\n } finally {\n }\n }\n}\n\n/**\n * Connection의 params의 원 타입과 사용 시에 타입 불일치로 인해 임시적으로 생성한 타입으로\n * 추후, 타입 일치를 통해서 제거할 예정임.\n *\n */\nexport interface InputConnection extends Connection {\n params: any\n}\n\n@ObjectType()\nexport class ConnectionState {\n @Field(type => Domain)\n domain?: Domain\n\n @Field({ nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field(type => Appliance, { nullable: true })\n edge?: Appliance\n\n @Field({ nullable: true })\n state?: ConnectionStatus\n\n @Field({ nullable: true })\n timestamp?: Date\n}\n\n@InputType()\nexport class NewConnection {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field(type => ObjectRef, { nullable: true })\n edge?: Appliance\n\n @Field({ nullable: true })\n endpoint?: string\n\n @Field({ nullable: true })\n params?: string\n}\n\n@InputType()\nexport class ConnectionPatch {\n @Field(type => ID, { nullable: true })\n id: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field(type => ObjectRef, { nullable: true })\n edge?: Appliance\n\n @Field({ nullable: true })\n endpoint?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ConnectionList {\n @Field(type => [Connection])\n items: Connection[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { Connection } from './connection-type';
|
2
|
+
import { ConnectionQuery } from './connection-query';
|
3
|
+
import { ConnectionMutation } from './connection-mutation';
|
4
|
+
import { ConnectionSubscription } from './connection-subscription';
|
5
|
+
export declare const entities: (typeof Connection)[];
|
6
|
+
export declare const resolvers: (typeof ConnectionQuery | typeof ConnectionMutation | typeof ConnectionSubscription)[];
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { ConnectorList, ConnectorType } from './connector-type';
|
2
|
+
export declare class ConnectorQuery {
|
3
|
+
connection(name: string, context: ResolverContext): Promise<ConnectorType>;
|
4
|
+
connectors(): Promise<ConnectorList>;
|
5
|
+
connectorByConnection(connectionName: string, context: ResolverContext): Promise<ConnectorType>;
|
6
|
+
}
|
@@ -48,6 +48,7 @@ let ConnectorQuery = class ConnectorQuery {
|
|
48
48
|
return connection && connection_manager_1.ConnectionManager.getConnector(connection.type);
|
49
49
|
}
|
50
50
|
};
|
51
|
+
exports.ConnectorQuery = ConnectorQuery;
|
51
52
|
tslib_1.__decorate([
|
52
53
|
(0, type_graphql_1.Query)(returns => connector_type_1.ConnectorType, { description: 'To fetch a connector' }),
|
53
54
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
@@ -70,8 +71,7 @@ tslib_1.__decorate([
|
|
70
71
|
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
71
72
|
tslib_1.__metadata("design:returntype", Promise)
|
72
73
|
], ConnectorQuery.prototype, "connectorByConnection", null);
|
73
|
-
ConnectorQuery = tslib_1.__decorate([
|
74
|
+
exports.ConnectorQuery = ConnectorQuery = tslib_1.__decorate([
|
74
75
|
(0, type_graphql_1.Resolver)(connector_type_1.ConnectorType)
|
75
76
|
], ConnectorQuery);
|
76
|
-
exports.ConnectorQuery = ConnectorQuery;
|
77
77
|
//# sourceMappingURL=connector-query.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"connector-query.js","sourceRoot":"","sources":["../../../server/service/connector/connector-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAwD;AAExD,iDAAqD;AAErD,wEAAmE;AACnE,mEAA0D;AAC1D,qDAA+D;AAGxD,IAAM,cAAc,GAApB,MAAM,cAAc;IAEnB,AAAN,KAAK,CAAC,UAAU,CAAc,IAAY,EAAS,OAAwB;QACzE,aAAa;QACb,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,sCAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;QAErG,OAAO;YACL,IAAI;YACJ,WAAW;YACX,IAAI;YACJ,aAAa;YACb,YAAY,EAAE,YAAY,IAAI,EAAE;SACjC,CAAA;IACH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EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,IAAI,UAAU,GAAG,MAAM,IAAA,qBAAa,EAAC,4BAAU,CAAC,CAAC,OAAO,CAAC;YACvD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;SAC3D,CAAC,CAAA;QAEF,OAAO,UAAU,IAAK,sCAAiB,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAS,CAAA;IAC/E,CAAC;CACF,CAAA;AApDY,wCAAc;AAEnB;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gDAWjD;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;;;gDAsB/E;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;IAE1F,mBAAA,IAAA,kBAAG,EAAC,gBAAgB,CAAC,CAAA;IACrB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DASP;yBAnDU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,8BAAa,CAAC;GACX,cAAc,CAoD1B","sourcesContent":["import { Arg, Ctx, Query, Resolver } from 'type-graphql'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { ConnectionManager } from '../../engine/connection-manager'\nimport { Connection } from '../connection/connection-type'\nimport { ConnectorList, ConnectorType } from './connector-type'\n\n@Resolver(ConnectorType)\nexport class ConnectorQuery {\n @Query(returns => ConnectorType, { description: 'To fetch a connector' })\n async connection(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<ConnectorType> {\n // @ts-ignore\n const { description, help, parameterSpec, taskPrefixes } = ConnectionManager.getConnector(name) || {}\n\n return {\n name,\n description,\n help,\n parameterSpec,\n taskPrefixes: taskPrefixes || []\n }\n }\n\n @Query(returns => ConnectorList, { description: 'To fetch multiple connector' })\n async connectors(): Promise<ConnectorList> {\n var connectors = ConnectionManager.getConnectors()\n var items = Object.keys(connectors)\n .map(name => {\n var connector = connectors[name]\n return {\n name,\n description: connector.description,\n help: connector.help,\n parameterSpec: connector.parameterSpec,\n taskPrefixes: connector.taskPrefixes || []\n }\n })\n .sort((x, y) => {\n return x.name < y.name ? -1 : 1\n })\n\n return {\n items,\n total: items.length\n }\n }\n\n @Query(returns => ConnectorType, { description: 'To fetch the connector from a connection' })\n async connectorByConnection(\n @Arg('connectionName') connectionName: string,\n @Ctx() context: ResolverContext\n ): Promise<ConnectorType> {\n const { domain } = context.state\n\n var connection = await getRepository(Connection).findOne({\n where: { domain: { id: domain.id }, name: connectionName }\n })\n\n return connection && (ConnectionManager.getConnector(connection.type) as any)\n }\n}\n"]}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { PropertySpec } from '../property-spec';
|
2
|
+
export declare class ConnectorType {
|
3
|
+
name: string;
|
4
|
+
description: string;
|
5
|
+
help?: string;
|
6
|
+
parameterSpec: PropertySpec[];
|
7
|
+
taskPrefixes?: string[];
|
8
|
+
}
|
9
|
+
export declare class ConnectorList {
|
10
|
+
items: ConnectorType[];
|
11
|
+
total: number;
|
12
|
+
}
|
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
|
|
6
6
|
const property_spec_1 = require("../property-spec");
|
7
7
|
let ConnectorType = class ConnectorType {
|
8
8
|
};
|
9
|
+
exports.ConnectorType = ConnectorType;
|
9
10
|
tslib_1.__decorate([
|
10
11
|
(0, type_graphql_1.Field)(),
|
11
12
|
tslib_1.__metadata("design:type", String)
|
@@ -26,12 +27,12 @@ tslib_1.__decorate([
|
|
26
27
|
(0, type_graphql_1.Field)(type => [String], { nullable: true }),
|
27
28
|
tslib_1.__metadata("design:type", Array)
|
28
29
|
], ConnectorType.prototype, "taskPrefixes", void 0);
|
29
|
-
ConnectorType = tslib_1.__decorate([
|
30
|
+
exports.ConnectorType = ConnectorType = tslib_1.__decorate([
|
30
31
|
(0, type_graphql_1.ObjectType)()
|
31
32
|
], ConnectorType);
|
32
|
-
exports.ConnectorType = ConnectorType;
|
33
33
|
let ConnectorList = class ConnectorList {
|
34
34
|
};
|
35
|
+
exports.ConnectorList = ConnectorList;
|
35
36
|
tslib_1.__decorate([
|
36
37
|
(0, type_graphql_1.Field)(type => [ConnectorType]),
|
37
38
|
tslib_1.__metadata("design:type", Array)
|
@@ -40,8 +41,7 @@ tslib_1.__decorate([
|
|
40
41
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
41
42
|
tslib_1.__metadata("design:type", Number)
|
42
43
|
], ConnectorList.prototype, "total", void 0);
|
43
|
-
ConnectorList = tslib_1.__decorate([
|
44
|
+
exports.ConnectorList = ConnectorList = tslib_1.__decorate([
|
44
45
|
(0, type_graphql_1.ObjectType)()
|
45
46
|
], ConnectorList);
|
46
|
-
exports.ConnectorList = ConnectorList;
|
47
47
|
//# sourceMappingURL=connector-type.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"connector-type.js","sourceRoot":"","sources":["../../../server/service/connector/connector-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAqD;AACrD,oDAA+C;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAezB,CAAA;
|
1
|
+
{"version":3,"file":"connector-type.js","sourceRoot":"","sources":["../../../server/service/connector/connector-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAqD;AACrD,oDAA+C;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAezB,CAAA;AAfY,sCAAa;AAExB;IADC,IAAA,oBAAK,GAAE;;2CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACP;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACrB;AAG7B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACrB;wBAdZ,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAezB;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AANY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC;;4CACT;AAGtB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;4CACN;wBALF,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB","sourcesContent":["import { ObjectType, Field, Int } from 'type-graphql'\nimport { PropertySpec } from '../property-spec'\n\n@ObjectType()\nexport class ConnectorType {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description: string\n\n @Field({ nullable: true })\n help?: string\n\n @Field(type => [PropertySpec], { nullable: true })\n parameterSpec: PropertySpec[]\n\n @Field(type => [String], { nullable: true })\n taskPrefixes?: string[]\n}\n\n@ObjectType()\nexport class ConnectorList {\n @Field(type => [ConnectorType])\n items: ConnectorType[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export * from './property-spec';
|
2
|
+
export * from './task-type/task-type-type';
|
3
|
+
export * from './connector/connector-type';
|
4
|
+
export * from './connection/connection-type';
|
5
|
+
export * from './scenario/scenario';
|
6
|
+
export * from './scenario-instance/scenario-instance-type';
|
7
|
+
export * from './scenario-queue/scenario-queue-type';
|
8
|
+
export * from './step/step-type';
|
9
|
+
export * from './scenario-flow/scenario-flow';
|
10
|
+
export * from './payload-log/payload-log';
|
11
|
+
export * from './state-register/state-register';
|
12
|
+
export declare const entities: any[];
|
13
|
+
export declare const schema: {
|
14
|
+
resolverClasses: (typeof import("./connection/connection-query").ConnectionQuery | typeof import("./connection/connection-mutation").ConnectionMutation | typeof import("./connection/connection-subscription").ConnectionSubscription | typeof import("./connector/connector-query").ConnectorQuery | typeof import("./scenario/scenario-query").ScenarioQuery | typeof import("./scenario/scenario-mutation").ScenarioMutation | typeof import("./scenario-instance/scenario-instance-query").ScenarioInstanceQuery | typeof import("./scenario-instance/scenario-instance-mutation").ScenarioInstanceMutation | typeof import("./scenario-instance/scenario-instance-subscription").ScenarioInstanceSubscription | typeof import("./scenario-queue/scenario-queue-subscription").ScenarioQueueSubscription | typeof import("./step/step-query").StepQuery | typeof import("./step/step-mutation").StepMutation | typeof import("./task-type/task-type-query").TaskTypeQuery | typeof import("./payload-log/payload-log-query").PayloadLogQuery | typeof import("./payload-log/payload-log-mutation").PayloadLogMutation | typeof import("./state-register/state-register-query").StateRegisterQuery | typeof import("./state-register/state-register-mutation").StateRegisterMutation | typeof import("./analysis/analysis-query").IntegrationAnalysisQuery)[];
|
15
|
+
};
|
16
|
+
export { PayloadType } from './payload-log/payload-log';
|
17
|
+
export { createPayloadLog } from './payload-log/payload-log-mutation';
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { PayloadLog } from './payload-log';
|
2
|
+
import { PayloadLogQuery } from './payload-log-query';
|
3
|
+
import { PayloadLogMutation } from './payload-log-mutation';
|
4
|
+
export declare const entities: (typeof PayloadLog)[];
|
5
|
+
export declare const resolvers: (typeof PayloadLogQuery | typeof PayloadLogMutation)[];
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { PayloadLog, PayloadType } from './payload-log';
|
2
|
+
import { NewPayloadLog, PayloadLogPatch } from './payload-log-type';
|
3
|
+
export declare class PayloadLogMutation {
|
4
|
+
createPayloadLog(payloadLog: NewPayloadLog, context: ResolverContext): Promise<PayloadLog>;
|
5
|
+
updatePayloadLog(id: string, patch: PayloadLogPatch, context: ResolverContext): Promise<PayloadLog>;
|
6
|
+
updateMultiplePayloadLog(patches: PayloadLogPatch[], context: ResolverContext): Promise<PayloadLog[]>;
|
7
|
+
deletePayloadLog(id: string, context: ResolverContext): Promise<boolean>;
|
8
|
+
deletePayloadLogs(ids: string[], context: ResolverContext): Promise<boolean>;
|
9
|
+
}
|
10
|
+
export declare function createPayloadLog(name: string, endpoint: string, request: string, response: string, context: any, type?: PayloadType, src?: string): Promise<void>;
|
@@ -58,6 +58,7 @@ let PayloadLogMutation = class PayloadLogMutation {
|
|
58
58
|
return true;
|
59
59
|
}
|
60
60
|
};
|
61
|
+
exports.PayloadLogMutation = PayloadLogMutation;
|
61
62
|
tslib_1.__decorate([
|
62
63
|
(0, type_graphql_1.Directive)('@transaction'),
|
63
64
|
(0, type_graphql_1.Mutation)(returns => payload_log_1.PayloadLog, { description: 'To create new PayloadLog' }),
|
@@ -104,10 +105,9 @@ tslib_1.__decorate([
|
|
104
105
|
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
105
106
|
tslib_1.__metadata("design:returntype", Promise)
|
106
107
|
], PayloadLogMutation.prototype, "deletePayloadLogs", null);
|
107
|
-
PayloadLogMutation = tslib_1.__decorate([
|
108
|
+
exports.PayloadLogMutation = PayloadLogMutation = tslib_1.__decorate([
|
108
109
|
(0, type_graphql_1.Resolver)(payload_log_1.PayloadLog)
|
109
110
|
], PayloadLogMutation);
|
110
|
-
exports.PayloadLogMutation = PayloadLogMutation;
|
111
111
|
async function createPayloadLog(name, endpoint, request, response, context, type = payload_log_1.PayloadType.EGESTION, src = null) {
|
112
112
|
try {
|
113
113
|
const { domain, user } = context === null || context === void 0 ? void 0 : context.state;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"payload-log-mutation.js","sourceRoot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AAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,cAAc,GAAG,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAA;QAEnD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;
|
1
|
+
{"version":3,"file":"payload-log-mutation.js","sourceRoot":"","sources":["../../../server/service/payload-log/payload-log-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAG5B,6CAA4C;AAC5C,iDAA6D;AAE7D,+CAAuD;AACvD,yDAAmE;AAG5D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,gBAAgB,CACD,UAAyB,EACrC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAC,IAAI,iCACzC,UAAU,KACb,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CACT,EAAU,EACP,KAAsB,EAC7B,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAA;QAC/C,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAA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,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAUP;6BA3GU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CA4G9B;AAEM,KAAK,UAAU,gBAAgB,CACpC,IAAY,EACZ,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,OAAY,EACZ,OAAoB,yBAAW,CAAC,QAAQ,EACxC,MAAc,IAAI;IAElB,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAmC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAA;QAEvE,uCAAuC;QACvC,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,IAAI,CAAC;YACnC,IAAI;YACJ,MAAM;YACN,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,IAAI;YACJ,GAAG;YACH,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAM,CAAC,KAAK,CAAC,qBAAqB,KAAK,EAAE,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC;AA7BD,4CA6BC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { logger } from '@things-factory/env'\nimport { Domain, getRepository } from '@things-factory/shell'\n\nimport { PayloadLog, PayloadType } from './payload-log'\nimport { NewPayloadLog, PayloadLogPatch } from './payload-log-type'\n\n@Resolver(PayloadLog)\nexport class PayloadLogMutation {\n @Directive('@transaction')\n @Mutation(returns => PayloadLog, { description: 'To create new PayloadLog' })\n async createPayloadLog(\n @Arg('payloadLog') payloadLog: NewPayloadLog,\n @Ctx() context: ResolverContext\n ): Promise<PayloadLog> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(PayloadLog).save({\n ...payloadLog,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => PayloadLog, { description: 'To modify PayloadLog information' })\n async updatePayloadLog(\n @Arg('id') id: string,\n @Arg('patch') patch: PayloadLogPatch,\n @Ctx() context: ResolverContext\n ): Promise<PayloadLog> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(PayloadLog)\n const payloadLog = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n return await repository.save({\n ...payloadLog,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [PayloadLog], { description: \"To modify multiple PayloadLogs' information\" })\n async updateMultiplePayloadLog(\n @Arg('patches', type => [PayloadLogPatch]) patches: PayloadLogPatch[],\n @Ctx() context: ResolverContext\n ): Promise<PayloadLog[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const payloadLogRepo = tx.getRepository(PayloadLog)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await payloadLogRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const payloadLog = await payloadLogRepo.findOneBy({ id: newRecord.id })\n\n const result = await payloadLogRepo.save({\n ...payloadLog,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete PayloadLog' })\n async deletePayloadLog(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(PayloadLog).delete({ domain: { id: domain.id }, id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple payloadLogs' })\n async deletePayloadLogs(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(PayloadLog).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n}\n\nexport async function createPayloadLog(\n name: string,\n endpoint: string,\n request: string,\n response: string,\n context: any,\n type: PayloadType = PayloadType.EGESTION,\n src: string = null\n): Promise<void> {\n try {\n const { domain, user }: { domain: Domain; user: User } = context?.state\n\n // disabled due to high db server usage\n await getRepository(PayloadLog).save({\n name,\n domain,\n endpoint,\n request,\n response,\n type,\n src,\n createdBy: user,\n updatedBy: user,\n createdAt: new Date(),\n updatedAt: new Date()\n })\n } catch (error) {\n logger.error(`PayloadLog Error: ${error}`)\n }\n}\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
2
|
+
import { Domain, ListParam } from '@things-factory/shell';
|
3
|
+
import { PayloadLog } from './payload-log';
|
4
|
+
import { PayloadLogList } from './payload-log-type';
|
5
|
+
export declare class PayloadLogQuery {
|
6
|
+
payloadLog(id: string, context: ResolverContext): Promise<PayloadLog>;
|
7
|
+
payloadLogs(params: ListParam, context: ResolverContext): Promise<PayloadLogList>;
|
8
|
+
domain(payloadLog: PayloadLog): Promise<Domain>;
|
9
|
+
updater(payloadLog: PayloadLog): Promise<User>;
|
10
|
+
creator(payloadLog: PayloadLog): Promise<User>;
|
11
|
+
}
|
@@ -32,6 +32,7 @@ let PayloadLogQuery = class PayloadLogQuery {
|
|
32
32
|
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: payloadLog.creatorId });
|
33
33
|
}
|
34
34
|
};
|
35
|
+
exports.PayloadLogQuery = PayloadLogQuery;
|
35
36
|
tslib_1.__decorate([
|
36
37
|
(0, type_graphql_1.Query)(returns => payload_log_1.PayloadLog, { description: 'To fetch a PayloadLog' }),
|
37
38
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
@@ -69,8 +70,7 @@ tslib_1.__decorate([
|
|
69
70
|
tslib_1.__metadata("design:paramtypes", [payload_log_1.PayloadLog]),
|
70
71
|
tslib_1.__metadata("design:returntype", Promise)
|
71
72
|
], PayloadLogQuery.prototype, "creator", null);
|
72
|
-
PayloadLogQuery = tslib_1.__decorate([
|
73
|
+
exports.PayloadLogQuery = PayloadLogQuery = tslib_1.__decorate([
|
73
74
|
(0, type_graphql_1.Resolver)(payload_log_1.PayloadLog)
|
74
75
|
], PayloadLogQuery);
|
75
|
-
exports.PayloadLogQuery = PayloadLogQuery;
|
76
76
|
//# sourceMappingURL=payload-log-query.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"payload-log-query.js","sourceRoot":"","sources":["../../../server/service/payload-log/payload-log-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAA2F;AAE3F,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAwB;QACrE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CAAS,MAAiB,EAAS,OAAwB;QAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC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kBAAG,GAAE,CAAA;;;;iDAM7C;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,iCAAc,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAChE,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;kDAS1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;6CAE1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;0BAnCU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAoC3B","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { convertListParams, Domain, getRepository, ListParam } from '@things-factory/shell'\n\nimport { PayloadLog } from './payload-log'\nimport { PayloadLogList } from './payload-log-type'\n\n@Resolver(PayloadLog)\nexport class PayloadLogQuery {\n @Query(returns => PayloadLog, { description: 'To fetch a PayloadLog' })\n async payloadLog(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<PayloadLog> {\n const { domain } = context.state\n\n return await getRepository(PayloadLog).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => PayloadLogList, { description: 'To fetch multiple PayloadLogs' })\n async payloadLogs(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<PayloadLogList> {\n const { domain } = context.state\n\n const convertedParams = convertListParams(params, {\n domain\n })\n const [items, total] = await getRepository(PayloadLog).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() payloadLog: PayloadLog): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: payloadLog.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() payloadLog: PayloadLog): Promise<User> {\n return await getRepository(User).findOneBy({ id: payloadLog.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() payloadLog: PayloadLog): Promise<User> {\n return await getRepository(User).findOneBy({ id: payloadLog.creatorId })\n }\n}\n"]}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { PayloadLog } from './payload-log';
|
2
|
+
export declare class NewPayloadLog {
|
3
|
+
name: string;
|
4
|
+
description?: string;
|
5
|
+
}
|
6
|
+
export declare class PayloadLogPatch {
|
7
|
+
id?: string;
|
8
|
+
name?: string;
|
9
|
+
description?: string;
|
10
|
+
cuFlag: string;
|
11
|
+
}
|
12
|
+
export declare class PayloadLogList {
|
13
|
+
items: PayloadLog[];
|
14
|
+
total: number;
|
15
|
+
}
|