@medusajs/medusa 1.6.1 → 1.6.2-alpha.1

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 (38) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +19 -0
  3. package/dist/api/index.d.ts +1 -0
  4. package/dist/api/index.js +1 -0
  5. package/dist/api/index.js.map +1 -1
  6. package/dist/api/routes/admin/draft-orders/get-draft-order.js +1 -2
  7. package/dist/api/routes/admin/draft-orders/get-draft-order.js.map +1 -1
  8. package/dist/api/routes/admin/product-types/list-product-types.d.ts +3 -7
  9. package/dist/api/routes/admin/product-types/list-product-types.js +3 -24
  10. package/dist/api/routes/admin/product-types/list-product-types.js.map +1 -1
  11. package/dist/api/routes/admin/products/list-types.d.ts +1 -0
  12. package/dist/api/routes/admin/products/list-types.js +1 -0
  13. package/dist/api/routes/admin/products/list-types.js.map +1 -1
  14. package/dist/api/routes/store/carts/create-payment-sessions.js +25 -30
  15. package/dist/api/routes/store/carts/create-payment-sessions.js.map +1 -1
  16. package/dist/api/routes/store/index.js +2 -0
  17. package/dist/api/routes/store/index.js.map +1 -1
  18. package/dist/api/routes/store/product-types/index.d.ts +15 -0
  19. package/dist/api/routes/store/product-types/index.js +59 -0
  20. package/dist/api/routes/store/product-types/index.js.map +1 -0
  21. package/dist/api/routes/store/product-types/list-product-types.d.ts +138 -0
  22. package/dist/api/routes/store/product-types/list-product-types.js +274 -0
  23. package/dist/api/routes/store/product-types/list-product-types.js.map +1 -0
  24. package/dist/services/cart.js +1 -8
  25. package/dist/services/cart.js.map +1 -1
  26. package/dist/services/event-bus.d.ts +9 -3
  27. package/dist/services/event-bus.js +6 -0
  28. package/dist/services/event-bus.js.map +1 -1
  29. package/dist/services/order.js +202 -176
  30. package/dist/services/order.js.map +1 -1
  31. package/dist/services/product-type.d.ts +2 -2
  32. package/dist/services/product-type.js +3 -3
  33. package/dist/services/product-type.js.map +1 -1
  34. package/dist/services/shipping-option.js +4 -4
  35. package/dist/services/shipping-option.js.map +1 -1
  36. package/dist/services/swap.js +83 -81
  37. package/dist/services/swap.js.map +1 -1
  38. package/package.json +2 -2
@@ -1 +1 @@
1
- @medusajs/medusa:build: cache hit, replaying output 49b6ce4ceb09f4b9
1
+ @medusajs/medusa:build: cache hit, replaying output 05f7c346279e2831
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.6.2-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2568](https://github.com/medusajs/medusa/pull/2568) [`2d095a0ce`](https://github.com/medusajs/medusa/commit/2d095a0ce14ab7f24b4e6856cb4850cea18af21c) Thanks [@adrien2p](https://github.com/adrien2p)! - fix(medusa): fix missing throw in the store cart create-payment-sessions
8
+
9
+ * [#2566](https://github.com/medusajs/medusa/pull/2566) [`8069ed5e9`](https://github.com/medusajs/medusa/commit/8069ed5e99dc53a912df9bb860114d2258044108) Thanks [@srindom](https://github.com/srindom)! - fix(medusa): add support for retrying failed event bus jobs
10
+
11
+ - [#2552](https://github.com/medusajs/medusa/pull/2552) [`7b0ceeffb`](https://github.com/medusajs/medusa/commit/7b0ceeffb4616c3f4e0cf51aba2ab381c61ea5d7) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - feat(medusa, medusa-js, medusa-react): /store api product types
12
+
13
+ - Updated dependencies []:
14
+ - @medusajs/medusa-cli@1.3.4-alpha.0
15
+
16
+ ## 1.6.2-alpha.0
17
+
18
+ ### Patch Changes
19
+
20
+ - [`5ea4b728e`](https://github.com/medusajs/medusa/commit/5ea4b728e728a7e6d4d6fe7255ea80395ab75bd3) Thanks [@olivermrbl](https://github.com/olivermrbl)! - Order/cart decorate totals should assign items totals, shipping option requirements should be tax-inclusive if shipping option is, ensure swaps can be created on orders with discounts
21
+
3
22
  ## 1.6.1
4
23
 
5
24
  ### Patch Changes
@@ -39,6 +39,7 @@ export * from "./routes/store/gift-cards";
39
39
  export * from "./routes/store/order-edits";
40
40
  export * from "./routes/store/orders";
41
41
  export * from "./routes/store/products";
42
+ export * from "./routes/store/product-types";
42
43
  export * from "./routes/store/regions";
43
44
  export * from "./routes/store/return-reasons";
44
45
  export * from "./routes/store/returns";
package/dist/api/index.js CHANGED
@@ -70,6 +70,7 @@ __exportStar(require("./routes/store/gift-cards"), exports);
70
70
  __exportStar(require("./routes/store/order-edits"), exports);
71
71
  __exportStar(require("./routes/store/orders"), exports);
72
72
  __exportStar(require("./routes/store/products"), exports);
73
+ __exportStar(require("./routes/store/product-types"), exports);
73
74
  __exportStar(require("./routes/store/regions"), exports);
74
75
  __exportStar(require("./routes/store/return-reasons"), exports);
75
76
  __exportStar(require("./routes/store/returns"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAChC,8EAAsD;AACtD,yDAAkC;AAClC,yDAAkC;AAElC,iCAAiC;AACjC,mBAAe,UAAC,SAAS,EAAE,MAAM;IAC/B,IAAM,GAAG,GAAG,IAAA,gBAAM,GAAE,CAAA;IAEpB,IAAA,eAAK,EAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;IAC7B,IAAA,eAAK,EAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;IAE7B,GAAG,CAAC,GAAG,CAAC,IAAA,uBAAY,GAAE,CAAC,CAAA;IAEvB,OAAO,GAAG,CAAA;AACZ,CAAC,EAAA;AAED,QAAQ;AACR,mEAAgD;AAChD,sDAAmC;AACnC,uDAAoC;AACpC,6DAA0C;AAC1C,4DAAyC;AACzC,iEAA8C;AAC9C,2DAAwC;AACxC,2DAAwC;AACxC,8DAA2C;AAC3C,4DAAyC;AACzC,yDAAsC;AACtC,uDAAoC;AACpC,+DAA4C;AAC5C,6DAA0C;AAC1C,wDAAqC;AACrC,6DAA0C;AAC1C,8DAA2C;AAC3C,+DAA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C,yDAAsC;AACtC,gEAA6C;AAC7C,kEAA+C;AAC/C,mEAAgD;AAChD,uDAAoC;AACpC,uDAAoC;AACpC,2DAAwC;AACxC,yDAAsC;AACtC,uDAAoC;AACpC,0DAAuC;AACvC,QAAQ;AACR,sDAAmC;AACnC,uDAAoC;AACpC,6DAA0C;AAC1C,2DAAwC;AACxC,4DAAyC;AACzC,6DAA0C;AAC1C,wDAAqC;AACrC,0DAAuC;AACvC,+DAA4C;AAC5C,yDAAsC;AACtC,gEAA6C;AAC7C,yDAAsC;AACtC,kEAA+C;AAC/C,uDAAoC;AACpC,0DAAuC"}
@@ -103,9 +103,8 @@ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0
103
103
  case 1:
104
104
  draftOrder = _b.sent();
105
105
  _a = draftOrder;
106
- return [4 /*yield*/, cartService.retrieve(draftOrder.cart_id, {
106
+ return [4 /*yield*/, cartService.retrieveWithTotals(draftOrder.cart_id, {
107
107
  relations: _1.defaultAdminDraftOrdersCartRelations,
108
- select: _1.defaultAdminDraftOrdersCartFields,
109
108
  })];
110
109
  case 2:
111
110
  _a.cart = _b.sent();
@@ -1 +1 @@
1
- {"version":3,"file":"get-draft-order.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/draft-orders/get-draft-order.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sBAKU;AAIV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,iBAAiB,GACrB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;gBAClC,WAAW,GAAgB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;gBAElC,qBAAM,iBAAiB,CAAC,QAAQ,CAAC,EAAE,EAAE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I,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAA;;;;KACtC,EAAA"}
@@ -1,4 +1,4 @@
1
- import { DateComparisonOperator, StringComparisonOperator } from "../../../../types/common";
1
+ import { DateComparisonOperator, FindPaginationParams, StringComparisonOperator } from "../../../../types/common";
2
2
  /**
3
3
  * @oas [get] /product-types
4
4
  * operationId: "GetProductTypes"
@@ -6,7 +6,7 @@ import { DateComparisonOperator, StringComparisonOperator } from "../../../../ty
6
6
  * description: "Retrieve a list of Product Types."
7
7
  * x-authenticated: true
8
8
  * parameters:
9
- * - (query) limit=10 {integer} The number of types to return.
9
+ * - (query) limit=20 {integer} The number of types to return.
10
10
  * - (query) offset=0 {integer} The number of items to skip before the results.
11
11
  * - (query) order {string} The field to sort items by.
12
12
  * - (query) discount_condition_id {string} The discount condition id on which to filter the product types.
@@ -127,11 +127,7 @@ import { DateComparisonOperator, StringComparisonOperator } from "../../../../ty
127
127
  */
128
128
  declare const _default: (req: any, res: any) => Promise<void>;
129
129
  export default _default;
130
- export declare class AdminGetProductTypesPaginationParams {
131
- limit?: number | undefined;
132
- offset?: number | undefined;
133
- }
134
- export declare class AdminGetProductTypesParams extends AdminGetProductTypesPaginationParams {
130
+ export declare class AdminGetProductTypesParams extends FindPaginationParams {
135
131
  id?: string | string[] | StringComparisonOperator;
136
132
  q?: string;
137
133
  value?: string | string[] | StringComparisonOperator;
@@ -76,11 +76,10 @@ var __read = (this && this.__read) || function (o, n) {
76
76
  return ar;
77
77
  };
78
78
  Object.defineProperty(exports, "__esModule", { value: true });
79
- exports.AdminGetProductTypesParams = exports.AdminGetProductTypesPaginationParams = void 0;
79
+ exports.AdminGetProductTypesParams = void 0;
80
80
  var common_1 = require("../../../../types/common");
81
81
  var class_validator_1 = require("class-validator");
82
82
  var is_type_1 = require("../../../../utils/validators/is-type");
83
- var class_transformer_1 = require("class-transformer");
84
83
  /**
85
84
  * @oas [get] /product-types
86
85
  * operationId: "GetProductTypes"
@@ -88,7 +87,7 @@ var class_transformer_1 = require("class-transformer");
88
87
  * description: "Retrieve a list of Product Types."
89
88
  * x-authenticated: true
90
89
  * parameters:
91
- * - (query) limit=10 {integer} The number of types to return.
90
+ * - (query) limit=20 {integer} The number of types to return.
92
91
  * - (query) offset=0 {integer} The number of items to skip before the results.
93
92
  * - (query) order {string} The field to sort items by.
94
93
  * - (query) discount_condition_id {string} The discount condition id on which to filter the product types.
@@ -228,26 +227,6 @@ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0
228
227
  }
229
228
  });
230
229
  }); });
231
- var AdminGetProductTypesPaginationParams = /** @class */ (function () {
232
- function AdminGetProductTypesPaginationParams() {
233
- this.limit = 10;
234
- this.offset = 0;
235
- }
236
- __decorate([
237
- (0, class_validator_1.IsNumber)(),
238
- (0, class_validator_1.IsOptional)(),
239
- (0, class_transformer_1.Type)(function () { return Number; }),
240
- __metadata("design:type", Object)
241
- ], AdminGetProductTypesPaginationParams.prototype, "limit", void 0);
242
- __decorate([
243
- (0, class_validator_1.IsNumber)(),
244
- (0, class_validator_1.IsOptional)(),
245
- (0, class_transformer_1.Type)(function () { return Number; }),
246
- __metadata("design:type", Object)
247
- ], AdminGetProductTypesPaginationParams.prototype, "offset", void 0);
248
- return AdminGetProductTypesPaginationParams;
249
- }());
250
- exports.AdminGetProductTypesPaginationParams = AdminGetProductTypesPaginationParams;
251
230
  // eslint-disable-next-line max-len
252
231
  var AdminGetProductTypesParams = /** @class */ (function (_super) {
253
232
  __extends(AdminGetProductTypesParams, _super);
@@ -290,6 +269,6 @@ var AdminGetProductTypesParams = /** @class */ (function (_super) {
290
269
  __metadata("design:type", String)
291
270
  ], AdminGetProductTypesParams.prototype, "discount_condition_id", void 0);
292
271
  return AdminGetProductTypesParams;
293
- }(AdminGetProductTypesPaginationParams));
272
+ }(common_1.FindPaginationParams));
294
273
  exports.AdminGetProductTypesParams = AdminGetProductTypesParams;
295
274
  //# sourceMappingURL=list-product-types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-product-types.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/product-types/list-product-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAGiC;AACjC,mDAAgE;AAEhE,gEAA6D;AAE7D,uDAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6HG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACtB,WAAW,GACf,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAA;gBAEjC,UAAU,GAAuB,GAAG,WAA1B,EAAE,gBAAgB,GAAK,GAAG,iBAAR,CAAQ;gBACtC,KAAiB,GAAG,CAAC,UAAU,EAA7B,IAAI,UAAA,EAAE,IAAI,UAAA,CAAmB;gBAEd,qBAAM,WAAW,CAAC,YAAY,CACnD,gBAAgB,EAChB,UAAU,CACX,EAAA;;gBAHK,KAAA,sBAAiB,SAGtB,KAAA,EAHM,KAAK,QAAA,EAAE,KAAK,QAAA;gBAKnB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACnB,aAAa,EAAE,KAAK;oBACpB,KAAK,OAAA;oBACL,MAAM,EAAE,IAAI;oBACZ,KAAK,EAAE,IAAI;iBACZ,CAAC,CAAA;;;;KACH,EAAA;AAED;IAAA;QAIE,UAAK,GAAI,EAAE,CAAA;QAKX,WAAM,GAAI,CAAC,CAAA;IACb,CAAC;IANC;QAHC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;QACZ,IAAA,wBAAI,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;;uEACR;IAKX;QAHC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;QACZ,IAAA,wBAAI,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;;wEACR;IACb,2CAAC;CAAA,AAVD,IAUC;AAVY,oFAAoC;AAYjD,mCAAmC;AACnC;IAAgD,8CAAoC;IAApF;;IA4BA,CAAC;IAzBC;QAFC,IAAA,gBAAM,EAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,iCAAwB,CAAC,CAAC;QACpD,IAAA,4BAAU,GAAE;;0DACoC;IAIjD;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;yDACH;IAIV;QAFC,IAAA,gBAAM,EAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,iCAAwB,CAAC,CAAC;QACpD,IAAA,4BAAU,GAAE;;6DACuC;IAIpD;QAFC,IAAA,gBAAM,EAAC,CAAC,+BAAsB,CAAC,CAAC;QAChC,IAAA,4BAAU,GAAE;kCACA,+BAAsB;kEAAA;IAInC;QAFC,IAAA,gBAAM,EAAC,CAAC,+BAAsB,CAAC,CAAC;QAChC,IAAA,4BAAU,GAAE;kCACA,+BAAsB;kEAAA;IAInC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;6DACC;IAId;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;6EACiB;IAChC,iCAAC;CAAA,AA5BD,CAAgD,oCAAoC,GA4BnF;AA5BY,gEAA0B"}
1
+ {"version":3,"file":"list-product-types.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/product-types/list-product-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAIiC;AACjC,mDAAsD;AAEtD,gEAA6D;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAAA,4BAAU,GAAE;kCACA,+BAAsB;kEAAA;IAInC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;6DACC;IAId;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;6EACiB;IAChC,iCAAC;CAAA,AA5BD,CAAgD,6BAAoB,GA4BnE;AA5BY,gEAA0B"}
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * @oas [get] /products/types
3
+ * deprecated: true
3
4
  * operationId: "GetProductsTypes"
4
5
  * summary: "List Product Types"
5
6
  * description: "Retrieves a list of Product Types."
@@ -38,6 +38,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  /**
40
40
  * @oas [get] /products/types
41
+ * deprecated: true
41
42
  * operationId: "GetProductsTypes"
42
43
  * summary: "List Product Types"
43
44
  * description: "Retrieves a list of Product Types."
@@ -1 +1 @@
1
- {"version":3,"file":"list-types.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/products/list-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACtB,cAAc,GAAmB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;gBAE5D,qBAAM,cAAc,CAAC,SAAS,EAAE,EAAA;;gBAAxC,KAAK,GAAG,SAAgC;gBAE9C,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,OAAA,EAAE,CAAC,CAAA;;;;KACpB,EAAA"}
1
+ {"version":3,"file":"list-types.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/products/list-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACtB,cAAc,GAAmB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;gBAE5D,qBAAM,cAAc,CAAC,SAAS,EAAE,EAAA;;gBAAxC,KAAK,GAAG,SAAgC;gBAE9C,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,OAAA,EAAE,CAAC,CAAA;;;;KACpB,EAAA"}
@@ -81,7 +81,7 @@ var _1 = require(".");
81
81
  * $ref: "#/components/responses/500_error"
82
82
  */
83
83
  exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
84
- var id, cartService, idempotencyKeyService, manager, headerKey, idempotencyKey, error_1, inProgress_1, err_1, _a, e_1;
84
+ var id, cartService, idempotencyKeyService, manager, headerKey, idempotencyKey, error_1, inProgress, err, _a;
85
85
  return __generator(this, function (_b) {
86
86
  switch (_b.label) {
87
87
  case 0:
@@ -115,21 +115,18 @@ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0
115
115
  case 4:
116
116
  res.setHeader("Access-Control-Expose-Headers", "Idempotency-Key");
117
117
  res.setHeader("Idempotency-Key", idempotencyKey.idempotency_key);
118
+ inProgress = true;
119
+ err = false;
118
120
  _b.label = 5;
119
121
  case 5:
120
- _b.trys.push([5, 14, , 15]);
121
- inProgress_1 = true;
122
- err_1 = false;
123
- _b.label = 6;
124
- case 6:
125
- if (!inProgress_1) return [3 /*break*/, 13];
122
+ if (!inProgress) return [3 /*break*/, 12];
126
123
  _a = idempotencyKey.recovery_point;
127
124
  switch (_a) {
128
- case "started": return [3 /*break*/, 7];
129
- case "finished": return [3 /*break*/, 9];
125
+ case "started": return [3 /*break*/, 6];
126
+ case "finished": return [3 /*break*/, 8];
130
127
  }
131
- return [3 /*break*/, 10];
132
- case 7: return [4 /*yield*/, manager
128
+ return [3 /*break*/, 9];
129
+ case 6: return [4 /*yield*/, manager
133
130
  .transaction("SERIALIZABLE", function (transactionManager) { return __awaiter(void 0, void 0, void 0, function () {
134
131
  return __generator(this, function (_a) {
135
132
  switch (_a.label) {
@@ -166,19 +163,19 @@ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0
166
163
  });
167
164
  }); })
168
165
  .catch(function (e) {
169
- inProgress_1 = false;
170
- err_1 = e;
166
+ inProgress = false;
167
+ err = e;
171
168
  })];
172
- case 8:
169
+ case 7:
173
170
  _b.sent();
174
- return [3 /*break*/, 12];
175
- case 9:
171
+ return [3 /*break*/, 11];
172
+ case 8:
176
173
  {
177
- inProgress_1 = false;
178
- return [3 /*break*/, 12];
174
+ inProgress = false;
175
+ return [3 /*break*/, 11];
179
176
  }
180
- _b.label = 10;
181
- case 10: return [4 /*yield*/, manager.transaction(function (transactionManager) { return __awaiter(void 0, void 0, void 0, function () {
177
+ _b.label = 9;
178
+ case 9: return [4 /*yield*/, manager.transaction(function (transactionManager) { return __awaiter(void 0, void 0, void 0, function () {
182
179
  return __generator(this, function (_a) {
183
180
  switch (_a.label) {
184
181
  case 0: return [4 /*yield*/, idempotencyKeyService
@@ -194,18 +191,16 @@ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0
194
191
  }
195
192
  });
196
193
  }); })];
197
- case 11:
194
+ case 10:
198
195
  _b.sent();
199
- return [3 /*break*/, 12];
200
- case 12: return [3 /*break*/, 6];
201
- case 13:
196
+ return [3 /*break*/, 11];
197
+ case 11: return [3 /*break*/, 5];
198
+ case 12:
199
+ if (err) {
200
+ throw err;
201
+ }
202
202
  res.status(idempotencyKey.response_code).json(idempotencyKey.response_body);
203
- return [3 /*break*/, 15];
204
- case 14:
205
- e_1 = _b.sent();
206
- console.log(e_1);
207
- throw e_1;
208
- case 15: return [2 /*return*/];
203
+ return [2 /*return*/];
209
204
  }
210
205
  });
211
206
  }); });
@@ -1 +1 @@
1
- {"version":3,"file":"create-payment-sessions.js","sourceRoot":"","sources":["../../../../../src/api/routes/store/carts/create-payment-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,EAAA;;gBARF,SAQE,CAAA;gBACF,yBAAK;;;gBAIX,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAA;;;;gBAE3E,OAAO,CAAC,GAAG,CAAC,GAAC,CAAC,CAAA;gBACd,MAAM,GAAC,CAAA;;;;KAEV,EAAA"}
1
+ {"version":3,"file":"create-payment-sessions.js","sourceRoot":"","sources":["../../../../../src/api/routes/store/carts/create-payment-sessions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAAqE;AAKrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,WAAW,GAAgB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;gBAC3D,qBAAqB,GAA0B,GAAG,CAAC,KAAK,CAAC,OAAO,CACpE,uBAAuB,CACxB,CAAA;gBACK,OAAO,GAAkB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;gBAErD,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAA;;;;gBAIhD,qBAAM,OAAO,CAAC,WAAW,CAAC,UAAO,kBAAkB;;;wCAChC,qBAAM,qBAAqB;yCACzC,eAAe,CAAC,kBAAkB,CAAC;yCACnC,iBAAiB,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA;;oCAFjE,cAAc,GAAG,SAEgD,CAAA;;;;yBAClE,CAAC,EAAA;;gBAJF,SAIE,CAAA;;;;gBAEF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,kCAA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AGC,qBAAM,OAAO,CAAC,WAAW,CAAC,UAAO,kBAAkB;;;oCAChC,qBAAM,qBAAqB;qCACzC,eAAe,CAAC,kBAAkB,CAAC;qCACnC,MAAM,CAAC,cAAc,CAAC,eAAe,EAAE;oCACtC,cAAc,EAAE,UAAU;oCAC1B,aAAa,EAAE,GAAG;oCAClB,aAAa,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;iCACrD,CAAC,EAAA;;gCANJ,cAAc,GAAG,SAMb,CAAA;;;;qBACL,CAAC,EAAA;;gBARF,SAQE,CAAA;gBACF,yBAAK;;;gBAIX,IAAI,GAAG,EAAE;oBACP,MAAM,GAAG,CAAA;iBACV;gBAED,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAA;;;;KAC5E,EAAA"}
@@ -14,6 +14,7 @@ var gift_cards_1 = __importDefault(require("./gift-cards"));
14
14
  var orders_1 = __importDefault(require("./orders"));
15
15
  var order_edits_1 = __importDefault(require("./order-edits"));
16
16
  var products_1 = __importDefault(require("./products"));
17
+ var product_types_1 = __importDefault(require("../admin/product-types"));
17
18
  var regions_1 = __importDefault(require("./regions"));
18
19
  var return_reasons_1 = __importDefault(require("./return-reasons"));
19
20
  var returns_1 = __importDefault(require("./returns"));
@@ -33,6 +34,7 @@ exports.default = (function (app, container, config) {
33
34
  (0, collections_1.default)(route);
34
35
  (0, customers_1.default)(route, container);
35
36
  (0, products_1.default)(route);
37
+ (0, product_types_1.default)(route);
36
38
  (0, orders_1.default)(route);
37
39
  (0, order_edits_1.default)(route);
38
40
  (0, carts_1.default)(route, container);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/routes/store/index.js"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AACvB,mCAAgC;AAChC,kEAA2C;AAC3C,gDAA+B;AAC/B,kDAAgC;AAChC,8DAA4C;AAC5C,0DAAwC;AACxC,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IAAA,iBAAY,EAAC,KAAK,CAAC,CAAA;IACnB,IAAA,eAAU,EAAC,KAAK,CAAC,CAAA;IACjB,IAAA,kBAAa,EAAC,KAAK,CAAC,CAAA;IACpB,IAAA,iBAAY,EAAC,KAAK,CAAC,CAAA;IACnB,IAAA,oBAAc,EAAC,KAAK,CAAC,CAAA;IACrB,IAAA,wBAAkB,EAAC,KAAK,CAAC,CAAA;IAEzB,OAAO,GAAG,CAAA;AACZ,CAAC,EAAA"}
@@ -0,0 +1,15 @@
1
+ import { ProductType } from "../../../..";
2
+ import { PaginatedResponse } from "../../../../types/common";
3
+ import "reflect-metadata";
4
+ declare const _default: (app: any) => any;
5
+ export default _default;
6
+ export declare const allowedStoreProductTypeFields: string[];
7
+ export declare const defaultStoreProductTypeFields: string[];
8
+ export declare const defaultStoreProductTypeRelations: never[];
9
+ export declare type StoreProductTypesListRes = PaginatedResponse & {
10
+ product_types: ProductType[];
11
+ };
12
+ export declare type StoreProductTypesRes = {
13
+ product_type: ProductType;
14
+ };
15
+ export * from "./list-product-types";
@@ -0,0 +1,59 @@
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
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.defaultStoreProductTypeRelations = exports.defaultStoreProductTypeFields = exports.allowedStoreProductTypeFields = void 0;
30
+ var express_1 = require("express");
31
+ var middlewares_1 = __importStar(require("../../../middlewares"));
32
+ require("reflect-metadata");
33
+ var list_product_types_1 = require("./list-product-types");
34
+ var route = (0, express_1.Router)();
35
+ exports.default = (function (app) {
36
+ app.use("/product-types", route);
37
+ route.get("/", (0, middlewares_1.transformQuery)(list_product_types_1.StoreGetProductTypesParams, {
38
+ defaultFields: exports.defaultStoreProductTypeFields,
39
+ defaultRelations: exports.defaultStoreProductTypeRelations,
40
+ allowedFields: exports.allowedStoreProductTypeFields,
41
+ isList: true,
42
+ }), middlewares_1.default.wrap(require("./list-product-types").default));
43
+ return app;
44
+ });
45
+ exports.allowedStoreProductTypeFields = [
46
+ "id",
47
+ "value",
48
+ "created_at",
49
+ "updated_at",
50
+ ];
51
+ exports.defaultStoreProductTypeFields = [
52
+ "id",
53
+ "value",
54
+ "created_at",
55
+ "updated_at",
56
+ ];
57
+ exports.defaultStoreProductTypeRelations = [];
58
+ __exportStar(require("./list-product-types"), exports);
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/routes/store/product-types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAGhC,kEAAkE;AAClE,4BAAyB;AACzB,2DAAiE;AAEjE,IAAM,KAAK,GAAG,IAAA,gBAAM,GAAE,CAAA;AAEtB,mBAAe,UAAC,GAAG;IACjB,GAAG,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;IAEhC,KAAK,CAAC,GAAG,CACP,GAAG,EACH,IAAA,4BAAc,EAAC,+CAA0B,EAAE;QACzC,aAAa,EAAE,qCAA6B;QAC5C,gBAAgB,EAAE,wCAAgC;QAClD,aAAa,EAAE,qCAA6B;QAC5C,MAAM,EAAE,IAAI;KACb,CAAC,EACF,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,CAC1D,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,EAAA;AAEY,QAAA,6BAA6B,GAAG;IAC3C,IAAI;IACJ,OAAO;IACP,YAAY;IACZ,YAAY;CACb,CAAA;AAEY,QAAA,6BAA6B,GAAG;IAC3C,IAAI;IACJ,OAAO;IACP,YAAY;IACZ,YAAY;CACb,CAAA;AACY,QAAA,gCAAgC,GAAG,EAAE,CAAA;AAUlD,uDAAoC"}
@@ -0,0 +1,138 @@
1
+ import { DateComparisonOperator, FindPaginationParams, StringComparisonOperator } from "../../../../types/common";
2
+ /**
3
+ * @oas [get] /product-types
4
+ * operationId: "GetProductTypes"
5
+ * summary: "List Product Types"
6
+ * description: "Retrieve a list of Product Types."
7
+ * x-authenticated: true
8
+ * parameters:
9
+ * - (query) limit=20 {integer} The number of types to return.
10
+ * - (query) offset=0 {integer} The number of items to skip before the results.
11
+ * - (query) order {string} The field to sort items by.
12
+ * - (query) discount_condition_id {string} The discount condition id on which to filter the product types.
13
+ * - in: query
14
+ * name: value
15
+ * style: form
16
+ * explode: false
17
+ * description: The type values to search for
18
+ * schema:
19
+ * type: array
20
+ * items:
21
+ * type: string
22
+ * - in: query
23
+ * name: id
24
+ * style: form
25
+ * explode: false
26
+ * description: The type IDs to search for
27
+ * schema:
28
+ * type: array
29
+ * items:
30
+ * type: string
31
+ * - (query) q {string} A query string to search values for
32
+ * - in: query
33
+ * name: created_at
34
+ * description: Date comparison for when resulting product types were created.
35
+ * schema:
36
+ * type: object
37
+ * properties:
38
+ * lt:
39
+ * type: string
40
+ * description: filter by dates less than this date
41
+ * format: date
42
+ * gt:
43
+ * type: string
44
+ * description: filter by dates greater than this date
45
+ * format: date
46
+ * lte:
47
+ * type: string
48
+ * description: filter by dates less than or equal to this date
49
+ * format: date
50
+ * gte:
51
+ * type: string
52
+ * description: filter by dates greater than or equal to this date
53
+ * format: date
54
+ * - in: query
55
+ * name: updated_at
56
+ * description: Date comparison for when resulting product types were updated.
57
+ * schema:
58
+ * type: object
59
+ * properties:
60
+ * lt:
61
+ * type: string
62
+ * description: filter by dates less than this date
63
+ * format: date
64
+ * gt:
65
+ * type: string
66
+ * description: filter by dates greater than this date
67
+ * format: date
68
+ * lte:
69
+ * type: string
70
+ * description: filter by dates less than or equal to this date
71
+ * format: date
72
+ * gte:
73
+ * type: string
74
+ * description: filter by dates greater than or equal to this date
75
+ * format: date
76
+ * x-codeSamples:
77
+ * - lang: JavaScript
78
+ * label: JS Client
79
+ * source: |
80
+ * import Medusa from "@medusajs/medusa-js"
81
+ * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
82
+ * // must be previously logged in or use api token
83
+ * medusa.store.productTypes.list()
84
+ * .then(({ product_types }) => {
85
+ * console.log(product_types.length);
86
+ * });
87
+ * - lang: Shell
88
+ * label: cURL
89
+ * source: |
90
+ * curl --location --request GET 'https://medusa-url.com/store/product-types' \
91
+ * --header 'Authorization: Bearer {api_token}'
92
+ * security:
93
+ * - api_token: []
94
+ * - cookie_auth: []
95
+ * tags:
96
+ * - Product Type
97
+ * responses:
98
+ * "200":
99
+ * description: OK
100
+ * content:
101
+ * application/json:
102
+ * schema:
103
+ * properties:
104
+ * product_types:
105
+ * $ref: "#/components/schemas/product_type"
106
+ * count:
107
+ * type: integer
108
+ * description: The total number of items available
109
+ * offset:
110
+ * type: integer
111
+ * description: The number of items skipped before these items
112
+ * limit:
113
+ * type: integer
114
+ * description: The number of items per page
115
+ * "400":
116
+ * $ref: "#/components/responses/400_error"
117
+ * "401":
118
+ * $ref: "#/components/responses/unauthorized"
119
+ * "404":
120
+ * $ref: "#/components/responses/not_found_error"
121
+ * "409":
122
+ * $ref: "#/components/responses/invalid_state_error"
123
+ * "422":
124
+ * $ref: "#/components/responses/invalid_request_error"
125
+ * "500":
126
+ * $ref: "#/components/responses/500_error"
127
+ */
128
+ declare const _default: (req: any, res: any) => Promise<void>;
129
+ export default _default;
130
+ export declare class StoreGetProductTypesParams extends FindPaginationParams {
131
+ id?: string | string[] | StringComparisonOperator;
132
+ q?: string;
133
+ value?: string | string[] | StringComparisonOperator;
134
+ created_at?: DateComparisonOperator;
135
+ updated_at?: DateComparisonOperator;
136
+ order?: string;
137
+ discount_condition_id?: string;
138
+ }