@medusajs/pricing 0.1.13-snapshot-20240718083016 → 0.1.13-snapshot-20240719080828

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. package/dist/index.d.ts +6 -6
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +5 -9
  4. package/dist/joiner-config.d.ts +2 -10
  5. package/dist/joiner-config.d.ts.map +1 -0
  6. package/dist/joiner-config.js +4 -52
  7. package/dist/migrations/Migration20230929122253.d.ts +1 -0
  8. package/dist/migrations/Migration20230929122253.d.ts.map +1 -0
  9. package/dist/migrations/Migration20240322094407.d.ts +1 -0
  10. package/dist/migrations/Migration20240322094407.d.ts.map +1 -0
  11. package/dist/migrations/Migration20240322113359.d.ts +1 -0
  12. package/dist/migrations/Migration20240322113359.d.ts.map +1 -0
  13. package/dist/migrations/Migration20240322120125.d.ts +1 -0
  14. package/dist/migrations/Migration20240322120125.d.ts.map +1 -0
  15. package/dist/migrations/Migration20240626133555.d.ts +5 -0
  16. package/dist/migrations/Migration20240626133555.d.ts.map +1 -0
  17. package/dist/migrations/Migration20240626133555.js +33 -0
  18. package/dist/migrations/Migration20240704094505.d.ts +6 -0
  19. package/dist/migrations/Migration20240704094505.d.ts.map +1 -0
  20. package/dist/migrations/Migration20240704094505.js +15 -0
  21. package/dist/models/index.d.ts +2 -3
  22. package/dist/models/index.d.ts.map +1 -0
  23. package/dist/models/index.js +3 -7
  24. package/dist/models/price-list-rule.d.ts +6 -8
  25. package/dist/models/price-list-rule.d.ts.map +1 -0
  26. package/dist/models/price-list-rule.js +8 -29
  27. package/dist/models/price-list.d.ts +2 -3
  28. package/dist/models/price-list.d.ts.map +1 -0
  29. package/dist/models/price-list.js +0 -9
  30. package/dist/models/price-preference.d.ts +13 -0
  31. package/dist/models/price-preference.d.ts.map +1 -0
  32. package/dist/models/{rule-type.js → price-preference.js} +35 -40
  33. package/dist/models/price-rule.d.ts +5 -9
  34. package/dist/models/price-rule.d.ts.map +1 -0
  35. package/dist/models/price-rule.js +6 -45
  36. package/dist/models/price-set.d.ts +1 -4
  37. package/dist/models/price-set.d.ts.map +1 -0
  38. package/dist/models/price-set.js +0 -19
  39. package/dist/models/price.d.ts +5 -4
  40. package/dist/models/price.d.ts.map +1 -0
  41. package/dist/models/price.js +5 -5
  42. package/dist/repositories/index.d.ts +1 -0
  43. package/dist/repositories/index.d.ts.map +1 -0
  44. package/dist/repositories/pricing.d.ts +1 -0
  45. package/dist/repositories/pricing.d.ts.map +1 -0
  46. package/dist/repositories/pricing.js +29 -36
  47. package/dist/schema/index.d.ts +1 -0
  48. package/dist/schema/index.d.ts.map +1 -0
  49. package/dist/services/index.d.ts +1 -2
  50. package/dist/services/index.d.ts.map +1 -0
  51. package/dist/services/index.js +1 -5
  52. package/dist/services/pricing-module.d.ts +66 -53
  53. package/dist/services/pricing-module.d.ts.map +1 -0
  54. package/dist/services/pricing-module.js +594 -605
  55. package/dist/types/index.d.ts +1 -0
  56. package/dist/types/index.d.ts.map +1 -0
  57. package/dist/types/services/index.d.ts +30 -2
  58. package/dist/types/services/index.d.ts.map +1 -0
  59. package/dist/types/services/index.js +0 -16
  60. package/dist/utils/events.d.ts +63 -0
  61. package/dist/utils/events.d.ts.map +1 -0
  62. package/dist/utils/events.js +66 -0
  63. package/dist/utils/index.d.ts +2 -0
  64. package/dist/utils/index.d.ts.map +1 -0
  65. package/dist/utils/index.js +1 -0
  66. package/dist/utils/validate-price-list-dates.d.ts +1 -0
  67. package/dist/utils/validate-price-list-dates.d.ts.map +1 -0
  68. package/package.json +8 -13
  69. package/dist/initialize/index.d.ts +0 -4
  70. package/dist/initialize/index.js +0 -17
  71. package/dist/loaders/connection.d.ts +0 -4
  72. package/dist/loaders/connection.js +0 -40
  73. package/dist/loaders/container.d.ts +0 -2
  74. package/dist/loaders/container.js +0 -34
  75. package/dist/loaders/index.d.ts +0 -2
  76. package/dist/loaders/index.js +0 -18
  77. package/dist/models/price-list-rule-value.d.ts +0 -17
  78. package/dist/models/price-list-rule-value.js +0 -102
  79. package/dist/models/price-set-rule-type.d.ts +0 -10
  80. package/dist/models/price-set-rule-type.js +0 -108
  81. package/dist/models/rule-type.d.ts +0 -17
  82. package/dist/module-definition.d.ts +0 -4
  83. package/dist/module-definition.js +0 -50
  84. package/dist/scripts/bin/run-seed.d.ts +0 -3
  85. package/dist/scripts/bin/run-seed.js +0 -38
  86. package/dist/scripts/seed.d.ts +0 -4
  87. package/dist/scripts/seed.js +0 -67
  88. package/dist/services/price-list.d.ts +0 -16
  89. package/dist/services/price-list.js +0 -34
  90. package/dist/services/rule-type.d.ts +0 -15
  91. package/dist/services/rule-type.js +0 -53
  92. package/dist/types/services/price-list.d.ts +0 -18
  93. package/dist/types/services/price-list.js +0 -2
  94. package/dist/types/services/price-set.d.ts +0 -4
  95. package/dist/types/services/price-set.js +0 -2
@@ -3,3 +3,4 @@ export type InitializeModuleInjectableDependencies = {
3
3
  logger?: Logger;
4
4
  };
5
5
  export * as ServiceTypes from "./services";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,MAAM,MAAM,sCAAsC,GAAG;IACnD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,OAAO,KAAK,YAAY,MAAM,YAAY,CAAA"}
@@ -1,2 +1,30 @@
1
- export * from "./price-list";
2
- export * from "./price-set";
1
+ import { PriceListStatus, PricingTypes } from "@medusajs/types";
2
+ export interface CreatePriceListDTO extends PricingTypes.CreatePriceListDTO {
3
+ rules_count?: number;
4
+ price_list_rules?: {
5
+ attribute: string;
6
+ value: string;
7
+ }[];
8
+ prices?: PricingTypes.CreatePriceListPriceDTO[];
9
+ }
10
+ export interface UpdatePriceListDTO {
11
+ id: string;
12
+ title?: string;
13
+ description?: string | null;
14
+ starts_at?: string | null;
15
+ ends_at?: string | null;
16
+ status?: PriceListStatus;
17
+ number_rules?: number;
18
+ }
19
+ export interface UpdatePriceSetInput extends PricingTypes.UpdatePriceSetDTO {
20
+ id: string;
21
+ }
22
+ export interface UpsertPriceDTO extends Omit<PricingTypes.CreatePriceDTO, "rules"> {
23
+ id?: string;
24
+ price_list_id?: string;
25
+ price_rules: PricingTypes.CreatePriceRuleDTO[];
26
+ }
27
+ export interface UpdatePricePreferenceInput extends PricingTypes.UpdatePricePreferenceDTO {
28
+ id: string;
29
+ }
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE/D,MAAM,WAAW,kBAAmB,SAAQ,YAAY,CAAC,kBAAkB;IACzE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gBAAgB,CAAC,EAAE;QACjB,SAAS,EAAE,MAAM,CAAA;QACjB,KAAK,EAAE,MAAM,CAAA;KACd,EAAE,CAAA;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,uBAAuB,EAAE,CAAA;CAChD;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,iBAAiB;IACzE,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC;IAClD,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,YAAY,CAAC,kBAAkB,EAAE,CAAA;CAC/C;AAED,MAAM,WAAW,0BACf,SAAQ,YAAY,CAAC,wBAAwB;IAC7C,EAAE,EAAE,MAAM,CAAA;CACX"}
@@ -1,18 +1,2 @@
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
- __exportStar(require("./price-list"), exports);
18
- __exportStar(require("./price-set"), exports);
@@ -0,0 +1,63 @@
1
+ export declare const eventBuilders: {
2
+ createdPriceSet: ({ data, sharedContext, }: {
3
+ data: {
4
+ id: string;
5
+ }[];
6
+ sharedContext: import("@medusajs/types").Context;
7
+ }) => void;
8
+ createdPrice: ({ data, sharedContext, }: {
9
+ data: {
10
+ id: string;
11
+ }[];
12
+ sharedContext: import("@medusajs/types").Context;
13
+ }) => void;
14
+ createdPriceRule: ({ data, sharedContext, }: {
15
+ data: {
16
+ id: string;
17
+ }[];
18
+ sharedContext: import("@medusajs/types").Context;
19
+ }) => void;
20
+ createdPriceList: ({ data, sharedContext, }: {
21
+ data: {
22
+ id: string;
23
+ }[];
24
+ sharedContext: import("@medusajs/types").Context;
25
+ }) => void;
26
+ createdPriceListRule: ({ data, sharedContext, }: {
27
+ data: {
28
+ id: string;
29
+ }[];
30
+ sharedContext: import("@medusajs/types").Context;
31
+ }) => void;
32
+ attachedPriceListRule: ({ data, sharedContext, }: {
33
+ data: {
34
+ id: string;
35
+ }[];
36
+ sharedContext: import("@medusajs/types").Context;
37
+ }) => void;
38
+ updatedPrice: ({ data, sharedContext, }: {
39
+ data: {
40
+ id: string;
41
+ }[];
42
+ sharedContext: import("@medusajs/types").Context;
43
+ }) => void;
44
+ updatedPriceRule: ({ data, sharedContext, }: {
45
+ data: {
46
+ id: string;
47
+ }[];
48
+ sharedContext: import("@medusajs/types").Context;
49
+ }) => void;
50
+ deletedPrice: ({ data, sharedContext, }: {
51
+ data: {
52
+ id: string;
53
+ }[];
54
+ sharedContext: import("@medusajs/types").Context;
55
+ }) => void;
56
+ deletedPriceRule: ({ data, sharedContext, }: {
57
+ data: {
58
+ id: string;
59
+ }[];
60
+ sharedContext: import("@medusajs/types").Context;
61
+ }) => void;
62
+ };
63
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DzB,CAAA"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.eventBuilders = void 0;
4
+ const utils_1 = require("@medusajs/utils");
5
+ exports.eventBuilders = {
6
+ createdPriceSet: (0, utils_1.eventBuilderFactory)({
7
+ source: utils_1.Modules.PRICING,
8
+ action: utils_1.CommonEvents.CREATED,
9
+ object: "price_set",
10
+ eventsEnum: utils_1.PricingEvents,
11
+ }),
12
+ createdPrice: (0, utils_1.eventBuilderFactory)({
13
+ source: utils_1.Modules.PRICING,
14
+ action: utils_1.CommonEvents.CREATED,
15
+ object: "price",
16
+ eventsEnum: utils_1.PricingEvents,
17
+ }),
18
+ createdPriceRule: (0, utils_1.eventBuilderFactory)({
19
+ source: utils_1.Modules.PRICING,
20
+ action: utils_1.CommonEvents.CREATED,
21
+ object: "price_rule",
22
+ eventsEnum: utils_1.PricingEvents,
23
+ }),
24
+ createdPriceList: (0, utils_1.eventBuilderFactory)({
25
+ source: utils_1.Modules.PRICING,
26
+ action: utils_1.CommonEvents.CREATED,
27
+ object: "price_list",
28
+ eventsEnum: utils_1.PricingEvents,
29
+ }),
30
+ createdPriceListRule: (0, utils_1.eventBuilderFactory)({
31
+ source: utils_1.Modules.PRICING,
32
+ action: utils_1.CommonEvents.CREATED,
33
+ object: "price_list_rule",
34
+ eventsEnum: utils_1.PricingEvents,
35
+ }),
36
+ attachedPriceListRule: (0, utils_1.eventBuilderFactory)({
37
+ source: utils_1.Modules.PRICING,
38
+ action: utils_1.CommonEvents.ATTACHED,
39
+ object: "price_list_rule",
40
+ eventsEnum: utils_1.PricingEvents,
41
+ }),
42
+ updatedPrice: (0, utils_1.eventBuilderFactory)({
43
+ source: utils_1.Modules.PRICING,
44
+ action: utils_1.CommonEvents.UPDATED,
45
+ object: "price",
46
+ eventsEnum: utils_1.PricingEvents,
47
+ }),
48
+ updatedPriceRule: (0, utils_1.eventBuilderFactory)({
49
+ source: utils_1.Modules.PRICING,
50
+ action: utils_1.CommonEvents.UPDATED,
51
+ object: "price_rule",
52
+ eventsEnum: utils_1.PricingEvents,
53
+ }),
54
+ deletedPrice: (0, utils_1.eventBuilderFactory)({
55
+ source: utils_1.Modules.PRICING,
56
+ action: utils_1.CommonEvents.DELETED,
57
+ object: "price",
58
+ eventsEnum: utils_1.PricingEvents,
59
+ }),
60
+ deletedPriceRule: (0, utils_1.eventBuilderFactory)({
61
+ source: utils_1.Modules.PRICING,
62
+ action: utils_1.CommonEvents.DELETED,
63
+ object: "price_rule",
64
+ eventsEnum: utils_1.PricingEvents,
65
+ }),
66
+ };
@@ -1 +1,3 @@
1
1
  export * from "./validate-price-list-dates";
2
+ export * from "./events";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA;AAC3C,cAAc,UAAU,CAAA"}
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./validate-price-list-dates"), exports);
18
+ __exportStar(require("./events"), exports);
@@ -2,3 +2,4 @@ export declare const validatePriceListDates: (priceListData: {
2
2
  starts_at?: Date | string | null;
3
3
  ends_at?: Date | string | null;
4
4
  }) => void;
5
+ //# sourceMappingURL=validate-price-list-dates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-price-list-dates.d.ts","sourceRoot":"","sources":["../../src/utils/validate-price-list-dates.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,kBAAmB;IACpD,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAChC,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;CAC/B,SAcA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/pricing",
3
- "version": "0.1.13-snapshot-20240718083016",
3
+ "version": "0.1.13-snapshot-20240719080828",
4
4
  "description": "Medusa Pricing module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,10 +8,7 @@
8
8
  "dist"
9
9
  ],
10
10
  "engines": {
11
- "node": ">=16"
12
- },
13
- "bin": {
14
- "medusa-pricing-seed": "dist/scripts/bin/run-seed.js"
11
+ "node": ">=20"
15
12
  },
16
13
  "repository": {
17
14
  "type": "git",
@@ -37,10 +34,12 @@
37
34
  "orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
38
35
  },
39
36
  "devDependencies": {
37
+ "@medusajs/modules-sdk": "1.13.0-snapshot-20240719080828",
38
+ "@medusajs/types": "1.12.0-snapshot-20240719080828",
40
39
  "@mikro-orm/cli": "5.9.7",
41
40
  "cross-env": "^5.2.1",
42
- "jest": "^29.6.3",
43
- "medusa-test-utils": "1.1.45-snapshot-20240718083016",
41
+ "jest": "^29.7.0",
42
+ "medusa-test-utils": "1.1.45-snapshot-20240719080828",
44
43
  "rimraf": "^3.0.2",
45
44
  "ts-jest": "^29.1.1",
46
45
  "ts-node": "^10.9.1",
@@ -48,14 +47,10 @@
48
47
  "typescript": "^5.1.6"
49
48
  },
50
49
  "dependencies": {
51
- "@medusajs/modules-sdk": "1.12.12-snapshot-20240718083016",
52
- "@medusajs/types": "1.11.17-snapshot-20240718083016",
53
- "@medusajs/utils": "1.11.10-snapshot-20240718083016",
50
+ "@medusajs/utils": "1.12.0-snapshot-20240719080828",
54
51
  "@mikro-orm/core": "5.9.7",
55
52
  "@mikro-orm/migrations": "5.9.7",
56
53
  "@mikro-orm/postgresql": "5.9.7",
57
- "awilix": "^8.0.0",
58
- "dotenv": "^16.4.5",
59
- "knex": "2.4.2"
54
+ "awilix": "^8.0.0"
60
55
  }
61
56
  }
@@ -1,4 +0,0 @@
1
- import { ExternalModuleDeclaration, InternalModuleDeclaration } from "@medusajs/modules-sdk";
2
- import { IPricingModuleService, ModulesSdkTypes } from "@medusajs/types";
3
- import { InitializeModuleInjectableDependencies } from "../types";
4
- export declare const initialize: (options?: ModulesSdkTypes.ModuleServiceInitializeOptions | ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions | ExternalModuleDeclaration | InternalModuleDeclaration, injectedDependencies?: InitializeModuleInjectableDependencies) => Promise<IPricingModuleService>;
@@ -1,17 +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 serviceKey = modules_sdk_1.Modules.PRICING;
8
- const loaded = await modules_sdk_1.MedusaModule.bootstrap({
9
- moduleKey: serviceKey,
10
- defaultPath: modules_sdk_1.MODULE_PACKAGE_NAMES[modules_sdk_1.Modules.PRICING],
11
- declaration: options,
12
- injectedDependencies,
13
- moduleExports: module_definition_1.moduleDefinition,
14
- });
15
- return loaded[serviceKey];
16
- };
17
- exports.initialize = initialize;
@@ -1,4 +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;
@@ -1,40 +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 PricingModels = __importStar(require("../models"));
28
- exports.default = async ({ options, container, logger, }, moduleDeclaration) => {
29
- const entities = Object.values(PricingModels);
30
- const pathToMigrations = __dirname + "/../migrations";
31
- await utils_1.ModulesSdkUtils.mikroOrmConnectionLoader({
32
- moduleName: "pricing",
33
- entities,
34
- container,
35
- options,
36
- moduleDeclaration,
37
- logger,
38
- pathToMigrations,
39
- });
40
- };
@@ -1,2 +0,0 @@
1
- declare const _default: ({ container, options }: import("@medusajs/types").LoaderOptions) => Promise<void>;
2
- export default _default;
@@ -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
- });
@@ -1,2 +0,0 @@
1
- export * from "./connection";
2
- export * from "./container";
@@ -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);
@@ -1,17 +0,0 @@
1
- import { DAL } from "@medusajs/types";
2
- import { OptionalProps } from "@mikro-orm/core";
3
- import PriceListRule from "./price-list-rule";
4
- type OptionalFields = DAL.SoftDeletableEntityDateColumns;
5
- export default class PriceListRuleValue {
6
- [OptionalProps]?: OptionalFields;
7
- id: string;
8
- price_list_rule_id: string;
9
- price_list_rule: PriceListRule;
10
- value: string;
11
- created_at: Date;
12
- updated_at: Date;
13
- deleted_at: Date | null;
14
- onCreate(): void;
15
- onInit(): void;
16
- }
17
- export {};
@@ -1,102 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const utils_1 = require("@medusajs/utils");
16
- const core_1 = require("@mikro-orm/core");
17
- const price_list_rule_1 = __importDefault(require("./price-list-rule"));
18
- const tableName = "price_list_rule_value";
19
- const PriceListRuleValueDeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
- tableName: tableName,
21
- columns: "deleted_at",
22
- where: "deleted_at IS NOT NULL",
23
- });
24
- const PriceListPriceListRuleIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
25
- tableName: tableName,
26
- columns: "price_list_rule_id",
27
- where: "deleted_at IS NULL",
28
- });
29
- let PriceListRuleValue = class PriceListRuleValue {
30
- constructor() {
31
- this.deleted_at = null;
32
- }
33
- onCreate() {
34
- this.id = (0, utils_1.generateEntityId)(this.id, "plrv");
35
- this.price_list_rule_id ?? (this.price_list_rule_id = this.price_list_rule?.id);
36
- }
37
- onInit() {
38
- this.id = (0, utils_1.generateEntityId)(this.id, "plrv");
39
- this.price_list_rule_id ?? (this.price_list_rule_id = this.price_list_rule?.id);
40
- }
41
- };
42
- __decorate([
43
- (0, core_1.PrimaryKey)({ columnType: "text" }),
44
- __metadata("design:type", String)
45
- ], PriceListRuleValue.prototype, "id", void 0);
46
- __decorate([
47
- PriceListPriceListRuleIdIndex.MikroORMIndex(),
48
- (0, core_1.ManyToOne)(() => price_list_rule_1.default, {
49
- columnType: "text",
50
- mapToPk: true,
51
- fieldName: "price_list_rule_id",
52
- onDelete: "cascade",
53
- }),
54
- __metadata("design:type", String)
55
- ], PriceListRuleValue.prototype, "price_list_rule_id", void 0);
56
- __decorate([
57
- (0, core_1.ManyToOne)(() => price_list_rule_1.default, { persist: false }),
58
- __metadata("design:type", price_list_rule_1.default)
59
- ], PriceListRuleValue.prototype, "price_list_rule", void 0);
60
- __decorate([
61
- (0, core_1.Property)({ columnType: "text" }),
62
- __metadata("design:type", String)
63
- ], PriceListRuleValue.prototype, "value", void 0);
64
- __decorate([
65
- (0, core_1.Property)({
66
- onCreate: () => new Date(),
67
- columnType: "timestamptz",
68
- defaultRaw: "now()",
69
- }),
70
- __metadata("design:type", Date)
71
- ], PriceListRuleValue.prototype, "created_at", void 0);
72
- __decorate([
73
- (0, core_1.Property)({
74
- onCreate: () => new Date(),
75
- onUpdate: () => new Date(),
76
- columnType: "timestamptz",
77
- defaultRaw: "now()",
78
- }),
79
- __metadata("design:type", Date)
80
- ], PriceListRuleValue.prototype, "updated_at", void 0);
81
- __decorate([
82
- PriceListRuleValueDeletedAtIndex.MikroORMIndex(),
83
- (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
84
- __metadata("design:type", Object)
85
- ], PriceListRuleValue.prototype, "deleted_at", void 0);
86
- __decorate([
87
- (0, core_1.BeforeCreate)(),
88
- __metadata("design:type", Function),
89
- __metadata("design:paramtypes", []),
90
- __metadata("design:returntype", void 0)
91
- ], PriceListRuleValue.prototype, "onCreate", null);
92
- __decorate([
93
- (0, core_1.OnInit)(),
94
- __metadata("design:type", Function),
95
- __metadata("design:paramtypes", []),
96
- __metadata("design:returntype", void 0)
97
- ], PriceListRuleValue.prototype, "onInit", null);
98
- PriceListRuleValue = __decorate([
99
- (0, core_1.Entity)({ tableName }),
100
- (0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
101
- ], PriceListRuleValue);
102
- exports.default = PriceListRuleValue;
@@ -1,10 +0,0 @@
1
- export default class PriceSetRuleType {
2
- id: string;
3
- price_set_id: string;
4
- rule_type_id: string;
5
- created_at: Date;
6
- updated_at: Date;
7
- deleted_at: Date | null;
8
- onCreate(): void;
9
- onInit(): void;
10
- }
@@ -1,108 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const utils_1 = require("@medusajs/utils");
16
- const core_1 = require("@mikro-orm/core");
17
- const price_set_1 = __importDefault(require("./price-set"));
18
- const rule_type_1 = __importDefault(require("./rule-type"));
19
- const tableName = "price_set_rule_type";
20
- const PriceSetRuleTypeDeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
21
- tableName: tableName,
22
- columns: "deleted_at",
23
- where: "deleted_at IS NOT NULL",
24
- });
25
- const PriceSetRuleTypePriceSetIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
26
- tableName: tableName,
27
- columns: "price_set_id",
28
- where: "deleted_at IS NULL",
29
- });
30
- const PriceSetRuleTypeRuleTypeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
31
- tableName: tableName,
32
- columns: "rule_type_id",
33
- where: "deleted_at IS NULL",
34
- });
35
- let PriceSetRuleType = class PriceSetRuleType {
36
- constructor() {
37
- this.deleted_at = null;
38
- }
39
- onCreate() {
40
- this.id = (0, utils_1.generateEntityId)(this.id, "psrt");
41
- }
42
- onInit() {
43
- this.id = (0, utils_1.generateEntityId)(this.id, "psrt");
44
- }
45
- };
46
- __decorate([
47
- (0, core_1.PrimaryKey)({ columnType: "text" }),
48
- __metadata("design:type", String)
49
- ], PriceSetRuleType.prototype, "id", void 0);
50
- __decorate([
51
- PriceSetRuleTypePriceSetIdIndex.MikroORMIndex(),
52
- (0, core_1.ManyToOne)(() => price_set_1.default, {
53
- columnType: "text",
54
- mapToPk: true,
55
- fieldName: "price_set_id",
56
- onDelete: "cascade",
57
- }),
58
- __metadata("design:type", String)
59
- ], PriceSetRuleType.prototype, "price_set_id", void 0);
60
- __decorate([
61
- PriceSetRuleTypeRuleTypeIdIndex.MikroORMIndex(),
62
- (0, core_1.ManyToOne)(() => rule_type_1.default, {
63
- columnType: "text",
64
- mapToPk: true,
65
- fieldName: "rule_type_id",
66
- onDelete: "cascade",
67
- }),
68
- __metadata("design:type", String)
69
- ], PriceSetRuleType.prototype, "rule_type_id", void 0);
70
- __decorate([
71
- (0, core_1.Property)({
72
- onCreate: () => new Date(),
73
- columnType: "timestamptz",
74
- defaultRaw: "now()",
75
- }),
76
- __metadata("design:type", Date)
77
- ], PriceSetRuleType.prototype, "created_at", void 0);
78
- __decorate([
79
- (0, core_1.Property)({
80
- onCreate: () => new Date(),
81
- onUpdate: () => new Date(),
82
- columnType: "timestamptz",
83
- defaultRaw: "now()",
84
- }),
85
- __metadata("design:type", Date)
86
- ], PriceSetRuleType.prototype, "updated_at", void 0);
87
- __decorate([
88
- PriceSetRuleTypeDeletedAtIndex.MikroORMIndex(),
89
- (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
90
- __metadata("design:type", Object)
91
- ], PriceSetRuleType.prototype, "deleted_at", void 0);
92
- __decorate([
93
- (0, core_1.BeforeCreate)(),
94
- __metadata("design:type", Function),
95
- __metadata("design:paramtypes", []),
96
- __metadata("design:returntype", void 0)
97
- ], PriceSetRuleType.prototype, "onCreate", null);
98
- __decorate([
99
- (0, core_1.OnInit)(),
100
- __metadata("design:type", Function),
101
- __metadata("design:paramtypes", []),
102
- __metadata("design:returntype", void 0)
103
- ], PriceSetRuleType.prototype, "onInit", null);
104
- PriceSetRuleType = __decorate([
105
- (0, core_1.Entity)({ tableName }),
106
- (0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
107
- ], PriceSetRuleType);
108
- exports.default = PriceSetRuleType;