@medusajs/promotion 0.0.5-snapshot-20240916110643 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. package/dist/index.d.ts +4 -5
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +20 -5
  4. package/dist/initialize/index.d.ts +5 -0
  5. package/dist/initialize/index.d.ts.map +1 -0
  6. package/dist/initialize/index.js +16 -0
  7. package/dist/joiner-config.d.ts +8 -1
  8. package/dist/joiner-config.d.ts.map +1 -1
  9. package/dist/joiner-config.js +35 -9
  10. package/dist/loaders/connection.d.ts +5 -0
  11. package/dist/loaders/connection.d.ts.map +1 -0
  12. package/dist/loaders/connection.js +41 -0
  13. package/dist/loaders/container.d.ts +3 -0
  14. package/dist/loaders/container.d.ts.map +1 -0
  15. package/dist/loaders/container.js +34 -0
  16. package/dist/loaders/index.d.ts +3 -0
  17. package/dist/loaders/index.d.ts.map +1 -0
  18. package/dist/loaders/index.js +18 -0
  19. package/dist/migrations/Migration20240227120221.d.ts.map +1 -1
  20. package/dist/migrations/Migration20240227120221.js +2 -10
  21. package/dist/models/application-method.d.ts +6 -4
  22. package/dist/models/application-method.d.ts.map +1 -1
  23. package/dist/models/application-method.js +6 -16
  24. package/dist/models/campaign-budget.d.ts +5 -6
  25. package/dist/models/campaign-budget.d.ts.map +1 -1
  26. package/dist/models/campaign-budget.js +4 -8
  27. package/dist/models/campaign.d.ts +4 -3
  28. package/dist/models/campaign.d.ts.map +1 -1
  29. package/dist/models/campaign.js +13 -10
  30. package/dist/models/promotion-rule-value.d.ts +1 -2
  31. package/dist/models/promotion-rule-value.d.ts.map +1 -1
  32. package/dist/models/promotion-rule-value.js +1 -1
  33. package/dist/models/promotion-rule.d.ts +1 -1
  34. package/dist/models/promotion-rule.d.ts.map +1 -1
  35. package/dist/models/promotion.d.ts +4 -5
  36. package/dist/models/promotion.d.ts.map +1 -1
  37. package/dist/models/promotion.js +4 -8
  38. package/dist/module-definition.d.ts +5 -0
  39. package/dist/module-definition.d.ts.map +1 -0
  40. package/dist/module-definition.js +50 -0
  41. package/dist/repositories/campaign.d.ts +16 -0
  42. package/dist/repositories/campaign.d.ts.map +1 -0
  43. package/dist/repositories/campaign.js +90 -0
  44. package/dist/repositories/index.d.ts +3 -0
  45. package/dist/repositories/index.d.ts.map +1 -0
  46. package/dist/repositories/index.js +7 -0
  47. package/dist/services/promotion-module.d.ts +26 -41
  48. package/dist/services/promotion-module.d.ts.map +1 -1
  49. package/dist/services/promotion-module.js +72 -271
  50. package/dist/types/application-method.d.ts +10 -12
  51. package/dist/types/application-method.d.ts.map +1 -1
  52. package/dist/types/campaign-budget.d.ts +6 -8
  53. package/dist/types/campaign-budget.d.ts.map +1 -1
  54. package/dist/types/campaign.d.ts +8 -6
  55. package/dist/types/campaign.d.ts.map +1 -1
  56. package/dist/types/promotion.d.ts +2 -2
  57. package/dist/types/promotion.d.ts.map +1 -1
  58. package/dist/utils/compute-actions/buy-get.d.ts +3 -6
  59. package/dist/utils/compute-actions/buy-get.d.ts.map +1 -1
  60. package/dist/utils/compute-actions/buy-get.js +30 -94
  61. package/dist/utils/compute-actions/line-items.d.ts.map +1 -1
  62. package/dist/utils/compute-actions/line-items.js +5 -5
  63. package/dist/utils/compute-actions/shipping-methods.d.ts +2 -2
  64. package/dist/utils/compute-actions/shipping-methods.d.ts.map +1 -1
  65. package/dist/utils/compute-actions/shipping-methods.js +18 -16
  66. package/dist/utils/compute-actions/usage.d.ts +3 -2
  67. package/dist/utils/compute-actions/usage.d.ts.map +1 -1
  68. package/dist/utils/compute-actions/usage.js +11 -4
  69. package/dist/utils/validations/application-method.d.ts.map +1 -1
  70. package/dist/utils/validations/application-method.js +2 -2
  71. package/dist/utils/validations/promotion-rule.d.ts +2 -2
  72. package/dist/utils/validations/promotion-rule.d.ts.map +1 -1
  73. package/dist/utils/validations/promotion-rule.js +2 -22
  74. package/package.json +14 -9
  75. package/dist/migrations/Migration20240617102917.d.ts +0 -6
  76. package/dist/migrations/Migration20240617102917.d.ts.map +0 -1
  77. package/dist/migrations/Migration20240617102917.js +0 -15
  78. package/dist/migrations/Migration20240624153824.d.ts +0 -6
  79. package/dist/migrations/Migration20240624153824.d.ts.map +0 -1
  80. package/dist/migrations/Migration20240624153824.js +0 -15
  81. package/dist/schema/index.d.ts +0 -3
  82. package/dist/schema/index.d.ts.map +0 -1
  83. package/dist/schema/index.js +0 -98
@@ -1,3 +0,0 @@
1
- declare const _default: "\nenum PromotionTypeValues {\n standard\n buyget\n}\n\nenum PromotionRuleOperatorValues {\n gt\n lt\n eq\n ne\n in\n lte\n gte\n}\n\nenum CampaignBudgetTypeValues {\n spend\n usage\n}\n\nenum ApplicationMethodTypeValues {\n fixed\n percentage\n}\n\nenum ApplicationMethodTargetTypeValues {\n order\n shipping_methods\n items\n}\n\nenum ApplicationMethodAllocationValues {\n each\n across\n}\n\ntype Promotion {\n id: ID!\n code: String\n type: PromotionTypeValues\n is_automatic: Boolean\n application_method: ApplicationMethod\n rules: [PromotionRule]\n campaign_id: String\n campaign: Campaign\n}\n\ntype PromotionRule {\n id: ID!\n description: String\n attribute: String\n operator: PromotionRuleOperatorValues\n values: [PromotionRuleValue!]!\n}\n\ntype PromotionRuleValue {\n id: ID!\n value: String\n}\n\ntype Campaign {\n id: ID!\n name: String\n description: String\n campaign_identifier: String\n starts_at: DateTime\n ends_at: DateTime\n budget: CampaignBudget\n promotions: [Promotion]\n}\n\ntype CampaignBudget {\n id: ID!\n type: CampaignBudgetTypeValues\n limit: Int\n used: Int\n currency_code: String\n}\n\ntype ApplicationMethod {\n id: ID!\n type: ApplicationMethodTypeValues\n target_type: ApplicationMethodTargetTypeValues\n allocation: ApplicationMethodAllocationValues\n value: Float\n currency_code: String\n max_quantity: Int\n buy_rules_min_quantity: Int\n apply_to_quantity: Int\n promotion: Promotion\n target_rules: [PromotionRule]\n buy_rules: [PromotionRule]\n}\n\n";
2
- export default _default;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":";AAAA,wBA+FC"}
@@ -1,98 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = `
4
- enum PromotionTypeValues {
5
- standard
6
- buyget
7
- }
8
-
9
- enum PromotionRuleOperatorValues {
10
- gt
11
- lt
12
- eq
13
- ne
14
- in
15
- lte
16
- gte
17
- }
18
-
19
- enum CampaignBudgetTypeValues {
20
- spend
21
- usage
22
- }
23
-
24
- enum ApplicationMethodTypeValues {
25
- fixed
26
- percentage
27
- }
28
-
29
- enum ApplicationMethodTargetTypeValues {
30
- order
31
- shipping_methods
32
- items
33
- }
34
-
35
- enum ApplicationMethodAllocationValues {
36
- each
37
- across
38
- }
39
-
40
- type Promotion {
41
- id: ID!
42
- code: String
43
- type: PromotionTypeValues
44
- is_automatic: Boolean
45
- application_method: ApplicationMethod
46
- rules: [PromotionRule]
47
- campaign_id: String
48
- campaign: Campaign
49
- }
50
-
51
- type PromotionRule {
52
- id: ID!
53
- description: String
54
- attribute: String
55
- operator: PromotionRuleOperatorValues
56
- values: [PromotionRuleValue!]!
57
- }
58
-
59
- type PromotionRuleValue {
60
- id: ID!
61
- value: String
62
- }
63
-
64
- type Campaign {
65
- id: ID!
66
- name: String
67
- description: String
68
- campaign_identifier: String
69
- starts_at: DateTime
70
- ends_at: DateTime
71
- budget: CampaignBudget
72
- promotions: [Promotion]
73
- }
74
-
75
- type CampaignBudget {
76
- id: ID!
77
- type: CampaignBudgetTypeValues
78
- limit: Int
79
- used: Int
80
- currency_code: String
81
- }
82
-
83
- type ApplicationMethod {
84
- id: ID!
85
- type: ApplicationMethodTypeValues
86
- target_type: ApplicationMethodTargetTypeValues
87
- allocation: ApplicationMethodAllocationValues
88
- value: Float
89
- currency_code: String
90
- max_quantity: Int
91
- buy_rules_min_quantity: Int
92
- apply_to_quantity: Int
93
- promotion: Promotion
94
- target_rules: [PromotionRule]
95
- buy_rules: [PromotionRule]
96
- }
97
-
98
- `;