@things-factory/integration-pos 5.0.7 → 6.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/controllers/index.js +2 -15
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/pos-api/decorators.js +2 -4
- package/dist-server/controllers/pos-api/decorators.js.map +1 -1
- package/dist-server/controllers/pos-api/index.js +11 -19
- package/dist-server/controllers/pos-api/index.js.map +1 -1
- package/dist-server/controllers/xilnex/apis/get-outlet.js.map +1 -1
- package/dist-server/controllers/xilnex/apis/get-outlets.js.map +1 -1
- package/dist-server/controllers/xilnex/apis/index.js +2 -15
- package/dist-server/controllers/xilnex/apis/index.js.map +1 -1
- package/dist-server/controllers/xilnex/index.js +3 -28
- package/dist-server/controllers/xilnex/index.js.map +1 -1
- package/dist-server/controllers/xilnex/platform-action.js.map +1 -1
- package/dist-server/controllers/xilnex/xilnex.js +3 -5
- package/dist-server/controllers/xilnex/xilnex.js.map +1 -1
- package/dist-server/engine/connector/index.js.map +1 -1
- package/dist-server/engine/connector/pos-connector.js.map +1 -1
- package/dist-server/engine/index.js.map +1 -1
- package/dist-server/engine/task/index.js.map +1 -1
- package/dist-server/engine/task/pos-api.js +4 -4
- package/dist-server/engine/task/pos-api.js.map +1 -1
- package/dist-server/entities/index.js.map +1 -1
- package/dist-server/entities/pos-store.js +34 -43
- package/dist-server/entities/pos-store.js.map +1 -1
- package/dist-server/graphql/index.js +3 -25
- package/dist-server/graphql/index.js.map +1 -1
- package/dist-server/graphql/resolvers/index.js +3 -25
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/create-pos-store.js +3 -3
- package/dist-server/graphql/resolvers/pos/create-pos-store.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/delete-pos-store.js +5 -5
- package/dist-server/graphql/resolvers/pos/delete-pos-store.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/delete-pos-stores.js +5 -4
- package/dist-server/graphql/resolvers/pos/delete-pos-stores.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/index.js +2 -24
- package/dist-server/graphql/resolvers/pos/index.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/pos-store.js +4 -4
- package/dist-server/graphql/resolvers/pos/pos-store.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/pos-stores.js +1 -2
- package/dist-server/graphql/resolvers/pos/pos-stores.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/update-multiple-pos-stores.js +3 -3
- package/dist-server/graphql/resolvers/pos/update-multiple-pos-stores.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/update-pos-store.js +3 -3
- package/dist-server/graphql/resolvers/pos/update-pos-store.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/xilnex/deactivate-xilnex-store.js +4 -4
- package/dist-server/graphql/resolvers/pos/xilnex/deactivate-xilnex-store.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/xilnex/generate-xilnex-access-token.js +5 -5
- package/dist-server/graphql/resolvers/pos/xilnex/generate-xilnex-access-token.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/xilnex/index.js.map +1 -1
- package/dist-server/graphql/resolvers/pos-api/index.js.map +1 -1
- package/dist-server/graphql/resolvers/pos-api/pos-outlet.js.map +1 -1
- package/dist-server/graphql/types/index.js +3 -25
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/pos/index.js.map +1 -1
- package/dist-server/graphql/types/pos/new-pos-store.js +2 -4
- package/dist-server/graphql/types/pos/new-pos-store.js.map +1 -1
- package/dist-server/graphql/types/pos/pos-store-list.js +2 -4
- package/dist-server/graphql/types/pos/pos-store-list.js.map +1 -1
- package/dist-server/graphql/types/pos/pos-store-patch.js +2 -4
- package/dist-server/graphql/types/pos/pos-store-patch.js.map +1 -1
- package/dist-server/graphql/types/pos/pos-store.js +2 -4
- package/dist-server/graphql/types/pos/pos-store.js.map +1 -1
- package/dist-server/graphql/types/pos-api/pos-outlet.js +2 -4
- package/dist-server/graphql/types/pos-api/pos-outlet.js.map +1 -1
- package/dist-server/index.js +5 -18
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +15 -15
- package/server/controllers/pos-api/index.ts +2 -1
- package/server/engine/task/pos-api.ts +4 -3
- package/server/graphql/resolvers/pos/create-pos-store.ts +4 -3
- package/server/graphql/resolvers/pos/delete-pos-store.ts +5 -4
- package/server/graphql/resolvers/pos/delete-pos-stores.ts +7 -4
- package/server/graphql/resolvers/pos/pos-store.ts +4 -3
- package/server/graphql/resolvers/pos/pos-stores.ts +2 -4
- package/server/graphql/resolvers/pos/update-multiple-pos-stores.ts +4 -3
- package/server/graphql/resolvers/pos/update-pos-store.ts +4 -3
- package/server/graphql/resolvers/pos/xilnex/deactivate-xilnex-store.ts +5 -4
- package/server/graphql/resolvers/pos/xilnex/generate-xilnex-access-token.ts +6 -6
- package/server/graphql/resolvers/pos-api/pos-outlet.ts +5 -5
|
@@ -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":"
|
|
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
|
|
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":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../server/controllers/pos-api/decorators.ts"],"names":[],"mappings":";;;;AAAA,0DAAyB;AACzB,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,kDAAkD,CAAC,CAAA;AAIvE,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAEZ,MAAM,GA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AED,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,16 +1,8 @@
|
|
|
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;
|
|
13
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const shell_1 = require("@things-factory/shell");
|
|
14
6
|
const entities_1 = require("../../entities");
|
|
15
7
|
const decorators_1 = require("./decorators");
|
|
16
8
|
exports.POS_STORE_STATUS = {
|
|
@@ -29,7 +21,7 @@ class POSAPI {
|
|
|
29
21
|
return POSAPI.platforms[name];
|
|
30
22
|
}
|
|
31
23
|
static async getPosStore(id) {
|
|
32
|
-
const repository = (0,
|
|
24
|
+
const repository = (0, shell_1.getRepository)(entities_1.PosStore);
|
|
33
25
|
// return await repository.find(id)
|
|
34
26
|
return await repository.findOne({
|
|
35
27
|
where: { id },
|
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/pos-api/index.ts"],"names":[],"mappings":";;;;AAAA,iDAAqD;AAErD,6CAAyC;AACzC,6CAAkC;AAErB,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;CACzB,CAAA;AAED,MAAa,MAAM;IAGjB,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,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,qBAAa,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 '@things-factory/shell'\n\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
|
-
|
|
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":"
|
|
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
|
-
|
|
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":"
|
|
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,OAAO,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE;QAC7B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;KACpB;IAED,IAAI,MAAM,GAAG,IAAI,CAAA;IACjB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,IAAI,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QAC5B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,GAAG,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;IAEF,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AAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;KACpB;IAED,IAAI,MAAM,GAAG,IAAI,CAAA;IACjB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,IAAI,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QAC5B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,GAAG,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC;AAEM,MAAM,MAAM,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IACvE,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC;QACxB,KAAK,EAAE,KAAK,CAAC,OAAO;QACpB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAC,CAAA;IAEF,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,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
|
|
8
|
-
const
|
|
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
|
constructor(config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xilnex.js","sourceRoot":"","sources":["../../../server/controllers/xilnex/xilnex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"xilnex.js","sourceRoot":"","sources":["../../../server/controllers/xilnex/xilnex.ts"],"names":[],"mappings":";;;;AAAA,oEAA8B;AAC9B,0DAAyB;AAEzB,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,uCAAuC,CAAC,CAAA;AAQ5D,MAAa,MAAM;IAGjB,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,qBACN,MAAM,CACV,CAAA;IACH,CAAC;IAED,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,MAAM,CAAA;QAE1D,KAAK,CAAC,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;QA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,oCAAiB,CAAC,qBAAqB,CAAC,UAAU,oBAAO,UAAU,EAAG,CAAA;QAEtE,oCAAiB,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,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const integration_base_1 = require("@things-factory/integration-base");
|
|
4
|
+
const shell_1 = require("@things-factory/shell");
|
|
4
5
|
const utils_1 = require("@things-factory/utils");
|
|
5
|
-
const typeorm_1 = require("typeorm");
|
|
6
|
-
const entities_1 = require("../../entities");
|
|
7
6
|
const pos_api_1 = require("../../controllers/pos-api");
|
|
7
|
+
const entities_1 = require("../../entities");
|
|
8
8
|
async function POSAPI(step, { logger, data, domain }) {
|
|
9
9
|
var { connection, params: { store: name, api, accessor } } = step;
|
|
10
10
|
var client = integration_base_1.ConnectionManager.getConnectionInstanceByName(domain, connection) || {};
|
|
@@ -14,9 +14,9 @@ async function POSAPI(step, { logger, data, domain }) {
|
|
|
14
14
|
if (!api) {
|
|
15
15
|
throw new Error(`no api defined`);
|
|
16
16
|
}
|
|
17
|
-
const repository = (0,
|
|
17
|
+
const repository = (0, shell_1.getRepository)(entities_1.PosStore);
|
|
18
18
|
const store = await repository.findOne({
|
|
19
|
-
where: { domain, name }
|
|
19
|
+
where: { domain: { id: domain.id }, name }
|
|
20
20
|
});
|
|
21
21
|
if (!store) {
|
|
22
22
|
throw new Error(`no store defined`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pos-api.js","sourceRoot":"","sources":["../../../server/engine/task/pos-api.ts"],"names":[],"mapp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,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 { getRepository } from '@things-factory/shell'\nimport { access } from '@things-factory/utils'\n\nimport { POSAPI as API } from '../../controllers/pos-api'\nimport { PosStore } from '../../entities'\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: { id: domain.id }, 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,95 @@
|
|
|
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
|
-
var _a, _b, _c;
|
|
12
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
3
|
exports.PosStore = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
14
5
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
15
6
|
const shell_1 = require("@things-factory/shell");
|
|
16
7
|
const typeorm_1 = require("typeorm");
|
|
17
8
|
let PosStore = class PosStore {
|
|
18
9
|
};
|
|
19
|
-
__decorate([
|
|
10
|
+
tslib_1.__decorate([
|
|
20
11
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
|
-
__metadata("design:type", String)
|
|
12
|
+
tslib_1.__metadata("design:type", String)
|
|
22
13
|
], PosStore.prototype, "id", void 0);
|
|
23
|
-
__decorate([
|
|
14
|
+
tslib_1.__decorate([
|
|
24
15
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
25
|
-
__metadata("design:type",
|
|
16
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
26
17
|
], PosStore.prototype, "domain", void 0);
|
|
27
|
-
__decorate([
|
|
18
|
+
tslib_1.__decorate([
|
|
28
19
|
(0, typeorm_1.Column)(),
|
|
29
|
-
__metadata("design:type", String)
|
|
20
|
+
tslib_1.__metadata("design:type", String)
|
|
30
21
|
], PosStore.prototype, "platform", void 0);
|
|
31
|
-
__decorate([
|
|
22
|
+
tslib_1.__decorate([
|
|
32
23
|
(0, typeorm_1.Column)({
|
|
33
24
|
nullable: true
|
|
34
25
|
}),
|
|
35
|
-
__metadata("design:type", String)
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
36
27
|
], PosStore.prototype, "storeId", void 0);
|
|
37
|
-
__decorate([
|
|
28
|
+
tslib_1.__decorate([
|
|
38
29
|
(0, typeorm_1.Column)(),
|
|
39
|
-
__metadata("design:type", String)
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
40
31
|
], PosStore.prototype, "countryCode", void 0);
|
|
41
|
-
__decorate([
|
|
32
|
+
tslib_1.__decorate([
|
|
42
33
|
(0, typeorm_1.Column)({
|
|
43
34
|
nullable: true
|
|
44
35
|
}),
|
|
45
|
-
__metadata("design:type", String)
|
|
36
|
+
tslib_1.__metadata("design:type", String)
|
|
46
37
|
], PosStore.prototype, "status", void 0);
|
|
47
|
-
__decorate([
|
|
38
|
+
tslib_1.__decorate([
|
|
48
39
|
(0, typeorm_1.Column)(),
|
|
49
|
-
__metadata("design:type", String)
|
|
40
|
+
tslib_1.__metadata("design:type", String)
|
|
50
41
|
], PosStore.prototype, "name", void 0);
|
|
51
|
-
__decorate([
|
|
42
|
+
tslib_1.__decorate([
|
|
52
43
|
(0, typeorm_1.Column)({
|
|
53
44
|
nullable: true
|
|
54
45
|
}),
|
|
55
|
-
__metadata("design:type", String)
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
56
47
|
], PosStore.prototype, "accessInfo", void 0);
|
|
57
|
-
__decorate([
|
|
48
|
+
tslib_1.__decorate([
|
|
58
49
|
(0, typeorm_1.Column)({
|
|
59
50
|
nullable: true
|
|
60
51
|
}),
|
|
61
|
-
__metadata("design:type", String)
|
|
52
|
+
tslib_1.__metadata("design:type", String)
|
|
62
53
|
], PosStore.prototype, "accessToken", void 0);
|
|
63
|
-
__decorate([
|
|
54
|
+
tslib_1.__decorate([
|
|
64
55
|
(0, typeorm_1.Column)({
|
|
65
56
|
nullable: true
|
|
66
57
|
}),
|
|
67
|
-
__metadata("design:type", String)
|
|
58
|
+
tslib_1.__metadata("design:type", String)
|
|
68
59
|
], PosStore.prototype, "refreshToken", void 0);
|
|
69
|
-
__decorate([
|
|
60
|
+
tslib_1.__decorate([
|
|
70
61
|
(0, typeorm_1.Column)({
|
|
71
62
|
nullable: true
|
|
72
63
|
}),
|
|
73
|
-
__metadata("design:type", String)
|
|
64
|
+
tslib_1.__metadata("design:type", String)
|
|
74
65
|
], PosStore.prototype, "store", void 0);
|
|
75
|
-
__decorate([
|
|
66
|
+
tslib_1.__decorate([
|
|
76
67
|
(0, typeorm_1.Column)({
|
|
77
68
|
nullable: true
|
|
78
69
|
}),
|
|
79
|
-
__metadata("design:type", String)
|
|
70
|
+
tslib_1.__metadata("design:type", String)
|
|
80
71
|
], PosStore.prototype, "description", void 0);
|
|
81
|
-
__decorate([
|
|
72
|
+
tslib_1.__decorate([
|
|
82
73
|
(0, typeorm_1.CreateDateColumn)(),
|
|
83
|
-
__metadata("design:type", Date)
|
|
74
|
+
tslib_1.__metadata("design:type", Date)
|
|
84
75
|
], PosStore.prototype, "createdAt", void 0);
|
|
85
|
-
__decorate([
|
|
76
|
+
tslib_1.__decorate([
|
|
86
77
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
87
|
-
__metadata("design:type", Date)
|
|
78
|
+
tslib_1.__metadata("design:type", Date)
|
|
88
79
|
], PosStore.prototype, "updatedAt", void 0);
|
|
89
|
-
__decorate([
|
|
80
|
+
tslib_1.__decorate([
|
|
90
81
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
91
82
|
nullable: true
|
|
92
83
|
}),
|
|
93
|
-
__metadata("design:type",
|
|
84
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
94
85
|
], PosStore.prototype, "creator", void 0);
|
|
95
|
-
__decorate([
|
|
86
|
+
tslib_1.__decorate([
|
|
96
87
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
97
88
|
nullable: true
|
|
98
89
|
}),
|
|
99
|
-
__metadata("design:type",
|
|
90
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
100
91
|
], PosStore.prototype, "updater", void 0);
|
|
101
|
-
PosStore = __decorate([
|
|
92
|
+
PosStore = tslib_1.__decorate([
|
|
102
93
|
(0, typeorm_1.Entity)(),
|
|
103
94
|
(0, typeorm_1.Index)('ix_pos-store_0', (store) => [store.domain, store.name], { unique: true })
|
|
104
95
|
], PosStore);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pos-store.js","sourceRoot":"","sources":["../../server/entities/pos-store.ts"],"names":[],"mappings":"
|
|
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,M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,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
|
|
28
|
-
const
|
|
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":"
|
|
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
|
|
28
|
-
const
|
|
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":"
|
|
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,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPosStore = void 0;
|
|
4
|
-
const
|
|
5
|
-
const entities_1 = require("../../../entities");
|
|
4
|
+
const shell_1 = require("@things-factory/shell");
|
|
6
5
|
const controllers_1 = require("../../../controllers");
|
|
6
|
+
const entities_1 = require("../../../entities");
|
|
7
7
|
exports.createPosStore = {
|
|
8
8
|
async createPosStore(_, { store }, context) {
|
|
9
|
-
return await (0,
|
|
9
|
+
return await (0, shell_1.getRepository)(entities_1.PosStore).save(Object.assign(Object.assign({ status: controllers_1.POS_STORE_STATUS.INACTIVE }, store), { domain: context.state.domain, creator: context.state.user, updater: context.state.user }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=create-pos-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/create-pos-store.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"create-pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/create-pos-store.ts"],"names":[],"mappings":";;;AAAA,iDAAqD;AAErD,sDAAuD;AACvD,gDAA4C;AAE/B,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,KAAK,EAAE,EAAE,OAAwB;QAC9D,OAAO,MAAM,IAAA,qBAAa,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 '@things-factory/shell'\n\nimport { POS_STORE_STATUS } from '../../../controllers'\nimport { PosStore } from '../../../entities'\n\nexport const createPosStore = {\n async createPosStore(_: any, { store }, context: ResolverContext) {\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,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deletePosStore = void 0;
|
|
4
|
-
const
|
|
5
|
-
const entities_1 = require("../../../entities");
|
|
4
|
+
const shell_1 = require("@things-factory/shell");
|
|
6
5
|
const controllers_1 = require("../../../controllers");
|
|
6
|
+
const entities_1 = require("../../../entities");
|
|
7
7
|
exports.deletePosStore = {
|
|
8
8
|
async deletePosStore(_, { name }, context) {
|
|
9
|
-
const foundStore = await (0,
|
|
10
|
-
where: { domain: context.state.domain, name }
|
|
9
|
+
const foundStore = await (0, shell_1.getRepository)(entities_1.PosStore).findOne({
|
|
10
|
+
where: { domain: { id: context.state.domain.id }, name }
|
|
11
11
|
});
|
|
12
|
-
await (0,
|
|
12
|
+
await (0, shell_1.getRepository)(entities_1.PosStore).save(Object.assign(Object.assign({}, foundStore), { status: controllers_1.POS_STORE_STATUS.TERMINATED, updater: context.state.user }));
|
|
13
13
|
return true;
|
|
14
14
|
}
|
|
15
15
|
};
|