@medusajs/stock-location
Advanced tools
Comparing version 1.11.4 to 1.11.5-snapshot-20240130203408
@@ -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-snapshot-20240130203408", | ||
"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-snapshot-20240130203408", | ||
"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-snapshot-20240130203408", | ||
"@medusajs/utils": "1.11.5-snapshot-20240130203408", | ||
"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
62284
1039
2
+ Added@fastify/accept-negotiator@1.1.0(transitive)
+ Added@fastify/ajv-compiler@3.6.0(transitive)
+ Added@fastify/compress@7.0.3(transitive)
+ Added@fastify/error@3.4.1(transitive)
+ Added@fastify/fast-json-stringify-compiler@4.3.0(transitive)
+ Added@fastify/merge-json-schemas@0.1.1(transitive)
+ Added@grpc/grpc-js@1.11.2(transitive)
+ Added@grpc/proto-loader@0.7.13(transitive)
+ Added@js-sdsl/ordered-map@4.4.2(transitive)
+ Added@medusajs/modules-sdk@1.12.8-snapshot-20240130203408(transitive)
+ Added@medusajs/orchestration@0.5.4-snapshot-20240130203408(transitive)
+ Added@medusajs/types@1.11.12-snapshot-20240130203408(transitive)
+ Added@medusajs/utils@1.11.5-snapshot-20240130203408(transitive)
+ Added@protobufjs/aspromise@1.1.2(transitive)
+ Added@protobufjs/base64@1.1.2(transitive)
+ Added@protobufjs/codegen@2.0.4(transitive)
+ Added@protobufjs/eventemitter@1.1.0(transitive)
+ Added@protobufjs/fetch@1.1.0(transitive)
+ Added@protobufjs/float@1.0.2(transitive)
+ Added@protobufjs/inquire@1.1.0(transitive)
+ Added@protobufjs/path@1.1.2(transitive)
+ Added@protobufjs/pool@1.1.0(transitive)
+ Added@protobufjs/utf8@1.1.0(transitive)
+ Added@rushstack/node-core-library@5.7.0(transitive)
+ Added@rushstack/terminal@0.14.0(transitive)
+ Added@rushstack/ts-command-line@4.22.6(transitive)
+ Added@types/node@22.5.4(transitive)
+ Addedabort-controller@3.0.0(transitive)
+ Addedabstract-logging@2.0.1(transitive)
+ Addedajv@8.17.1(transitive)
+ Addedajv-formats@2.1.1(transitive)
+ Addedansi-regex@6.0.1(transitive)
+ Addedatomic-sleep@1.0.0(transitive)
+ Addedavvio@8.4.0(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcookie@0.6.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddset@3.1.3(transitive)
+ Addedduplexify@3.7.14.1.3(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedfast-content-type-parse@1.1.0(transitive)
+ Addedfast-decode-uri-component@1.0.1(transitive)
+ Addedfast-json-stringify@5.16.1(transitive)
+ Addedfast-querystring@1.1.2(transitive)
+ Addedfast-redact@3.5.0(transitive)
+ Addedfast-uri@2.4.03.0.1(transitive)
+ Addedfastify@4.28.1(transitive)
+ Addedfastify-plugin@4.5.1(transitive)
+ Addedfind-my-way@8.2.0(transitive)
+ Addedforwarded@0.2.0(transitive)
+ Addedipaddr.js@1.9.1(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedjson-schema-ref-resolver@1.0.1(transitive)
+ Addedlight-my-request@5.13.0(transitive)
+ Addedlodash.camelcase@4.3.0(transitive)
+ Addedlong@5.2.3(transitive)
+ Addedmime-db@1.53.0(transitive)
+ Addedon-exit-leak-free@2.1.2(transitive)
+ Addedpeek-stream@1.1.3(transitive)
+ Addedpino@9.4.0(transitive)
+ Addedpino-abstract-transport@1.2.0(transitive)
+ Addedpino-std-serializers@7.0.0(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedprocess-warning@3.0.04.0.0(transitive)
+ Addedprotobufjs@7.4.0(transitive)
+ Addedproxy-addr@2.0.7(transitive)
+ Addedpump@3.0.0(transitive)
+ Addedpumpify@2.0.1(transitive)
+ Addedquick-format-unescaped@4.0.4(transitive)
+ Addedreadable-stream@2.3.83.6.24.5.2(transitive)
+ Addedreal-require@0.2.0(transitive)
+ Addedret@0.4.3(transitive)
+ Addedrfdc@1.4.1(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafe-regex2@3.1.0(transitive)
+ Addedsafe-stable-stringify@2.5.0(transitive)
+ Addedsecure-json-parse@2.7.0(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedset-cookie-parser@2.7.0(transitive)
+ Addedsonic-boom@4.1.0(transitive)
+ Addedstream-shift@1.0.3(transitive)
+ Addedstring_decoder@1.1.11.3.0(transitive)
+ Addedthread-stream@3.1.0(transitive)
+ Addedthrough2@2.0.5(transitive)
+ Addedtoad-cache@3.7.0(transitive)
+ Addedundici@6.19.8(transitive)
+ Addedundici-types@6.19.8(transitive)
+ Addedutil-deprecate@1.0.2(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)
- Removed@rushstack/node-core-library@5.8.0(transitive)
- Removed@rushstack/terminal@0.14.1(transitive)
- Removed@rushstack/ts-command-line@4.22.7(transitive)
- Removedansi-regex@6.1.0(transitive)
- Removedbignumber.js@9.1.2(transitive)
- Removeddset@3.1.4(transitive)