@things-factory/shell 4.3.671 → 4.3.673

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 (89) hide show
  1. package/dist-server/graphql-local-client.js +36 -0
  2. package/dist-server/graphql-local-client.js.map +1 -0
  3. package/dist-server/index.js +25 -0
  4. package/dist-server/index.js.map +1 -0
  5. package/dist-server/initializers/database.js +30 -0
  6. package/dist-server/initializers/database.js.map +1 -0
  7. package/dist-server/initializers/naming-strategy.js +19 -0
  8. package/dist-server/initializers/naming-strategy.js.map +1 -0
  9. package/dist-server/middlewares/domain-middleware.js +23 -0
  10. package/dist-server/middlewares/domain-middleware.js.map +1 -0
  11. package/dist-server/middlewares/index.js +59 -0
  12. package/dist-server/middlewares/index.js.map +1 -0
  13. package/dist-server/migrations/1000000000000-SeedDomain.js +29 -0
  14. package/dist-server/migrations/1000000000000-SeedDomain.js.map +1 -0
  15. package/dist-server/migrations/index.js +12 -0
  16. package/dist-server/migrations/index.js.map +1 -0
  17. package/dist-server/pubsub-log-transport.js +27 -0
  18. package/dist-server/pubsub-log-transport.js.map +1 -0
  19. package/dist-server/pubsub.js +84 -0
  20. package/dist-server/pubsub.js.map +1 -0
  21. package/dist-server/routers/domain-router.js +20 -0
  22. package/dist-server/routers/domain-router.js.map +1 -0
  23. package/dist-server/routers/global-router.js +47 -0
  24. package/dist-server/routers/global-router.js.map +1 -0
  25. package/dist-server/routers/index.js +19 -0
  26. package/dist-server/routers/index.js.map +1 -0
  27. package/dist-server/schema.js +109 -0
  28. package/dist-server/schema.js.map +1 -0
  29. package/dist-server/server-dev.js +217 -0
  30. package/dist-server/server-dev.js.map +1 -0
  31. package/dist-server/server.js +177 -0
  32. package/dist-server/server.js.map +1 -0
  33. package/dist-server/service/common-types/index.js +23 -0
  34. package/dist-server/service/common-types/index.js.map +1 -0
  35. package/dist-server/service/common-types/list-param.js +83 -0
  36. package/dist-server/service/common-types/list-param.js.map +1 -0
  37. package/dist-server/service/common-types/log.js +37 -0
  38. package/dist-server/service/common-types/log.js.map +1 -0
  39. package/dist-server/service/common-types/object-ref.js +32 -0
  40. package/dist-server/service/common-types/object-ref.js.map +1 -0
  41. package/dist-server/service/common-types/scalar-any.js +45 -0
  42. package/dist-server/service/common-types/scalar-any.js.map +1 -0
  43. package/dist-server/service/common-types/scalar-date.js +25 -0
  44. package/dist-server/service/common-types/scalar-date.js.map +1 -0
  45. package/dist-server/service/common-types/scalar-object.js +18 -0
  46. package/dist-server/service/common-types/scalar-object.js.map +1 -0
  47. package/dist-server/service/directive-transaction/index.js +18 -0
  48. package/dist-server/service/directive-transaction/index.js.map +1 -0
  49. package/dist-server/service/directive-transaction/transaction.js +35 -0
  50. package/dist-server/service/directive-transaction/transaction.js.map +1 -0
  51. package/dist-server/service/domain/domain-resolver.js +150 -0
  52. package/dist-server/service/domain/domain-resolver.js.map +1 -0
  53. package/dist-server/service/domain/domain-types.js +89 -0
  54. package/dist-server/service/domain/domain-types.js.map +1 -0
  55. package/dist-server/service/domain/domain.js +113 -0
  56. package/dist-server/service/domain/domain.js.map +1 -0
  57. package/dist-server/service/domain/index.js +8 -0
  58. package/dist-server/service/domain/index.js.map +1 -0
  59. package/dist-server/service/index.js +45 -0
  60. package/dist-server/service/index.js.map +1 -0
  61. package/dist-server/service/subscription-data/data-resolver.js +62 -0
  62. package/dist-server/service/subscription-data/data-resolver.js.map +1 -0
  63. package/dist-server/service/subscription-data/data-types.js +35 -0
  64. package/dist-server/service/subscription-data/data-types.js.map +1 -0
  65. package/dist-server/service/subscription-data/index.js +7 -0
  66. package/dist-server/service/subscription-data/index.js.map +1 -0
  67. package/dist-server/utils/condition-builder.js +126 -0
  68. package/dist-server/utils/condition-builder.js.map +1 -0
  69. package/dist-server/utils/get-domain.js +128 -0
  70. package/dist-server/utils/get-domain.js.map +1 -0
  71. package/dist-server/utils/index.js +22 -0
  72. package/dist-server/utils/index.js.map +1 -0
  73. package/dist-server/utils/list-params-converter.js +102 -0
  74. package/dist-server/utils/list-params-converter.js.map +1 -0
  75. package/dist-server/utils/list-query-builder.js +51 -0
  76. package/dist-server/utils/list-query-builder.js.map +1 -0
  77. package/dist-server/utils/publish-progress.js +18 -0
  78. package/dist-server/utils/publish-progress.js.map +1 -0
  79. package/dist-server/webpack/koa-webpack/client.js +24 -0
  80. package/dist-server/webpack/koa-webpack/client.js.map +1 -0
  81. package/dist-server/webpack/koa-webpack/index.js +58 -0
  82. package/dist-server/webpack/koa-webpack/index.js.map +1 -0
  83. package/dist-server/webpack/koa-webpack/middleware.js +42 -0
  84. package/dist-server/webpack/koa-webpack/middleware.js.map +1 -0
  85. package/dist-server/webpack/koa-webpack/validate.js +26 -0
  86. package/dist-server/webpack/koa-webpack/validate.js.map +1 -0
  87. package/package.json +2 -2
  88. package/server/index.ts +0 -2
  89. package/server/pubsub.ts +1 -1
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScalarAny = void 0;
4
+ const graphql_1 = require("graphql");
5
+ function parseObject(ast) {
6
+ const value = Object.create(null);
7
+ ast.fields.forEach(field => {
8
+ value[field.name.value] = parseAst(field.value);
9
+ });
10
+ return value;
11
+ }
12
+ function parseAst(ast) {
13
+ switch (ast.kind) {
14
+ case graphql_1.Kind.INT:
15
+ return parseInt(ast.value);
16
+ case graphql_1.Kind.FLOAT:
17
+ return parseFloat(ast.value);
18
+ case graphql_1.Kind.BOOLEAN:
19
+ return ast.value;
20
+ case graphql_1.Kind.STRING:
21
+ return ast.value;
22
+ case graphql_1.Kind.LIST:
23
+ return ast.values.map(parseAst);
24
+ case graphql_1.Kind.OBJECT:
25
+ return parseObject(ast);
26
+ default:
27
+ return null;
28
+ }
29
+ }
30
+ exports.ScalarAny = new graphql_1.GraphQLScalarType({
31
+ name: 'Any',
32
+ description: 'Any Scalar type (String, Boolean, Int, Float, Object, List)',
33
+ serialize(value) {
34
+ // Implement your own behavior here by setting the 'result' variable
35
+ return value;
36
+ },
37
+ parseValue(value) {
38
+ // Implement your own behavior here by setting the 'result' variable
39
+ return value;
40
+ },
41
+ parseLiteral(ast) {
42
+ return parseAst(ast);
43
+ }
44
+ });
45
+ //# sourceMappingURL=scalar-any.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalar-any.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-any.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAEjD,SAAS,WAAW,CAAC,GAAG;IACtB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACjC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACzB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;IACF,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,QAAQ,CAAC,GAAG;IACnB,QAAQ,GAAG,CAAC,IAAI,EAAE;QAChB,KAAK,cAAI,CAAC,GAAG;YACX,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC5B,KAAK,cAAI,CAAC,KAAK;YACb,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC9B,KAAK,cAAI,CAAC,OAAO;YACf,OAAO,GAAG,CAAC,KAAK,CAAA;QAClB,KAAK,cAAI,CAAC,MAAM;YACd,OAAO,GAAG,CAAC,KAAK,CAAA;QAClB,KAAK,cAAI,CAAC,IAAI;YACZ,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACjC,KAAK,cAAI,CAAC,MAAM;YACd,OAAO,WAAW,CAAC,GAAG,CAAC,CAAA;QACzB;YACE,OAAO,IAAI,CAAA;KACd;AACH,CAAC;AAEY,QAAA,SAAS,GAAG,IAAI,2BAAiB,CAAC;IAC7C,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,6DAA6D;IAC1E,SAAS,CAAC,KAAK;QACb,oEAAoE;QACpE,OAAO,KAAK,CAAA;IACd,CAAC;IACD,UAAU,CAAC,KAAK;QACd,oEAAoE;QACpE,OAAO,KAAK,CAAA;IACd,CAAC;IACD,YAAY,CAAC,GAAG;QACd,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScalarDate = void 0;
4
+ const graphql_1 = require("graphql");
5
+ exports.ScalarDate = new graphql_1.GraphQLScalarType({
6
+ name: 'Date',
7
+ description: 'Date custom scalar type',
8
+ parseValue(value) {
9
+ return new Date(value); // value from the client
10
+ },
11
+ serialize(value) {
12
+ /**
13
+ * Note: Allow value to be date only like "2021-01-31" to be serialize before passing data to clientside for TypeGraphql.
14
+ * Usage: When database column datatype is "date" and data do not contain any time component.
15
+ */
16
+ return new Date(value).getTime(); // value sent to the client
17
+ },
18
+ parseLiteral(ast) {
19
+ if (ast.kind === graphql_1.Kind.INT) {
20
+ return new Date(+ast.value); // ast value is always in string format
21
+ }
22
+ return null;
23
+ }
24
+ });
25
+ //# sourceMappingURL=scalar-date.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalar-date.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-date.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAEpC,QAAA,UAAU,GAAG,IAAI,2BAAiB,CAAC;IAC9C,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,yBAAyB;IACtC,UAAU,CAAC,KAAK;QACd,OAAO,IAAI,IAAI,CAAC,KAAwB,CAAC,CAAA,CAAC,wBAAwB;IACpE,CAAC;IACD,SAAS,CAAC,KAAK;QACb;;;WAGG;QACH,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAA,CAAC,2BAA2B;IAC9D,CAAC;IACD,YAAY,CAAC,GAAG;QACd,IAAI,GAAG,CAAC,IAAI,KAAK,cAAI,CAAC,GAAG,EAAE;YACzB,OAAO,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA,CAAC,uCAAuC;SACpE;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScalarObject = void 0;
4
+ const { GraphQLScalarType } = require('graphql');
5
+ exports.ScalarObject = new GraphQLScalarType({
6
+ name: 'Object',
7
+ description: 'Can be anything',
8
+ parseValue(value) {
9
+ return value;
10
+ },
11
+ serialize(value) {
12
+ return value;
13
+ },
14
+ parseLiteral(ast) {
15
+ return ast;
16
+ }
17
+ });
18
+ //# sourceMappingURL=scalar-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalar-object.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-object.ts"],"names":[],"mappings":";;;AAAA,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAEnC,QAAA,YAAY,GAAG,IAAI,iBAAiB,CAAC;IAChD,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,iBAAiB;IAC9B,UAAU,CAAC,KAAK;QACd,OAAO,KAAK,CAAA;IACd,CAAC;IACD,SAAS,CAAC,KAAK;QACb,OAAO,KAAK,CAAA;IACd,CAAC;IACD,YAAY,CAAC,GAAG;QACd,OAAO,GAAG,CAAA;IACZ,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./transaction"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/directive-transaction/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transactionDirectiveResolver = exports.transactionDirectiveTypeDefs = void 0;
4
+ const graphql_1 = require("graphql");
5
+ const graphql_tag_1 = require("graphql-tag");
6
+ const typeorm_1 = require("typeorm");
7
+ const utils_1 = require("@graphql-tools/utils");
8
+ const debug = require('debug')('things-factory:shell:directive-transaction');
9
+ const DIRECTIVE = 'transaction';
10
+ exports.transactionDirectiveTypeDefs = (0, graphql_tag_1.gql) `
11
+ directive @${DIRECTIVE} on FIELD_DEFINITION
12
+ `;
13
+ const transactionDirectiveResolver = (schema) => (0, utils_1.mapSchema)(schema, {
14
+ [utils_1.MapperKind.OBJECT_FIELD]: (fieldConfig, fieldName) => {
15
+ var _a;
16
+ const transactionDirective = (_a = (0, utils_1.getDirective)(schema, fieldConfig, DIRECTIVE)) === null || _a === void 0 ? void 0 : _a[0];
17
+ if (transactionDirective) {
18
+ const { resolve = graphql_1.defaultFieldResolver } = fieldConfig;
19
+ fieldConfig.resolve = async function (source, args, context, info) {
20
+ debug('@transaction-begin : ', fieldName);
21
+ return await (0, typeorm_1.getConnection)().transaction(async (tx) => {
22
+ /* local-graphql-client로부터 invoke인 경우에는 context.req, context.res 가 없으므로, 빈 오브젝트로 대체해준다. */
23
+ let wrap = context.app.createContext(context.req || {}, context.res || {});
24
+ wrap.state = Object.assign(Object.assign({}, context.state), { tx });
25
+ let result = await resolve.call(this, source, args, wrap, info);
26
+ debug('@transaction-end : ', fieldName);
27
+ return result;
28
+ });
29
+ };
30
+ return fieldConfig;
31
+ }
32
+ }
33
+ });
34
+ exports.transactionDirectiveResolver = transactionDirectiveResolver;
35
+ //# sourceMappingURL=transaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/directive-transaction/transaction.ts"],"names":[],"mappings":";;;AAAA,qCAA6D;AAC7D,6CAAiC;AACjC,qCAAuC;AACvC,gDAA0E;AAE1E,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,4CAA4C,CAAC,CAAA;AAE5E,MAAM,SAAS,GAAG,aAAa,CAAA;AAElB,QAAA,4BAA4B,GAAG,IAAA,iBAAG,EAAA;iBAC9B,SAAS;GACvB,CAAA;AACI,MAAM,4BAA4B,GAAG,CAAC,MAAqB,EAAE,EAAE,CACpE,IAAA,iBAAS,EAAC,MAAM,EAAE;IAChB,CAAC,kBAAU,CAAC,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE;;QACpD,MAAM,oBAAoB,GAAG,MAAA,IAAA,oBAAY,EAAC,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,0CAAG,CAAC,CAAC,CAAA;QAC9E,IAAI,oBAAoB,EAAE;YACxB,MAAM,EAAE,OAAO,GAAG,8BAAoB,EAAE,GAAG,WAAW,CAAA;YAEtD,WAAW,CAAC,OAAO,GAAG,KAAK,WAAW,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI;gBAC/D,KAAK,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAA;gBAEzC,OAAO,MAAM,IAAA,uBAAa,GAAE,CAAC,WAAW,CAAC,KAAK,EAAC,EAAE,EAAC,EAAE;oBAClD,0FAA0F;oBAC1F,IAAI,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,CAAA;oBAE1E,IAAI,CAAC,KAAK,mCACL,OAAO,CAAC,KAAK,KAChB,EAAE,GACH,CAAA;oBAED,IAAI,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;oBAE/D,KAAK,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAA;oBAEvC,OAAO,MAAM,CAAA;gBACf,CAAC,CAAC,CAAA;YACJ,CAAC,CAAA;YAED,OAAO,WAAW,CAAA;SACnB;IACH,CAAC;CACF,CAAC,CAAA;AA9BS,QAAA,4BAA4B,gCA8BrC"}
@@ -0,0 +1,150 @@
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.DomainResolver = void 0;
16
+ const type_graphql_1 = require("type-graphql");
17
+ const typeorm_1 = require("typeorm");
18
+ const utils_1 = require("@things-factory/utils");
19
+ const list_query_builder_1 = require("../../utils/list-query-builder");
20
+ const list_param_1 = require("../common-types/list-param");
21
+ const domain_1 = require("./domain");
22
+ const domain_types_1 = require("./domain-types");
23
+ let DomainResolver = class DomainResolver {
24
+ async domain(id) {
25
+ const repository = (0, typeorm_1.getRepository)(domain_1.Domain);
26
+ return await repository.findOne({ id });
27
+ }
28
+ async domains(params, context) {
29
+ const queryBuilder = (0, typeorm_1.getRepository)(domain_1.Domain).createQueryBuilder();
30
+ (0, list_query_builder_1.buildQuery)(queryBuilder, params || {}, context, false);
31
+ const [items, total] = await queryBuilder.getManyAndCount();
32
+ return { items, total };
33
+ }
34
+ async checkExistsDomain(name) {
35
+ const domainRepository = (0, typeorm_1.getRepository)(domain_1.Domain);
36
+ const targetSubdomain = (0, utils_1.slugger)(name);
37
+ const oldDomain = await domainRepository.findOne({ subdomain: targetSubdomain });
38
+ if (oldDomain) {
39
+ throw new Error('domain is duplicated');
40
+ }
41
+ return true;
42
+ }
43
+ async createDomain(domainInput) {
44
+ const { name, description } = domainInput;
45
+ const domainRepo = (0, typeorm_1.getRepository)(domain_1.Domain);
46
+ const subdomain = (0, utils_1.slugger)(name);
47
+ const domain = await domainRepo.findOne({ subdomain });
48
+ if (domain) {
49
+ throw new Error('domain is duplicated');
50
+ }
51
+ return await domainRepo.save({ name, description, subdomain });
52
+ }
53
+ async deleteDomain(name) {
54
+ return await (0, typeorm_1.getRepository)(domain_1.Domain).delete({ name });
55
+ }
56
+ async deleteDomains(names) {
57
+ const domains = await (0, typeorm_1.getRepository)(domain_1.Domain).find({ where: { name: (0, typeorm_1.In)(names) } });
58
+ const domainIds = domains.map(domain => domain.id);
59
+ await (0, typeorm_1.getRepository)(domain_1.Domain).delete({ id: (0, typeorm_1.In)(domainIds) });
60
+ }
61
+ async updateDomain(name, patch) {
62
+ const repository = (0, typeorm_1.getRepository)(domain_1.Domain);
63
+ const domain = await repository.findOne({ name });
64
+ return await repository.save(Object.assign(Object.assign({}, domain), patch));
65
+ }
66
+ async updateDomains(patches) {
67
+ const domainRepo = (0, typeorm_1.getRepository)(domain_1.Domain);
68
+ const patchIds = patches.filter((patch) => patch.id);
69
+ if (patchIds.length > 0) {
70
+ patchIds.forEach(async (updateRecord) => {
71
+ const domain = await domainRepo.findOne({ where: { id: updateRecord.id } });
72
+ if (updateRecord.name) {
73
+ updateRecord.subdomain = (0, utils_1.slugger)(updateRecord.name);
74
+ }
75
+ await domainRepo.save(Object.assign(Object.assign({}, domain), updateRecord));
76
+ });
77
+ }
78
+ return true;
79
+ }
80
+ };
81
+ __decorate([
82
+ (0, type_graphql_1.Directive)('@privilege(category: "system", privilege: "mutation", domainOwnerGranted: true, superUserGranted: true)'),
83
+ (0, type_graphql_1.Query)(returns => domain_1.Domain, { description: 'To fetch domain' }),
84
+ __param(0, (0, type_graphql_1.Arg)('id')),
85
+ __metadata("design:type", Function),
86
+ __metadata("design:paramtypes", [String]),
87
+ __metadata("design:returntype", Promise)
88
+ ], DomainResolver.prototype, "domain", null);
89
+ __decorate([
90
+ (0, type_graphql_1.Directive)('@privilege(category: "system", privilege: "query", superUserGranted: true)'),
91
+ (0, type_graphql_1.Query)(returns => domain_types_1.DomainList, { description: 'To fetch multiple domain' }),
92
+ __param(0, (0, type_graphql_1.Args)()),
93
+ __param(1, (0, type_graphql_1.Ctx)()),
94
+ __metadata("design:type", Function),
95
+ __metadata("design:paramtypes", [list_param_1.ListParam, Object]),
96
+ __metadata("design:returntype", Promise)
97
+ ], DomainResolver.prototype, "domains", null);
98
+ __decorate([
99
+ (0, type_graphql_1.Query)(returns => Boolean, { description: 'To check if given domain is exist' }),
100
+ __param(0, (0, type_graphql_1.Arg)('name')),
101
+ __metadata("design:type", Function),
102
+ __metadata("design:paramtypes", [String]),
103
+ __metadata("design:returntype", Promise)
104
+ ], DomainResolver.prototype, "checkExistsDomain", null);
105
+ __decorate([
106
+ (0, type_graphql_1.Directive)('@privilege(category: "system", privilege: "mutation", superUserGranted: true)'),
107
+ (0, type_graphql_1.Mutation)(returns => domain_1.Domain, { description: 'To create domain' }),
108
+ __param(0, (0, type_graphql_1.Arg)('domainInput')),
109
+ __metadata("design:type", Function),
110
+ __metadata("design:paramtypes", [domain_types_1.DomainPatch]),
111
+ __metadata("design:returntype", Promise)
112
+ ], DomainResolver.prototype, "createDomain", null);
113
+ __decorate([
114
+ (0, type_graphql_1.Directive)('@privilege(category: "system", privilege: "mutation", superUserGranted: true)'),
115
+ (0, type_graphql_1.Mutation)(returns => domain_1.Domain, { description: 'To delete domain' }),
116
+ __param(0, (0, type_graphql_1.Arg)('name')),
117
+ __metadata("design:type", Function),
118
+ __metadata("design:paramtypes", [String]),
119
+ __metadata("design:returntype", Promise)
120
+ ], DomainResolver.prototype, "deleteDomain", null);
121
+ __decorate([
122
+ (0, type_graphql_1.Directive)('@privilege(category: "system", privilege: "mutation", superUserGranted: true)'),
123
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple domains' }),
124
+ __param(0, (0, type_graphql_1.Arg)('names', () => [String])),
125
+ __metadata("design:type", Function),
126
+ __metadata("design:paramtypes", [Array]),
127
+ __metadata("design:returntype", Promise)
128
+ ], DomainResolver.prototype, "deleteDomains", null);
129
+ __decorate([
130
+ (0, type_graphql_1.Directive)('@privilege(category: "system", privilege: "mutation", domainOwnerGranted: true, superUserGranted: true)'),
131
+ (0, type_graphql_1.Mutation)(returns => domain_1.Domain, { description: 'To update domain' }),
132
+ __param(0, (0, type_graphql_1.Arg)('name')),
133
+ __param(1, (0, type_graphql_1.Arg)('patch', () => domain_types_1.DomainPatch)),
134
+ __metadata("design:type", Function),
135
+ __metadata("design:paramtypes", [String, domain_types_1.DomainPatch]),
136
+ __metadata("design:returntype", Promise)
137
+ ], DomainResolver.prototype, "updateDomain", null);
138
+ __decorate([
139
+ (0, type_graphql_1.Directive)('@privilege(category: "system", privilege: "mutation", superUserGranted: true)'),
140
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To update multiple domains' }),
141
+ __param(0, (0, type_graphql_1.Arg)('patches', () => [domain_types_1.DomainPatch])),
142
+ __metadata("design:type", Function),
143
+ __metadata("design:paramtypes", [Array]),
144
+ __metadata("design:returntype", Promise)
145
+ ], DomainResolver.prototype, "updateDomains", null);
146
+ DomainResolver = __decorate([
147
+ (0, type_graphql_1.Resolver)(domain_1.Domain)
148
+ ], DomainResolver);
149
+ exports.DomainResolver = DomainResolver;
150
+ //# sourceMappingURL=domain-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-resolver.js","sourceRoot":"","sources":["../../../server/service/domain/domain-resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAmF;AACnF,qCAAuD;AAEvD,iDAA+C;AAE/C,uEAA2D;AAC3D,2DAAsD;AACtD,qCAAiC;AACjC,iDAAwD;AAGjD,IAAM,cAAc,GAApB,MAAM,cAAc;IAGnB,AAAN,KAAK,CAAC,MAAM,CAAY,EAAU;QAChC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,eAAM,CAAC,CAAA;QAExC,OAAO,MAAM,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IACzC,CAAC;IAIK,AAAN,KAAK,CAAC,OAAO,CAAS,MAAiB,EAAS,OAAO;QACrD,MAAM,YAAY,GAAG,IAAA,uBAAa,EAAC,eAAM,CAAC,CAAC,kBAAkB,EAAE,CAAA;QAC/D,IAAA,+BAAU,EAAC,YAAY,EAAE,MAAM,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;QACtD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,iBAAiB,CAAc,IAAY;QAC/C,MAAM,gBAAgB,GAAuB,IAAA,uBAAa,EAAC,eAAM,CAAC,CAAA;QAClE,MAAM,eAAe,GA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,CAAA;;;;mDAKhD;AAIK;IAFL,IAAA,wBAAS,EAAC,yGAAyG,CAAC;IACpH,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,eAAM,EAAE,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAC7C,WAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,WAAA,IAAA,kBAAG,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,0BAAW,CAAC,CAAA;;6CAAQ,0BAAW;;kDAQhG;AAIK;IAFL,IAAA,wBAAS,EAAC,+EAA+E,CAAC;IAC1F,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;IACvD,WAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,0BAAW,CAAC,CAAC,CAAA;;;;mDAqBvD;AAjGU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,eAAM,CAAC;GACJ,cAAc,CAkG1B;AAlGY,wCAAc"}
@@ -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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DomainList = exports.DomainPatch = exports.DomainInput = void 0;
13
+ const type_graphql_1 = require("type-graphql");
14
+ const domain_1 = require("./domain");
15
+ let DomainInput = class DomainInput {
16
+ };
17
+ __decorate([
18
+ (0, type_graphql_1.Field)(),
19
+ __metadata("design:type", String)
20
+ ], DomainInput.prototype, "name", void 0);
21
+ __decorate([
22
+ (0, type_graphql_1.Field)({ nullable: true }),
23
+ __metadata("design:type", String)
24
+ ], DomainInput.prototype, "description", void 0);
25
+ DomainInput = __decorate([
26
+ (0, type_graphql_1.InputType)()
27
+ ], DomainInput);
28
+ exports.DomainInput = DomainInput;
29
+ let DomainPatch = class DomainPatch {
30
+ };
31
+ __decorate([
32
+ (0, type_graphql_1.Field)({ nullable: true }),
33
+ __metadata("design:type", String)
34
+ ], DomainPatch.prototype, "id", void 0);
35
+ __decorate([
36
+ (0, type_graphql_1.Field)({ nullable: true }),
37
+ __metadata("design:type", String)
38
+ ], DomainPatch.prototype, "name", void 0);
39
+ __decorate([
40
+ (0, type_graphql_1.Field)({ nullable: true }),
41
+ __metadata("design:type", String)
42
+ ], DomainPatch.prototype, "description", void 0);
43
+ __decorate([
44
+ (0, type_graphql_1.Field)({ nullable: true }),
45
+ __metadata("design:type", String)
46
+ ], DomainPatch.prototype, "timezone", void 0);
47
+ __decorate([
48
+ (0, type_graphql_1.Field)({ nullable: true }),
49
+ __metadata("design:type", Boolean)
50
+ ], DomainPatch.prototype, "systemFlag", void 0);
51
+ __decorate([
52
+ (0, type_graphql_1.Field)({ nullable: true }),
53
+ __metadata("design:type", String)
54
+ ], DomainPatch.prototype, "subdomain", void 0);
55
+ __decorate([
56
+ (0, type_graphql_1.Field)({ nullable: true }),
57
+ __metadata("design:type", String)
58
+ ], DomainPatch.prototype, "brandName", void 0);
59
+ __decorate([
60
+ (0, type_graphql_1.Field)({ nullable: true }),
61
+ __metadata("design:type", String)
62
+ ], DomainPatch.prototype, "brandImage", void 0);
63
+ __decorate([
64
+ (0, type_graphql_1.Field)({ nullable: true }),
65
+ __metadata("design:type", String)
66
+ ], DomainPatch.prototype, "contentImage", void 0);
67
+ __decorate([
68
+ (0, type_graphql_1.Field)({ nullable: true }),
69
+ __metadata("design:type", String)
70
+ ], DomainPatch.prototype, "theme", void 0);
71
+ DomainPatch = __decorate([
72
+ (0, type_graphql_1.InputType)()
73
+ ], DomainPatch);
74
+ exports.DomainPatch = DomainPatch;
75
+ let DomainList = class DomainList {
76
+ };
77
+ __decorate([
78
+ (0, type_graphql_1.Field)(type => [domain_1.Domain], { nullable: true }),
79
+ __metadata("design:type", Array)
80
+ ], DomainList.prototype, "items", void 0);
81
+ __decorate([
82
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
83
+ __metadata("design:type", Number)
84
+ ], DomainList.prototype, "total", void 0);
85
+ DomainList = __decorate([
86
+ (0, type_graphql_1.ObjectType)()
87
+ ], DomainList);
88
+ exports.DomainList = DomainList;
89
+ //# sourceMappingURL=domain-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-types.js","sourceRoot":"","sources":["../../../server/service/domain/domain-types.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAgE;AAChE,qCAAiC;AAG1B,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AALC;IAAC,IAAA,oBAAK,GAAE;;yCACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACN;AALT,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CAMvB;AANY,kCAAW;AASjB,IAAM,WAAW,GAAjB,MAAM,WAAW;CA8BvB,CAAA;AA7BC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACf;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACb,OAAO;+CAAA;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACR;AAElB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACR;AAElB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACP;AAEnB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACL;AAErB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACZ;AA7BH,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CA8BvB;AA9BY,kCAAW;AAiCjB,IAAM,UAAU,GAAhB,MAAM,UAAU;CAMtB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,eAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC7B;AAEf;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC1B;AALF,UAAU;IADtB,IAAA,yBAAU,GAAE;GACA,UAAU,CAMtB;AANY,gCAAU"}
@@ -0,0 +1,113 @@
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.Domain = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const type_graphql_1 = require("type-graphql");
15
+ let Domain = class Domain {
16
+ };
17
+ __decorate([
18
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
19
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
20
+ __metadata("design:type", String)
21
+ ], Domain.prototype, "id", void 0);
22
+ __decorate([
23
+ (0, type_graphql_1.Field)(),
24
+ (0, typeorm_1.Column)({
25
+ unique: true
26
+ }),
27
+ __metadata("design:type", String)
28
+ ], Domain.prototype, "name", void 0);
29
+ __decorate([
30
+ (0, type_graphql_1.Field)({ nullable: true }),
31
+ (0, typeorm_1.Column)({
32
+ nullable: true
33
+ }),
34
+ __metadata("design:type", String)
35
+ ], Domain.prototype, "description", void 0);
36
+ __decorate([
37
+ (0, type_graphql_1.Field)({ nullable: true }),
38
+ (0, typeorm_1.Column)({
39
+ nullable: true
40
+ }),
41
+ __metadata("design:type", String)
42
+ ], Domain.prototype, "extType", void 0);
43
+ __decorate([
44
+ (0, type_graphql_1.Field)({ nullable: true }),
45
+ (0, typeorm_1.Column)({
46
+ nullable: true
47
+ }),
48
+ __metadata("design:type", String)
49
+ ], Domain.prototype, "timezone", void 0);
50
+ __decorate([
51
+ (0, type_graphql_1.Field)({ nullable: true }),
52
+ (0, typeorm_1.Column)({
53
+ default: false
54
+ }),
55
+ __metadata("design:type", Boolean)
56
+ ], Domain.prototype, "systemFlag", void 0);
57
+ __decorate([
58
+ (0, type_graphql_1.Field)({ nullable: true }),
59
+ (0, typeorm_1.Column)({
60
+ nullable: true
61
+ }),
62
+ __metadata("design:type", String)
63
+ ], Domain.prototype, "subdomain", void 0);
64
+ __decorate([
65
+ (0, type_graphql_1.Field)({ nullable: true }),
66
+ (0, typeorm_1.Column)({
67
+ nullable: true
68
+ }),
69
+ __metadata("design:type", String)
70
+ ], Domain.prototype, "brandName", void 0);
71
+ __decorate([
72
+ (0, type_graphql_1.Field)({ nullable: true }),
73
+ (0, typeorm_1.Column)({
74
+ nullable: true
75
+ }),
76
+ __metadata("design:type", String)
77
+ ], Domain.prototype, "brandImage", void 0);
78
+ __decorate([
79
+ (0, type_graphql_1.Field)({ nullable: true }),
80
+ (0, typeorm_1.Column)({
81
+ nullable: true
82
+ }),
83
+ __metadata("design:type", String)
84
+ ], Domain.prototype, "contentImage", void 0);
85
+ __decorate([
86
+ (0, type_graphql_1.Field)({ nullable: true }),
87
+ (0, typeorm_1.Column)({ nullable: true }),
88
+ __metadata("design:type", String)
89
+ ], Domain.prototype, "owner", void 0);
90
+ __decorate([
91
+ (0, type_graphql_1.Field)({ nullable: true }),
92
+ (0, typeorm_1.Column)({
93
+ nullable: true
94
+ }),
95
+ __metadata("design:type", String)
96
+ ], Domain.prototype, "theme", void 0);
97
+ __decorate([
98
+ (0, type_graphql_1.Field)({ nullable: true }),
99
+ (0, typeorm_1.CreateDateColumn)(),
100
+ __metadata("design:type", Date)
101
+ ], Domain.prototype, "createdAt", void 0);
102
+ __decorate([
103
+ (0, type_graphql_1.Field)({ nullable: true }),
104
+ (0, typeorm_1.UpdateDateColumn)(),
105
+ __metadata("design:type", Date)
106
+ ], Domain.prototype, "updatedAt", void 0);
107
+ Domain = __decorate([
108
+ (0, typeorm_1.Entity)(),
109
+ (0, typeorm_1.Index)('ix_domain_0', (domain) => [domain.subdomain], { unique: true }),
110
+ (0, type_graphql_1.ObjectType)()
111
+ ], Domain);
112
+ exports.Domain = Domain;
113
+ //# sourceMappingURL=domain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../server/service/domain/domain.ts"],"names":[],"mappings":";;;;;;;;;;;;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,IAAI;KACf,CAAC;;0CACgB;AAElB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;4CACkB;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qCACd;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;qCACW;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,0BAAgB,GAAE;8BACR,IAAI;yCAAA;AAEf;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,0BAAgB,GAAE;8BACR,IAAI;yCAAA;AA3EJ,MAAM;IAHlB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,aAAa,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC9E,IAAA,yBAAU,GAAE;GACA,MAAM,CA4ElB;AA5EY,wBAAM"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const domain_1 = require("./domain");
5
+ const domain_resolver_1 = require("./domain-resolver");
6
+ exports.entities = [domain_1.Domain];
7
+ exports.resolvers = [domain_resolver_1.DomainResolver];
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/domain/index.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AACjC,uDAAkD;AAErC,QAAA,QAAQ,GAAG,CAAC,eAAM,CAAC,CAAA;AACnB,QAAA,SAAS,GAAG,CAAC,gCAAc,CAAC,CAAA"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.schema = exports.entities = void 0;
18
+ const directive_transaction_1 = require("./directive-transaction");
19
+ const domain_1 = require("./domain");
20
+ const subscription_data_1 = require("./subscription-data");
21
+ __exportStar(require("./common-types"), exports);
22
+ __exportStar(require("./domain/domain"), exports);
23
+ /* EXPORT TYPES */
24
+ __exportStar(require("./domain/domain-types"), exports);
25
+ __exportStar(require("./subscription-data/data-types"), exports);
26
+ exports.entities = [
27
+ /* Entities */
28
+ ...domain_1.entities,
29
+ ...domain_1.entities
30
+ ];
31
+ exports.schema = {
32
+ typeDefs: {
33
+ transactionDirectiveTypeDefs: directive_transaction_1.transactionDirectiveTypeDefs
34
+ },
35
+ resolverClasses: [
36
+ /* Resolvers */
37
+ ...domain_1.resolvers,
38
+ ...domain_1.resolvers,
39
+ ...subscription_data_1.resolvers
40
+ ],
41
+ directives: {
42
+ transaction: directive_transaction_1.transactionDirectiveResolver
43
+ }
44
+ };
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mEAAoG;AACpG,qCAKiB;AACjB,2DAA4E;AAE5E,iDAA8B;AAC9B,kDAA+B;AAE/B,kBAAkB;AAClB,wDAAqC;AACrC,iEAA8C;AAEjC,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,iBAAY;IACf,GAAG,iBAAc;CAClB,CAAA;AACY,QAAA,MAAM,GAAG;IACpB,QAAQ,EAAE;QACR,4BAA4B,EAA5B,oDAA4B;KAC7B;IACD,eAAe,EAAE;QACf,eAAe;QACf,GAAG,kBAAa;QAChB,GAAG,kBAAe;QAClB,GAAG,6BAAyB;KAC7B;IACD,UAAU,EAAE;QACV,WAAW,EAAE,oDAA4B;KAC1C;CACF,CAAA"}