@wix/auto_sdk_loyalty_earning-rules 1.0.7 → 1.0.8

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.
Files changed (134) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.d.ts +28 -0
  11. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js +35 -0
  12. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js.map +1 -0
  13. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.d.ts +48 -0
  14. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js +353 -0
  15. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js.map +1 -0
  16. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.d.ts +28 -0
  17. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js +180 -0
  18. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js.map +1 -0
  19. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.d.ts +93 -0
  20. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js +93 -0
  21. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js.map +1 -0
  22. package/build/{loyalty-v1-loyalty-earning-rule-earning-rules.universal-ByA9SEhi.d.mts → cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts} +65 -202
  23. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +37 -0
  24. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js.map +1 -0
  25. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.d.ts +839 -0
  26. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +400 -0
  27. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.d.ts +28 -0
  39. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js +28 -0
  40. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js.map +1 -0
  41. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.d.ts +48 -0
  42. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js +342 -0
  43. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js.map +1 -0
  44. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.d.ts +28 -0
  45. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js +146 -0
  46. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js.map +1 -0
  47. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.d.ts +93 -0
  48. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js +78 -0
  49. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js.map +1 -0
  50. package/build/{loyalty-v1-loyalty-earning-rule-earning-rules.universal-ByA9SEhi.d.ts → es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts} +65 -202
  51. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +34 -0
  52. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js.map +1 -0
  53. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.d.ts +839 -0
  54. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +366 -0
  55. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.d.ts +28 -0
  66. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js +35 -0
  67. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js.map +1 -0
  68. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.d.ts +48 -0
  69. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js +353 -0
  70. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js.map +1 -0
  71. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.d.ts +28 -0
  72. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js +180 -0
  73. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js.map +1 -0
  74. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.d.ts +93 -0
  75. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js +93 -0
  76. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js.map +1 -0
  77. package/build/internal/{loyalty-v1-loyalty-earning-rule-earning-rules.universal-DOjaPKYu.d.mts → cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts} +65 -207
  78. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +37 -0
  79. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js.map +1 -0
  80. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.d.ts +844 -0
  81. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +400 -0
  82. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.d.ts +28 -0
  93. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js +28 -0
  94. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js.map +1 -0
  95. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.d.ts +48 -0
  96. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js +342 -0
  97. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js.map +1 -0
  98. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.d.ts +28 -0
  99. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js +146 -0
  100. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js.map +1 -0
  101. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.d.ts +93 -0
  102. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js +78 -0
  103. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js.map +1 -0
  104. package/build/internal/{loyalty-v1-loyalty-earning-rule-earning-rules.universal-DOjaPKYu.d.ts → es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts} +65 -207
  105. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +34 -0
  106. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js.map +1 -0
  107. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.d.ts +844 -0
  108. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +366 -0
  109. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js.map +1 -0
  110. package/package.json +11 -12
  111. package/build/index.d.mts +0 -112
  112. package/build/index.d.ts +0 -112
  113. package/build/index.js +0 -732
  114. package/build/index.js.map +0 -1
  115. package/build/index.mjs +0 -694
  116. package/build/index.mjs.map +0 -1
  117. package/build/internal/index.d.mts +0 -112
  118. package/build/internal/index.d.ts +0 -112
  119. package/build/internal/index.js +0 -732
  120. package/build/internal/index.js.map +0 -1
  121. package/build/internal/index.mjs +0 -694
  122. package/build/internal/index.mjs.map +0 -1
  123. package/build/internal/meta.d.mts +0 -322
  124. package/build/internal/meta.d.ts +0 -322
  125. package/build/internal/meta.js +0 -500
  126. package/build/internal/meta.js.map +0 -1
  127. package/build/internal/meta.mjs +0 -466
  128. package/build/internal/meta.mjs.map +0 -1
  129. package/build/meta.d.mts +0 -322
  130. package/build/meta.d.ts +0 -322
  131. package/build/meta.js +0 -500
  132. package/build/meta.js.map +0 -1
  133. package/build/meta.mjs +0 -466
  134. package/build/meta.mjs.map +0 -1
package/build/meta.d.mts DELETED
@@ -1,322 +0,0 @@
1
- import { k as CreateLoyaltyEarningRuleRequest$1, l as CreateLoyaltyEarningRuleResponse$1, m as BulkCreateLoyaltyEarningRulesRequest$1, B as BulkCreateLoyaltyEarningRulesResponse$1, p as CreateCustomLoyaltyEarningRuleRequest$1, a as CreateCustomLoyaltyEarningRuleResponse$1, G as GetLoyaltyEarningRuleRequest$1, s as GetLoyaltyEarningRuleResponse$1, t as UpdateLoyaltyEarningRuleRequest$1, b as UpdateLoyaltyEarningRuleResponse$1, u as DeleteLoyaltyEarningRuleRequest$1, v as DeleteLoyaltyEarningRuleResponse$1, w as DeleteAutomationEarningRuleRequest$1, x as DeleteAutomationEarningRuleResponse$1, y as ListEarningRulesRequest$1, d as ListEarningRulesResponse$1 } from './loyalty-v1-loyalty-earning-rule-earning-rules.universal-ByA9SEhi.mjs';
2
-
3
- /**
4
- * A loyalty earning rule defines how customers earn points in a loyalty program.
5
- * You can create rules for different activities, such as making purchases.
6
- */
7
- interface LoyaltyEarningRule extends LoyaltyEarningRuleTypeOneOf {
8
- /** Fixed amount of points awarded for each qualifying activity. */
9
- fixedAmount?: FixedAmount;
10
- /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
11
- conversionRate?: ConversionRate;
12
- /**
13
- * Loyalty earning rule ID.
14
- * @format GUID
15
- * @readonly
16
- */
17
- id?: string | null;
18
- /**
19
- * ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID.
20
- * @format GUID
21
- */
22
- sourceAppId?: string;
23
- /**
24
- * ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events.
25
- * @minLength 1
26
- * @maxLength 80
27
- */
28
- triggerAppId?: string;
29
- /**
30
- * Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`.
31
- * @minLength 1
32
- * @maxLength 80
33
- */
34
- triggerActivityType?: string;
35
- /**
36
- * Name of the earning rule.
37
- * @minLength 1
38
- * @maxLength 50
39
- */
40
- title?: string;
41
- /** Current status of the earning rule. */
42
- status?: Status;
43
- /**
44
- * Revision number, incremented by 1 each time the earning rule is updated.
45
- * Pass the latest revision when updating to prevent conflicting changes.
46
- */
47
- revision?: string | null;
48
- /**
49
- * Date and time the earning rule was created.
50
- * @readonly
51
- */
52
- createdDate?: Date | null;
53
- /**
54
- * Date and time the earning rule was last updated.
55
- * @readonly
56
- */
57
- updatedDate?: Date | null;
58
- /**
59
- * Additional metadata about the earning rule.
60
- * @readonly
61
- */
62
- metadata?: Metadata;
63
- }
64
- /** @oneof */
65
- interface LoyaltyEarningRuleTypeOneOf {
66
- /** Fixed amount of points awarded for each qualifying activity. */
67
- fixedAmount?: FixedAmount;
68
- /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
69
- conversionRate?: ConversionRate;
70
- }
71
- /** Fixed amount type of earning rule. */
72
- interface FixedAmount {
73
- /**
74
- * Fixed amount configurations for each tier.
75
- * @maxSize 21
76
- */
77
- configs?: FixedAmountConfig[];
78
- }
79
- interface FixedAmountConfig {
80
- /**
81
- * Tier ID. If empty, the [base tier](https://dev.wix.com/docs/rest/crm/loyalty-program/tiers/introduction#terminology) is used.
82
- * @format GUID
83
- * @readonly
84
- */
85
- tierId?: string | null;
86
- /** Number of points to award. */
87
- points?: number;
88
- }
89
- /**
90
- * Conversion rate type of earning rule.
91
- * Customers earn points based on the amount spent.
92
- * For example, for every $10 spent, a customer might earn 1 point.
93
- */
94
- interface ConversionRate {
95
- /**
96
- * Conversion rate configurations for each tier.
97
- *
98
- * Points are awarded proportionally to the amount spent.
99
- *
100
- * Formula: `(amount spent) / (money_amount * points)`.
101
- * @maxSize 21
102
- */
103
- configs?: ConversionRateConfig[];
104
- /**
105
- * Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.
106
- * For example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.
107
- * This field is only applicable for automated earning rules.
108
- */
109
- field?: string | null;
110
- }
111
- interface ConversionRateConfig {
112
- /**
113
- * Tier ID. If empty, the [base tier](https://dev.wix.com/docs/rest/crm/loyalty-program/tiers/introduction) is used.
114
- * @format GUID
115
- * @readonly
116
- */
117
- tierId?: string | null;
118
- /**
119
- * The amount of money used as a reference for point calculation.
120
- * Points are awarded proportionally to the amount spent.
121
- *
122
- * For example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).
123
- *
124
- * Formula for points is: `(amount spent) / (money_amount * points)`.
125
- */
126
- moneyAmount?: number;
127
- /**
128
- * Points given for the specified `money_amount`.
129
- * Works in conjunction with `money_amount` to define the earning rule.
130
- *
131
- * For example: If `money_amount` is 20 and `points` is 10:
132
- * - Spending 10 units of currency earns 5 points
133
- * - Spending 20 units of currency earns 10 points
134
- * - Spending 30 units of currency earns 15 points
135
- */
136
- points?: number;
137
- }
138
- declare enum Status {
139
- /** Status is unknown or not specified. */
140
- UNKNOWN = "UNKNOWN",
141
- /** Earning rule is active and can assign points. */
142
- ACTIVE = "ACTIVE",
143
- /** Earning rule is paused and can't assign points. */
144
- PAUSED = "PAUSED"
145
- }
146
- interface Metadata {
147
- /** Whether the earning rule can be deleted. */
148
- canBeDeleted?: boolean;
149
- }
150
- interface CreateLoyaltyEarningRuleRequest {
151
- /** Earning rule to create. */
152
- earningRule: LoyaltyEarningRule;
153
- }
154
- interface CreateLoyaltyEarningRuleResponse {
155
- /** Created earning rule. */
156
- earningRule?: LoyaltyEarningRule;
157
- }
158
- interface BulkCreateLoyaltyEarningRulesRequest {
159
- /**
160
- * Earning rules to create.
161
- * @minSize 1
162
- * @maxSize 100
163
- */
164
- earningRules: LoyaltyEarningRule[];
165
- }
166
- interface BulkCreateLoyaltyEarningRulesResponse {
167
- /** Created earning rules. */
168
- results?: BulkLoyaltyEarningRuleResult[];
169
- /** Additional metadata for the created earning rules. */
170
- bulkActionMetadata?: BulkActionMetadata;
171
- }
172
- interface BulkLoyaltyEarningRuleResult {
173
- /** Additional metadata for the created earning rules. */
174
- itemMetadata?: ItemMetadata;
175
- /** Created earning rule. */
176
- item?: LoyaltyEarningRule;
177
- }
178
- interface ItemMetadata {
179
- /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
180
- id?: string | null;
181
- /** Index of the item within the request array. Allows for correlation between request and response items. */
182
- originalIndex?: number;
183
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
184
- success?: boolean;
185
- /** Details about the error in case of failure. */
186
- error?: ApplicationError;
187
- }
188
- interface ApplicationError {
189
- /** Error code. */
190
- code?: string;
191
- /** Description of the error. */
192
- description?: string;
193
- /** Data related to the error. */
194
- data?: Record<string, any> | null;
195
- }
196
- interface BulkActionMetadata {
197
- /** Number of items that were successfully processed. */
198
- totalSuccesses?: number;
199
- /** Number of items that couldn't be processed. */
200
- totalFailures?: number;
201
- /** Number of failures without details because detailed failure threshold was exceeded. */
202
- undetailedFailures?: number;
203
- }
204
- interface CreateCustomLoyaltyEarningRuleRequest {
205
- /** Type of the custom earning rule. */
206
- type: Type;
207
- /** Custom earning rule to create. */
208
- earningRule?: CustomLoyaltyEarningRule;
209
- }
210
- declare enum Type {
211
- /** Unknown type. This value is not used. */
212
- UNKNOWN_TYPE = "UNKNOWN_TYPE",
213
- /** Earning rule for social media. */
214
- SOCIAL_MEDIA = "SOCIAL_MEDIA",
215
- /** Earning rule for birthdays. */
216
- BIRTHDAY = "BIRTHDAY"
217
- }
218
- /** Used in CreateCustomLoyaltyEarningRuleRequest */
219
- interface CustomLoyaltyEarningRule extends CustomLoyaltyEarningRuleTypeOneOf {
220
- /** Fixed amount of points awarded for each qualifying activity. */
221
- fixedAmount?: FixedAmount;
222
- /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
223
- conversionRate?: ConversionRate;
224
- /**
225
- * Name of the earning rule.
226
- * @minLength 1
227
- * @maxLength 50
228
- */
229
- title?: string;
230
- }
231
- /** @oneof */
232
- interface CustomLoyaltyEarningRuleTypeOneOf {
233
- /** Fixed amount of points awarded for each qualifying activity. */
234
- fixedAmount?: FixedAmount;
235
- /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
236
- conversionRate?: ConversionRate;
237
- }
238
- interface CreateCustomLoyaltyEarningRuleResponse {
239
- /** Created earning rule. */
240
- earningRule?: LoyaltyEarningRule;
241
- }
242
- interface GetLoyaltyEarningRuleRequest {
243
- /**
244
- * ID of the earning rule to retrieve.
245
- * @format GUID
246
- */
247
- id: string;
248
- }
249
- interface GetLoyaltyEarningRuleResponse {
250
- /** Retrieved earning rule. */
251
- earningRule?: LoyaltyEarningRule;
252
- }
253
- interface UpdateLoyaltyEarningRuleRequest {
254
- /** Earning rule to update. */
255
- earningRule: LoyaltyEarningRule;
256
- }
257
- interface UpdateLoyaltyEarningRuleResponse {
258
- /** The updated earning rule. */
259
- earningRule?: LoyaltyEarningRule;
260
- }
261
- interface DeleteLoyaltyEarningRuleRequest {
262
- /**
263
- * ID of the earning rule to delete.
264
- * @format GUID
265
- */
266
- id: string;
267
- /**
268
- * Revision of the earning rule. Incremented by 1 each time the earning rule is updated.
269
- * Pass the latest revision when updating to prevent conflicting changes.
270
- */
271
- revision?: string;
272
- }
273
- interface DeleteLoyaltyEarningRuleResponse {
274
- }
275
- interface DeleteAutomationEarningRuleRequest {
276
- /**
277
- * ID of the earning rule to delete.
278
- * @format GUID
279
- */
280
- id: string;
281
- }
282
- interface DeleteAutomationEarningRuleResponse {
283
- }
284
- interface ListEarningRulesRequest {
285
- /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */
286
- triggerAppId?: string | null;
287
- /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */
288
- triggerActivityType?: string | null;
289
- }
290
- interface ListEarningRulesResponse {
291
- /** Retrieved earning rules. */
292
- earningRules?: LoyaltyEarningRule[];
293
- }
294
-
295
- type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
296
- getUrl: (context: any) => string;
297
- httpMethod: K;
298
- path: string;
299
- pathParams: M;
300
- __requestType: T;
301
- __originalRequestType: S;
302
- __responseType: Q;
303
- __originalResponseType: R;
304
- };
305
- declare function createLoyaltyEarningRule(): __PublicMethodMetaInfo<'POST', {}, CreateLoyaltyEarningRuleRequest$1, CreateLoyaltyEarningRuleRequest, CreateLoyaltyEarningRuleResponse$1, CreateLoyaltyEarningRuleResponse>;
306
- declare function bulkCreateLoyaltyEarningRules(): __PublicMethodMetaInfo<'POST', {}, BulkCreateLoyaltyEarningRulesRequest$1, BulkCreateLoyaltyEarningRulesRequest, BulkCreateLoyaltyEarningRulesResponse$1, BulkCreateLoyaltyEarningRulesResponse>;
307
- declare function createCustomLoyaltyEarningRule(): __PublicMethodMetaInfo<'POST', {}, CreateCustomLoyaltyEarningRuleRequest$1, CreateCustomLoyaltyEarningRuleRequest, CreateCustomLoyaltyEarningRuleResponse$1, CreateCustomLoyaltyEarningRuleResponse>;
308
- declare function getLoyaltyEarningRule(): __PublicMethodMetaInfo<'GET', {
309
- id: string;
310
- }, GetLoyaltyEarningRuleRequest$1, GetLoyaltyEarningRuleRequest, GetLoyaltyEarningRuleResponse$1, GetLoyaltyEarningRuleResponse>;
311
- declare function updateLoyaltyEarningRule(): __PublicMethodMetaInfo<'PUT', {
312
- earningRuleId: string;
313
- }, UpdateLoyaltyEarningRuleRequest$1, UpdateLoyaltyEarningRuleRequest, UpdateLoyaltyEarningRuleResponse$1, UpdateLoyaltyEarningRuleResponse>;
314
- declare function deleteLoyaltyEarningRule(): __PublicMethodMetaInfo<'DELETE', {
315
- id: string;
316
- }, DeleteLoyaltyEarningRuleRequest$1, DeleteLoyaltyEarningRuleRequest, DeleteLoyaltyEarningRuleResponse$1, DeleteLoyaltyEarningRuleResponse>;
317
- declare function deleteAutomationEarningRule(): __PublicMethodMetaInfo<'DELETE', {
318
- id: string;
319
- }, DeleteAutomationEarningRuleRequest$1, DeleteAutomationEarningRuleRequest, DeleteAutomationEarningRuleResponse$1, DeleteAutomationEarningRuleResponse>;
320
- declare function listEarningRules(): __PublicMethodMetaInfo<'GET', {}, ListEarningRulesRequest$1, ListEarningRulesRequest, ListEarningRulesResponse$1, ListEarningRulesResponse>;
321
-
322
- export { type __PublicMethodMetaInfo, bulkCreateLoyaltyEarningRules, createCustomLoyaltyEarningRule, createLoyaltyEarningRule, deleteAutomationEarningRule, deleteLoyaltyEarningRule, getLoyaltyEarningRule, listEarningRules, updateLoyaltyEarningRule };
package/build/meta.d.ts DELETED
@@ -1,322 +0,0 @@
1
- import { k as CreateLoyaltyEarningRuleRequest$1, l as CreateLoyaltyEarningRuleResponse$1, m as BulkCreateLoyaltyEarningRulesRequest$1, B as BulkCreateLoyaltyEarningRulesResponse$1, p as CreateCustomLoyaltyEarningRuleRequest$1, a as CreateCustomLoyaltyEarningRuleResponse$1, G as GetLoyaltyEarningRuleRequest$1, s as GetLoyaltyEarningRuleResponse$1, t as UpdateLoyaltyEarningRuleRequest$1, b as UpdateLoyaltyEarningRuleResponse$1, u as DeleteLoyaltyEarningRuleRequest$1, v as DeleteLoyaltyEarningRuleResponse$1, w as DeleteAutomationEarningRuleRequest$1, x as DeleteAutomationEarningRuleResponse$1, y as ListEarningRulesRequest$1, d as ListEarningRulesResponse$1 } from './loyalty-v1-loyalty-earning-rule-earning-rules.universal-ByA9SEhi.js';
2
-
3
- /**
4
- * A loyalty earning rule defines how customers earn points in a loyalty program.
5
- * You can create rules for different activities, such as making purchases.
6
- */
7
- interface LoyaltyEarningRule extends LoyaltyEarningRuleTypeOneOf {
8
- /** Fixed amount of points awarded for each qualifying activity. */
9
- fixedAmount?: FixedAmount;
10
- /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
11
- conversionRate?: ConversionRate;
12
- /**
13
- * Loyalty earning rule ID.
14
- * @format GUID
15
- * @readonly
16
- */
17
- id?: string | null;
18
- /**
19
- * ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID.
20
- * @format GUID
21
- */
22
- sourceAppId?: string;
23
- /**
24
- * ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events.
25
- * @minLength 1
26
- * @maxLength 80
27
- */
28
- triggerAppId?: string;
29
- /**
30
- * Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`.
31
- * @minLength 1
32
- * @maxLength 80
33
- */
34
- triggerActivityType?: string;
35
- /**
36
- * Name of the earning rule.
37
- * @minLength 1
38
- * @maxLength 50
39
- */
40
- title?: string;
41
- /** Current status of the earning rule. */
42
- status?: Status;
43
- /**
44
- * Revision number, incremented by 1 each time the earning rule is updated.
45
- * Pass the latest revision when updating to prevent conflicting changes.
46
- */
47
- revision?: string | null;
48
- /**
49
- * Date and time the earning rule was created.
50
- * @readonly
51
- */
52
- createdDate?: Date | null;
53
- /**
54
- * Date and time the earning rule was last updated.
55
- * @readonly
56
- */
57
- updatedDate?: Date | null;
58
- /**
59
- * Additional metadata about the earning rule.
60
- * @readonly
61
- */
62
- metadata?: Metadata;
63
- }
64
- /** @oneof */
65
- interface LoyaltyEarningRuleTypeOneOf {
66
- /** Fixed amount of points awarded for each qualifying activity. */
67
- fixedAmount?: FixedAmount;
68
- /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
69
- conversionRate?: ConversionRate;
70
- }
71
- /** Fixed amount type of earning rule. */
72
- interface FixedAmount {
73
- /**
74
- * Fixed amount configurations for each tier.
75
- * @maxSize 21
76
- */
77
- configs?: FixedAmountConfig[];
78
- }
79
- interface FixedAmountConfig {
80
- /**
81
- * Tier ID. If empty, the [base tier](https://dev.wix.com/docs/rest/crm/loyalty-program/tiers/introduction#terminology) is used.
82
- * @format GUID
83
- * @readonly
84
- */
85
- tierId?: string | null;
86
- /** Number of points to award. */
87
- points?: number;
88
- }
89
- /**
90
- * Conversion rate type of earning rule.
91
- * Customers earn points based on the amount spent.
92
- * For example, for every $10 spent, a customer might earn 1 point.
93
- */
94
- interface ConversionRate {
95
- /**
96
- * Conversion rate configurations for each tier.
97
- *
98
- * Points are awarded proportionally to the amount spent.
99
- *
100
- * Formula: `(amount spent) / (money_amount * points)`.
101
- * @maxSize 21
102
- */
103
- configs?: ConversionRateConfig[];
104
- /**
105
- * Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.
106
- * For example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.
107
- * This field is only applicable for automated earning rules.
108
- */
109
- field?: string | null;
110
- }
111
- interface ConversionRateConfig {
112
- /**
113
- * Tier ID. If empty, the [base tier](https://dev.wix.com/docs/rest/crm/loyalty-program/tiers/introduction) is used.
114
- * @format GUID
115
- * @readonly
116
- */
117
- tierId?: string | null;
118
- /**
119
- * The amount of money used as a reference for point calculation.
120
- * Points are awarded proportionally to the amount spent.
121
- *
122
- * For example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).
123
- *
124
- * Formula for points is: `(amount spent) / (money_amount * points)`.
125
- */
126
- moneyAmount?: number;
127
- /**
128
- * Points given for the specified `money_amount`.
129
- * Works in conjunction with `money_amount` to define the earning rule.
130
- *
131
- * For example: If `money_amount` is 20 and `points` is 10:
132
- * - Spending 10 units of currency earns 5 points
133
- * - Spending 20 units of currency earns 10 points
134
- * - Spending 30 units of currency earns 15 points
135
- */
136
- points?: number;
137
- }
138
- declare enum Status {
139
- /** Status is unknown or not specified. */
140
- UNKNOWN = "UNKNOWN",
141
- /** Earning rule is active and can assign points. */
142
- ACTIVE = "ACTIVE",
143
- /** Earning rule is paused and can't assign points. */
144
- PAUSED = "PAUSED"
145
- }
146
- interface Metadata {
147
- /** Whether the earning rule can be deleted. */
148
- canBeDeleted?: boolean;
149
- }
150
- interface CreateLoyaltyEarningRuleRequest {
151
- /** Earning rule to create. */
152
- earningRule: LoyaltyEarningRule;
153
- }
154
- interface CreateLoyaltyEarningRuleResponse {
155
- /** Created earning rule. */
156
- earningRule?: LoyaltyEarningRule;
157
- }
158
- interface BulkCreateLoyaltyEarningRulesRequest {
159
- /**
160
- * Earning rules to create.
161
- * @minSize 1
162
- * @maxSize 100
163
- */
164
- earningRules: LoyaltyEarningRule[];
165
- }
166
- interface BulkCreateLoyaltyEarningRulesResponse {
167
- /** Created earning rules. */
168
- results?: BulkLoyaltyEarningRuleResult[];
169
- /** Additional metadata for the created earning rules. */
170
- bulkActionMetadata?: BulkActionMetadata;
171
- }
172
- interface BulkLoyaltyEarningRuleResult {
173
- /** Additional metadata for the created earning rules. */
174
- itemMetadata?: ItemMetadata;
175
- /** Created earning rule. */
176
- item?: LoyaltyEarningRule;
177
- }
178
- interface ItemMetadata {
179
- /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
180
- id?: string | null;
181
- /** Index of the item within the request array. Allows for correlation between request and response items. */
182
- originalIndex?: number;
183
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
184
- success?: boolean;
185
- /** Details about the error in case of failure. */
186
- error?: ApplicationError;
187
- }
188
- interface ApplicationError {
189
- /** Error code. */
190
- code?: string;
191
- /** Description of the error. */
192
- description?: string;
193
- /** Data related to the error. */
194
- data?: Record<string, any> | null;
195
- }
196
- interface BulkActionMetadata {
197
- /** Number of items that were successfully processed. */
198
- totalSuccesses?: number;
199
- /** Number of items that couldn't be processed. */
200
- totalFailures?: number;
201
- /** Number of failures without details because detailed failure threshold was exceeded. */
202
- undetailedFailures?: number;
203
- }
204
- interface CreateCustomLoyaltyEarningRuleRequest {
205
- /** Type of the custom earning rule. */
206
- type: Type;
207
- /** Custom earning rule to create. */
208
- earningRule?: CustomLoyaltyEarningRule;
209
- }
210
- declare enum Type {
211
- /** Unknown type. This value is not used. */
212
- UNKNOWN_TYPE = "UNKNOWN_TYPE",
213
- /** Earning rule for social media. */
214
- SOCIAL_MEDIA = "SOCIAL_MEDIA",
215
- /** Earning rule for birthdays. */
216
- BIRTHDAY = "BIRTHDAY"
217
- }
218
- /** Used in CreateCustomLoyaltyEarningRuleRequest */
219
- interface CustomLoyaltyEarningRule extends CustomLoyaltyEarningRuleTypeOneOf {
220
- /** Fixed amount of points awarded for each qualifying activity. */
221
- fixedAmount?: FixedAmount;
222
- /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
223
- conversionRate?: ConversionRate;
224
- /**
225
- * Name of the earning rule.
226
- * @minLength 1
227
- * @maxLength 50
228
- */
229
- title?: string;
230
- }
231
- /** @oneof */
232
- interface CustomLoyaltyEarningRuleTypeOneOf {
233
- /** Fixed amount of points awarded for each qualifying activity. */
234
- fixedAmount?: FixedAmount;
235
- /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
236
- conversionRate?: ConversionRate;
237
- }
238
- interface CreateCustomLoyaltyEarningRuleResponse {
239
- /** Created earning rule. */
240
- earningRule?: LoyaltyEarningRule;
241
- }
242
- interface GetLoyaltyEarningRuleRequest {
243
- /**
244
- * ID of the earning rule to retrieve.
245
- * @format GUID
246
- */
247
- id: string;
248
- }
249
- interface GetLoyaltyEarningRuleResponse {
250
- /** Retrieved earning rule. */
251
- earningRule?: LoyaltyEarningRule;
252
- }
253
- interface UpdateLoyaltyEarningRuleRequest {
254
- /** Earning rule to update. */
255
- earningRule: LoyaltyEarningRule;
256
- }
257
- interface UpdateLoyaltyEarningRuleResponse {
258
- /** The updated earning rule. */
259
- earningRule?: LoyaltyEarningRule;
260
- }
261
- interface DeleteLoyaltyEarningRuleRequest {
262
- /**
263
- * ID of the earning rule to delete.
264
- * @format GUID
265
- */
266
- id: string;
267
- /**
268
- * Revision of the earning rule. Incremented by 1 each time the earning rule is updated.
269
- * Pass the latest revision when updating to prevent conflicting changes.
270
- */
271
- revision?: string;
272
- }
273
- interface DeleteLoyaltyEarningRuleResponse {
274
- }
275
- interface DeleteAutomationEarningRuleRequest {
276
- /**
277
- * ID of the earning rule to delete.
278
- * @format GUID
279
- */
280
- id: string;
281
- }
282
- interface DeleteAutomationEarningRuleResponse {
283
- }
284
- interface ListEarningRulesRequest {
285
- /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */
286
- triggerAppId?: string | null;
287
- /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */
288
- triggerActivityType?: string | null;
289
- }
290
- interface ListEarningRulesResponse {
291
- /** Retrieved earning rules. */
292
- earningRules?: LoyaltyEarningRule[];
293
- }
294
-
295
- type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
296
- getUrl: (context: any) => string;
297
- httpMethod: K;
298
- path: string;
299
- pathParams: M;
300
- __requestType: T;
301
- __originalRequestType: S;
302
- __responseType: Q;
303
- __originalResponseType: R;
304
- };
305
- declare function createLoyaltyEarningRule(): __PublicMethodMetaInfo<'POST', {}, CreateLoyaltyEarningRuleRequest$1, CreateLoyaltyEarningRuleRequest, CreateLoyaltyEarningRuleResponse$1, CreateLoyaltyEarningRuleResponse>;
306
- declare function bulkCreateLoyaltyEarningRules(): __PublicMethodMetaInfo<'POST', {}, BulkCreateLoyaltyEarningRulesRequest$1, BulkCreateLoyaltyEarningRulesRequest, BulkCreateLoyaltyEarningRulesResponse$1, BulkCreateLoyaltyEarningRulesResponse>;
307
- declare function createCustomLoyaltyEarningRule(): __PublicMethodMetaInfo<'POST', {}, CreateCustomLoyaltyEarningRuleRequest$1, CreateCustomLoyaltyEarningRuleRequest, CreateCustomLoyaltyEarningRuleResponse$1, CreateCustomLoyaltyEarningRuleResponse>;
308
- declare function getLoyaltyEarningRule(): __PublicMethodMetaInfo<'GET', {
309
- id: string;
310
- }, GetLoyaltyEarningRuleRequest$1, GetLoyaltyEarningRuleRequest, GetLoyaltyEarningRuleResponse$1, GetLoyaltyEarningRuleResponse>;
311
- declare function updateLoyaltyEarningRule(): __PublicMethodMetaInfo<'PUT', {
312
- earningRuleId: string;
313
- }, UpdateLoyaltyEarningRuleRequest$1, UpdateLoyaltyEarningRuleRequest, UpdateLoyaltyEarningRuleResponse$1, UpdateLoyaltyEarningRuleResponse>;
314
- declare function deleteLoyaltyEarningRule(): __PublicMethodMetaInfo<'DELETE', {
315
- id: string;
316
- }, DeleteLoyaltyEarningRuleRequest$1, DeleteLoyaltyEarningRuleRequest, DeleteLoyaltyEarningRuleResponse$1, DeleteLoyaltyEarningRuleResponse>;
317
- declare function deleteAutomationEarningRule(): __PublicMethodMetaInfo<'DELETE', {
318
- id: string;
319
- }, DeleteAutomationEarningRuleRequest$1, DeleteAutomationEarningRuleRequest, DeleteAutomationEarningRuleResponse$1, DeleteAutomationEarningRuleResponse>;
320
- declare function listEarningRules(): __PublicMethodMetaInfo<'GET', {}, ListEarningRulesRequest$1, ListEarningRulesRequest, ListEarningRulesResponse$1, ListEarningRulesResponse>;
321
-
322
- export { type __PublicMethodMetaInfo, bulkCreateLoyaltyEarningRules, createCustomLoyaltyEarningRule, createLoyaltyEarningRule, deleteAutomationEarningRule, deleteLoyaltyEarningRule, getLoyaltyEarningRule, listEarningRules, updateLoyaltyEarningRule };