@things-factory/integration-pos 5.0.0 → 5.0.11

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 (60) hide show
  1. package/dist-server/controllers/index.js +2 -15
  2. package/dist-server/controllers/index.js.map +1 -1
  3. package/dist-server/controllers/pos-api/decorators.js +2 -4
  4. package/dist-server/controllers/pos-api/decorators.js.map +1 -1
  5. package/dist-server/controllers/pos-api/index.js +9 -17
  6. package/dist-server/controllers/pos-api/index.js.map +1 -1
  7. package/dist-server/controllers/xilnex/apis/get-outlet.js.map +1 -1
  8. package/dist-server/controllers/xilnex/apis/get-outlets.js.map +1 -1
  9. package/dist-server/controllers/xilnex/apis/index.js +2 -15
  10. package/dist-server/controllers/xilnex/apis/index.js.map +1 -1
  11. package/dist-server/controllers/xilnex/index.js +3 -28
  12. package/dist-server/controllers/xilnex/index.js.map +1 -1
  13. package/dist-server/controllers/xilnex/platform-action.js.map +1 -1
  14. package/dist-server/controllers/xilnex/xilnex.js +3 -5
  15. package/dist-server/controllers/xilnex/xilnex.js.map +1 -1
  16. package/dist-server/engine/connector/index.js.map +1 -1
  17. package/dist-server/engine/connector/pos-connector.js.map +1 -1
  18. package/dist-server/engine/index.js.map +1 -1
  19. package/dist-server/engine/task/index.js.map +1 -1
  20. package/dist-server/engine/task/pos-api.js.map +1 -1
  21. package/dist-server/entities/index.js.map +1 -1
  22. package/dist-server/entities/pos-store.js +34 -42
  23. package/dist-server/entities/pos-store.js.map +1 -1
  24. package/dist-server/graphql/index.js +3 -25
  25. package/dist-server/graphql/index.js.map +1 -1
  26. package/dist-server/graphql/resolvers/index.js +3 -25
  27. package/dist-server/graphql/resolvers/index.js.map +1 -1
  28. package/dist-server/graphql/resolvers/pos/create-pos-store.js.map +1 -1
  29. package/dist-server/graphql/resolvers/pos/delete-pos-store.js.map +1 -1
  30. package/dist-server/graphql/resolvers/pos/delete-pos-stores.js.map +1 -1
  31. package/dist-server/graphql/resolvers/pos/index.js +2 -24
  32. package/dist-server/graphql/resolvers/pos/index.js.map +1 -1
  33. package/dist-server/graphql/resolvers/pos/pos-store.js.map +1 -1
  34. package/dist-server/graphql/resolvers/pos/pos-stores.js.map +1 -1
  35. package/dist-server/graphql/resolvers/pos/update-multiple-pos-stores.js.map +1 -1
  36. package/dist-server/graphql/resolvers/pos/update-pos-store.js.map +1 -1
  37. package/dist-server/graphql/resolvers/pos/xilnex/deactivate-xilnex-store.js.map +1 -1
  38. package/dist-server/graphql/resolvers/pos/xilnex/generate-xilnex-access-token.js.map +1 -1
  39. package/dist-server/graphql/resolvers/pos/xilnex/index.js.map +1 -1
  40. package/dist-server/graphql/resolvers/pos-api/index.js.map +1 -1
  41. package/dist-server/graphql/resolvers/pos-api/pos-outlet.js.map +1 -1
  42. package/dist-server/graphql/types/index.js +3 -25
  43. package/dist-server/graphql/types/index.js.map +1 -1
  44. package/dist-server/graphql/types/pos/index.js.map +1 -1
  45. package/dist-server/graphql/types/pos/new-pos-store.js +2 -4
  46. package/dist-server/graphql/types/pos/new-pos-store.js.map +1 -1
  47. package/dist-server/graphql/types/pos/pos-store-list.js +2 -4
  48. package/dist-server/graphql/types/pos/pos-store-list.js.map +1 -1
  49. package/dist-server/graphql/types/pos/pos-store-patch.js +2 -4
  50. package/dist-server/graphql/types/pos/pos-store-patch.js.map +1 -1
  51. package/dist-server/graphql/types/pos/pos-store.js +2 -4
  52. package/dist-server/graphql/types/pos/pos-store.js.map +1 -1
  53. package/dist-server/graphql/types/pos-api/pos-outlet.js +2 -4
  54. package/dist-server/graphql/types/pos-api/pos-outlet.js.map +1 -1
  55. package/dist-server/index.js +5 -18
  56. package/dist-server/index.js.map +1 -1
  57. package/dist-server/migrations/index.js.map +1 -1
  58. package/dist-server/routes.js.map +1 -1
  59. package/dist-server/tsconfig.tsbuildinfo +1 -0
  60. package/package.json +14 -14
@@ -1,19 +1,6 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
17
4
  require("./xilnex");
18
- __exportStar(require("./pos-api"), exports);
5
+ tslib_1.__exportStar(require("./pos-api"), exports);
19
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oBAAiB;AAEjB,4CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":";;;AAAA,oBAAiB;AAEjB,oDAAyB","sourcesContent":["import './xilnex'\n\nexport * from './pos-api'\n"]}
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.api = void 0;
7
- const debug_1 = __importDefault(require("debug"));
4
+ const tslib_1 = require("tslib");
5
+ const debug_1 = tslib_1.__importDefault(require("debug"));
8
6
  const debug = (0, debug_1.default)('things-factory:integration-pos:pos-api-decorator');
9
7
  const NOOP = v => v;
10
8
  const api = (target, property, descriptor) => {
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../server/controllers/pos-api/decorators.ts"],"names":[],"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B,IAAI,YAAY,GAAG,MAAM,WAAW,CAAC,OAAO,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;QAC9D,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;QAE9B,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;YACtC,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE;SAC3E,CAAC,CAAA;QAEF,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QAE3B,OAAO,MAAM,SAAS,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IAC7C,CAAC,CAAA;IAED,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AApCY,QAAA,GAAG,OAoCf","sourcesContent":["import Debug from 'debug'\nconst debug = Debug('things-factory:integration-pos:pos-api-decorator')\n\nimport { PosStore } from '../../entities'\n\nconst NOOP = v => v\n\nexport const api = (target: Object, property: string, descriptor: TypedPropertyDescriptor<any>): any => {\n const method = descriptor.value\n\n descriptor.value = async function (store: PosStore, request) {\n const POSAPI = this\n\n var { platform } = store\n\n var { action: platformAction, apis } = POSAPI.getPlatform(platform)\n\n var m = apis[method.name]\n if (!m) {\n throw Error(`POS Platform '${platform}' doesn't have API ${method.name}`)\n }\n\n var {\n path,\n method: httpMethod = 'post',\n denormalize = NOOP,\n normalize = NOOP,\n action = platformAction\n } = m.apply(this, [request])\n\n var denormalized = await denormalize(request || {}, { store })\n debug('request', denormalized)\n\n var response = await action.apply(this, [\n { store, method: httpMethod, path, request: denormalized, platformAction }\n ])\n\n debug('response', response)\n\n return await normalize(response, { store })\n }\n\n return descriptor\n}\n"]}
@@ -1,15 +1,7 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.POSAPI = exports.POS_STORE_STATUS = void 0;
4
+ const tslib_1 = require("tslib");
13
5
  const typeorm_1 = require("typeorm");
14
6
  const entities_1 = require("../../entities");
15
7
  const decorators_1 = require("./decorators");
@@ -40,17 +32,17 @@ class POSAPI {
40
32
  static getOutlet(store, req) { }
41
33
  }
42
34
  POSAPI.platforms = {};
43
- __decorate([
35
+ tslib_1.__decorate([
44
36
  decorators_1.api,
45
- __metadata("design:type", Function),
46
- __metadata("design:paramtypes", [Object, Object]),
47
- __metadata("design:returntype", Object)
37
+ tslib_1.__metadata("design:type", Function),
38
+ tslib_1.__metadata("design:paramtypes", [Object, Object]),
39
+ tslib_1.__metadata("design:returntype", Object)
48
40
  ], POSAPI, "getOutlets", null);
49
- __decorate([
41
+ tslib_1.__decorate([
50
42
  decorators_1.api,
51
- __metadata("design:type", Function),
52
- __metadata("design:paramtypes", [Object, Object]),
53
- __metadata("design:returntype", Object)
43
+ tslib_1.__metadata("design:type", Function),
44
+ tslib_1.__metadata("design:paramtypes", [Object, Object]),
45
+ tslib_1.__metadata("design:returntype", Object)
54
46
  ], POSAPI, "getOutlet", null);
55
47
  exports.POSAPI = POSAPI;
56
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/pos-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuC;AACvC,6C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IAAI;QACxC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG;YACvB,MAAM;YACN,IAAI;SACL,CAAA;IACH,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,IAAI;QACrB,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;QACzB,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAA;QAC1C,mCAAmC;QACnC,OAAO,MAAM,UAAU,CAAC,OAAO,CAAC;YAC9B,KAAK,EAAE,EAAE,EAAE,EAAE;YACb,SAAS,EAAE,CAAC,QAAQ,CAAC;SACtB,CAAC,CAAA;IACJ,CAAC;IAGD,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,IAAQ,CAAC;IAGrC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,IAAQ,CAAC;;AA1B7B,gBAAS,GAAG,EAAE,CAAA;AAuBrB;IADC,gBAAG;;;;8BACiC;AAGrC;IADC,gBAAG;;;;6BACgC;AA3BtC,wBA4BC","sourcesContent":["import { getRepository } from 'typeorm'\nimport { PosStore } from '../../entities'\nimport { api } from './decorators'\n\nexport const POS_STORE_STATUS = {\n ACTIVE: 'active',\n INACTIVE: 'inactive',\n TERMINATED: 'terminated'\n}\n\nexport class POSAPI {\n static platforms = {}\n\n static registerPlatform(name, action, apis) {\n POSAPI.platforms[name] = {\n action,\n apis\n }\n }\n\n static getPlatform(name) {\n return POSAPI.platforms[name]\n }\n\n static async getPosStore(id) {\n const repository = getRepository(PosStore)\n // return await repository.find(id)\n return await repository.findOne({\n where: { id },\n relations: ['domain']\n })\n }\n\n @api\n static getOutlets(store, req): any {}\n\n @api\n static getOutlet(store, req): any {}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"get-outlet.js","sourceRoot":"","sources":["../../../../server/controllers/xilnex/apis/get-outlet.ts"],"names":[],"mappings":";;;AAAA,SAAgB,SAAS;IACvB,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,oBAAoB;QAC1B,WAAW,CAAC,GAAG;YACb,OAAO,EAAE,CAAA;QACX,CAAC;QACD,SAAS,CAAC,GAAG;YACX,yBACK,GAAG,EACP;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAbD,8BAaC"}
1
+ {"version":3,"file":"get-outlet.js","sourceRoot":"","sources":["../../../../server/controllers/xilnex/apis/get-outlet.ts"],"names":[],"mappings":";;;AAAA,SAAgB,SAAS;IACvB,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,oBAAoB;QAC1B,WAAW,CAAC,GAAG;YACb,OAAO,EAAE,CAAA;QACX,CAAC;QACD,SAAS,CAAC,GAAG;YACX,yBACK,GAAG,EACP;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAbD,8BAaC","sourcesContent":["export function getOutlet() {\n return {\n method: 'get',\n path: '/outlet/{outletNo}',\n denormalize(req) {\n return {}\n },\n normalize(res) {\n return {\n ...res\n }\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"get-outlets.js","sourceRoot":"","sources":["../../../../server/controllers/xilnex/apis/get-outlets.ts"],"names":[],"mappings":";;;AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,mDAAmD,CAAC,CAAA;AAEnF,SAAgB,UAAU;IACxB,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,UAAU;QAChB,WAAW,CAAC,GAAG;YACb,OAAO,EAAE,CAAA;QACX,CAAC;QACD,SAAS,CAAC,GAAG;YACX,KAAK,CAAC,eAAe,EAAE,GAAG,CAAC,CAAA;YAC3B,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAA;YAEvB,OAAO;gBACL,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,OAAO,CAAC,MAAM;aACtB,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAjBD,gCAiBC"}
1
+ {"version":3,"file":"get-outlets.js","sourceRoot":"","sources":["../../../../server/controllers/xilnex/apis/get-outlets.ts"],"names":[],"mappings":";;;AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,mDAAmD,CAAC,CAAA;AAEnF,SAAgB,UAAU;IACxB,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,UAAU;QAChB,WAAW,CAAC,GAAG;YACb,OAAO,EAAE,CAAA;QACX,CAAC;QACD,SAAS,CAAC,GAAG;YACX,KAAK,CAAC,eAAe,EAAE,GAAG,CAAC,CAAA;YAC3B,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAA;YAEvB,OAAO;gBACL,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,OAAO,CAAC,MAAM;aACtB,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAjBD,gCAiBC","sourcesContent":["const debug = require('debug')('things-factory:integration-pos:xilnex:get-outlets')\n\nexport function getOutlets() {\n return {\n method: 'get',\n path: '/outlets',\n denormalize(req) {\n return {}\n },\n normalize(res) {\n debug('response data', res)\n const { outlets } = res\n \n return {\n items: outlets,\n total: outlets.length\n }\n }\n }\n}\n"]}
@@ -1,18 +1,5 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./get-outlets"), exports);
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./get-outlets"), exports);
18
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/controllers/xilnex/apis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/controllers/xilnex/apis/index.ts"],"names":[],"mappings":";;;AAAA,wDAA6B","sourcesContent":["export * from './get-outlets'"]}
@@ -1,34 +1,9 @@
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
- };
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
2
  Object.defineProperty(exports, "__esModule", { value: true });
29
- __exportStar(require("./xilnex"), exports);
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./xilnex"), exports);
30
5
  const platform_action_1 = require("./platform-action");
31
6
  const pos_api_1 = require("../pos-api");
32
- const APIS = __importStar(require("./apis"));
7
+ const APIS = tslib_1.__importStar(require("./apis"));
33
8
  pos_api_1.POSAPI.registerPlatform('xilnex', platform_action_1.action, APIS);
34
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/xilnex/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwB;AAExB,uDAA0C;AAC1C,wCAAmC;AAEnC,6CAA8B;AAE9B,gBAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,wBAAM,EAAE,IAAI,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/xilnex/index.ts"],"names":[],"mappings":";;;AAAA,mDAAwB;AAExB,uDAA0C;AAC1C,wCAAmC;AAEnC,qDAA8B;AAE9B,gBAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,wBAAM,EAAE,IAAI,CAAC,CAAA","sourcesContent":["export * from './xilnex'\n\nimport { action } from './platform-action'\nimport { POSAPI } from '../pos-api'\n\nimport * as APIS from './apis'\n\nPOSAPI.registerPlatform('xilnex', action, APIS)\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"platform-action.js","sourceRoot":"","sources":["../../../server/controllers/xilnex/platform-action.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AAEjC,6CAA4C;AAC5C,MAAM,YAAY,GAAG,YAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAA;AAC3D,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,YAAY,CAAA;AAE1C,SAAS,UAAU,CAAC,IAAI,EAAE,GAAG;IAC3B,IAAI,KAAK,GAAG,EAAE,CAAA;IACd,IAAI,EAAE,GAAG,YAAY,CAAA;IACrB,IAAI,IAAI,CAAA;IAER,O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OAAO,CAAA;IAE/C,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAEjC,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAClD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;QAChB,MAAM,QAAQ,CAAC,KAAK,CAAA;KACrB;IAED,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC,CAAA;AAjBY,QAAA,MAAM,UAiBlB","sourcesContent":["import { Xilnex } from './xilnex'\n\nimport { config } from '@things-factory/env'\nconst xilnexConfig = config.get('posIntegrationXilnex', {})\nconst { apiKey, apiSecret } = xilnexConfig\n\nfunction substitute(path, obj) {\n var props = []\n var re = /{([^}]+)}/g\n var text\n\n while ((text = re.exec(path))) {\n props.push(text[1])\n }\n\n var result = path\n props.forEach(prop => {\n let value = obj[prop.trim()]\n result = result.replace(`{${prop}}`, value === undefined ? '' : value)\n })\n\n return result\n}\n\nexport const action = async ({ store, method = 'get', path, request }) => {\n const client = new Xilnex({\n store: store.storeId,\n accessToken: store.accessToken,\n storeId: store.storeId\n })\n\n const { resource = {}, payload = {} } = request\n\n path = substitute(path, resource)\n\n var response = await client[method](path, payload)\n if (!response.ok) {\n throw response.error\n }\n\n return response.data\n}\n"]}
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.Xilnex = void 0;
7
- const node_fetch_1 = __importDefault(require("node-fetch"));
8
- const debug_1 = __importDefault(require("debug"));
4
+ const tslib_1 = require("tslib");
5
+ const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
6
+ const debug_1 = tslib_1.__importDefault(require("debug"));
9
7
  const debug = (0, debug_1.default)('things-factory:integration-pos:xilnex');
10
8
  class Xilnex {
11
9
  const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,MAAM,EAAE,IAAI,CAAC,CAAA;QAEnB,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QAErC,MAAM,QAAQ,GAAG,kCAAkC,IAAI,EAAE,CAAA;QAEzD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAK,EAAC,QAAQ,EAAE;YACrC,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,WAAW;gBACpB,MAAM,EAAE,GAAG;gBACX,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,QAAQ;SACf,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QACpC,KAAK,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAA;QAEhC,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AA/GD,wBA+GC","sourcesContent":["import fetch from 'node-fetch'\nimport Debug from 'debug'\n\nconst debug = Debug('things-factory:integration-pos:xilnex')\n\nexport type XilnexConfig = {\n store: string\n accessToken?: string,\n storeId: string\n}\n\nexport class Xilnex {\n private config: XilnexConfig\n\n constructor(config: XilnexConfig) {\n this.config = {\n ...config\n }\n }\n\n async get(path: string, data: any) {\n const { store, accessToken, storeId: appid } = this.config\n\n const qs = Object.entries(data)\n .map(([k, v]) => `${k}=${encodeURIComponent(String(v))}`)\n .join('&')\n\n const endpoint = `https://api.xilnex.com/logic/v2${path}${qs ? '?' + qs : ''}`\n debug('endpoint', endpoint)\n\n const response = await fetch(endpoint, {\n headers: {\n 'appid': appid,\n 'token': accessToken,\n 'auth': '5'\n }\n })\n\n const result = await response.json()\n debug('response result', result)\n\n return result\n }\n\n async post(path: string, data: any = {}) {\n const { store, accessToken, storeId: appid } = this.config\n\n debug('data', data)\n\n const jsondata = JSON.stringify(data)\n\n const endpoint = `https://api.xilnex.com/logic/v2${path}`\n\n const response = await fetch(endpoint, {\n method: 'post',\n headers: {\n 'appid': appid,\n 'token': accessToken,\n 'auth': '5',\n 'Content-Type': 'application/json'\n },\n body: jsondata\n })\n\n const result = await response.json()\n debug('response result', result)\n\n return result\n }\n\n\n async put(path: string, data: any = {}) {\n const { store, accessToken, storeId: appid } = this.config\n\n debug('data', data)\n\n const jsondata = JSON.stringify(data)\n\n const endpoint = `https://api.xilnex.com/logic/v2${path}`\n\n const response = await fetch(endpoint, {\n method: 'put',\n headers: {\n 'appid': appid,\n 'token': accessToken,\n 'auth': '5',\n 'Content-Type': 'application/json'\n },\n body: jsondata\n })\n\n const result = await response.json()\n debug('response result', result)\n\n return result\n }\n\n async delete(path: string, data: any = {}) {\n const { store, accessToken, storeId: appid } = this.config\n\n debug('data', data)\n\n const jsondata = JSON.stringify(data)\n\n const endpoint = `https://api.xilnex.com/logic/v2${path}`\n\n const response = await fetch(endpoint, {\n method: 'delete',\n headers: {\n 'appid': appid,\n 'token': accessToken,\n 'auth': '5',\n 'Content-Type': 'application/json'\n },\n body: jsondata\n })\n\n const result = await response.json()\n debug('response result', result)\n\n return result\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/connector/index.ts"],"names":[],"mappings":";;AAAA,2BAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/connector/index.ts"],"names":[],"mappings":";;AAAA,2BAAwB","sourcesContent":["import './pos-connector'\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"pos-connector.js","sourceRoot":"","sources":["../../../server/engine/connector/pos-connector.ts"],"names":[],"mappings":";;;AAAA,uEAA2F;AAE3F,MAAa,YAAY;IACvB,KAAK,CAAC,KAAK,CAAC,iBAAiB;QAC3B,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;QAEtD,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAA;IACtE,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CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,IAAI,IAAI,UAAU,CAAC,QAAQ,gBAAgB,CAAC,CAAA;IACxG,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,UAAsB;QACrC,oCAAiB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAA;QAEtD,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,UAAU,CAAC,IAAI,mBAAmB,CAAC,CAAA;IAC/F,CAAC;IAED,IAAI,aAAa;QACf,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,YAAY;QACd,OAAO,CAAC,KAAK,CAAC,CAAA;IAChB,CAAC;CACF;AA5BD,oCA4BC;AAED,oCAAiB,CAAC,iBAAiB,CAAC,eAAe,EAAE,IAAI,YAAY,EAAE,CAAC,CAAA","sourcesContent":["import { ConnectionManager, Connector, Connection } from '@things-factory/integration-base'\n\nexport class POSConnector implements Connector {\n async ready(connectionConfigs) {\n await Promise.all(connectionConfigs.map(this.connect))\n\n ConnectionManager.logger.info('pos-connector connections are ready')\n }\n\n async connect(connection) {\n const { domain, name, endpoint } = connection\n\n ConnectionManager.addConnectionInstance(connection, { ...connection })\n\n ConnectionManager.logger.info(`pos-connector connection(${name}:${connection.endpoint}) is connected`)\n }\n\n async disconnect(connection: Connection) {\n ConnectionManager.removeConnectionInstance(connection)\n\n ConnectionManager.logger.info(`pos-connector connection(${connection.name}) is disconnected`)\n }\n\n get parameterSpec() {\n return []\n }\n\n get taskPrefixes() {\n return ['pos']\n }\n}\n\nConnectionManager.registerConnector('pos-connector', new POSConnector())\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/engine/index.ts"],"names":[],"mappings":";;AAAA,uBAAoB;AACpB,kBAAe"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/engine/index.ts"],"names":[],"mappings":";;AAAA,uBAAoB;AACpB,kBAAe","sourcesContent":["import './connector'\nimport './task'\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/task/index.ts"],"names":[],"mappings":";;AAAA,qBAAkB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/task/index.ts"],"names":[],"mappings":";;AAAA,qBAAkB","sourcesContent":["import './pos-api'\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"pos-api.js","sourceRoot":"","sources":["../../../server/engine/task/pos-api.ts"],"names":[],"mappings":";;AAAA,uEAAkF;AAClF,iDAA8C;AAC9C,qCAAuC;AACvC,6CAAyC;AACzC,uDAAyD;AAEzD,KAAK,UAAU,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;IAClD,IAAI,EACF,UAAU,EACV,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,EACvC,GAAG,IAAI,CAAA;IAER,IAAI,MAAM,GAAG,oCAAiB,CAAC,2BAA2B,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,CAAA;IACpF,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAA;KACjD;IAED,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAA;KAClC;IAED,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAA;IAC1C,MAAM,KAAK,GAAa,MAAM,UAAU,CAAC,OAAO,CAAC;QAC/C,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;KACxB,CAAC,CAAA;IAEF,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;KACpC;IAED,IAAI,MAAM,GAAG,MAAM,gBAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAA,cAAM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AgB,CAAC,CAAA;KAClC;IAED,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAA;IAC1C,MAAM,KAAK,GAAa,MAAM,UAAU,CAAC,OAAO,CAAC;QAC/C,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;KACxB,CAAC,CAAA;IAEF,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;KACpC;IAED,IAAI,MAAM,GAAG,MAAM,gBAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAA,cAAM,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAE1E,OAAO;QACL,IAAI,EAAE,MAAM;KACb,CAAA;AACH,CAAC;AAED,MAAM,CAAC,aAAa,GAAG;IACrB;QACE,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE;YACR,SAAS,EAAE,QAAQ;YACnB,QAAQ,EAAE,MAAM;SACjB;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,EAAE,EAAE,gBAAgB,CAAC;SAChC;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;KAClB;CACF,CAAA;AAED,+BAAY,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA","sourcesContent":["import { ConnectionManager, TaskRegistry } from '@things-factory/integration-base'\nimport { access } from '@things-factory/utils'\nimport { getRepository } from 'typeorm'\nimport { PosStore } from '../../entities'\nimport { POSAPI as API } from '../../controllers/pos-api'\n\nasync function POSAPI(step, { logger, data, domain }) {\n var {\n connection,\n params: { store: name, api, accessor }\n } = step\n\n var client = ConnectionManager.getConnectionInstanceByName(domain, connection) || {}\n if (!client) {\n throw new Error(`no connection : ${connection}`)\n }\n\n if (!api) {\n throw new Error(`no api defined`)\n }\n\n const repository = getRepository(PosStore)\n const store: PosStore = await repository.findOne({\n where: { domain, name }\n })\n\n if (!store) {\n throw new Error(`no store defined`)\n }\n\n var result = await API[api](store, accessor ? access(accessor, data) : {})\n\n return {\n data: result\n }\n}\n\nPOSAPI.parameterSpec = [\n {\n type: 'entity-selector',\n name: 'store',\n label: 'store',\n property: {\n queryName: 'stores',\n valueKey: 'name'\n }\n },\n {\n type: 'select',\n name: 'api',\n label: 'api',\n property: {\n options: ['', 'getPOSInvoices']\n }\n },\n {\n type: 'string',\n name: 'accessor',\n label: 'accessor'\n }\n]\n\nTaskRegistry.registerTaskHandler('pos-api', POSAPI)\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/entities/index.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAI7B,yFAJA,oBAAQ,OAIA;AAFJ,QAAA,QAAQ,GAAG,CAAC,oBAAQ,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/entities/index.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAI7B,yFAJA,oBAAQ,OAIA;AAFJ,QAAA,QAAQ,GAAG,CAAC,oBAAQ,CAAC,CAAA","sourcesContent":["import { PosStore } from './pos-store'\n\nexport const entities = [PosStore]\n\nexport { PosStore }\n"]}
@@ -1,104 +1,96 @@
1
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
2
  var _a, _b, _c;
12
3
  Object.defineProperty(exports, "__esModule", { value: true });
13
4
  exports.PosStore = void 0;
5
+ const tslib_1 = require("tslib");
14
6
  const auth_base_1 = require("@things-factory/auth-base");
15
7
  const shell_1 = require("@things-factory/shell");
16
8
  const typeorm_1 = require("typeorm");
17
9
  let PosStore = class PosStore {
18
10
  };
19
- __decorate([
11
+ tslib_1.__decorate([
20
12
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
21
- __metadata("design:type", String)
13
+ tslib_1.__metadata("design:type", String)
22
14
  ], PosStore.prototype, "id", void 0);
23
- __decorate([
15
+ tslib_1.__decorate([
24
16
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
25
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
17
+ tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
26
18
  ], PosStore.prototype, "domain", void 0);
27
- __decorate([
19
+ tslib_1.__decorate([
28
20
  (0, typeorm_1.Column)(),
29
- __metadata("design:type", String)
21
+ tslib_1.__metadata("design:type", String)
30
22
  ], PosStore.prototype, "platform", void 0);
31
- __decorate([
23
+ tslib_1.__decorate([
32
24
  (0, typeorm_1.Column)({
33
25
  nullable: true
34
26
  }),
35
- __metadata("design:type", String)
27
+ tslib_1.__metadata("design:type", String)
36
28
  ], PosStore.prototype, "storeId", void 0);
37
- __decorate([
29
+ tslib_1.__decorate([
38
30
  (0, typeorm_1.Column)(),
39
- __metadata("design:type", String)
31
+ tslib_1.__metadata("design:type", String)
40
32
  ], PosStore.prototype, "countryCode", void 0);
41
- __decorate([
33
+ tslib_1.__decorate([
42
34
  (0, typeorm_1.Column)({
43
35
  nullable: true
44
36
  }),
45
- __metadata("design:type", String)
37
+ tslib_1.__metadata("design:type", String)
46
38
  ], PosStore.prototype, "status", void 0);
47
- __decorate([
39
+ tslib_1.__decorate([
48
40
  (0, typeorm_1.Column)(),
49
- __metadata("design:type", String)
41
+ tslib_1.__metadata("design:type", String)
50
42
  ], PosStore.prototype, "name", void 0);
51
- __decorate([
43
+ tslib_1.__decorate([
52
44
  (0, typeorm_1.Column)({
53
45
  nullable: true
54
46
  }),
55
- __metadata("design:type", String)
47
+ tslib_1.__metadata("design:type", String)
56
48
  ], PosStore.prototype, "accessInfo", void 0);
57
- __decorate([
49
+ tslib_1.__decorate([
58
50
  (0, typeorm_1.Column)({
59
51
  nullable: true
60
52
  }),
61
- __metadata("design:type", String)
53
+ tslib_1.__metadata("design:type", String)
62
54
  ], PosStore.prototype, "accessToken", void 0);
63
- __decorate([
55
+ tslib_1.__decorate([
64
56
  (0, typeorm_1.Column)({
65
57
  nullable: true
66
58
  }),
67
- __metadata("design:type", String)
59
+ tslib_1.__metadata("design:type", String)
68
60
  ], PosStore.prototype, "refreshToken", void 0);
69
- __decorate([
61
+ tslib_1.__decorate([
70
62
  (0, typeorm_1.Column)({
71
63
  nullable: true
72
64
  }),
73
- __metadata("design:type", String)
65
+ tslib_1.__metadata("design:type", String)
74
66
  ], PosStore.prototype, "store", void 0);
75
- __decorate([
67
+ tslib_1.__decorate([
76
68
  (0, typeorm_1.Column)({
77
69
  nullable: true
78
70
  }),
79
- __metadata("design:type", String)
71
+ tslib_1.__metadata("design:type", String)
80
72
  ], PosStore.prototype, "description", void 0);
81
- __decorate([
73
+ tslib_1.__decorate([
82
74
  (0, typeorm_1.CreateDateColumn)(),
83
- __metadata("design:type", Date)
75
+ tslib_1.__metadata("design:type", Date)
84
76
  ], PosStore.prototype, "createdAt", void 0);
85
- __decorate([
77
+ tslib_1.__decorate([
86
78
  (0, typeorm_1.UpdateDateColumn)(),
87
- __metadata("design:type", Date)
79
+ tslib_1.__metadata("design:type", Date)
88
80
  ], PosStore.prototype, "updatedAt", void 0);
89
- __decorate([
81
+ tslib_1.__decorate([
90
82
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
91
83
  nullable: true
92
84
  }),
93
- __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
85
+ tslib_1.__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
94
86
  ], PosStore.prototype, "creator", void 0);
95
- __decorate([
87
+ tslib_1.__decorate([
96
88
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
97
89
  nullable: true
98
90
  }),
99
- __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
91
+ tslib_1.__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
100
92
  ], PosStore.prototype, "updater", void 0);
101
- PosStore = __decorate([
93
+ PosStore = tslib_1.__decorate([
102
94
  (0, typeorm_1.Entity)(),
103
95
  (0, typeorm_1.Index)('ix_pos-store_0', (store) => [store.domain, store.name], { unique: true })
104
96
  ], PosStore);
@@ -1 +1 @@
1
- {"version":3,"file":"pos-store.js","sourceRoot":"","sources":["../../server/entities/pos-store.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAgD;AAChD,iDAA8C;AAC9C,qCAAsH;AAOtH,IAAa,QAAQ,GAArB,MAAa,QAAQ;CAkEpB,CAAA;AAhEC;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;oCACrB;AAGV;IADC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;kDAClB,cAAM,oBAAN,cAAM;wCAAA;AAGd;IADC,IAAA,gBAAM,GAAE;;0CACO;AAKhB;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;yCACa;AAGf;IADC,IAAA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oBAAJ,gBAAI;yCAAA;AAjEF,QAAQ;IALpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,gBAAgB,EAChB,CAAC,KAAe,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAClE;GACY,QAAQ,CAkEpB;AAlEY,4BAAQ","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\nimport { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'\n\n@Entity()\n@Index(\n 'ix_pos-store_0',\n (store: PosStore) => [store.domain, store.name], { unique: true }\n)\nexport class PosStore {\n @PrimaryGeneratedColumn('uuid')\n id: string\n\n @ManyToOne(type => Domain)\n domain: Domain\n\n @Column()\n platform: string\n\n @Column({\n nullable: true\n })\n storeId: string\n\n @Column()\n countryCode: string\n\n @Column({\n nullable: true\n })\n status: string\n\n @Column()\n name: string\n\n @Column({\n nullable: true\n })\n accessInfo: string\n\n @Column({\n nullable: true\n })\n accessToken: string\n\n @Column({\n nullable: true\n })\n refreshToken: string\n\n @Column({\n nullable: true\n })\n store: string\n\n @Column({\n nullable: true\n })\n description: string\n\n @CreateDateColumn()\n createdAt: Date\n\n @UpdateDateColumn()\n updatedAt: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n creator: User\n\n @ManyToOne(type => User, {\n nullable: true\n })\n updater: User\n}\n"]}
@@ -1,31 +1,9 @@
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.schema = void 0;
27
- const typeDefs = __importStar(require("./types"));
28
- const resolvers = __importStar(require("./resolvers"));
4
+ const tslib_1 = require("tslib");
5
+ const typeDefs = tslib_1.__importStar(require("./types"));
6
+ const resolvers = tslib_1.__importStar(require("./resolvers"));
29
7
  exports.schema = {
30
8
  typeDefs,
31
9
  resolvers
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/graphql/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAmC;AACnC,uDAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,QAAQ;IACR,SAAS;CACV,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/graphql/index.ts"],"names":[],"mappings":";;;;AAAA,0DAAmC;AACnC,+DAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,QAAQ;IACR,SAAS;CACV,CAAA","sourcesContent":["import * as typeDefs from './types'\nimport * as resolvers from './resolvers'\n\nexport const schema = {\n typeDefs,\n resolvers\n}\n"]}
@@ -1,31 +1,9 @@
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.mutations = exports.queries = void 0;
27
- const POS = __importStar(require("./pos"));
28
- const POSAPI = __importStar(require("./pos-api"));
4
+ const tslib_1 = require("tslib");
5
+ const POS = tslib_1.__importStar(require("./pos"));
6
+ const POSAPI = tslib_1.__importStar(require("./pos-api"));
29
7
  exports.queries = [
30
8
  POS.Query,
31
9
  POSAPI.Query
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/resolvers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4B;AAC5B,kDAAmC;AAEtB,QAAA,OAAO,GAAG;IACrB,GAAG,CAAC,KAAK;IACT,MAAM,CAAC,KAAK;CACb,CAAA;AAEY,QAAA,SAAS,GAAG;IACvB,GAAG,CAAC,QAAQ;IACZ,MAAM,CAAC,QAAQ;CAChB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/resolvers/index.ts"],"names":[],"mappings":";;;;AAAA,mDAA4B;AAC5B,0DAAmC;AAEtB,QAAA,OAAO,GAAG;IACrB,GAAG,CAAC,KAAK;IACT,MAAM,CAAC,KAAK;CACb,CAAA;AAEY,QAAA,SAAS,GAAG;IACvB,GAAG,CAAC,QAAQ;IACZ,MAAM,CAAC,QAAQ;CAChB,CAAA","sourcesContent":["import * as POS from './pos'\nimport * as POSAPI from './pos-api'\n\nexport const queries = [\n POS.Query,\n POSAPI.Query\n]\n\nexport const mutations = [\n POS.Mutation,\n POSAPI.Mutation\n]\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"create-pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/create-pos-store.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA4C;AAC5C,sDAAuD;AAE1C,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,KAAK,EAAE,EAAE,OAAY;QAClD,OAAO,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,+BACvC,MAAM,EAAE,8BAAgB,CAAC,QAAQ,IAC9B,KAAK,KACR,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAC5B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAC3B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"create-pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/create-pos-store.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA4C;AAC5C,sDAAuD;AAE1C,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,KAAK,EAAE,EAAE,OAAY;QAClD,OAAO,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,+BACvC,MAAM,EAAE,8BAAgB,CAAC,QAAQ,IAC9B,KAAK,KACR,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAC5B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAC3B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from 'typeorm'\nimport { PosStore } from '../../../entities'\nimport { POS_STORE_STATUS } from '../../../controllers'\n\nexport const createPosStore = {\n async createPosStore(_: any, { store }, context: any) {\n return await getRepository(PosStore).save({\n status: POS_STORE_STATUS.INACTIVE,\n ...store,\n domain: context.state.domain,\n creator: context.state.user,\n updater: context.state.user\n })\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"delete-pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/delete-pos-store.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA4C;AAC5C,sDAAuD;AAE1C,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAY;QACjD,MAAM,UAAU,GAAa,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YACjE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE;SAC9C,CAAC,CAAA;QAEF,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,iCAC7B,UAAU,KACb,MAAM,EAAE,8BAAgB,CAAC,UAAU,EACnC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"delete-pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/delete-pos-store.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA4C;AAC5C,sDAAuD;AAE1C,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAY;QACjD,MAAM,UAAU,GAAa,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YACjE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE;SAC9C,CAAC,CAAA;QAEF,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,iCAC7B,UAAU,KACb,MAAM,EAAE,8BAAgB,CAAC,UAAU,EACnC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from 'typeorm'\nimport { PosStore } from '../../../entities'\nimport { POS_STORE_STATUS } from '../../../controllers'\n\nexport const deletePosStore = {\n async deletePosStore(_: any, { name }, context: any) {\n const foundStore: PosStore = await getRepository(PosStore).findOne({\n where: { domain: context.state.domain, name }\n })\n\n await getRepository(PosStore).save({\n ...foundStore,\n status: POS_STORE_STATUS.TERMINATED,\n updater: context.state.user\n })\n\n return true\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"delete-pos-stores.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/delete-pos-stores.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAC3C,gDAA4C;AAC5C,sDAAuD;AAE1C,QAAA,eAAe,GAAG;IAC7B,KAAK,CAAC,eAAe,CAAC,CAAM,EAAE,EAAE,KAAK,EAAE,EAAE,OAAY;QACnD,IAAI,WAAW,GAAe,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,CAAC;YAC/D,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,IAAA,YAAE,EAAC,KAAK,CAAC,EAAE;SACzD,CAAC,CAAA;QAEF,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,KAAe,EAAE,EAAE;YAC1D,uCACK,KAAK,KACR,MAAM,EAAE,8BAAgB,CAAC,UAAU,EACnC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC5B;QACH,CAAC,CAAC,CAAA;QAEF,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QACnD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"delete-pos-stores.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/delete-pos-stores.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAC3C,gDAA4C;AAC5C,sDAAuD;AAE1C,QAAA,eAAe,GAAG;IAC7B,KAAK,CAAC,eAAe,CAAC,CAAM,EAAE,EAAE,KAAK,EAAE,EAAE,OAAY;QACnD,IAAI,WAAW,GAAe,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,CAAC;YAC/D,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,IAAA,YAAE,EAAC,KAAK,CAAC,EAAE;SACzD,CAAC,CAAA;QAEF,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,KAAe,EAAE,EAAE;YAC1D,uCACK,KAAK,KACR,MAAM,EAAE,8BAAgB,CAAC,UAAU,EACnC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC5B;QACH,CAAC,CAAC,CAAA;QAEF,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QACnD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA","sourcesContent":["import { getRepository, In } from 'typeorm'\nimport { PosStore } from '../../../entities'\nimport { POS_STORE_STATUS } from '../../../controllers'\n\nexport const deletePosStores = {\n async deletePosStores(_: any, { names }, context: any) {\n let foundStores: PosStore[] = await getRepository(PosStore).find({\n where: { domain: context.state.domain, name: In(names) }\n })\n\n const updatedPosStore = foundStores.map((store: PosStore) => {\n return {\n ...store,\n status: POS_STORE_STATUS.TERMINATED,\n updater: context.state.user\n }\n })\n\n await getRepository(PosStore).save(updatedPosStore)\n return true\n }\n}\n"]}
@@ -1,29 +1,7 @@
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.Mutation = exports.Query = void 0;
4
+ const tslib_1 = require("tslib");
27
5
  const pos_store_1 = require("./pos-store");
28
6
  const pos_stores_1 = require("./pos-stores");
29
7
  const update_multiple_pos_stores_1 = require("./update-multiple-pos-stores");
@@ -31,7 +9,7 @@ const update_pos_store_1 = require("./update-pos-store");
31
9
  const create_pos_store_1 = require("./create-pos-store");
32
10
  const delete_pos_store_1 = require("./delete-pos-store");
33
11
  const delete_pos_stores_1 = require("./delete-pos-stores");
34
- const Xilnex = __importStar(require("./xilnex"));
12
+ const Xilnex = tslib_1.__importStar(require("./xilnex"));
35
13
  exports.Query = Object.assign(Object.assign(Object.assign({}, pos_stores_1.posStoresResolver), pos_store_1.posStoreResolver), Xilnex.Query);
36
14
  exports.Mutation = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, update_pos_store_1.updatePosStore), update_multiple_pos_stores_1.updateMultiplePosStore), create_pos_store_1.createPosStore), delete_pos_store_1.deletePosStore), delete_pos_stores_1.deletePosStores), Xilnex.Mutation);
37
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8C;AAC9C,6CAAgD;AAEhD,6EAAqE;AACrE,yDAAmD;AACnD,yDAAmD;AACnD,yDAAmD;AACnD,2DAAqD;AAErD,iDAAkC;AAErB,QAAA,KAAK,iDACb,8BAAiB,GACjB,4BAAgB,GAChB,MAAM,CAAC,KAAK,EAChB;AAEY,QAAA,QAAQ,2FAChB,iCAAc,GACd,mDAAsB,GACtB,iCAAc,GACd,iCAAc,GACd,mCAAe,GACf,MAAM,CAAC,QAAQ,EACnB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/index.ts"],"names":[],"mappings":";;;;AAAA,2CAA8C;AAC9C,6CAAgD;AAEhD,6EAAqE;AACrE,yDAAmD;AACnD,yDAAmD;AACnD,yDAAmD;AACnD,2DAAqD;AAErD,yDAAkC;AAErB,QAAA,KAAK,iDACb,8BAAiB,GACjB,4BAAgB,GAChB,MAAM,CAAC,KAAK,EAChB;AAEY,QAAA,QAAQ,2FAChB,iCAAc,GACd,mDAAsB,GACtB,iCAAc,GACd,iCAAc,GACd,mCAAe,GACf,MAAM,CAAC,QAAQ,EACnB","sourcesContent":["import { posStoreResolver } from './pos-store'\nimport { posStoresResolver } from './pos-stores'\n\nimport { updateMultiplePosStore } from './update-multiple-pos-stores'\nimport { updatePosStore } from './update-pos-store'\nimport { createPosStore } from './create-pos-store'\nimport { deletePosStore } from './delete-pos-store'\nimport { deletePosStores } from './delete-pos-stores'\n\nimport * as Xilnex from './xilnex'\n\nexport const Query = {\n ...posStoresResolver,\n ...posStoreResolver,\n ...Xilnex.Query\n}\n\nexport const Mutation = {\n ...updatePosStore,\n ...updateMultiplePosStore,\n ...createPosStore,\n ...deletePosStore,\n ...deletePosStores,\n ...Xilnex.Mutation\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/pos-store.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA4C;AAE/B,QAAA,gBAAgB,GAAG;IAC9B,KAAK,CAAC,QAAQ,CAAC,CAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAY;QACzC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAA;QAE1C,OAAO,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE;YAC3C,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/pos-store.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA4C;AAE/B,QAAA,gBAAgB,GAAG;IAC9B,KAAK,CAAC,QAAQ,CAAC,CAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAY;QACzC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAA;QAE1C,OAAO,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE;YAC3C,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from 'typeorm'\nimport { PosStore } from '../../../entities'\n\nexport const posStoreResolver = {\n async posStore(_: any, { id }, context: any) {\n const repository = getRepository(PosStore)\n\n return await getRepository(PosStore).findOne({\n where: { domain: context.state.domain, id },\n relations: ['domain', 'creator', 'updater']\n })\n }\n}\n"]}