@things-factory/integration-sellercraft 4.0.1 → 4.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-sellercraft",
3
- "version": "4.0.1",
3
+ "version": "4.0.6",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,18 +24,18 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
25
25
  },
26
26
  "dependencies": {
27
- "@things-factory/apptool-ui": "^4.0.1",
28
- "@things-factory/auth-ui": "^4.0.1",
29
- "@things-factory/biz-base": "^4.0.1",
30
- "@things-factory/code-ui": "^4.0.1",
31
- "@things-factory/context-ui": "^4.0.1",
32
- "@things-factory/grist-ui": "^4.0.1",
33
- "@things-factory/i18n-ui": "^4.0.1",
34
- "@things-factory/integration-ui": "^4.0.1",
35
- "@things-factory/more-ui": "^4.0.1",
36
- "@things-factory/resource-ui": "^4.0.1",
37
- "@things-factory/setting-ui": "^4.0.1",
38
- "@things-factory/system-ui": "^4.0.1",
27
+ "@things-factory/apptool-ui": "^4.0.6",
28
+ "@things-factory/auth-ui": "^4.0.6",
29
+ "@things-factory/biz-base": "^4.0.6",
30
+ "@things-factory/code-ui": "^4.0.6",
31
+ "@things-factory/context-ui": "^4.0.6",
32
+ "@things-factory/grist-ui": "^4.0.6",
33
+ "@things-factory/i18n-ui": "^4.0.6",
34
+ "@things-factory/integration-ui": "^4.0.6",
35
+ "@things-factory/more-ui": "^4.0.6",
36
+ "@things-factory/resource-ui": "^4.0.6",
37
+ "@things-factory/setting-ui": "^4.0.6",
38
+ "@things-factory/system-ui": "^4.0.6",
39
39
  "debug": "^4.1.1",
40
40
  "node-fetch": "^2.6.0",
41
41
  "querystring": "^0.2.1"
@@ -51,5 +51,5 @@
51
51
  "nock": "^13.0.2",
52
52
  "should": "^13.2.3"
53
53
  },
54
- "gitHead": "6803d6f150cc64cbb8b12a88d9131bb6fb9ad880"
54
+ "gitHead": "471247c3499ba439b074c7654ae8d8e9fc3972f0"
55
55
  }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.api = void 0;
7
- const debug_1 = __importDefault(require("debug"));
8
- const debug = (0, debug_1.default)('things-factory:integration-marketplace:store-api-decorator');
9
- const NOOP = v => v;
10
- const api = (target, property, descriptor) => {
11
- const method = descriptor.value;
12
- descriptor.value = async function (store, request) {
13
- const SellercraftAPI = this;
14
- var { platform } = store;
15
- var { action: platformAction, apis } = SellercraftAPI.getPlatform(platform);
16
- var m = apis[method.name];
17
- if (!m) {
18
- throw Error(`Sellercraft doesn't have API ${method.name}`);
19
- }
20
- var { path, method: httpMethod = 'post', denormalize = NOOP, normalize = NOOP, action = platformAction } = m.apply(this, [request]);
21
- var denormalized = await denormalize(request || {}, { store });
22
- debug('request', denormalized);
23
- var response = await action.apply(this, [
24
- { store, method: httpMethod, path, request: denormalized, platformAction }
25
- ]);
26
- debug('response', response);
27
- return await normalize(response, { store });
28
- };
29
- return descriptor;
30
- };
31
- exports.api = api;
32
- //# sourceMappingURL=decorators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../server/controllers/store-api/decorators.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,4DAA4D,CAAC,CAAA;AAIjF,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAEZ,MAAM,GAAG,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAE,UAAwC,EAAO,EAAE;IACrG,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAA;IAE/B,UAAU,CAAC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3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SellercraftAPI = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const service_1 = require("../../service");
15
- const decorators_1 = require("./decorators");
16
- class SellercraftAPI {
17
- static registerPlatform(name, action, apis) {
18
- SellercraftAPI.platforms[name] = {
19
- action,
20
- apis
21
- };
22
- }
23
- static getPlatform(name) {
24
- return SellercraftAPI.platforms[name];
25
- }
26
- static async getSellercraft(id) {
27
- const repository = (0, typeorm_1.getRepository)(service_1.Sellercraft);
28
- return await repository.findOne({
29
- where: { id },
30
- relations: ['domain']
31
- });
32
- }
33
- static echo(sellercraft, req) { }
34
- static addInboundOrder(sellercraft, req) { }
35
- static fetchOrderDocument(sellercraft, req) { }
36
- static initiateOrderDocument(sellercraft, req) { }
37
- static initiateOrderShipment(sellercraft, req) { }
38
- static packMarketplaceOrder(sellercraft, req) { }
39
- static updateMarketplaceOrder(sellercraft, req) { }
40
- static updateProduct(sellercraft, req) { }
41
- }
42
- SellercraftAPI.platforms = {};
43
- __decorate([
44
- decorators_1.api,
45
- __metadata("design:type", Function),
46
- __metadata("design:paramtypes", [Object, Object]),
47
- __metadata("design:returntype", Object)
48
- ], SellercraftAPI, "echo", null);
49
- __decorate([
50
- decorators_1.api,
51
- __metadata("design:type", Function),
52
- __metadata("design:paramtypes", [Object, Object]),
53
- __metadata("design:returntype", Object)
54
- ], SellercraftAPI, "addInboundOrder", null);
55
- __decorate([
56
- decorators_1.api,
57
- __metadata("design:type", Function),
58
- __metadata("design:paramtypes", [Object, Object]),
59
- __metadata("design:returntype", Object)
60
- ], SellercraftAPI, "fetchOrderDocument", null);
61
- __decorate([
62
- decorators_1.api,
63
- __metadata("design:type", Function),
64
- __metadata("design:paramtypes", [Object, Object]),
65
- __metadata("design:returntype", Object)
66
- ], SellercraftAPI, "initiateOrderDocument", null);
67
- __decorate([
68
- decorators_1.api,
69
- __metadata("design:type", Function),
70
- __metadata("design:paramtypes", [Object, Object]),
71
- __metadata("design:returntype", Object)
72
- ], SellercraftAPI, "initiateOrderShipment", null);
73
- __decorate([
74
- decorators_1.api,
75
- __metadata("design:type", Function),
76
- __metadata("design:paramtypes", [Object, Object]),
77
- __metadata("design:returntype", Object)
78
- ], SellercraftAPI, "packMarketplaceOrder", null);
79
- __decorate([
80
- decorators_1.api,
81
- __metadata("design:type", Function),
82
- __metadata("design:paramtypes", [Object, Object]),
83
- __metadata("design:returntype", Object)
84
- ], SellercraftAPI, "updateMarketplaceOrder", null);
85
- __decorate([
86
- decorators_1.api,
87
- __metadata("design:type", Function),
88
- __metadata("design:paramtypes", [Object, Object]),
89
- __metadata("design:returntype", Object)
90
- ], SellercraftAPI, "updateProduct", null);
91
- exports.SellercraftAPI = SellercraftAPI;
92
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/store-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuC;AACvC,2CAA2C;AAC3C,6CAAkC;AAElC,MAAa,cAAc;IAGzB,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI;QACxC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG;YAC/B,MAAM;YACN,IAAI;SACL,CAAA;IACH,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,IAAI;QACrB,OAAO,cAAc,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