@medusajs/stock-location
Advanced tools
Comparing version 1.11.4 to 1.11.5-next-20240207092132
@@ -17,2 +17,3 @@ "use strict"; | ||
const utils_1 = require("@medusajs/utils"); | ||
const typeorm_1 = require("typeorm"); | ||
const joiner_config_1 = require("../joiner-config"); | ||
@@ -41,6 +42,4 @@ const models_1 = require("../models"); | ||
async list(selector = {}, config = { relations: [], skip: 0, take: 10 }, context = {}) { | ||
const manager = context.transactionManager ?? this.manager_; | ||
const locationRepo = manager.getRepository(models_1.StockLocation); | ||
const query = (0, build_query_1.buildQuery)(selector, config); | ||
return await locationRepo.find(query); | ||
const [locations] = await this.listAndCount(selector, config, context); | ||
return locations; | ||
} | ||
@@ -57,3 +56,18 @@ /** | ||
const locationRepo = manager.getRepository(models_1.StockLocation); | ||
let q; | ||
if (selector.q) { | ||
q = selector.q; | ||
delete selector.q; | ||
} | ||
const query = (0, build_query_1.buildQuery)(selector, config); | ||
if (q) { | ||
const where = query.where; | ||
delete where.name; | ||
query.where = [ | ||
{ | ||
...where, | ||
name: (0, typeorm_1.ILike)(`%${q}%`), | ||
}, | ||
]; | ||
} | ||
return await locationRepo.findAndCount(query); | ||
@@ -198,2 +212,20 @@ } | ||
__decorate([ | ||
__param(2, (0, utils_1.MedusaContext)()), | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", [Object, Object, Object]), | ||
__metadata("design:returntype", Promise) | ||
], StockLocationService.prototype, "list", null); | ||
__decorate([ | ||
__param(2, (0, utils_1.MedusaContext)()), | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", [Object, Object, Object]), | ||
__metadata("design:returntype", Promise) | ||
], StockLocationService.prototype, "listAndCount", null); | ||
__decorate([ | ||
__param(2, (0, utils_1.MedusaContext)()), | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", [String, Object, Object]), | ||
__metadata("design:returntype", Promise) | ||
], StockLocationService.prototype, "retrieve", null); | ||
__decorate([ | ||
(0, utils_1.InjectEntityManager)((target) => target.moduleDeclaration?.resources === types_1.MODULE_RESOURCE_TYPE.ISOLATED), | ||
@@ -200,0 +232,0 @@ __param(1, (0, utils_1.MedusaContext)()), |
{ | ||
"name": "@medusajs/stock-location", | ||
"version": "1.11.4", | ||
"version": "1.11.5-next-20240207092132", | ||
"description": "Stock Location Module for Medusa", | ||
@@ -23,3 +23,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@medusajs/types": "^1.11.11", | ||
"@medusajs/types": "1.11.12-next-20240207092132", | ||
"cross-env": "^5.2.1", | ||
@@ -32,4 +32,4 @@ "jest": "^29.6.3", | ||
"dependencies": { | ||
"@medusajs/modules-sdk": "^1.12.7", | ||
"@medusajs/utils": "^1.11.4", | ||
"@medusajs/modules-sdk": "1.12.8-next-20240207092132", | ||
"@medusajs/utils": "1.11.5-next-20240207092132", | ||
"awilix": "^8.0.0", | ||
@@ -36,0 +36,0 @@ "typeorm": "^0.3.16" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62268
1039
2
+ Added@medusajs/modules-sdk@1.12.8-next-20240207092132(transitive)
+ Added@medusajs/orchestration@0.5.4-next-20240207092132(transitive)
+ Added@medusajs/types@1.11.12-next-20240207092132(transitive)
+ Added@medusajs/utils@1.11.5-next-20240207092132(transitive)
- Removed@medusajs/modules-sdk@1.12.12(transitive)
- Removed@medusajs/orchestration@0.5.8(transitive)
- Removed@medusajs/types@1.11.17(transitive)
- Removed@medusajs/utils@1.11.10(transitive)
- Removedbignumber.js@9.1.2(transitive)