@medusajs/store 0.1.2-preview-20240510084332 → 0.1.2-preview-20240514174418
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -8
- package/dist/joiner-config.js +1 -1
- package/dist/module-definition.js +0 -50
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
@@ -2,7 +2,4 @@ import { moduleDefinition } from "./module-definition";
|
|
2
2
|
export * from "./types";
|
3
3
|
export * from "./models";
|
4
4
|
export * from "./services";
|
5
|
-
export declare const initialize: (options?: import("@medusajs/modules-sdk").InternalModuleDeclaration | import("@medusajs/modules-sdk").ModuleServiceInitializeOptions | import("@medusajs/modules-sdk").ModuleServiceInitializeCustomDataLayerOptions | import("@medusajs/modules-sdk").ExternalModuleDeclaration | undefined, injectedDependencies?: any) => Promise<unknown>;
|
6
|
-
export declare const runMigrations: ((options: import("@medusajs/modules-sdk").LoaderOptions<any>, moduleDeclaration?: import("@medusajs/modules-sdk").InternalModuleDeclaration | undefined) => Promise<void>) | undefined;
|
7
|
-
export declare const revertMigration: ((options: import("@medusajs/modules-sdk").LoaderOptions<any>, moduleDeclaration?: import("@medusajs/modules-sdk").InternalModuleDeclaration | undefined) => Promise<void>) | undefined;
|
8
5
|
export default moduleDefinition;
|
package/dist/index.js
CHANGED
@@ -14,16 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
exports.revertMigration = exports.runMigrations = exports.initialize = void 0;
|
18
17
|
const module_definition_1 = require("./module-definition");
|
19
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
20
18
|
__exportStar(require("./types"), exports);
|
21
19
|
__exportStar(require("./models"), exports);
|
22
20
|
__exportStar(require("./services"), exports);
|
23
|
-
exports.initialize = (0, modules_sdk_1.initializeFactory)({
|
24
|
-
moduleName: modules_sdk_1.Modules.STORE,
|
25
|
-
moduleDefinition: module_definition_1.moduleDefinition,
|
26
|
-
});
|
27
|
-
exports.runMigrations = module_definition_1.moduleDefinition.runMigrations;
|
28
|
-
exports.revertMigration = module_definition_1.moduleDefinition.revertMigration;
|
29
21
|
exports.default = module_definition_1.moduleDefinition;
|
package/dist/joiner-config.js
CHANGED
@@ -9,7 +9,7 @@ const store_1 = __importDefault(require("./models/store"));
|
|
9
9
|
exports.LinkableKeys = {};
|
10
10
|
const entityLinkableKeysMap = {};
|
11
11
|
Object.entries(exports.LinkableKeys).forEach(([key, value]) => {
|
12
|
-
entityLinkableKeysMap[value]
|
12
|
+
entityLinkableKeysMap[value] ??= [];
|
13
13
|
entityLinkableKeysMap[value].push({
|
14
14
|
mapTo: key,
|
15
15
|
valueFrom: key.split("_").pop(),
|
@@ -1,58 +1,8 @@
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
3
|
exports.moduleDefinition = void 0;
|
27
|
-
const ModuleServices = __importStar(require("./services"));
|
28
4
|
const _services_1 = require("./services");
|
29
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
30
|
-
const Models = __importStar(require("./models"));
|
31
|
-
const ModuleModels = __importStar(require("./models"));
|
32
|
-
const utils_1 = require("@medusajs/utils");
|
33
|
-
const ModuleRepositories = __importStar(require("./repositories"));
|
34
|
-
const migrationScriptOptions = {
|
35
|
-
moduleName: modules_sdk_1.Modules.STORE,
|
36
|
-
models: Models,
|
37
|
-
pathToMigrations: __dirname + "/migrations",
|
38
|
-
};
|
39
|
-
const runMigrations = utils_1.ModulesSdkUtils.buildMigrationScript(migrationScriptOptions);
|
40
|
-
const revertMigration = utils_1.ModulesSdkUtils.buildRevertMigrationScript(migrationScriptOptions);
|
41
|
-
const containerLoader = utils_1.ModulesSdkUtils.moduleContainerLoaderFactory({
|
42
|
-
moduleModels: ModuleModels,
|
43
|
-
moduleRepositories: ModuleRepositories,
|
44
|
-
moduleServices: ModuleServices,
|
45
|
-
});
|
46
|
-
const connectionLoader = utils_1.ModulesSdkUtils.mikroOrmConnectionLoaderFactory({
|
47
|
-
moduleName: modules_sdk_1.Modules.STORE,
|
48
|
-
moduleModels: Object.values(Models),
|
49
|
-
migrationsPath: __dirname + "/migrations",
|
50
|
-
});
|
51
5
|
const service = _services_1.StoreModuleService;
|
52
|
-
const loaders = [containerLoader, connectionLoader];
|
53
6
|
exports.moduleDefinition = {
|
54
7
|
service,
|
55
|
-
loaders,
|
56
|
-
revertMigration,
|
57
|
-
runMigrations,
|
58
8
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/store",
|
3
|
-
"version": "0.1.2-preview-
|
3
|
+
"version": "0.1.2-preview-20240514174418",
|
4
4
|
"description": "Medusa Store module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -48,9 +48,9 @@
|
|
48
48
|
"typescript": "^5.1.6"
|
49
49
|
},
|
50
50
|
"dependencies": {
|
51
|
-
"@medusajs/modules-sdk": "1.
|
52
|
-
"@medusajs/types": "1.
|
53
|
-
"@medusajs/utils": "1.
|
51
|
+
"@medusajs/modules-sdk": "1.13.0-preview-20240514174418",
|
52
|
+
"@medusajs/types": "1.12.0-preview-20240514174418",
|
53
|
+
"@medusajs/utils": "1.12.0-preview-20240514174418",
|
54
54
|
"@mikro-orm/core": "5.9.7",
|
55
55
|
"@mikro-orm/migrations": "5.9.7",
|
56
56
|
"@mikro-orm/postgresql": "5.9.7",
|