@medusajs/promotion 0.0.5-preview-20240510084332 → 0.0.5-preview-20240514174418
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -18
- package/dist/module-definition.d.ts +0 -2
- package/dist/module-definition.d.ts.map +1 -1
- package/dist/module-definition.js +1 -43
- package/package.json +5 -5
- package/dist/initialize/index.d.ts +0 -5
- package/dist/initialize/index.d.ts.map +0 -1
- package/dist/initialize/index.js +0 -16
- package/dist/loaders/connection.d.ts +0 -5
- package/dist/loaders/connection.d.ts.map +0 -1
- package/dist/loaders/connection.js +0 -41
- package/dist/loaders/container.d.ts +0 -3
- package/dist/loaders/container.d.ts.map +0 -1
- package/dist/loaders/container.js +0 -34
- package/dist/loaders/index.d.ts +0 -3
- package/dist/loaders/index.d.ts.map +0 -1
- package/dist/loaders/index.js +0 -18
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import { moduleDefinition
|
1
|
+
import { moduleDefinition } from "./module-definition";
|
2
2
|
export default moduleDefinition;
|
3
|
-
export { revertMigration, runMigrations };
|
4
|
-
export * from "./initialize";
|
5
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,eAAe,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
@@ -1,22 +1,4 @@
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
exports.runMigrations = exports.revertMigration = void 0;
|
18
3
|
const module_definition_1 = require("./module-definition");
|
19
|
-
Object.defineProperty(exports, "revertMigration", { enumerable: true, get: function () { return module_definition_1.revertMigration; } });
|
20
|
-
Object.defineProperty(exports, "runMigrations", { enumerable: true, get: function () { return module_definition_1.runMigrations; } });
|
21
4
|
exports.default = module_definition_1.moduleDefinition;
|
22
|
-
__exportStar(require("./initialize"), exports);
|
@@ -1,5 +1,3 @@
|
|
1
1
|
import { ModuleExports } from "@medusajs/types";
|
2
|
-
export declare const runMigrations: ({ options, logger, }?: Pick<import("@medusajs/modules-sdk").LoaderOptions<import("@medusajs/modules-sdk").ModuleServiceInitializeOptions>, "options" | "logger"> | undefined) => Promise<void>;
|
3
|
-
export declare const revertMigration: ({ options, logger, }?: Pick<import("@medusajs/modules-sdk").LoaderOptions<import("@medusajs/modules-sdk").ModuleServiceInitializeOptions>, "options" | "logger"> | undefined) => Promise<void>;
|
4
2
|
export declare const moduleDefinition: ModuleExports;
|
5
3
|
//# sourceMappingURL=module-definition.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"module-definition.d.ts","sourceRoot":"","sources":["../src/module-definition.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"module-definition.d.ts","sourceRoot":"","sources":["../src/module-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAK/C,eAAO,MAAM,gBAAgB,EAAE,aAE9B,CAAA"}
|
@@ -1,50 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
-
};
|
28
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.moduleDefinition =
|
30
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
31
|
-
const utils_1 = require("@medusajs/utils");
|
32
|
-
const Models = __importStar(require("./models"));
|
3
|
+
exports.moduleDefinition = void 0;
|
33
4
|
const _services_1 = require("./services");
|
34
|
-
const connection_1 = __importDefault(require("./loaders/connection"));
|
35
|
-
const container_1 = __importDefault(require("./loaders/container"));
|
36
|
-
const migrationScriptOptions = {
|
37
|
-
moduleName: modules_sdk_1.Modules.PROMOTION,
|
38
|
-
models: Models,
|
39
|
-
pathToMigrations: __dirname + "/migrations",
|
40
|
-
};
|
41
|
-
exports.runMigrations = utils_1.ModulesSdkUtils.buildMigrationScript(migrationScriptOptions);
|
42
|
-
exports.revertMigration = utils_1.ModulesSdkUtils.buildRevertMigrationScript(migrationScriptOptions);
|
43
5
|
const service = _services_1.PromotionModuleService;
|
44
|
-
const loaders = [container_1.default, connection_1.default];
|
45
6
|
exports.moduleDefinition = {
|
46
7
|
service,
|
47
|
-
loaders,
|
48
|
-
runMigrations: exports.runMigrations,
|
49
|
-
revertMigration: exports.revertMigration,
|
50
8
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/promotion",
|
3
|
-
"version": "0.0.5-preview-
|
3
|
+
"version": "0.0.5-preview-20240514174418",
|
4
4
|
"description": "Medusa Promotion module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -40,7 +40,7 @@
|
|
40
40
|
"@mikro-orm/cli": "5.9.7",
|
41
41
|
"cross-env": "^5.2.1",
|
42
42
|
"jest": "^29.6.3",
|
43
|
-
"medusa-test-utils": "1.1.45-preview-
|
43
|
+
"medusa-test-utils": "1.1.45-preview-20240514174418",
|
44
44
|
"rimraf": "^3.0.2",
|
45
45
|
"ts-jest": "^29.1.1",
|
46
46
|
"ts-node": "^10.9.1",
|
@@ -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",
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { ExternalModuleDeclaration, InternalModuleDeclaration } from "@medusajs/modules-sdk";
|
2
|
-
import { IPromotionModuleService, ModulesSdkTypes } from "@medusajs/types";
|
3
|
-
import { InitializeModuleInjectableDependencies } from "../types";
|
4
|
-
export declare const initialize: (options?: ModulesSdkTypes.ModuleServiceInitializeOptions | ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions | ExternalModuleDeclaration | InternalModuleDeclaration, injectedDependencies?: InitializeModuleInjectableDependencies) => Promise<IPromotionModuleService>;
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EAI1B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAE1E,OAAO,EAAE,sCAAsC,EAAE,MAAM,UAAU,CAAA;AAEjE,eAAO,MAAM,UAAU,aAEjB,gBAAgB,8BAA8B,GAC9C,gBAAgB,6CAA6C,GAC7D,yBAAyB,GACzB,yBAAyB,yBACN,sCAAsC,KAC5D,QAAQ,uBAAuB,CAYjC,CAAA"}
|
package/dist/initialize/index.js
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.initialize = void 0;
|
4
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
5
|
-
const module_definition_1 = require("../module-definition");
|
6
|
-
const initialize = async (options, injectedDependencies) => {
|
7
|
-
const loaded = await modules_sdk_1.MedusaModule.bootstrap({
|
8
|
-
moduleKey: modules_sdk_1.Modules.PROMOTION,
|
9
|
-
defaultPath: modules_sdk_1.MODULE_PACKAGE_NAMES[modules_sdk_1.Modules.PROMOTION],
|
10
|
-
declaration: options,
|
11
|
-
injectedDependencies,
|
12
|
-
moduleExports: module_definition_1.moduleDefinition,
|
13
|
-
});
|
14
|
-
return loaded[modules_sdk_1.Modules.PROMOTION];
|
15
|
-
};
|
16
|
-
exports.initialize = initialize;
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { InternalModuleDeclaration, LoaderOptions } from "@medusajs/modules-sdk";
|
2
|
-
import { ModulesSdkTypes } from "@medusajs/types";
|
3
|
-
declare const _default: ({ options, container, logger, }: LoaderOptions<ModulesSdkTypes.ModuleServiceInitializeOptions | ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions>, moduleDeclaration?: InternalModuleDeclaration) => Promise<void>;
|
4
|
-
export default _default;
|
5
|
-
//# sourceMappingURL=connection.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/loaders/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,aAAa,EAEd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;0DAU5C,cACC,gBAAgB,8BAA8B,GAC9C,gBAAgB,6CAA6C,CAChE,sBACmB,yBAAyB,KAC5C,QAAQ,IAAI,CAAC;AAVhB,wBAuBC"}
|
@@ -1,41 +0,0 @@
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
27
|
-
const utils_1 = require("@medusajs/utils");
|
28
|
-
const PromotionModels = __importStar(require("../models"));
|
29
|
-
exports.default = async ({ options, container, logger, }, moduleDeclaration) => {
|
30
|
-
const entities = Object.values(PromotionModels);
|
31
|
-
const pathToMigrations = __dirname + "/../migrations";
|
32
|
-
await utils_1.ModulesSdkUtils.mikroOrmConnectionLoader({
|
33
|
-
moduleName: modules_sdk_1.Modules.PROMOTION,
|
34
|
-
entities,
|
35
|
-
container,
|
36
|
-
options,
|
37
|
-
moduleDeclaration,
|
38
|
-
logger,
|
39
|
-
pathToMigrations,
|
40
|
-
});
|
41
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/loaders/container.ts"],"names":[],"mappings":";AAKA,wBAIE"}
|
@@ -1,34 +0,0 @@
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
const utils_1 = require("@medusajs/utils");
|
27
|
-
const ModuleModels = __importStar(require("../models"));
|
28
|
-
const ModuleRepositories = __importStar(require("../repositories"));
|
29
|
-
const ModuleServices = __importStar(require("../services"));
|
30
|
-
exports.default = utils_1.ModulesSdkUtils.moduleContainerLoaderFactory({
|
31
|
-
moduleModels: ModuleModels,
|
32
|
-
moduleRepositories: ModuleRepositories,
|
33
|
-
moduleServices: ModuleServices,
|
34
|
-
});
|
package/dist/loaders/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
|
package/dist/loaders/index.js
DELETED
@@ -1,18 +0,0 @@
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./connection"), exports);
|
18
|
-
__exportStar(require("./container"), exports);
|