@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
@@ -0,0 +1,844 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+ /**
3
+ * A loyalty earning rule defines how customers earn points in a loyalty program.
4
+ * You can create rules for different activities, such as making purchases.
5
+ */
6
+ export interface LoyaltyEarningRule extends LoyaltyEarningRuleTypeOneOf {
7
+ /** Fixed amount of points awarded for each qualifying activity. */
8
+ fixedAmount?: FixedAmount;
9
+ /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
10
+ conversionRate?: ConversionRate;
11
+ /**
12
+ * Loyalty earning rule ID.
13
+ * @format GUID
14
+ * @readonly
15
+ */
16
+ _id?: string | null;
17
+ /**
18
+ * ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID.
19
+ * @format GUID
20
+ */
21
+ sourceAppId?: string;
22
+ /**
23
+ * ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events.
24
+ * @minLength 1
25
+ * @maxLength 80
26
+ */
27
+ triggerAppId?: string;
28
+ /**
29
+ * Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`.
30
+ * @minLength 1
31
+ * @maxLength 80
32
+ */
33
+ triggerActivityType?: string;
34
+ /**
35
+ * Name of the earning rule.
36
+ * @minLength 1
37
+ * @maxLength 50
38
+ */
39
+ title?: string;
40
+ /** Current status of the earning rule. */
41
+ status?: Status;
42
+ /**
43
+ * Revision number, incremented by 1 each time the earning rule is updated.
44
+ * Pass the latest revision when updating to prevent conflicting changes.
45
+ */
46
+ revision?: string | null;
47
+ /**
48
+ * Date and time the earning rule was created.
49
+ * @readonly
50
+ */
51
+ _createdDate?: Date | null;
52
+ /**
53
+ * Date and time the earning rule was last updated.
54
+ * @readonly
55
+ */
56
+ _updatedDate?: Date | null;
57
+ /**
58
+ * Additional metadata about the earning rule.
59
+ * @readonly
60
+ */
61
+ metadata?: Metadata;
62
+ }
63
+ /** @oneof */
64
+ export interface LoyaltyEarningRuleTypeOneOf {
65
+ /** Fixed amount of points awarded for each qualifying activity. */
66
+ fixedAmount?: FixedAmount;
67
+ /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
68
+ conversionRate?: ConversionRate;
69
+ }
70
+ /** Fixed amount type of earning rule. */
71
+ export interface FixedAmount {
72
+ /**
73
+ * Fixed amount configurations for each tier.
74
+ * @maxSize 21
75
+ */
76
+ configs?: FixedAmountConfig[];
77
+ }
78
+ export interface FixedAmountConfig {
79
+ /**
80
+ * Tier ID. If empty, the [base tier](https://dev.wix.com/docs/rest/crm/loyalty-program/tiers/introduction#terminology) is used.
81
+ * @format GUID
82
+ * @readonly
83
+ */
84
+ tierId?: string | null;
85
+ /** Number of points to award. */
86
+ points?: number;
87
+ }
88
+ /**
89
+ * Conversion rate type of earning rule.
90
+ * Customers earn points based on the amount spent.
91
+ * For example, for every $10 spent, a customer might earn 1 point.
92
+ */
93
+ export interface ConversionRate {
94
+ /**
95
+ * Conversion rate configurations for each tier.
96
+ *
97
+ * Points are awarded proportionally to the amount spent.
98
+ *
99
+ * Formula: `(amount spent) / (money_amount * points)`.
100
+ * @maxSize 21
101
+ */
102
+ configs?: ConversionRateConfig[];
103
+ /**
104
+ * 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.
105
+ * For example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.
106
+ * This field is only applicable for automated earning rules.
107
+ */
108
+ field?: string | null;
109
+ }
110
+ export interface ConversionRateConfig {
111
+ /**
112
+ * Tier ID. If empty, the [base tier](https://dev.wix.com/docs/rest/crm/loyalty-program/tiers/introduction) is used.
113
+ * @format GUID
114
+ * @readonly
115
+ */
116
+ tierId?: string | null;
117
+ /**
118
+ * The amount of money used as a reference for point calculation.
119
+ * Points are awarded proportionally to the amount spent.
120
+ *
121
+ * For example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).
122
+ *
123
+ * Formula for points is: `(amount spent) / (money_amount * points)`.
124
+ */
125
+ moneyAmount?: number;
126
+ /**
127
+ * Points given for the specified `money_amount`.
128
+ * Works in conjunction with `money_amount` to define the earning rule.
129
+ *
130
+ * For example: If `money_amount` is 20 and `points` is 10:
131
+ * - Spending 10 units of currency earns 5 points
132
+ * - Spending 20 units of currency earns 10 points
133
+ * - Spending 30 units of currency earns 15 points
134
+ */
135
+ points?: number;
136
+ }
137
+ export declare enum Status {
138
+ /** Status is unknown or not specified. */
139
+ UNKNOWN = "UNKNOWN",
140
+ /** Earning rule is active and can assign points. */
141
+ ACTIVE = "ACTIVE",
142
+ /** Earning rule is paused and can't assign points. */
143
+ PAUSED = "PAUSED"
144
+ }
145
+ export interface Metadata {
146
+ /** Whether the earning rule can be deleted. */
147
+ canBeDeleted?: boolean;
148
+ /**
149
+ * Information about the type of custom earning rule.
150
+ * @internal
151
+ */
152
+ ruleTypeTag?: LoyaltyEarningRuleTypeTag;
153
+ }
154
+ export interface LoyaltyEarningRuleTypeTag {
155
+ /** Type of custom earning rule. */
156
+ ruleType?: LoyaltyEarningRuleTypeTagType;
157
+ }
158
+ export declare enum LoyaltyEarningRuleTypeTagType {
159
+ /** Type is unknown or not specified. */
160
+ UNKNOWN_TYPE = "UNKNOWN_TYPE",
161
+ /** Earning rule for a customer's birthday. */
162
+ BIRTHDAY = "BIRTHDAY"
163
+ }
164
+ export interface EarningRuleDisabled {
165
+ }
166
+ export interface CreateLoyaltyEarningRuleRequest {
167
+ /** Earning rule to create. */
168
+ earningRule: LoyaltyEarningRule;
169
+ }
170
+ export interface CreateLoyaltyEarningRuleResponse {
171
+ /** Created earning rule. */
172
+ earningRule?: LoyaltyEarningRule;
173
+ }
174
+ export interface BulkCreateLoyaltyEarningRulesRequest {
175
+ /**
176
+ * Earning rules to create.
177
+ * @minSize 1
178
+ * @maxSize 100
179
+ */
180
+ earningRules: LoyaltyEarningRule[];
181
+ }
182
+ export interface BulkCreateLoyaltyEarningRulesResponse {
183
+ /** Created earning rules. */
184
+ results?: BulkLoyaltyEarningRuleResult[];
185
+ /** Additional metadata for the created earning rules. */
186
+ bulkActionMetadata?: BulkActionMetadata;
187
+ }
188
+ export interface BulkLoyaltyEarningRuleResult {
189
+ /** Additional metadata for the created earning rules. */
190
+ itemMetadata?: ItemMetadata;
191
+ /** Created earning rule. */
192
+ item?: LoyaltyEarningRule;
193
+ }
194
+ export interface ItemMetadata {
195
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
196
+ _id?: string | null;
197
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
198
+ originalIndex?: number;
199
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
200
+ success?: boolean;
201
+ /** Details about the error in case of failure. */
202
+ error?: ApplicationError;
203
+ }
204
+ export interface ApplicationError {
205
+ /** Error code. */
206
+ code?: string;
207
+ /** Description of the error. */
208
+ description?: string;
209
+ /** Data related to the error. */
210
+ data?: Record<string, any> | null;
211
+ }
212
+ export interface BulkActionMetadata {
213
+ /** Number of items that were successfully processed. */
214
+ totalSuccesses?: number;
215
+ /** Number of items that couldn't be processed. */
216
+ totalFailures?: number;
217
+ /** Number of failures without details because detailed failure threshold was exceeded. */
218
+ undetailedFailures?: number;
219
+ }
220
+ export interface CreateCustomLoyaltyEarningRuleRequest {
221
+ /** Type of the custom earning rule. */
222
+ type: Type;
223
+ /** Custom earning rule to create. */
224
+ earningRule?: CustomLoyaltyEarningRule;
225
+ }
226
+ export declare enum Type {
227
+ /** Unknown type. This value is not used. */
228
+ UNKNOWN_TYPE = "UNKNOWN_TYPE",
229
+ /** Earning rule for social media. */
230
+ SOCIAL_MEDIA = "SOCIAL_MEDIA",
231
+ /** Earning rule for birthdays. */
232
+ BIRTHDAY = "BIRTHDAY"
233
+ }
234
+ /** Used in CreateCustomLoyaltyEarningRuleRequest */
235
+ export interface CustomLoyaltyEarningRule extends CustomLoyaltyEarningRuleTypeOneOf {
236
+ /** Fixed amount of points awarded for each qualifying activity. */
237
+ fixedAmount?: FixedAmount;
238
+ /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
239
+ conversionRate?: ConversionRate;
240
+ /**
241
+ * Name of the earning rule.
242
+ * @minLength 1
243
+ * @maxLength 50
244
+ */
245
+ title?: string;
246
+ }
247
+ /** @oneof */
248
+ export interface CustomLoyaltyEarningRuleTypeOneOf {
249
+ /** Fixed amount of points awarded for each qualifying activity. */
250
+ fixedAmount?: FixedAmount;
251
+ /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
252
+ conversionRate?: ConversionRate;
253
+ }
254
+ export interface CreateCustomLoyaltyEarningRuleResponse {
255
+ /** Created earning rule. */
256
+ earningRule?: LoyaltyEarningRule;
257
+ }
258
+ export interface GetLoyaltyEarningRuleRequest {
259
+ /**
260
+ * ID of the earning rule to retrieve.
261
+ * @format GUID
262
+ */
263
+ _id: string;
264
+ }
265
+ export interface GetLoyaltyEarningRuleResponse {
266
+ /** Retrieved earning rule. */
267
+ earningRule?: LoyaltyEarningRule;
268
+ }
269
+ export interface UpdateLoyaltyEarningRuleRequest {
270
+ /** Earning rule to update. */
271
+ earningRule: LoyaltyEarningRule;
272
+ }
273
+ export interface UpdateLoyaltyEarningRuleResponse {
274
+ /** The updated earning rule. */
275
+ earningRule?: LoyaltyEarningRule;
276
+ }
277
+ export interface DeleteLoyaltyEarningRuleRequest {
278
+ /**
279
+ * ID of the earning rule to delete.
280
+ * @format GUID
281
+ */
282
+ _id: string;
283
+ /**
284
+ * Revision of the earning rule. Incremented by 1 each time the earning rule is updated.
285
+ * Pass the latest revision when updating to prevent conflicting changes.
286
+ */
287
+ revision?: string;
288
+ }
289
+ export interface DeleteLoyaltyEarningRuleResponse {
290
+ }
291
+ export interface DeleteAutomationEarningRuleRequest {
292
+ /**
293
+ * ID of the earning rule to delete.
294
+ * @format GUID
295
+ */
296
+ _id: string;
297
+ }
298
+ export interface DeleteAutomationEarningRuleResponse {
299
+ }
300
+ export interface ListEarningRulesRequest {
301
+ /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */
302
+ triggerAppId?: string | null;
303
+ /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */
304
+ triggerActivityType?: string | null;
305
+ }
306
+ export interface ListEarningRulesResponse {
307
+ /** Retrieved earning rules. */
308
+ earningRules?: LoyaltyEarningRule[];
309
+ }
310
+ export interface ListEarningRulesInTierRequest {
311
+ /**
312
+ * ID of the tier for which the earning rules will be returned.
313
+ * @format GUID
314
+ */
315
+ tierId?: string | null;
316
+ /** Pagination options. */
317
+ paging?: CursorPaging;
318
+ }
319
+ export interface CursorPaging {
320
+ /**
321
+ * Maximum number of items to return in the results.
322
+ * @max 100
323
+ */
324
+ limit?: number | null;
325
+ /**
326
+ * Pointer to the next or previous page in the list of results.
327
+ *
328
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
329
+ * Not relevant for the first request.
330
+ * @maxLength 16000
331
+ */
332
+ cursor?: string | null;
333
+ }
334
+ export interface ListEarningRulesInTierResponse {
335
+ /** Retrieved earning rules. */
336
+ earningRules?: LoyaltyEarningRule[];
337
+ /** Details on the paged set of results returned. */
338
+ pagingMetadata?: PagingMetadataV2;
339
+ }
340
+ export interface PagingMetadataV2 {
341
+ /** Number of items returned in the response. */
342
+ count?: number | null;
343
+ /** Offset that was requested. */
344
+ offset?: number | null;
345
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
346
+ total?: number | null;
347
+ /** Flag that indicates the server failed to calculate the `total` field. */
348
+ tooManyToCount?: boolean | null;
349
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
350
+ cursors?: Cursors;
351
+ }
352
+ export interface Cursors {
353
+ /**
354
+ * Cursor string pointing to the next page in the list of results.
355
+ * @maxLength 16000
356
+ */
357
+ next?: string | null;
358
+ /**
359
+ * Cursor pointing to the previous page in the list of results.
360
+ * @maxLength 16000
361
+ */
362
+ prev?: string | null;
363
+ }
364
+ export interface DomainEvent extends DomainEventBodyOneOf {
365
+ createdEvent?: EntityCreatedEvent;
366
+ updatedEvent?: EntityUpdatedEvent;
367
+ deletedEvent?: EntityDeletedEvent;
368
+ actionEvent?: ActionEvent;
369
+ /**
370
+ * Unique event ID.
371
+ * Allows clients to ignore duplicate webhooks.
372
+ */
373
+ _id?: string;
374
+ /**
375
+ * Assumes actions are also always typed to an entity_type
376
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
377
+ */
378
+ entityFqdn?: string;
379
+ /**
380
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
381
+ * This is although the created/updated/deleted notion is duplication of the oneof types
382
+ * Example: created/updated/deleted/started/completed/email_opened
383
+ */
384
+ slug?: string;
385
+ /** ID of the entity associated with the event. */
386
+ entityId?: string;
387
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
388
+ eventTime?: Date | null;
389
+ /**
390
+ * Whether the event was triggered as a result of a privacy regulation application
391
+ * (for example, GDPR).
392
+ */
393
+ triggeredByAnonymizeRequest?: boolean | null;
394
+ /** If present, indicates the action that triggered the event. */
395
+ originatedFrom?: string | null;
396
+ /**
397
+ * A sequence number defining the order of updates to the underlying entity.
398
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
399
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
400
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
401
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
402
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
403
+ */
404
+ entityEventSequence?: string | null;
405
+ }
406
+ /** @oneof */
407
+ export interface DomainEventBodyOneOf {
408
+ createdEvent?: EntityCreatedEvent;
409
+ updatedEvent?: EntityUpdatedEvent;
410
+ deletedEvent?: EntityDeletedEvent;
411
+ actionEvent?: ActionEvent;
412
+ }
413
+ export interface EntityCreatedEvent {
414
+ entity?: string;
415
+ }
416
+ export interface RestoreInfo {
417
+ deletedDate?: Date | null;
418
+ }
419
+ export interface EntityUpdatedEvent {
420
+ /**
421
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
422
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
423
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
424
+ */
425
+ currentEntity?: string;
426
+ }
427
+ export interface EntityDeletedEvent {
428
+ /** Entity that was deleted */
429
+ deletedEntity?: string | null;
430
+ }
431
+ export interface ActionEvent {
432
+ body?: string;
433
+ }
434
+ export interface Empty {
435
+ }
436
+ export interface MessageEnvelope {
437
+ /**
438
+ * App instance ID.
439
+ * @format GUID
440
+ */
441
+ instanceId?: string | null;
442
+ /**
443
+ * Event type.
444
+ * @maxLength 150
445
+ */
446
+ eventType?: string;
447
+ /** The identification type and identity data. */
448
+ identity?: IdentificationData;
449
+ /** Stringify payload. */
450
+ data?: string;
451
+ }
452
+ export interface IdentificationData extends IdentificationDataIdOneOf {
453
+ /**
454
+ * ID of a site visitor that has not logged in to the site.
455
+ * @format GUID
456
+ */
457
+ anonymousVisitorId?: string;
458
+ /**
459
+ * ID of a site visitor that has logged in to the site.
460
+ * @format GUID
461
+ */
462
+ memberId?: string;
463
+ /**
464
+ * ID of a Wix user (site owner, contributor, etc.).
465
+ * @format GUID
466
+ */
467
+ wixUserId?: string;
468
+ /**
469
+ * ID of an app.
470
+ * @format GUID
471
+ */
472
+ appId?: string;
473
+ /** @readonly */
474
+ identityType?: WebhookIdentityType;
475
+ }
476
+ /** @oneof */
477
+ export interface IdentificationDataIdOneOf {
478
+ /**
479
+ * ID of a site visitor that has not logged in to the site.
480
+ * @format GUID
481
+ */
482
+ anonymousVisitorId?: string;
483
+ /**
484
+ * ID of a site visitor that has logged in to the site.
485
+ * @format GUID
486
+ */
487
+ memberId?: string;
488
+ /**
489
+ * ID of a Wix user (site owner, contributor, etc.).
490
+ * @format GUID
491
+ */
492
+ wixUserId?: string;
493
+ /**
494
+ * ID of an app.
495
+ * @format GUID
496
+ */
497
+ appId?: string;
498
+ }
499
+ export declare enum WebhookIdentityType {
500
+ UNKNOWN = "UNKNOWN",
501
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
502
+ MEMBER = "MEMBER",
503
+ WIX_USER = "WIX_USER",
504
+ APP = "APP"
505
+ }
506
+ export interface BaseEventMetadata {
507
+ /**
508
+ * App instance ID.
509
+ * @format GUID
510
+ */
511
+ instanceId?: string | null;
512
+ /**
513
+ * Event type.
514
+ * @maxLength 150
515
+ */
516
+ eventType?: string;
517
+ /** The identification type and identity data. */
518
+ identity?: IdentificationData;
519
+ }
520
+ export interface EventMetadata extends BaseEventMetadata {
521
+ /**
522
+ * Unique event ID.
523
+ * Allows clients to ignore duplicate webhooks.
524
+ */
525
+ _id?: string;
526
+ /**
527
+ * Assumes actions are also always typed to an entity_type
528
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
529
+ */
530
+ entityFqdn?: string;
531
+ /**
532
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
533
+ * This is although the created/updated/deleted notion is duplication of the oneof types
534
+ * Example: created/updated/deleted/started/completed/email_opened
535
+ */
536
+ slug?: string;
537
+ /** ID of the entity associated with the event. */
538
+ entityId?: string;
539
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
540
+ eventTime?: Date | null;
541
+ /**
542
+ * Whether the event was triggered as a result of a privacy regulation application
543
+ * (for example, GDPR).
544
+ */
545
+ triggeredByAnonymizeRequest?: boolean | null;
546
+ /** If present, indicates the action that triggered the event. */
547
+ originatedFrom?: string | null;
548
+ /**
549
+ * A sequence number defining the order of updates to the underlying entity.
550
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
551
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
552
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
553
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
554
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
555
+ */
556
+ entityEventSequence?: string | null;
557
+ }
558
+ export interface LoyaltyEarningRuleCreatedEnvelope {
559
+ entity: LoyaltyEarningRule;
560
+ metadata: EventMetadata;
561
+ }
562
+ /**
563
+ * Triggered when an earning rule is created.
564
+ * @permissionScope Read Loyalty
565
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
566
+ * @permissionScope Manage Loyalty
567
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
568
+ * @permissionScope Manage Restaurants - all permissions
569
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
570
+ * @permissionId LOYALTY.READ_EARNING_RULES
571
+ * @webhook
572
+ * @eventType wix.loyalty.v1.loyalty_earning_rule_created
573
+ * @slug created
574
+ */
575
+ export declare function onLoyaltyEarningRuleCreated(handler: (event: LoyaltyEarningRuleCreatedEnvelope) => void | Promise<void>): void;
576
+ export interface LoyaltyEarningRuleDeletedEnvelope {
577
+ metadata: EventMetadata;
578
+ }
579
+ /**
580
+ * Triggered when an earning rule is deleted.
581
+ * @permissionScope Read Loyalty
582
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
583
+ * @permissionScope Manage Loyalty
584
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
585
+ * @permissionScope Manage Restaurants - all permissions
586
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
587
+ * @permissionId LOYALTY.READ_EARNING_RULES
588
+ * @webhook
589
+ * @eventType wix.loyalty.v1.loyalty_earning_rule_deleted
590
+ * @slug deleted
591
+ */
592
+ export declare function onLoyaltyEarningRuleDeleted(handler: (event: LoyaltyEarningRuleDeletedEnvelope) => void | Promise<void>): void;
593
+ export interface LoyaltyEarningRuleUpdatedEnvelope {
594
+ entity: LoyaltyEarningRule;
595
+ metadata: EventMetadata;
596
+ }
597
+ /**
598
+ * Triggered when an earning rule is updated.
599
+ * @permissionScope Read Loyalty
600
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
601
+ * @permissionScope Manage Loyalty
602
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
603
+ * @permissionScope Manage Restaurants - all permissions
604
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
605
+ * @permissionId LOYALTY.READ_EARNING_RULES
606
+ * @webhook
607
+ * @eventType wix.loyalty.v1.loyalty_earning_rule_updated
608
+ * @slug updated
609
+ */
610
+ export declare function onLoyaltyEarningRuleUpdated(handler: (event: LoyaltyEarningRuleUpdatedEnvelope) => void | Promise<void>): void;
611
+ type LoyaltyEarningRuleNonNullablePaths = `fixedAmount.configs` | `fixedAmount.configs.${number}.points` | `conversionRate.configs` | `conversionRate.configs.${number}.moneyAmount` | `conversionRate.configs.${number}.points` | `sourceAppId` | `triggerAppId` | `triggerActivityType` | `title` | `status` | `metadata.canBeDeleted`;
612
+ /**
613
+ * Creates a non-automated earning rule.
614
+ *
615
+ * >**Note**: You can only create non-automated earning rules from a supported list.
616
+ * For the supported list of services, see the introduction.
617
+ * @param earningRule - Earning rule to create.
618
+ * @public
619
+ * @requiredField earningRule
620
+ * @requiredField earningRule.sourceAppId
621
+ * @requiredField earningRule.status
622
+ * @requiredField earningRule.title
623
+ * @requiredField earningRule.triggerActivityType
624
+ * @requiredField earningRule.triggerAppId
625
+ * @requiredField earningRule.type
626
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
627
+ * @permissionScope Manage Loyalty
628
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
629
+ * @permissionScope Manage Restaurants - all permissions
630
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
631
+ * @applicableIdentity APP
632
+ * @returns Created earning rule.
633
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateLoyaltyEarningRule
634
+ */
635
+ export declare function createLoyaltyEarningRule(earningRule: NonNullablePaths<LoyaltyEarningRule, `sourceAppId` | `status` | `title` | `triggerActivityType` | `triggerAppId`>): Promise<NonNullablePaths<LoyaltyEarningRule, LoyaltyEarningRuleNonNullablePaths>>;
636
+ /**
637
+ * Creates multiple non-automated earning rules.
638
+ *
639
+ * >**Note**: You can only create non-automated earning rules from a supported list.
640
+ * For the supported list of services, see the introduction.
641
+ * @param earningRules - Earning rules to create.
642
+ * @public
643
+ * @requiredField earningRules
644
+ * @requiredField earningRules.sourceAppId
645
+ * @requiredField earningRules.status
646
+ * @requiredField earningRules.title
647
+ * @requiredField earningRules.triggerActivityType
648
+ * @requiredField earningRules.triggerAppId
649
+ * @requiredField earningRules.type
650
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
651
+ * @permissionScope Manage Loyalty
652
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
653
+ * @permissionScope Manage Restaurants - all permissions
654
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
655
+ * @applicableIdentity APP
656
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.BulkCreateLoyaltyEarningRules
657
+ */
658
+ export declare function bulkCreateLoyaltyEarningRules(earningRules: NonNullablePaths<LoyaltyEarningRule, `sourceAppId` | `status` | `title` | `triggerActivityType` | `triggerAppId`>[]): Promise<NonNullablePaths<BulkCreateLoyaltyEarningRulesResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | {
659
+ [P in LoyaltyEarningRuleNonNullablePaths]: `results.${number}.item.${P}`;
660
+ }[LoyaltyEarningRuleNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
661
+ /**
662
+ * Creates a custom automated earning rule.
663
+ *
664
+ * To learn more about the automated rules, read the introduction.
665
+ * @param type - Type of the custom earning rule.
666
+ * @public
667
+ * @requiredField type
668
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
669
+ * @permissionScope Manage Loyalty
670
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
671
+ * @permissionScope Manage Restaurants - all permissions
672
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
673
+ * @applicableIdentity APP
674
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateCustomLoyaltyEarningRule
675
+ */
676
+ export declare function createCustomLoyaltyEarningRule(type: Type, options?: CreateCustomLoyaltyEarningRuleOptions): Promise<NonNullablePaths<CreateCustomLoyaltyEarningRuleResponse, {
677
+ [P in LoyaltyEarningRuleNonNullablePaths]: `earningRule.${P}`;
678
+ }[LoyaltyEarningRuleNonNullablePaths]>>;
679
+ export interface CreateCustomLoyaltyEarningRuleOptions {
680
+ /** Custom earning rule to create. */
681
+ earningRule?: CustomLoyaltyEarningRule;
682
+ }
683
+ /**
684
+ * Retrieves a specified non-automated earning rule.
685
+ * @param _id - ID of the earning rule to retrieve.
686
+ * @public
687
+ * @requiredField _id
688
+ * @permissionId LOYALTY.READ_EARNING_RULES
689
+ * @permissionScope Read Loyalty
690
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
691
+ * @permissionScope Manage Loyalty
692
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
693
+ * @permissionScope Manage Restaurants - all permissions
694
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
695
+ * @applicableIdentity APP
696
+ * @applicableIdentity VISITOR
697
+ * @returns Retrieved earning rule.
698
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.GetLoyaltyEarningRule
699
+ */
700
+ export declare function getLoyaltyEarningRule(_id: string): Promise<NonNullablePaths<LoyaltyEarningRule, LoyaltyEarningRuleNonNullablePaths>>;
701
+ /**
702
+ * Updates an earning rule.
703
+ *
704
+ * Supports partial updates.
705
+ *
706
+ * Revision number, which increments by 1 each time the earning rule is updated. To prevent conflicting changes,
707
+ * the current revision must be passed when updating the earning rule.
708
+ * @param _id - Loyalty earning rule ID.
709
+ * @public
710
+ * @requiredField _id
711
+ * @requiredField earningRule
712
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
713
+ * @permissionScope Manage Loyalty
714
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
715
+ * @permissionScope Manage Restaurants - all permissions
716
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
717
+ * @applicableIdentity APP
718
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.UpdateLoyaltyEarningRule
719
+ */
720
+ export declare function updateLoyaltyEarningRule(_id: string, earningRule: UpdateLoyaltyEarningRule): Promise<NonNullablePaths<UpdateLoyaltyEarningRuleResponse, {
721
+ [P in LoyaltyEarningRuleNonNullablePaths]: `earningRule.${P}`;
722
+ }[LoyaltyEarningRuleNonNullablePaths]>>;
723
+ export interface UpdateLoyaltyEarningRule {
724
+ /** Fixed amount of points awarded for each qualifying activity. */
725
+ fixedAmount?: FixedAmount;
726
+ /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
727
+ conversionRate?: ConversionRate;
728
+ /**
729
+ * Loyalty earning rule ID.
730
+ * @format GUID
731
+ * @readonly
732
+ */
733
+ _id?: string | null;
734
+ /**
735
+ * ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID.
736
+ * @format GUID
737
+ */
738
+ sourceAppId?: string;
739
+ /**
740
+ * ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events.
741
+ * @minLength 1
742
+ * @maxLength 80
743
+ */
744
+ triggerAppId?: string;
745
+ /**
746
+ * Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`.
747
+ * @minLength 1
748
+ * @maxLength 80
749
+ */
750
+ triggerActivityType?: string;
751
+ /**
752
+ * Name of the earning rule.
753
+ * @minLength 1
754
+ * @maxLength 50
755
+ */
756
+ title?: string;
757
+ /** Current status of the earning rule. */
758
+ status?: Status;
759
+ /**
760
+ * Revision number, incremented by 1 each time the earning rule is updated.
761
+ * Pass the latest revision when updating to prevent conflicting changes.
762
+ */
763
+ revision?: string | null;
764
+ /**
765
+ * Date and time the earning rule was created.
766
+ * @readonly
767
+ */
768
+ _createdDate?: Date | null;
769
+ /**
770
+ * Date and time the earning rule was last updated.
771
+ * @readonly
772
+ */
773
+ _updatedDate?: Date | null;
774
+ /**
775
+ * Additional metadata about the earning rule.
776
+ * @readonly
777
+ */
778
+ metadata?: Metadata;
779
+ }
780
+ /**
781
+ * Deletes a non-automated earning rule.
782
+ * @param _id - ID of the earning rule to delete.
783
+ * @public
784
+ * @requiredField _id
785
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
786
+ * @permissionScope Manage Loyalty
787
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
788
+ * @permissionScope Manage Restaurants - all permissions
789
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
790
+ * @applicableIdentity APP
791
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteLoyaltyEarningRule
792
+ */
793
+ export declare function deleteLoyaltyEarningRule(_id: string, options?: DeleteLoyaltyEarningRuleOptions): Promise<void>;
794
+ export interface DeleteLoyaltyEarningRuleOptions {
795
+ /**
796
+ * Revision of the earning rule. Incremented by 1 each time the earning rule is updated.
797
+ * Pass the latest revision when updating to prevent conflicting changes.
798
+ */
799
+ revision?: string;
800
+ }
801
+ /**
802
+ * Deletes a custom automated earning rule.
803
+ *
804
+ * > **Note:** Pre-installed automated rules can only be paused, not deleted.
805
+ * @param _id - ID of the earning rule to delete.
806
+ * @public
807
+ * @requiredField _id
808
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
809
+ * @permissionScope Manage Loyalty
810
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
811
+ * @permissionScope Manage Restaurants - all permissions
812
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
813
+ * @applicableIdentity APP
814
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteAutomationEarningRule
815
+ */
816
+ export declare function deleteAutomationEarningRule(_id: string): Promise<void>;
817
+ /**
818
+ * Retrieves a list of earning rules.
819
+ *
820
+ * Returns both automated and non-automated earning rules.
821
+ *
822
+ * You can filter the results by `triggerAppId` or `triggerActivityType`.
823
+ * @public
824
+ * @permissionId LOYALTY.READ_EARNING_RULES
825
+ * @permissionScope Read Loyalty
826
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
827
+ * @permissionScope Manage Loyalty
828
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
829
+ * @permissionScope Manage Restaurants - all permissions
830
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
831
+ * @applicableIdentity APP
832
+ * @applicableIdentity VISITOR
833
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.ListEarningRules
834
+ */
835
+ export declare function listEarningRules(options?: ListEarningRulesOptions): Promise<NonNullablePaths<ListEarningRulesResponse, {
836
+ [P in LoyaltyEarningRuleNonNullablePaths]: `earningRules.${number}.${P}`;
837
+ }[LoyaltyEarningRuleNonNullablePaths]>>;
838
+ export interface ListEarningRulesOptions {
839
+ /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */
840
+ triggerAppId?: string | null;
841
+ /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */
842
+ triggerActivityType?: string | null;
843
+ }
844
+ export {};