@medusajs/medusa 1.20.7 → 1.20.8

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.
@@ -3,8 +3,8 @@ import { FindParams } from "../../../../types/common";
3
3
  /**
4
4
  * @oas [post] /admin/inventory-items/{id}/location-levels
5
5
  * operationId: "PostInventoryItemsInventoryItemLocationLevels"
6
- * summary: "Create a Location Level"
7
- * description: "Create a Location Level for a given Inventory Item."
6
+ * summary: "Create an Inventory Level"
7
+ * description: "Create an Inventory Level for a given Inventory Item."
8
8
  * x-authenticated: true
9
9
  * parameters:
10
10
  * - (path) id=* {string} The ID of the Inventory Item.
@@ -107,7 +107,7 @@ export default _default;
107
107
  /**
108
108
  * @schema AdminPostInventoryItemsItemLocationLevelsReq
109
109
  * type: object
110
- * description: "The details of the location level to create."
110
+ * description: "The details of the inventory level to create."
111
111
  * required:
112
112
  * - location_id
113
113
  * - stocked_quantity
@@ -66,8 +66,8 @@ var common_1 = require("../../../../types/common");
66
66
  /**
67
67
  * @oas [post] /admin/inventory-items/{id}/location-levels
68
68
  * operationId: "PostInventoryItemsInventoryItemLocationLevels"
69
- * summary: "Create a Location Level"
70
- * description: "Create a Location Level for a given Inventory Item."
69
+ * summary: "Create an Inventory Level"
70
+ * description: "Create an Inventory Level for a given Inventory Item."
71
71
  * x-authenticated: true
72
72
  * parameters:
73
73
  * - (path) id=* {string} The ID of the Inventory Item.
@@ -201,7 +201,7 @@ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0
201
201
  /**
202
202
  * @schema AdminPostInventoryItemsItemLocationLevelsReq
203
203
  * type: object
204
- * description: "The details of the location level to create."
204
+ * description: "The details of the inventory level to create."
205
205
  * required:
206
206
  * - location_id
207
207
  * - stocked_quantity
@@ -2,12 +2,12 @@ import { Request, Response } from "express";
2
2
  /**
3
3
  * @oas [delete] /admin/inventory-items/{id}/location-levels/{location_id}
4
4
  * operationId: "DeleteInventoryItemsInventoryIteLocationLevelsLocation"
5
- * summary: "Delete a Location Level"
6
- * description: "Delete a location level of an Inventory Item."
5
+ * summary: "Delete a Inventory Level"
6
+ * description: "Delete a inventory level of an Inventory Item."
7
7
  * x-authenticated: true
8
8
  * parameters:
9
9
  * - (path) id=* {string} The ID of the Inventory Item.
10
- * - (path) location_id=* {string} The ID of the location.
10
+ * - (path) location_id=* {string} The ID of the inventory level.
11
11
  * x-codegen:
12
12
  * method: deleteLocationLevel
13
13
  * x-codeSamples:
@@ -40,12 +40,12 @@ var medusa_core_utils_1 = require("medusa-core-utils");
40
40
  /**
41
41
  * @oas [delete] /admin/inventory-items/{id}/location-levels/{location_id}
42
42
  * operationId: "DeleteInventoryItemsInventoryIteLocationLevelsLocation"
43
- * summary: "Delete a Location Level"
44
- * description: "Delete a location level of an Inventory Item."
43
+ * summary: "Delete a Inventory Level"
44
+ * description: "Delete a inventory level of an Inventory Item."
45
45
  * x-authenticated: true
46
46
  * parameters:
47
47
  * - (path) id=* {string} The ID of the Inventory Item.
48
- * - (path) location_id=* {string} The ID of the location.
48
+ * - (path) location_id=* {string} The ID of the inventory level.
49
49
  * x-codegen:
50
50
  * method: deleteLocationLevel
51
51
  * x-codeSamples:
@@ -3,14 +3,14 @@ import { FindParams } from "../../../../types/common";
3
3
  /**
4
4
  * @oas [post] /admin/inventory-items/{id}/location-levels/{location_id}
5
5
  * operationId: "PostInventoryItemsInventoryItemLocationLevelsLocationLevel"
6
- * summary: "Update a Location Level"
7
- * description: "Update a Location Level's details for a given Inventory Item."
6
+ * summary: "Update a Inventory Level"
7
+ * description: "Update an inventory level's details for a given Inventory Item."
8
8
  * x-authenticated: true
9
9
  * parameters:
10
10
  * - (path) id=* {string} The ID of the Inventory Item that the location is associated with.
11
- * - (path) location_id=* {string} The ID of the Location to update.
12
- * - (query) expand {string} Comma-separated relations that should be expanded in the returned location level.
13
- * - (query) fields {string} Comma-separated fields that should be included in the returned location level.
11
+ * - (path) location_id=* {string} The ID of the inventory level to update.
12
+ * - (query) expand {string} Comma-separated relations that should be expanded in the returned inventory level.
13
+ * - (query) fields {string} Comma-separated fields that should be included in the returned inventory level.
14
14
  * requestBody:
15
15
  * content:
16
16
  * application/json:
@@ -108,10 +108,10 @@ export default _default;
108
108
  * type: object
109
109
  * properties:
110
110
  * stocked_quantity:
111
- * description: the total stock quantity of an inventory item at the given location ID
111
+ * description: the total stock quantity of an inventory item at the specified inventory level
112
112
  * type: number
113
113
  * incoming_quantity:
114
- * description: the incoming stock quantity of an inventory item at the given location ID
114
+ * description: the incoming stock quantity of an inventory item at the specified inventory level
115
115
  * type: number
116
116
  */
117
117
  export declare class AdminPostInventoryItemsItemLocationLevelsLevelReq {
@@ -66,14 +66,14 @@ var common_1 = require("../../../../types/common");
66
66
  /**
67
67
  * @oas [post] /admin/inventory-items/{id}/location-levels/{location_id}
68
68
  * operationId: "PostInventoryItemsInventoryItemLocationLevelsLocationLevel"
69
- * summary: "Update a Location Level"
70
- * description: "Update a Location Level's details for a given Inventory Item."
69
+ * summary: "Update a Inventory Level"
70
+ * description: "Update an inventory level's details for a given Inventory Item."
71
71
  * x-authenticated: true
72
72
  * parameters:
73
73
  * - (path) id=* {string} The ID of the Inventory Item that the location is associated with.
74
- * - (path) location_id=* {string} The ID of the Location to update.
75
- * - (query) expand {string} Comma-separated relations that should be expanded in the returned location level.
76
- * - (query) fields {string} Comma-separated fields that should be included in the returned location level.
74
+ * - (path) location_id=* {string} The ID of the inventory level to update.
75
+ * - (query) expand {string} Comma-separated relations that should be expanded in the returned inventory level.
76
+ * - (query) fields {string} Comma-separated fields that should be included in the returned inventory level.
77
77
  * requestBody:
78
78
  * content:
79
79
  * application/json:
@@ -189,10 +189,10 @@ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0
189
189
  * type: object
190
190
  * properties:
191
191
  * stocked_quantity:
192
- * description: the total stock quantity of an inventory item at the given location ID
192
+ * description: the total stock quantity of an inventory item at the specified inventory level
193
193
  * type: number
194
194
  * incoming_quantity:
195
- * description: the incoming stock quantity of an inventory item at the given location ID
195
+ * description: the incoming stock quantity of an inventory item at the specified inventory level
196
196
  * type: number
197
197
  */
198
198
  var AdminPostInventoryItemsItemLocationLevelsLevelReq = /** @class */ (function () {
@@ -66,12 +66,16 @@ var __read = (this && this.__read) || function (o, n) {
66
66
  }
67
67
  return ar;
68
68
  };
69
+ var __importDefault = (this && this.__importDefault) || function (mod) {
70
+ return (mod && mod.__esModule) ? mod : { "default": mod };
71
+ };
69
72
  Object.defineProperty(exports, "__esModule", { value: true });
70
73
  exports.AdminGetProductParams = void 0;
71
74
  var utils_1 = require("@medusajs/utils");
72
75
  var common_1 = require("../../../../types/common");
73
76
  var utils_2 = require("../../../../utils");
74
77
  var index_1 = require("./index");
78
+ var sales_channels_1 = __importDefault(require("../../../../loaders/feature-flags/sales-channels"));
75
79
  /**
76
80
  * @oas [get] /admin/products/{id}
77
81
  * operationId: "GetProductsProduct"
@@ -180,7 +184,8 @@ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0
180
184
  decoratePromises.push(pricingService.setAdminProductPricing([product]));
181
185
  }
182
186
  shouldSetAvailability = (_b = req.retrieveConfig.relations) === null || _b === void 0 ? void 0 : _b.includes("variants");
183
- if (!shouldSetAvailability) return [3 /*break*/, 9];
187
+ if (!(shouldSetAvailability &&
188
+ featureFlagRouter.isFeatureEnabled(sales_channels_1.default.key))) return [3 /*break*/, 9];
184
189
  salesChannels = void 0;
185
190
  if (!isMedusaV2FlagOn) return [3 /*break*/, 6];
186
191
  remoteQuery = req.scope.resolve("remoteQuery");
@@ -1 +1 @@
1
- {"version":3,"file":"get-product.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/products/get-product.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,yCAA0D;AAC1D,mDAAqD;AACrD,2CAAmD;AACnD,iCAA8D;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,GACzB,MAAA,GAAG,CAAC,cAAc,CAAC,SAAS,0CAAE,QAAQ,CAAC,UAAU,CAAC,CAAA;qBAEhD,qBAAqB,EAArB,wBAAqB;gBACnB,aAAa,SAAA,CAAA;qBAEb,gBAAgB,EAAhB,wBAAgB;gBACZ,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;gBAC9C,KAAK,GAAG;oBACZ,aAAa,EAAE;wBACb,MAAM,EAAE,CAAC,IAAI,CAAC;qBACf;iBACF,CAAA;gBACe,qBAAM,WAAW,CAAC,KAAK,CAAC,EAAA;;gBAAxC,aAAa,GAAG,SAAwB,CAAA;;;gBAElC,mBAAmB,GAAwB,GAAG,CAAC,KAAK,CAAC,OAAO,CAChE,qBAAqB,CACtB,CACA;gBAAkB,qBAAM,mBAAmB,CAAC,YAAY,CACvD,EAAE,EACF,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CACnB,EAAA;;gBAHA,KAAA,sBAAkB,SAGlB,KAAA,EAHC,aAAa,QAAA,CAGd;;;gBAGH,gBAAgB,CAAC,IAAI,CACnB,8BAA8B,CAAC,sBAAsB,CACnD,CAAC,OAAO,CAAC,EACT,aAAa,CAAC,GAAG,CAAC,UAAC,YAAY,IAAK,OAAA,YAAY,CAAC,EAAE,EAAf,CAAe,CAAC,CACrD,CACF,CAAA;;oBAEH,qBAAM,IAAA,kBAAU,EAAC,gBAAgB,CAAC,EAAA;;gBAAlC,SAAkC,CAAA;gBAElC,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;;;;KACtB,EAAA;AAED;IAA2C,yCAAU;IAArD;;IAAuD,CAAC;IAAD,4BAAC;AAAD,CAAC,AAAxD,CAA2C,mBAAU,GAAG;AAA3C,sDAAqB"}
1
+ {"version":3,"file":"get-product.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/products/get-product.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;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AA,EAAE,CAAC,CAAA;;;;KACtB,EAAA;AAED;IAA2C,yCAAU;IAArD;;IAAuD,CAAC;IAAD,4BAAC;AAAD,CAAC,AAAxD,CAA2C,mBAAU,GAAG;AAA3C,sDAAqB"}
@@ -196,8 +196,8 @@ export interface PaymentProcessor {
196
196
  *
197
197
  * @example
198
198
  * import {
199
- * PaymentContext,
200
- * PaymentSessionResponse,
199
+ * PaymentProcessorContext,
200
+ * PaymentProcessorSessionResponse,
201
201
  * // ...
202
202
  * } from "@medusajs/medusa"
203
203
  *
@@ -4,6 +4,9 @@ import { Product } from "./product";
4
4
  export declare class ProductCollection extends SoftDeletableEntity {
5
5
  title: string;
6
6
  handle: string;
7
+ /**
8
+ * @apiIgnore
9
+ */
7
10
  products: Relation<Product>[];
8
11
  metadata: Record<string, unknown>;
9
12
  /**
@@ -42,6 +45,7 @@ export declare class ProductCollection extends SoftDeletableEntity {
42
45
  * description: The details of the products that belong to this product collection.
43
46
  * type: array
44
47
  * x-expandable: "products"
48
+ * x-ignore: true
45
49
  * items:
46
50
  * $ref: "#/components/schemas/Product"
47
51
  * created_at:
@@ -110,6 +110,7 @@ exports.ProductCollection = ProductCollection;
110
110
  * description: The details of the products that belong to this product collection.
111
111
  * type: array
112
112
  * x-expandable: "products"
113
+ * x-ignore: true
113
114
  * items:
114
115
  * $ref: "#/components/schemas/Product"
115
116
  * created_at:
@@ -1 +1 @@
1
- {"version":3,"file":"product-collection.js","sourceRoot":"","sources":["../../src/models/product-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAOgB;AAEhB,kDAAsB;AACtB,oFAAgF;AAChF,4DAAwD;AACxD,kEAA8D;AAC9D,qCAAmC;AAGnC;IAAuC,qCAAmB;IAA1D;;IA0BA,CAAC;IAZC;;OAEG;IAEK,qDAAyB,GADjC;QAEE,IAAI,IAAI,CAAC,EAAE;YAAE,OAAM;QAEnB,IAAI,CAAC,EAAE,GAAG,IAAA,qCAAgB,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AE,GAAG,IAAA,qCAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QAC3C,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,IAAI,CAAC,MAAM,GAAG,gBAAC,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SACtC;IACH,CAAC;IA3BD;QAAC,IAAA,gBAAM,GAAE;;oDACI;IAEb;QAAC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC;QACpD,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACb;IAKd;QAAC,IAAA,mBAAS,EAAC,cAAM,OAAA,iBAAO,EAAP,CAAO,EAAE,UAAC,OAAO,IAAK,OAAA,OAAO,CAAC,UAAU,EAAlB,CAAkB,CAAC;;uDAC7B;IAE7B;QAAC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDAChB;IAKjC;QAAC,IAAA,sBAAY,GAAE;;;;sEAQd;IA5BU,iBAAiB;QAD7B,IAAA,gBAAM,GAAE;OACI,iBAAiB,CA6B7B;IAAD,wBAAC;CAAA,AA7BD,CAAuC,2CAAmB,GA6BzD;AA7BY,8CAAiB;AA+B9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG"}
@@ -38,7 +38,8 @@ export default class JobSchedulerService {
38
38
  * @param data - the data to be sent with the event
39
39
  * @param schedule - the schedule expression
40
40
  * @param handler - the handler to call on the job
41
- * @return void
41
+ * @param options - the create job options
42
+ * @return added job
42
43
  */
43
44
  create<T>(eventName: string, data: T, schedule: string, handler: ScheduledJobHandler, options: CreateJobOptions): Promise<Job>;
44
45
  }
@@ -151,12 +151,13 @@ var JobSchedulerService = /** @class */ (function () {
151
151
  * @param data - the data to be sent with the event
152
152
  * @param schedule - the schedule expression
153
153
  * @param handler - the handler to call on the job
154
- * @return void
154
+ * @param options - the create job options
155
+ * @return added job
155
156
  */
156
157
  JobSchedulerService.prototype.create = function (eventName, data, schedule, handler, options) {
157
158
  var _a;
158
159
  return __awaiter(this, void 0, void 0, function () {
159
- var jobToCreate, repeatOpts, existingJobs, existingJob;
160
+ var jobToCreate, baseJobOptions, existingJobs, existingJob;
160
161
  return __generator(this, function (_b) {
161
162
  switch (_b.label) {
162
163
  case 0:
@@ -166,9 +167,20 @@ var JobSchedulerService = /** @class */ (function () {
166
167
  eventName: eventName,
167
168
  data: data,
168
169
  };
169
- repeatOpts = { repeat: { pattern: schedule } };
170
+ baseJobOptions = {
171
+ repeat: { pattern: schedule },
172
+ removeOnComplete: {
173
+ // keep completed jobs not older than 24 hours
174
+ age: 60 * 60 * 24,
175
+ },
176
+ removeOnFail: {
177
+ // keep failed jobs not older than 1 week and not more than 5000
178
+ count: 5000,
179
+ age: 60 * 60 * 24 * 7,
180
+ },
181
+ };
170
182
  if (!(options === null || options === void 0 ? void 0 : options.keepExisting)) return [3 /*break*/, 2];
171
- return [4 /*yield*/, this.queue_.add(eventName, jobToCreate, repeatOpts)];
183
+ return [4 /*yield*/, this.queue_.add(eventName, jobToCreate, baseJobOptions)];
172
184
  case 1: return [2 /*return*/, _b.sent()];
173
185
  case 2: return [4 /*yield*/, this.queue_.getRepeatableJobs()];
174
186
  case 3:
@@ -179,7 +191,7 @@ var JobSchedulerService = /** @class */ (function () {
179
191
  case 4:
180
192
  _b.sent();
181
193
  _b.label = 5;
182
- case 5: return [4 /*yield*/, this.queue_.add(eventName, jobToCreate, repeatOpts)];
194
+ case 5: return [4 /*yield*/, this.queue_.add(eventName, jobToCreate, baseJobOptions)];
183
195
  case 6: return [2 /*return*/, _b.sent()];
184
196
  }
185
197
  });
@@ -1 +1 @@
1
- {"version":3,"file":"job-scheduler.js","sourceRoot":"","sources":["../../src/services/job-scheduler.ts"],"names":[],"mappings":";;;;;;;;;;;;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P,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAA,EAArB,wBAAqB;wBAChB,qBAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,cAAc,CAAC,EAAA;4BAApE,sBAAO,SAA6D,EAAA;4BAGhD,qBAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,EAAA;;wBAArD,YAAY,GAAG,MAAA,CAAC,SAAqC,CAAC,mCAAI,EAAE;wBAE5D,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,KAAK,SAAS,EAAtB,CAAsB,CAAC,CAAA;6BAElE,WAAW,EAAX,wBAAW;wBACb,qBAAM,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,WAAW,CAAC,GAAG,CAAC,EAAA;;wBAAxD,SAAwD,CAAA;;4BAGnD,qBAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,cAAc,CAAC,EAAA;4BAApE,sBAAO,SAA6D,EAAA;;;;KACrE;IACH,0BAAC;AAAD,CAAC,AAvID,IAuIC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/medusa",
3
- "version": "1.20.7",
3
+ "version": "1.20.8",
4
4
  "description": "Building blocks for digital commerce",
5
5
  "main": "dist/index.js",
6
6
  "bin": "./cli.js",
@@ -22,7 +22,7 @@
22
22
  "author": "Sebastian Rindom",
23
23
  "license": "MIT",
24
24
  "devDependencies": {
25
- "@medusajs/types": "^1.11.16",
25
+ "@medusajs/types": "^1.11.17",
26
26
  "@swc/core": "^1.4.8",
27
27
  "@swc/jest": "^0.2.36",
28
28
  "@types/express": "^4.17.17",
@@ -33,8 +33,8 @@
33
33
  "@types/papaparse": "^5.3.7",
34
34
  "cross-env": "^5.2.1",
35
35
  "jest": "^25.5.4",
36
- "medusa-interfaces": "^1.3.9",
37
- "medusa-test-utils": "^1.1.44",
36
+ "medusa-interfaces": "^1.3.10",
37
+ "medusa-test-utils": "^1.1.45",
38
38
  "rimraf": "^5.0.1",
39
39
  "supertest": "^4.0.2",
40
40
  "ts-jest": "^25.5.1",
@@ -53,13 +53,13 @@
53
53
  "typeorm": "^0.3.16"
54
54
  },
55
55
  "dependencies": {
56
- "@medusajs/core-flows": "^0.0.9",
57
- "@medusajs/link-modules": "^0.2.11",
58
- "@medusajs/medusa-cli": "^1.3.22",
59
- "@medusajs/modules-sdk": "^1.12.11",
60
- "@medusajs/orchestration": "^0.5.7",
61
- "@medusajs/utils": "^1.11.9",
62
- "@medusajs/workflows-sdk": "^0.1.7",
56
+ "@medusajs/core-flows": "^0.0.10",
57
+ "@medusajs/link-modules": "^0.2.12",
58
+ "@medusajs/medusa-cli": "^1.3.23",
59
+ "@medusajs/modules-sdk": "^1.12.12",
60
+ "@medusajs/orchestration": "^0.5.8",
61
+ "@medusajs/utils": "^1.11.10",
62
+ "@medusajs/workflows-sdk": "^0.1.8",
63
63
  "awilix": "^8.0.0",
64
64
  "body-parser": "^1.19.0",
65
65
  "boxen": "^5.0.1",
@@ -83,8 +83,8 @@
83
83
  "iso8601-duration": "^1.3.0",
84
84
  "jsonwebtoken": "^9.0.0",
85
85
  "lodash": "^4.17.21",
86
- "medusa-core-utils": "^1.2.2",
87
- "medusa-telemetry": "^0.0.17",
86
+ "medusa-core-utils": "^1.2.3",
87
+ "medusa-telemetry": "^0.0.18",
88
88
  "morgan": "^1.9.1",
89
89
  "multer": "^1.4.5-lts.1",
90
90
  "node-schedule": "^2.1.1",