@things-factory/integration-sellercraft 4.3.671 → 4.3.673

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist-server/constants/index.js +19 -0
  2. package/dist-server/constants/index.js.map +1 -0
  3. package/dist-server/constants/order-status-mapping.js +31 -0
  4. package/dist-server/constants/order-status-mapping.js.map +1 -0
  5. package/dist-server/constants/platform.js +10 -0
  6. package/dist-server/constants/platform.js.map +1 -0
  7. package/dist-server/controllers/index.js +21 -0
  8. package/dist-server/controllers/index.js.map +1 -0
  9. package/dist-server/controllers/sellercraft/apis/add-inbound-order.js +47 -0
  10. package/dist-server/controllers/sellercraft/apis/add-inbound-order.js.map +1 -0
  11. package/dist-server/controllers/sellercraft/apis/echo.js +19 -0
  12. package/dist-server/controllers/sellercraft/apis/echo.js.map +1 -0
  13. package/dist-server/controllers/sellercraft/apis/fetch-order-document.js +22 -0
  14. package/dist-server/controllers/sellercraft/apis/fetch-order-document.js.map +1 -0
  15. package/dist-server/controllers/sellercraft/apis/index.js +25 -0
  16. package/dist-server/controllers/sellercraft/apis/index.js.map +1 -0
  17. package/dist-server/controllers/sellercraft/apis/initiate-order-document.js +21 -0
  18. package/dist-server/controllers/sellercraft/apis/initiate-order-document.js.map +1 -0
  19. package/dist-server/controllers/sellercraft/apis/initiate-order-shipment.js +34 -0
  20. package/dist-server/controllers/sellercraft/apis/initiate-order-shipment.js.map +1 -0
  21. package/dist-server/controllers/sellercraft/apis/pack-marketplace-order.js +47 -0
  22. package/dist-server/controllers/sellercraft/apis/pack-marketplace-order.js.map +1 -0
  23. package/dist-server/controllers/sellercraft/apis/update-marketplace-order.js +18 -0
  24. package/dist-server/controllers/sellercraft/apis/update-marketplace-order.js.map +1 -0
  25. package/dist-server/controllers/sellercraft/apis/update-product.js +24 -0
  26. package/dist-server/controllers/sellercraft/apis/update-product.js.map +1 -0
  27. package/dist-server/controllers/sellercraft/index.js +34 -0
  28. package/dist-server/controllers/sellercraft/index.js.map +1 -0
  29. package/dist-server/controllers/sellercraft/platform-action.js +33 -0
  30. package/dist-server/controllers/sellercraft/platform-action.js.map +1 -0
  31. package/dist-server/controllers/sellercraft/sellercraft.js +93 -0
  32. package/dist-server/controllers/sellercraft/sellercraft.js.map +1 -0
  33. package/dist-server/controllers/sellercraft-api/decorators.js +40 -0
  34. package/dist-server/controllers/sellercraft-api/decorators.js.map +1 -0
  35. package/dist-server/controllers/sellercraft-api/index.js +92 -0
  36. package/dist-server/controllers/sellercraft-api/index.js.map +1 -0
  37. package/dist-server/controllers/sellercraft-api/types.js +1 -0
  38. package/dist-server/controllers/sellercraft-api/types.js.map +1 -0
  39. package/dist-server/controllers/sellercraft-channel-integration/apis/echo.js +19 -0
  40. package/dist-server/controllers/sellercraft-channel-integration/apis/echo.js.map +1 -0
  41. package/dist-server/controllers/sellercraft-channel-integration/apis/index.js +23 -0
  42. package/dist-server/controllers/sellercraft-channel-integration/apis/index.js.map +1 -0
  43. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-categories.js +39 -0
  44. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-categories.js.map +1 -0
  45. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-category-attributes.js +48 -0
  46. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-category-attributes.js.map +1 -0
  47. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order-package.js +49 -0
  48. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order-package.js.map +1 -0
  49. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.js +93 -0
  50. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.js.map +1 -0
  51. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.js +91 -0
  52. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.js.map +1 -0
  53. package/dist-server/controllers/sellercraft-channel-integration/index.js +34 -0
  54. package/dist-server/controllers/sellercraft-channel-integration/index.js.map +1 -0
  55. package/dist-server/controllers/sellercraft-channel-integration/platform-action.js +33 -0
  56. package/dist-server/controllers/sellercraft-channel-integration/platform-action.js.map +1 -0
  57. package/dist-server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.js +101 -0
  58. package/dist-server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.js.map +1 -0
  59. package/dist-server/controllers/sellercraft-channel-integration-api/decorators.js +32 -0
  60. package/dist-server/controllers/sellercraft-channel-integration-api/decorators.js.map +1 -0
  61. package/dist-server/controllers/sellercraft-channel-integration-api/index.js +78 -0
  62. package/dist-server/controllers/sellercraft-channel-integration-api/index.js.map +1 -0
  63. package/dist-server/controllers/sellercraft-channel-integration-api/types.js +1 -0
  64. package/dist-server/controllers/sellercraft-channel-integration-api/types.js.map +1 -0
  65. package/dist-server/index.js +23 -0
  66. package/dist-server/index.js.map +1 -0
  67. package/dist-server/middlewares/index.js +8 -0
  68. package/dist-server/middlewares/index.js.map +1 -0
  69. package/dist-server/migrations/index.js +12 -0
  70. package/dist-server/migrations/index.js.map +1 -0
  71. package/dist-server/routers/sellercraft-router.js +286 -0
  72. package/dist-server/routers/sellercraft-router.js.map +1 -0
  73. package/dist-server/routes.js +29 -0
  74. package/dist-server/routes.js.map +1 -0
  75. package/dist-server/service/index.js +36 -0
  76. package/dist-server/service/index.js.map +1 -0
  77. package/dist-server/service/marketplace-channel/index.js +9 -0
  78. package/dist-server/service/marketplace-channel/index.js.map +1 -0
  79. package/dist-server/service/marketplace-channel/marketplace-channel-order-mutation.js +402 -0
  80. package/dist-server/service/marketplace-channel/marketplace-channel-order-mutation.js.map +1 -0
  81. package/dist-server/service/marketplace-channel/marketplace-channel-product-mutation.js +255 -0
  82. package/dist-server/service/marketplace-channel/marketplace-channel-product-mutation.js.map +1 -0
  83. package/dist-server/service/marketplace-channel/marketplace-channel.js +93 -0
  84. package/dist-server/service/marketplace-channel/marketplace-channel.js.map +1 -0
  85. package/dist-server/service/sellercraft/index.js +9 -0
  86. package/dist-server/service/sellercraft/index.js.map +1 -0
  87. package/dist-server/service/sellercraft/sellercraft-mutation.js +120 -0
  88. package/dist-server/service/sellercraft/sellercraft-mutation.js.map +1 -0
  89. package/dist-server/service/sellercraft/sellercraft-query.js +84 -0
  90. package/dist-server/service/sellercraft/sellercraft-query.js.map +1 -0
  91. package/dist-server/service/sellercraft/sellercraft-type.js +89 -0
  92. package/dist-server/service/sellercraft/sellercraft-type.js.map +1 -0
  93. package/dist-server/service/sellercraft/sellercraft.js +116 -0
  94. package/dist-server/service/sellercraft/sellercraft.js.map +1 -0
  95. package/dist-server/utils/tokencraft-util.js +63 -0
  96. package/dist-server/utils/tokencraft-util.js.map +1 -0
  97. package/package.json +15 -15
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SellercraftList = exports.SellercraftPatch = exports.NewSellercraft = void 0;
13
+ const type_graphql_1 = require("type-graphql");
14
+ const sellercraft_1 = require("./sellercraft");
15
+ let NewSellercraft = class NewSellercraft {
16
+ };
17
+ __decorate([
18
+ (0, type_graphql_1.Field)(),
19
+ __metadata("design:type", String)
20
+ ], NewSellercraft.prototype, "name", void 0);
21
+ __decorate([
22
+ (0, type_graphql_1.Field)({ nullable: true }),
23
+ __metadata("design:type", String)
24
+ ], NewSellercraft.prototype, "description", void 0);
25
+ __decorate([
26
+ (0, type_graphql_1.Field)(type => sellercraft_1.SellercraftPlatform, { nullable: true }),
27
+ __metadata("design:type", String)
28
+ ], NewSellercraft.prototype, "platform", void 0);
29
+ __decorate([
30
+ (0, type_graphql_1.Field)(),
31
+ __metadata("design:type", String)
32
+ ], NewSellercraft.prototype, "accountId", void 0);
33
+ __decorate([
34
+ (0, type_graphql_1.Field)(type => sellercraft_1.SellercraftStatus, { nullable: true }),
35
+ __metadata("design:type", String)
36
+ ], NewSellercraft.prototype, "status", void 0);
37
+ NewSellercraft = __decorate([
38
+ (0, type_graphql_1.InputType)()
39
+ ], NewSellercraft);
40
+ exports.NewSellercraft = NewSellercraft;
41
+ let SellercraftPatch = class SellercraftPatch {
42
+ };
43
+ __decorate([
44
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
45
+ __metadata("design:type", String)
46
+ ], SellercraftPatch.prototype, "id", void 0);
47
+ __decorate([
48
+ (0, type_graphql_1.Field)({ nullable: true }),
49
+ __metadata("design:type", String)
50
+ ], SellercraftPatch.prototype, "name", void 0);
51
+ __decorate([
52
+ (0, type_graphql_1.Field)(type => sellercraft_1.SellercraftPlatform, { nullable: true }),
53
+ __metadata("design:type", String)
54
+ ], SellercraftPatch.prototype, "platform", void 0);
55
+ __decorate([
56
+ (0, type_graphql_1.Field)({ nullable: true }),
57
+ __metadata("design:type", String)
58
+ ], SellercraftPatch.prototype, "accountId", void 0);
59
+ __decorate([
60
+ (0, type_graphql_1.Field)({ nullable: true }),
61
+ __metadata("design:type", String)
62
+ ], SellercraftPatch.prototype, "description", void 0);
63
+ __decorate([
64
+ (0, type_graphql_1.Field)(type => sellercraft_1.SellercraftStatus, { nullable: true }),
65
+ __metadata("design:type", String)
66
+ ], SellercraftPatch.prototype, "status", void 0);
67
+ __decorate([
68
+ (0, type_graphql_1.Field)({ nullable: true }),
69
+ __metadata("design:type", String)
70
+ ], SellercraftPatch.prototype, "cuFlag", void 0);
71
+ SellercraftPatch = __decorate([
72
+ (0, type_graphql_1.InputType)()
73
+ ], SellercraftPatch);
74
+ exports.SellercraftPatch = SellercraftPatch;
75
+ let SellercraftList = class SellercraftList {
76
+ };
77
+ __decorate([
78
+ (0, type_graphql_1.Field)(type => [sellercraft_1.Sellercraft]),
79
+ __metadata("design:type", Array)
80
+ ], SellercraftList.prototype, "items", void 0);
81
+ __decorate([
82
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
83
+ __metadata("design:type", Number)
84
+ ], SellercraftList.prototype, "total", void 0);
85
+ SellercraftList = __decorate([
86
+ (0, type_graphql_1.ObjectType)()
87
+ ], SellercraftList);
88
+ exports.SellercraftList = SellercraftList;
89
+ //# sourceMappingURL=sellercraft-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sellercraft-type.js","sourceRoot":"","sources":["../../../server/service/sellercraft/sellercraft-type.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAoE;AAEpE,+CAAmF;AAG5E,IAAM,cAAc,GAApB,MAAM,cAAc;CAe1B,CAAA;AAdC;IAAC,IAAA,oBAAK,GAAE;;4CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iCAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC1B;AAE7B;IAAC,IAAA,oBAAK,GAAE;;iDACS;AAEjB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,+BAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC3B;AAdf,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CAe1B;AAfY,wCAAc;AAkBpB,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAqB5B,CAAA;AApBC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iCAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACzB;AAE9B;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACR;AAElB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,+BAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC3B;AAE1B;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACX;AApBJ,gBAAgB;IAD5B,IAAA,wBAAS,GAAE;GACC,gBAAgB,CAqB5B;AArBY,4CAAgB;AAwBtB,IAAM,eAAe,GAArB,MAAM,eAAe;CAM3B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,yBAAW,CAAC,CAAC;;8CACT;AAEpB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;8CACN;AALF,eAAe;IAD3B,IAAA,yBAAU,GAAE;GACA,eAAe,CAM3B;AANY,0CAAe"}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var _a, _b, _c;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.Sellercraft = exports.SellercraftPlatform = exports.SellercraftStatus = void 0;
14
+ const type_graphql_1 = require("type-graphql");
15
+ const typeorm_1 = require("typeorm");
16
+ const auth_base_1 = require("@things-factory/auth-base");
17
+ const shell_1 = require("@things-factory/shell");
18
+ var SellercraftStatus;
19
+ (function (SellercraftStatus) {
20
+ SellercraftStatus["ACTIVE"] = "ACTIVE";
21
+ SellercraftStatus["INACTIVE"] = "INACTIVE";
22
+ SellercraftStatus["TERMINATED"] = "TERMINATED";
23
+ })(SellercraftStatus = exports.SellercraftStatus || (exports.SellercraftStatus = {}));
24
+ (0, type_graphql_1.registerEnumType)(SellercraftStatus, {
25
+ name: 'SellercraftStatus',
26
+ description: 'state enumeration of a sellercraft'
27
+ });
28
+ var SellercraftPlatform;
29
+ (function (SellercraftPlatform) {
30
+ SellercraftPlatform["SELLERCRAFT"] = "SELLERCRAFT";
31
+ })(SellercraftPlatform = exports.SellercraftPlatform || (exports.SellercraftPlatform = {}));
32
+ (0, type_graphql_1.registerEnumType)(SellercraftPlatform, {
33
+ name: 'SellercraftPlatform',
34
+ description: 'platform enumeration of a sellercraft'
35
+ });
36
+ let Sellercraft = class Sellercraft {
37
+ };
38
+ __decorate([
39
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
40
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
41
+ __metadata("design:type", String)
42
+ ], Sellercraft.prototype, "id", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
45
+ (0, type_graphql_1.Field)({ nullable: true }),
46
+ __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
47
+ ], Sellercraft.prototype, "domain", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.RelationId)((sellercraft) => sellercraft.domain),
50
+ __metadata("design:type", String)
51
+ ], Sellercraft.prototype, "domainId", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)(),
54
+ (0, type_graphql_1.Field)(),
55
+ __metadata("design:type", String)
56
+ ], Sellercraft.prototype, "name", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({ nullable: true }),
59
+ (0, type_graphql_1.Field)({ nullable: true }),
60
+ __metadata("design:type", String)
61
+ ], Sellercraft.prototype, "description", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.Column)(),
64
+ (0, type_graphql_1.Field)(),
65
+ __metadata("design:type", String)
66
+ ], Sellercraft.prototype, "accountId", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.Column)(),
69
+ (0, type_graphql_1.Field)(),
70
+ __metadata("design:type", String)
71
+ ], Sellercraft.prototype, "platform", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.Column)({ nullable: true }),
74
+ (0, type_graphql_1.Field)({ nullable: true }),
75
+ __metadata("design:type", String)
76
+ ], Sellercraft.prototype, "status", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.Column)('simple-json', { nullable: true }),
79
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
80
+ __metadata("design:type", Object)
81
+ ], Sellercraft.prototype, "sellercraftSetting", void 0);
82
+ __decorate([
83
+ (0, typeorm_1.CreateDateColumn)(),
84
+ (0, type_graphql_1.Field)({ nullable: true }),
85
+ __metadata("design:type", Date)
86
+ ], Sellercraft.prototype, "createdAt", void 0);
87
+ __decorate([
88
+ (0, typeorm_1.UpdateDateColumn)(),
89
+ (0, type_graphql_1.Field)({ nullable: true }),
90
+ __metadata("design:type", Date)
91
+ ], Sellercraft.prototype, "updatedAt", void 0);
92
+ __decorate([
93
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
94
+ (0, type_graphql_1.Field)({ nullable: true }),
95
+ __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
96
+ ], Sellercraft.prototype, "creator", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.RelationId)((sellercraft) => sellercraft.creator),
99
+ __metadata("design:type", String)
100
+ ], Sellercraft.prototype, "creatorId", void 0);
101
+ __decorate([
102
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
103
+ (0, type_graphql_1.Field)({ nullable: true }),
104
+ __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
105
+ ], Sellercraft.prototype, "updater", void 0);
106
+ __decorate([
107
+ (0, typeorm_1.RelationId)((sellercraft) => sellercraft.updater),
108
+ __metadata("design:type", String)
109
+ ], Sellercraft.prototype, "updaterId", void 0);
110
+ Sellercraft = __decorate([
111
+ (0, typeorm_1.Entity)(),
112
+ (0, typeorm_1.Index)('ix_sellercraft_0', (sellercraft) => [sellercraft.domain, sellercraft.name], { unique: true }),
113
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for Sellercraft' })
114
+ ], Sellercraft);
115
+ exports.Sellercraft = Sellercraft;
116
+ //# sourceMappingURL=sellercraft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sellercraft.js","sourceRoot":"","sources":["../../../server/service/sellercraft/sellercraft.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCASgB;AAEhB,yDAAgD;AAChD,iDAA4D;AAE5D,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,8CAAyB,CAAA;AAC3B,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QA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AM,EAAE,IAAI,EAAE,CAAC;IACjH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;GACzC,WAAW,CAyDvB;AAzDY,kCAAW"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getShops = exports.getShop = void 0;
4
+ const env_1 = require("@things-factory/env");
5
+ const constants_1 = require("../constants");
6
+ const integration_base_1 = require("@things-factory/integration-base");
7
+ async function getShop(context, channelId, shopId) {
8
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
9
+ const sellercraftChannelIntegrationConfig = env_1.config.get('sellercraftChannelIntegrationConfig', {});
10
+ const { tokenCraftApiKey: apiKey, tokenCraftUrl } = sellercraftChannelIntegrationConfig;
11
+ const xApiKey = context.headers['x-api-key'];
12
+ if (apiKey !== xApiKey)
13
+ context.throw(400, 'api key validation failed');
14
+ var fullPath = `${tokenCraftUrl}?channel_id=${channelId}&shop_id=${shopId}`;
15
+ const response = await fetch(fullPath, {
16
+ method: 'get',
17
+ headers: {
18
+ 'Content-Type': 'application/json',
19
+ 'x-api-key': apiKey
20
+ }
21
+ });
22
+ if (response.ok) {
23
+ let store = await response.json();
24
+ let mappedStore = {
25
+ accessKey: ((_b = (_a = store.shop) === null || _a === void 0 ? void 0 : _a.credential) === null || _b === void 0 ? void 0 : _b.consumer_key) || '',
26
+ accessSecret: ((_d = (_c = store.shop) === null || _c === void 0 ? void 0 : _c.credential) === null || _d === void 0 ? void 0 : _d.consumer_secret) || '',
27
+ storeURL: (_f = (_e = store.shop) === null || _e === void 0 ? void 0 : _e.credential) === null || _f === void 0 ? void 0 : _f.store_url,
28
+ platform: constants_1.PLATFORM[`${store.shop.org_prefix}`],
29
+ accessToken: (_h = (_g = store.shop) === null || _g === void 0 ? void 0 : _g.credential) === null || _h === void 0 ? void 0 : _h.access_token,
30
+ channelShopId: (_j = store.shop) === null || _j === void 0 ? void 0 : _j.channel_shop_id,
31
+ storeId: (_l = (_k = store.shop) === null || _k === void 0 ? void 0 : _k.credential) === null || _l === void 0 ? void 0 : _l.store_url
32
+ };
33
+ return mappedStore;
34
+ }
35
+ else {
36
+ (0, integration_base_1.createPayloadLog)(shopId, tokenCraftUrl, `channel_id=${channelId}&shop_id=${shopId}`, (response === null || response === void 0 ? void 0 : response.statusText) || 500, {
37
+ state: { domain: null }
38
+ });
39
+ }
40
+ }
41
+ exports.getShop = getShop;
42
+ async function getShops(channelId) {
43
+ const sellercraftChannelIntegrationConfig = env_1.config.get('sellercraftChannelIntegrationConfig', {});
44
+ const { tokenCraftApiKey: apiKey, getShopsTokenCraftUrl } = sellercraftChannelIntegrationConfig;
45
+ var channelsFullPath = getShopsTokenCraftUrl + '?channel_id=' + channelId;
46
+ const channelResponse = await fetch(channelsFullPath, {
47
+ method: 'get',
48
+ headers: {
49
+ 'Content-Type': 'application/json',
50
+ 'x-api-key': apiKey
51
+ }
52
+ });
53
+ if (!channelResponse.ok) {
54
+ (0, integration_base_1.createPayloadLog)(channelId, getShopsTokenCraftUrl, `channel_id=${channelId}`, (channelResponse === null || channelResponse === void 0 ? void 0 : channelResponse.statusText) || 500, {
55
+ state: { domain: null }
56
+ });
57
+ throw new Error(channelResponse);
58
+ }
59
+ var shopsResponse = await channelResponse.json();
60
+ return shopsResponse.shops;
61
+ }
62
+ exports.getShops = getShops;
63
+ //# sourceMappingURL=tokencraft-util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokencraft-util.js","sourceRoot":"","sources":["../../server/utils/tokencraft-util.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,4CAAuC;AACvC,uEAAmE;AAE5D,KAAK,UAAU,OAAO,CAAC,OAAY,EAAE,SAAiB,EAAE,MAAc;;IAC3E,MAAM,mCAAmC,GAAG,YAAM,CAAC,GAAG,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAA;IACjG,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,E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E,EAAE,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,KAAI,GAAG,EAAE;YAChH,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAA;KACH;AACH,CAAC;AAhCD,0BAgCC;AAEM,KAAK,UAAU,QAAQ,CAAC,SAAiB;IAC9C,MAAM,mCAAmC,GAAG,YAAM,CAAC,GAAG,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAA;IACjG,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,mCAAmC,CAAA;IAE/F,IAAI,gBAAgB,GAAG,qBAAqB,GAAG,cAAc,GAAG,SAAS,CAAA;IACzE,MAAM,eAAe,GAAQ,MAAM,KAAK,CAAC,gBAAgB,EAAE;QACzD,MAAM,EAAE,KAAK;QACb,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,WAAW,EAAE,MAAM;SACpB;KACF,CAAC,CAAA;IAEF,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE;QACrB,IAAA,mCAAgB,EAAC,SAAS,EAAE,qBAAqB,EAAE,cAAc,SAAS,EAAE,EAAE,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,UAAU,KAAI,GAAG,EAAE;YAChH,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAA;QACJ,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;KACnC;IACC,IAAI,aAAa,GAAG,MAAM,eAAe,CAAC,IAAI,EAAE,CAAA;IAChD,OAAO,aAAa,CAAC,KAAK,CAAA;AAC5B,CAAC;AArBD,4BAqBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-sellercraft",
3
- "version": "4.3.671",
3
+ "version": "4.3.673",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -23,19 +23,19 @@
23
23
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
24
24
  },
25
25
  "dependencies": {
26
- "@things-factory/apptool-ui": "^4.3.671",
27
- "@things-factory/auth-ui": "^4.3.671",
28
- "@things-factory/biz-base": "^4.3.671",
29
- "@things-factory/code-ui": "^4.3.671",
30
- "@things-factory/context-ui": "^4.3.671",
31
- "@things-factory/grist-ui": "^4.3.671",
32
- "@things-factory/i18n-base": "^4.3.671",
33
- "@things-factory/integration-marketplace": "^4.3.671",
34
- "@things-factory/integration-ui": "^4.3.671",
35
- "@things-factory/more-ui": "^4.3.671",
36
- "@things-factory/resource-ui": "^4.3.671",
37
- "@things-factory/setting-ui": "^4.3.671",
38
- "@things-factory/system-ui": "^4.3.671",
26
+ "@things-factory/apptool-ui": "^4.3.673",
27
+ "@things-factory/auth-ui": "^4.3.673",
28
+ "@things-factory/biz-base": "^4.3.673",
29
+ "@things-factory/code-ui": "^4.3.673",
30
+ "@things-factory/context-ui": "^4.3.673",
31
+ "@things-factory/grist-ui": "^4.3.673",
32
+ "@things-factory/i18n-base": "^4.3.673",
33
+ "@things-factory/integration-marketplace": "^4.3.673",
34
+ "@things-factory/integration-ui": "^4.3.673",
35
+ "@things-factory/more-ui": "^4.3.673",
36
+ "@things-factory/resource-ui": "^4.3.673",
37
+ "@things-factory/setting-ui": "^4.3.673",
38
+ "@things-factory/system-ui": "^4.3.673",
39
39
  "debug": "^4.1.1",
40
40
  "node-fetch": "^2.6.0",
41
41
  "querystring": "^0.2.1"
@@ -50,5 +50,5 @@
50
50
  "nock": "^13.0.2",
51
51
  "should": "^13.2.3"
52
52
  },
53
- "gitHead": "ef524cb207378186ec71917d9a8546363d4300b2"
53
+ "gitHead": "d22f985380f3af2ebc0f81ea8bec478ba00b4777"
54
54
  }