@things-factory/integration-base 5.0.0-alpha.51 → 5.0.0-alpha.52

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.
Files changed (34) hide show
  1. package/dist-server/engine/task/local-graphql-query.js +1 -1
  2. package/dist-server/engine/task/local-graphql-query.js.map +1 -1
  3. package/dist-server/service/connection/connection-query.js +6 -3
  4. package/dist-server/service/connection/connection-query.js.map +1 -1
  5. package/dist-server/service/index.js +11 -3
  6. package/dist-server/service/index.js.map +1 -1
  7. package/dist-server/service/payload-log/index.js +9 -0
  8. package/dist-server/service/payload-log/index.js.map +1 -0
  9. package/dist-server/service/payload-log/payload-log-mutation.js +142 -0
  10. package/dist-server/service/payload-log/payload-log-mutation.js.map +1 -0
  11. package/dist-server/service/payload-log/payload-log-query.js +89 -0
  12. package/dist-server/service/payload-log/payload-log-query.js.map +1 -0
  13. package/dist-server/service/payload-log/payload-log-type.js +65 -0
  14. package/dist-server/service/payload-log/payload-log-type.js.map +1 -0
  15. package/dist-server/service/payload-log/payload-log.js +115 -0
  16. package/dist-server/service/payload-log/payload-log.js.map +1 -0
  17. package/dist-server/service/scenario/scenario-query.js +7 -4
  18. package/dist-server/service/scenario/scenario-query.js.map +1 -1
  19. package/dist-server/service/scenario-instance/scenario-instance-query.js +4 -2
  20. package/dist-server/service/scenario-instance/scenario-instance-query.js.map +1 -1
  21. package/dist-server/service/step/step-query.js +3 -3
  22. package/dist-server/service/step/step-query.js.map +1 -1
  23. package/package.json +7 -7
  24. package/server/engine/task/local-graphql-query.ts +1 -1
  25. package/server/service/connection/connection-query.ts +9 -4
  26. package/server/service/index.ts +9 -2
  27. package/server/service/payload-log/index.ts +7 -0
  28. package/server/service/payload-log/payload-log-mutation.ts +147 -0
  29. package/server/service/payload-log/payload-log-query.ts +47 -0
  30. package/server/service/payload-log/payload-log-type.ts +36 -0
  31. package/server/service/payload-log/payload-log.ts +97 -0
  32. package/server/service/scenario/scenario-query.ts +10 -5
  33. package/server/service/scenario-instance/scenario-instance-query.ts +13 -4
  34. package/server/service/step/step-query.ts +6 -4
@@ -60,6 +60,6 @@ LocalGraphqlQuery.parameterSpec = [
60
60
  }
61
61
  ];
62
62
  LocalGraphqlQuery.connectorFree = true;
63
- LocalGraphqlQuery.help = 'integration/task/local-graphql-mutate';
63
+ LocalGraphqlQuery.help = 'integration/task/local-graphql-query';
64
64
  task_registry_1.TaskRegistry.registerTaskHandler('local-graphql-query', LocalGraphqlQuery);
65
65
  //# sourceMappingURL=local-graphql-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-graphql-query.js","sourceRoot":"","sources":["../../../server/engine/task/local-graphql-query.ts"],"names":[],"mappings":";;;;;AAAA,8DAA6B;AAC7B,qCAAuC;AACvC,6BAAwB;AAExB,yDAAgD;AAChD,iDAA8C;AAE9C,oDAA+C;AAE/C,KAAK,UAAU,iBAAiB,CAAC,IAAI,EAAE,OAAO;IAC5C,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;IAChC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,GAAG,MAAM,IAAI,EAAE,CAAA;IAC7D,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;IAEjD,MAAM,IAAI,GAAG,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE;QACxD,SAAS,EAAE,CAAC,SAAS,CAAC;KACvB,CAAC,CAAA;IAEF,MAAM,EAAE,GAAG,IAAI,QAAE,CAAC;QAChB,OAAO,EAAE;YACP,IAAI;YACJ,SAAS;SACV;KACF,CAAC,CAAA;IAEF,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,GAAG,GAAG,CAAC,CAAA;IAEjC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE;QACjF,MAAM,QAAQ,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAA;QAC1C,SAAS,CAAC,GAAG,CAAC,GAAG,IAAA,cAAM,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;QACvC,OAAO,SAAS,CAAA;IAClB,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAC7C,KAAK,EAAE,IAAA,qBAAG,EAAA;QACN,KAAK;KACR;QACD,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,MAAM;gBACN,IAAI;aACL;SACF;KACF,CAAC,CAAA;IAEF,OAAO;QACL,IAAI,EAAE,WAAW;KAClB,CAAA;AACH,CAAC;AAED,iBAAiB,CAAC,aAAa,GAAG;IAChC;QACE,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO;KACf;IACD;QACE,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,WAAW;QAClB,QAAQ,EAAE;YACR,OAAO,EAAE,EAAE,CAAC,uBAAuB;SACpC;KACF;CACF,CAAA;AAED,iBAAiB,CAAC,aAAa,GAAG,IAAI,CAAA;AACtC,iBAAiB,CAAC,IAAI,GAAG,uCAAuC,CAAA;AAEhE,4BAAY,CAAC,mBAAmB,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAA"}
1
+ {"version":3,"file":"local-graphql-query.js","sourceRoot":"","sources":["../../../server/engine/task/local-graphql-query.ts"],"names":[],"mappings":";;;;;AAAA,8DAA6B;AAC7B,qCAAuC;AACvC,6BAAwB;AAExB,yDAAgD;AAChD,iDAA8C;AAE9C,oDAA+C;AAE/C,KAAK,UAAU,iBAAiB,CAAC,IAAI,EAAE,OAAO;IAC5C,IAAI,EAAE,MAAM,EAAE,S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AE,OAAO;QACb,KAAK,EAAE,OAAO;KACf;IACD;QACE,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,WAAW;QAClB,QAAQ,EAAE;YACR,OAAO,EAAE,EAAE,CAAC,uBAAuB;SACpC;KACF;CACF,CAAA;AAED,iBAAiB,CAAC,aAAa,GAAG,IAAI,CAAA;AACtC,iBAAiB,CAAC,IAAI,GAAG,sCAAsC,CAAA;AAE/D,4BAAY,CAAC,mBAAmB,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAA"}
@@ -16,10 +16,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.ConnectionQuery = void 0;
17
17
  const type_graphql_1 = require("type-graphql");
18
18
  const typeorm_1 = require("typeorm");
19
- const shell_1 = require("@things-factory/shell");
20
19
  const auth_base_1 = require("@things-factory/auth-base");
21
- const connection_type_1 = require("./connection-type");
20
+ const shell_1 = require("@things-factory/shell");
22
21
  const connection_manager_1 = require("../../engine/connection-manager");
22
+ const connection_type_1 = require("./connection-type");
23
23
  let ConnectionQuery = class ConnectionQuery {
24
24
  async connection(name, context) {
25
25
  const { domain } = context.state;
@@ -33,7 +33,10 @@ let ConnectionQuery = class ConnectionQuery {
33
33
  }
34
34
  async connections(params, context) {
35
35
  const { domain } = context.state;
36
- const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
36
+ const convertedParams = (0, shell_1.convertListParams)(params, {
37
+ domain,
38
+ searchables: ['name', 'description', 'type', 'endpoint']
39
+ });
37
40
  const [items, total] = await (0, typeorm_1.getRepository)(connection_type_1.Connection).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: ['domain'] }));
38
41
  items.forEach(connection => {
39
42
  connection['state'] = connection_manager_1.ConnectionManager.getConnectionInstance(connection)
@@ -1 +1 @@
1
- {"version":3,"file":"connection-query.js","sourceRoot":"","sources":["../../../server/service/connection/connection-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AA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AgB1C;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,iCAAe,EAAE,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;IACnE,WAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;oCAAgB,iCAAe;2DASpF;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,4BAAU;;6CAE1C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,4BAAU;;8CAE3C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,4BAAU;;8CAE3C;AA9DU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,4BAAU,CAAC;GACR,eAAe,CA+D3B;AA/DY,0CAAe"}
1
+ {"version":3,"file":"connection-query.js","sourceRoot":"","sources":["../../../server/service/connection/connection-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAmF;AACnF,qCAAuC;AAEvC,yDAAgD;AAChD,iDAA4E;AAE5E,wEAAmE;AACnE,uDAAiG;AAGjG,IAAa,eAAe,GAA5B,MAAa,eAAe;IAE1B,KAAK,CAAC,UAAU,CAAc,IAAY,EAAS,OAAY;QAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,IAAI,UAAU,GAAG,MAAM,IAAA,uBAAa,EAAC,4BAAU,CAAC,CAAC,OAAO,CAAC;YACvD,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;YACvB,SAAS,EAAE,CAAC,QAAQ,CAAC;SACtB,CAAC,CAAA;QAEF,OAAO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AE1C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,4BAAU;;8CAE3C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,4BAAU;;8CAE3C;AAjEU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,4BAAU,CAAC;GACR,eAAe,CAkE3B;AAlEY,0CAAe"}
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.schema = exports.entities = void 0;
17
+ exports.createPayloadLog = exports.PayloadType = exports.schema = exports.entities = void 0;
18
18
  const connection_1 = require("./connection");
19
19
  const connector_1 = require("./connector");
20
20
  const scenario_1 = require("./scenario");
@@ -22,6 +22,7 @@ const scenario_instance_1 = require("./scenario-instance");
22
22
  const scenario_queue_1 = require("./scenario-queue");
23
23
  const step_1 = require("./step");
24
24
  const task_type_1 = require("./task-type");
25
+ const payload_log_1 = require("./payload-log");
25
26
  __exportStar(require("./property-spec"), exports);
26
27
  __exportStar(require("./task-type/task-type-type"), exports);
27
28
  __exportStar(require("./connector/connector-type"), exports);
@@ -31,6 +32,7 @@ __exportStar(require("./scenario-instance/scenario-instance-type"), exports);
31
32
  __exportStar(require("./scenario-queue/scenario-queue-type"), exports);
32
33
  __exportStar(require("./step/step-type"), exports);
33
34
  __exportStar(require("./scenario-flow/scenario-flow"), exports);
35
+ __exportStar(require("./payload-log/payload-log"), exports);
34
36
  exports.entities = [
35
37
  ...task_type_1.entities,
36
38
  ...connector_1.entities,
@@ -38,7 +40,8 @@ exports.entities = [
38
40
  ...scenario_1.entities,
39
41
  ...scenario_instance_1.entities,
40
42
  ...scenario_queue_1.entities,
41
- ...step_1.entities
43
+ ...step_1.entities,
44
+ ...payload_log_1.entities
42
45
  ];
43
46
  exports.schema = {
44
47
  resolverClasses: [
@@ -48,7 +51,12 @@ exports.schema = {
48
51
  ...scenario_1.resolvers,
49
52
  ...scenario_instance_1.resolvers,
50
53
  ...scenario_queue_1.resolvers,
51
- ...step_1.resolvers
54
+ ...step_1.resolvers,
55
+ ...payload_log_1.resolvers
52
56
  ]
53
57
  };
58
+ var payload_log_2 = require("./payload-log/payload-log");
59
+ Object.defineProperty(exports, "PayloadType", { enumerable: true, get: function () { return payload_log_2.PayloadType; } });
60
+ var payload_log_mutation_1 = require("./payload-log/payload-log-mutation");
61
+ Object.defineProperty(exports, "createPayloadLog", { enumerable: true, get: function () { return payload_log_mutation_1.createPayloadLog; } });
54
62
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA+F;AAC/F,2CAA4F;AAC5F,yCAAyF;AACzF,2DAAkH;AAClH,qDAAyG;AACzG,iCAA6E;AAC7E,2CAA0F;AAE1F,kDAA+B;AAC/B,6DAA0C;AAC1C,6DAA0C;AAC1C,+DAA4C;AAC5C,2DAAwC;AACxC,6EAA0D;AAC1D,uEAAoD;AACpD,mDAAgC;AAChC,gEAA6C;AAEhC,QAAA,QAAQ,GAAG;IACtB,GAAG,oBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,qBAAkB;IACrB,GAAG,mBAAgB;IACnB,GAAG,4BAAwB;IAC3B,GAAG,yBAAqB;IACxB,GAAG,eAAY;CAChB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,GAAG,qBAAiB;QACpB,GAAG,qBAAkB;QACrB,GAAG,sBAAmB;QACtB,GAAG,oBAAiB;QACpB,GAAG,6BAAyB;QAC5B,GAAG,0BAAsB;QACzB,GAAG,gBAAa;KACjB;CACF,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA+F;AAC/F,2CAA4F;AAC5F,yCAAyF;AACzF,2DAAkH;AAClH,qDAAyG;AACzG,iCAA6E;AAC7E,2CAA0F;AAC1F,+CAAgG;AAEhG,kDAA+B;AAC/B,6DAA0C;AAC1C,6DAA0C;AAC1C,+DAA4C;AAC5C,2DAAwC;AACxC,6EAA0D;AAC1D,uEAAoD;AACpD,mDAAgC;AAChC,gEAA6C;AAC7C,4DAAyC;AAE5B,QAAA,QAAQ,GAAG;IACtB,GAAG,oBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,qBAAkB;IACrB,GAAG,mBAAgB;IACnB,GAAG,4BAAwB;IAC3B,GAAG,yBAAqB;IACxB,GAAG,eAAY;IACf,GAAG,sBAAkB;CACtB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,GAAG,qBAAiB;QACpB,GAAG,qBAAkB;QACrB,GAAG,sBAAmB;QACtB,GAAG,oBAAiB;QACpB,GAAG,6BAAyB;QAC5B,GAAG,0BAAsB;QACzB,GAAG,gBAAa;QAChB,GAAG,uBAAmB;KACvB;CACF,CAAA;AAED,yDAAuD;AAA9C,0GAAA,WAAW,OAAA;AACpB,2EAAqE;AAA5D,wHAAA,gBAAgB,OAAA"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const payload_log_1 = require("./payload-log");
5
+ const payload_log_query_1 = require("./payload-log-query");
6
+ const payload_log_mutation_1 = require("./payload-log-mutation");
7
+ exports.entities = [payload_log_1.PayloadLog];
8
+ exports.resolvers = [payload_log_query_1.PayloadLogQuery, payload_log_mutation_1.PayloadLogMutation];
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/payload-log/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,2DAAqD;AACrD,iEAA2D;AAE9C,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA"}
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.createPayloadLog = exports.PayloadLogMutation = void 0;
16
+ const type_graphql_1 = require("type-graphql");
17
+ const typeorm_1 = require("typeorm");
18
+ const payload_log_1 = require("./payload-log");
19
+ const payload_log_type_1 = require("./payload-log-type");
20
+ const env_1 = require("@things-factory/env");
21
+ let PayloadLogMutation = class PayloadLogMutation {
22
+ async createPayloadLog(payloadLog, context) {
23
+ const { domain, user, tx } = context.state;
24
+ return await tx.getRepository(payload_log_1.PayloadLog).save(Object.assign(Object.assign({}, payloadLog), { domain, creator: user, updater: user }));
25
+ }
26
+ async updatePayloadLog(id, patch, context) {
27
+ const { domain, user, tx } = context.state;
28
+ const repository = tx.getRepository(payload_log_1.PayloadLog);
29
+ const payloadLog = await repository.findOne({
30
+ where: { domain, id }
31
+ });
32
+ return await repository.save(Object.assign(Object.assign(Object.assign({}, payloadLog), patch), { updater: user }));
33
+ }
34
+ async updateMultiplePayloadLog(patches, context) {
35
+ const { domain, user, tx } = context.state;
36
+ let results = [];
37
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
38
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
39
+ const payloadLogRepo = tx.getRepository(payload_log_1.PayloadLog);
40
+ if (_createRecords.length > 0) {
41
+ for (let i = 0; i < _createRecords.length; i++) {
42
+ const newRecord = _createRecords[i];
43
+ const result = await payloadLogRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
44
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
45
+ }
46
+ }
47
+ if (_updateRecords.length > 0) {
48
+ for (let i = 0; i < _updateRecords.length; i++) {
49
+ const newRecord = _updateRecords[i];
50
+ const payloadLog = await payloadLogRepo.findOne(newRecord.id);
51
+ const result = await payloadLogRepo.save(Object.assign(Object.assign(Object.assign({}, payloadLog), newRecord), { updater: user }));
52
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
53
+ }
54
+ }
55
+ return results;
56
+ }
57
+ async deletePayloadLog(id, context) {
58
+ const { domain, tx } = context.state;
59
+ await tx.getRepository(payload_log_1.PayloadLog).delete({ domain, id });
60
+ return true;
61
+ }
62
+ async deletePayloadLogs(ids, context) {
63
+ const { domain, tx } = context.state;
64
+ await tx.getRepository(payload_log_1.PayloadLog).delete({
65
+ domain,
66
+ id: (0, typeorm_1.In)(ids)
67
+ });
68
+ return true;
69
+ }
70
+ };
71
+ __decorate([
72
+ (0, type_graphql_1.Directive)('@transaction'),
73
+ (0, type_graphql_1.Mutation)(returns => payload_log_1.PayloadLog, { description: 'To create new PayloadLog' }),
74
+ __param(0, (0, type_graphql_1.Arg)('payloadLog')),
75
+ __param(1, (0, type_graphql_1.Ctx)()),
76
+ __metadata("design:type", Function),
77
+ __metadata("design:paramtypes", [payload_log_type_1.NewPayloadLog, Object]),
78
+ __metadata("design:returntype", Promise)
79
+ ], PayloadLogMutation.prototype, "createPayloadLog", null);
80
+ __decorate([
81
+ (0, type_graphql_1.Directive)('@transaction'),
82
+ (0, type_graphql_1.Mutation)(returns => payload_log_1.PayloadLog, { description: 'To modify PayloadLog information' }),
83
+ __param(0, (0, type_graphql_1.Arg)('id')),
84
+ __param(1, (0, type_graphql_1.Arg)('patch')),
85
+ __param(2, (0, type_graphql_1.Ctx)()),
86
+ __metadata("design:type", Function),
87
+ __metadata("design:paramtypes", [String, payload_log_type_1.PayloadLogPatch, Object]),
88
+ __metadata("design:returntype", Promise)
89
+ ], PayloadLogMutation.prototype, "updatePayloadLog", null);
90
+ __decorate([
91
+ (0, type_graphql_1.Directive)('@transaction'),
92
+ (0, type_graphql_1.Mutation)(returns => [payload_log_1.PayloadLog], { description: "To modify multiple PayloadLogs' information" }),
93
+ __param(0, (0, type_graphql_1.Arg)('patches', type => [payload_log_type_1.PayloadLogPatch])),
94
+ __param(1, (0, type_graphql_1.Ctx)()),
95
+ __metadata("design:type", Function),
96
+ __metadata("design:paramtypes", [Array, Object]),
97
+ __metadata("design:returntype", Promise)
98
+ ], PayloadLogMutation.prototype, "updateMultiplePayloadLog", null);
99
+ __decorate([
100
+ (0, type_graphql_1.Directive)('@transaction'),
101
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete PayloadLog' }),
102
+ __param(0, (0, type_graphql_1.Arg)('id')),
103
+ __param(1, (0, type_graphql_1.Ctx)()),
104
+ __metadata("design:type", Function),
105
+ __metadata("design:paramtypes", [String, Object]),
106
+ __metadata("design:returntype", Promise)
107
+ ], PayloadLogMutation.prototype, "deletePayloadLog", null);
108
+ __decorate([
109
+ (0, type_graphql_1.Directive)('@transaction'),
110
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple payloadLogs' }),
111
+ __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
112
+ __param(1, (0, type_graphql_1.Ctx)()),
113
+ __metadata("design:type", Function),
114
+ __metadata("design:paramtypes", [Array, Object]),
115
+ __metadata("design:returntype", Promise)
116
+ ], PayloadLogMutation.prototype, "deletePayloadLogs", null);
117
+ PayloadLogMutation = __decorate([
118
+ (0, type_graphql_1.Resolver)(payload_log_1.PayloadLog)
119
+ ], PayloadLogMutation);
120
+ exports.PayloadLogMutation = PayloadLogMutation;
121
+ async function createPayloadLog(name, endpoint, request, response, context, type = payload_log_1.PayloadType.EGESTION) {
122
+ try {
123
+ const { domain, user } = context === null || context === void 0 ? void 0 : context.state;
124
+ await (0, typeorm_1.getRepository)(payload_log_1.PayloadLog).save({
125
+ name,
126
+ domain,
127
+ endpoint,
128
+ request,
129
+ response,
130
+ type,
131
+ createdBy: user,
132
+ updatedBy: user,
133
+ createdAt: new Date(),
134
+ updatedAt: new Date(),
135
+ });
136
+ }
137
+ catch (error) {
138
+ env_1.logger.error(`PayloadLog Error: ${error}`);
139
+ }
140
+ }
141
+ exports.createPayloadLog = createPayloadLog;
142
+ //# sourceMappingURL=payload-log-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload-log-mutation.js","sourceRoot":"","sources":["../../../server/service/payload-log/payload-log-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA2C;AAC3C,+CAAuD;AACvD,yDAAmE;AACnE,6CAA4C;AAM5C,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAG7B,KAAK,CAAC,gBAAgB,CAAoB,UAAyB,EAAS,OAAY;QACtF,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,E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,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAUP;AAxGU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CAyG9B;AAzGY,gDAAkB;AA4GxB,KAAK,UAAU,gBAAgB,CACpC,IAAY,EACZ,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,OAAY,EACZ,OAAoB,yBAAW,CAAC,QAAQ;IAExC,IAAI;QACF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAmC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAA;QAEvE,MAAM,IAAA,uBAAa,EAAC,wBAAU,CAAC,CAAC,IAAI,CAAC;YACnC,IAAI;YACJ,MAAM;YACN,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,IAAI;YACJ,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC,CAAA;KAGH;IAAC,OAAO,KAAK,EAAE;QACd,YAAM,CAAC,KAAK,CAAC,qBAAqB,KAAK,EAAE,CAAC,CAAA;KAC3C;AACH,CAAC;AA5BD,4CA4BC"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var _a;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.PayloadLogQuery = void 0;
17
+ const type_graphql_1 = require("type-graphql");
18
+ const typeorm_1 = require("typeorm");
19
+ const auth_base_1 = require("@things-factory/auth-base");
20
+ const shell_1 = require("@things-factory/shell");
21
+ const payload_log_1 = require("./payload-log");
22
+ const payload_log_type_1 = require("./payload-log-type");
23
+ let PayloadLogQuery = class PayloadLogQuery {
24
+ async payloadLog(id, context) {
25
+ const { domain } = context.state;
26
+ return await (0, typeorm_1.getRepository)(payload_log_1.PayloadLog).findOne({
27
+ where: { domain, id }
28
+ });
29
+ }
30
+ async payloadLogs(params, context) {
31
+ const { domain } = context.state;
32
+ const convertedParams = (0, shell_1.convertListParams)(params, {
33
+ domain
34
+ });
35
+ const [items, total] = await (0, typeorm_1.getRepository)(payload_log_1.PayloadLog).findAndCount(convertedParams);
36
+ return { items, total };
37
+ }
38
+ async domain(payloadLog) {
39
+ return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(payloadLog.domainId);
40
+ }
41
+ async updater(payloadLog) {
42
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(payloadLog.updaterId);
43
+ }
44
+ async creator(payloadLog) {
45
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(payloadLog.creatorId);
46
+ }
47
+ };
48
+ __decorate([
49
+ (0, type_graphql_1.Query)(returns => payload_log_1.PayloadLog, { description: 'To fetch a PayloadLog' }),
50
+ __param(0, (0, type_graphql_1.Arg)('id')),
51
+ __param(1, (0, type_graphql_1.Ctx)()),
52
+ __metadata("design:type", Function),
53
+ __metadata("design:paramtypes", [String, Object]),
54
+ __metadata("design:returntype", Promise)
55
+ ], PayloadLogQuery.prototype, "payloadLog", null);
56
+ __decorate([
57
+ (0, type_graphql_1.Query)(returns => payload_log_type_1.PayloadLogList, { description: 'To fetch multiple PayloadLogs' }),
58
+ __param(0, (0, type_graphql_1.Args)()),
59
+ __param(1, (0, type_graphql_1.Ctx)()),
60
+ __metadata("design:type", Function),
61
+ __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
62
+ __metadata("design:returntype", Promise)
63
+ ], PayloadLogQuery.prototype, "payloadLogs", null);
64
+ __decorate([
65
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
66
+ __param(0, (0, type_graphql_1.Root)()),
67
+ __metadata("design:type", Function),
68
+ __metadata("design:paramtypes", [payload_log_1.PayloadLog]),
69
+ __metadata("design:returntype", Promise)
70
+ ], PayloadLogQuery.prototype, "domain", null);
71
+ __decorate([
72
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
73
+ __param(0, (0, type_graphql_1.Root)()),
74
+ __metadata("design:type", Function),
75
+ __metadata("design:paramtypes", [payload_log_1.PayloadLog]),
76
+ __metadata("design:returntype", Promise)
77
+ ], PayloadLogQuery.prototype, "updater", null);
78
+ __decorate([
79
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
80
+ __param(0, (0, type_graphql_1.Root)()),
81
+ __metadata("design:type", Function),
82
+ __metadata("design:paramtypes", [payload_log_1.PayloadLog]),
83
+ __metadata("design:returntype", Promise)
84
+ ], PayloadLogQuery.prototype, "creator", null);
85
+ PayloadLogQuery = __decorate([
86
+ (0, type_graphql_1.Resolver)(payload_log_1.PayloadLog)
87
+ ], PayloadLogQuery);
88
+ exports.PayloadLogQuery = PayloadLogQuery;
89
+ //# sourceMappingURL=payload-log-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload-log-query.js","sourceRoot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,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;IAChE,CAAC;CACF,CAAA;AAlCC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,wBAAU,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;IACrD,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDAM7C;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,iCAAc,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAChE,WAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,WAAA,IAAA,kBAAG,GAAE,CAAA;;yDAAjB,iBAAS,oBAAT,iBAAS;;kDAS1C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;6CAE1C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;8CAE3C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;8CAE3C;AAnCU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAoC3B;AApCY,0CAAe"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PayloadLogList = exports.PayloadLogPatch = exports.NewPayloadLog = void 0;
13
+ const type_graphql_1 = require("type-graphql");
14
+ const payload_log_1 = require("./payload-log");
15
+ let NewPayloadLog = class NewPayloadLog {
16
+ };
17
+ __decorate([
18
+ (0, type_graphql_1.Field)(),
19
+ __metadata("design:type", String)
20
+ ], NewPayloadLog.prototype, "name", void 0);
21
+ __decorate([
22
+ (0, type_graphql_1.Field)({ nullable: true }),
23
+ __metadata("design:type", String)
24
+ ], NewPayloadLog.prototype, "description", void 0);
25
+ NewPayloadLog = __decorate([
26
+ (0, type_graphql_1.InputType)()
27
+ ], NewPayloadLog);
28
+ exports.NewPayloadLog = NewPayloadLog;
29
+ let PayloadLogPatch = class PayloadLogPatch {
30
+ };
31
+ __decorate([
32
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
33
+ __metadata("design:type", String)
34
+ ], PayloadLogPatch.prototype, "id", void 0);
35
+ __decorate([
36
+ (0, type_graphql_1.Field)({ nullable: true }),
37
+ __metadata("design:type", String)
38
+ ], PayloadLogPatch.prototype, "name", void 0);
39
+ __decorate([
40
+ (0, type_graphql_1.Field)({ nullable: true }),
41
+ __metadata("design:type", String)
42
+ ], PayloadLogPatch.prototype, "description", void 0);
43
+ __decorate([
44
+ (0, type_graphql_1.Field)(),
45
+ __metadata("design:type", String)
46
+ ], PayloadLogPatch.prototype, "cuFlag", void 0);
47
+ PayloadLogPatch = __decorate([
48
+ (0, type_graphql_1.InputType)()
49
+ ], PayloadLogPatch);
50
+ exports.PayloadLogPatch = PayloadLogPatch;
51
+ let PayloadLogList = class PayloadLogList {
52
+ };
53
+ __decorate([
54
+ (0, type_graphql_1.Field)(type => [payload_log_1.PayloadLog]),
55
+ __metadata("design:type", Array)
56
+ ], PayloadLogList.prototype, "items", void 0);
57
+ __decorate([
58
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
59
+ __metadata("design:type", Number)
60
+ ], PayloadLogList.prototype, "total", void 0);
61
+ PayloadLogList = __decorate([
62
+ (0, type_graphql_1.ObjectType)()
63
+ ], PayloadLogList);
64
+ exports.PayloadLogList = PayloadLogList;
65
+ //# sourceMappingURL=payload-log-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload-log-type.js","sourceRoot":"","sources":["../../../server/service/payload-log/payload-log-type.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAoE;AAEpE,+CAA0C;AAG1C,IAAa,aAAa,GAA1B,MAAa,aAAa;CAMzB,CAAA;AAJC;IADC,IAAA,oBAAK,GAAE;;2CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AALT,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAMzB;AANY,sCAAa;AAS1B,IAAa,eAAe,GAA5B,MAAa,eAAe;CAY3B,CAAA;AAVC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAGpB;IADC,IAAA,oBAAK,GAAE;;+CACM;AAXH,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAY3B;AAZY,0CAAe;AAe5B,IAAa,cAAc,GAA3B,MAAa,cAAc;CAM1B,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,CAAC;;6CACT;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;AALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B;AANY,wCAAc"}
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var _a, _b, _c;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.PayloadLog = exports.PayloadType = void 0;
14
+ const typeorm_1 = require("typeorm");
15
+ const type_graphql_1 = require("type-graphql");
16
+ const env_1 = require("@things-factory/env");
17
+ const shell_1 = require("@things-factory/shell");
18
+ const auth_base_1 = require("@things-factory/auth-base");
19
+ const ORMCONFIG = env_1.config.get('ormconfig', {});
20
+ const DATABASE_TYPE = ORMCONFIG.type;
21
+ var PayloadType;
22
+ (function (PayloadType) {
23
+ PayloadType["INGESTION"] = "ingestion";
24
+ PayloadType["EGESTION"] = "egestion";
25
+ })(PayloadType = exports.PayloadType || (exports.PayloadType = {}));
26
+ let PayloadLog = class PayloadLog {
27
+ };
28
+ __decorate([
29
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
30
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
31
+ __metadata("design:type", String)
32
+ ], PayloadLog.prototype, "id", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
35
+ (0, type_graphql_1.Field)({ nullable: true }),
36
+ __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
37
+ ], PayloadLog.prototype, "domain", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.RelationId)((payloadLog) => payloadLog.domain),
40
+ __metadata("design:type", String)
41
+ ], PayloadLog.prototype, "domainId", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)(),
44
+ (0, type_graphql_1.Field)(),
45
+ __metadata("design:type", String)
46
+ ], PayloadLog.prototype, "name", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({
49
+ type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
50
+ ? 'enum'
51
+ : DATABASE_TYPE == 'oracle'
52
+ ? 'varchar2'
53
+ : 'smallint',
54
+ enum: PayloadType,
55
+ default: PayloadType.EGESTION,
56
+ nullable: true
57
+ }),
58
+ (0, type_graphql_1.Field)(type => String),
59
+ __metadata("design:type", String)
60
+ ], PayloadLog.prototype, "type", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)(),
63
+ (0, type_graphql_1.Field)(),
64
+ __metadata("design:type", String)
65
+ ], PayloadLog.prototype, "endpoint", void 0);
66
+ __decorate([
67
+ (0, typeorm_1.Column)(),
68
+ (0, type_graphql_1.Field)(),
69
+ __metadata("design:type", String)
70
+ ], PayloadLog.prototype, "request", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.Column)(),
73
+ (0, type_graphql_1.Field)(),
74
+ __metadata("design:type", String)
75
+ ], PayloadLog.prototype, "response", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.CreateDateColumn)(),
78
+ (0, type_graphql_1.Field)({ nullable: true }),
79
+ __metadata("design:type", Date)
80
+ ], PayloadLog.prototype, "createdAt", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.UpdateDateColumn)(),
83
+ (0, type_graphql_1.Field)({ nullable: true }),
84
+ __metadata("design:type", Date)
85
+ ], PayloadLog.prototype, "updatedAt", void 0);
86
+ __decorate([
87
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
88
+ nullable: true
89
+ }),
90
+ (0, type_graphql_1.Field)({ nullable: true }),
91
+ __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
92
+ ], PayloadLog.prototype, "creator", void 0);
93
+ __decorate([
94
+ (0, typeorm_1.RelationId)((payloadLog) => payloadLog.creator),
95
+ __metadata("design:type", String)
96
+ ], PayloadLog.prototype, "creatorId", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
99
+ nullable: true
100
+ }),
101
+ (0, type_graphql_1.Field)({ nullable: true }),
102
+ __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
103
+ ], PayloadLog.prototype, "updater", void 0);
104
+ __decorate([
105
+ (0, typeorm_1.RelationId)((payloadLog) => payloadLog.creator),
106
+ __metadata("design:type", String)
107
+ ], PayloadLog.prototype, "updaterId", void 0);
108
+ PayloadLog = __decorate([
109
+ (0, typeorm_1.Entity)(),
110
+ (0, typeorm_1.Index)('ix_payload_log_0', (payloadLog) => [payloadLog.domain]),
111
+ (0, typeorm_1.Index)('ix_payload_log_1', (payloadLog) => [payloadLog.domain, payloadLog.endpoint]),
112
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for PayloadLog' })
113
+ ], PayloadLog);
114
+ exports.PayloadLog = PayloadLog;
115
+ //# sourceMappingURL=payload-log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload-log.js","sourceRoot":"","sources":["../../../server/service/payload-log/payload-log.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCASgB;AAChB,+CAA2E;AAE3E,6CAA4C;AAE5C,iDAA8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F,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;GACxC,UAAU,CAmEtB;AAnEY,gCAAU"}
@@ -16,12 +16,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.ScenarioQuery = void 0;
17
17
  const type_graphql_1 = require("type-graphql");
18
18
  const typeorm_1 = require("typeorm");
19
- const shell_1 = require("@things-factory/shell");
20
19
  const auth_base_1 = require("@things-factory/auth-base");
21
- const scenario_type_1 = require("./scenario-type");
20
+ const shell_1 = require("@things-factory/shell");
21
+ const engine_1 = require("../../engine");
22
22
  const scenario_instance_type_1 = require("../scenario-instance/scenario-instance-type");
23
23
  const step_type_1 = require("../step/step-type");
24
- const engine_1 = require("../../engine");
24
+ const scenario_type_1 = require("./scenario-type");
25
25
  let ScenarioQuery = class ScenarioQuery {
26
26
  async scenario(id, context) {
27
27
  const { domain } = context.state;
@@ -31,7 +31,10 @@ let ScenarioQuery = class ScenarioQuery {
31
31
  }
32
32
  async scenarios(params, context) {
33
33
  const { domain } = context.state;
34
- const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
34
+ const convertedParams = (0, shell_1.convertListParams)(params, {
35
+ domain,
36
+ searchables: ['name', 'description', 'type']
37
+ });
35
38
  const [items, total] = await (0, typeorm_1.getRepository)(scenario_type_1.Scenario).findAndCount(convertedParams);
36
39
  return { items, total };
37
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-query.js","sourceRoot":"","sources":["../../../server/service/scenario/scenario-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,qCAAuC;AACvC,iDAA4E;AAC5E,yDAAgD;AAChD,mDAAwD;AACxD,wFAAsG;AACtG,iDAAwC;AACxC,yCAA6C;AAG7C,IAAa,aAAa,GAA1B,MAAa,aAAa;IAExB,KAAK,CAAC,QAAQ,CAAY,EAAU,EAAS,OAAY;QACvD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,C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WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAW,wBAAQ;;4CAEvC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAW,wBAAQ;;4CAEvC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,gBAAI,CAAC,CAAC;IACjB,WAAA,IAAA,mBAAI,GAAE,CAAA;IAAsB,WAAA,IAAA,kBAAG,GAAE,CAAA;;qCAAhB,wBAAQ;;0CAMrC;AAKD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACrC,WAAA,IAAA,mBAAI,GAAE,CAAA;IAAsB,WAAA,IAAA,kBAAG,GAAE,CAAA;;qCAAhB,wBAAQ;;0CAKrC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,yCAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7C,WAAA,IAAA,mBAAI,GAAE,CAAA;IAAsB,WAAA,IAAA,kBAAG,GAAE,CAAA;;qCAAhB,wBAAQ;;8CAIzC;AA9DU,aAAa;IADzB,IAAA,uBAAQ,EAAC,wBAAQ,CAAC;GACN,aAAa,CA+DzB;AA/DY,sCAAa"}
@@ -16,8 +16,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.ScenarioInstanceQuery = void 0;
17
17
  const type_graphql_1 = require("type-graphql");
18
18
  const shell_1 = require("@things-factory/shell");
19
- const scenario_instance_type_1 = require("./scenario-instance-type");
20
19
  const engine_1 = require("../../engine");
20
+ const scenario_instance_type_1 = require("./scenario-instance-type");
21
21
  let ScenarioInstanceQuery = class ScenarioInstanceQuery {
22
22
  async scenarioInstance(instanceName, context) {
23
23
  const { domain } = context.state;
@@ -27,7 +27,9 @@ let ScenarioInstanceQuery = class ScenarioInstanceQuery {
27
27
  const { domain } = context.state;
28
28
  var scenarioInstances = engine_1.ScenarioEngine.getScenarioInstances(domain);
29
29
  /* IMPLEMENT-ME 검색 기능.. */
30
- const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
30
+ const convertedParams = (0, shell_1.convertListParams)(params, {
31
+ domain
32
+ });
31
33
  var items = scenarioInstances;
32
34
  return {
33
35
  items,
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-instance-query.js","sourceRoot":"","sources":["../../../server/service/scenario-instance/scenario-instance-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAmF;AACnF,iDAAkF;AAClF,qEAAmI;AACnI,yCAA6C;AAG7C,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAEhC,KAAK,CAAC,gBAAgB,CAAsB,YAAoB,EAAS,OAAY;QACnF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,uBAAc,CAAC,mBAAmB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACjE,CAAC;IAGD,KAAK,CAAC,iBAAiB,CAAS,MAAiB,EAAS,OAAY;QACpE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,IAAI,iBAAiB,GAAG,uBAAc,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAA;QACnE,0BAA0B;QAC1B,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;QAE5D,IAAI,KAAK,GAAG,iBAAiB,CAAA;QAE7B,OAAO;YACL,KAAK;YACL,KAAK,EAAE,KAAK,CAAC,MAAM;SACpB,CAAA;IACH,CAAC;IAGD,KAAK,CAAC,IAAI,CAAS,gBAAkC;;QACnD,OAAO,MAAA,gBAAgB,CAAC,OAAO,0CAAE,IAAwB,CAAA;IAC3D,CAAC;IAGD,KAAK,CAAC,KAAK,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,CAAC,iDAAwB,CAAC;IACtC,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,yCAAgB;oCAAG,iDAAwB;qDAE7E;AAED;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,CAAC;IACnB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,yCAAgB;;sDAEzD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,CAAC;IACxB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,yCAAgB;;iDAEpD;AAGD;IADC,IAAA,4BAAa,GAAE;IACC,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,yCAAgB;;sDAEzD;AAnDU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,yCAAgB,CAAC;GACd,qBAAqB,CAoDjC;AApDY,sDAAqB"}
1
+ {"version":3,"file":"scenario-instance-query.js","sourceRoot":"","sources":["../../../server/service/scenario-instance/scenario-instance-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAmF;AAEnF,iDAAkF;AAElF,yCAA6C;AAC7C,qEAKiC;AAGjC,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAEhC,KAAK,CAAC,gBAAgB,CAAsB,YAAoB,EAAS,OAAY;QACnF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,uBAAc,CAAC,mBAAmB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACjE,CAAC;IAGD,KAAK,CAAC,iBAAiB,CAAS,MAAiB,EAAS,OAAY;QACpE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,IAAI,iBAAiB,GAAG,uBAAc,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAA;QACnE,0BAA0B;QAC1B,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE;YAChD,MAAM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,EAAE,CAAC,yCAAgB,CAAC;IAC5B,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,yCAAgB;;iDAEpD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,+CAAsB,CAAC;IACjC,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,yCAAgB;;kDAErD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,iDAAwB,CAAC;IACtC,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,yCAAgB;oCAAG,iDAAwB;qDAE7E;AAED;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,CAAC;IACnB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,yCAAgB;;sDAEzD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,CAAC;IACxB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,yCAAgB;;iDAEpD;AAGD;IADC,IAAA,4BAAa,GAAE;IACC,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAmB,yCAAgB;;sDAEzD;AArDU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,yCAAgB,CAAC;GACd,qBAAqB,CAsDjC;AAtDY,sDAAqB"}
@@ -16,10 +16,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.StepQuery = void 0;
17
17
  const type_graphql_1 = require("type-graphql");
18
18
  const typeorm_1 = require("typeorm");
19
- const shell_1 = require("@things-factory/shell");
20
19
  const auth_base_1 = require("@things-factory/auth-base");
21
- const step_type_1 = require("./step-type");
20
+ const shell_1 = require("@things-factory/shell");
22
21
  const scenario_type_1 = require("../scenario/scenario-type");
22
+ const step_type_1 = require("./step-type");
23
23
  let StepQuery = class StepQuery {
24
24
  async step(name, context) {
25
25
  const { domain } = context.state;
@@ -29,7 +29,7 @@ let StepQuery = class StepQuery {
29
29
  }
30
30
  async steps(params, context) {
31
31
  const { domain } = context.state;
32
- const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
32
+ const convertedParams = (0, shell_1.convertListParams)(params, { domain });
33
33
  const [items, total] = await (0, typeorm_1.getRepository)(step_type_1.Step).findAndCount(convertedParams);
34
34
  return { items, total };
35
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"step-query.js","sourceRoot":"","sources":["../../../server/service/step/step-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,qCAAuC;AACvC,iDAA4E;AAC5E,yDAAgD;AAChD,2CAA4C;AAC5C,6DAAoD;AAGpD,IAAa,SAAS,GAAtB,MAAa,SAAS;IAEpB,KAAK,CAAC,IAAI,CAAc,IAAY,EAAS,OAAY;QACvD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC,CAAC,OAAO,CAAC;YACvC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,KAAK,CAAS,MAAiB,EAAS,OAAY;QACxD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAE9E,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGD,KAAK,CAAC,QAAQ,CAAS,IAAU;QAC/B,OAAO,MAAM,IAAA,uBAAa,EAAC,wBAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAC/D,CAAC;IAGD,KAA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CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAO,gBAAI;;wCAE/B;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAO,gBAAI;;wCAE/B;AAtCU,SAAS;IADrB,IAAA,uBAAQ,EAAC,gBAAI,CAAC;GACF,SAAS,CAuCrB;AAvCY,8BAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-base",
3
- "version": "5.0.0-alpha.51",
3
+ "version": "5.0.0-alpha.52",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -26,11 +26,11 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@apollo/client": "^3.5.10",
29
- "@things-factory/api": "^5.0.0-alpha.51",
30
- "@things-factory/auth-base": "^5.0.0-alpha.51",
31
- "@things-factory/env": "^5.0.0-alpha.51",
32
- "@things-factory/oauth2-client": "^5.0.0-alpha.51",
33
- "@things-factory/shell": "^5.0.0-alpha.51",
29
+ "@things-factory/api": "^5.0.0-alpha.52",
30
+ "@things-factory/auth-base": "^5.0.0-alpha.52",
31
+ "@things-factory/env": "^5.0.0-alpha.52",
32
+ "@things-factory/oauth2-client": "^5.0.0-alpha.52",
33
+ "@things-factory/shell": "^5.0.0-alpha.52",
34
34
  "async-mqtt": "^2.5.0",
35
35
  "cron": "^1.7.2",
36
36
  "cross-fetch": "^3.0.4",
@@ -41,5 +41,5 @@
41
41
  "promise-socket": "^7.0.0",
42
42
  "vm2": "^3.9.2"
43
43
  },
44
- "gitHead": "b83a1e08b773501783b4a95438291ce96f558bde"
44
+ "gitHead": "dd9c8f2e256e256e42bd9bd26db5eaa955f85620"
45
45
  }
@@ -66,6 +66,6 @@ LocalGraphqlQuery.parameterSpec = [
66
66
  ]
67
67
 
68
68
  LocalGraphqlQuery.connectorFree = true
69
- LocalGraphqlQuery.help = 'integration/task/local-graphql-mutate'
69
+ LocalGraphqlQuery.help = 'integration/task/local-graphql-query'
70
70
 
71
71
  TaskRegistry.registerTaskHandler('local-graphql-query', LocalGraphqlQuery)
@@ -1,9 +1,11 @@
1
- import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
1
+ import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'
2
2
  import { getRepository } from 'typeorm'
3
- import { Domain, ListParam, convertListParams } from '@things-factory/shell'
3
+
4
4
  import { User } from '@things-factory/auth-base'
5
- import { Connection, ConnectionList, ConnectionState, ConnectionStatus } from './connection-type'
5
+ import { convertListParams, Domain, ListParam } from '@things-factory/shell'
6
+
6
7
  import { ConnectionManager } from '../../engine/connection-manager'
8
+ import { Connection, ConnectionList, ConnectionState, ConnectionStatus } from './connection-type'
7
9
 
8
10
  @Resolver(Connection)
9
11
  export class ConnectionQuery {
@@ -28,7 +30,10 @@ export class ConnectionQuery {
28
30
  async connections(@Args() params: ListParam, @Ctx() context: any): Promise<ConnectionList> {
29
31
  const { domain } = context.state
30
32
 
31
- const convertedParams = convertListParams(params, domain.id)
33
+ const convertedParams = convertListParams(params, {
34
+ domain,
35
+ searchables: ['name', 'description', 'type', 'endpoint']
36
+ })
32
37
  const [items, total] = await getRepository(Connection).findAndCount({
33
38
  ...convertedParams,
34
39
  relations: ['domain']
@@ -5,6 +5,7 @@ import { entities as ScenarioInstanceEntities, resolvers as ScenarioInstanceReso
5
5
  import { entities as ScenarioQueueEntities, resolvers as ScenarioQueueResolvers } from './scenario-queue'
6
6
  import { entities as StepEntities, resolvers as StepResolvers } from './step'
7
7
  import { entities as TaskTypeEntities, resolvers as TaskTypeResolvers } from './task-type'
8
+ import { entities as PayloadLogEntities, resolvers as PayloadLogResolvers } from './payload-log'
8
9
 
9
10
  export * from './property-spec'
10
11
  export * from './task-type/task-type-type'
@@ -15,6 +16,7 @@ export * from './scenario-instance/scenario-instance-type'
15
16
  export * from './scenario-queue/scenario-queue-type'
16
17
  export * from './step/step-type'
17
18
  export * from './scenario-flow/scenario-flow'
19
+ export * from './payload-log/payload-log'
18
20
 
19
21
  export const entities = [
20
22
  ...TaskTypeEntities,
@@ -23,7 +25,8 @@ export const entities = [
23
25
  ...ScenarioEntities,
24
26
  ...ScenarioInstanceEntities,
25
27
  ...ScenarioQueueEntities,
26
- ...StepEntities
28
+ ...StepEntities,
29
+ ...PayloadLogEntities
27
30
  ]
28
31
 
29
32
  export const schema = {
@@ -34,6 +37,10 @@ export const schema = {
34
37
  ...ScenarioResolvers,
35
38
  ...ScenarioInstanceResolvers,
36
39
  ...ScenarioQueueResolvers,
37
- ...StepResolvers
40
+ ...StepResolvers,
41
+ ...PayloadLogResolvers
38
42
  ]
39
43
  }
44
+
45
+ export { PayloadType } from './payload-log/payload-log'
46
+ export { createPayloadLog } from './payload-log/payload-log-mutation'
@@ -0,0 +1,7 @@
1
+ import { PayloadLog } from './payload-log'
2
+ import { PayloadLogQuery } from './payload-log-query'
3
+ import { PayloadLogMutation } from './payload-log-mutation'
4
+
5
+ export const entities = [PayloadLog]
6
+ export const resolvers = [PayloadLogQuery, PayloadLogMutation]
7
+
@@ -0,0 +1,147 @@
1
+ import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'
2
+ import { getRepository, In } from 'typeorm'
3
+ import { PayloadLog, PayloadType } from './payload-log'
4
+ import { NewPayloadLog, PayloadLogPatch } from './payload-log-type'
5
+ import { logger } from '@things-factory/env'
6
+ import { Domain } from '@things-factory/shell'
7
+ import { User } from '@things-factory/auth-base'
8
+ import { Bizplace } from '@things-factory/biz-base'
9
+
10
+ @Resolver(PayloadLog)
11
+ export class PayloadLogMutation {
12
+ @Directive('@transaction')
13
+ @Mutation(returns => PayloadLog, { description: 'To create new PayloadLog' })
14
+ async createPayloadLog(@Arg('payloadLog') payloadLog: NewPayloadLog, @Ctx() context: any): Promise<PayloadLog> {
15
+ const { domain, user, tx } = context.state
16
+
17
+ return await tx.getRepository(PayloadLog).save({
18
+ ...payloadLog,
19
+ domain,
20
+ creator: user,
21
+ updater: user
22
+ })
23
+ }
24
+
25
+ @Directive('@transaction')
26
+ @Mutation(returns => PayloadLog, { description: 'To modify PayloadLog information' })
27
+ async updatePayloadLog(
28
+ @Arg('id') id: string,
29
+ @Arg('patch') patch: PayloadLogPatch,
30
+ @Ctx() context: any
31
+ ): Promise<PayloadLog> {
32
+ const { domain, user, tx } = context.state
33
+
34
+ const repository = tx.getRepository(PayloadLog)
35
+ const payloadLog = await repository.findOne({
36
+ where: { domain, id }
37
+ })
38
+
39
+ return await repository.save({
40
+ ...payloadLog,
41
+ ...patch,
42
+ updater: user
43
+ })
44
+ }
45
+
46
+ @Directive('@transaction')
47
+ @Mutation(returns => [PayloadLog], { description: "To modify multiple PayloadLogs' information" })
48
+ async updateMultiplePayloadLog(
49
+ @Arg('patches', type => [PayloadLogPatch]) patches: PayloadLogPatch[],
50
+ @Ctx() context: any
51
+ ): Promise<PayloadLog[]> {
52
+ const { domain, user, tx } = context.state
53
+
54
+ let results = []
55
+ const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')
56
+ const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')
57
+ const payloadLogRepo = tx.getRepository(PayloadLog)
58
+
59
+ if (_createRecords.length > 0) {
60
+ for (let i = 0; i < _createRecords.length; i++) {
61
+ const newRecord = _createRecords[i]
62
+
63
+ const result = await payloadLogRepo.save({
64
+ ...newRecord,
65
+ domain,
66
+ creator: user,
67
+ updater: user
68
+ })
69
+
70
+ results.push({ ...result, cuFlag: '+' })
71
+ }
72
+ }
73
+
74
+ if (_updateRecords.length > 0) {
75
+ for (let i = 0; i < _updateRecords.length; i++) {
76
+ const newRecord = _updateRecords[i]
77
+ const payloadLog = await payloadLogRepo.findOne(newRecord.id)
78
+
79
+ const result = await payloadLogRepo.save({
80
+ ...payloadLog,
81
+ ...newRecord,
82
+ updater: user
83
+ })
84
+
85
+ results.push({ ...result, cuFlag: 'M' })
86
+ }
87
+ }
88
+
89
+ return results
90
+ }
91
+
92
+ @Directive('@transaction')
93
+ @Mutation(returns => Boolean, { description: 'To delete PayloadLog' })
94
+ async deletePayloadLog(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {
95
+ const { domain, tx } = context.state
96
+
97
+ await tx.getRepository(PayloadLog).delete({ domain, id })
98
+ return true
99
+ }
100
+
101
+ @Directive('@transaction')
102
+ @Mutation(returns => Boolean, { description: 'To delete multiple payloadLogs' })
103
+ async deletePayloadLogs(
104
+ @Arg('ids', type => [String]) ids: string[],
105
+ @Ctx() context: any
106
+ ): Promise<boolean> {
107
+ const { domain, tx } = context.state
108
+
109
+ await tx.getRepository(PayloadLog).delete({
110
+ domain,
111
+ id: In(ids)
112
+ })
113
+
114
+ return true
115
+ }
116
+ }
117
+
118
+
119
+ export async function createPayloadLog(
120
+ name: string,
121
+ endpoint: string,
122
+ request: string,
123
+ response: string,
124
+ context: any,
125
+ type: PayloadType = PayloadType.EGESTION
126
+ ): Promise<void> {
127
+ try {
128
+ const { domain, user }: { domain: Domain; user: User } = context?.state
129
+
130
+ await getRepository(PayloadLog).save({
131
+ name,
132
+ domain,
133
+ endpoint,
134
+ request,
135
+ response,
136
+ type,
137
+ createdBy: user,
138
+ updatedBy: user,
139
+ createdAt: new Date(),
140
+ updatedAt: new Date(),
141
+ })
142
+
143
+
144
+ } catch (error) {
145
+ logger.error(`PayloadLog Error: ${error}`)
146
+ }
147
+ }
@@ -0,0 +1,47 @@
1
+ import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'
2
+ import { getRepository } from 'typeorm'
3
+
4
+ import { User } from '@things-factory/auth-base'
5
+ import { convertListParams, Domain, ListParam } from '@things-factory/shell'
6
+
7
+ import { PayloadLog } from './payload-log'
8
+ import { PayloadLogList } from './payload-log-type'
9
+
10
+ @Resolver(PayloadLog)
11
+ export class PayloadLogQuery {
12
+ @Query(returns => PayloadLog, { description: 'To fetch a PayloadLog' })
13
+ async payloadLog(@Arg('id') id: string, @Ctx() context: any): Promise<PayloadLog> {
14
+ const { domain } = context.state
15
+
16
+ return await getRepository(PayloadLog).findOne({
17
+ where: { domain, id }
18
+ })
19
+ }
20
+
21
+ @Query(returns => PayloadLogList, { description: 'To fetch multiple PayloadLogs' })
22
+ async payloadLogs(@Args() params: ListParam, @Ctx() context: any): Promise<PayloadLogList> {
23
+ const { domain } = context.state
24
+
25
+ const convertedParams = convertListParams(params, {
26
+ domain
27
+ })
28
+ const [items, total] = await getRepository(PayloadLog).findAndCount(convertedParams)
29
+
30
+ return { items, total }
31
+ }
32
+
33
+ @FieldResolver(type => Domain)
34
+ async domain(@Root() payloadLog: PayloadLog): Promise<Domain> {
35
+ return await getRepository(Domain).findOne(payloadLog.domainId)
36
+ }
37
+
38
+ @FieldResolver(type => User)
39
+ async updater(@Root() payloadLog: PayloadLog): Promise<User> {
40
+ return await getRepository(User).findOne(payloadLog.updaterId)
41
+ }
42
+
43
+ @FieldResolver(type => User)
44
+ async creator(@Root() payloadLog: PayloadLog): Promise<User> {
45
+ return await getRepository(User).findOne(payloadLog.creatorId)
46
+ }
47
+ }
@@ -0,0 +1,36 @@
1
+ import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
2
+
3
+ import { PayloadLog } from './payload-log'
4
+
5
+ @InputType()
6
+ export class NewPayloadLog {
7
+ @Field()
8
+ name: string
9
+
10
+ @Field({ nullable: true })
11
+ description?: string
12
+ }
13
+
14
+ @InputType()
15
+ export class PayloadLogPatch {
16
+ @Field(type => ID, { nullable: true })
17
+ id?: string
18
+
19
+ @Field({ nullable: true })
20
+ name?: string
21
+
22
+ @Field({ nullable: true })
23
+ description?: string
24
+
25
+ @Field()
26
+ cuFlag: string
27
+ }
28
+
29
+ @ObjectType()
30
+ export class PayloadLogList {
31
+ @Field(type => [PayloadLog])
32
+ items: PayloadLog[]
33
+
34
+ @Field(type => Int)
35
+ total: number
36
+ }
@@ -0,0 +1,97 @@
1
+ import {
2
+ CreateDateColumn,
3
+ UpdateDateColumn,
4
+ Entity,
5
+ Index,
6
+ Column,
7
+ RelationId,
8
+ ManyToOne,
9
+ PrimaryGeneratedColumn
10
+ } from 'typeorm'
11
+ import { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
12
+
13
+ import { config } from '@things-factory/env'
14
+ import { Bizplace } from '@things-factory/biz-base'
15
+ import { Domain } from '@things-factory/shell'
16
+ import { User } from '@things-factory/auth-base'
17
+
18
+ const ORMCONFIG = config.get('ormconfig', {})
19
+ const DATABASE_TYPE = ORMCONFIG.type
20
+
21
+ export enum PayloadType {
22
+ INGESTION = 'ingestion',
23
+ EGESTION = 'egestion',
24
+ }
25
+ @Entity()
26
+ @Index('ix_payload_log_0', (payloadLog: PayloadLog) => [payloadLog.domain])
27
+
28
+ @Index('ix_payload_log_1', (payloadLog: PayloadLog) => [payloadLog.domain, payloadLog.endpoint])
29
+ @ObjectType({ description: 'Entity for PayloadLog' })
30
+ export class PayloadLog {
31
+ @PrimaryGeneratedColumn('uuid')
32
+ @Field(type => ID)
33
+ readonly id: string
34
+
35
+ @ManyToOne(type => Domain)
36
+ @Field({ nullable: true })
37
+ domain?: Domain
38
+
39
+ @RelationId((payloadLog: PayloadLog) => payloadLog.domain)
40
+ domainId?: string
41
+
42
+ @Column()
43
+ @Field()
44
+ name: string
45
+
46
+ @Column({
47
+ type:
48
+ DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
49
+ ? 'enum'
50
+ : DATABASE_TYPE == 'oracle'
51
+ ? 'varchar2'
52
+ : 'smallint',
53
+ enum: PayloadType,
54
+ default: PayloadType.EGESTION,
55
+ nullable: true
56
+ })
57
+ @Field(type => String)
58
+ type: PayloadType
59
+
60
+ @Column()
61
+ @Field()
62
+ endpoint: string
63
+
64
+ @Column()
65
+ @Field()
66
+ request: string
67
+
68
+ @Column()
69
+ @Field()
70
+ response: string
71
+
72
+ @CreateDateColumn()
73
+ @Field({ nullable: true })
74
+ createdAt?: Date
75
+
76
+ @UpdateDateColumn()
77
+ @Field({ nullable: true })
78
+ updatedAt?: Date
79
+
80
+ @ManyToOne(type => User, {
81
+ nullable: true
82
+ })
83
+ @Field({ nullable: true })
84
+ creator?: User
85
+
86
+ @RelationId((payloadLog: PayloadLog) => payloadLog.creator)
87
+ creatorId?: string
88
+
89
+ @ManyToOne(type => User, {
90
+ nullable: true
91
+ })
92
+ @Field({ nullable: true })
93
+ updater?: User
94
+
95
+ @RelationId((payloadLog: PayloadLog) => payloadLog.creator)
96
+ updaterId?: string
97
+ }
@@ -1,11 +1,13 @@
1
- import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
1
+ import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'
2
2
  import { getRepository } from 'typeorm'
3
- import { Domain, ListParam, convertListParams } from '@things-factory/shell'
3
+
4
4
  import { User } from '@things-factory/auth-base'
5
- import { Scenario, ScenarioList } from './scenario-type'
5
+ import { convertListParams, Domain, ListParam } from '@things-factory/shell'
6
+
7
+ import { ScenarioEngine } from '../../engine'
6
8
  import { ScenarioInstance, ScenarioInstanceStatus } from '../scenario-instance/scenario-instance-type'
7
9
  import { Step } from '../step/step-type'
8
- import { ScenarioEngine } from '../../engine'
10
+ import { Scenario, ScenarioList } from './scenario-type'
9
11
 
10
12
  @Resolver(Scenario)
11
13
  export class ScenarioQuery {
@@ -22,7 +24,10 @@ export class ScenarioQuery {
22
24
  async scenarios(@Args() params: ListParam, @Ctx() context: any): Promise<ScenarioList> {
23
25
  const { domain } = context.state
24
26
 
25
- const convertedParams = convertListParams(params, domain.id)
27
+ const convertedParams = convertListParams(params, {
28
+ domain,
29
+ searchables: ['name', 'description', 'type']
30
+ })
26
31
  const [items, total] = await getRepository(Scenario).findAndCount(convertedParams)
27
32
 
28
33
  return { items, total }
@@ -1,7 +1,14 @@
1
- import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'
2
- import { ListParam, convertListParams, ScalarObject } from '@things-factory/shell'
3
- import { ScenarioInstance, ScenarioInstanceList, ScenarioInstanceStatus, ScenarioInstanceProgress } from './scenario-instance-type'
1
+ import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'
2
+
3
+ import { convertListParams, ListParam, ScalarObject } from '@things-factory/shell'
4
+
4
5
  import { ScenarioEngine } from '../../engine'
6
+ import {
7
+ ScenarioInstance,
8
+ ScenarioInstanceList,
9
+ ScenarioInstanceProgress,
10
+ ScenarioInstanceStatus
11
+ } from './scenario-instance-type'
5
12
 
6
13
  @Resolver(ScenarioInstance)
7
14
  export class ScenarioInstanceQuery {
@@ -18,7 +25,9 @@ export class ScenarioInstanceQuery {
18
25
 
19
26
  var scenarioInstances = ScenarioEngine.getScenarioInstances(domain)
20
27
  /* IMPLEMENT-ME 검색 기능.. */
21
- const convertedParams = convertListParams(params, domain.id)
28
+ const convertedParams = convertListParams(params, {
29
+ domain
30
+ })
22
31
 
23
32
  var items = scenarioInstances
24
33
 
@@ -1,9 +1,11 @@
1
- import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
1
+ import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'
2
2
  import { getRepository } from 'typeorm'
3
- import { Domain, ListParam, convertListParams } from '@things-factory/shell'
3
+
4
4
  import { User } from '@things-factory/auth-base'
5
- import { Step, StepList } from './step-type'
5
+ import { convertListParams, Domain, ListParam } from '@things-factory/shell'
6
+
6
7
  import { Scenario } from '../scenario/scenario-type'
8
+ import { Step, StepList } from './step-type'
7
9
 
8
10
  @Resolver(Step)
9
11
  export class StepQuery {
@@ -20,7 +22,7 @@ export class StepQuery {
20
22
  async steps(@Args() params: ListParam, @Ctx() context: any): Promise<StepList> {
21
23
  const { domain } = context.state
22
24
 
23
- const convertedParams = convertListParams(params, domain.id)
25
+ const convertedParams = convertListParams(params, { domain })
24
26
  const [items, total] = await getRepository(Step).findAndCount(convertedParams)
25
27
 
26
28
  return { items, total }