@medusajs/medusa 1.3.1-alpha.89 → 1.3.1-export-api.108

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 (133) hide show
  1. package/dist/api/middlewares/feature-flag-enabled.d.ts +2 -0
  2. package/dist/api/middlewares/feature-flag-enabled.js +57 -0
  3. package/dist/api/middlewares/feature-flag-enabled.js.map +1 -0
  4. package/dist/api/routes/admin/collections/add-products.d.ts +2 -1
  5. package/dist/api/routes/admin/collections/add-products.js +4 -7
  6. package/dist/api/routes/admin/collections/add-products.js.map +1 -1
  7. package/dist/api/routes/admin/collections/create-collection.d.ts +2 -1
  8. package/dist/api/routes/admin/collections/create-collection.js +6 -8
  9. package/dist/api/routes/admin/collections/create-collection.js.map +1 -1
  10. package/dist/api/routes/admin/collections/delete-collection.d.ts +2 -1
  11. package/dist/api/routes/admin/collections/delete-collection.js.map +1 -1
  12. package/dist/api/routes/admin/collections/get-collection.d.ts +2 -1
  13. package/dist/api/routes/admin/collections/get-collection.js +4 -5
  14. package/dist/api/routes/admin/collections/get-collection.js.map +1 -1
  15. package/dist/api/routes/admin/collections/index.js +32 -12
  16. package/dist/api/routes/admin/collections/index.js.map +1 -1
  17. package/dist/api/routes/admin/collections/list-collections.d.ts +2 -1
  18. package/dist/api/routes/admin/collections/list-collections.js +9 -19
  19. package/dist/api/routes/admin/collections/list-collections.js.map +1 -1
  20. package/dist/api/routes/admin/collections/remove-products.d.ts +2 -1
  21. package/dist/api/routes/admin/collections/remove-products.js +5 -8
  22. package/dist/api/routes/admin/collections/remove-products.js.map +1 -1
  23. package/dist/api/routes/admin/collections/update-collection.d.ts +2 -1
  24. package/dist/api/routes/admin/collections/update-collection.js +5 -8
  25. package/dist/api/routes/admin/collections/update-collection.js.map +1 -1
  26. package/dist/api/routes/admin/customer-groups/add-customers-batch.d.ts +2 -1
  27. package/dist/api/routes/admin/customer-groups/add-customers-batch.js.map +1 -1
  28. package/dist/api/routes/admin/customer-groups/create-customer-group.d.ts +2 -1
  29. package/dist/api/routes/admin/customer-groups/create-customer-group.js.map +1 -1
  30. package/dist/api/routes/admin/customer-groups/delete-customer-group.d.ts +2 -1
  31. package/dist/api/routes/admin/customer-groups/delete-customer-group.js.map +1 -1
  32. package/dist/api/routes/admin/customer-groups/delete-customers-batch.d.ts +2 -1
  33. package/dist/api/routes/admin/customer-groups/delete-customers-batch.js.map +1 -1
  34. package/dist/api/routes/admin/customer-groups/get-customer-group-customers.d.ts +2 -1
  35. package/dist/api/routes/admin/customer-groups/get-customer-group-customers.js.map +1 -1
  36. package/dist/api/routes/admin/customer-groups/get-customer-group.d.ts +2 -1
  37. package/dist/api/routes/admin/customer-groups/get-customer-group.js +3 -17
  38. package/dist/api/routes/admin/customer-groups/get-customer-group.js.map +1 -1
  39. package/dist/api/routes/admin/customer-groups/index.js +29 -11
  40. package/dist/api/routes/admin/customer-groups/index.js.map +1 -1
  41. package/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts +2 -1
  42. package/dist/api/routes/admin/customer-groups/list-customer-groups.js +10 -45
  43. package/dist/api/routes/admin/customer-groups/list-customer-groups.js.map +1 -1
  44. package/dist/api/routes/admin/customer-groups/update-customer-group.d.ts +2 -1
  45. package/dist/api/routes/admin/customer-groups/update-customer-group.js.map +1 -1
  46. package/dist/api/routes/admin/draft-orders/index.js +1 -0
  47. package/dist/api/routes/admin/draft-orders/index.js.map +1 -1
  48. package/dist/api/routes/admin/gift-cards/list-gift-cards.js +23 -7
  49. package/dist/api/routes/admin/gift-cards/list-gift-cards.js.map +1 -1
  50. package/dist/api/routes/admin/shipping-options/list-shipping-options.js +6 -2
  51. package/dist/api/routes/admin/shipping-options/list-shipping-options.js.map +1 -1
  52. package/dist/api/routes/admin/uploads/create-upload.d.ts +1 -1
  53. package/dist/api/routes/admin/uploads/create-upload.js +5 -5
  54. package/dist/api/routes/admin/uploads/create-upload.js.map +1 -1
  55. package/dist/api/routes/admin/uploads/delete-upload.d.ts +4 -1
  56. package/dist/api/routes/admin/uploads/delete-upload.js +10 -12
  57. package/dist/api/routes/admin/uploads/delete-upload.js.map +1 -1
  58. package/dist/api/routes/admin/uploads/get-download-url.d.ts +7 -4
  59. package/dist/api/routes/admin/uploads/get-download-url.js +14 -15
  60. package/dist/api/routes/admin/uploads/get-download-url.js.map +1 -1
  61. package/dist/api/routes/admin/uploads/index.d.ts +8 -3
  62. package/dist/api/routes/admin/uploads/index.js +17 -3
  63. package/dist/api/routes/admin/uploads/index.js.map +1 -1
  64. package/dist/api/routes/store/shipping-options/list-options.js +6 -2
  65. package/dist/api/routes/store/shipping-options/list-options.js.map +1 -1
  66. package/dist/api/routes/store/shipping-options/list-shipping-options.js +8 -2
  67. package/dist/api/routes/store/shipping-options/list-shipping-options.js.map +1 -1
  68. package/dist/commands/migrate.js +23 -19
  69. package/dist/commands/migrate.js.map +1 -1
  70. package/dist/commands/seed.js +14 -10
  71. package/dist/commands/seed.js.map +1 -1
  72. package/dist/commands/utils/get-migrations.d.ts +2 -1
  73. package/dist/commands/utils/get-migrations.js +95 -36
  74. package/dist/commands/utils/get-migrations.js.map +1 -1
  75. package/dist/helpers/test-request.js +21 -15
  76. package/dist/helpers/test-request.js.map +1 -1
  77. package/dist/loaders/config.js +3 -2
  78. package/dist/loaders/config.js.map +1 -1
  79. package/dist/loaders/feature-flags/index.d.ts +6 -0
  80. package/dist/loaders/feature-flags/index.js +71 -0
  81. package/dist/loaders/feature-flags/index.js.map +1 -0
  82. package/dist/loaders/index.d.ts +1 -1
  83. package/dist/loaders/index.js +8 -5
  84. package/dist/loaders/index.js.map +1 -1
  85. package/dist/repositories/gift-card.d.ts +3 -2
  86. package/dist/repositories/gift-card.js +98 -40
  87. package/dist/repositories/gift-card.js.map +1 -1
  88. package/dist/repositories/tax-rate.d.ts +1 -1
  89. package/dist/repositories/tax-rate.js +2 -9
  90. package/dist/repositories/tax-rate.js.map +1 -1
  91. package/dist/services/cart.js +6 -1
  92. package/dist/services/cart.js.map +1 -1
  93. package/dist/services/fulfillment.d.ts +63 -64
  94. package/dist/services/fulfillment.js +200 -194
  95. package/dist/services/fulfillment.js.map +1 -1
  96. package/dist/services/gift-card.d.ts +6 -0
  97. package/dist/services/gift-card.js +36 -1
  98. package/dist/services/gift-card.js.map +1 -1
  99. package/dist/services/idempotency-key.d.ts +1 -5
  100. package/dist/services/idempotency-key.js +2 -5
  101. package/dist/services/idempotency-key.js.map +1 -1
  102. package/dist/services/index.d.ts +11 -12
  103. package/dist/services/index.js +23 -25
  104. package/dist/services/index.js.map +1 -1
  105. package/dist/services/pricing.d.ts +16 -2
  106. package/dist/services/pricing.js +145 -0
  107. package/dist/services/pricing.js.map +1 -1
  108. package/dist/services/shipping-profile.d.ts +2 -2
  109. package/dist/services/shipping-profile.js +1 -1
  110. package/dist/services/tax-provider.js +1 -1
  111. package/dist/services/tax-provider.js.map +1 -1
  112. package/dist/services/tax-rate.d.ts +1 -1
  113. package/dist/services/tax-rate.js +2 -2
  114. package/dist/services/tax-rate.js.map +1 -1
  115. package/dist/types/feature-flags.d.ts +9 -0
  116. package/dist/types/feature-flags.js +3 -0
  117. package/dist/types/feature-flags.js.map +1 -0
  118. package/dist/types/fulfillment.d.ts +27 -0
  119. package/dist/types/fulfillment.js +3 -0
  120. package/dist/types/fulfillment.js.map +1 -0
  121. package/dist/types/global.d.ts +1 -0
  122. package/dist/types/pricing.d.ts +6 -1
  123. package/dist/utils/db-aware-column.js +2 -2
  124. package/dist/utils/db-aware-column.js.map +1 -1
  125. package/dist/utils/feature-flag-decorators.d.ts +4 -0
  126. package/dist/utils/feature-flag-decorators.js +52 -0
  127. package/dist/utils/feature-flag-decorators.js.map +1 -0
  128. package/dist/utils/flag-router.d.ts +7 -0
  129. package/dist/utils/flag-router.js +19 -0
  130. package/dist/utils/flag-router.js.map +1 -0
  131. package/dist/utils/get-query-config.js +1 -1
  132. package/dist/utils/get-query-config.js.map +1 -1
  133. package/package.json +7 -7
@@ -0,0 +1,2 @@
1
+ import { NextFunction, Request, Response } from "express";
2
+ export declare function isFeatureFlagEnabled(flagKey: string): (req: Request, res: Response, next: NextFunction) => Promise<void>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.isFeatureFlagEnabled = void 0;
40
+ function isFeatureFlagEnabled(flagKey) {
41
+ var _this = this;
42
+ return function (req, res, next) { return __awaiter(_this, void 0, void 0, function () {
43
+ var featureFlagRouter;
44
+ return __generator(this, function (_a) {
45
+ featureFlagRouter = req.scope.resolve("featureFlagRouter");
46
+ if (!featureFlagRouter.isFeatureEnabled(flagKey)) {
47
+ res.sendStatus(404);
48
+ }
49
+ else {
50
+ next();
51
+ }
52
+ return [2 /*return*/];
53
+ });
54
+ }); };
55
+ }
56
+ exports.isFeatureFlagEnabled = isFeatureFlagEnabled;
57
+ //# sourceMappingURL=feature-flag-enabled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-flag-enabled.js","sourceRoot":"","sources":["../../../src/api/middlewares/feature-flag-enabled.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAAgB,oBAAoB,CAClC,OAAe;IADjB,iBAcC;IAXC,OAAO,UAAO,GAAY,EAAE,GAAa,EAAE,IAAkB;;;YACrD,iBAAiB,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CACzC,mBAAmB,CACN,CAAA;YAEf,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE;gBAChD,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;aACpB;iBAAM;gBACL,IAAI,EAAE,CAAA;aACP;;;SACF,CAAA;AACH,CAAC;AAdD,oDAcC"}
@@ -1,4 +1,5 @@
1
- declare const _default: (req: any, res: any) => Promise<void>;
1
+ import { Request, Response } from "express";
2
+ declare const _default: (req: Request, res: Response) => Promise<void>;
2
3
  /**
3
4
  * @oas [post] /collections/{id}/products/batch
4
5
  * operationId: "PostProductsToCollection"
@@ -47,7 +47,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
48
  exports.AdminPostProductsToCollectionReq = void 0;
49
49
  var class_validator_1 = require("class-validator");
50
- var validator_1 = require("../../../../utils/validator");
51
50
  /**
52
51
  * @oas [post] /collections/{id}/products/batch
53
52
  * operationId: "PostProductsToCollection"
@@ -76,17 +75,15 @@ var validator_1 = require("../../../../utils/validator");
76
75
  * description: OK
77
76
  */
78
77
  exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
79
- var id, validated, productCollectionService, collection;
78
+ var id, validatedBody, productCollectionService, collection;
80
79
  return __generator(this, function (_a) {
81
80
  switch (_a.label) {
82
81
  case 0:
83
82
  id = req.params.id;
84
- return [4 /*yield*/, (0, validator_1.validator)(AdminPostProductsToCollectionReq, req.body)];
85
- case 1:
86
- validated = _a.sent();
83
+ validatedBody = req.validatedBody;
87
84
  productCollectionService = req.scope.resolve("productCollectionService");
88
- return [4 /*yield*/, productCollectionService.addProducts(id, validated.product_ids)];
89
- case 2:
85
+ return [4 /*yield*/, productCollectionService.addProducts(id, validatedBody.product_ids)];
86
+ case 1:
90
87
  collection = _a.sent();
91
88
  res.status(200).json({ collection: collection });
92
89
  return [2 /*return*/];
@@ -1 +1 @@
1
- {"version":3,"file":"add-products.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/add-products.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAyD;AAEzD,yDAAuD;AACvD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EA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AE,CAAC,CAAA;;;;KACrC,EAAA;AAED;IAAA;IAIA,CAAC;IADC;QAFC,IAAA,+BAAa,GAAE;QACf,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;yEACJ;IACvB,uCAAC;CAAA,AAJD,IAIC;AAJY,4EAAgC"}
@@ -1,4 +1,5 @@
1
- declare const _default: (req: any, res: any) => Promise<void>;
1
+ import { Request, Response } from "express";
2
+ declare const _default: (req: Request, res: Response) => Promise<void>;
2
3
  /**
3
4
  * @oas [post] /collections
4
5
  * operationId: "PostCollections"
@@ -47,7 +47,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
48
  exports.AdminPostCollectionsReq = void 0;
49
49
  var class_validator_1 = require("class-validator");
50
- var validator_1 = require("../../../../utils/validator");
51
50
  /**
52
51
  * @oas [post] /collections
53
52
  * operationId: "PostCollections"
@@ -83,18 +82,17 @@ var validator_1 = require("../../../../utils/validator");
83
82
  * $ref: "#/components/schemas/product_collection"
84
83
  */
85
84
  exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
86
- var validated, productCollectionService, created, collection;
85
+ var validatedBody, productCollectionService, created, collection;
87
86
  return __generator(this, function (_a) {
88
87
  switch (_a.label) {
89
- case 0: return [4 /*yield*/, (0, validator_1.validator)(AdminPostCollectionsReq, req.body)];
90
- case 1:
91
- validated = _a.sent();
88
+ case 0:
89
+ validatedBody = req.validatedBody;
92
90
  productCollectionService = req.scope.resolve("productCollectionService");
93
- return [4 /*yield*/, productCollectionService.create(validated)];
94
- case 2:
91
+ return [4 /*yield*/, productCollectionService.create(validatedBody)];
92
+ case 1:
95
93
  created = _a.sent();
96
94
  return [4 /*yield*/, productCollectionService.retrieve(created.id)];
97
- case 3:
95
+ case 2:
98
96
  collection = _a.sent();
99
97
  res.status(200).json({ collection: collection });
100
98
  return [2 /*return*/];
@@ -1 +1 @@
1
- {"version":3,"file":"create-collection.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/create-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAA4E;AAE5E,yDAAuD;AACvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;oBACV,qBAAM,IAAA,qBAAS,EAAC,uBAAuB,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA;;gBAA9D,SAAS,GAAG,SAAkD;gBAE9D,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBAEe,qBAAM,wBAAwB,CAAC,MAAM,CAAC,SAAS,CAAC,EAAA;;gBAA1D,OAAO,GAAG,SAAgD;gBAC7C,qBAAM,wBAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAA;;gBAAhE,UAAU,GAAG,SAAmD;gBAEtE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,YAAA,EAAE,CAAC,CAAA;;;;KACrC,EAAA;AAED;IAAA;IAYA,CAAC;IATC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;0DACA;IAIb;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;2DACE;IAIf;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;6DACI;IACnB,8BAAC;CAAA,AAZD,IAYC;AAZY,0DAAuB"}
1
+ {"version":3,"file":"create-collection.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/create-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAA4E;AAI5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,mBAAe,UAAO,GAAY,EAAE,GAAa;;;;;gBACvC,aAAa,GAAK,GAAG,cAAR,CAAQ;gBAEvB,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBAEe,qBAAM,wBAAwB,CAAC,MAAM,CAAC,aAAa,CAAC,EAAA;;gBAA9D,OAAO,GAAG,SAAoD;gBACjD,qBAAM,wBAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAA;;gBAAhE,UAAU,GAAG,SAAmD;gBAEtE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,YAAA,EAAE,CAAC,CAAA;;;;KACrC,EAAA;AAED;IAAA;IAYA,CAAC;IATC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;0DACA;IAIb;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;2DACE;IAIf;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;6DACI;IACnB,8BAAC;CAAA,AAZD,IAYC;AAZY,0DAAuB"}
@@ -1,4 +1,5 @@
1
- declare const _default: (req: any, res: any) => Promise<void>;
1
+ import { Request, Response } from "express";
2
+ declare const _default: (req: Request, res: Response) => Promise<void>;
2
3
  /**
3
4
  * @oas [delete] /collections/{id}
4
5
  * operationId: "DeleteCollectionsCollection"
@@ -1 +1 @@
1
- {"version":3,"file":"delete-collection.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/delete-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBACD,qBAAM,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC,EAAA;;gBAAzC,SAAyC,CAAA;gBAEzC,GAAG,CAAC,IAAI,CAAC;oBACP,EAAE,IAAA;oBACF,MAAM,EAAE,oBAAoB;oBAC5B,OAAO,EAAE,IAAI;iBACd,CAAC,CAAA;;;;KACH,EAAA"}
1
+ {"version":3,"file":"delete-collection.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/delete-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,mBAAe,UAAO,GAAY,EAAE,GAAa;;;;;gBACvC,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBACD,qBAAM,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC,EAAA;;gBAAzC,SAAyC,CAAA;gBAEzC,GAAG,CAAC,IAAI,CAAC;oBACP,EAAE,IAAA;oBACF,MAAM,EAAE,oBAAoB;oBAC5B,OAAO,EAAE,IAAI;iBACd,CAAC,CAAA;;;;KACH,EAAA"}
@@ -1,4 +1,5 @@
1
- declare const _default: (req: any, res: any) => Promise<void>;
1
+ import { Request, Response } from "express";
2
+ declare const _default: (req: Request, res: Response) => Promise<void>;
2
3
  /**
3
4
  * @oas [get] /collections/{id}
4
5
  * operationId: "GetCollectionsCollection"
@@ -58,16 +58,15 @@ var _1 = require(".");
58
58
  * $ref: "#/components/schemas/product_collection"
59
59
  */
60
60
  exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
61
- var id, retrieveConfig, productCollectionService, collection;
61
+ var id, productCollectionService, collection;
62
62
  return __generator(this, function (_a) {
63
63
  switch (_a.label) {
64
64
  case 0:
65
65
  id = req.params.id;
66
- retrieveConfig = {
67
- relations: _1.defaultAdminCollectionsRelations,
68
- };
69
66
  productCollectionService = req.scope.resolve("productCollectionService");
70
- return [4 /*yield*/, productCollectionService.retrieve(id, retrieveConfig)];
67
+ return [4 /*yield*/, productCollectionService.retrieve(id, {
68
+ relations: _1.defaultAdminCollectionsRelations,
69
+ })];
71
70
  case 1:
72
71
  collection = _a.sent();
73
72
  res.status(200).json({ collection: collection });
@@ -1 +1 @@
1
- {"version":3,"file":"get-collection.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/get-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAAoD;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,cAAc,GAAG;oBACrB,SAAS,EAAE,mCAAgC;iBAC5C,CAAA;gBAEK,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBAEkB,qBAAM,wBAAwB,CAAC,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC,EAAA;;gBAAxE,UAAU,GAAG,SAA2D;gBAC9E,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,YAAA,EAAE,CAAC,CAAA;;;;KACrC,EAAA"}
1
+ {"version":3,"file":"get-collection.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/get-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAAoD;AAGpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mBAAe,UAAO,GAAY,EAAE,GAAa;;;;;gBACvC,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBAEkB,qBAAM,wBAAwB,CAAC,QAAQ,CAAC,EAAE,EAAE;wBAC7D,SAAS,EAAE,mCAAgC;qBAC5C,CAAC,EAAA;;gBAFI,UAAU,GAAG,SAEjB;gBACF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,YAAA,EAAE,CAAC,CAAA;;;;KACrC,EAAA"}
@@ -6,27 +6,47 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
6
6
  if (k2 === undefined) k2 = k;
7
7
  o[k2] = m[k];
8
8
  }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
9
21
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
22
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
23
  };
12
- var __importDefault = (this && this.__importDefault) || function (mod) {
13
- return (mod && mod.__esModule) ? mod : { "default": mod };
14
- };
15
24
  Object.defineProperty(exports, "__esModule", { value: true });
16
25
  exports.defaultAdminCollectionsRelations = exports.defaultAdminCollectionsFields = void 0;
17
26
  var express_1 = require("express");
18
27
  require("reflect-metadata");
19
- var middlewares_1 = __importDefault(require("../../../middlewares"));
20
- var route = (0, express_1.Router)();
28
+ var middlewares_1 = __importStar(require("../../../middlewares"));
29
+ var list_collections_1 = require("./list-collections");
30
+ var create_collection_1 = require("./create-collection");
31
+ var update_collection_1 = require("./update-collection");
32
+ var add_products_1 = require("./add-products");
33
+ var remove_products_1 = require("./remove-products");
21
34
  exports.default = (function (app) {
35
+ var route = (0, express_1.Router)();
22
36
  app.use("/collections", route);
23
- route.post("/", middlewares_1.default.wrap(require("./create-collection").default));
24
- route.post("/:id", middlewares_1.default.wrap(require("./update-collection").default));
25
- route.delete("/:id", middlewares_1.default.wrap(require("./delete-collection").default));
26
- route.get("/:id", middlewares_1.default.wrap(require("./get-collection").default));
27
- route.get("/", middlewares_1.default.wrap(require("./list-collections").default));
28
- route.post("/:id/products/batch", middlewares_1.default.wrap(require("./add-products").default));
29
- route.delete("/:id/products/batch", middlewares_1.default.wrap(require("./remove-products").default));
37
+ route.post("/", (0, middlewares_1.transformBody)(create_collection_1.AdminPostCollectionsReq), middlewares_1.default.wrap(require("./create-collection").default));
38
+ route.get("/", (0, middlewares_1.transformQuery)(list_collections_1.AdminGetCollectionsParams, {
39
+ defaultRelations: exports.defaultAdminCollectionsRelations,
40
+ defaultFields: exports.defaultAdminCollectionsFields,
41
+ isList: true,
42
+ }), middlewares_1.default.wrap(require("./list-collections").default));
43
+ var collectionRouter = (0, express_1.Router)({ mergeParams: true });
44
+ route.use("/:id", collectionRouter);
45
+ collectionRouter.post("/", (0, middlewares_1.transformBody)(update_collection_1.AdminPostCollectionsCollectionReq), middlewares_1.default.wrap(require("./update-collection").default));
46
+ collectionRouter.get("/", middlewares_1.default.wrap(require("./get-collection").default));
47
+ collectionRouter.delete("/", middlewares_1.default.wrap(require("./delete-collection").default));
48
+ collectionRouter.post("/products/batch", (0, middlewares_1.transformBody)(add_products_1.AdminPostProductsToCollectionReq), middlewares_1.default.wrap(require("./add-products").default));
49
+ collectionRouter.delete("/products/batch", (0, middlewares_1.transformBody)(remove_products_1.AdminDeleteProductsFromCollectionReq), middlewares_1.default.wrap(require("./remove-products").default));
30
50
  return app;
31
51
  });
32
52
  exports.defaultAdminCollectionsFields = [
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/index.ts"],"names":[],"mappings":";;;;;;;;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C,UAAU,CAAC,CAAA;AAY5D,iDAA8B;AAC9B,sDAAmC;AACnC,sDAAmC;AACnC,mDAAgC;AAChC,qDAAkC;AAClC,oDAAiC;AACjC,sDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAChC,4BAAyB;AAGzB,kEAAiF;AACjF,uDAA8D;AAC9D,yDAA6D;AAC7D,yDAAuE;AACvE,+CAAiE;AACjE,qDAAwE;AAExE,mBAAe,UAAC,GAAG;IACjB,IAAM,KAAK,GAAG,IAAA,gBAAM,GAAE,CAAA;IACtB,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;IAE9B,KAAK,CAAC,IAAI,CACR,GAAG,EACH,IAAA,2BAAa,EAAC,2CAAuB,CAAC,EACtC,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,CACzD,CAAA;IACD,KAAK,CAAC,GAAG,CACP,GAAG,EACH,IAAA,4BAAc,EACZ,4CAAyB,EACzB;QACE,gBAAgB,EAAE,wCAAgC;QAClD,aAAa,EAAE,qCAA6B;QAC5C,MAAM,EAAE,IAAI;KACb,CACF,EACD,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CACxD,CAAA;IAED,IAAM,gBAAgB,GAAG,IAAA,gBAAM,EAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;IACtD,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IACnC,gBAAgB,CAAC,IAAI,CACnB,GAAG,EACH,IAAA,2BAAa,EAAC,qDAAiC,CAAC,EAChD,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,CACzD,CAAA;IACD,gBAAgB,CAAC,GAAG,CAClB,GAAG,EACH,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CACtD,CAAA;IACD,gBAAgB,CAAC,MAAM,CACrB,GAAG,EACH,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,CACzD,CAAA;IACD,gBAAgB,CAAC,IAAI,CACnB,iBAAiB,EACjB,IAAA,2BAAa,EAAC,+CAAgC,CAAC,EAC/C,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,CACpD,CAAA;IACD,gBAAgB,CAAC,MAAM,CACrB,iBAAiB,EACjB,IAAA,2BAAa,EAAC,sDAAoC,CAAC,EACnD,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CACvD,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,EAAA;AAEY,QAAA,6BAA6B,GAAG;IAC3C,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,YAAY;CACb,CAAA;AACY,QAAA,gCAAgC,GAAG,CAAC,UAAU,CAAC,CAAA;AAY5D,iDAA8B;AAC9B,sDAAmC;AACnC,sDAAmC;AACnC,mDAAgC;AAChC,qDAAkC;AAClC,oDAAiC;AACjC,sDAAmC"}
@@ -1,5 +1,6 @@
1
1
  import { DateComparisonOperator } from "../../../../types/common";
2
- declare const _default: (req: any, res: any) => Promise<void>;
2
+ import { Request, Response } from "express";
3
+ declare const _default: (req: Request, res: Response) => Promise<void>;
3
4
  /**
4
5
  * @oas [get] /collections
5
6
  * operationId: "GetCollections"
@@ -99,9 +99,7 @@ exports.AdminGetCollectionsParams = exports.AdminGetCollectionsPaginationParams
99
99
  var class_transformer_1 = require("class-transformer");
100
100
  var class_validator_1 = require("class-validator");
101
101
  var lodash_1 = __importStar(require("lodash"));
102
- var _1 = require(".");
103
102
  var common_1 = require("../../../../types/common");
104
- var validator_1 = require("../../../../utils/validator");
105
103
  /**
106
104
  * @oas [get] /collections
107
105
  * operationId: "GetCollections"
@@ -129,28 +127,20 @@ var validator_1 = require("../../../../utils/validator");
129
127
  * $ref: "#/components/schemas/product_collection"
130
128
  */
131
129
  exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
132
- var validated, productCollectionService, listConfig, filterableFields, _a, collections, count;
133
- return __generator(this, function (_b) {
134
- switch (_b.label) {
135
- case 0: return [4 /*yield*/, (0, validator_1.validator)(AdminGetCollectionsParams, req.query)];
136
- case 1:
137
- validated = _b.sent();
130
+ var productCollectionService, _a, limit, offset, filterableFields, listConfig, _b, collections, count;
131
+ return __generator(this, function (_c) {
132
+ switch (_c.label) {
133
+ case 0:
138
134
  productCollectionService = req.scope.resolve("productCollectionService");
139
- listConfig = {
140
- select: _1.defaultAdminCollectionsFields,
141
- relations: _1.defaultAdminCollectionsRelations,
142
- skip: validated.offset,
143
- take: validated.limit,
144
- };
145
- filterableFields = lodash_1.default.omit(validated, ["limit", "offset"]);
135
+ _a = req.validatedQuery, limit = _a.limit, offset = _a.offset, filterableFields = req.filterableFields, listConfig = req.listConfig;
146
136
  return [4 /*yield*/, productCollectionService.listAndCount(lodash_1.default.pickBy(filterableFields, lodash_1.identity), listConfig)];
147
- case 2:
148
- _a = __read.apply(void 0, [_b.sent(), 2]), collections = _a[0], count = _a[1];
137
+ case 1:
138
+ _b = __read.apply(void 0, [_c.sent(), 2]), collections = _b[0], count = _b[1];
149
139
  res.status(200).json({
150
140
  collections: collections,
151
141
  count: count,
152
- offset: validated.offset,
153
- limit: validated.limit,
142
+ offset: offset,
143
+ limit: limit,
154
144
  });
155
145
  return [2 /*return*/];
156
146
  }
@@ -1 +1 @@
1
- {"version":3,"file":"list-collections.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/list-collections.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAAI,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;;sEACT;IAKV;QAHC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;QACZ,IAAA,wBAAI,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;;uEACT;IACZ,0CAAC;CAAA,AAVD,IAUC;AAVY,kFAAmC;AAYhD;IAA+C,6CAAmC;IAAlF;;IA2BA,CAAC;IAxBC;QAFC,IAAA,4BAAU,GAAE;QACZ,IAAA,0BAAQ,GAAE;;4DACG;IAId;QAFC,IAAA,4BAAU,GAAE;QACZ,IAAA,0BAAQ,GAAE;;6DACI;IAKf;QAHC,IAAA,4BAAU,GAAE;QACZ,IAAA,gCAAc,GAAE;QAChB,IAAA,wBAAI,EAAC,cAAM,OAAA,+BAAsB,EAAtB,CAAsB,CAAC;kCACtB,+BAAsB;iEAAA;IAKnC;QAHC,IAAA,4BAAU,GAAE;QACZ,IAAA,gCAAc,GAAE;QAChB,IAAA,wBAAI,EAAC,cAAM,OAAA,+BAAsB,EAAtB,CAAsB,CAAC;kCACtB,+BAAsB;iEAAA;IAKnC;QAHC,IAAA,gCAAc,GAAE;QAChB,IAAA,4BAAU,GAAE;QACZ,IAAA,wBAAI,EAAC,cAAM,OAAA,+BAAsB,EAAtB,CAAsB,CAAC;kCACtB,+BAAsB;iEAAA;IAInC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;wDACH;IACZ,gCAAC;CAAA,AA3BD,CAA+C,mCAAmC,GA2BjF;AA3BY,8DAAyB"}
1
+ {"version":3,"file":"list-collections.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/list-collections.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAAgF;AAChF,+CAAoC;AAEpC,mDAAi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AU,GAAE;QACZ,IAAA,gCAAc,GAAE;QAChB,IAAA,wBAAI,EAAC,cAAM,OAAA,+BAAsB,EAAtB,CAAsB,CAAC;kCACtB,+BAAsB;iEAAA;IAKnC;QAHC,IAAA,4BAAU,GAAE;QACZ,IAAA,gCAAc,GAAE;QAChB,IAAA,wBAAI,EAAC,cAAM,OAAA,+BAAsB,EAAtB,CAAsB,CAAC;kCACtB,+BAAsB;iEAAA;IAKnC;QAHC,IAAA,gCAAc,GAAE;QAChB,IAAA,4BAAU,GAAE;QACZ,IAAA,wBAAI,EAAC,cAAM,OAAA,+BAAsB,EAAtB,CAAsB,CAAC;kCACtB,+BAAsB;iEAAA;IAInC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;wDACH;IACZ,gCAAC;CAAA,AA3BD,CAA+C,mCAAmC,GA2BjF;AA3BY,8DAAyB"}
@@ -1,4 +1,5 @@
1
- declare const _default: (req: any, res: any) => Promise<void>;
1
+ import { Request, Response } from "express";
2
+ declare const _default: (req: Request, res: Response) => Promise<void>;
2
3
  /**
3
4
  * @oas [delete] /collections/{id}/products/batch
4
5
  * operationId: "DeleteProductsFromCollection"
@@ -47,7 +47,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
48
  exports.AdminDeleteProductsFromCollectionReq = void 0;
49
49
  var class_validator_1 = require("class-validator");
50
- var validator_1 = require("../../../../utils/validator");
51
50
  /**
52
51
  * @oas [delete] /collections/{id}/products/batch
53
52
  * operationId: "DeleteProductsFromCollection"
@@ -76,22 +75,20 @@ var validator_1 = require("../../../../utils/validator");
76
75
  * description: OK
77
76
  */
78
77
  exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
79
- var id, validated, productCollectionService;
78
+ var id, validatedBody, productCollectionService;
80
79
  return __generator(this, function (_a) {
81
80
  switch (_a.label) {
82
81
  case 0:
83
82
  id = req.params.id;
84
- return [4 /*yield*/, (0, validator_1.validator)(AdminDeleteProductsFromCollectionReq, req.body)];
85
- case 1:
86
- validated = _a.sent();
83
+ validatedBody = req.validatedBody;
87
84
  productCollectionService = req.scope.resolve("productCollectionService");
88
- return [4 /*yield*/, productCollectionService.removeProducts(id, validated.product_ids)];
89
- case 2:
85
+ return [4 /*yield*/, productCollectionService.removeProducts(id, validatedBody.product_ids)];
86
+ case 1:
90
87
  _a.sent();
91
88
  res.json({
92
89
  id: id,
93
90
  object: "product-collection",
94
- removed_products: validated.product_ids,
91
+ removed_products: validatedBody.product_ids,
95
92
  });
96
93
  return [2 /*return*/];
97
94
  }
@@ -1 +1 @@
1
- {"version":3,"file":"remove-products.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/remove-products.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAyD;AAEzD,yDAAuD;AACvD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEP,qBAAM,IAAA,qBAAS,EAC/B,oCAAoC,EACpC,GAAG,CAAC,IAAI,CACT,EAAA;;gBAHK,SAAS,GAAG,SAGjB;gBAEK,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBAED,qBAAM,wBAAwB,CAAC,cAAc,CAAC,EAAE,EAAE,SAAS,CAAC,WAAW,CAAC,EAAA;;gBAAxE,SAAwE,CAAA;gBAExE,GAAG,CAAC,IAAI,CAAC;oBACP,EAAE,IAAA;oBACF,MAAM,EAAE,oBAAoB;oBAC5B,gBAAgB,EAAE,SAAS,CAAC,WAAW;iBACxC,CAAC,CAAA;;;;KACH,EAAA;AAED;IAAA;IAIA,CAAC;IADC;QAFC,IAAA,+BAAa,GAAE;QACf,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;6EACJ;IACvB,2CAAC;CAAA,AAJD,IAIC;AAJY,oFAAoC"}
1
+ {"version":3,"file":"remove-products.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/remove-products.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAyD;AAIzD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,mBAAe,UAAO,GAAY,EAAE,GAAa;;;;;gBACvC,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBACjB,aAAa,GAAK,GAA8D,cAAnE,CAAmE;gBAElF,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBAED,qBAAM,wBAAwB,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,CAAC,WAAW,CAAC,EAAA;;gBAA5E,SAA4E,CAAA;gBAE5E,GAAG,CAAC,IAAI,CAAC;oBACP,EAAE,IAAA;oBACF,MAAM,EAAE,oBAAoB;oBAC5B,gBAAgB,EAAE,aAAa,CAAC,WAAW;iBAC5C,CAAC,CAAA;;;;KACH,EAAA;AAED;IAAA;IAIA,CAAC;IADC;QAFC,IAAA,+BAAa,GAAE;QACf,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;6EACJ;IACvB,2CAAC;CAAA,AAJD,IAIC;AAJY,oFAAoC"}
@@ -1,4 +1,5 @@
1
- declare const _default: (req: any, res: any) => Promise<void>;
1
+ import { Request, Response } from "express";
2
+ declare const _default: (req: Request, res: Response) => Promise<void>;
2
3
  /**
3
4
  * @oas [post] /collections/{id}
4
5
  * operationId: "PostCollectionsCollection"
@@ -47,7 +47,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
48
  exports.AdminPostCollectionsCollectionReq = void 0;
49
49
  var class_validator_1 = require("class-validator");
50
- var validator_1 = require("../../../../utils/validator");
51
50
  /**
52
51
  * @oas [post] /collections/{id}
53
52
  * operationId: "PostCollectionsCollection"
@@ -83,20 +82,18 @@ var validator_1 = require("../../../../utils/validator");
83
82
  * $ref: "#/components/schemas/product_collection"
84
83
  */
85
84
  exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
86
- var id, validated, productCollectionService, updated, collection;
85
+ var id, validatedBody, productCollectionService, updated, collection;
87
86
  return __generator(this, function (_a) {
88
87
  switch (_a.label) {
89
88
  case 0:
90
89
  id = req.params.id;
91
- return [4 /*yield*/, (0, validator_1.validator)(AdminPostCollectionsCollectionReq, req.body)];
92
- case 1:
93
- validated = _a.sent();
90
+ validatedBody = req.validatedBody;
94
91
  productCollectionService = req.scope.resolve("productCollectionService");
95
- return [4 /*yield*/, productCollectionService.update(id, validated)];
96
- case 2:
92
+ return [4 /*yield*/, productCollectionService.update(id, validatedBody)];
93
+ case 1:
97
94
  updated = _a.sent();
98
95
  return [4 /*yield*/, productCollectionService.retrieve(updated.id)];
99
- case 3:
96
+ case 2:
100
97
  collection = _a.sent();
101
98
  res.status(200).json({ collection: collection });
102
99
  return [2 /*return*/];
@@ -1 +1 @@
1
- {"version":3,"file":"update-collection.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/update-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAgE;AAEhE,yDAAuD;AACvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEP,qBAAM,IAAA,qBAAS,EAAC,iCAAiC,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA;;gBAAxE,SAAS,GAAG,SAA4D;gBACxE,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBAEe,qBAAM,wBAAwB,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,EAAA;;gBAA9D,OAAO,GAAG,SAAoD;gBACjD,qBAAM,wBAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAA;;gBAAhE,UAAU,GAAG,SAAmD;gBAEtE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,YAAA,EAAE,CAAC,CAAA;;;;KACrC,EAAA;AAED;IAAA;IAYA,CAAC;IATC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;oEACC;IAId;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;qEACE;IAIf;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;uEACI;IACnB,wCAAC;CAAA,AAZD,IAYC;AAZY,8EAAiC"}
1
+ {"version":3,"file":"update-collection.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/collections/update-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,mBAAe,UAAO,GAAY,EAAE,GAAa;;;;;gBACvC,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBACjB,aAAa,GAAK,GAAG,cAAR,CAAQ;gBAEvB,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBAEe,qBAAM,wBAAwB,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,CAAC,EAAA;;gBAAlE,OAAO,GAAG,SAAwD;gBACrD,qBAAM,wBAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAA;;gBAAhE,UAAU,GAAG,SAAmD;gBAEtE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,YAAA,EAAE,CAAC,CAAA;;;;KACrC,EAAA;AAED;IAAA;IAYA,CAAC;IATC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;oEACC;IAId;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;qEACE;IAIf;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;uEACI;IACnB,wCAAC;CAAA,AAZD,IAYC;AAZY,8EAAiC"}
@@ -1,5 +1,6 @@
1
1
  import { CustomerGroupsBatchCustomer } from "../../../../types/customer-groups";
2
- declare const _default: (req: any, res: any) => Promise<void>;
2
+ import { Request, Response } from "express";
3
+ declare const _default: (req: Request, res: Response) => Promise<void>;
3
4
  /**
4
5
  * @oas [post] /customer-groups/{id}/customers/batch
5
6
  * operationId: "PostCustomerGroupsGroupCustomersBatch"
@@ -1 +1 @@
1
- {"version":3,"file":"add-customers-batch.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customer-groups/add-customers-batch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAAgD;AAEhD,qEAA+E;AAC/E,yDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBACP,qBAAM,IAAA,qBAAS,EAC/B,6CAA6C,EAC7C,GAAG,CAAC,IAAI,CACT,EAAA;;gBAHK,SAAS,GAAG,SAGjB;gBAEK,oBAAoB,GAAyB,GAAG,CAAC,KAAK,CAAC,OAAO,CAClE,sBAAsB,CACvB,CAAA;gBAEsB,qBAAM,oBAAoB,CAAC,YAAY,CAC5D,EAAE,EACF,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,UAAC,EAAM;4BAAJ,EAAE,QAAA;wBAAO,OAAA,EAAE;oBAAF,CAAE,CAAC,CAC3C,EAAA;;gBAHK,cAAc,GAAG,SAGtB;gBACD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,cAAc,gBAAA,EAAE,CAAC,CAAA;;;;KACzC,EAAA;AAED;IAAA;IAIA,CAAC;IADC;QAFC,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC9B,IAAA,wBAAI,EAAC,cAAM,OAAA,6CAA2B,EAA3B,CAA2B,CAAC;;uFACG;IAC7C,oDAAC;CAAA,AAJD,IAIC;AAJY,sGAA6C"}
1
+ {"version":3,"file":"add-customers-batch.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customer-groups/add-customers-batch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAAgD;AAEhD,qEAA+E;AAC/E,yDAAuD;AAGvD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,mBAAe,UAAO,GAAY,EAAE,GAAa;;;;;gBACvC,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBACP,qBAAM,IAAA,qBAAS,EAC/B,6CAA6C,EAC7C,GAAG,CAAC,IAAI,CACT,EAAA;;gBAHK,SAAS,GAAG,SAGjB;gBAEK,oBAAoB,GAAyB,GAAG,CAAC,KAAK,CAAC,OAAO,CAClE,sBAAsB,CACvB,CAAA;gBAEsB,qBAAM,oBAAoB,CAAC,YAAY,CAC5D,EAAE,EACF,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,UAAC,EAAM;4BAAJ,EAAE,QAAA;wBAAO,OAAA,EAAE;oBAAF,CAAE,CAAC,CAC3C,EAAA;;gBAHK,cAAc,GAAG,SAGtB;gBACD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,cAAc,gBAAA,EAAE,CAAC,CAAA;;;;KACzC,EAAA;AAED;IAAA;IAIA,CAAC;IADC;QAFC,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC9B,IAAA,wBAAI,EAAC,cAAM,OAAA,6CAA2B,EAA3B,CAA2B,CAAC;;uFACG;IAC7C,oDAAC;CAAA,AAJD,IAIC;AAJY,sGAA6C"}
@@ -1,4 +1,5 @@
1
- declare const _default: (req: any, res: any) => Promise<void>;
1
+ import { Request, Response } from "express";
2
+ declare const _default: (req: Request, res: Response) => Promise<void>;
2
3
  /**
3
4
  * @oas [post] /customer-groups
4
5
  * operationId: "PostCustomerGroups"
@@ -1 +1 @@
1
- {"version":3,"file":"create-customer-group.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customer-groups/create-customer-group.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAgE;AAEhE,yDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;oBACV,qBAAM,IAAA,qBAAS,EAAC,0BAA0B,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA;;gBAAjE,SAAS,GAAG,SAAqD;gBAEjE,oBAAoB,GAAyB,GAAG,CAAC,KAAK,CAAC,OAAO,CAClE,sBAAsB,CACvB,CAAA;gBAEqB,qBAAM,oBAAoB,CAAC,MAAM,CAAC,SAAS,CAAC,EAAA;;gBAA5D,aAAa,GAAG,SAA4C;gBAClE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC,CAAA;;;;KACxD,EAAA;AAED;IAAA;IAOA,CAAC;IALC;QADC,IAAA,0BAAQ,GAAE;;4DACC;IAIZ;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;gEACI;IACnB,iCAAC;CAAA,AAPD,IAOC;AAPY,gEAA0B"}
1
+ {"version":3,"file":"create-customer-group.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customer-groups/create-customer-group.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAgE;AAEhE,yDAAuD;AAGvD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,mBAAe,UAAO,GAAY,EAAE,GAAa;;;;oBAC7B,qBAAM,IAAA,qBAAS,EAAC,0BAA0B,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA;;gBAAjE,SAAS,GAAG,SAAqD;gBAEjE,oBAAoB,GAAyB,GAAG,CAAC,KAAK,CAAC,OAAO,CAClE,sBAAsB,CACvB,CAAA;gBAEqB,qBAAM,oBAAoB,CAAC,MAAM,CAAC,SAAS,CAAC,EAAA;;gBAA5D,aAAa,GAAG,SAA4C;gBAClE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC,CAAA;;;;KACxD,EAAA;AAED;IAAA;IAOA,CAAC;IALC;QADC,IAAA,0BAAQ,GAAE;;4DACC;IAIZ;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;gEACI;IACnB,iCAAC;CAAA,AAPD,IAOC;AAPY,gEAA0B"}
@@ -1,4 +1,5 @@
1
- declare const _default: (req: any, res: any) => Promise<void>;
1
+ import { Request, Response } from "express";
2
+ declare const _default: (req: Request, res: Response) => Promise<void>;
2
3
  /**
3
4
  * @oas [delete] /customer-groups/{id}
4
5
  * operationId: "DeleteCustomerGroupsCustomerGroup"
@@ -1 +1 @@
1
- {"version":3,"file":"delete-customer-group.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customer-groups/delete-customer-group.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,oBAAoB,GAAyB,GAAG,CAAC,KAAK,CAAC,OAAO,CAClE,sBAAsB,CACvB,CAAA;gBAED,qBAAM,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC,EAAA;;gBAArC,SAAqC,CAAA;gBAErC,GAAG,CAAC,IAAI,CAAC;oBACP,EAAE,EAAE,EAAE;oBACN,MAAM,EAAE,gBAAgB;oBACxB,OAAO,EAAE,IAAI;iBACd,CAAC,CAAA;;;;KACH,EAAA"}
1
+ {"version":3,"file":"delete-customer-group.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customer-groups/delete-customer-group.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,mBAAe,UAAO,GAAY,EAAE,GAAa;;;;;gBACvC,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,oBAAoB,GAAyB,GAAG,CAAC,KAAK,CAAC,OAAO,CAClE,sBAAsB,CACvB,CAAA;gBAED,qBAAM,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC,EAAA;;gBAArC,SAAqC,CAAA;gBAErC,GAAG,CAAC,IAAI,CAAC;oBACP,EAAE,EAAE,EAAE;oBACN,MAAM,EAAE,gBAAgB;oBACxB,OAAO,EAAE,IAAI;iBACd,CAAC,CAAA;;;;KACH,EAAA"}
@@ -1,5 +1,6 @@
1
1
  import { CustomerGroupsBatchCustomer } from "../../../../types/customer-groups";
2
- declare const _default: (req: any, res: any) => Promise<void>;
2
+ import { Request, Response } from "express";
3
+ declare const _default: (req: Request, res: Response) => Promise<void>;
3
4
  /**
4
5
  * @oas [delete] /customer-groups/{id}/customers/batch
5
6
  * operationId: "DeleteCustomerGroupsGroupCustomerBatch"
@@ -1 +1 @@
1
- {"version":3,"file":"delete-customers-batch.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customer-groups/delete-customers-batch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAAgD;AAEhD,qEAA+E;AAC/E,yDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBACP,qBAAM,IAAA,qBAAS,EAC/B,8CAA8C,EAC9C,GAAG,CAAC,IAAI,CACT,EAAA;;gBAHK,SAAS,GAAG,SAGjB;gBAEK,oBAAoB,GAAyB,GAAG,CAAC,KAAK,CAAC,OAAO,CAClE,sBAAsB,CACvB,CAAA;gBAEsB,qBAAM,oBAAoB,CAAC,cAAc,CAC9D,EAAE,EACF,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,UAAC,EAAM;4BAAJ,EAAE,QAAA;wBAAO,OAAA,EAAE;oBAAF,CAAE,CAAC,CAC3C,EAAA;;gBAHK,cAAc,GAAG,SAGtB;gBACD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,cAAc,gBAAA,EAAE,CAAC,CAAA;;;;KACzC,EAAA;AAED;IAAA;IAIA,CAAC;IADC;QAFC,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC9B,IAAA,wBAAI,EAAC,cAAM,OAAA,6CAA2B,EAA3B,CAA2B,CAAC;;wFACG;IAC7C,qDAAC;CAAA,AAJD,IAIC;AAJY,wGAA8C"}
1
+ {"version":3,"file":"delete-customers-batch.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customer-groups/delete-customers-batch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAAgD;AAEhD,qEAA+E;AAC/E,yDAAuD;AAGvD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,mBAAe,UAAO,GAAY,EAAE,GAAa;;;;;gBACvC,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBACP,qBAAM,IAAA,qBAAS,EAC/B,8CAA8C,EAC9C,GAAG,CAAC,IAAI,CACT,EAAA;;gBAHK,SAAS,GAAG,SAGjB;gBAEK,oBAAoB,GAAyB,GAAG,CAAC,KAAK,CAAC,OAAO,CAClE,sBAAsB,CACvB,CAAA;gBAEsB,qBAAM,oBAAoB,CAAC,cAAc,CAC9D,EAAE,EACF,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,UAAC,EAAM;4BAAJ,EAAE,QAAA;wBAAO,OAAA,EAAE;oBAAF,CAAE,CAAC,CAC3C,EAAA;;gBAHK,cAAc,GAAG,SAGtB;gBACD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,cAAc,gBAAA,EAAE,CAAC,CAAA;;;;KACzC,EAAA;AAED;IAAA;IAIA,CAAC;IADC;QAFC,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC9B,IAAA,wBAAI,EAAC,cAAM,OAAA,6CAA2B,EAA3B,CAA2B,CAAC;;wFACG;IAC7C,qDAAC;CAAA,AAJD,IAIC;AAJY,wGAA8C"}
@@ -1,4 +1,5 @@
1
- declare const _default: (req: any, res: any) => Promise<void>;
1
+ import { Request, Response } from "express";
2
+ declare const _default: (req: Request, res: Response) => Promise<void>;
2
3
  /**
3
4
  * @oas [get] /customer-groups/{id}/customers
4
5
  * operationId: "GetCustomerGroupsGroupCustomers"
@@ -1 +1 @@
1
- {"version":3,"file":"get-customer-group-customers.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customer-groups/get-customer-group-customers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gFAAkE;AAElE;;;;;;;;;;;;;;;;;GAiBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEzB,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAA;gBAER,qBAAM,mBAAkB,CAAC,YAAY,CAClD,GAAG,CAAC,KAAK,EACT,GAAG,CAAC,KAAK,EACT,GAAG,CAAC,IAAI,CACT,EAAA;;gBAJK,MAAM,GAAG,SAId;gBAED,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;;;;KACjB,EAAA"}
1
+ {"version":3,"file":"get-customer-group-customers.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customer-groups/get-customer-group-customers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gFAAkE;AAGlE;;;;;;;;;;;;;;;;;GAiBG;AACH,mBAAe,UAAO,GAAY,EAAE,GAAa;;;;;gBACvC,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEzB,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAA;gBAER,qBAAM,mBAAkB,CAAC,YAAY,CAClD,GAAG,CAAC,KAAK,EACT,GAAG,CAAC,KAAK,EACT,GAAG,CAAC,IAAI,CACT,EAAA;;gBAJK,MAAM,GAAG,SAId;gBAED,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;;;;KACjB,EAAA"}
@@ -1,5 +1,6 @@
1
1
  import { FindParams } from "../../../../types/common";
2
- declare const _default: (req: any, res: any) => Promise<void>;
2
+ import { Request, Response } from "express";
3
+ declare const _default: (req: Request, res: Response) => Promise<void>;
3
4
  /**
4
5
  * @oas [get] /customer-groups/{id}
5
6
  * operationId: "GetCustomerGroupsGroup"
@@ -53,8 +53,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
53
53
  Object.defineProperty(exports, "__esModule", { value: true });
54
54
  exports.AdminGetCustomerGroupsGroupParams = void 0;
55
55
  var common_1 = require("../../../../types/common");
56
- var validator_1 = require("../../../../utils/validator");
57
- var _1 = require(".");
58
56
  /**
59
57
  * @oas [get] /customer-groups/{id}
60
58
  * operationId: "GetCustomerGroupsGroup"
@@ -76,26 +74,14 @@ var _1 = require(".");
76
74
  * $ref: "#/components/schemas/customer_group"
77
75
  */
78
76
  exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
79
- var id, validated, customerGroupService, expandFields, findConfig, customerGroup;
77
+ var id, customerGroupService, customerGroup;
80
78
  return __generator(this, function (_a) {
81
79
  switch (_a.label) {
82
80
  case 0:
83
81
  id = req.params.id;
84
- return [4 /*yield*/, (0, validator_1.validator)(AdminGetCustomerGroupsGroupParams, req.query)];
85
- case 1:
86
- validated = _a.sent();
87
82
  customerGroupService = req.scope.resolve("customerGroupService");
88
- expandFields = [];
89
- if (validated.expand) {
90
- expandFields = validated.expand.split(",");
91
- }
92
- findConfig = {
93
- relations: expandFields.length
94
- ? expandFields
95
- : _1.defaultAdminCustomerGroupsRelations,
96
- };
97
- return [4 /*yield*/, customerGroupService.retrieve(id, findConfig)];
98
- case 2:
83
+ return [4 /*yield*/, customerGroupService.retrieve(id, req.retrieveConfig)];
84
+ case 1:
99
85
  customerGroup = _a.sent();
100
86
  res.json({ customer_group: customerGroup });
101
87
  return [2 /*return*/];