@medusajs/inventory 1.9.0 → 1.9.1-beta-20230619165231
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -2
- package/dist/index.js +5 -36
- package/dist/index.js.map +1 -1
- package/dist/initialize/index.js +2 -1
- package/dist/initialize/index.js.map +1 -1
- package/dist/module-definition.d.ts +2 -0
- package/dist/module-definition.js +47 -0
- package/dist/module-definition.js.map +1 -0
- package/dist/services/inventory-item.d.ts +17 -9
- package/dist/services/inventory-item.js +22 -35
- package/dist/services/inventory-item.js.map +1 -1
- package/dist/services/inventory-level.d.ts +12 -0
- package/dist/services/inventory-level.js +18 -48
- package/dist/services/inventory-level.js.map +1 -1
- package/dist/services/inventory.d.ts +27 -4
- package/dist/services/inventory.js +27 -67
- package/dist/services/inventory.js.map +1 -1
- package/dist/services/reservation-item.d.ts +9 -1
- package/dist/services/reservation-item.js +17 -27
- package/dist/services/reservation-item.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const moduleDefinition: ModuleExports;
|
|
1
|
+
import { moduleDefinition } from "./module-definition";
|
|
3
2
|
export default moduleDefinition;
|
|
4
3
|
export * from "./initialize";
|
|
5
4
|
export { revertMigration, runMigrations } from "./migrations/run-migration";
|
package/dist/index.js
CHANGED
|
@@ -10,47 +10,16 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
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
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
15
|
};
|
|
28
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
17
|
exports.runMigrations = exports.revertMigration = void 0;
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const migrations_1 = __importDefault(require("./migrations"));
|
|
36
|
-
const run_migration_1 = require("./migrations/run-migration");
|
|
37
|
-
const InventoryModels = __importStar(require("./models"));
|
|
38
|
-
const inventory_1 = __importDefault(require("./services/inventory"));
|
|
39
|
-
const service = inventory_1.default;
|
|
40
|
-
const loaders = [container_1.default, connection_1.default];
|
|
41
|
-
const models = Object.values(InventoryModels);
|
|
42
|
-
const moduleDefinition = {
|
|
43
|
-
service,
|
|
44
|
-
migrations: migrations_1.default,
|
|
45
|
-
loaders,
|
|
46
|
-
models,
|
|
47
|
-
runMigrations: run_migration_1.runMigrations,
|
|
48
|
-
revertMigration: run_migration_1.revertMigration,
|
|
49
|
-
};
|
|
50
|
-
exports.default = moduleDefinition;
|
|
18
|
+
const module_definition_1 = require("./module-definition");
|
|
19
|
+
exports.default = module_definition_1.moduleDefinition;
|
|
51
20
|
__exportStar(require("./initialize"), exports);
|
|
52
|
-
var
|
|
53
|
-
Object.defineProperty(exports, "revertMigration", { enumerable: true, get: function () { return
|
|
54
|
-
Object.defineProperty(exports, "runMigrations", { enumerable: true, get: function () { return
|
|
21
|
+
var run_migration_1 = require("./migrations/run-migration");
|
|
22
|
+
Object.defineProperty(exports, "revertMigration", { enumerable: true, get: function () { return run_migration_1.revertMigration; } });
|
|
23
|
+
Object.defineProperty(exports, "runMigrations", { enumerable: true, get: function () { return run_migration_1.runMigrations; } });
|
|
55
24
|
__exportStar(require("./types"), exports);
|
|
56
25
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,2DAAsD;AAEtD,kBAAe,oCAAgB,CAAA;AAE/B,+CAA4B;AAC5B,4DAA2E;AAAlE,gHAAA,eAAe,OAAA;AAAE,8GAAA,aAAa,OAAA;AACvC,0CAAuB"}
|
package/dist/initialize/index.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initialize = void 0;
|
|
4
4
|
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
|
5
|
+
const module_definition_1 = require("../module-definition");
|
|
5
6
|
const initialize = async (options, injectedDependencies) => {
|
|
6
7
|
const serviceKey = modules_sdk_1.Modules.INVENTORY;
|
|
7
|
-
const loaded = await modules_sdk_1.MedusaModule.bootstrap(serviceKey, "@medusajs/inventory", options, injectedDependencies);
|
|
8
|
+
const loaded = await modules_sdk_1.MedusaModule.bootstrap(serviceKey, "@medusajs/inventory", options, module_definition_1.moduleDefinition, injectedDependencies);
|
|
8
9
|
return loaded[serviceKey];
|
|
9
10
|
};
|
|
10
11
|
exports.initialize = initialize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":";;;AAAA,uDAK8B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":";;;AAAA,uDAK8B;AAE9B,4DAAuD;AAGhD,MAAM,UAAU,GAAG,KAAK,EAC7B,OAAsE,EACtE,oBAEC,EAC2B,EAAE;IAC9B,MAAM,UAAU,GAAG,qBAAO,CAAC,SAAS,CAAA;IACpC,MAAM,MAAM,GAAG,MAAM,0BAAY,CAAC,SAAS,CACzC,UAAU,EACV,qBAAqB,EACrB,OAAgE,EAChE,oCAAgB,EAChB,oBAAoB,CACrB,CAAA;IAED,OAAO,MAAM,CAAC,UAAU,CAAsB,CAAA;AAChD,CAAC,CAAA;AAhBY,QAAA,UAAU,cAgBtB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.moduleDefinition = void 0;
|
|
30
|
+
const inventory_1 = __importDefault(require("./services/inventory"));
|
|
31
|
+
const container_1 = __importDefault(require("./loaders/container"));
|
|
32
|
+
const connection_1 = __importDefault(require("./loaders/connection"));
|
|
33
|
+
const InventoryModels = __importStar(require("./models"));
|
|
34
|
+
const migrations_1 = __importDefault(require("./migrations"));
|
|
35
|
+
const run_migration_1 = require("./migrations/run-migration");
|
|
36
|
+
const service = inventory_1.default;
|
|
37
|
+
const loaders = [container_1.default, connection_1.default];
|
|
38
|
+
const models = Object.values(InventoryModels);
|
|
39
|
+
exports.moduleDefinition = {
|
|
40
|
+
service,
|
|
41
|
+
migrations: migrations_1.default,
|
|
42
|
+
loaders,
|
|
43
|
+
models,
|
|
44
|
+
runMigrations: run_migration_1.runMigrations,
|
|
45
|
+
revertMigration: run_migration_1.revertMigration,
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=module-definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-definition.js","sourceRoot":"","sources":["../src/module-definition.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAmD;AACnD,oEAA+C;AAC/C,sEAAiD;AACjD,0DAA2C;AAE3C,8DAAqC;AACrC,8DAA2E;AAE3E,MAAM,OAAO,GAAG,mBAAgB,CAAA;AAChC,MAAM,OAAO,GAAG,CAAC,mBAAa,EAAE,oBAAc,CAAC,CAAA;AAC/C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAEhC,QAAA,gBAAgB,GAAkB;IAC7C,OAAO;IACP,UAAU,EAAV,oBAAU;IACV,OAAO;IACP,MAAM;IACN,aAAa,EAAb,6BAAa;IACb,eAAe,EAAf,+BAAe;CAChB,CAAA"}
|
|
@@ -17,36 +17,44 @@ export default class InventoryItemService {
|
|
|
17
17
|
/**
|
|
18
18
|
* @param selector - Filter options for inventory items.
|
|
19
19
|
* @param config - Configuration for query.
|
|
20
|
+
* @param context
|
|
20
21
|
* @return Resolves to the list of inventory items that match the filter.
|
|
21
22
|
*/
|
|
22
23
|
list(selector?: FilterableInventoryItemProps, config?: FindConfig<InventoryItem>, context?: SharedContext): Promise<InventoryItemDTO[]>;
|
|
23
|
-
/**
|
|
24
|
-
* @param selector - Filter options for inventory items.
|
|
25
|
-
* @param config - Configuration for query.
|
|
26
|
-
* @return - Resolves to the list of inventory items that match the filter and the count of all matching items.
|
|
27
|
-
*/
|
|
28
|
-
listAndCount(selector?: FilterableInventoryItemProps, config?: FindConfig<InventoryItem>, context?: SharedContext): Promise<[InventoryItemDTO[], number]>;
|
|
29
24
|
/**
|
|
30
25
|
* Retrieves an inventory item by its id.
|
|
31
26
|
* @param inventoryItemId - the id of the inventory item to retrieve.
|
|
32
27
|
* @param config - the configuration options for the find operation.
|
|
28
|
+
* @param context
|
|
33
29
|
* @return The retrieved inventory item.
|
|
34
30
|
* @throws If the inventory item id is not defined or if the inventory item is not found.
|
|
35
31
|
*/
|
|
36
32
|
retrieve(inventoryItemId: string, config?: FindConfig<InventoryItem>, context?: SharedContext): Promise<InventoryItem>;
|
|
37
33
|
/**
|
|
38
|
-
* @param
|
|
39
|
-
* @
|
|
34
|
+
* @param selector - Filter options for inventory items.
|
|
35
|
+
* @param config - Configuration for query.
|
|
36
|
+
* @param context
|
|
37
|
+
* @return - Resolves to the list of inventory items that match the filter and the count of all matching items.
|
|
38
|
+
*/
|
|
39
|
+
listAndCount(selector?: FilterableInventoryItemProps, config?: FindConfig<InventoryItem>, context?: SharedContext): Promise<[InventoryItemDTO[], number]>;
|
|
40
|
+
/**
|
|
41
|
+
* @param data
|
|
42
|
+
* @param context
|
|
43
|
+
* @param data
|
|
44
|
+
* @param context
|
|
40
45
|
*/
|
|
41
46
|
create(data: CreateInventoryItemInput, context?: SharedContext): Promise<InventoryItem>;
|
|
42
47
|
/**
|
|
43
48
|
* @param inventoryItemId - The id of the inventory item to update.
|
|
44
|
-
* @param
|
|
49
|
+
* @param data
|
|
50
|
+
* @param context
|
|
51
|
+
* @param context
|
|
45
52
|
* @return The updated inventory item.
|
|
46
53
|
*/
|
|
47
54
|
update(inventoryItemId: string, data: Omit<DeepPartial<InventoryItem>, "id" | "created_at" | "metadata" | "deleted_at">, context?: SharedContext): Promise<InventoryItem>;
|
|
48
55
|
/**
|
|
49
56
|
* @param inventoryItemId - The id of the inventory item to delete.
|
|
57
|
+
* @param context
|
|
50
58
|
*/
|
|
51
59
|
delete(inventoryItemId: string, context?: SharedContext): Promise<void>;
|
|
52
60
|
}
|
|
@@ -24,25 +24,18 @@ class InventoryItemService {
|
|
|
24
24
|
/**
|
|
25
25
|
* @param selector - Filter options for inventory items.
|
|
26
26
|
* @param config - Configuration for query.
|
|
27
|
+
* @param context
|
|
27
28
|
* @return Resolves to the list of inventory items that match the filter.
|
|
28
29
|
*/
|
|
29
30
|
async list(selector = {}, config = { relations: [], skip: 0, take: 10 }, context = {}) {
|
|
30
|
-
const queryBuilder = (0, query_1.getListQuery)(context.transactionManager, selector, config);
|
|
31
|
+
const queryBuilder = (0, query_1.getListQuery)(context.transactionManager ?? this.manager_, selector, config);
|
|
31
32
|
return await queryBuilder.getMany();
|
|
32
33
|
}
|
|
33
|
-
/**
|
|
34
|
-
* @param selector - Filter options for inventory items.
|
|
35
|
-
* @param config - Configuration for query.
|
|
36
|
-
* @return - Resolves to the list of inventory items that match the filter and the count of all matching items.
|
|
37
|
-
*/
|
|
38
|
-
async listAndCount(selector = {}, config = { relations: [], skip: 0, take: 10 }, context = {}) {
|
|
39
|
-
const queryBuilder = (0, query_1.getListQuery)(context.transactionManager, selector, config);
|
|
40
|
-
return await queryBuilder.getManyAndCount();
|
|
41
|
-
}
|
|
42
34
|
/**
|
|
43
35
|
* Retrieves an inventory item by its id.
|
|
44
36
|
* @param inventoryItemId - the id of the inventory item to retrieve.
|
|
45
37
|
* @param config - the configuration options for the find operation.
|
|
38
|
+
* @param context
|
|
46
39
|
* @return The retrieved inventory item.
|
|
47
40
|
* @throws If the inventory item id is not defined or if the inventory item is not found.
|
|
48
41
|
*/
|
|
@@ -50,7 +43,7 @@ class InventoryItemService {
|
|
|
50
43
|
if (!(0, utils_1.isDefined)(inventoryItemId)) {
|
|
51
44
|
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_FOUND, `"inventoryItemId" must be defined`);
|
|
52
45
|
}
|
|
53
|
-
const manager = context.transactionManager;
|
|
46
|
+
const manager = context.transactionManager ?? this.manager_;
|
|
54
47
|
const itemRepository = manager.getRepository(models_1.InventoryItem);
|
|
55
48
|
const query = (0, build_query_1.buildQuery)({ id: inventoryItemId }, config);
|
|
56
49
|
const [inventoryItem] = await itemRepository.find(query);
|
|
@@ -60,8 +53,20 @@ class InventoryItemService {
|
|
|
60
53
|
return inventoryItem;
|
|
61
54
|
}
|
|
62
55
|
/**
|
|
63
|
-
* @param
|
|
64
|
-
* @
|
|
56
|
+
* @param selector - Filter options for inventory items.
|
|
57
|
+
* @param config - Configuration for query.
|
|
58
|
+
* @param context
|
|
59
|
+
* @return - Resolves to the list of inventory items that match the filter and the count of all matching items.
|
|
60
|
+
*/
|
|
61
|
+
async listAndCount(selector = {}, config = { relations: [], skip: 0, take: 10 }, context = {}) {
|
|
62
|
+
const queryBuilder = (0, query_1.getListQuery)(context.transactionManager ?? this.manager_, selector, config);
|
|
63
|
+
return await queryBuilder.getManyAndCount();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @param data
|
|
67
|
+
* @param context
|
|
68
|
+
* @param data
|
|
69
|
+
* @param context
|
|
65
70
|
*/
|
|
66
71
|
async create(data, context = {}) {
|
|
67
72
|
const manager = context.transactionManager;
|
|
@@ -90,7 +95,9 @@ class InventoryItemService {
|
|
|
90
95
|
}
|
|
91
96
|
/**
|
|
92
97
|
* @param inventoryItemId - The id of the inventory item to update.
|
|
93
|
-
* @param
|
|
98
|
+
* @param data
|
|
99
|
+
* @param context
|
|
100
|
+
* @param context
|
|
94
101
|
* @return The updated inventory item.
|
|
95
102
|
*/
|
|
96
103
|
async update(inventoryItemId, data, context = {}) {
|
|
@@ -111,6 +118,7 @@ class InventoryItemService {
|
|
|
111
118
|
}
|
|
112
119
|
/**
|
|
113
120
|
* @param inventoryItemId - The id of the inventory item to delete.
|
|
121
|
+
* @param context
|
|
114
122
|
*/
|
|
115
123
|
async delete(inventoryItemId, context = {}) {
|
|
116
124
|
const manager = context.transactionManager;
|
|
@@ -126,27 +134,6 @@ InventoryItemService.Events = {
|
|
|
126
134
|
UPDATED: "inventory-item.updated",
|
|
127
135
|
DELETED: "inventory-item.deleted",
|
|
128
136
|
};
|
|
129
|
-
__decorate([
|
|
130
|
-
(0, utils_1.InjectEntityManager)(),
|
|
131
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
132
|
-
__metadata("design:type", Function),
|
|
133
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
134
|
-
__metadata("design:returntype", Promise)
|
|
135
|
-
], InventoryItemService.prototype, "list", null);
|
|
136
|
-
__decorate([
|
|
137
|
-
(0, utils_1.InjectEntityManager)(),
|
|
138
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
139
|
-
__metadata("design:type", Function),
|
|
140
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
141
|
-
__metadata("design:returntype", Promise)
|
|
142
|
-
], InventoryItemService.prototype, "listAndCount", null);
|
|
143
|
-
__decorate([
|
|
144
|
-
(0, utils_1.InjectEntityManager)(),
|
|
145
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
146
|
-
__metadata("design:type", Function),
|
|
147
|
-
__metadata("design:paramtypes", [String, Object, Object]),
|
|
148
|
-
__metadata("design:returntype", Promise)
|
|
149
|
-
], InventoryItemService.prototype, "retrieve", null);
|
|
150
137
|
__decorate([
|
|
151
138
|
(0, utils_1.InjectEntityManager)(),
|
|
152
139
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inventory-item.js","sourceRoot":"","sources":["../../src/services/inventory-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAQA,2CAKwB;AAExB,sCAAyC;AACzC,0CAA6C;AAC7C,sDAAiD;AAOjD,MAAqB,oBAAoB;IAUvC,YAAY,EAAE,eAAe,EAAE,OAAO,EAAwB;QAC5D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAA;IACzC,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"inventory-item.js","sourceRoot":"","sources":["../../src/services/inventory-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAQA,2CAKwB;AAExB,sCAAyC;AACzC,0CAA6C;AAC7C,sDAAiD;AAOjD,MAAqB,oBAAoB;IAUvC,YAAY,EAAE,eAAe,EAAE,OAAO,EAAwB;QAC5D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAA;IACzC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,WAAyC,EAAE,EAC3C,SAAoC,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EACxE,UAAyB,EAAE;QAE3B,MAAM,YAAY,GAAG,IAAA,oBAAY,EAC/B,OAAO,CAAC,kBAAkB,IAAI,IAAI,CAAC,QAAQ,EAC3C,QAAQ,EACR,MAAM,CACP,CAAA;QACD,OAAO,MAAM,YAAY,CAAC,OAAO,EAAE,CAAA;IACrC,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,Q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A;;;;kDAUjB;AAxLH,uCAyLC"}
|
|
@@ -18,6 +18,7 @@ export default class InventoryLevelService {
|
|
|
18
18
|
* Retrieves a list of inventory levels based on the provided selector and configuration.
|
|
19
19
|
* @param selector - An object containing filterable properties for inventory levels.
|
|
20
20
|
* @param config - An object containing configuration options for the query.
|
|
21
|
+
* @param context
|
|
21
22
|
* @return Array of inventory levels.
|
|
22
23
|
*/
|
|
23
24
|
list(selector?: FilterableInventoryLevelProps, config?: FindConfig<InventoryLevel>, context?: SharedContext): Promise<InventoryLevel[]>;
|
|
@@ -25,6 +26,7 @@ export default class InventoryLevelService {
|
|
|
25
26
|
* Retrieves a list of inventory levels and a count based on the provided selector and configuration.
|
|
26
27
|
* @param selector - An object containing filterable properties for inventory levels.
|
|
27
28
|
* @param config - An object containing configuration options for the query.
|
|
29
|
+
* @param context
|
|
28
30
|
* @return An array of inventory levels and a count.
|
|
29
31
|
*/
|
|
30
32
|
listAndCount(selector?: FilterableInventoryLevelProps, config?: FindConfig<InventoryLevel>, context?: SharedContext): Promise<[InventoryLevel[], number]>;
|
|
@@ -32,6 +34,7 @@ export default class InventoryLevelService {
|
|
|
32
34
|
* Retrieves a single inventory level by its ID.
|
|
33
35
|
* @param inventoryLevelId - The ID of the inventory level to retrieve.
|
|
34
36
|
* @param config - An object containing configuration options for the query.
|
|
37
|
+
* @param context
|
|
35
38
|
* @return A inventory level.
|
|
36
39
|
* @throws If the inventory level ID is not defined or the given ID was not found.
|
|
37
40
|
*/
|
|
@@ -39,6 +42,7 @@ export default class InventoryLevelService {
|
|
|
39
42
|
/**
|
|
40
43
|
* Creates a new inventory level.
|
|
41
44
|
* @param data - An object containing the properties for the new inventory level.
|
|
45
|
+
* @param context
|
|
42
46
|
* @return The created inventory level.
|
|
43
47
|
*/
|
|
44
48
|
create(data: CreateInventoryLevelInput, context?: SharedContext): Promise<InventoryLevel>;
|
|
@@ -46,6 +50,7 @@ export default class InventoryLevelService {
|
|
|
46
50
|
* Updates an existing inventory level.
|
|
47
51
|
* @param inventoryLevelId - The ID of the inventory level to update.
|
|
48
52
|
* @param data - An object containing the properties to update on the inventory level.
|
|
53
|
+
* @param context
|
|
49
54
|
* @return The updated inventory level.
|
|
50
55
|
* @throws If the inventory level ID is not defined or the given ID was not found.
|
|
51
56
|
*/
|
|
@@ -55,27 +60,32 @@ export default class InventoryLevelService {
|
|
|
55
60
|
* @param inventoryItemId - The ID of the inventory item.
|
|
56
61
|
* @param locationId - The ID of the location.
|
|
57
62
|
* @param quantity - The quantity to adjust from the reserved quantity.
|
|
63
|
+
* @param context
|
|
58
64
|
*/
|
|
59
65
|
adjustReservedQuantity(inventoryItemId: string, locationId: string, quantity: number, context?: SharedContext): Promise<void>;
|
|
60
66
|
/**
|
|
61
67
|
* Deletes inventory levels by inventory Item ID.
|
|
62
68
|
* @param inventoryItemId - The ID or IDs of the inventory item to delete inventory levels for.
|
|
69
|
+
* @param context
|
|
63
70
|
*/
|
|
64
71
|
deleteByInventoryItemId(inventoryItemId: string | string[], context?: SharedContext): Promise<void>;
|
|
65
72
|
/**
|
|
66
73
|
* Deletes an inventory level by ID.
|
|
67
74
|
* @param inventoryLevelId - The ID or IDs of the inventory level to delete.
|
|
75
|
+
* @param context
|
|
68
76
|
*/
|
|
69
77
|
delete(inventoryLevelId: string | string[], context?: SharedContext): Promise<void>;
|
|
70
78
|
/**
|
|
71
79
|
* Deletes inventory levels by location ID.
|
|
72
80
|
* @param locationId - The ID of the location to delete inventory levels for.
|
|
81
|
+
* @param context
|
|
73
82
|
*/
|
|
74
83
|
deleteByLocationId(locationId: string, context?: SharedContext): Promise<void>;
|
|
75
84
|
/**
|
|
76
85
|
* Gets the total stocked quantity for a specific inventory item at multiple locations.
|
|
77
86
|
* @param inventoryItemId - The ID of the inventory item.
|
|
78
87
|
* @param locationIds - The IDs of the locations.
|
|
88
|
+
* @param context
|
|
79
89
|
* @return The total stocked quantity.
|
|
80
90
|
*/
|
|
81
91
|
getStockedQuantity(inventoryItemId: string, locationIds: string[] | string, context?: SharedContext): Promise<number>;
|
|
@@ -83,6 +93,7 @@ export default class InventoryLevelService {
|
|
|
83
93
|
* Gets the total available quantity for a specific inventory item at multiple locations.
|
|
84
94
|
* @param inventoryItemId - The ID of the inventory item.
|
|
85
95
|
* @param locationIds - The IDs of the locations.
|
|
96
|
+
* @param context
|
|
86
97
|
* @return The total available quantity.
|
|
87
98
|
*/
|
|
88
99
|
getAvailableQuantity(inventoryItemId: string, locationIds: string[] | string, context?: SharedContext): Promise<number>;
|
|
@@ -90,6 +101,7 @@ export default class InventoryLevelService {
|
|
|
90
101
|
* Gets the total reserved quantity for a specific inventory item at multiple locations.
|
|
91
102
|
* @param inventoryItemId - The ID of the inventory item.
|
|
92
103
|
* @param locationIds - The IDs of the locations.
|
|
104
|
+
* @param context
|
|
93
105
|
* @return The total reserved quantity.
|
|
94
106
|
*/
|
|
95
107
|
getReservedQuantity(inventoryItemId: string, locationIds: string[] | string, context?: SharedContext): Promise<number>;
|
|
@@ -25,10 +25,11 @@ class InventoryLevelService {
|
|
|
25
25
|
* Retrieves a list of inventory levels based on the provided selector and configuration.
|
|
26
26
|
* @param selector - An object containing filterable properties for inventory levels.
|
|
27
27
|
* @param config - An object containing configuration options for the query.
|
|
28
|
+
* @param context
|
|
28
29
|
* @return Array of inventory levels.
|
|
29
30
|
*/
|
|
30
31
|
async list(selector = {}, config = { relations: [], skip: 0, take: 10 }, context = {}) {
|
|
31
|
-
const manager = context.transactionManager;
|
|
32
|
+
const manager = context.transactionManager ?? this.manager_;
|
|
32
33
|
const levelRepository = manager.getRepository(models_1.InventoryLevel);
|
|
33
34
|
const query = (0, build_query_1.buildQuery)(selector, config);
|
|
34
35
|
return await levelRepository.find(query);
|
|
@@ -37,10 +38,11 @@ class InventoryLevelService {
|
|
|
37
38
|
* Retrieves a list of inventory levels and a count based on the provided selector and configuration.
|
|
38
39
|
* @param selector - An object containing filterable properties for inventory levels.
|
|
39
40
|
* @param config - An object containing configuration options for the query.
|
|
41
|
+
* @param context
|
|
40
42
|
* @return An array of inventory levels and a count.
|
|
41
43
|
*/
|
|
42
44
|
async listAndCount(selector = {}, config = { relations: [], skip: 0, take: 10 }, context = {}) {
|
|
43
|
-
const manager = context.transactionManager;
|
|
45
|
+
const manager = context.transactionManager ?? this.manager_;
|
|
44
46
|
const levelRepository = manager.getRepository(models_1.InventoryLevel);
|
|
45
47
|
const query = (0, build_query_1.buildQuery)(selector, config);
|
|
46
48
|
return await levelRepository.findAndCount(query);
|
|
@@ -49,6 +51,7 @@ class InventoryLevelService {
|
|
|
49
51
|
* Retrieves a single inventory level by its ID.
|
|
50
52
|
* @param inventoryLevelId - The ID of the inventory level to retrieve.
|
|
51
53
|
* @param config - An object containing configuration options for the query.
|
|
54
|
+
* @param context
|
|
52
55
|
* @return A inventory level.
|
|
53
56
|
* @throws If the inventory level ID is not defined or the given ID was not found.
|
|
54
57
|
*/
|
|
@@ -56,7 +59,7 @@ class InventoryLevelService {
|
|
|
56
59
|
if (!(0, utils_1.isDefined)(inventoryLevelId)) {
|
|
57
60
|
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_FOUND, `"inventoryLevelId" must be defined`);
|
|
58
61
|
}
|
|
59
|
-
const manager = context.transactionManager;
|
|
62
|
+
const manager = context.transactionManager ?? this.manager_;
|
|
60
63
|
const levelRepository = manager.getRepository(models_1.InventoryLevel);
|
|
61
64
|
const query = (0, build_query_1.buildQuery)({ id: inventoryLevelId }, config);
|
|
62
65
|
const [inventoryLevel] = await levelRepository.find(query);
|
|
@@ -68,6 +71,7 @@ class InventoryLevelService {
|
|
|
68
71
|
/**
|
|
69
72
|
* Creates a new inventory level.
|
|
70
73
|
* @param data - An object containing the properties for the new inventory level.
|
|
74
|
+
* @param context
|
|
71
75
|
* @return The created inventory level.
|
|
72
76
|
*/
|
|
73
77
|
async create(data, context = {}) {
|
|
@@ -90,6 +94,7 @@ class InventoryLevelService {
|
|
|
90
94
|
* Updates an existing inventory level.
|
|
91
95
|
* @param inventoryLevelId - The ID of the inventory level to update.
|
|
92
96
|
* @param data - An object containing the properties to update on the inventory level.
|
|
97
|
+
* @param context
|
|
93
98
|
* @return The updated inventory level.
|
|
94
99
|
* @throws If the inventory level ID is not defined or the given ID was not found.
|
|
95
100
|
*/
|
|
@@ -114,6 +119,7 @@ class InventoryLevelService {
|
|
|
114
119
|
* @param inventoryItemId - The ID of the inventory item.
|
|
115
120
|
* @param locationId - The ID of the location.
|
|
116
121
|
* @param quantity - The quantity to adjust from the reserved quantity.
|
|
122
|
+
* @param context
|
|
117
123
|
*/
|
|
118
124
|
async adjustReservedQuantity(inventoryItemId, locationId, quantity, context = {}) {
|
|
119
125
|
const manager = context.transactionManager;
|
|
@@ -127,6 +133,7 @@ class InventoryLevelService {
|
|
|
127
133
|
/**
|
|
128
134
|
* Deletes inventory levels by inventory Item ID.
|
|
129
135
|
* @param inventoryItemId - The ID or IDs of the inventory item to delete inventory levels for.
|
|
136
|
+
* @param context
|
|
130
137
|
*/
|
|
131
138
|
async deleteByInventoryItemId(inventoryItemId, context = {}) {
|
|
132
139
|
const ids = Array.isArray(inventoryItemId)
|
|
@@ -142,6 +149,7 @@ class InventoryLevelService {
|
|
|
142
149
|
/**
|
|
143
150
|
* Deletes an inventory level by ID.
|
|
144
151
|
* @param inventoryLevelId - The ID or IDs of the inventory level to delete.
|
|
152
|
+
* @param context
|
|
145
153
|
*/
|
|
146
154
|
async delete(inventoryLevelId, context = {}) {
|
|
147
155
|
const ids = Array.isArray(inventoryLevelId)
|
|
@@ -157,6 +165,7 @@ class InventoryLevelService {
|
|
|
157
165
|
/**
|
|
158
166
|
* Deletes inventory levels by location ID.
|
|
159
167
|
* @param locationId - The ID of the location to delete inventory levels for.
|
|
168
|
+
* @param context
|
|
160
169
|
*/
|
|
161
170
|
async deleteByLocationId(locationId, context = {}) {
|
|
162
171
|
const manager = context.transactionManager;
|
|
@@ -170,13 +179,14 @@ class InventoryLevelService {
|
|
|
170
179
|
* Gets the total stocked quantity for a specific inventory item at multiple locations.
|
|
171
180
|
* @param inventoryItemId - The ID of the inventory item.
|
|
172
181
|
* @param locationIds - The IDs of the locations.
|
|
182
|
+
* @param context
|
|
173
183
|
* @return The total stocked quantity.
|
|
174
184
|
*/
|
|
175
185
|
async getStockedQuantity(inventoryItemId, locationIds, context = {}) {
|
|
176
186
|
if (!Array.isArray(locationIds)) {
|
|
177
187
|
locationIds = [locationIds];
|
|
178
188
|
}
|
|
179
|
-
const manager = context.transactionManager;
|
|
189
|
+
const manager = context.transactionManager ?? this.manager_;
|
|
180
190
|
const levelRepository = manager.getRepository(models_1.InventoryLevel);
|
|
181
191
|
const result = await levelRepository
|
|
182
192
|
.createQueryBuilder()
|
|
@@ -190,13 +200,14 @@ class InventoryLevelService {
|
|
|
190
200
|
* Gets the total available quantity for a specific inventory item at multiple locations.
|
|
191
201
|
* @param inventoryItemId - The ID of the inventory item.
|
|
192
202
|
* @param locationIds - The IDs of the locations.
|
|
203
|
+
* @param context
|
|
193
204
|
* @return The total available quantity.
|
|
194
205
|
*/
|
|
195
206
|
async getAvailableQuantity(inventoryItemId, locationIds, context = {}) {
|
|
196
207
|
if (!Array.isArray(locationIds)) {
|
|
197
208
|
locationIds = [locationIds];
|
|
198
209
|
}
|
|
199
|
-
const manager = context.transactionManager;
|
|
210
|
+
const manager = context.transactionManager ?? this.manager_;
|
|
200
211
|
const levelRepository = manager.getRepository(models_1.InventoryLevel);
|
|
201
212
|
const result = await levelRepository
|
|
202
213
|
.createQueryBuilder()
|
|
@@ -210,13 +221,14 @@ class InventoryLevelService {
|
|
|
210
221
|
* Gets the total reserved quantity for a specific inventory item at multiple locations.
|
|
211
222
|
* @param inventoryItemId - The ID of the inventory item.
|
|
212
223
|
* @param locationIds - The IDs of the locations.
|
|
224
|
+
* @param context
|
|
213
225
|
* @return The total reserved quantity.
|
|
214
226
|
*/
|
|
215
227
|
async getReservedQuantity(inventoryItemId, locationIds, context = {}) {
|
|
216
228
|
if (!Array.isArray(locationIds)) {
|
|
217
229
|
locationIds = [locationIds];
|
|
218
230
|
}
|
|
219
|
-
const manager = context.transactionManager;
|
|
231
|
+
const manager = context.transactionManager ?? this.manager_;
|
|
220
232
|
const levelRepository = manager.getRepository(models_1.InventoryLevel);
|
|
221
233
|
const result = await levelRepository
|
|
222
234
|
.createQueryBuilder()
|
|
@@ -232,27 +244,6 @@ InventoryLevelService.Events = {
|
|
|
232
244
|
UPDATED: "inventory-level.updated",
|
|
233
245
|
DELETED: "inventory-level.deleted",
|
|
234
246
|
};
|
|
235
|
-
__decorate([
|
|
236
|
-
(0, utils_1.InjectEntityManager)(),
|
|
237
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
238
|
-
__metadata("design:type", Function),
|
|
239
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
240
|
-
__metadata("design:returntype", Promise)
|
|
241
|
-
], InventoryLevelService.prototype, "list", null);
|
|
242
|
-
__decorate([
|
|
243
|
-
(0, utils_1.InjectEntityManager)(),
|
|
244
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
245
|
-
__metadata("design:type", Function),
|
|
246
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
247
|
-
__metadata("design:returntype", Promise)
|
|
248
|
-
], InventoryLevelService.prototype, "listAndCount", null);
|
|
249
|
-
__decorate([
|
|
250
|
-
(0, utils_1.InjectEntityManager)(),
|
|
251
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
252
|
-
__metadata("design:type", Function),
|
|
253
|
-
__metadata("design:paramtypes", [String, Object, Object]),
|
|
254
|
-
__metadata("design:returntype", Promise)
|
|
255
|
-
], InventoryLevelService.prototype, "retrieve", null);
|
|
256
247
|
__decorate([
|
|
257
248
|
(0, utils_1.InjectEntityManager)(),
|
|
258
249
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
@@ -295,26 +286,5 @@ __decorate([
|
|
|
295
286
|
__metadata("design:paramtypes", [String, Object]),
|
|
296
287
|
__metadata("design:returntype", Promise)
|
|
297
288
|
], InventoryLevelService.prototype, "deleteByLocationId", null);
|
|
298
|
-
__decorate([
|
|
299
|
-
(0, utils_1.InjectEntityManager)(),
|
|
300
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
301
|
-
__metadata("design:type", Function),
|
|
302
|
-
__metadata("design:paramtypes", [String, Object, Object]),
|
|
303
|
-
__metadata("design:returntype", Promise)
|
|
304
|
-
], InventoryLevelService.prototype, "getStockedQuantity", null);
|
|
305
|
-
__decorate([
|
|
306
|
-
(0, utils_1.InjectEntityManager)(),
|
|
307
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
308
|
-
__metadata("design:type", Function),
|
|
309
|
-
__metadata("design:paramtypes", [String, Object, Object]),
|
|
310
|
-
__metadata("design:returntype", Promise)
|
|
311
|
-
], InventoryLevelService.prototype, "getAvailableQuantity", null);
|
|
312
|
-
__decorate([
|
|
313
|
-
(0, utils_1.InjectEntityManager)(),
|
|
314
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
315
|
-
__metadata("design:type", Function),
|
|
316
|
-
__metadata("design:paramtypes", [String, Object, Object]),
|
|
317
|
-
__metadata("design:returntype", Promise)
|
|
318
|
-
], InventoryLevelService.prototype, "getReservedQuantity", null);
|
|
319
289
|
exports.default = InventoryLevelService;
|
|
320
290
|
//# sourceMappingURL=inventory-level.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inventory-level.js","sourceRoot":"","sources":["../../src/services/inventory-level.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAOA,2CAKwB;AACxB,qCAAyE;AACzE,sCAA0C;AAC1C,sDAAiD;AAOjD,MAAqB,qBAAqB;IAUxC,YAAY,EAAE,eAAe,EAAE,OAAO,EAAwB;QAC5D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAA;IACzC,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"inventory-level.js","sourceRoot":"","sources":["../../src/services/inventory-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