@medusajs/store 2.12.2-snapshot-20251207121122 → 2.12.2-snapshot-20251207203158
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/models/currency.d.ts +0 -12
- package/dist/models/currency.d.ts.map +1 -1
- package/dist/models/index.d.ts +0 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +1 -3
- package/dist/models/index.js.map +1 -1
- package/dist/models/store.d.ts +0 -6
- package/dist/models/store.d.ts.map +1 -1
- package/dist/models/store.js +1 -5
- package/dist/models/store.js.map +1 -1
- package/dist/services/store-module-service.d.ts +0 -4
- package/dist/services/store-module-service.d.ts.map +1 -1
- package/dist/services/store-module-service.js +18 -25
- package/dist/services/store-module-service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/migrations/Migration20251202184737.d.ts +0 -6
- package/dist/migrations/Migration20251202184737.d.ts.map +0 -1
- package/dist/migrations/Migration20251202184737.js +0 -17
- package/dist/migrations/Migration20251202184737.js.map +0 -1
- package/dist/models/locale.d.ts +0 -36
- package/dist/models/locale.d.ts.map +0 -1
- package/dist/models/locale.js +0 -19
- package/dist/models/locale.js.map +0 -1
|
@@ -10,12 +10,6 @@ declare const StoreCurrency: import("@medusajs/framework/utils").DmlEntity<impor
|
|
|
10
10
|
default_location_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
11
11
|
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
12
12
|
supported_currencies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "StoreCurrency">>;
|
|
13
|
-
supported_locales: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
14
|
-
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
15
|
-
locale_code: import("@medusajs/framework/utils").TextProperty;
|
|
16
|
-
is_default: import("@medusajs/framework/utils").BooleanProperty;
|
|
17
|
-
store: import("@medusajs/framework/utils").RelationNullableModifier<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, undefined>, true>;
|
|
18
|
-
}>, "StoreLocale">>;
|
|
19
13
|
}>, "Store">, import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
20
14
|
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
21
15
|
name: import("@medusajs/framework/utils").TextProperty;
|
|
@@ -24,12 +18,6 @@ declare const StoreCurrency: import("@medusajs/framework/utils").DmlEntity<impor
|
|
|
24
18
|
default_location_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
25
19
|
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
26
20
|
supported_currencies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "StoreCurrency">>;
|
|
27
|
-
supported_locales: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
28
|
-
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
29
|
-
locale_code: import("@medusajs/framework/utils").TextProperty;
|
|
30
|
-
is_default: import("@medusajs/framework/utils").BooleanProperty;
|
|
31
|
-
store: import("@medusajs/framework/utils").RelationNullableModifier<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, undefined>, true>;
|
|
32
|
-
}>, "StoreLocale">>;
|
|
33
21
|
}>, "Store">, undefined>, true>;
|
|
34
22
|
}>, "StoreCurrency">;
|
|
35
23
|
export default StoreCurrency;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../src/models/currency.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../src/models/currency.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;oBASjB,CAAA;AAEF,eAAe,aAAa,CAAA"}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/models/index.js
CHANGED
|
@@ -3,11 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.StoreCurrency = exports.Store = void 0;
|
|
7
7
|
var store_1 = require("./store");
|
|
8
8
|
Object.defineProperty(exports, "Store", { enumerable: true, get: function () { return __importDefault(store_1).default; } });
|
|
9
9
|
var currency_1 = require("./currency");
|
|
10
10
|
Object.defineProperty(exports, "StoreCurrency", { enumerable: true, get: function () { return __importDefault(currency_1).default; } });
|
|
11
|
-
var locale_1 = require("./locale");
|
|
12
|
-
Object.defineProperty(exports, "StoreLocale", { enumerable: true, get: function () { return __importDefault(locale_1).default; } });
|
|
13
11
|
//# sourceMappingURL=index.js.map
|
package/dist/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;AAAA,iCAA0C;AAAjC,+GAAA,OAAO,OAAS;AACzB,uCAAqD;AAA5C,0HAAA,OAAO,OAAiB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;AAAA,iCAA0C;AAAjC,+GAAA,OAAO,OAAS;AACzB,uCAAqD;AAA5C,0HAAA,OAAO,OAAiB"}
|
package/dist/models/store.d.ts
CHANGED
|
@@ -11,12 +11,6 @@ declare const Store: import("@medusajs/framework/utils").DmlEntity<import("@medu
|
|
|
11
11
|
is_default: import("@medusajs/framework/utils").BooleanProperty;
|
|
12
12
|
store: import("@medusajs/framework/utils").RelationNullableModifier<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, undefined>, true>;
|
|
13
13
|
}>, "StoreCurrency">>;
|
|
14
|
-
supported_locales: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
15
|
-
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
16
|
-
locale_code: import("@medusajs/framework/utils").TextProperty;
|
|
17
|
-
is_default: import("@medusajs/framework/utils").BooleanProperty;
|
|
18
|
-
store: import("@medusajs/framework/utils").RelationNullableModifier<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, undefined>, true>;
|
|
19
|
-
}>, "StoreLocale">>;
|
|
20
14
|
}>, "Store">;
|
|
21
15
|
export default Store;
|
|
22
16
|
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/models/store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/models/store.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,KAAK;;;;;;;;;;;;;YAcP,CAAA;AAEJ,eAAe,KAAK,CAAA"}
|
package/dist/models/store.js
CHANGED
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const utils_1 = require("@medusajs/framework/utils");
|
|
7
7
|
const currency_1 = __importDefault(require("./currency"));
|
|
8
|
-
const locale_1 = __importDefault(require("./locale"));
|
|
9
8
|
const Store = utils_1.model
|
|
10
9
|
.define("Store", {
|
|
11
10
|
id: utils_1.model.id({ prefix: "store" }).primaryKey(),
|
|
@@ -17,12 +16,9 @@ const Store = utils_1.model
|
|
|
17
16
|
supported_currencies: utils_1.model.hasMany(() => currency_1.default, {
|
|
18
17
|
mappedBy: "store",
|
|
19
18
|
}),
|
|
20
|
-
supported_locales: utils_1.model.hasMany(() => locale_1.default, {
|
|
21
|
-
mappedBy: "store",
|
|
22
|
-
}),
|
|
23
19
|
})
|
|
24
20
|
.cascades({
|
|
25
|
-
delete: ["supported_currencies"
|
|
21
|
+
delete: ["supported_currencies"],
|
|
26
22
|
});
|
|
27
23
|
exports.default = Store;
|
|
28
24
|
//# sourceMappingURL=store.js.map
|
package/dist/models/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/models/store.ts"],"names":[],"mappings":";;;;;AAAA,qDAAiD;AACjD,0DAAsC;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/models/store.ts"],"names":[],"mappings":";;;;;AAAA,qDAAiD;AACjD,0DAAsC;AAEtC,MAAM,KAAK,GAAG,aAAK;KAChB,MAAM,CAAC,OAAO,EAAE;IACf,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE;IAC9C,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,UAAU,EAAE;IACvD,wBAAwB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACjD,iBAAiB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC1C,mBAAmB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACjC,oBAAoB,EAAE,aAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,kBAAa,EAAE;QACvD,QAAQ,EAAE,OAAO;KAClB,CAAC;CACH,CAAC;KACD,QAAQ,CAAC;IACR,MAAM,EAAE,CAAC,sBAAsB,CAAC;CACjC,CAAC,CAAA;AAEJ,kBAAe,KAAK,CAAA"}
|
|
@@ -12,9 +12,6 @@ declare const StoreModuleService_base: import("@medusajs/framework/utils").Medus
|
|
|
12
12
|
StoreCurrency: {
|
|
13
13
|
dto: StoreTypes.StoreCurrencyDTO;
|
|
14
14
|
};
|
|
15
|
-
StoreLocale: {
|
|
16
|
-
dto: StoreTypes.StoreLocaleDTO;
|
|
17
|
-
};
|
|
18
15
|
}>;
|
|
19
16
|
export default class StoreModuleService extends StoreModuleService_base implements IStoreModuleService {
|
|
20
17
|
protected readonly moduleDeclaration: InternalModuleDeclaration;
|
|
@@ -32,7 +29,6 @@ export default class StoreModuleService extends StoreModuleService_base implemen
|
|
|
32
29
|
protected update_(data: UpdateStoreInput[], sharedContext?: Context): Promise<InferEntityType<typeof Store>[]>;
|
|
33
30
|
private static normalizeInput;
|
|
34
31
|
private static validateCreateRequest;
|
|
35
|
-
private static validateSupportedItems;
|
|
36
32
|
private static validateUpdateRequest;
|
|
37
33
|
}
|
|
38
34
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-module-service.d.ts","sourceRoot":"","sources":["../../src/services/store-module-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,GAAG,EACH,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,UAAU,EACX,MAAM,2BAA2B,CAAA;AAclC,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"store-module-service.d.ts","sourceRoot":"","sources":["../../src/services/store-module-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,GAAG,EACH,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,UAAU,EACX,MAAM,2BAA2B,CAAA;AAclC,OAAO,EAAE,KAAK,EAAiB,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,M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,cAAc,EAC/B,aAAa,CAAC,EAAE,OAAO,GACtB,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;cAgBf,aAAa,CAC3B,IAAI,EAAE,UAAU,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,EAAE,EAC5C,aAAa,GAAE,OAAY,GAC3C,OAAO,CAAC,eAAe,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;IAwBrC,YAAY,CAChB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,UAAU,CAAC,cAAc,EAC/B,aAAa,CAAC,EAAE,OAAO,GACtB,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;IAEzB,YAAY,CAChB,QAAQ,EAAE,UAAU,CAAC,oBAAoB,EACzC,IAAI,EAAE,UAAU,CAAC,cAAc,EAC/B,aAAa,CAAC,EAAE,OAAO,GACtB,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;cAoCjB,OAAO,CACrB,IAAI,EAAE,gBAAgB,EAAE,EACP,aAAa,GAAE,OAAY,GAC3C,OAAO,CAAC,eAAe,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;IAa3C,OAAO,CAAC,MAAM,CAAC,cAAc;IAe7B,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAuCpC,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAGrC"}
|
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const types_1 = require("@medusajs/framework/types");
|
|
16
16
|
const utils_1 = require("@medusajs/framework/utils");
|
|
17
17
|
const _models_1 = require("../models");
|
|
18
|
-
class StoreModuleService extends (0, utils_1.MedusaService)({ Store: _models_1.Store, StoreCurrency: _models_1.StoreCurrency
|
|
18
|
+
class StoreModuleService extends (0, utils_1.MedusaService)({ Store: _models_1.Store, StoreCurrency: _models_1.StoreCurrency }) {
|
|
19
19
|
constructor({ baseRepository, storeService }, moduleDeclaration) {
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
super(...arguments);
|
|
@@ -32,7 +32,7 @@ class StoreModuleService extends (0, utils_1.MedusaService)({ Store: _models_1.S
|
|
|
32
32
|
async create_(data, sharedContext = {}) {
|
|
33
33
|
let normalizedInput = StoreModuleService.normalizeInput(data);
|
|
34
34
|
StoreModuleService.validateCreateRequest(normalizedInput);
|
|
35
|
-
return (await this.storeService_.upsertWithReplace(normalizedInput, { relations: ["supported_currencies"
|
|
35
|
+
return (await this.storeService_.upsertWithReplace(normalizedInput, { relations: ["supported_currencies"] }, sharedContext)).entities;
|
|
36
36
|
}
|
|
37
37
|
async upsertStores(data, sharedContext = {}) {
|
|
38
38
|
const result = await this.upsertStores_(data, sharedContext);
|
|
@@ -72,7 +72,7 @@ class StoreModuleService extends (0, utils_1.MedusaService)({ Store: _models_1.S
|
|
|
72
72
|
async update_(data, sharedContext = {}) {
|
|
73
73
|
const normalizedInput = StoreModuleService.normalizeInput(data);
|
|
74
74
|
StoreModuleService.validateUpdateRequest(normalizedInput);
|
|
75
|
-
return (await this.storeService_.upsertWithReplace(normalizedInput, { relations: ["supported_currencies"
|
|
75
|
+
return (await this.storeService_.upsertWithReplace(normalizedInput, { relations: ["supported_currencies"] }, sharedContext)).entities;
|
|
76
76
|
}
|
|
77
77
|
static normalizeInput(stores) {
|
|
78
78
|
return stores.map((store) => (0, utils_1.removeUndefined)({
|
|
@@ -87,30 +87,23 @@ class StoreModuleService extends (0, utils_1.MedusaService)({ Store: _models_1.S
|
|
|
87
87
|
static validateCreateRequest(stores) {
|
|
88
88
|
for (const store of stores) {
|
|
89
89
|
if (store.supported_currencies?.length) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (item.is_default) {
|
|
106
|
-
if (seenDefault) {
|
|
107
|
-
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Only one default ${typeName} is allowed`);
|
|
90
|
+
const duplicates = (0, utils_1.getDuplicates)(store.supported_currencies?.map((c) => c.currency_code));
|
|
91
|
+
if (duplicates.length) {
|
|
92
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Duplicate currency codes: ${duplicates.join(", ")}`);
|
|
93
|
+
}
|
|
94
|
+
let seenDefault = false;
|
|
95
|
+
store.supported_currencies?.forEach((c) => {
|
|
96
|
+
if (c.is_default) {
|
|
97
|
+
if (seenDefault) {
|
|
98
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Only one default currency is allowed`);
|
|
99
|
+
}
|
|
100
|
+
seenDefault = true;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
if (!seenDefault) {
|
|
104
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `There should be a default currency set for the store`);
|
|
108
105
|
}
|
|
109
|
-
seenDefault = true;
|
|
110
106
|
}
|
|
111
|
-
});
|
|
112
|
-
if (!seenDefault) {
|
|
113
|
-
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `There should be a default ${typeName} set for the store`);
|
|
114
107
|
}
|
|
115
108
|
}
|
|
116
109
|
static validateUpdateRequest(stores) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-module-service.js","sourceRoot":"","sources":["../../src/services/store-module-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qDAQkC;AAClC,qDAWkC;AAElC,
|
|
1
|
+
{"version":3,"file":"store-module-service.js","sourceRoot":"","sources":["../../src/services/store-module-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qDAQkC;AAClC,qDAWkC;AAElC,qCAA8C;AAQ9C,MAAqB,kBACnB,SAAQ,IAAA,qBAAa,EAGlB,EAAE,KAAK,EAAL,eAAK,EAAE,aAAa,EAAb,uBAAa,EAA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YACH,CAAC;QACH,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,qBAAqB,CAAC,MAA0B;QAC7D,kBAAkB,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAA;IAClD,CAAC;CACF;AA3OD,qCA2OC;AAvMO;IAHL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IACb,mBAAmB;;IAGhB,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;sDASjB;AAGK;IADL,IAAA,gCAAwB,GAAE;IAGxB,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;iDAYjB;AAaK;IAFL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IAGV,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;sDAOjB;AAGe;IADf,IAAA,gCAAwB,GAAE;IAGxB,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;uDAsBjB;AAkBK;IAHL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IACb,mBAAmB;;IAIhB,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;sDAyBjB;AAGe;IADf,IAAA,gCAAwB,GAAE;IAGxB,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;iDAYjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/migrations/initialsetup20240227075933.ts","../src/migrations/migration20240621145944.ts","../src/migrations/migration20241206083313.ts","../src/
|
|
1
|
+
{"root":["../src/index.ts","../src/migrations/initialsetup20240227075933.ts","../src/migrations/migration20240621145944.ts","../src/migrations/migration20241206083313.ts","../src/models/currency.ts","../src/models/index.ts","../src/models/store.ts","../src/services/index.ts","../src/services/store-module-service.ts","../src/services/__tests__/noop.ts","../src/types/index.ts"],"version":"5.9.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/store",
|
|
3
|
-
"version": "2.12.2-snapshot-
|
|
3
|
+
"version": "2.12.2-snapshot-20251207203158",
|
|
4
4
|
"description": "Medusa Store module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true medusa-mikro-orm cache:clear"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@medusajs/framework": "2.12.2-snapshot-
|
|
40
|
-
"@medusajs/test-utils": "2.12.2-snapshot-
|
|
39
|
+
"@medusajs/framework": "2.12.2-snapshot-20251207203158",
|
|
40
|
+
"@medusajs/test-utils": "2.12.2-snapshot-20251207203158"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@medusajs/framework": "2.12.2-snapshot-
|
|
43
|
+
"@medusajs/framework": "2.12.2-snapshot-20251207203158"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Migration20251202184737.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20251202184737.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,uBAAwB,SAAQ,SAAS;IAErC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAQnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAIrC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Migration20251202184737 = void 0;
|
|
4
|
-
const migrations_1 = require("@mikro-orm/migrations");
|
|
5
|
-
class Migration20251202184737 extends migrations_1.Migration {
|
|
6
|
-
async up() {
|
|
7
|
-
this.addSql(`create table if not exists "store_locale" ("id" text not null, "locale_code" text not null, "is_default" boolean not null default false, "store_id" text null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "store_locale_pkey" primary key ("id"));`);
|
|
8
|
-
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_store_locale_store_id" ON "store_locale" ("store_id") WHERE deleted_at IS NULL;`);
|
|
9
|
-
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_store_locale_deleted_at" ON "store_locale" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
10
|
-
this.addSql(`alter table if exists "store_locale" add constraint "store_locale_store_id_foreign" foreign key ("store_id") references "store" ("id") on update cascade on delete cascade;`);
|
|
11
|
-
}
|
|
12
|
-
async down() {
|
|
13
|
-
this.addSql(`drop table if exists "store_locale" cascade;`);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.Migration20251202184737 = Migration20251202184737;
|
|
17
|
-
//# sourceMappingURL=Migration20251202184737.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Migration20251202184737.js","sourceRoot":"","sources":["../../src/migrations/Migration20251202184737.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAElD,MAAa,uBAAwB,SAAQ,sBAAS;IAE3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,qVAAqV,CAAC,CAAC;QACnW,IAAI,CAAC,MAAM,CAAC,iHAAiH,CAAC,CAAC;QAC/H,IAAI,CAAC,MAAM,CAAC,qHAAqH,CAAC,CAAC;QAEnI,IAAI,CAAC,MAAM,CAAC,6KAA6K,CAAC,CAAC;IAC7L,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,8CAA8C,CAAC,CAAC;IAC9D,CAAC;CAEF;AAdD,0DAcC"}
|
package/dist/models/locale.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
declare const StoreLocale: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
-
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
-
locale_code: import("@medusajs/framework/utils").TextProperty;
|
|
4
|
-
is_default: import("@medusajs/framework/utils").BooleanProperty;
|
|
5
|
-
store: import("@medusajs/framework/utils").RelationNullableModifier<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
6
|
-
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
7
|
-
name: import("@medusajs/framework/utils").TextProperty;
|
|
8
|
-
default_sales_channel_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
9
|
-
default_region_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
10
|
-
default_location_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
11
|
-
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
12
|
-
supported_currencies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
13
|
-
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
14
|
-
currency_code: import("@medusajs/framework/utils").TextProperty;
|
|
15
|
-
is_default: import("@medusajs/framework/utils").BooleanProperty;
|
|
16
|
-
store: import("@medusajs/framework/utils").RelationNullableModifier<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, undefined>, true>;
|
|
17
|
-
}>, "StoreCurrency">>;
|
|
18
|
-
supported_locales: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "StoreLocale">>;
|
|
19
|
-
}>, "Store">, import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
20
|
-
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
21
|
-
name: import("@medusajs/framework/utils").TextProperty;
|
|
22
|
-
default_sales_channel_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
23
|
-
default_region_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
24
|
-
default_location_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
25
|
-
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
26
|
-
supported_currencies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
27
|
-
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
28
|
-
currency_code: import("@medusajs/framework/utils").TextProperty;
|
|
29
|
-
is_default: import("@medusajs/framework/utils").BooleanProperty;
|
|
30
|
-
store: import("@medusajs/framework/utils").RelationNullableModifier<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "Store">, undefined>, true>;
|
|
31
|
-
}>, "StoreCurrency">>;
|
|
32
|
-
supported_locales: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "StoreLocale">>;
|
|
33
|
-
}>, "Store">, undefined>, true>;
|
|
34
|
-
}>, "StoreLocale">;
|
|
35
|
-
export default StoreLocale;
|
|
36
|
-
//# sourceMappingURL=locale.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBASf,CAAA;AAEF,eAAe,WAAW,CAAA"}
|
package/dist/models/locale.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const utils_1 = require("@medusajs/framework/utils");
|
|
7
|
-
const store_1 = __importDefault(require("./store"));
|
|
8
|
-
const StoreLocale = utils_1.model.define("StoreLocale", {
|
|
9
|
-
id: utils_1.model.id({ prefix: "stloc" }).primaryKey(),
|
|
10
|
-
locale_code: utils_1.model.text().searchable(),
|
|
11
|
-
is_default: utils_1.model.boolean().default(false),
|
|
12
|
-
store: utils_1.model
|
|
13
|
-
.belongsTo(() => store_1.default, {
|
|
14
|
-
mappedBy: "supported_locales",
|
|
15
|
-
})
|
|
16
|
-
.nullable(),
|
|
17
|
-
});
|
|
18
|
-
exports.default = StoreLocale;
|
|
19
|
-
//# sourceMappingURL=locale.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":";;;;;AAAA,qDAAiD;AACjD,oDAA2B;AAE3B,MAAM,WAAW,GAAG,aAAK,CAAC,MAAM,CAAC,aAAa,EAAE;IAC9C,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE;IAC9C,WAAW,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACtC,UAAU,EAAE,aAAK,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC1C,KAAK,EAAE,aAAK;SACT,SAAS,CAAC,GAAG,EAAE,CAAC,eAAK,EAAE;QACtB,QAAQ,EAAE,mBAAmB;KAC9B,CAAC;SACD,QAAQ,EAAE;CACd,CAAC,CAAA;AAEF,kBAAe,WAAW,CAAA"}
|