@medusajs/types 1.11.1 → 1.11.2-next-20230929123725

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.
@@ -1,4 +1,7 @@
1
1
  export * from "./currency";
2
2
  export * from "./money-amount";
3
3
  export * from "./price-set";
4
+ export * from "./price-set-money-amount";
5
+ export * from "./price-set-money-amount-rules";
4
6
  export * from "./rule-type";
7
+ export * from './price-rule';
@@ -17,5 +17,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./currency"), exports);
18
18
  __exportStar(require("./money-amount"), exports);
19
19
  __exportStar(require("./price-set"), exports);
20
+ __exportStar(require("./price-set-money-amount"), exports);
21
+ __exportStar(require("./price-set-money-amount-rules"), exports);
20
22
  __exportStar(require("./rule-type"), exports);
23
+ __exportStar(require("./price-rule"), exports);
21
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pricing/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,iDAA8B;AAC9B,8CAA2B;AAC3B,8CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pricing/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,iDAA8B;AAC9B,8CAA2B;AAC3B,2DAAwC;AACxC,iEAA8C;AAC9C,8CAA2B;AAC3B,+CAA4B"}
@@ -0,0 +1,39 @@
1
+ import { BaseFilterable } from "../../dal";
2
+ import { PriceSetDTO } from "./price-set";
3
+ import { RuleTypeDTO } from "./rule-type";
4
+ export interface PriceRuleDTO {
5
+ id: string;
6
+ price_set_id: string;
7
+ price_set: PriceSetDTO;
8
+ rule_type_id: string;
9
+ rule_type: RuleTypeDTO;
10
+ is_dynamic: boolean;
11
+ value: string;
12
+ priority: number;
13
+ price_set_money_amount_id: string;
14
+ price_list_id: string;
15
+ }
16
+ export interface CreatePriceRuleDTO {
17
+ id: string;
18
+ price_set_id: string;
19
+ rule_type_id: string;
20
+ is_dynamic?: boolean;
21
+ value: string;
22
+ priority?: number;
23
+ price_set_money_amount_id: string;
24
+ price_list_id: string;
25
+ }
26
+ export interface UpdatePriceRuleDTO {
27
+ id: string;
28
+ price_set_id?: string;
29
+ rule_type_id?: string;
30
+ is_dynamic?: boolean;
31
+ value?: string;
32
+ priority?: number;
33
+ price_set_money_amount_id?: string;
34
+ price_list_id?: string;
35
+ }
36
+ export interface FilterablePriceRuleProps extends BaseFilterable<FilterablePriceRuleProps> {
37
+ id?: string[];
38
+ name?: string[];
39
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=price-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"price-rule.js","sourceRoot":"","sources":["../../../src/pricing/common/price-rule.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { BaseFilterable } from "../../dal";
2
+ import { PriceSetMoneyAmountDTO } from "./price-set-money-amount";
3
+ import { RuleTypeDTO } from "./rule-type";
4
+ export interface PriceSetMoneyAmountRulesDTO {
5
+ id: string;
6
+ price_set_money_amount: PriceSetMoneyAmountDTO;
7
+ rule_type: RuleTypeDTO;
8
+ value: string;
9
+ }
10
+ export interface CreatePriceSetMoneyAmountRulesDTO {
11
+ price_set_money_amount: string;
12
+ rule_type: string;
13
+ value: string;
14
+ }
15
+ export interface UpdatePriceSetMoneyAmountRulesDTO {
16
+ id: string;
17
+ price_set_money_amount?: string;
18
+ rule_type?: string;
19
+ value?: string;
20
+ }
21
+ export interface FilterablePriceSetMoneyAmountRulesProps extends BaseFilterable<FilterablePriceSetMoneyAmountRulesProps> {
22
+ id?: string[];
23
+ rule_type_id?: string[];
24
+ price_set_money_amount_id?: string[];
25
+ value?: string[];
26
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=price-set-money-amount-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"price-set-money-amount-rules.js","sourceRoot":"","sources":["../../../src/pricing/common/price-set-money-amount-rules.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { MoneyAmountDTO } from "./money-amount";
2
+ import { PriceSetDTO } from "./price-set";
3
+ export interface PriceSetMoneyAmountDTO {
4
+ id: string;
5
+ title?: string;
6
+ price_set?: PriceSetDTO;
7
+ rule_type?: MoneyAmountDTO;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=price-set-money-amount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"price-set-money-amount.js","sourceRoot":"","sources":["../../../src/pricing/common/price-set-money-amount.ts"],"names":[],"mappings":""}
@@ -1,9 +1,7 @@
1
1
  import { BaseFilterable } from "../../dal";
2
2
  import { FilterableMoneyAmountProps, MoneyAmountDTO } from "./money-amount";
3
3
  export interface PricingContext {
4
- context?: {
5
- currency_code?: string;
6
- };
4
+ context?: Record<string, string | number>;
7
5
  }
8
6
  export interface PricingFilters {
9
7
  id: string[];
@@ -1,7 +1,7 @@
1
+ import { CalculatedPriceSetDTO, CreateCurrencyDTO, CreateMoneyAmountDTO, CreatePriceRuleDTO, CreatePriceSetDTO, CreatePriceSetMoneyAmountRulesDTO, CreateRuleTypeDTO, CurrencyDTO, FilterableCurrencyProps, FilterableMoneyAmountProps, FilterablePriceRuleProps, FilterablePriceSetMoneyAmountRulesProps, FilterablePriceSetProps, FilterableRuleTypeProps, MoneyAmountDTO, PriceRuleDTO, PriceSetDTO, PriceSetMoneyAmountRulesDTO, PricingContext, PricingFilters, RuleTypeDTO, UpdateCurrencyDTO, UpdateMoneyAmountDTO, UpdatePriceRuleDTO, UpdatePriceSetDTO, UpdatePriceSetMoneyAmountRulesDTO, UpdateRuleTypeDTO } from "./common";
1
2
  import { FindConfig } from "../common";
2
3
  import { ModuleJoinerConfig } from "../modules-sdk";
3
4
  import { Context } from "../shared-context";
4
- import { CalculatedPriceSetDTO, CreateCurrencyDTO, CreateMoneyAmountDTO, CreatePriceSetDTO, CreateRuleTypeDTO, CurrencyDTO, FilterableCurrencyProps, FilterableMoneyAmountProps, FilterablePriceSetProps, FilterableRuleTypeProps, MoneyAmountDTO, PriceSetDTO, PricingContext, PricingFilters, RuleTypeDTO, UpdateCurrencyDTO, UpdateMoneyAmountDTO, UpdatePriceSetDTO, UpdateRuleTypeDTO } from "./common";
5
5
  export interface IPricingModuleService {
6
6
  __joinerConfig(): ModuleJoinerConfig;
7
7
  calculatePrices(filters: PricingFilters, context?: PricingContext, sharedContext?: Context): Promise<CalculatedPriceSetDTO>;
@@ -28,5 +28,17 @@ export interface IPricingModuleService {
28
28
  listAndCountRuleTypes(filters?: FilterableRuleTypeProps, config?: FindConfig<RuleTypeDTO>, sharedContext?: Context): Promise<[RuleTypeDTO[], number]>;
29
29
  createRuleTypes(data: CreateRuleTypeDTO[], sharedContext?: Context): Promise<RuleTypeDTO[]>;
30
30
  updateRuleTypes(data: UpdateRuleTypeDTO[], sharedContext?: Context): Promise<RuleTypeDTO[]>;
31
- deleteRuleTypes(ruleTypes: string[], sharedContext?: Context): Promise<void>;
31
+ deleteRuleTypes(ruleTypeIds: string[], sharedContext?: Context): Promise<void>;
32
+ retrievePriceSetMoneyAmountRules(id: string, config?: FindConfig<PriceSetMoneyAmountRulesDTO>, sharedContext?: Context): Promise<PriceSetMoneyAmountRulesDTO>;
33
+ listPriceSetMoneyAmountRules(filters?: FilterablePriceSetMoneyAmountRulesProps, config?: FindConfig<PriceSetMoneyAmountRulesDTO>, sharedContext?: Context): Promise<PriceSetMoneyAmountRulesDTO[]>;
34
+ listAndCountPriceSetMoneyAmountRules(filters?: FilterablePriceSetMoneyAmountRulesProps, config?: FindConfig<PriceSetMoneyAmountRulesDTO>, sharedContext?: Context): Promise<[PriceSetMoneyAmountRulesDTO[], number]>;
35
+ createPriceSetMoneyAmountRules(data: CreatePriceSetMoneyAmountRulesDTO[], sharedContext?: Context): Promise<PriceSetMoneyAmountRulesDTO[]>;
36
+ updatePriceSetMoneyAmountRules(data: UpdatePriceSetMoneyAmountRulesDTO[], sharedContext?: Context): Promise<PriceSetMoneyAmountRulesDTO[]>;
37
+ deletePriceSetMoneyAmountRules(ids: string[], sharedContext?: Context): Promise<void>;
38
+ retrievePriceRule(id: string, config?: FindConfig<PriceRuleDTO>, sharedContext?: Context): Promise<PriceRuleDTO>;
39
+ listPriceRules(filters?: FilterablePriceRuleProps, config?: FindConfig<PriceRuleDTO>, sharedContext?: Context): Promise<PriceRuleDTO[]>;
40
+ listAndCountPriceRules(filters?: FilterablePriceRuleProps, config?: FindConfig<PriceRuleDTO>, sharedContext?: Context): Promise<[PriceRuleDTO[], number]>;
41
+ createPriceRules(data: CreatePriceRuleDTO[], sharedContext?: Context): Promise<PriceRuleDTO[]>;
42
+ updatePriceRules(data: UpdatePriceRuleDTO[], sharedContext?: Context): Promise<PriceRuleDTO[]>;
43
+ deletePriceRules(priceRuleIds: string[], sharedContext?: Context): Promise<void>;
32
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/types",
3
- "version": "1.11.1",
3
+ "version": "1.11.2-next-20230929123725",
4
4
  "description": "Medusa Types definition",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",