@wix/auto_sdk_loyalty_earning-rules 1.0.7 → 1.0.9

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 (138) 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 +39 -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 +97 -0
  21. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js.map +1 -0
  22. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts +942 -0
  23. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +151 -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 +1280 -0
  26. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +514 -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/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts +942 -0
  51. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +148 -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 +1280 -0
  54. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +480 -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 +39 -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 +97 -0
  76. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js.map +1 -0
  77. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts +942 -0
  78. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +151 -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 +1285 -0
  81. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +514 -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/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts +942 -0
  105. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +148 -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 +1285 -0
  108. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +480 -0
  109. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js.map +1 -0
  110. package/package.json +13 -14
  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/loyalty-v1-loyalty-earning-rule-earning-rules.universal-DOjaPKYu.d.mts +0 -643
  124. package/build/internal/loyalty-v1-loyalty-earning-rule-earning-rules.universal-DOjaPKYu.d.ts +0 -643
  125. package/build/internal/meta.d.mts +0 -322
  126. package/build/internal/meta.d.ts +0 -322
  127. package/build/internal/meta.js +0 -500
  128. package/build/internal/meta.js.map +0 -1
  129. package/build/internal/meta.mjs +0 -466
  130. package/build/internal/meta.mjs.map +0 -1
  131. package/build/loyalty-v1-loyalty-earning-rule-earning-rules.universal-ByA9SEhi.d.mts +0 -638
  132. package/build/loyalty-v1-loyalty-earning-rule-earning-rules.universal-ByA9SEhi.d.ts +0 -638
  133. package/build/meta.d.mts +0 -322
  134. package/build/meta.d.ts +0 -322
  135. package/build/meta.js +0 -500
  136. package/build/meta.js.map +0 -1
  137. package/build/meta.mjs +0 -466
  138. package/build/meta.mjs.map +0 -1
@@ -0,0 +1,1280 @@
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
+ export interface LoyaltyEarningRuleTypeTag {
150
+ /** Type of custom earning rule. */
151
+ ruleType?: LoyaltyEarningRuleTypeTagType;
152
+ }
153
+ export declare enum LoyaltyEarningRuleTypeTagType {
154
+ /** Type is unknown or not specified. */
155
+ UNKNOWN_TYPE = "UNKNOWN_TYPE",
156
+ /** Earning rule for a customer's birthday. */
157
+ BIRTHDAY = "BIRTHDAY"
158
+ }
159
+ export interface CacheInvalidated {
160
+ }
161
+ export interface EarningRuleDisabled {
162
+ }
163
+ export interface CreateLoyaltyEarningRuleRequest {
164
+ /** Earning rule to create. */
165
+ earningRule: LoyaltyEarningRule;
166
+ }
167
+ export interface CreateLoyaltyEarningRuleResponse {
168
+ /** Created earning rule. */
169
+ earningRule?: LoyaltyEarningRule;
170
+ }
171
+ export interface BulkCreateLoyaltyEarningRulesRequest {
172
+ /**
173
+ * Earning rules to create.
174
+ * @minSize 1
175
+ * @maxSize 100
176
+ */
177
+ earningRules: LoyaltyEarningRule[];
178
+ }
179
+ export interface BulkCreateLoyaltyEarningRulesResponse {
180
+ /** Created earning rules. */
181
+ results?: BulkLoyaltyEarningRuleResult[];
182
+ /** Additional metadata for the created earning rules. */
183
+ bulkActionMetadata?: BulkActionMetadata;
184
+ }
185
+ export interface BulkLoyaltyEarningRuleResult {
186
+ /** Additional metadata for the created earning rules. */
187
+ itemMetadata?: ItemMetadata;
188
+ /** Created earning rule. */
189
+ item?: LoyaltyEarningRule;
190
+ }
191
+ export interface ItemMetadata {
192
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
193
+ _id?: string | null;
194
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
195
+ originalIndex?: number;
196
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
197
+ success?: boolean;
198
+ /** Details about the error in case of failure. */
199
+ error?: ApplicationError;
200
+ }
201
+ export interface ApplicationError {
202
+ /** Error code. */
203
+ code?: string;
204
+ /** Description of the error. */
205
+ description?: string;
206
+ /** Data related to the error. */
207
+ data?: Record<string, any> | null;
208
+ }
209
+ export interface BulkActionMetadata {
210
+ /** Number of items that were successfully processed. */
211
+ totalSuccesses?: number;
212
+ /** Number of items that couldn't be processed. */
213
+ totalFailures?: number;
214
+ /** Number of failures without details because detailed failure threshold was exceeded. */
215
+ undetailedFailures?: number;
216
+ }
217
+ export interface CreateCustomLoyaltyEarningRuleRequest {
218
+ /** Type of the custom earning rule. */
219
+ type: Type;
220
+ /** Custom earning rule to create. */
221
+ earningRule?: CustomLoyaltyEarningRule;
222
+ }
223
+ export declare enum Type {
224
+ /** Unknown type. This value is not used. */
225
+ UNKNOWN_TYPE = "UNKNOWN_TYPE",
226
+ /** Earning rule for social media. */
227
+ SOCIAL_MEDIA = "SOCIAL_MEDIA",
228
+ /** Earning rule for birthdays. */
229
+ BIRTHDAY = "BIRTHDAY"
230
+ }
231
+ /** Used in CreateCustomLoyaltyEarningRuleRequest */
232
+ export interface CustomLoyaltyEarningRule extends 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
+ * Name of the earning rule.
239
+ * @minLength 1
240
+ * @maxLength 50
241
+ */
242
+ title?: string;
243
+ }
244
+ /** @oneof */
245
+ export interface CustomLoyaltyEarningRuleTypeOneOf {
246
+ /** Fixed amount of points awarded for each qualifying activity. */
247
+ fixedAmount?: FixedAmount;
248
+ /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
249
+ conversionRate?: ConversionRate;
250
+ }
251
+ export interface CreateCustomLoyaltyEarningRuleResponse {
252
+ /** Created earning rule. */
253
+ earningRule?: LoyaltyEarningRule;
254
+ }
255
+ export interface GetLoyaltyEarningRuleRequest {
256
+ /**
257
+ * ID of the earning rule to retrieve.
258
+ * @format GUID
259
+ */
260
+ _id: string;
261
+ }
262
+ export interface GetLoyaltyEarningRuleResponse {
263
+ /** Retrieved earning rule. */
264
+ earningRule?: LoyaltyEarningRule;
265
+ }
266
+ export interface UpdateLoyaltyEarningRuleRequest {
267
+ /** Earning rule to update. */
268
+ earningRule: LoyaltyEarningRule;
269
+ }
270
+ export interface UpdateLoyaltyEarningRuleResponse {
271
+ /** The updated earning rule. */
272
+ earningRule?: LoyaltyEarningRule;
273
+ }
274
+ export interface DeleteLoyaltyEarningRuleRequest {
275
+ /**
276
+ * ID of the earning rule to delete.
277
+ * @format GUID
278
+ */
279
+ _id: string;
280
+ /**
281
+ * Revision of the earning rule. Incremented by 1 each time the earning rule is updated.
282
+ * Pass the latest revision when updating to prevent conflicting changes.
283
+ */
284
+ revision?: string;
285
+ }
286
+ export interface DeleteLoyaltyEarningRuleResponse {
287
+ }
288
+ export interface DeleteAutomationEarningRuleRequest {
289
+ /**
290
+ * ID of the earning rule to delete.
291
+ * @format GUID
292
+ */
293
+ _id: string;
294
+ }
295
+ export interface DeleteAutomationEarningRuleResponse {
296
+ }
297
+ export interface ListEarningRulesRequest {
298
+ /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */
299
+ triggerAppId?: string | null;
300
+ /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */
301
+ triggerActivityType?: string | null;
302
+ }
303
+ export interface ListEarningRulesResponse {
304
+ /** Retrieved earning rules. */
305
+ earningRules?: LoyaltyEarningRule[];
306
+ }
307
+ export interface ListEarningRulesInTierRequest {
308
+ /**
309
+ * ID of the tier for which the earning rules will be returned.
310
+ * @format GUID
311
+ */
312
+ tierId?: string | null;
313
+ /** Pagination options. */
314
+ paging?: CursorPaging;
315
+ }
316
+ export interface CursorPaging {
317
+ /**
318
+ * Maximum number of items to return in the results.
319
+ * @max 100
320
+ */
321
+ limit?: number | null;
322
+ /**
323
+ * Pointer to the next or previous page in the list of results.
324
+ *
325
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
326
+ * Not relevant for the first request.
327
+ * @maxLength 16000
328
+ */
329
+ cursor?: string | null;
330
+ }
331
+ export interface ListEarningRulesInTierResponse {
332
+ /** Retrieved earning rules. */
333
+ earningRules?: LoyaltyEarningRule[];
334
+ /** Details on the paged set of results returned. */
335
+ pagingMetadata?: PagingMetadataV2;
336
+ }
337
+ export interface PagingMetadataV2 {
338
+ /** Number of items returned in the response. */
339
+ count?: number | null;
340
+ /** Offset that was requested. */
341
+ offset?: number | null;
342
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
343
+ total?: number | null;
344
+ /** Flag that indicates the server failed to calculate the `total` field. */
345
+ tooManyToCount?: boolean | null;
346
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
347
+ cursors?: Cursors;
348
+ }
349
+ export interface Cursors {
350
+ /**
351
+ * Cursor string pointing to the next page in the list of results.
352
+ * @maxLength 16000
353
+ */
354
+ next?: string | null;
355
+ /**
356
+ * Cursor pointing to the previous page in the list of results.
357
+ * @maxLength 16000
358
+ */
359
+ prev?: string | null;
360
+ }
361
+ export interface DomainEvent extends DomainEventBodyOneOf {
362
+ createdEvent?: EntityCreatedEvent;
363
+ updatedEvent?: EntityUpdatedEvent;
364
+ deletedEvent?: EntityDeletedEvent;
365
+ actionEvent?: ActionEvent;
366
+ /**
367
+ * Unique event ID.
368
+ * Allows clients to ignore duplicate webhooks.
369
+ */
370
+ _id?: string;
371
+ /**
372
+ * Assumes actions are also always typed to an entity_type
373
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
374
+ */
375
+ entityFqdn?: string;
376
+ /**
377
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
378
+ * This is although the created/updated/deleted notion is duplication of the oneof types
379
+ * Example: created/updated/deleted/started/completed/email_opened
380
+ */
381
+ slug?: string;
382
+ /** ID of the entity associated with the event. */
383
+ entityId?: string;
384
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
385
+ eventTime?: Date | null;
386
+ /**
387
+ * Whether the event was triggered as a result of a privacy regulation application
388
+ * (for example, GDPR).
389
+ */
390
+ triggeredByAnonymizeRequest?: boolean | null;
391
+ /** If present, indicates the action that triggered the event. */
392
+ originatedFrom?: string | null;
393
+ /**
394
+ * A sequence number defining the order of updates to the underlying entity.
395
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
396
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
397
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
398
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
399
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
400
+ */
401
+ entityEventSequence?: string | null;
402
+ }
403
+ /** @oneof */
404
+ export interface DomainEventBodyOneOf {
405
+ createdEvent?: EntityCreatedEvent;
406
+ updatedEvent?: EntityUpdatedEvent;
407
+ deletedEvent?: EntityDeletedEvent;
408
+ actionEvent?: ActionEvent;
409
+ }
410
+ export interface EntityCreatedEvent {
411
+ entity?: string;
412
+ }
413
+ export interface RestoreInfo {
414
+ deletedDate?: Date | null;
415
+ }
416
+ export interface EntityUpdatedEvent {
417
+ /**
418
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
419
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
420
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
421
+ */
422
+ currentEntity?: string;
423
+ }
424
+ export interface EntityDeletedEvent {
425
+ /** Entity that was deleted */
426
+ deletedEntity?: string | null;
427
+ }
428
+ export interface ActionEvent {
429
+ body?: string;
430
+ }
431
+ export interface Empty {
432
+ }
433
+ export interface InvalidateEarningRuleCacheRequest {
434
+ }
435
+ export interface InvalidateEarningRuleCacheResponse {
436
+ }
437
+ export interface MetaSiteSpecialEvent extends MetaSiteSpecialEventPayloadOneOf {
438
+ /** Emitted on a meta site creation. */
439
+ siteCreated?: SiteCreated;
440
+ /** Emitted on a meta site transfer completion. */
441
+ siteTransferred?: SiteTransferred;
442
+ /** Emitted on a meta site deletion. */
443
+ siteDeleted?: SiteDeleted;
444
+ /** Emitted on a meta site restoration. */
445
+ siteUndeleted?: SiteUndeleted;
446
+ /** Emitted on the first* publish of the meta site (* switching from unpublished to published state). */
447
+ sitePublished?: SitePublished;
448
+ /** Emitted on a meta site unpublish. */
449
+ siteUnpublished?: SiteUnpublished;
450
+ /** Emitted when meta site is marked as template. */
451
+ siteMarkedAsTemplate?: SiteMarkedAsTemplate;
452
+ /** Emitted when meta site is marked as a WixSite. */
453
+ siteMarkedAsWixSite?: SiteMarkedAsWixSite;
454
+ /** Emitted when an application is provisioned (installed). */
455
+ serviceProvisioned?: ServiceProvisioned;
456
+ /** Emitted when an application is removed (uninstalled). */
457
+ serviceRemoved?: ServiceRemoved;
458
+ /** Emitted when meta site name (URL slug) is changed. */
459
+ siteRenamedPayload?: SiteRenamed;
460
+ /** Emitted when meta site was permanently deleted. */
461
+ hardDeleted?: SiteHardDeleted;
462
+ /** Emitted on a namespace change. */
463
+ namespaceChanged?: NamespaceChanged;
464
+ /** Emitted when Studio is attached. */
465
+ studioAssigned?: StudioAssigned;
466
+ /** Emitted when Studio is detached. */
467
+ studioUnassigned?: StudioUnassigned;
468
+ /**
469
+ * Emitted when one of the URLs is changed. After this event you may call `urls-server` to fetch
470
+ * the actual URL.
471
+ *
472
+ * See: https://wix.slack.com/archives/C0UHEBPFT/p1732520791210559?thread_ts=1732027914.294059&cid=C0UHEBPFT
473
+ * See: https://wix.slack.com/archives/C0UHEBPFT/p1744115197619459
474
+ */
475
+ urlChanged?: SiteUrlChanged;
476
+ /** Site is marked as PurgedExternally */
477
+ sitePurgedExternally?: SitePurgedExternally;
478
+ /** Emitted when Odeditor is attached. */
479
+ odeditorAssigned?: OdeditorAssigned;
480
+ /** Emitted when Odeditor is detached. */
481
+ odeditorUnassigned?: OdeditorUnassigned;
482
+ /**
483
+ * A meta site id.
484
+ * @format GUID
485
+ */
486
+ metaSiteId?: string;
487
+ /** A meta site version. Monotonically increasing. */
488
+ version?: string;
489
+ /** A timestamp of the event. */
490
+ timestamp?: string;
491
+ /**
492
+ * TODO(meta-site): Change validation once validations are disabled for consumers
493
+ * More context: https://wix.slack.com/archives/C0UHEBPFT/p1720957844413149 and https://wix.slack.com/archives/CFWKX325T/p1728892152855659
494
+ * @maxSize 4000
495
+ */
496
+ assets?: Asset[];
497
+ }
498
+ /** @oneof */
499
+ export interface MetaSiteSpecialEventPayloadOneOf {
500
+ /** Emitted on a meta site creation. */
501
+ siteCreated?: SiteCreated;
502
+ /** Emitted on a meta site transfer completion. */
503
+ siteTransferred?: SiteTransferred;
504
+ /** Emitted on a meta site deletion. */
505
+ siteDeleted?: SiteDeleted;
506
+ /** Emitted on a meta site restoration. */
507
+ siteUndeleted?: SiteUndeleted;
508
+ /** Emitted on the first* publish of the meta site (* switching from unpublished to published state). */
509
+ sitePublished?: SitePublished;
510
+ /** Emitted on a meta site unpublish. */
511
+ siteUnpublished?: SiteUnpublished;
512
+ /** Emitted when meta site is marked as template. */
513
+ siteMarkedAsTemplate?: SiteMarkedAsTemplate;
514
+ /** Emitted when meta site is marked as a WixSite. */
515
+ siteMarkedAsWixSite?: SiteMarkedAsWixSite;
516
+ /** Emitted when an application is provisioned (installed). */
517
+ serviceProvisioned?: ServiceProvisioned;
518
+ /** Emitted when an application is removed (uninstalled). */
519
+ serviceRemoved?: ServiceRemoved;
520
+ /** Emitted when meta site name (URL slug) is changed. */
521
+ siteRenamedPayload?: SiteRenamed;
522
+ /** Emitted when meta site was permanently deleted. */
523
+ hardDeleted?: SiteHardDeleted;
524
+ /** Emitted on a namespace change. */
525
+ namespaceChanged?: NamespaceChanged;
526
+ /** Emitted when Studio is attached. */
527
+ studioAssigned?: StudioAssigned;
528
+ /** Emitted when Studio is detached. */
529
+ studioUnassigned?: StudioUnassigned;
530
+ /**
531
+ * Emitted when one of the URLs is changed. After this event you may call `urls-server` to fetch
532
+ * the actual URL.
533
+ *
534
+ * See: https://wix.slack.com/archives/C0UHEBPFT/p1732520791210559?thread_ts=1732027914.294059&cid=C0UHEBPFT
535
+ * See: https://wix.slack.com/archives/C0UHEBPFT/p1744115197619459
536
+ */
537
+ urlChanged?: SiteUrlChanged;
538
+ /** Site is marked as PurgedExternally */
539
+ sitePurgedExternally?: SitePurgedExternally;
540
+ /** Emitted when Odeditor is attached. */
541
+ odeditorAssigned?: OdeditorAssigned;
542
+ /** Emitted when Odeditor is detached. */
543
+ odeditorUnassigned?: OdeditorUnassigned;
544
+ }
545
+ export interface Asset {
546
+ /**
547
+ * An application definition id (app_id in dev-center). For legacy reasons may be UUID or a string (from Java Enum).
548
+ * @maxLength 36
549
+ */
550
+ appDefId?: string;
551
+ /**
552
+ * An instance id. For legacy reasons may be UUID or a string.
553
+ * @maxLength 200
554
+ */
555
+ instanceId?: string;
556
+ /** An application state. */
557
+ state?: State;
558
+ }
559
+ export declare enum State {
560
+ UNKNOWN = "UNKNOWN",
561
+ ENABLED = "ENABLED",
562
+ DISABLED = "DISABLED",
563
+ PENDING = "PENDING",
564
+ DEMO = "DEMO"
565
+ }
566
+ export interface SiteCreated {
567
+ /**
568
+ * A template identifier (empty if not created from a template).
569
+ * @maxLength 36
570
+ */
571
+ originTemplateId?: string;
572
+ /**
573
+ * An account id of the owner.
574
+ * @format GUID
575
+ */
576
+ ownerId?: string;
577
+ /** A context in which meta site was created. */
578
+ context?: SiteCreatedContext;
579
+ /**
580
+ * A meta site id from which this site was created.
581
+ *
582
+ * In case of a creation from a template it's a template id.
583
+ * In case of a site duplication ("Save As" in dashboard or duplicate in UM) it's an id of a source site.
584
+ * @format GUID
585
+ */
586
+ originMetaSiteId?: string | null;
587
+ /**
588
+ * A meta site name (URL slug).
589
+ * @maxLength 20
590
+ */
591
+ siteName?: string;
592
+ /** A namespace. */
593
+ namespace?: Namespace;
594
+ }
595
+ export declare enum SiteCreatedContext {
596
+ /** A valid option, we don't expose all reasons why site might be created. */
597
+ OTHER = "OTHER",
598
+ /** A meta site was created from template. */
599
+ FROM_TEMPLATE = "FROM_TEMPLATE",
600
+ /** A meta site was created by copying of the transfferred meta site. */
601
+ DUPLICATE_BY_SITE_TRANSFER = "DUPLICATE_BY_SITE_TRANSFER",
602
+ /** A copy of existing meta site. */
603
+ DUPLICATE = "DUPLICATE",
604
+ /** A meta site was created as a transfferred site (copy of the original), old flow, should die soon. */
605
+ OLD_SITE_TRANSFER = "OLD_SITE_TRANSFER",
606
+ /** deprecated A meta site was created for Flash editor. */
607
+ FLASH = "FLASH"
608
+ }
609
+ export declare enum Namespace {
610
+ UNKNOWN_NAMESPACE = "UNKNOWN_NAMESPACE",
611
+ /** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */
612
+ WIX = "WIX",
613
+ /** ShoutOut stand alone product. These are siteless (no actual Wix site, no HtmlWeb). MetaSites with this namespace will *not* be shown in a user's site list by default. */
614
+ SHOUT_OUT = "SHOUT_OUT",
615
+ /** MetaSites created by the Albums product, they appear as part of the Albums app. MetaSites with this namespace will *not* be shown in a user's site list by default. */
616
+ ALBUMS = "ALBUMS",
617
+ /** Part of the WixStores migration flow, a user tries to migrate and gets this site to view and if the user likes it then stores removes this namespace and deletes the old site with the old stores. MetaSites with this namespace will *not* be shown in a user's site list by default. */
618
+ WIX_STORES_TEST_DRIVE = "WIX_STORES_TEST_DRIVE",
619
+ /** Hotels standalone (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
620
+ HOTELS = "HOTELS",
621
+ /** Clubs siteless MetaSites, a club without a wix website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
622
+ CLUBS = "CLUBS",
623
+ /** A partially created ADI website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
624
+ ONBOARDING_DRAFT = "ONBOARDING_DRAFT",
625
+ /** AppBuilder for AppStudio / shmite (c). MetaSites with this namespace will *not* be shown in a user's site list by default. */
626
+ DEV_SITE = "DEV_SITE",
627
+ /** LogoMaker websites offered to the user after logo purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
628
+ LOGOS = "LOGOS",
629
+ /** VideoMaker websites offered to the user after video purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
630
+ VIDEO_MAKER = "VIDEO_MAKER",
631
+ /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
632
+ PARTNER_DASHBOARD = "PARTNER_DASHBOARD",
633
+ /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
634
+ DEV_CENTER_COMPANY = "DEV_CENTER_COMPANY",
635
+ /**
636
+ * A draft created by HTML editor on open. Upon "first save" it will be moved to be of WIX domain.
637
+ *
638
+ * Meta site with this namespace will *not* be shown in a user's site list by default.
639
+ */
640
+ HTML_DRAFT = "HTML_DRAFT",
641
+ /**
642
+ * the user-journey for Fitness users who want to start from managing their business instead of designing their website.
643
+ * Will be accessible from Site List and will not have a website app.
644
+ * Once the user attaches a site, the site will become a regular wixsite.
645
+ */
646
+ SITELESS_BUSINESS = "SITELESS_BUSINESS",
647
+ /** Belongs to "strategic products" company. Supports new product in the creator's economy space. */
648
+ CREATOR_ECONOMY = "CREATOR_ECONOMY",
649
+ /** It is to be used in the Business First efforts. */
650
+ DASHBOARD_FIRST = "DASHBOARD_FIRST",
651
+ /** Bookings business flow with no site. */
652
+ ANYWHERE = "ANYWHERE",
653
+ /** Namespace for Headless Backoffice with no editor */
654
+ HEADLESS = "HEADLESS",
655
+ /**
656
+ * Namespace for master site that will exist in parent account that will be referenced by subaccounts
657
+ * The site will be used for account level CSM feature for enterprise
658
+ */
659
+ ACCOUNT_MASTER_CMS = "ACCOUNT_MASTER_CMS",
660
+ /** Rise.ai Siteless account management for Gift Cards and Store Credit. */
661
+ RISE = "RISE",
662
+ /**
663
+ * As part of the branded app new funnel, users now can create a meta site that will be branded app first.
664
+ * There's a blank site behind the scene but it's blank).
665
+ * The Mobile company will be the owner of this namespace.
666
+ */
667
+ BRANDED_FIRST = "BRANDED_FIRST",
668
+ /** Nownia.com Siteless account management for Ai Scheduling Assistant. */
669
+ NOWNIA = "NOWNIA",
670
+ /**
671
+ * UGC Templates are templates that are created by users for personal use and to sale to other users.
672
+ * The Partners company owns this namespace.
673
+ */
674
+ UGC_TEMPLATE = "UGC_TEMPLATE",
675
+ /** Codux Headless Sites */
676
+ CODUX = "CODUX",
677
+ /** Bobb - AI Design Creator. */
678
+ MEDIA_DESIGN_CREATOR = "MEDIA_DESIGN_CREATOR",
679
+ /**
680
+ * Shared Blog Site is a unique single site across Enterprise account,
681
+ * This site will hold all Blog posts related to the Marketing product.
682
+ */
683
+ SHARED_BLOG_ENTERPRISE = "SHARED_BLOG_ENTERPRISE",
684
+ /** Standalone forms (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
685
+ STANDALONE_FORMS = "STANDALONE_FORMS",
686
+ /** Standalone events (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
687
+ STANDALONE_EVENTS = "STANDALONE_EVENTS",
688
+ /** MIMIR - Siteless account for MIMIR Ai Job runner. */
689
+ MIMIR = "MIMIR"
690
+ }
691
+ /** Site transferred to another user. */
692
+ export interface SiteTransferred {
693
+ /**
694
+ * A previous owner id (user that transfers meta site).
695
+ * @format GUID
696
+ */
697
+ oldOwnerId?: string;
698
+ /**
699
+ * A new owner id (user that accepts meta site).
700
+ * @format GUID
701
+ */
702
+ newOwnerId?: string;
703
+ }
704
+ /** Soft deletion of the meta site. Could be restored. */
705
+ export interface SiteDeleted {
706
+ /** A deletion context. */
707
+ deleteContext?: DeleteContext;
708
+ }
709
+ export interface DeleteContext {
710
+ /** When the meta site was deleted. */
711
+ dateDeleted?: Date | null;
712
+ /** A status. */
713
+ deleteStatus?: DeleteStatus;
714
+ /**
715
+ * A reason (flow).
716
+ * @maxLength 255
717
+ */
718
+ deleteOrigin?: string;
719
+ /**
720
+ * A service that deleted it.
721
+ * @maxLength 255
722
+ */
723
+ initiatorId?: string | null;
724
+ }
725
+ export declare enum DeleteStatus {
726
+ UNKNOWN = "UNKNOWN",
727
+ TRASH = "TRASH",
728
+ DELETED = "DELETED",
729
+ PENDING_PURGE = "PENDING_PURGE",
730
+ PURGED_EXTERNALLY = "PURGED_EXTERNALLY"
731
+ }
732
+ /** Restoration of the meta site. */
733
+ export interface SiteUndeleted {
734
+ }
735
+ /** First publish of a meta site. Or subsequent publish after unpublish. */
736
+ export interface SitePublished {
737
+ }
738
+ export interface SiteUnpublished {
739
+ /**
740
+ * A list of URLs previously associated with the meta site.
741
+ * @maxLength 4000
742
+ * @maxSize 10000
743
+ */
744
+ urls?: string[];
745
+ }
746
+ export interface SiteMarkedAsTemplate {
747
+ }
748
+ export interface SiteMarkedAsWixSite {
749
+ }
750
+ /**
751
+ * Represents a service provisioned a site.
752
+ *
753
+ * Note on `origin_instance_id`:
754
+ * There is no guarantee that you will be able to find a meta site using `origin_instance_id`.
755
+ * This is because of the following scenario:
756
+ *
757
+ * Imagine you have a template where a third-party application (TPA) includes some stub data,
758
+ * such as a product catalog. When you create a site from this template, you inherit this
759
+ * default product catalog. However, if the template's product catalog is modified,
760
+ * your site will retain the catalog as it was at the time of site creation. This ensures that
761
+ * your site remains consistent with what you initially received and does not include any
762
+ * changes made to the original template afterward.
763
+ * To ensure this, the TPA on the template gets a new instance_id.
764
+ */
765
+ export interface ServiceProvisioned {
766
+ /**
767
+ * Either UUID or EmbeddedServiceType.
768
+ * @maxLength 36
769
+ */
770
+ appDefId?: string;
771
+ /**
772
+ * Not only UUID. Something here could be something weird.
773
+ * @maxLength 36
774
+ */
775
+ instanceId?: string;
776
+ /**
777
+ * An instance id from which this instance is originated.
778
+ * @maxLength 36
779
+ */
780
+ originInstanceId?: string;
781
+ /**
782
+ * A version.
783
+ * @maxLength 500
784
+ */
785
+ version?: string | null;
786
+ /**
787
+ * The origin meta site id
788
+ * @format GUID
789
+ */
790
+ originMetaSiteId?: string | null;
791
+ }
792
+ export interface ServiceRemoved {
793
+ /**
794
+ * Either UUID or EmbeddedServiceType.
795
+ * @maxLength 36
796
+ */
797
+ appDefId?: string;
798
+ /**
799
+ * Not only UUID. Something here could be something weird.
800
+ * @maxLength 36
801
+ */
802
+ instanceId?: string;
803
+ /**
804
+ * A version.
805
+ * @maxLength 500
806
+ */
807
+ version?: string | null;
808
+ }
809
+ /** Rename of the site. Meaning, free public url has been changed as well. */
810
+ export interface SiteRenamed {
811
+ /**
812
+ * A new meta site name (URL slug).
813
+ * @maxLength 20
814
+ */
815
+ newSiteName?: string;
816
+ /**
817
+ * A previous meta site name (URL slug).
818
+ * @maxLength 255
819
+ */
820
+ oldSiteName?: string;
821
+ }
822
+ /**
823
+ * Hard deletion of the meta site.
824
+ *
825
+ * Could not be restored. Therefore it's desirable to cleanup data.
826
+ */
827
+ export interface SiteHardDeleted {
828
+ /** A deletion context. */
829
+ deleteContext?: DeleteContext;
830
+ }
831
+ export interface NamespaceChanged {
832
+ /** A previous namespace. */
833
+ oldNamespace?: Namespace;
834
+ /** A new namespace. */
835
+ newNamespace?: Namespace;
836
+ }
837
+ /** Assigned Studio editor */
838
+ export interface StudioAssigned {
839
+ }
840
+ /** Unassigned Studio editor */
841
+ export interface StudioUnassigned {
842
+ }
843
+ /**
844
+ * Fired in case site URLs were changed in any way: new secondary domain, published, account slug rename, site rename etc.
845
+ *
846
+ * This is an internal event, it's not propagated in special events, because it's non-actionable. If you need to keep up
847
+ * with sites and its urls, you need to listen to another topic/event. Read about it:
848
+ *
849
+ * https://bo.wix.com/wix-docs/rest/meta-site/meta-site---urls-service
850
+ */
851
+ export interface SiteUrlChanged {
852
+ }
853
+ /**
854
+ * Used at the end of the deletion flow for both draft sites and when a user deletes a site.
855
+ * Consumed by other teams to remove relevant data.
856
+ */
857
+ export interface SitePurgedExternally {
858
+ /**
859
+ * @maxLength 2048
860
+ * @maxSize 100
861
+ * @deprecated
862
+ * @targetRemovalDate 2025-04-15
863
+ */
864
+ appDefId?: string[];
865
+ }
866
+ /** Assigned Odeditor */
867
+ export interface OdeditorAssigned {
868
+ }
869
+ /** Unassigned Odeditor */
870
+ export interface OdeditorUnassigned {
871
+ }
872
+ export interface MessageEnvelope {
873
+ /**
874
+ * App instance ID.
875
+ * @format GUID
876
+ */
877
+ instanceId?: string | null;
878
+ /**
879
+ * Event type.
880
+ * @maxLength 150
881
+ */
882
+ eventType?: string;
883
+ /** The identification type and identity data. */
884
+ identity?: IdentificationData;
885
+ /** Stringify payload. */
886
+ data?: string;
887
+ }
888
+ export interface IdentificationData extends IdentificationDataIdOneOf {
889
+ /**
890
+ * ID of a site visitor that has not logged in to the site.
891
+ * @format GUID
892
+ */
893
+ anonymousVisitorId?: string;
894
+ /**
895
+ * ID of a site visitor that has logged in to the site.
896
+ * @format GUID
897
+ */
898
+ memberId?: string;
899
+ /**
900
+ * ID of a Wix user (site owner, contributor, etc.).
901
+ * @format GUID
902
+ */
903
+ wixUserId?: string;
904
+ /**
905
+ * ID of an app.
906
+ * @format GUID
907
+ */
908
+ appId?: string;
909
+ /** @readonly */
910
+ identityType?: WebhookIdentityType;
911
+ }
912
+ /** @oneof */
913
+ export interface IdentificationDataIdOneOf {
914
+ /**
915
+ * ID of a site visitor that has not logged in to the site.
916
+ * @format GUID
917
+ */
918
+ anonymousVisitorId?: string;
919
+ /**
920
+ * ID of a site visitor that has logged in to the site.
921
+ * @format GUID
922
+ */
923
+ memberId?: string;
924
+ /**
925
+ * ID of a Wix user (site owner, contributor, etc.).
926
+ * @format GUID
927
+ */
928
+ wixUserId?: string;
929
+ /**
930
+ * ID of an app.
931
+ * @format GUID
932
+ */
933
+ appId?: string;
934
+ }
935
+ export declare enum WebhookIdentityType {
936
+ UNKNOWN = "UNKNOWN",
937
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
938
+ MEMBER = "MEMBER",
939
+ WIX_USER = "WIX_USER",
940
+ APP = "APP"
941
+ }
942
+ export interface BaseEventMetadata {
943
+ /**
944
+ * App instance ID.
945
+ * @format GUID
946
+ */
947
+ instanceId?: string | null;
948
+ /**
949
+ * Event type.
950
+ * @maxLength 150
951
+ */
952
+ eventType?: string;
953
+ /** The identification type and identity data. */
954
+ identity?: IdentificationData;
955
+ }
956
+ export interface EventMetadata extends BaseEventMetadata {
957
+ /**
958
+ * Unique event ID.
959
+ * Allows clients to ignore duplicate webhooks.
960
+ */
961
+ _id?: string;
962
+ /**
963
+ * Assumes actions are also always typed to an entity_type
964
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
965
+ */
966
+ entityFqdn?: string;
967
+ /**
968
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
969
+ * This is although the created/updated/deleted notion is duplication of the oneof types
970
+ * Example: created/updated/deleted/started/completed/email_opened
971
+ */
972
+ slug?: string;
973
+ /** ID of the entity associated with the event. */
974
+ entityId?: string;
975
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
976
+ eventTime?: Date | null;
977
+ /**
978
+ * Whether the event was triggered as a result of a privacy regulation application
979
+ * (for example, GDPR).
980
+ */
981
+ triggeredByAnonymizeRequest?: boolean | null;
982
+ /** If present, indicates the action that triggered the event. */
983
+ originatedFrom?: string | null;
984
+ /**
985
+ * A sequence number defining the order of updates to the underlying entity.
986
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
987
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
988
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
989
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
990
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
991
+ */
992
+ entityEventSequence?: string | null;
993
+ }
994
+ export interface LoyaltyEarningRuleCreatedEnvelope {
995
+ entity: LoyaltyEarningRule;
996
+ metadata: EventMetadata;
997
+ }
998
+ /**
999
+ * Triggered when an earning rule is created.
1000
+ * @permissionScope Read Loyalty
1001
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
1002
+ * @permissionScope Manage Loyalty
1003
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
1004
+ * @permissionScope Manage Restaurants - all permissions
1005
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1006
+ * @permissionId LOYALTY.READ_EARNING_RULES
1007
+ * @webhook
1008
+ * @eventType wix.loyalty.v1.loyalty_earning_rule_created
1009
+ * @slug created
1010
+ */
1011
+ export declare function onLoyaltyEarningRuleCreated(handler: (event: LoyaltyEarningRuleCreatedEnvelope) => void | Promise<void>): void;
1012
+ export interface LoyaltyEarningRuleDeletedEnvelope {
1013
+ metadata: EventMetadata;
1014
+ }
1015
+ /**
1016
+ * Triggered when an earning rule is deleted.
1017
+ * @permissionScope Read Loyalty
1018
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
1019
+ * @permissionScope Manage Loyalty
1020
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
1021
+ * @permissionScope Manage Restaurants - all permissions
1022
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1023
+ * @permissionId LOYALTY.READ_EARNING_RULES
1024
+ * @webhook
1025
+ * @eventType wix.loyalty.v1.loyalty_earning_rule_deleted
1026
+ * @slug deleted
1027
+ */
1028
+ export declare function onLoyaltyEarningRuleDeleted(handler: (event: LoyaltyEarningRuleDeletedEnvelope) => void | Promise<void>): void;
1029
+ export interface LoyaltyEarningRuleUpdatedEnvelope {
1030
+ entity: LoyaltyEarningRule;
1031
+ metadata: EventMetadata;
1032
+ }
1033
+ /**
1034
+ * Triggered when an earning rule is updated.
1035
+ * @permissionScope Read Loyalty
1036
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
1037
+ * @permissionScope Manage Loyalty
1038
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
1039
+ * @permissionScope Manage Restaurants - all permissions
1040
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1041
+ * @permissionId LOYALTY.READ_EARNING_RULES
1042
+ * @webhook
1043
+ * @eventType wix.loyalty.v1.loyalty_earning_rule_updated
1044
+ * @slug updated
1045
+ */
1046
+ export declare function onLoyaltyEarningRuleUpdated(handler: (event: LoyaltyEarningRuleUpdatedEnvelope) => void | Promise<void>): void;
1047
+ 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`;
1048
+ /**
1049
+ * Creates a non-automated earning rule.
1050
+ *
1051
+ * >**Note**: You can only create non-automated earning rules from a supported list.
1052
+ * For the supported list of services, see the introduction.
1053
+ * @param earningRule - Earning rule to create.
1054
+ * @public
1055
+ * @requiredField earningRule
1056
+ * @requiredField earningRule.sourceAppId
1057
+ * @requiredField earningRule.status
1058
+ * @requiredField earningRule.title
1059
+ * @requiredField earningRule.triggerActivityType
1060
+ * @requiredField earningRule.triggerAppId
1061
+ * @requiredField earningRule.type
1062
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
1063
+ * @permissionScope Manage Loyalty
1064
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
1065
+ * @permissionScope Manage Restaurants - all permissions
1066
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1067
+ * @applicableIdentity APP
1068
+ * @returns Created earning rule.
1069
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateLoyaltyEarningRule
1070
+ */
1071
+ export declare function createLoyaltyEarningRule(earningRule: NonNullablePaths<LoyaltyEarningRule, `sourceAppId` | `status` | `title` | `triggerActivityType` | `triggerAppId`>): Promise<NonNullablePaths<LoyaltyEarningRule, LoyaltyEarningRuleNonNullablePaths>>;
1072
+ /**
1073
+ * Creates multiple non-automated earning rules.
1074
+ *
1075
+ * >**Note**: You can only create non-automated earning rules from a supported list.
1076
+ * For the supported list of services, see the introduction.
1077
+ * @param earningRules - Earning rules to create.
1078
+ * @public
1079
+ * @requiredField earningRules
1080
+ * @requiredField earningRules.sourceAppId
1081
+ * @requiredField earningRules.status
1082
+ * @requiredField earningRules.title
1083
+ * @requiredField earningRules.triggerActivityType
1084
+ * @requiredField earningRules.triggerAppId
1085
+ * @requiredField earningRules.type
1086
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
1087
+ * @permissionScope Manage Loyalty
1088
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
1089
+ * @permissionScope Manage Restaurants - all permissions
1090
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1091
+ * @applicableIdentity APP
1092
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.BulkCreateLoyaltyEarningRules
1093
+ */
1094
+ 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` | {
1095
+ [P in LoyaltyEarningRuleNonNullablePaths]: `results.${number}.item.${P}`;
1096
+ }[LoyaltyEarningRuleNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
1097
+ /**
1098
+ * Creates a custom automated earning rule.
1099
+ *
1100
+ * To learn more about the automated rules, read the introduction.
1101
+ * @param type - Type of the custom earning rule.
1102
+ * @public
1103
+ * @requiredField type
1104
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
1105
+ * @permissionScope Manage Loyalty
1106
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
1107
+ * @permissionScope Manage Restaurants - all permissions
1108
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1109
+ * @applicableIdentity APP
1110
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateCustomLoyaltyEarningRule
1111
+ */
1112
+ export declare function createCustomLoyaltyEarningRule(type: Type, options?: CreateCustomLoyaltyEarningRuleOptions): Promise<NonNullablePaths<CreateCustomLoyaltyEarningRuleResponse, {
1113
+ [P in LoyaltyEarningRuleNonNullablePaths]: `earningRule.${P}`;
1114
+ }[LoyaltyEarningRuleNonNullablePaths]>>;
1115
+ export interface CreateCustomLoyaltyEarningRuleOptions {
1116
+ /** Custom earning rule to create. */
1117
+ earningRule?: CustomLoyaltyEarningRule;
1118
+ }
1119
+ /**
1120
+ * Retrieves a specified non-automated earning rule.
1121
+ * @param _id - ID of the earning rule to retrieve.
1122
+ * @public
1123
+ * @requiredField _id
1124
+ * @permissionId LOYALTY.READ_EARNING_RULES
1125
+ * @permissionScope Read Loyalty
1126
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
1127
+ * @permissionScope Manage Loyalty
1128
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
1129
+ * @permissionScope Manage Restaurants - all permissions
1130
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1131
+ * @applicableIdentity APP
1132
+ * @applicableIdentity VISITOR
1133
+ * @returns Retrieved earning rule.
1134
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.GetLoyaltyEarningRule
1135
+ */
1136
+ export declare function getLoyaltyEarningRule(_id: string): Promise<NonNullablePaths<LoyaltyEarningRule, LoyaltyEarningRuleNonNullablePaths>>;
1137
+ /**
1138
+ * Updates an earning rule.
1139
+ *
1140
+ * Supports partial updates.
1141
+ *
1142
+ * Revision number, which increments by 1 each time the earning rule is updated. To prevent conflicting changes,
1143
+ * the current revision must be passed when updating the earning rule.
1144
+ * @param _id - Loyalty earning rule ID.
1145
+ * @public
1146
+ * @requiredField _id
1147
+ * @requiredField earningRule
1148
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
1149
+ * @permissionScope Manage Loyalty
1150
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
1151
+ * @permissionScope Manage Restaurants - all permissions
1152
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1153
+ * @applicableIdentity APP
1154
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.UpdateLoyaltyEarningRule
1155
+ */
1156
+ export declare function updateLoyaltyEarningRule(_id: string, earningRule: UpdateLoyaltyEarningRule): Promise<NonNullablePaths<UpdateLoyaltyEarningRuleResponse, {
1157
+ [P in LoyaltyEarningRuleNonNullablePaths]: `earningRule.${P}`;
1158
+ }[LoyaltyEarningRuleNonNullablePaths]>>;
1159
+ export interface UpdateLoyaltyEarningRule {
1160
+ /** Fixed amount of points awarded for each qualifying activity. */
1161
+ fixedAmount?: FixedAmount;
1162
+ /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
1163
+ conversionRate?: ConversionRate;
1164
+ /**
1165
+ * Loyalty earning rule ID.
1166
+ * @format GUID
1167
+ * @readonly
1168
+ */
1169
+ _id?: string | null;
1170
+ /**
1171
+ * ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID.
1172
+ * @format GUID
1173
+ */
1174
+ sourceAppId?: string;
1175
+ /**
1176
+ * ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events.
1177
+ * @minLength 1
1178
+ * @maxLength 80
1179
+ */
1180
+ triggerAppId?: string;
1181
+ /**
1182
+ * Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`.
1183
+ * @minLength 1
1184
+ * @maxLength 80
1185
+ */
1186
+ triggerActivityType?: string;
1187
+ /**
1188
+ * Name of the earning rule.
1189
+ * @minLength 1
1190
+ * @maxLength 50
1191
+ */
1192
+ title?: string;
1193
+ /** Current status of the earning rule. */
1194
+ status?: Status;
1195
+ /**
1196
+ * Revision number, incremented by 1 each time the earning rule is updated.
1197
+ * Pass the latest revision when updating to prevent conflicting changes.
1198
+ */
1199
+ revision?: string | null;
1200
+ /**
1201
+ * Date and time the earning rule was created.
1202
+ * @readonly
1203
+ */
1204
+ _createdDate?: Date | null;
1205
+ /**
1206
+ * Date and time the earning rule was last updated.
1207
+ * @readonly
1208
+ */
1209
+ _updatedDate?: Date | null;
1210
+ /**
1211
+ * Additional metadata about the earning rule.
1212
+ * @readonly
1213
+ */
1214
+ metadata?: Metadata;
1215
+ }
1216
+ /**
1217
+ * Deletes a non-automated earning rule.
1218
+ * @param _id - ID of the earning rule to delete.
1219
+ * @public
1220
+ * @requiredField _id
1221
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
1222
+ * @permissionScope Manage Loyalty
1223
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
1224
+ * @permissionScope Manage Restaurants - all permissions
1225
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1226
+ * @applicableIdentity APP
1227
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteLoyaltyEarningRule
1228
+ */
1229
+ export declare function deleteLoyaltyEarningRule(_id: string, options?: DeleteLoyaltyEarningRuleOptions): Promise<void>;
1230
+ export interface DeleteLoyaltyEarningRuleOptions {
1231
+ /**
1232
+ * Revision of the earning rule. Incremented by 1 each time the earning rule is updated.
1233
+ * Pass the latest revision when updating to prevent conflicting changes.
1234
+ */
1235
+ revision?: string;
1236
+ }
1237
+ /**
1238
+ * Deletes a custom automated earning rule.
1239
+ *
1240
+ * > **Note:** Pre-installed automated rules can only be paused, not deleted.
1241
+ * @param _id - ID of the earning rule to delete.
1242
+ * @public
1243
+ * @requiredField _id
1244
+ * @permissionId LOYALTY.MANAGE_EARNING_RULES
1245
+ * @permissionScope Manage Loyalty
1246
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
1247
+ * @permissionScope Manage Restaurants - all permissions
1248
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1249
+ * @applicableIdentity APP
1250
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteAutomationEarningRule
1251
+ */
1252
+ export declare function deleteAutomationEarningRule(_id: string): Promise<void>;
1253
+ /**
1254
+ * Retrieves a list of earning rules.
1255
+ *
1256
+ * Returns both automated and non-automated earning rules.
1257
+ *
1258
+ * You can filter the results by `triggerAppId` or `triggerActivityType`.
1259
+ * @public
1260
+ * @permissionId LOYALTY.READ_EARNING_RULES
1261
+ * @permissionScope Read Loyalty
1262
+ * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
1263
+ * @permissionScope Manage Loyalty
1264
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
1265
+ * @permissionScope Manage Restaurants - all permissions
1266
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1267
+ * @applicableIdentity APP
1268
+ * @applicableIdentity VISITOR
1269
+ * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.ListEarningRules
1270
+ */
1271
+ export declare function listEarningRules(options?: ListEarningRulesOptions): Promise<NonNullablePaths<ListEarningRulesResponse, {
1272
+ [P in LoyaltyEarningRuleNonNullablePaths]: `earningRules.${number}.${P}`;
1273
+ }[LoyaltyEarningRuleNonNullablePaths]>>;
1274
+ export interface ListEarningRulesOptions {
1275
+ /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */
1276
+ triggerAppId?: string | null;
1277
+ /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */
1278
+ triggerActivityType?: string | null;
1279
+ }
1280
+ export {};