@wix/referral 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,145 +1,240 @@
1
- /** ReferralEvent. */
2
- interface ReferralEvent extends ReferralEventEventTypeOneOf {
3
- /** ReferredFriendSignupEvent is an event that is triggered when a referred friend signs up. */
4
- referredFriendSignupEvent?: ReferredFriendSignupEvent;
5
- /** SuccessfulReferralEvent is an event that is triggered when a referral is successful. */
6
- successfulReferralEvent?: V1SuccessfulReferralEvent;
7
- /** ActionEvent is an event that is triggered when an action is performed. */
8
- actionEvent?: V1ActionEvent;
9
- /** RewardEvent is an event that is triggered when a reward is given. */
10
- rewardEvent?: RewardEvent;
1
+ /** ReferralProgram is the main entity of ReferralPrograms that can be used to manage the program. */
2
+ interface ReferralProgram {
3
+ /** Referral program name. */
4
+ name?: string | null;
11
5
  /**
12
- * ReferralEvent ID.
6
+ * Referral program status.
13
7
  * @readonly
14
8
  */
15
- _id?: string | null;
9
+ status?: ProgramStatus;
16
10
  /** Represents the current state of an item. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision. */
17
11
  revision?: string | null;
18
12
  /**
19
- * Represents the time this ReferralEvent was created.
13
+ * Program's creation date and time.
20
14
  * @readonly
21
15
  */
22
16
  _createdDate?: Date;
23
17
  /**
24
- * Represents the time this ReferralEvent was last updated.
18
+ * Program's last update date and time
25
19
  * @readonly
26
20
  */
27
21
  _updatedDate?: Date;
28
- }
29
- /** @oneof */
30
- interface ReferralEventEventTypeOneOf {
31
- /** ReferredFriendSignupEvent is an event that is triggered when a referred friend signs up. */
32
- referredFriendSignupEvent?: ReferredFriendSignupEvent;
33
- /** SuccessfulReferralEvent is an event that is triggered when a referral is successful. */
34
- successfulReferralEvent?: V1SuccessfulReferralEvent;
35
- /** ActionEvent is an event that is triggered when an action is performed. */
36
- actionEvent?: V1ActionEvent;
37
- /** RewardEvent is an event that is triggered when a reward is given. */
38
- rewardEvent?: RewardEvent;
39
- }
40
- interface ReferredFriendSignupEvent {
41
- /** The referred friend ID. */
42
- referredFriendId?: string;
43
- }
44
- interface V1SuccessfulReferralEvent {
45
- /** The referred friend ID. */
46
- referredFriendId?: string;
47
- /** The referring customer ID. */
48
- referringCustomerId?: string;
49
- }
50
- interface V1ActionEvent {
51
- /** The referred friend ID. */
52
- referredFriendId?: string;
53
- /** The referring customer ID. */
54
- referringCustomerId?: string;
55
- /** The trigger of the action. */
56
- trigger?: V1Trigger;
57
- /** Amount. */
58
- amount?: string | null;
59
- /** Currency. */
60
- currency?: string | null;
61
- /** Order ID. */
62
- orderId?: string | null;
63
- }
64
- interface V1Trigger {
65
- /** The app id of the app that triggered the event. */
66
- appId?: string;
67
- /** The activity type that triggered the event. */
68
- activityType?: string;
69
- }
70
- interface RewardEvent extends RewardEventReceiverOneOf {
71
- /**
72
- * The referring customer ID.
73
- * @readonly
74
- */
75
- rewardedReferringCustomerId?: string;
76
- /**
77
- * The referred friend ID.
22
+ /** Referred friend reward configuration. */
23
+ referredFriendReward?: Reward$2;
24
+ /** Referring customer reward configuration. */
25
+ referringCustomerReward?: Reward$2;
26
+ /** List of actions that complete referral. */
27
+ successfulReferralActions?: Action[];
28
+ /**
29
+ * Set to true if user has required plan to activate program.
78
30
  * @readonly
31
+ * @deprecated Set to true if user has required plan to activate program.
32
+ * @replacedBy GetReferralProgramPremiumFeatures
33
+ * @targetRemovalDate 2024-09-01
79
34
  */
80
- rewardedReferredFriendId?: string;
81
- /** The referral reward ID. */
82
- referralRewardId?: string;
83
- /** The reward type. */
84
- rewardType?: Reward;
35
+ isPremium?: boolean;
36
+ /** Emails configuration. */
37
+ emails?: Emails;
38
+ }
39
+ declare enum ProgramStatus {
40
+ /** unknown status. */
41
+ UNKNOWN = "UNKNOWN",
42
+ /** initial program status (program was created but was not enabled yet). */
43
+ DRAFT = "DRAFT",
44
+ /** program is active. */
45
+ ACTIVE = "ACTIVE",
46
+ /** program was manually disabled by the user (this action can be reverted, meaning user can set it to be active again). */
47
+ PAUSED = "PAUSED"
48
+ }
49
+ interface Reward$2 extends RewardOptionsOneOf$1 {
50
+ /** Options for coupon reward type. */
51
+ couponOptions?: Coupon$2;
52
+ /** Options for Loyalty points reward type. */
53
+ loyaltyPointsOptions?: LoyaltyPoints$2;
54
+ /** Type of the reward. */
55
+ type?: Type$1;
85
56
  }
86
57
  /** @oneof */
87
- interface RewardEventReceiverOneOf {
88
- /**
89
- * The referring customer ID.
90
- * @readonly
91
- */
92
- rewardedReferringCustomerId?: string;
93
- /**
94
- * The referred friend ID.
95
- * @readonly
96
- */
97
- rewardedReferredFriendId?: string;
58
+ interface RewardOptionsOneOf$1 {
59
+ /** Options for coupon reward type. */
60
+ couponOptions?: Coupon$2;
61
+ /** Options for Loyalty points reward type. */
62
+ loyaltyPointsOptions?: LoyaltyPoints$2;
98
63
  }
99
- declare enum Reward {
64
+ declare enum Type$1 {
100
65
  /** Unknown reward type. */
101
66
  UNKNOWN = "UNKNOWN",
102
- /** Reward is a coupon. */
67
+ /** Coupon reward type. */
103
68
  COUPON = "COUPON",
104
- /** Reward is loyalty points. */
69
+ /** Loyalty points reward type. */
105
70
  LOYALTY_POINTS = "LOYALTY_POINTS",
106
- /** No reward. */
71
+ /** No reward type. */
107
72
  NOTHING = "NOTHING"
108
73
  }
109
- interface CursorQuery$1 extends CursorQueryPagingMethodOneOf$1 {
110
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
111
- cursorPaging?: CursorPaging$1;
74
+ interface Coupon$2 extends CouponDiscountTypeOptionsOneOf$2, CouponScopeOrMinSubtotalOneOf$2 {
75
+ /** Options for fixed amount discount type. */
76
+ fixedAmountOptions?: FixedAmountDiscount$2;
77
+ /** Options for percentage discount type. */
78
+ percentageOptions?: PercentageDiscount$2;
79
+ /** Limit the coupon to carts with a subtotal above this number. */
80
+ minimumSubtotal?: number;
81
+ /** Specifies the type of line items this coupon will apply to. */
82
+ scope?: CouponScope$2;
83
+ /** Coupon name. */
84
+ name?: string;
85
+ /** Coupon discount type. */
86
+ discountType?: DiscountType$2;
87
+ /** Limit the coupon to only apply to one item in cart. */
88
+ limitedToOneItem?: boolean | null;
89
+ /** If true, coupon also applies to subscriptions. */
90
+ appliesToSubscriptions?: boolean | null;
91
+ /** Specifies the amount of discounted cycles for subscription item. See Stores Coupons documentation for more info. */
92
+ discountedCycleCount?: number | null;
93
+ }
94
+ /** @oneof */
95
+ interface CouponDiscountTypeOptionsOneOf$2 {
96
+ /** Options for fixed amount discount type. */
97
+ fixedAmountOptions?: FixedAmountDiscount$2;
98
+ /** Options for percentage discount type. */
99
+ percentageOptions?: PercentageDiscount$2;
100
+ }
101
+ /** @oneof */
102
+ interface CouponScopeOrMinSubtotalOneOf$2 {
103
+ /** Limit the coupon to carts with a subtotal above this number. */
104
+ minimumSubtotal?: number;
105
+ /** Specifies the type of line items this coupon will apply to. */
106
+ scope?: CouponScope$2;
107
+ }
108
+ declare enum DiscountType$2 {
109
+ /** Unknown discount type. */
110
+ UNKNOWN = "UNKNOWN",
111
+ /** Discount as a fixed amount. */
112
+ FIXED_AMOUNT = "FIXED_AMOUNT",
113
+ /** Discount as a percentage. */
114
+ PERCENTAGE = "PERCENTAGE",
115
+ /** Free shipping. */
116
+ FREE_SHIPPING = "FREE_SHIPPING"
117
+ }
118
+ interface FixedAmountDiscount$2 {
119
+ /** Fixed amount to discount. */
120
+ amount?: number;
121
+ }
122
+ interface PercentageDiscount$2 {
123
+ /** Percentage to discount. */
124
+ percentage?: number;
125
+ }
126
+ interface CouponScope$2 {
127
+ /** Namespace of the coupon scope. */
128
+ namespace?: string;
129
+ /** Group of the coupon scope. */
130
+ group?: Group$2;
131
+ }
132
+ interface Group$2 {
133
+ /** Name of the group. */
134
+ name?: string;
135
+ /** Entity ID of the group. */
136
+ entityId?: string | null;
137
+ }
138
+ interface LoyaltyPoints$2 {
139
+ /** Amount of points to give. */
140
+ amount?: number;
141
+ }
142
+ declare enum Action {
143
+ /** Unknown action. */
144
+ UNKNOWN = "UNKNOWN",
145
+ /** Store order placed. */
146
+ STORE_ORDER_PLACED = "STORE_ORDER_PLACED",
147
+ /** Pricing plan ordered. */
148
+ PLAN_ORDERED = "PLAN_ORDERED",
149
+ /** Wix events ticket ordered. */
150
+ TICKET_ORDERED = "TICKET_ORDERED",
151
+ /** Bookings session booked. */
152
+ SESSION_BOOKED = "SESSION_BOOKED",
153
+ /** Restaurant order placed. */
154
+ RESTAURANT_ORDER_PLACED = "RESTAURANT_ORDER_PLACED"
155
+ }
156
+ interface Emails {
157
+ /** Encourage customers to refer their friends email. Select for which apps to enable. */
158
+ encourageToReferFriends?: App[];
159
+ /** Notify customers about their referral reward email. Set true to enable email. */
160
+ notifyCustomersAboutReward?: boolean;
161
+ }
162
+ declare enum App {
163
+ /** Unknown app. */
164
+ UNKNOWN = "UNKNOWN",
165
+ /** Wix stores. */
166
+ STORES = "STORES",
167
+ /** Wix pricing plans. */
168
+ PRICING_PLANS = "PRICING_PLANS",
169
+ /** Wix events. */
170
+ EVENTS = "EVENTS",
171
+ /** Wix bookings. */
172
+ BOOKINGS = "BOOKINGS",
173
+ /** Wix restaurants. */
174
+ RESTAURANTS = "RESTAURANTS"
175
+ }
176
+ interface GetReferralProgramRequest {
177
+ }
178
+ interface GetReferralProgramResponse {
179
+ /** The retrieved ReferralProgram. */
180
+ referralProgram?: ReferralProgram;
181
+ }
182
+ interface BulkGetReferralProgramRequest {
183
+ }
184
+ interface BulkGetReferralProgramResponse {
185
+ /** Referral programs. */
186
+ programInSites?: ProgramInSite[];
187
+ }
188
+ interface ProgramInSite {
189
+ /** Metasite ID. */
190
+ metaSiteId?: string;
191
+ /** Referral program. */
192
+ referralProgram?: ReferralProgram;
193
+ }
194
+ interface QueryReferralProgramsRequest {
195
+ /** Query to filter ReferralPrograms. */
196
+ query: CursorQuery$4;
197
+ }
198
+ interface CursorQuery$4 extends CursorQueryPagingMethodOneOf$4 {
199
+ /**
200
+ * Cursor paging options.
201
+ *
202
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
203
+ */
204
+ cursorPaging?: CursorPaging$4;
112
205
  /**
113
- * Filter object in the following format:
114
- * `"filter" : {
115
- * "fieldName1": "value1",
116
- * "fieldName2":{"$operator":"value2"}
117
- * }`
118
- * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
206
+ * Filter object.
207
+ *
208
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
119
209
  */
120
210
  filter?: Record<string, any> | null;
121
211
  /**
122
- * Sort object in the following format:
123
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
212
+ * Sort object.
213
+ *
214
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
124
215
  */
125
- sort?: Sorting$1[];
216
+ sort?: Sorting$4[];
126
217
  }
127
218
  /** @oneof */
128
- interface CursorQueryPagingMethodOneOf$1 {
129
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
130
- cursorPaging?: CursorPaging$1;
219
+ interface CursorQueryPagingMethodOneOf$4 {
220
+ /**
221
+ * Cursor paging options.
222
+ *
223
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
224
+ */
225
+ cursorPaging?: CursorPaging$4;
131
226
  }
132
- interface Sorting$1 {
227
+ interface Sorting$4 {
133
228
  /** Name of the field to sort by. */
134
229
  fieldName?: string;
135
230
  /** Sort order. */
136
- order?: SortOrder$1;
231
+ order?: SortOrder$4;
137
232
  }
138
- declare enum SortOrder$1 {
233
+ declare enum SortOrder$4 {
139
234
  ASC = "ASC",
140
235
  DESC = "DESC"
141
236
  }
142
- interface CursorPaging$1 {
237
+ interface CursorPaging$4 {
143
238
  /** Maximum number of items to return in the results. */
144
239
  limit?: number | null;
145
240
  /**
@@ -150,11 +245,17 @@ interface CursorPaging$1 {
150
245
  */
151
246
  cursor?: string | null;
152
247
  }
153
- interface CursorPagingMetadata$1 {
248
+ interface QueryReferralProgramsResponse {
249
+ /** ReferralPrograms that match the query. */
250
+ referralPrograms?: ReferralProgram[];
251
+ /** Paging metadata. */
252
+ pagingMetadata?: CursorPagingMetadata$4;
253
+ }
254
+ interface CursorPagingMetadata$4 {
154
255
  /** Number of items returned in the response. */
155
256
  count?: number | null;
156
257
  /** Cursor strings that point to the next page, previous page, or both. */
157
- cursors?: Cursors$3;
258
+ cursors?: Cursors$4;
158
259
  /**
159
260
  * Whether there are more pages to retrieve following the current page.
160
261
  *
@@ -163,219 +264,976 @@ interface CursorPagingMetadata$1 {
163
264
  */
164
265
  hasNext?: boolean | null;
165
266
  }
166
- interface Cursors$3 {
267
+ interface Cursors$4 {
167
268
  /** Cursor string pointing to the next page in the list of results. */
168
269
  next?: string | null;
169
270
  /** Cursor pointing to the previous page in the list of results. */
170
271
  prev?: string | null;
171
272
  }
172
- interface GetReferralStatisticsResponse {
173
- /** Total sign ups completed by referred friends */
174
- totalSignUpsCompleted?: number;
175
- /** Total actions completed by referred friends */
176
- totalActionsCompleted?: number;
177
- /** Total amount of purchases made by referred friends */
178
- totalAmountGenerated?: string;
273
+ interface UpdateReferralProgramRequest {
274
+ /** ReferralProgram to be updated, may be partial. */
275
+ referralProgram: ReferralProgram;
179
276
  }
180
- interface QueryReferringCustomerTotalsResponse {
181
- /** List of ReferringCustomerTotals that match the query. */
182
- referringCustomerTotals?: ReferringCustomerTotal[];
183
- /** Paging metadata. */
184
- metadata?: CursorPagingMetadata$1;
277
+ interface UpdateReferralProgramResponse {
278
+ /** The updated ReferralProgram. */
279
+ referralProgram?: ReferralProgram;
185
280
  }
186
- interface ReferringCustomerTotal {
187
- /**
188
- * Referring customer id.
189
- * @readonly
190
- */
191
- referringCustomerId?: string;
281
+ interface ActivateReferralProgramRequest {
282
+ }
283
+ interface ActivateReferralProgramResponse {
284
+ /** The activated ReferralProgram. */
285
+ referralProgram?: ReferralProgram;
286
+ }
287
+ interface PauseReferralProgramRequest {
288
+ }
289
+ interface PauseReferralProgramResponse {
290
+ /** The paused ReferralProgram. */
291
+ referralProgram?: ReferralProgram;
292
+ }
293
+ interface GetAISocialMediaPostsSuggestionsRequest {
294
+ /** The topic to generate suggestions for. */
295
+ topic?: string;
296
+ }
297
+ interface GetAISocialMediaPostsSuggestionsResponse {
298
+ /** The generated suggestions. */
299
+ suggestions?: AISocialMediaPostSuggestion[];
300
+ /** The refer friends page URL. */
301
+ referFriendsPageUrl?: string | null;
302
+ }
303
+ interface AISocialMediaPostSuggestion {
304
+ /** The suggested post content. */
305
+ postContent?: string;
306
+ /** The suggested hashtags. */
307
+ hashtags?: string[];
308
+ }
309
+ interface GenerateAISocialMediaPostsSuggestionsRequest {
310
+ /** The topic to generate suggestions for. */
311
+ topic?: string;
312
+ }
313
+ interface GenerateAISocialMediaPostsSuggestionsResponse {
314
+ /** The generated suggestions. */
315
+ suggestions?: AISocialMediaPostSuggestion[];
316
+ /** The refer friends page URL. */
317
+ referFriendsPageUrl?: string | null;
318
+ }
319
+ interface GetReferralProgramPremiumFeaturesRequest {
320
+ }
321
+ interface GetReferralProgramPremiumFeaturesResponse {
192
322
  /**
193
- * Contact id.
323
+ * Set to true if user has referral program feature.
194
324
  * @readonly
195
325
  */
196
- contactId?: string;
326
+ referralProgram?: boolean;
327
+ }
328
+ interface DomainEvent$4 extends DomainEventBodyOneOf$4 {
329
+ createdEvent?: EntityCreatedEvent$4;
330
+ updatedEvent?: EntityUpdatedEvent$4;
331
+ deletedEvent?: EntityDeletedEvent$4;
332
+ actionEvent?: ActionEvent$4;
197
333
  /**
198
- * Last successful referral date.
199
- * @readonly
334
+ * Unique event ID.
335
+ * Allows clients to ignore duplicate webhooks.
200
336
  */
201
- lastSuccessfulReferral?: Date;
337
+ _id?: string;
202
338
  /**
203
- * Total successful referrals made by this customer.
204
- * @readonly
339
+ * Assumes actions are also always typed to an entity_type
340
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
205
341
  */
206
- totalSuccessfulReferrals?: number;
342
+ entityFqdn?: string;
207
343
  /**
208
- * Total amount generated by friends referred by this customer.
209
- * @readonly
344
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
345
+ * This is although the created/updated/deleted notion is duplication of the oneof types
346
+ * Example: created/updated/deleted/started/completed/email_opened
210
347
  */
211
- totalAmountGenerated?: string;
348
+ slug?: string;
349
+ /** ID of the entity associated with the event. */
350
+ entityId?: string;
351
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
352
+ eventTime?: Date;
212
353
  /**
213
- * Last friend action date.
214
- * @readonly
354
+ * Whether the event was triggered as a result of a privacy regulation application
355
+ * (for example, GDPR).
215
356
  */
216
- lastFriendAction?: Date;
357
+ triggeredByAnonymizeRequest?: boolean | null;
358
+ /** If present, indicates the action that triggered the event. */
359
+ originatedFrom?: string | null;
217
360
  /**
218
- * Total friends that have actions done.
219
- * @readonly
361
+ * A sequence number defining the order of updates to the underlying entity.
362
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
363
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
364
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
365
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
366
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
220
367
  */
221
- totalFriendsWithActions?: number;
368
+ entityEventSequence?: string | null;
222
369
  }
223
- interface QueryReferredFriendActionsResponse {
224
- /** List of ReferredFriendActions that match the query. */
225
- referredFriendActions?: ReferredFriendAction[];
226
- /** Paging metadata. */
227
- metadata?: CursorPagingMetadata$1;
370
+ /** @oneof */
371
+ interface DomainEventBodyOneOf$4 {
372
+ createdEvent?: EntityCreatedEvent$4;
373
+ updatedEvent?: EntityUpdatedEvent$4;
374
+ deletedEvent?: EntityDeletedEvent$4;
375
+ actionEvent?: ActionEvent$4;
376
+ }
377
+ interface EntityCreatedEvent$4 {
378
+ entity?: string;
379
+ }
380
+ interface RestoreInfo {
381
+ deletedDate?: Date;
382
+ }
383
+ interface EntityUpdatedEvent$4 {
384
+ /**
385
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
386
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
387
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
388
+ */
389
+ currentEntity?: string;
390
+ }
391
+ interface EntityDeletedEvent$4 {
392
+ /** Entity that was deleted */
393
+ deletedEntity?: string | null;
394
+ }
395
+ interface ActionEvent$4 {
396
+ body?: string;
397
+ }
398
+ interface Empty$3 {
399
+ }
400
+ interface MetaSiteSpecialEvent extends MetaSiteSpecialEventPayloadOneOf {
401
+ /** Emitted on a meta site creation. */
402
+ siteCreated?: SiteCreated;
403
+ /** Emitted on a meta site transfer completion. */
404
+ siteTransferred?: SiteTransferred;
405
+ /** Emitted on a meta site deletion. */
406
+ siteDeleted?: SiteDeleted;
407
+ /** Emitted on a meta site restoration. */
408
+ siteUndeleted?: SiteUndeleted;
409
+ /** Emitted on the first* publish of the meta site (* switching from unpublished to published state). */
410
+ sitePublished?: SitePublished;
411
+ /** Emitted on a meta site unpublish. */
412
+ siteUnpublished?: SiteUnpublished;
413
+ /** Emitted when meta site is marked as template. */
414
+ siteMarkedAsTemplate?: SiteMarkedAsTemplate;
415
+ /** Emitted when meta site is marked as a WixSite. */
416
+ siteMarkedAsWixSite?: SiteMarkedAsWixSite;
417
+ /** Emitted when an application is provisioned (installed). */
418
+ serviceProvisioned?: ServiceProvisioned;
419
+ /** Emitted when an application is removed (uninstalled). */
420
+ serviceRemoved?: ServiceRemoved;
421
+ /** Emitted when meta site name (URL slug) is changed. */
422
+ siteRenamedPayload?: SiteRenamed;
423
+ /** Emitted when meta site was permanently deleted. */
424
+ hardDeleted?: SiteHardDeleted;
425
+ /** Emitted on a namespace change. */
426
+ namespaceChanged?: NamespaceChanged;
427
+ /** Emitted when Studio is attached. */
428
+ studioAssigned?: StudioAssigned;
429
+ /** Emitted when Studio is detached. */
430
+ studioUnassigned?: StudioUnassigned;
431
+ /** A meta site id. */
432
+ metaSiteId?: string;
433
+ /** A meta site version. Monotonically increasing. */
434
+ version?: string;
435
+ /** A timestamp of the event. */
436
+ timestamp?: string;
437
+ /** A list of "assets" (applications). The same as MetaSiteContext. */
438
+ assets?: Asset[];
228
439
  }
229
- interface ReferredFriendAction extends ReferredFriendActionRewardTypeOptionsOneOf {
230
- /** Coupon reward type options. */
231
- coupon?: V1Coupon$1;
232
- /** Loyalty points reward type options. */
233
- loyaltyPoints?: LoyaltyPoints;
440
+ /** @oneof */
441
+ interface MetaSiteSpecialEventPayloadOneOf {
442
+ /** Emitted on a meta site creation. */
443
+ siteCreated?: SiteCreated;
444
+ /** Emitted on a meta site transfer completion. */
445
+ siteTransferred?: SiteTransferred;
446
+ /** Emitted on a meta site deletion. */
447
+ siteDeleted?: SiteDeleted;
448
+ /** Emitted on a meta site restoration. */
449
+ siteUndeleted?: SiteUndeleted;
450
+ /** Emitted on the first* publish of the meta site (* switching from unpublished to published state). */
451
+ sitePublished?: SitePublished;
452
+ /** Emitted on a meta site unpublish. */
453
+ siteUnpublished?: SiteUnpublished;
454
+ /** Emitted when meta site is marked as template. */
455
+ siteMarkedAsTemplate?: SiteMarkedAsTemplate;
456
+ /** Emitted when meta site is marked as a WixSite. */
457
+ siteMarkedAsWixSite?: SiteMarkedAsWixSite;
458
+ /** Emitted when an application is provisioned (installed). */
459
+ serviceProvisioned?: ServiceProvisioned;
460
+ /** Emitted when an application is removed (uninstalled). */
461
+ serviceRemoved?: ServiceRemoved;
462
+ /** Emitted when meta site name (URL slug) is changed. */
463
+ siteRenamedPayload?: SiteRenamed;
464
+ /** Emitted when meta site was permanently deleted. */
465
+ hardDeleted?: SiteHardDeleted;
466
+ /** Emitted on a namespace change. */
467
+ namespaceChanged?: NamespaceChanged;
468
+ /** Emitted when Studio is attached. */
469
+ studioAssigned?: StudioAssigned;
470
+ /** Emitted when Studio is detached. */
471
+ studioUnassigned?: StudioUnassigned;
472
+ }
473
+ interface Asset {
474
+ /** An application definition id (app_id in dev-center). For legacy reasons may be UUID or a string (from Java Enum). */
475
+ appDefId?: string;
476
+ /** An instance id. For legacy reasons may be UUID or a string. */
477
+ instanceId?: string;
478
+ /** An application state. */
479
+ state?: State;
480
+ }
481
+ declare enum State {
482
+ UNKNOWN = "UNKNOWN",
483
+ ENABLED = "ENABLED",
484
+ DISABLED = "DISABLED",
485
+ PENDING = "PENDING",
486
+ DEMO = "DEMO"
487
+ }
488
+ interface SiteCreated {
489
+ /** A template identifier (empty if not created from a template). */
490
+ originTemplateId?: string;
491
+ /** An account id of the owner. */
492
+ ownerId?: string;
493
+ /** A context in which meta site was created. */
494
+ context?: SiteCreatedContext;
495
+ /**
496
+ * A meta site id from which this site was created.
497
+ *
498
+ * In case of a creation from a template it's a template id.
499
+ * In case of a site duplication ("Save As" in dashboard or duplicate in UM) it's an id of a source site.
500
+ */
501
+ originMetaSiteId?: string | null;
502
+ /** A meta site name (URL slug). */
503
+ siteName?: string;
504
+ /** A namespace. */
505
+ namespace?: Namespace;
506
+ }
507
+ declare enum SiteCreatedContext {
508
+ /** A valid option, we don't expose all reasons why site might be created. */
509
+ OTHER = "OTHER",
510
+ /** A meta site was created from template. */
511
+ FROM_TEMPLATE = "FROM_TEMPLATE",
512
+ /** A meta site was created by copying of the transfferred meta site. */
513
+ DUPLICATE_BY_SITE_TRANSFER = "DUPLICATE_BY_SITE_TRANSFER",
514
+ /** A copy of existing meta site. */
515
+ DUPLICATE = "DUPLICATE",
516
+ /** A meta site was created as a transfferred site (copy of the original), old flow, should die soon. */
517
+ OLD_SITE_TRANSFER = "OLD_SITE_TRANSFER",
518
+ /** deprecated A meta site was created for Flash editor. */
519
+ FLASH = "FLASH"
520
+ }
521
+ declare enum Namespace {
522
+ UNKNOWN_NAMESPACE = "UNKNOWN_NAMESPACE",
523
+ /** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */
524
+ WIX = "WIX",
525
+ /** 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. */
526
+ SHOUT_OUT = "SHOUT_OUT",
527
+ /** 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. */
528
+ ALBUMS = "ALBUMS",
529
+ /** 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. */
530
+ WIX_STORES_TEST_DRIVE = "WIX_STORES_TEST_DRIVE",
531
+ /** Hotels standalone (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
532
+ HOTELS = "HOTELS",
533
+ /** 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. */
534
+ CLUBS = "CLUBS",
535
+ /** A partially created ADI website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
536
+ ONBOARDING_DRAFT = "ONBOARDING_DRAFT",
537
+ /** AppBuilder for AppStudio / shmite (c). MetaSites with this namespace will *not* be shown in a user's site list by default. */
538
+ DEV_SITE = "DEV_SITE",
539
+ /** 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. */
540
+ LOGOS = "LOGOS",
541
+ /** 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. */
542
+ VIDEO_MAKER = "VIDEO_MAKER",
543
+ /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
544
+ PARTNER_DASHBOARD = "PARTNER_DASHBOARD",
545
+ /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
546
+ DEV_CENTER_COMPANY = "DEV_CENTER_COMPANY",
547
+ /**
548
+ * A draft created by HTML editor on open. Upon "first save" it will be moved to be of WIX domain.
549
+ *
550
+ * Meta site with this namespace will *not* be shown in a user's site list by default.
551
+ */
552
+ HTML_DRAFT = "HTML_DRAFT",
553
+ /**
554
+ * the user-journey for Fitness users who want to start from managing their business instead of designing their website.
555
+ * Will be accessible from Site List and will not have a website app.
556
+ * Once the user attaches a site, the site will become a regular wixsite.
557
+ */
558
+ SITELESS_BUSINESS = "SITELESS_BUSINESS",
559
+ /** Belongs to "strategic products" company. Supports new product in the creator's economy space. */
560
+ CREATOR_ECONOMY = "CREATOR_ECONOMY",
561
+ /** It is to be used in the Business First efforts. */
562
+ DASHBOARD_FIRST = "DASHBOARD_FIRST",
563
+ /** Bookings business flow with no site. */
564
+ ANYWHERE = "ANYWHERE",
565
+ /** Namespace for Headless Backoffice with no editor */
566
+ HEADLESS = "HEADLESS",
567
+ /**
568
+ * Namespace for master site that will exist in parent account that will be referenced by subaccounts
569
+ * The site will be used for account level CSM feature for enterprise
570
+ */
571
+ ACCOUNT_MASTER_CMS = "ACCOUNT_MASTER_CMS",
572
+ /** Rise.ai Siteless account management for Gift Cards and Store Credit. */
573
+ RISE = "RISE",
574
+ /**
575
+ * As part of the branded app new funnel, users now can create a meta site that will be branded app first.
576
+ * There's a blank site behind the scene but it's blank).
577
+ * The Mobile company will be the owner of this namespace.
578
+ */
579
+ BRANDED_FIRST = "BRANDED_FIRST",
580
+ /** Nownia.com Siteless account management for Ai Scheduling Assistant. */
581
+ NOWNIA = "NOWNIA"
582
+ }
583
+ /** Site transferred to another user. */
584
+ interface SiteTransferred {
585
+ /** A previous owner id (user that transfers meta site). */
586
+ oldOwnerId?: string;
587
+ /** A new owner id (user that accepts meta site). */
588
+ newOwnerId?: string;
589
+ }
590
+ /** Soft deletion of the meta site. Could be restored. */
591
+ interface SiteDeleted {
592
+ /** A deletion context. */
593
+ deleteContext?: DeleteContext;
594
+ }
595
+ interface DeleteContext {
596
+ /** When the meta site was deleted. */
597
+ dateDeleted?: Date;
598
+ /** A status. */
599
+ deleteStatus?: DeleteStatus;
600
+ /** A reason (flow). */
601
+ deleteOrigin?: string;
602
+ /** A service that deleted it. */
603
+ initiatorId?: string | null;
604
+ }
605
+ declare enum DeleteStatus {
606
+ UNKNOWN = "UNKNOWN",
607
+ TRASH = "TRASH",
608
+ DELETED = "DELETED",
609
+ PENDING_PURGE = "PENDING_PURGE"
610
+ }
611
+ /** Restoration of the meta site. */
612
+ interface SiteUndeleted {
613
+ }
614
+ /** First publish of a meta site. Or subsequent publish after unpublish. */
615
+ interface SitePublished {
616
+ }
617
+ interface SiteUnpublished {
618
+ /** A list of URLs previously associated with the meta site. */
619
+ urls?: string[];
620
+ }
621
+ interface SiteMarkedAsTemplate {
622
+ }
623
+ interface SiteMarkedAsWixSite {
624
+ }
625
+ interface ServiceProvisioned {
626
+ /** Either UUID or EmbeddedServiceType. */
627
+ appDefId?: string;
628
+ /** Not only UUID. Something here could be something weird. */
629
+ instanceId?: string;
630
+ /** An instance id from which this instance is originated. */
631
+ originInstanceId?: string;
632
+ /** A version. */
633
+ version?: string | null;
634
+ }
635
+ interface ServiceRemoved {
636
+ /** Either UUID or EmbeddedServiceType. */
637
+ appDefId?: string;
638
+ /** Not only UUID. Something here could be something weird. */
639
+ instanceId?: string;
640
+ /** A version. */
641
+ version?: string | null;
642
+ }
643
+ /** Rename of the site. Meaning, free public url has been changed as well. */
644
+ interface SiteRenamed {
645
+ /** A new meta site name (URL slug). */
646
+ newSiteName?: string;
647
+ /** A previous meta site name (URL slug). */
648
+ oldSiteName?: string;
649
+ }
650
+ /**
651
+ * Hard deletion of the meta site.
652
+ *
653
+ * Could not be restored. Therefore it's desirable to cleanup data.
654
+ */
655
+ interface SiteHardDeleted {
656
+ /** A deletion context. */
657
+ deleteContext?: DeleteContext;
658
+ }
659
+ interface NamespaceChanged {
660
+ /** A previous namespace. */
661
+ oldNamespace?: Namespace;
662
+ /** A new namespace. */
663
+ newNamespace?: Namespace;
664
+ }
665
+ /** Assigned Studio editor */
666
+ interface StudioAssigned {
667
+ }
668
+ /** Unassigned Studio editor */
669
+ interface StudioUnassigned {
670
+ }
671
+ interface HtmlSitePublished {
672
+ /** Application instance ID */
673
+ appInstanceId?: string;
674
+ /** Application type */
675
+ appType?: string;
676
+ /** Revision */
677
+ revision?: string;
678
+ /** MSID */
679
+ metaSiteId?: string | null;
680
+ /** optional branch id if publish is done from branch */
681
+ branchId?: string | null;
682
+ /** The site's last transactionId */
683
+ lastTransactionId?: string | null;
684
+ /** A list of the site's pages */
685
+ pages?: Page[];
686
+ /** Site's publish date */
687
+ publishDate?: string;
688
+ }
689
+ interface Page {
690
+ /** Page's Id */
691
+ _id?: string;
692
+ }
693
+ interface SubscriptionEvent extends SubscriptionEventEventOneOf {
694
+ /** Triggered when a subscription is created. */
695
+ created?: SubscriptionCreated;
234
696
  /**
235
- * Referred friend id.
236
- * @readonly
697
+ * Triggered when a subscription is assigned to a Wix site, including the initial
698
+ * assignment of a floating subscription or a re-assignement from a different site.
237
699
  */
238
- referredFriendId?: string;
700
+ assigned?: SubscriptionAssigned;
701
+ /** Triggered when a subscription is canceled. */
702
+ cancelled?: SubscriptionCancelled;
703
+ /** Triggered when the subscription's auto renew is turned on. */
704
+ autoRenewTurnedOn?: SubscriptionAutoRenewTurnedOn;
705
+ /** Triggered when the subscription's auto renew is turned off. */
706
+ autoRenewTurnedOff?: SubscriptionAutoRenewTurnedOff;
239
707
  /**
240
- * Contact id.
241
- * @readonly
708
+ * Triggered when a subscription is unassigned from a Wix site and becomes
709
+ * floating.
242
710
  */
243
- contactId?: string;
711
+ unassigned?: SubscriptionUnassigned;
244
712
  /**
245
- * First action trigger.
246
- * @readonly
713
+ * Triggered when a subscription is transferred from one Wix account to another.
714
+ * A transfer includes cancelling the original subscription and creating a new
715
+ * subscription for the target account. The event returns both the original
716
+ * and the new subscription.
247
717
  */
248
- trigger?: V1Trigger;
718
+ transferred?: SubscriptionTransferred;
719
+ /** Triggered when a recurring charge succeeds for a subscription. */
720
+ recurringChargeSucceeded?: RecurringChargeSucceeded;
249
721
  /**
250
- * First action date.
251
- * @readonly
722
+ * Triggered when a subscription was updated including when its product has been
723
+ * up- or downgraded or the billing cycle is changed.
252
724
  */
253
- actionDate?: Date;
254
- /** Issued reward type. */
255
- rewardType?: Reward;
256
- /** Total number of actions. */
257
- totalActions?: number;
725
+ contractSwitched?: ContractSwitched;
258
726
  /**
259
- * Total amount spent by this referred friend.
260
- * @readonly
727
+ * Triggered when a subscription gets close to the end of its billing cycle.
728
+ * The exact number of days is defined in the billing system.
261
729
  */
262
- totalAmountSpent?: string;
730
+ nearEndOfPeriod?: SubscriptionNearEndOfPeriod;
263
731
  /**
264
- * friend signup date.
265
- * @readonly
732
+ * Triggered when a subscription is updated and the change doesn't happen
733
+ * immediately but at the end of the current billing cycle.
266
734
  */
267
- signupDate?: Date;
735
+ pendingChange?: SubscriptionPendingChange;
736
+ /** ID of the subscription's event. */
737
+ eventId?: string | null;
738
+ /**
739
+ * Date and time of the event in
740
+ * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
741
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
742
+ */
743
+ eventDate?: Date;
268
744
  }
269
745
  /** @oneof */
270
- interface ReferredFriendActionRewardTypeOptionsOneOf {
271
- /** Coupon reward type options. */
272
- coupon?: V1Coupon$1;
273
- /** Loyalty points reward type options. */
274
- loyaltyPoints?: LoyaltyPoints;
746
+ interface SubscriptionEventEventOneOf {
747
+ /** Triggered when a subscription is created. */
748
+ created?: SubscriptionCreated;
749
+ /**
750
+ * Triggered when a subscription is assigned to a Wix site, including the initial
751
+ * assignment of a floating subscription or a re-assignement from a different site.
752
+ */
753
+ assigned?: SubscriptionAssigned;
754
+ /** Triggered when a subscription is canceled. */
755
+ cancelled?: SubscriptionCancelled;
756
+ /** Triggered when the subscription's auto renew is turned on. */
757
+ autoRenewTurnedOn?: SubscriptionAutoRenewTurnedOn;
758
+ /** Triggered when the subscription's auto renew is turned off. */
759
+ autoRenewTurnedOff?: SubscriptionAutoRenewTurnedOff;
760
+ /**
761
+ * Triggered when a subscription is unassigned from a Wix site and becomes
762
+ * floating.
763
+ */
764
+ unassigned?: SubscriptionUnassigned;
765
+ /**
766
+ * Triggered when a subscription is transferred from one Wix account to another.
767
+ * A transfer includes cancelling the original subscription and creating a new
768
+ * subscription for the target account. The event returns both the original
769
+ * and the new subscription.
770
+ */
771
+ transferred?: SubscriptionTransferred;
772
+ /** Triggered when a recurring charge succeeds for a subscription. */
773
+ recurringChargeSucceeded?: RecurringChargeSucceeded;
774
+ /**
775
+ * Triggered when a subscription was updated including when its product has been
776
+ * up- or downgraded or the billing cycle is changed.
777
+ */
778
+ contractSwitched?: ContractSwitched;
779
+ /**
780
+ * Triggered when a subscription gets close to the end of its billing cycle.
781
+ * The exact number of days is defined in the billing system.
782
+ */
783
+ nearEndOfPeriod?: SubscriptionNearEndOfPeriod;
784
+ /**
785
+ * Triggered when a subscription is updated and the change doesn't happen
786
+ * immediately but at the end of the current billing cycle.
787
+ */
788
+ pendingChange?: SubscriptionPendingChange;
275
789
  }
276
- interface V1Coupon$1 {
790
+ /** Triggered when a subscription is created. */
791
+ interface SubscriptionCreated {
792
+ /** Created subscription. */
793
+ subscription?: Subscription;
794
+ /** Metadata for the `created` event. */
795
+ metadata?: Record<string, string>;
277
796
  /**
278
- * Coupon ID.
279
- * @readonly
797
+ * Subscription reactivation data.
798
+ * A subscription can be reactivated for example if it was incorrectly canceled because of fraud and then reactivated
799
+ * by the billing system
280
800
  */
801
+ reactivationData?: ReactivationData;
802
+ }
803
+ /**
804
+ * A subscription holds information about a Premium product that a Wix account
805
+ * owner has purchased including details about the billing.
806
+ */
807
+ interface Subscription {
808
+ /** ID of the subscription. */
281
809
  _id?: string;
810
+ /** ID of the Wix account that purchased the subscription. */
811
+ userId?: string;
282
812
  /**
283
- * Coupon code.
284
- * @readonly
813
+ * ID of the [product](https://bo.wix.com/wix-docs/rest/premium/premium-product-catalog-v2/products/product-object)
814
+ * for which the subscription was purchased.
285
815
  */
286
- code?: string;
816
+ productId?: string;
287
817
  /**
288
- * Coupon status.
289
- * @readonly
818
+ * Date and time the subscription was created in
819
+ * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
820
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
290
821
  */
291
- status?: Status$2;
822
+ createdAt?: Date;
292
823
  /**
293
- * Coupon specification.
294
- * @readonly
824
+ * Date and time the subscription was last updated in
825
+ * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
826
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
295
827
  */
296
- couponSpecification?: Coupon$1;
828
+ updatedAt?: Date;
829
+ /**
830
+ * ID of the metasite that the subscription is assigned to.
831
+ * Available only when the subscription is assigned to a Wix site.
832
+ * Subscriptions for account level products can't be assigned to a Wix site.
833
+ */
834
+ metaSiteId?: string | null;
835
+ /** Information about the system that manages the subscription's billing. */
836
+ billingReference?: BillingReference;
837
+ /** Information about the billing cycle of the subscription. */
838
+ cycle?: Cycle;
839
+ /**
840
+ * Subscription status.
841
+ *
842
+ * + `UNKNOWN`: Default status.
843
+ * + `AUTO_RENEW_ON`: Subscription is active and automatically renews at the end of the current billing cycle.
844
+ * + `AUTO_RENEW_OFF`: Subscription is active but expires at the end of the current billing cycle.
845
+ * + `MANUAL_RECURRING`: Subscription is active and renews at the end of the current billing cycle, in case the customer takes an action related to the payment.
846
+ * + `CANCELLED`: Subscription isn't active because it has been canceled.
847
+ * + `TRANSFERRED`: Subscription isn't active because it has been transferred to a different account. A different active subscription was created for the target account.
848
+ */
849
+ status?: SubscriptionStatus;
850
+ /**
851
+ * Date and time the subscription was last transferred from one Wix account to
852
+ * another in
853
+ * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
854
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
855
+ */
856
+ transferredAt?: Date;
857
+ /**
858
+ * ID of the [product type](https://bo.wix.com/wix-docs/rest/premium/premium-product-catalog-v2/product-types/product-type-object)
859
+ * that the product, for which the subscription was purchased, belongs to.
860
+ */
861
+ productTypeId?: string;
862
+ /** Version number, which increments by 1 each time the subscription is updated. */
863
+ version?: number;
864
+ /**
865
+ * Whether the subscription is active. Includes the statuses
866
+ * `"AUTO_RENEW_ON"`, `"AUTO_RENEW_OFF"`, and `"MANUAL_RECURRING"`.
867
+ */
868
+ active?: boolean;
869
+ /**
870
+ * Date and time the subscription was originally created in
871
+ * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
872
+ * `YYYY-MM-DDThh:mm:ss.sssZ` format.
873
+ * Differs from `createdAt` in case the subscription was originally created for a different Wix account and has been transferred.
874
+ */
875
+ originalCreationDate?: Date;
876
+ /** Custom metadata about the subscription. */
877
+ metadata?: Record<string, string>;
878
+ /**
879
+ * 2-letter country code in
880
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
881
+ * format.
882
+ */
883
+ countryCode?: string | null;
297
884
  }
298
- declare enum Status$2 {
299
- /** Unknown coupon status. */
885
+ interface BillingReference {
886
+ /**
887
+ * Name of the billing system that manages the subscription.
888
+ *
889
+ * + `"UNKNOWN"`: Default value.
890
+ * + `"SBS"`: [Wix Billing](https://github.com/wix-p/premium-billing/tree/master/sbs).
891
+ * + `"LICENSER"`:
892
+ * + `"BASS"`: [Billing and Subscriptions System](https://dev.wix.com/docs/rest/internal-only/premium/subscriptions-by-billing-by-wix/introduction).
893
+ * + `"RESELLER"`: [External Reseller](https://dev.wix.com/api/rest/account-level-apis/resellers/introduction).
894
+ */
895
+ providerName?: ProviderName;
896
+ /** Current provider reference ID. */
897
+ providerReferenceId?: string | null;
898
+ /** Previous provider reference IDs. Used for when a subscription is extended, specifically for domains. */
899
+ previousProviderReferenceIds?: string[];
900
+ }
901
+ declare enum ProviderName {
300
902
  UNKNOWN = "UNKNOWN",
301
- /** Coupon is active and can be applied. */
302
- ACTIVE = "ACTIVE",
303
- /** Coupon was already applied and can not be used anymore. */
304
- APPLIED = "APPLIED",
305
- /** Coupon was deleted. */
306
- DELETED = "DELETED"
307
- }
308
- interface Coupon$1 extends CouponDiscountTypeOptionsOneOf$1, CouponScopeOrMinSubtotalOneOf$1 {
309
- /** Options for fixed amount discount type */
310
- fixedAmountOptions?: FixedAmountDiscount$1;
311
- /** Options for percentage discount type */
312
- percentageOptions?: PercentageDiscount$1;
313
- /** Limit the coupon to carts with a subtotal above this number. */
314
- minimumSubtotal?: number;
315
- /** Specifies the type of line items this coupon will apply to. */
316
- scope?: CouponScope$1;
317
- /** Coupon name */
318
- name?: string;
319
- /** Coupon discount type */
320
- discountType?: DiscountType$1;
321
- /** Limit the coupon to only apply to one item in cart. */
322
- limitedToOneItem?: boolean | null;
323
- /** If true, coupon also applies to subscriptions. */
324
- appliesToSubscriptions?: boolean | null;
325
- /** Specifies the amount of discounted cycles for subscription item. See Stores Coupons documentation for more info. */
326
- discountedCycleCount?: number | null;
903
+ SBS = "SBS",
904
+ LICENSER = "LICENSER",
905
+ BASS = "BASS",
906
+ RESELLER = "RESELLER",
907
+ RECURRING_INVOICES = "RECURRING_INVOICES"
908
+ }
909
+ interface Cycle extends CycleCycleSelectorOneOf {
910
+ /** repetitive interval */
911
+ interval?: Interval;
912
+ /** one time */
913
+ oneTime?: OneTime;
327
914
  }
328
915
  /** @oneof */
329
- interface CouponDiscountTypeOptionsOneOf$1 {
330
- /** Options for fixed amount discount type */
331
- fixedAmountOptions?: FixedAmountDiscount$1;
332
- /** Options for percentage discount type */
333
- percentageOptions?: PercentageDiscount$1;
916
+ interface CycleCycleSelectorOneOf {
917
+ /** repetitive interval */
918
+ interval?: Interval;
919
+ /** one time */
920
+ oneTime?: OneTime;
921
+ }
922
+ interface Interval {
923
+ /** interval unit of measure */
924
+ unit?: IntervalUnit;
925
+ /** number of interval */
926
+ count?: number;
927
+ }
928
+ declare enum IntervalUnit {
929
+ /** unknown interval unit */
930
+ UNKNOWN = "UNKNOWN",
931
+ /** day */
932
+ DAY = "DAY",
933
+ /** week */
934
+ WEEK = "WEEK",
935
+ /** month */
936
+ MONTH = "MONTH",
937
+ /** year */
938
+ YEAR = "YEAR"
939
+ }
940
+ interface OneTime {
941
+ }
942
+ declare enum SubscriptionStatus {
943
+ UNKNOWN = "UNKNOWN",
944
+ AUTO_RENEW_ON = "AUTO_RENEW_ON",
945
+ AUTO_RENEW_OFF = "AUTO_RENEW_OFF",
946
+ MANUAL_RECURRING = "MANUAL_RECURRING",
947
+ CANCELLED = "CANCELLED",
948
+ TRANSFERRED = "TRANSFERRED"
949
+ }
950
+ /** Triggered when a subscription is reactivated. */
951
+ interface ReactivationData {
952
+ reactivationReason?: ReactivationReasonEnum;
953
+ /**
954
+ * In the event of reactivation after chargeback dispute, the subscription may be extended according to the
955
+ * number of days it was inactive during the time of resolving the dispute
956
+ */
957
+ newEndOfPeriod?: Date;
958
+ /** The original end date, before the inactive period. */
959
+ oldEndOfPeriod?: Date;
960
+ /** The difference in days between the new new_end_of_period and old_end_of_period */
961
+ differenceInDays?: number | null;
962
+ }
963
+ /** Reason for subscription reactivation */
964
+ declare enum ReactivationReasonEnum {
965
+ UNKNOWN = "UNKNOWN",
966
+ /**
967
+ * Subscription was reactivated due to billing status change from CANCELED to ACTIVE, for example if it was incorrectly
968
+ * canceled because of suspicion of fraud
969
+ */
970
+ BILLING_STATUS_CHANGE = "BILLING_STATUS_CHANGE",
971
+ /** Subscription was reactivated after a chargeback dispute */
972
+ REACTIVATED_AFTER_CHARGEBACK = "REACTIVATED_AFTER_CHARGEBACK"
973
+ }
974
+ /**
975
+ * Triggered when a subscription is assigned to a Wix site, including the initial
976
+ * assignment of a floating subscription or a re-assignement from a different site.
977
+ */
978
+ interface SubscriptionAssigned {
979
+ /** Assigned subscription. */
980
+ subscription?: Subscription;
981
+ /** ID of the metasite that the subscription has been assigned to before the update. */
982
+ previousMetaSiteId?: string | null;
983
+ }
984
+ /** Triggered when a subscription is canceled. */
985
+ interface SubscriptionCancelled {
986
+ /** Canceled subscription. */
987
+ subscription?: Subscription;
988
+ /** Details about the cancellation including who canceled the subscription and why. */
989
+ cancellationDetails?: CancellationDetails;
990
+ /**
991
+ * Whether the subscription is canceled immediately or expires at the end of the current billing cycle.
992
+ *
993
+ * Default: `false`
994
+ */
995
+ immediateCancel?: boolean;
996
+ /** Whether the subscription was canceled during the free trial period. */
997
+ canceledInFreeTrial?: boolean;
334
998
  }
335
- /** @oneof */
336
- interface CouponScopeOrMinSubtotalOneOf$1 {
337
- /** Limit the coupon to carts with a subtotal above this number. */
338
- minimumSubtotal?: number;
339
- /** Specifies the type of line items this coupon will apply to. */
340
- scope?: CouponScope$1;
999
+ /** Information about the cancellation flow including who canceled the subscription and why it was canceled. */
1000
+ interface CancellationDetails {
1001
+ /**
1002
+ * Cancellation code.
1003
+ *
1004
+ * Values supported for cancellations on behalf of the billing system: `-1`, `-2`, `-3`, `-4`, `-5`, `-6`, `-7`, `-8`.
1005
+ * For cancellations on behalf of the site owner or the service provider `cancellationCode`
1006
+ * is taken from the request of
1007
+ * [Cancel Immediately Offline](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/cancel-immediately-offline).
1008
+ *
1009
+ * + `-1`: The subscription has been cancelled by the billing system but none of the listed cancellation reasons applies.
1010
+ * + `-2`: There were payment problems.
1011
+ * + `-3`: There was a chargeback.
1012
+ * + `-4`: Customer support has canceled the subscription and issued a refund.
1013
+ * + `-5`: The site owner has changed their existing subscription.
1014
+ * + `-6`: The subscription has been transferred to a different Wix account.
1015
+ * + `-7`: The subscription has been canceled because the site owner hasn't manually authenticated the recurring payment during the subscription's grace period. For example, site owners must manually confirm recurring payments within 40 days when paying with boleto.
1016
+ * + `-8`: The Wix account that the subscription belonged to has been deleted.
1017
+ */
1018
+ cancellationCode?: number | null;
1019
+ /**
1020
+ * Cancellation reason. For cancellations on behalf of the site owner or the service provider `cancellationReason`
1021
+ * is taken from the request of
1022
+ * [Cancel Immediately Offline](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/cancel-immediately-offline).
1023
+ * For cancellations on behalf of the billing system `cancellationReason` is `null` or an empty string.
1024
+ */
1025
+ cancellationReason?: string | null;
1026
+ /**
1027
+ * Initiator of the cancellation. For `"USER_REQUESTED"` and `"APP_MANAGED"`,
1028
+ * `cancellationCode` and `cancellationReason` are taken from the request of
1029
+ * [Cancel Immediately](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/cancel-immediately)
1030
+ * or [Cancel Immediately Offline](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/cancel-immediately-offline).
1031
+ * For `"PASSIVE"`, cancellations `cancellationCode` is automatically calculated and `cancellationReason`
1032
+ * is `null` or an empty string.
1033
+ *
1034
+ * + `"UNKNOWN`: Default value.
1035
+ * + `"USER_REQUESTED"`: The Wix account owner has canceled the subscription.
1036
+ * + `"APP_MANAGED"`: The service provider has canceled the subscription.
1037
+ * + `"PASSIVE"`: The billing system has canceled the subscription. For example, in case of payment failure or fraud.
1038
+ */
1039
+ initiator?: Initiator;
341
1040
  }
342
- declare enum DiscountType$1 {
1041
+ declare enum Initiator {
343
1042
  UNKNOWN = "UNKNOWN",
344
- /** Discount as a fixed amount */
345
- FIXED_AMOUNT = "FIXED_AMOUNT",
346
- /** Discount as a percentage */
347
- PERCENTAGE = "PERCENTAGE",
348
- /** Free shipping */
349
- FREE_SHIPPING = "FREE_SHIPPING"
350
- }
351
- interface FixedAmountDiscount$1 {
352
- /** Fixed amount to discount */
353
- amount?: number;
1043
+ USER_REQUESTED = "USER_REQUESTED",
1044
+ APP_MANAGED = "APP_MANAGED",
1045
+ PASSIVE = "PASSIVE"
354
1046
  }
355
- interface PercentageDiscount$1 {
356
- percentage?: number;
1047
+ /** Triggered when the subscription's auto renew is turned on. */
1048
+ interface SubscriptionAutoRenewTurnedOn {
1049
+ /** Subscription for which auto renew is turned on. */
1050
+ subscription?: Subscription;
1051
+ /**
1052
+ * Supported values: `USER`, `APP`.
1053
+ *
1054
+ * Information about who turned auto renew on.
1055
+ * + `"USER"`: The site owner who purchased the subscription has turned auto renew on.
1056
+ * + `"APP"`: The service provider has turned auto renew on.
1057
+ */
1058
+ initiator?: string | null;
357
1059
  }
358
- interface CouponScope$1 {
359
- namespace?: string;
360
- group?: Group$1;
1060
+ /** Triggered when the subscription's auto renew is turned off. */
1061
+ interface SubscriptionAutoRenewTurnedOff {
1062
+ /** Subscription for which auto renew is turned off. */
1063
+ subscription?: Subscription;
1064
+ /** Details about the cancellation including who canceled the subscription and why. */
1065
+ cancellationDetails?: CancellationDetails;
1066
+ /**
1067
+ * Whether the subscription is immediately canceled or expires at the end of the current billing cycle.
1068
+ *
1069
+ * Default: `false`
1070
+ */
1071
+ immediateCancel?: boolean;
361
1072
  }
362
- interface Group$1 {
363
- name?: string;
364
- entityId?: string | null;
1073
+ /**
1074
+ * Triggered when a subscription is unassigned from a Wix site and becomes
1075
+ * floating.
1076
+ */
1077
+ interface SubscriptionUnassigned {
1078
+ /** Unassigned subscription. */
1079
+ subscription?: Subscription;
1080
+ /** ID of the metasite that the subscription has been assigned to before the event. */
1081
+ previousMetaSiteId?: string;
1082
+ /**
1083
+ * Reason why the subscription is unassigned.
1084
+ *
1085
+ * + `"UNKNOWN"`: Default value.
1086
+ * + `"USER_REQUESTED"`: The Wix account owner has unassigned the subscription.
1087
+ * + `"REPLACED_BY_ANOTHER_SUBSCRIPTION"`: A different subscription that replaces this subscription is assigned to the site.
1088
+ */
1089
+ unassignReason?: UnassignReason;
365
1090
  }
366
- interface LoyaltyPoints {
1091
+ declare enum UnassignReason {
1092
+ UNKNOWN = "UNKNOWN",
1093
+ USER_REQUESTED = "USER_REQUESTED",
1094
+ REPLACED_BY_ANOTHER_SUBSCRIPTION = "REPLACED_BY_ANOTHER_SUBSCRIPTION"
1095
+ }
1096
+ /**
1097
+ * Triggered when a subscription is transferred from one Wix account to another.
1098
+ * A transfer includes cancelling the original subscription and creating a new
1099
+ * subscription for the target account. The event returns both the original
1100
+ * and the new subscription.
1101
+ */
1102
+ interface SubscriptionTransferred {
1103
+ /** Original subscription that was canceled for the transfer. */
1104
+ originSubscription?: Subscription;
1105
+ /** Newly created subscription for the target account. */
1106
+ targetSubscription?: Subscription;
1107
+ }
1108
+ /** Triggered when a recurring charge succeeds for a subscription. */
1109
+ interface RecurringChargeSucceeded {
1110
+ /** Subscription for which the recurring charge has succeeded. */
1111
+ subscription?: Subscription;
1112
+ /** Indication that there was a successful charge at the end of the free trial period */
1113
+ freeTrialPeriodEnd?: boolean;
1114
+ }
1115
+ /**
1116
+ * Triggered when a subscription was updated including when its product has been
1117
+ * up- or downgraded or the billing cycle is changed.
1118
+ */
1119
+ interface ContractSwitched {
1120
+ /** Updated subscription. */
1121
+ subscription?: Subscription;
1122
+ /** Billing cycle before the update. */
1123
+ previousCycle?: Cycle;
1124
+ /** ID of the product belonging to the subscription before the update. */
1125
+ previousProductId?: string;
1126
+ /** ID of the product type that the subscription's original product belonged to before the update. */
1127
+ previousProductTypeId?: string;
1128
+ /**
1129
+ * Update type. __Note__: Doesn't include information about a product adjustment.
1130
+ * For that purpose, see `productAdjustment`.
1131
+ *
1132
+ * + `"NOT_APPLICABLE"`: Default value.
1133
+ * + `"ADDITIONAL_QUANTITY"`: An increased usage quota is added to the subscription. For example, a second mailbox is added to a subscription that previously included a single mailbox.
1134
+ * + `"CREDIT_UNUSED_PERIOD"`: The subscription is upgraded and the new price is less than the regular price. The new price applies to every billing cycle, not just the first cycle.
1135
+ * + `"REFUND_PRICE_DIFF"`: Not implemented.
1136
+ * + `"ADJUST_PERIOD_END"`: Not implemented.
1137
+ * + `"DOWNGRADE_GRACE_PERIOD"`: For downgrades during the grace period. In this situation, the site owner hasn’t paid yet and must immediately pay for the downgraded subscription.
1138
+ * + `"FULL_AMOUNT_PERIOD"`: For upgrades in which the site owner retains unused benefits. For example, site owners upgrading a Facebook Ads subscription retain their unused FB Ads credit. The unused credit is added to the new credit.
1139
+ * + `"END_OF_PERIOD"`: The subscription's billing current cycle is extended because of a downgrade.
1140
+ * + `"PENDING_CHANGES"`: The subscription's billing is updated, but the change doesn't apply immediately. Instead, the update becomes effective at the end of current billing cycle.
1141
+ * + `"DOWNGRADE_RENEWAL"`: The subscription is downgraded because of a declined payment. This prevents subscriptions from churning.
1142
+ */
1143
+ contractSwitchType?: ContractSwitchType;
367
1144
  /**
368
- * Loyalty transaction ID.
369
- * @readonly
1145
+ * ID of the metasite the subscription has been assigned to previously.
1146
+ * Available only in case the subscription is assigned to a different site.
370
1147
  */
371
- transactionId?: string;
1148
+ previousMetaSiteId?: string | null;
372
1149
  /**
373
- * Loyalty points amount given.
374
- * @readonly
1150
+ * Update reason.
1151
+ *
1152
+ * + `"PRICE_INCREASE"`: The subscription's price has been increased.
1153
+ * + `"EXTERNAL_PROVIDER_TRIGGER"`: Any reason other than a price increase.
375
1154
  */
376
- amount?: number;
1155
+ contractSwitchReason?: ContractSwitchReason;
1156
+ /** Information about the price update. Available only for updates with a price increase. */
1157
+ productPriceIncreaseData?: ProductPriceIncreaseData;
1158
+ /**
1159
+ * Information about a product adjustment. For example, a downgrade.
1160
+ * __Note__: This isn't the same as `contractSwitchType`.
1161
+ *
1162
+ * + `NOT_APPLICABLE`: There is no information about whether the product has been up- or downgraded.
1163
+ * + `DOWNGRADE`: The product has been downgraded.
1164
+ */
1165
+ productAdjustment?: ProductAdjustment;
1166
+ }
1167
+ /** Copied from SBS */
1168
+ declare enum ContractSwitchType {
1169
+ NOT_APPLICABLE = "NOT_APPLICABLE",
1170
+ ADDITIONAL_QUANTITY = "ADDITIONAL_QUANTITY",
1171
+ CREDIT_UNUSED_PERIOD = "CREDIT_UNUSED_PERIOD",
1172
+ REFUND_PRICE_DIFF = "REFUND_PRICE_DIFF",
1173
+ ADJUST_PERIOD_END = "ADJUST_PERIOD_END",
1174
+ DOWNGRADE_GRACE_PERIOD = "DOWNGRADE_GRACE_PERIOD",
1175
+ FULL_AMOUNT_PERIOD = "FULL_AMOUNT_PERIOD",
1176
+ END_OF_PERIOD = "END_OF_PERIOD",
1177
+ PENDING_CHANGES = "PENDING_CHANGES",
1178
+ DOWNGRADE_RENEWAL = "DOWNGRADE_RENEWAL"
1179
+ }
1180
+ declare enum ContractSwitchReason {
1181
+ EXTERNAL_PROVIDER_TRIGGER = "EXTERNAL_PROVIDER_TRIGGER",
1182
+ PRICE_INCREASE = "PRICE_INCREASE"
1183
+ }
1184
+ /** Triggered when a subscription's price is increased. */
1185
+ interface ProductPriceIncreaseData {
1186
+ /** Price of the subscription before the update. */
1187
+ previousPrice?: string | null;
1188
+ /** A value that is used in order to select the correct email template to send the user regarding the price increase. */
1189
+ emailTemplateSelector?: string | null;
1190
+ /** Used to differentiate between migration segments. Does not have to be unique per segment. */
1191
+ segmentName?: string | null;
1192
+ /** Used to determine how the price increase was triggered. */
1193
+ priceIncreaseTrigger?: PriceIncreaseTrigger;
1194
+ }
1195
+ /** Reason for Price Increase Trigger */
1196
+ declare enum PriceIncreaseTrigger {
1197
+ NEAR_RENEWAL = "NEAR_RENEWAL",
1198
+ RECURRING_SUCCESS = "RECURRING_SUCCESS",
1199
+ MANUAL = "MANUAL"
1200
+ }
1201
+ /** Triggered when a subscription's product is adusted. */
1202
+ declare enum ProductAdjustment {
1203
+ /** flag to show that the ContractSwitchedEvent is not applicable / needed */
1204
+ NOT_APPLICABLE = "NOT_APPLICABLE",
1205
+ /** flag to show that the ContractSwitchedEvent is a Downgrade */
1206
+ DOWNGRADE = "DOWNGRADE"
1207
+ }
1208
+ /**
1209
+ * Triggered when a subscription gets close to the end of its billing cycle.
1210
+ * The exact number of days is defined in the billing system.
1211
+ */
1212
+ interface SubscriptionNearEndOfPeriod {
1213
+ /** Subscription that got close to the end of its billing cycle. */
1214
+ subscription?: Subscription;
1215
+ /** Whether the subscription is within the free trial period. */
1216
+ inFreeTrial?: boolean;
1217
+ }
1218
+ /**
1219
+ * Triggered when a subscription is updated and the change doesn't happen
1220
+ * immediately but at the end of the current billing cycle.
1221
+ */
1222
+ interface SubscriptionPendingChange {
1223
+ /** Subscription for which a pending update is triggered. */
1224
+ subscription?: Subscription;
1225
+ }
1226
+ interface MessageEnvelope$4 {
1227
+ /** App instance ID. */
1228
+ instanceId?: string | null;
1229
+ /** Event type. */
1230
+ eventType?: string;
1231
+ /** The identification type and identity data. */
1232
+ identity?: IdentificationData$4;
1233
+ /** Stringify payload. */
1234
+ data?: string;
377
1235
  }
378
- interface IdentificationData$2 extends IdentificationDataIdOneOf$2 {
1236
+ interface IdentificationData$4 extends IdentificationDataIdOneOf$4 {
379
1237
  /** ID of a site visitor that has not logged in to the site. */
380
1238
  anonymousVisitorId?: string;
381
1239
  /** ID of a site visitor that has logged in to the site. */
@@ -385,10 +1243,10 @@ interface IdentificationData$2 extends IdentificationDataIdOneOf$2 {
385
1243
  /** ID of an app. */
386
1244
  appId?: string;
387
1245
  /** @readonly */
388
- identityType?: WebhookIdentityType$2;
1246
+ identityType?: WebhookIdentityType$4;
389
1247
  }
390
1248
  /** @oneof */
391
- interface IdentificationDataIdOneOf$2 {
1249
+ interface IdentificationDataIdOneOf$4 {
392
1250
  /** ID of a site visitor that has not logged in to the site. */
393
1251
  anonymousVisitorId?: string;
394
1252
  /** ID of a site visitor that has logged in to the site. */
@@ -398,75 +1256,91 @@ interface IdentificationDataIdOneOf$2 {
398
1256
  /** ID of an app. */
399
1257
  appId?: string;
400
1258
  }
401
- declare enum WebhookIdentityType$2 {
1259
+ declare enum WebhookIdentityType$4 {
402
1260
  UNKNOWN = "UNKNOWN",
403
1261
  ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
404
1262
  MEMBER = "MEMBER",
405
1263
  WIX_USER = "WIX_USER",
406
1264
  APP = "APP"
407
1265
  }
408
- interface GetReferralStatisticsResponseNonNullableFields {
409
- totalSignUpsCompleted: number;
410
- totalActionsCompleted: number;
411
- totalAmountGenerated: string;
1266
+ interface FixedAmountDiscountNonNullableFields$2 {
1267
+ amount: number;
412
1268
  }
413
- interface QueryReferringCustomerTotalsResponseNonNullableFields {
414
- referringCustomerTotals: {
415
- referringCustomerId: string;
416
- contactId: string;
417
- totalSuccessfulReferrals: number;
418
- totalAmountGenerated: string;
419
- totalFriendsWithActions: number;
420
- }[];
1269
+ interface PercentageDiscountNonNullableFields$2 {
1270
+ percentage: number;
421
1271
  }
422
- interface QueryReferredFriendActionsResponseNonNullableFields {
423
- referredFriendActions: {
424
- coupon?: {
425
- _id: string;
426
- code: string;
427
- status: Status$2;
428
- couponSpecification?: {
429
- fixedAmountOptions?: {
430
- amount: number;
431
- };
432
- percentageOptions?: {
433
- percentage: number;
434
- };
435
- minimumSubtotal: number;
436
- scope?: {
437
- namespace: string;
438
- group?: {
439
- name: string;
440
- };
441
- };
442
- name: string;
443
- discountType: DiscountType$1;
444
- };
445
- };
446
- loyaltyPoints?: {
447
- transactionId: string;
448
- amount: number;
449
- };
450
- referredFriendId: string;
451
- contactId: string;
452
- trigger?: {
453
- appId: string;
454
- activityType: string;
455
- };
456
- rewardType: Reward;
457
- totalActions: number;
458
- totalAmountSpent: string;
459
- }[];
1272
+ interface GroupNonNullableFields$2 {
1273
+ name: string;
460
1274
  }
461
- interface BaseEventMetadata$2 {
1275
+ interface CouponScopeNonNullableFields$2 {
1276
+ namespace: string;
1277
+ group?: GroupNonNullableFields$2;
1278
+ }
1279
+ interface CouponNonNullableFields$2 {
1280
+ fixedAmountOptions?: FixedAmountDiscountNonNullableFields$2;
1281
+ percentageOptions?: PercentageDiscountNonNullableFields$2;
1282
+ minimumSubtotal: number;
1283
+ scope?: CouponScopeNonNullableFields$2;
1284
+ name: string;
1285
+ discountType: DiscountType$2;
1286
+ }
1287
+ interface LoyaltyPointsNonNullableFields$1 {
1288
+ amount: number;
1289
+ }
1290
+ interface RewardNonNullableFields {
1291
+ couponOptions?: CouponNonNullableFields$2;
1292
+ loyaltyPointsOptions?: LoyaltyPointsNonNullableFields$1;
1293
+ type: Type$1;
1294
+ }
1295
+ interface EmailsNonNullableFields {
1296
+ encourageToReferFriends: App[];
1297
+ notifyCustomersAboutReward: boolean;
1298
+ }
1299
+ interface ReferralProgramNonNullableFields {
1300
+ status: ProgramStatus;
1301
+ referredFriendReward?: RewardNonNullableFields;
1302
+ referringCustomerReward?: RewardNonNullableFields;
1303
+ successfulReferralActions: Action[];
1304
+ isPremium: boolean;
1305
+ emails?: EmailsNonNullableFields;
1306
+ }
1307
+ interface GetReferralProgramResponseNonNullableFields {
1308
+ referralProgram?: ReferralProgramNonNullableFields;
1309
+ }
1310
+ interface QueryReferralProgramsResponseNonNullableFields {
1311
+ referralPrograms: ReferralProgramNonNullableFields[];
1312
+ }
1313
+ interface UpdateReferralProgramResponseNonNullableFields {
1314
+ referralProgram?: ReferralProgramNonNullableFields;
1315
+ }
1316
+ interface ActivateReferralProgramResponseNonNullableFields {
1317
+ referralProgram?: ReferralProgramNonNullableFields;
1318
+ }
1319
+ interface PauseReferralProgramResponseNonNullableFields {
1320
+ referralProgram?: ReferralProgramNonNullableFields;
1321
+ }
1322
+ interface AISocialMediaPostSuggestionNonNullableFields {
1323
+ postContent: string;
1324
+ hashtags: string[];
1325
+ }
1326
+ interface GetAISocialMediaPostsSuggestionsResponseNonNullableFields {
1327
+ suggestions: AISocialMediaPostSuggestionNonNullableFields[];
1328
+ }
1329
+ interface GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields {
1330
+ suggestions: AISocialMediaPostSuggestionNonNullableFields[];
1331
+ }
1332
+ interface GetReferralProgramPremiumFeaturesResponseNonNullableFields {
1333
+ referralProgram: boolean;
1334
+ }
1335
+ interface BaseEventMetadata$3 {
462
1336
  /** App instance ID. */
463
1337
  instanceId?: string | null;
464
1338
  /** Event type. */
465
1339
  eventType?: string;
466
1340
  /** The identification type and identity data. */
467
- identity?: IdentificationData$2;
1341
+ identity?: IdentificationData$4;
468
1342
  }
469
- interface EventMetadata$2 extends BaseEventMetadata$2 {
1343
+ interface EventMetadata$3 extends BaseEventMetadata$3 {
470
1344
  /**
471
1345
  * Unique event ID.
472
1346
  * Allows clients to ignore duplicate webhooks.
@@ -485,7 +1359,7 @@ interface EventMetadata$2 extends BaseEventMetadata$2 {
485
1359
  slug?: string;
486
1360
  /** ID of the entity associated with the event. */
487
1361
  entityId?: string;
488
- /** Event timestamp. */
1362
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
489
1363
  eventTime?: Date;
490
1364
  /**
491
1365
  * Whether the event was triggered as a result of a privacy regulation application
@@ -504,130 +1378,80 @@ interface EventMetadata$2 extends BaseEventMetadata$2 {
504
1378
  */
505
1379
  entityEventSequence?: string | null;
506
1380
  }
507
- interface ReferralEventCreatedEnvelope {
508
- entity: ReferralEvent;
509
- metadata: EventMetadata$2;
1381
+ interface ProgramUpdatedEnvelope {
1382
+ entity: ReferralProgram;
1383
+ metadata: EventMetadata$3;
510
1384
  }
511
- interface QueryCursorResult$2 {
512
- cursors: Cursors$3;
1385
+ interface QueryCursorResult$3 {
1386
+ cursors: Cursors$4;
513
1387
  hasNext: () => boolean;
514
1388
  hasPrev: () => boolean;
515
1389
  length: number;
516
1390
  pageSize: number;
517
1391
  }
518
- interface ReferralEventsQueryResult extends QueryCursorResult$2 {
519
- items: ReferralEvent[];
520
- query: ReferralEventsQueryBuilder;
521
- next: () => Promise<ReferralEventsQueryResult>;
522
- prev: () => Promise<ReferralEventsQueryResult>;
1392
+ interface ReferralProgramsQueryResult extends QueryCursorResult$3 {
1393
+ items: ReferralProgram[];
1394
+ query: ReferralProgramsQueryBuilder;
1395
+ next: () => Promise<ReferralProgramsQueryResult>;
1396
+ prev: () => Promise<ReferralProgramsQueryResult>;
523
1397
  }
524
- interface ReferralEventsQueryBuilder {
525
- /** @param propertyName - Property whose value is compared with `value`.
526
- * @param value - Value to compare against.
527
- * @documentationMaturity preview
528
- */
529
- eq: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
530
- /** @param propertyName - Property whose value is compared with `value`.
531
- * @param value - Value to compare against.
532
- * @documentationMaturity preview
533
- */
534
- ne: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
535
- /** @param propertyName - Property whose value is compared with `value`.
536
- * @param value - Value to compare against.
537
- * @documentationMaturity preview
538
- */
539
- ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
540
- /** @param propertyName - Property whose value is compared with `value`.
541
- * @param value - Value to compare against.
542
- * @documentationMaturity preview
543
- */
544
- gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
545
- /** @param propertyName - Property whose value is compared with `value`.
546
- * @param value - Value to compare against.
547
- * @documentationMaturity preview
548
- */
549
- le: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
550
- /** @param propertyName - Property whose value is compared with `value`.
551
- * @param value - Value to compare against.
552
- * @documentationMaturity preview
553
- */
554
- lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
555
- /** @param propertyName - Property whose value is compared with `values`.
556
- * @param values - List of values to compare against.
557
- * @documentationMaturity preview
558
- */
559
- hasSome: (propertyName: '_createdDate' | '_updatedDate', value: any[]) => ReferralEventsQueryBuilder;
560
- /** @documentationMaturity preview */
561
- in: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
562
- /** @documentationMaturity preview */
563
- exists: (propertyName: '_createdDate' | '_updatedDate', value: boolean) => ReferralEventsQueryBuilder;
564
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
565
- * @documentationMaturity preview
566
- */
567
- ascending: (...propertyNames: Array<'_createdDate' | '_updatedDate'>) => ReferralEventsQueryBuilder;
568
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
569
- * @documentationMaturity preview
570
- */
571
- descending: (...propertyNames: Array<'_createdDate' | '_updatedDate'>) => ReferralEventsQueryBuilder;
1398
+ interface ReferralProgramsQueryBuilder {
572
1399
  /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
573
1400
  * @documentationMaturity preview
574
1401
  */
575
- limit: (limit: number) => ReferralEventsQueryBuilder;
1402
+ limit: (limit: number) => ReferralProgramsQueryBuilder;
576
1403
  /** @param cursor - A pointer to specific record
577
1404
  * @documentationMaturity preview
578
1405
  */
579
- skipTo: (cursor: string) => ReferralEventsQueryBuilder;
1406
+ skipTo: (cursor: string) => ReferralProgramsQueryBuilder;
580
1407
  /** @documentationMaturity preview */
581
- find: () => Promise<ReferralEventsQueryResult>;
1408
+ find: () => Promise<ReferralProgramsQueryResult>;
582
1409
  }
583
- interface QueryReferringCustomerTotalsOptions {
584
- /** Query to filter ReferringCustomerTotals. */
585
- query?: CursorQuery$1;
586
- /** List of contact ids to filter ReferringCustomerTotals. */
587
- contactIds?: string[];
1410
+ interface GetAiSocialMediaPostsSuggestionsOptions {
1411
+ /** The topic to generate suggestions for. */
1412
+ topic?: string;
588
1413
  }
589
- interface QueryReferredFriendActionsOptions {
590
- /** Query to filter ReferredFriendActions. */
591
- query?: CursorQuery$1;
592
- /** List of contact ids to filter ReferredFriendActions. */
593
- contactIds?: string[];
1414
+ interface GenerateAiSocialMediaPostsSuggestionsOptions {
1415
+ /** The topic to generate suggestions for. */
1416
+ topic?: string;
594
1417
  }
595
1418
 
596
- type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
597
- interface HttpClient$3 {
598
- request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
599
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1419
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
1420
+ interface HttpClient {
1421
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
1422
+ fetchWithAuth: typeof fetch;
1423
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
600
1424
  }
601
- type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
602
- type HttpResponse$3<T = any> = {
1425
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
1426
+ type HttpResponse<T = any> = {
603
1427
  data: T;
604
1428
  status: number;
605
1429
  statusText: string;
606
1430
  headers: any;
607
1431
  request?: any;
608
1432
  };
609
- type RequestOptions$3<_TResponse = any, Data = any> = {
1433
+ type RequestOptions<_TResponse = any, Data = any> = {
610
1434
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
611
1435
  url: string;
612
1436
  data?: Data;
613
1437
  params?: URLSearchParams;
614
- } & APIMetadata$3;
615
- type APIMetadata$3 = {
1438
+ } & APIMetadata;
1439
+ type APIMetadata = {
616
1440
  methodFqn?: string;
617
1441
  entityFqdn?: string;
618
1442
  packageName?: string;
619
1443
  };
620
- type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
621
- type EventDefinition$2<Payload = unknown, Type extends string = string> = {
1444
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
1445
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
622
1446
  __type: 'event-definition';
623
1447
  type: Type;
624
1448
  isDomainEvent?: boolean;
625
1449
  transformations?: (envelope: unknown) => Payload;
626
1450
  __payload: Payload;
627
1451
  };
628
- declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
629
- type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
630
- type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
1452
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
1453
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
1454
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
631
1455
 
632
1456
  declare global {
633
1457
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -636,223 +1460,277 @@ declare global {
636
1460
  }
637
1461
  }
638
1462
 
639
- declare function getReferralEvent$1(httpClient: HttpClient$3): (referralEventId: string) => Promise<ReferralEvent & {
640
- referredFriendSignupEvent?: {
641
- referredFriendId: string;
642
- } | undefined;
643
- successfulReferralEvent?: {
644
- referredFriendId: string;
645
- referringCustomerId: string;
646
- } | undefined;
647
- actionEvent?: {
648
- referredFriendId: string;
649
- referringCustomerId: string;
650
- trigger?: {
651
- appId: string;
652
- activityType: string;
653
- } | undefined;
654
- } | undefined;
655
- rewardEvent?: {
656
- rewardedReferringCustomerId: string;
657
- rewardedReferredFriendId: string;
658
- referralRewardId: string;
659
- rewardType: Reward;
660
- } | undefined;
661
- }>;
662
- declare function queryReferralEvent$1(httpClient: HttpClient$3): () => ReferralEventsQueryBuilder;
663
- declare function getReferralStatistics$1(httpClient: HttpClient$3): () => Promise<GetReferralStatisticsResponse & GetReferralStatisticsResponseNonNullableFields>;
664
- declare function queryReferringCustomerTotals$1(httpClient: HttpClient$3): (options?: QueryReferringCustomerTotalsOptions) => Promise<QueryReferringCustomerTotalsResponse & QueryReferringCustomerTotalsResponseNonNullableFields>;
665
- declare function queryReferredFriendActions$1(httpClient: HttpClient$3): (options?: QueryReferredFriendActionsOptions) => Promise<QueryReferredFriendActionsResponse & QueryReferredFriendActionsResponseNonNullableFields>;
666
- declare const onReferralEventCreated$1: EventDefinition$2<ReferralEventCreatedEnvelope, "wix.loyalty.referral.v1.referral_event_created">;
1463
+ declare function createRESTModule$4<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
667
1464
 
668
- declare const getReferralEvent: BuildRESTFunction$3<typeof getReferralEvent$1>;
669
- declare const queryReferralEvent: BuildRESTFunction$3<typeof queryReferralEvent$1>;
670
- declare const getReferralStatistics: BuildRESTFunction$3<typeof getReferralStatistics$1>;
671
- declare const queryReferringCustomerTotals: BuildRESTFunction$3<typeof queryReferringCustomerTotals$1>;
672
- declare const queryReferredFriendActions: BuildRESTFunction$3<typeof queryReferredFriendActions$1>;
673
- declare const onReferralEventCreated: BuildEventDefinition$2<typeof onReferralEventCreated$1>;
1465
+ declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
674
1466
 
675
- declare const context$3_getReferralEvent: typeof getReferralEvent;
676
- declare const context$3_getReferralStatistics: typeof getReferralStatistics;
677
- declare const context$3_onReferralEventCreated: typeof onReferralEventCreated;
678
- declare const context$3_queryReferralEvent: typeof queryReferralEvent;
679
- declare const context$3_queryReferredFriendActions: typeof queryReferredFriendActions;
680
- declare const context$3_queryReferringCustomerTotals: typeof queryReferringCustomerTotals;
681
- declare namespace context$3 {
682
- export { context$3_getReferralEvent as getReferralEvent, context$3_getReferralStatistics as getReferralStatistics, context$3_onReferralEventCreated as onReferralEventCreated, context$3_queryReferralEvent as queryReferralEvent, context$3_queryReferredFriendActions as queryReferredFriendActions, context$3_queryReferringCustomerTotals as queryReferringCustomerTotals };
1467
+ declare const getReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicGetReferralProgram>>;
1468
+ declare const queryReferralPrograms: ReturnType<typeof createRESTModule$4<typeof publicQueryReferralPrograms>>;
1469
+ declare const updateReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicUpdateReferralProgram>>;
1470
+ declare const activateReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicActivateReferralProgram>>;
1471
+ declare const pauseReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicPauseReferralProgram>>;
1472
+ declare const getAiSocialMediaPostsSuggestions: ReturnType<typeof createRESTModule$4<typeof publicGetAiSocialMediaPostsSuggestions>>;
1473
+ declare const generateAiSocialMediaPostsSuggestions: ReturnType<typeof createRESTModule$4<typeof publicGenerateAiSocialMediaPostsSuggestions>>;
1474
+ declare const getReferralProgramPremiumFeatures: ReturnType<typeof createRESTModule$4<typeof publicGetReferralProgramPremiumFeatures>>;
1475
+ declare const onProgramUpdated: ReturnType<typeof createEventModule$3<typeof publicOnProgramUpdated>>;
1476
+
1477
+ type context$4_AISocialMediaPostSuggestion = AISocialMediaPostSuggestion;
1478
+ type context$4_Action = Action;
1479
+ declare const context$4_Action: typeof Action;
1480
+ type context$4_ActivateReferralProgramRequest = ActivateReferralProgramRequest;
1481
+ type context$4_ActivateReferralProgramResponse = ActivateReferralProgramResponse;
1482
+ type context$4_ActivateReferralProgramResponseNonNullableFields = ActivateReferralProgramResponseNonNullableFields;
1483
+ type context$4_App = App;
1484
+ declare const context$4_App: typeof App;
1485
+ type context$4_Asset = Asset;
1486
+ type context$4_BillingReference = BillingReference;
1487
+ type context$4_BulkGetReferralProgramRequest = BulkGetReferralProgramRequest;
1488
+ type context$4_BulkGetReferralProgramResponse = BulkGetReferralProgramResponse;
1489
+ type context$4_CancellationDetails = CancellationDetails;
1490
+ type context$4_ContractSwitchReason = ContractSwitchReason;
1491
+ declare const context$4_ContractSwitchReason: typeof ContractSwitchReason;
1492
+ type context$4_ContractSwitchType = ContractSwitchType;
1493
+ declare const context$4_ContractSwitchType: typeof ContractSwitchType;
1494
+ type context$4_ContractSwitched = ContractSwitched;
1495
+ type context$4_Cycle = Cycle;
1496
+ type context$4_CycleCycleSelectorOneOf = CycleCycleSelectorOneOf;
1497
+ type context$4_DeleteContext = DeleteContext;
1498
+ type context$4_DeleteStatus = DeleteStatus;
1499
+ declare const context$4_DeleteStatus: typeof DeleteStatus;
1500
+ type context$4_Emails = Emails;
1501
+ type context$4_GenerateAISocialMediaPostsSuggestionsRequest = GenerateAISocialMediaPostsSuggestionsRequest;
1502
+ type context$4_GenerateAISocialMediaPostsSuggestionsResponse = GenerateAISocialMediaPostsSuggestionsResponse;
1503
+ type context$4_GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields = GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields;
1504
+ type context$4_GenerateAiSocialMediaPostsSuggestionsOptions = GenerateAiSocialMediaPostsSuggestionsOptions;
1505
+ type context$4_GetAISocialMediaPostsSuggestionsRequest = GetAISocialMediaPostsSuggestionsRequest;
1506
+ type context$4_GetAISocialMediaPostsSuggestionsResponse = GetAISocialMediaPostsSuggestionsResponse;
1507
+ type context$4_GetAISocialMediaPostsSuggestionsResponseNonNullableFields = GetAISocialMediaPostsSuggestionsResponseNonNullableFields;
1508
+ type context$4_GetAiSocialMediaPostsSuggestionsOptions = GetAiSocialMediaPostsSuggestionsOptions;
1509
+ type context$4_GetReferralProgramPremiumFeaturesRequest = GetReferralProgramPremiumFeaturesRequest;
1510
+ type context$4_GetReferralProgramPremiumFeaturesResponse = GetReferralProgramPremiumFeaturesResponse;
1511
+ type context$4_GetReferralProgramPremiumFeaturesResponseNonNullableFields = GetReferralProgramPremiumFeaturesResponseNonNullableFields;
1512
+ type context$4_GetReferralProgramRequest = GetReferralProgramRequest;
1513
+ type context$4_GetReferralProgramResponse = GetReferralProgramResponse;
1514
+ type context$4_GetReferralProgramResponseNonNullableFields = GetReferralProgramResponseNonNullableFields;
1515
+ type context$4_HtmlSitePublished = HtmlSitePublished;
1516
+ type context$4_Initiator = Initiator;
1517
+ declare const context$4_Initiator: typeof Initiator;
1518
+ type context$4_Interval = Interval;
1519
+ type context$4_IntervalUnit = IntervalUnit;
1520
+ declare const context$4_IntervalUnit: typeof IntervalUnit;
1521
+ type context$4_MetaSiteSpecialEvent = MetaSiteSpecialEvent;
1522
+ type context$4_MetaSiteSpecialEventPayloadOneOf = MetaSiteSpecialEventPayloadOneOf;
1523
+ type context$4_Namespace = Namespace;
1524
+ declare const context$4_Namespace: typeof Namespace;
1525
+ type context$4_NamespaceChanged = NamespaceChanged;
1526
+ type context$4_OneTime = OneTime;
1527
+ type context$4_Page = Page;
1528
+ type context$4_PauseReferralProgramRequest = PauseReferralProgramRequest;
1529
+ type context$4_PauseReferralProgramResponse = PauseReferralProgramResponse;
1530
+ type context$4_PauseReferralProgramResponseNonNullableFields = PauseReferralProgramResponseNonNullableFields;
1531
+ type context$4_PriceIncreaseTrigger = PriceIncreaseTrigger;
1532
+ declare const context$4_PriceIncreaseTrigger: typeof PriceIncreaseTrigger;
1533
+ type context$4_ProductAdjustment = ProductAdjustment;
1534
+ declare const context$4_ProductAdjustment: typeof ProductAdjustment;
1535
+ type context$4_ProductPriceIncreaseData = ProductPriceIncreaseData;
1536
+ type context$4_ProgramInSite = ProgramInSite;
1537
+ type context$4_ProgramStatus = ProgramStatus;
1538
+ declare const context$4_ProgramStatus: typeof ProgramStatus;
1539
+ type context$4_ProgramUpdatedEnvelope = ProgramUpdatedEnvelope;
1540
+ type context$4_ProviderName = ProviderName;
1541
+ declare const context$4_ProviderName: typeof ProviderName;
1542
+ type context$4_QueryReferralProgramsRequest = QueryReferralProgramsRequest;
1543
+ type context$4_QueryReferralProgramsResponse = QueryReferralProgramsResponse;
1544
+ type context$4_QueryReferralProgramsResponseNonNullableFields = QueryReferralProgramsResponseNonNullableFields;
1545
+ type context$4_ReactivationData = ReactivationData;
1546
+ type context$4_ReactivationReasonEnum = ReactivationReasonEnum;
1547
+ declare const context$4_ReactivationReasonEnum: typeof ReactivationReasonEnum;
1548
+ type context$4_RecurringChargeSucceeded = RecurringChargeSucceeded;
1549
+ type context$4_ReferralProgram = ReferralProgram;
1550
+ type context$4_ReferralProgramsQueryBuilder = ReferralProgramsQueryBuilder;
1551
+ type context$4_ReferralProgramsQueryResult = ReferralProgramsQueryResult;
1552
+ type context$4_RestoreInfo = RestoreInfo;
1553
+ type context$4_ServiceProvisioned = ServiceProvisioned;
1554
+ type context$4_ServiceRemoved = ServiceRemoved;
1555
+ type context$4_SiteCreated = SiteCreated;
1556
+ type context$4_SiteCreatedContext = SiteCreatedContext;
1557
+ declare const context$4_SiteCreatedContext: typeof SiteCreatedContext;
1558
+ type context$4_SiteDeleted = SiteDeleted;
1559
+ type context$4_SiteHardDeleted = SiteHardDeleted;
1560
+ type context$4_SiteMarkedAsTemplate = SiteMarkedAsTemplate;
1561
+ type context$4_SiteMarkedAsWixSite = SiteMarkedAsWixSite;
1562
+ type context$4_SitePublished = SitePublished;
1563
+ type context$4_SiteRenamed = SiteRenamed;
1564
+ type context$4_SiteTransferred = SiteTransferred;
1565
+ type context$4_SiteUndeleted = SiteUndeleted;
1566
+ type context$4_SiteUnpublished = SiteUnpublished;
1567
+ type context$4_State = State;
1568
+ declare const context$4_State: typeof State;
1569
+ type context$4_StudioAssigned = StudioAssigned;
1570
+ type context$4_StudioUnassigned = StudioUnassigned;
1571
+ type context$4_Subscription = Subscription;
1572
+ type context$4_SubscriptionAssigned = SubscriptionAssigned;
1573
+ type context$4_SubscriptionAutoRenewTurnedOff = SubscriptionAutoRenewTurnedOff;
1574
+ type context$4_SubscriptionAutoRenewTurnedOn = SubscriptionAutoRenewTurnedOn;
1575
+ type context$4_SubscriptionCancelled = SubscriptionCancelled;
1576
+ type context$4_SubscriptionCreated = SubscriptionCreated;
1577
+ type context$4_SubscriptionEvent = SubscriptionEvent;
1578
+ type context$4_SubscriptionEventEventOneOf = SubscriptionEventEventOneOf;
1579
+ type context$4_SubscriptionNearEndOfPeriod = SubscriptionNearEndOfPeriod;
1580
+ type context$4_SubscriptionPendingChange = SubscriptionPendingChange;
1581
+ type context$4_SubscriptionStatus = SubscriptionStatus;
1582
+ declare const context$4_SubscriptionStatus: typeof SubscriptionStatus;
1583
+ type context$4_SubscriptionTransferred = SubscriptionTransferred;
1584
+ type context$4_SubscriptionUnassigned = SubscriptionUnassigned;
1585
+ type context$4_UnassignReason = UnassignReason;
1586
+ declare const context$4_UnassignReason: typeof UnassignReason;
1587
+ type context$4_UpdateReferralProgramRequest = UpdateReferralProgramRequest;
1588
+ type context$4_UpdateReferralProgramResponse = UpdateReferralProgramResponse;
1589
+ type context$4_UpdateReferralProgramResponseNonNullableFields = UpdateReferralProgramResponseNonNullableFields;
1590
+ declare const context$4_activateReferralProgram: typeof activateReferralProgram;
1591
+ declare const context$4_generateAiSocialMediaPostsSuggestions: typeof generateAiSocialMediaPostsSuggestions;
1592
+ declare const context$4_getAiSocialMediaPostsSuggestions: typeof getAiSocialMediaPostsSuggestions;
1593
+ declare const context$4_getReferralProgram: typeof getReferralProgram;
1594
+ declare const context$4_getReferralProgramPremiumFeatures: typeof getReferralProgramPremiumFeatures;
1595
+ declare const context$4_onProgramUpdated: typeof onProgramUpdated;
1596
+ declare const context$4_pauseReferralProgram: typeof pauseReferralProgram;
1597
+ declare const context$4_queryReferralPrograms: typeof queryReferralPrograms;
1598
+ declare const context$4_updateReferralProgram: typeof updateReferralProgram;
1599
+ declare namespace context$4 {
1600
+ export { type context$4_AISocialMediaPostSuggestion as AISocialMediaPostSuggestion, context$4_Action as Action, type ActionEvent$4 as ActionEvent, type context$4_ActivateReferralProgramRequest as ActivateReferralProgramRequest, type context$4_ActivateReferralProgramResponse as ActivateReferralProgramResponse, type context$4_ActivateReferralProgramResponseNonNullableFields as ActivateReferralProgramResponseNonNullableFields, context$4_App as App, type context$4_Asset as Asset, type BaseEventMetadata$3 as BaseEventMetadata, type context$4_BillingReference as BillingReference, type context$4_BulkGetReferralProgramRequest as BulkGetReferralProgramRequest, type context$4_BulkGetReferralProgramResponse as BulkGetReferralProgramResponse, type context$4_CancellationDetails as CancellationDetails, context$4_ContractSwitchReason as ContractSwitchReason, context$4_ContractSwitchType as ContractSwitchType, type context$4_ContractSwitched as ContractSwitched, type Coupon$2 as Coupon, type CouponDiscountTypeOptionsOneOf$2 as CouponDiscountTypeOptionsOneOf, type CouponScope$2 as CouponScope, type CouponScopeOrMinSubtotalOneOf$2 as CouponScopeOrMinSubtotalOneOf, type CursorPaging$4 as CursorPaging, type CursorPagingMetadata$4 as CursorPagingMetadata, type CursorQuery$4 as CursorQuery, type CursorQueryPagingMethodOneOf$4 as CursorQueryPagingMethodOneOf, type Cursors$4 as Cursors, type context$4_Cycle as Cycle, type context$4_CycleCycleSelectorOneOf as CycleCycleSelectorOneOf, type context$4_DeleteContext as DeleteContext, context$4_DeleteStatus as DeleteStatus, DiscountType$2 as DiscountType, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type context$4_Emails as Emails, type Empty$3 as Empty, type EntityCreatedEvent$4 as EntityCreatedEvent, type EntityDeletedEvent$4 as EntityDeletedEvent, type EntityUpdatedEvent$4 as EntityUpdatedEvent, type EventMetadata$3 as EventMetadata, type FixedAmountDiscount$2 as FixedAmountDiscount, type context$4_GenerateAISocialMediaPostsSuggestionsRequest as GenerateAISocialMediaPostsSuggestionsRequest, type context$4_GenerateAISocialMediaPostsSuggestionsResponse as GenerateAISocialMediaPostsSuggestionsResponse, type context$4_GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields as GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields, type context$4_GenerateAiSocialMediaPostsSuggestionsOptions as GenerateAiSocialMediaPostsSuggestionsOptions, type context$4_GetAISocialMediaPostsSuggestionsRequest as GetAISocialMediaPostsSuggestionsRequest, type context$4_GetAISocialMediaPostsSuggestionsResponse as GetAISocialMediaPostsSuggestionsResponse, type context$4_GetAISocialMediaPostsSuggestionsResponseNonNullableFields as GetAISocialMediaPostsSuggestionsResponseNonNullableFields, type context$4_GetAiSocialMediaPostsSuggestionsOptions as GetAiSocialMediaPostsSuggestionsOptions, type context$4_GetReferralProgramPremiumFeaturesRequest as GetReferralProgramPremiumFeaturesRequest, type context$4_GetReferralProgramPremiumFeaturesResponse as GetReferralProgramPremiumFeaturesResponse, type context$4_GetReferralProgramPremiumFeaturesResponseNonNullableFields as GetReferralProgramPremiumFeaturesResponseNonNullableFields, type context$4_GetReferralProgramRequest as GetReferralProgramRequest, type context$4_GetReferralProgramResponse as GetReferralProgramResponse, type context$4_GetReferralProgramResponseNonNullableFields as GetReferralProgramResponseNonNullableFields, type Group$2 as Group, type context$4_HtmlSitePublished as HtmlSitePublished, type IdentificationData$4 as IdentificationData, type IdentificationDataIdOneOf$4 as IdentificationDataIdOneOf, context$4_Initiator as Initiator, type context$4_Interval as Interval, context$4_IntervalUnit as IntervalUnit, type LoyaltyPoints$2 as LoyaltyPoints, type MessageEnvelope$4 as MessageEnvelope, type context$4_MetaSiteSpecialEvent as MetaSiteSpecialEvent, type context$4_MetaSiteSpecialEventPayloadOneOf as MetaSiteSpecialEventPayloadOneOf, context$4_Namespace as Namespace, type context$4_NamespaceChanged as NamespaceChanged, type context$4_OneTime as OneTime, type context$4_Page as Page, type context$4_PauseReferralProgramRequest as PauseReferralProgramRequest, type context$4_PauseReferralProgramResponse as PauseReferralProgramResponse, type context$4_PauseReferralProgramResponseNonNullableFields as PauseReferralProgramResponseNonNullableFields, type PercentageDiscount$2 as PercentageDiscount, context$4_PriceIncreaseTrigger as PriceIncreaseTrigger, context$4_ProductAdjustment as ProductAdjustment, type context$4_ProductPriceIncreaseData as ProductPriceIncreaseData, type context$4_ProgramInSite as ProgramInSite, context$4_ProgramStatus as ProgramStatus, type context$4_ProgramUpdatedEnvelope as ProgramUpdatedEnvelope, context$4_ProviderName as ProviderName, type context$4_QueryReferralProgramsRequest as QueryReferralProgramsRequest, type context$4_QueryReferralProgramsResponse as QueryReferralProgramsResponse, type context$4_QueryReferralProgramsResponseNonNullableFields as QueryReferralProgramsResponseNonNullableFields, type context$4_ReactivationData as ReactivationData, context$4_ReactivationReasonEnum as ReactivationReasonEnum, type context$4_RecurringChargeSucceeded as RecurringChargeSucceeded, type context$4_ReferralProgram as ReferralProgram, type context$4_ReferralProgramsQueryBuilder as ReferralProgramsQueryBuilder, type context$4_ReferralProgramsQueryResult as ReferralProgramsQueryResult, type context$4_RestoreInfo as RestoreInfo, type Reward$2 as Reward, type RewardOptionsOneOf$1 as RewardOptionsOneOf, type context$4_ServiceProvisioned as ServiceProvisioned, type context$4_ServiceRemoved as ServiceRemoved, type context$4_SiteCreated as SiteCreated, context$4_SiteCreatedContext as SiteCreatedContext, type context$4_SiteDeleted as SiteDeleted, type context$4_SiteHardDeleted as SiteHardDeleted, type context$4_SiteMarkedAsTemplate as SiteMarkedAsTemplate, type context$4_SiteMarkedAsWixSite as SiteMarkedAsWixSite, type context$4_SitePublished as SitePublished, type context$4_SiteRenamed as SiteRenamed, type context$4_SiteTransferred as SiteTransferred, type context$4_SiteUndeleted as SiteUndeleted, type context$4_SiteUnpublished as SiteUnpublished, SortOrder$4 as SortOrder, type Sorting$4 as Sorting, context$4_State as State, type context$4_StudioAssigned as StudioAssigned, type context$4_StudioUnassigned as StudioUnassigned, type context$4_Subscription as Subscription, type context$4_SubscriptionAssigned as SubscriptionAssigned, type context$4_SubscriptionAutoRenewTurnedOff as SubscriptionAutoRenewTurnedOff, type context$4_SubscriptionAutoRenewTurnedOn as SubscriptionAutoRenewTurnedOn, type context$4_SubscriptionCancelled as SubscriptionCancelled, type context$4_SubscriptionCreated as SubscriptionCreated, type context$4_SubscriptionEvent as SubscriptionEvent, type context$4_SubscriptionEventEventOneOf as SubscriptionEventEventOneOf, type context$4_SubscriptionNearEndOfPeriod as SubscriptionNearEndOfPeriod, type context$4_SubscriptionPendingChange as SubscriptionPendingChange, context$4_SubscriptionStatus as SubscriptionStatus, type context$4_SubscriptionTransferred as SubscriptionTransferred, type context$4_SubscriptionUnassigned as SubscriptionUnassigned, Type$1 as Type, context$4_UnassignReason as UnassignReason, type context$4_UpdateReferralProgramRequest as UpdateReferralProgramRequest, type context$4_UpdateReferralProgramResponse as UpdateReferralProgramResponse, type context$4_UpdateReferralProgramResponseNonNullableFields as UpdateReferralProgramResponseNonNullableFields, WebhookIdentityType$4 as WebhookIdentityType, context$4_activateReferralProgram as activateReferralProgram, context$4_generateAiSocialMediaPostsSuggestions as generateAiSocialMediaPostsSuggestions, context$4_getAiSocialMediaPostsSuggestions as getAiSocialMediaPostsSuggestions, context$4_getReferralProgram as getReferralProgram, context$4_getReferralProgramPremiumFeatures as getReferralProgramPremiumFeatures, context$4_onProgramUpdated as onProgramUpdated, context$4_pauseReferralProgram as pauseReferralProgram, context$4_queryReferralPrograms as queryReferralPrograms, context$4_updateReferralProgram as updateReferralProgram };
683
1601
  }
684
1602
 
685
- /** ReferralReward is the main entity of ReferralRewards that can be used for lorem ipsum dolor */
686
- interface ReferralReward extends ReferralRewardReceiverOneOf, ReferralRewardRewardTypeOptionsOneOf {
687
- /**
688
- * Referring customer ID.
689
- * @readonly
690
- */
691
- rewardedReferringCustomerId?: string;
692
- /**
693
- * Referred friend ID.
694
- * @readonly
695
- */
696
- rewardedReferredFriendId?: string;
697
- /** Coupon reward type options. */
698
- coupon?: V1Coupon;
699
- /** Loyalty points reward type options. */
700
- loyaltyPoints?: V1LoyaltyPoints;
1603
+ /** ReferralEvent. */
1604
+ interface ReferralEvent extends ReferralEventEventTypeOneOf {
1605
+ /** ReferredFriendSignupEvent is an event that is triggered when a referred friend signs up. */
1606
+ referredFriendSignupEvent?: ReferredFriendSignupEvent;
1607
+ /** SuccessfulReferralEvent is an event that is triggered when a referral is successful. */
1608
+ successfulReferralEvent?: V1SuccessfulReferralEvent;
1609
+ /** ActionEvent is an event that is triggered when an action is performed. */
1610
+ actionEvent?: V1ActionEvent;
1611
+ /** RewardEvent is an event that is triggered when a reward is given. */
1612
+ rewardEvent?: RewardEvent;
701
1613
  /**
702
- * ReferralReward ID.
1614
+ * ReferralEvent ID.
703
1615
  * @readonly
704
1616
  */
705
1617
  _id?: string | null;
706
1618
  /** Represents the current state of an item. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision. */
707
1619
  revision?: string | null;
708
1620
  /**
709
- * Represents the time this ReferralReward was created.
1621
+ * Represents the time this ReferralEvent was created.
710
1622
  * @readonly
711
1623
  */
712
1624
  _createdDate?: Date;
713
1625
  /**
714
- * Represents the time this ReferralReward was last updated.
1626
+ * Represents the time this ReferralEvent was last updated.
715
1627
  * @readonly
716
1628
  */
717
1629
  _updatedDate?: Date;
718
- /** Reward type. */
719
- rewardType?: RewardTypeType;
720
1630
  }
721
1631
  /** @oneof */
722
- interface ReferralRewardReceiverOneOf {
1632
+ interface ReferralEventEventTypeOneOf {
1633
+ /** ReferredFriendSignupEvent is an event that is triggered when a referred friend signs up. */
1634
+ referredFriendSignupEvent?: ReferredFriendSignupEvent;
1635
+ /** SuccessfulReferralEvent is an event that is triggered when a referral is successful. */
1636
+ successfulReferralEvent?: V1SuccessfulReferralEvent;
1637
+ /** ActionEvent is an event that is triggered when an action is performed. */
1638
+ actionEvent?: V1ActionEvent;
1639
+ /** RewardEvent is an event that is triggered when a reward is given. */
1640
+ rewardEvent?: RewardEvent;
1641
+ }
1642
+ interface ReferredFriendSignupEvent {
1643
+ /** The referred friend ID. */
1644
+ referredFriendId?: string;
1645
+ }
1646
+ interface V1SuccessfulReferralEvent {
1647
+ /** The referred friend ID. */
1648
+ referredFriendId?: string;
1649
+ /** The referring customer ID. */
1650
+ referringCustomerId?: string;
1651
+ }
1652
+ interface V1ActionEvent {
1653
+ /** The referred friend ID. */
1654
+ referredFriendId?: string;
1655
+ /** The referring customer ID. */
1656
+ referringCustomerId?: string;
1657
+ /** The trigger of the action. */
1658
+ trigger?: V1Trigger;
1659
+ /** Amount. */
1660
+ amount?: string | null;
1661
+ /** Currency. */
1662
+ currency?: string | null;
1663
+ /** Order ID. */
1664
+ orderId?: string | null;
1665
+ }
1666
+ interface V1Trigger {
1667
+ /** The app id of the app that triggered the event. */
1668
+ appId?: string;
1669
+ /** The activity type that triggered the event. */
1670
+ activityType?: string;
1671
+ }
1672
+ interface RewardEvent extends RewardEventReceiverOneOf {
723
1673
  /**
724
- * Referring customer ID.
1674
+ * The referring customer ID.
725
1675
  * @readonly
726
1676
  */
727
1677
  rewardedReferringCustomerId?: string;
728
1678
  /**
729
- * Referred friend ID.
1679
+ * The referred friend ID.
730
1680
  * @readonly
731
1681
  */
732
1682
  rewardedReferredFriendId?: string;
1683
+ /** The referral reward ID. */
1684
+ referralRewardId?: string;
1685
+ /** The reward type. */
1686
+ rewardType?: Reward$1;
733
1687
  }
734
1688
  /** @oneof */
735
- interface ReferralRewardRewardTypeOptionsOneOf {
736
- /** Coupon reward type options. */
737
- coupon?: V1Coupon;
738
- /** Loyalty points reward type options. */
739
- loyaltyPoints?: V1LoyaltyPoints;
740
- }
741
- declare enum RewardTypeType {
742
- /** Unknown reward type. */
743
- UNKNOWN = "UNKNOWN",
744
- /** Coupon reward type. */
745
- COUPON = "COUPON",
746
- /** Loyalty points reward type. */
747
- LOYALTY_POINTS = "LOYALTY_POINTS",
748
- /** No reward. */
749
- NOTHING = "NOTHING"
750
- }
751
- interface V1Coupon {
752
- /**
753
- * Coupon ID.
754
- * @readonly
755
- */
756
- _id?: string;
757
- /**
758
- * Coupon code.
759
- * @readonly
760
- */
761
- code?: string;
1689
+ interface RewardEventReceiverOneOf {
762
1690
  /**
763
- * Coupon status.
1691
+ * The referring customer ID.
764
1692
  * @readonly
765
1693
  */
766
- status?: Status$1;
1694
+ rewardedReferringCustomerId?: string;
767
1695
  /**
768
- * Coupon specification.
1696
+ * The referred friend ID.
769
1697
  * @readonly
770
1698
  */
771
- couponSpecification?: Coupon;
772
- }
773
- declare enum Status$1 {
774
- /** Unknown coupon status. */
775
- UNKNOWN = "UNKNOWN",
776
- /** Coupon is active and can be applied. */
777
- ACTIVE = "ACTIVE",
778
- /** Coupon was already applied and can not be used anymore. */
779
- APPLIED = "APPLIED",
780
- /** Coupon was deleted. */
781
- DELETED = "DELETED"
782
- }
783
- interface Coupon extends CouponDiscountTypeOptionsOneOf, CouponScopeOrMinSubtotalOneOf {
784
- /** Options for fixed amount discount type */
785
- fixedAmountOptions?: FixedAmountDiscount;
786
- /** Options for percentage discount type */
787
- percentageOptions?: PercentageDiscount;
788
- /** Limit the coupon to carts with a subtotal above this number. */
789
- minimumSubtotal?: number;
790
- /** Specifies the type of line items this coupon will apply to. */
791
- scope?: CouponScope;
792
- /** Coupon name */
793
- name?: string;
794
- /** Coupon discount type */
795
- discountType?: DiscountType;
796
- /** Limit the coupon to only apply to one item in cart. */
797
- limitedToOneItem?: boolean | null;
798
- /** If true, coupon also applies to subscriptions. */
799
- appliesToSubscriptions?: boolean | null;
800
- /** Specifies the amount of discounted cycles for subscription item. See Stores Coupons documentation for more info. */
801
- discountedCycleCount?: number | null;
802
- }
803
- /** @oneof */
804
- interface CouponDiscountTypeOptionsOneOf {
805
- /** Options for fixed amount discount type */
806
- fixedAmountOptions?: FixedAmountDiscount;
807
- /** Options for percentage discount type */
808
- percentageOptions?: PercentageDiscount;
809
- }
810
- /** @oneof */
811
- interface CouponScopeOrMinSubtotalOneOf {
812
- /** Limit the coupon to carts with a subtotal above this number. */
813
- minimumSubtotal?: number;
814
- /** Specifies the type of line items this coupon will apply to. */
815
- scope?: CouponScope;
1699
+ rewardedReferredFriendId?: string;
816
1700
  }
817
- declare enum DiscountType {
1701
+ declare enum Reward$1 {
1702
+ /** Unknown reward type. */
818
1703
  UNKNOWN = "UNKNOWN",
819
- /** Discount as a fixed amount */
820
- FIXED_AMOUNT = "FIXED_AMOUNT",
821
- /** Discount as a percentage */
822
- PERCENTAGE = "PERCENTAGE",
823
- /** Free shipping */
824
- FREE_SHIPPING = "FREE_SHIPPING"
1704
+ /** Reward is a coupon. */
1705
+ COUPON = "COUPON",
1706
+ /** Reward is loyalty points. */
1707
+ LOYALTY_POINTS = "LOYALTY_POINTS",
1708
+ /** No reward. */
1709
+ NOTHING = "NOTHING"
825
1710
  }
826
- interface FixedAmountDiscount {
827
- /** Fixed amount to discount */
828
- amount?: number;
1711
+ interface CreateReferralEventRequest {
1712
+ /** ReferralEvent to be created */
1713
+ referralEvent?: ReferralEvent;
829
1714
  }
830
- interface PercentageDiscount {
831
- percentage?: number;
1715
+ interface CreateReferralEventResponse {
1716
+ /** The created ReferralEvent */
1717
+ referralEvent?: ReferralEvent;
832
1718
  }
833
- interface CouponScope {
834
- namespace?: string;
835
- group?: Group;
1719
+ interface GetReferralEventRequest {
1720
+ /** Id of the ReferralEvent to retrieve */
1721
+ referralEventId: string;
836
1722
  }
837
- interface Group {
838
- name?: string;
839
- entityId?: string | null;
1723
+ interface GetReferralEventResponse {
1724
+ /** The retrieved ReferralEvent */
1725
+ referralEvent?: ReferralEvent;
840
1726
  }
841
- interface V1LoyaltyPoints {
842
- /**
843
- * Loyalty transaction ID.
844
- * @readonly
845
- */
846
- transactionId?: string;
847
- /**
848
- * Loyalty points amount given.
849
- * @readonly
850
- */
851
- amount?: number;
1727
+ interface QueryReferralEventRequest {
1728
+ /** Query to filter ReferralEvents. */
1729
+ query: CursorQuery$3;
852
1730
  }
853
- interface CursorQuery extends CursorQueryPagingMethodOneOf {
1731
+ interface CursorQuery$3 extends CursorQueryPagingMethodOneOf$3 {
854
1732
  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
855
- cursorPaging?: CursorPaging;
1733
+ cursorPaging?: CursorPaging$3;
856
1734
  /**
857
1735
  * Filter object in the following format:
858
1736
  * `"filter" : {
@@ -866,24 +1744,24 @@ interface CursorQuery extends CursorQueryPagingMethodOneOf {
866
1744
  * Sort object in the following format:
867
1745
  * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
868
1746
  */
869
- sort?: Sorting[];
1747
+ sort?: Sorting$3[];
870
1748
  }
871
1749
  /** @oneof */
872
- interface CursorQueryPagingMethodOneOf {
1750
+ interface CursorQueryPagingMethodOneOf$3 {
873
1751
  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
874
- cursorPaging?: CursorPaging;
1752
+ cursorPaging?: CursorPaging$3;
875
1753
  }
876
- interface Sorting {
1754
+ interface Sorting$3 {
877
1755
  /** Name of the field to sort by. */
878
1756
  fieldName?: string;
879
1757
  /** Sort order. */
880
- order?: SortOrder;
1758
+ order?: SortOrder$3;
881
1759
  }
882
- declare enum SortOrder {
1760
+ declare enum SortOrder$3 {
883
1761
  ASC = "ASC",
884
1762
  DESC = "DESC"
885
1763
  }
886
- interface CursorPaging {
1764
+ interface CursorPaging$3 {
887
1765
  /** Maximum number of items to return in the results. */
888
1766
  limit?: number | null;
889
1767
  /**
@@ -894,17 +1772,17 @@ interface CursorPaging {
894
1772
  */
895
1773
  cursor?: string | null;
896
1774
  }
897
- interface QueryReferralRewardsResponse {
898
- /** The retrieved ReferralRewards. */
899
- referralRewards?: ReferralReward[];
900
- /** Metadata for paging. */
901
- metadata?: CursorPagingMetadata;
1775
+ interface QueryReferralEventResponse {
1776
+ /** List of ReferralEvents that match the query. */
1777
+ referralEvents?: ReferralEvent[];
1778
+ /** Paging metadata. */
1779
+ metadata?: CursorPagingMetadata$3;
902
1780
  }
903
- interface CursorPagingMetadata {
1781
+ interface CursorPagingMetadata$3 {
904
1782
  /** Number of items returned in the response. */
905
1783
  count?: number | null;
906
1784
  /** Cursor strings that point to the next page, previous page, or both. */
907
- cursors?: Cursors$2;
1785
+ cursors?: Cursors$3;
908
1786
  /**
909
1787
  * Whether there are more pages to retrieve following the current page.
910
1788
  *
@@ -913,123 +1791,1196 @@ interface CursorPagingMetadata {
913
1791
  */
914
1792
  hasNext?: boolean | null;
915
1793
  }
916
- interface Cursors$2 {
1794
+ interface Cursors$3 {
917
1795
  /** Cursor string pointing to the next page in the list of results. */
918
1796
  next?: string | null;
919
1797
  /** Cursor pointing to the previous page in the list of results. */
920
1798
  prev?: string | null;
921
1799
  }
922
- interface QueryReferralRewardsResponseNonNullableFields {
923
- referralRewards: {
924
- rewardedReferringCustomerId: string;
925
- rewardedReferredFriendId: string;
926
- coupon?: {
927
- _id: string;
928
- code: string;
929
- status: Status$1;
930
- couponSpecification?: {
931
- fixedAmountOptions?: {
932
- amount: number;
933
- };
934
- percentageOptions?: {
935
- percentage: number;
936
- };
937
- minimumSubtotal: number;
938
- scope?: {
939
- namespace: string;
940
- group?: {
941
- name: string;
942
- };
943
- };
944
- name: string;
945
- discountType: DiscountType;
946
- };
947
- };
948
- loyaltyPoints?: {
949
- transactionId: string;
950
- amount: number;
951
- };
952
- rewardType: RewardTypeType;
953
- }[];
1800
+ interface GetReferralStatisticsRequest {
954
1801
  }
955
- interface QueryReferralRewardsOptions {
956
- /** Filter by contact id or set to "me" for current identity's rewards. */
957
- contactId?: string | null;
1802
+ interface GetReferralStatisticsResponse {
1803
+ /** Total sign ups completed by referred friends */
1804
+ totalSignUpsCompleted?: number;
1805
+ /** Total actions completed by referred friends */
1806
+ totalActionsCompleted?: number;
1807
+ /** Total amount of purchases made by referred friends */
1808
+ totalAmountGenerated?: string;
958
1809
  }
959
-
960
- type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
961
- interface HttpClient$2 {
962
- request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
963
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1810
+ interface QueryReferringCustomerTotalsRequest {
1811
+ /** Query to filter ReferringCustomerTotals. */
1812
+ query?: CursorQuery$3;
1813
+ /** List of contact ids to filter ReferringCustomerTotals. */
1814
+ contactIds?: string[];
964
1815
  }
965
- type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
966
- type HttpResponse$2<T = any> = {
967
- data: T;
968
- status: number;
969
- statusText: string;
970
- headers: any;
971
- request?: any;
972
- };
973
- type RequestOptions$2<_TResponse = any, Data = any> = {
974
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
975
- url: string;
976
- data?: Data;
977
- params?: URLSearchParams;
978
- } & APIMetadata$2;
979
- type APIMetadata$2 = {
980
- methodFqn?: string;
1816
+ interface QueryReferringCustomerTotalsResponse {
1817
+ /** List of ReferringCustomerTotals that match the query. */
1818
+ referringCustomerTotals?: ReferringCustomerTotal[];
1819
+ /** Paging metadata. */
1820
+ metadata?: CursorPagingMetadata$3;
1821
+ }
1822
+ interface ReferringCustomerTotal {
1823
+ /**
1824
+ * Referring customer id.
1825
+ * @readonly
1826
+ */
1827
+ referringCustomerId?: string;
1828
+ /**
1829
+ * Contact id.
1830
+ * @readonly
1831
+ */
1832
+ contactId?: string;
1833
+ /**
1834
+ * Last successful referral date.
1835
+ * @readonly
1836
+ */
1837
+ lastSuccessfulReferral?: Date;
1838
+ /**
1839
+ * Total successful referrals made by this customer.
1840
+ * @readonly
1841
+ */
1842
+ totalSuccessfulReferrals?: number;
1843
+ /**
1844
+ * Total amount generated by friends referred by this customer.
1845
+ * @readonly
1846
+ */
1847
+ totalAmountGenerated?: string;
1848
+ /**
1849
+ * Last friend action date.
1850
+ * @readonly
1851
+ */
1852
+ lastFriendAction?: Date;
1853
+ /**
1854
+ * Total friends that have actions done.
1855
+ * @readonly
1856
+ */
1857
+ totalFriendsWithActions?: number;
1858
+ }
1859
+ interface QueryReferredFriendActionsRequest {
1860
+ /** Query to filter ReferredFriendActions. */
1861
+ query?: CursorQuery$3;
1862
+ /** List of contact ids to filter ReferredFriendActions. */
1863
+ contactIds?: string[];
1864
+ }
1865
+ interface QueryReferredFriendActionsResponse {
1866
+ /** List of ReferredFriendActions that match the query. */
1867
+ referredFriendActions?: ReferredFriendAction[];
1868
+ /** Paging metadata. */
1869
+ metadata?: CursorPagingMetadata$3;
1870
+ }
1871
+ interface ReferredFriendAction extends ReferredFriendActionRewardTypeOptionsOneOf {
1872
+ /** Coupon reward type options. */
1873
+ coupon?: V1Coupon$1;
1874
+ /** Loyalty points reward type options. */
1875
+ loyaltyPoints?: LoyaltyPoints$1;
1876
+ /**
1877
+ * Referred friend id.
1878
+ * @readonly
1879
+ */
1880
+ referredFriendId?: string;
1881
+ /**
1882
+ * Contact id.
1883
+ * @readonly
1884
+ */
1885
+ contactId?: string;
1886
+ /**
1887
+ * First action trigger.
1888
+ * @readonly
1889
+ */
1890
+ trigger?: V1Trigger;
1891
+ /**
1892
+ * First action date.
1893
+ * @readonly
1894
+ */
1895
+ actionDate?: Date;
1896
+ /** Issued reward type. */
1897
+ rewardType?: Reward$1;
1898
+ /** Total number of actions. */
1899
+ totalActions?: number;
1900
+ /**
1901
+ * Total amount spent by this referred friend.
1902
+ * @readonly
1903
+ */
1904
+ totalAmountSpent?: string;
1905
+ /**
1906
+ * friend signup date.
1907
+ * @readonly
1908
+ */
1909
+ signupDate?: Date;
1910
+ }
1911
+ /** @oneof */
1912
+ interface ReferredFriendActionRewardTypeOptionsOneOf {
1913
+ /** Coupon reward type options. */
1914
+ coupon?: V1Coupon$1;
1915
+ /** Loyalty points reward type options. */
1916
+ loyaltyPoints?: LoyaltyPoints$1;
1917
+ }
1918
+ interface V1Coupon$1 {
1919
+ /**
1920
+ * Coupon ID.
1921
+ * @readonly
1922
+ */
1923
+ _id?: string;
1924
+ /**
1925
+ * Coupon code.
1926
+ * @readonly
1927
+ */
1928
+ code?: string;
1929
+ /**
1930
+ * Coupon status.
1931
+ * @readonly
1932
+ */
1933
+ status?: Status$2;
1934
+ /**
1935
+ * Coupon specification.
1936
+ * @readonly
1937
+ */
1938
+ couponSpecification?: Coupon$1;
1939
+ }
1940
+ declare enum Status$2 {
1941
+ /** Unknown coupon status. */
1942
+ UNKNOWN = "UNKNOWN",
1943
+ /** Coupon is active and can be applied. */
1944
+ ACTIVE = "ACTIVE",
1945
+ /** Coupon was already applied and can not be used anymore. */
1946
+ APPLIED = "APPLIED",
1947
+ /** Coupon was deleted. */
1948
+ DELETED = "DELETED"
1949
+ }
1950
+ interface Coupon$1 extends CouponDiscountTypeOptionsOneOf$1, CouponScopeOrMinSubtotalOneOf$1 {
1951
+ /** Options for fixed amount discount type. */
1952
+ fixedAmountOptions?: FixedAmountDiscount$1;
1953
+ /** Options for percentage discount type. */
1954
+ percentageOptions?: PercentageDiscount$1;
1955
+ /** Limit the coupon to carts with a subtotal above this number. */
1956
+ minimumSubtotal?: number;
1957
+ /** Specifies the type of line items this coupon will apply to. */
1958
+ scope?: CouponScope$1;
1959
+ /** Coupon name. */
1960
+ name?: string;
1961
+ /** Coupon discount type. */
1962
+ discountType?: DiscountType$1;
1963
+ /** Limit the coupon to only apply to one item in cart. */
1964
+ limitedToOneItem?: boolean | null;
1965
+ /** If true, coupon also applies to subscriptions. */
1966
+ appliesToSubscriptions?: boolean | null;
1967
+ /** Specifies the amount of discounted cycles for subscription item. See Stores Coupons documentation for more info. */
1968
+ discountedCycleCount?: number | null;
1969
+ }
1970
+ /** @oneof */
1971
+ interface CouponDiscountTypeOptionsOneOf$1 {
1972
+ /** Options for fixed amount discount type. */
1973
+ fixedAmountOptions?: FixedAmountDiscount$1;
1974
+ /** Options for percentage discount type. */
1975
+ percentageOptions?: PercentageDiscount$1;
1976
+ }
1977
+ /** @oneof */
1978
+ interface CouponScopeOrMinSubtotalOneOf$1 {
1979
+ /** Limit the coupon to carts with a subtotal above this number. */
1980
+ minimumSubtotal?: number;
1981
+ /** Specifies the type of line items this coupon will apply to. */
1982
+ scope?: CouponScope$1;
1983
+ }
1984
+ declare enum DiscountType$1 {
1985
+ /** Unknown discount type. */
1986
+ UNKNOWN = "UNKNOWN",
1987
+ /** Discount as a fixed amount. */
1988
+ FIXED_AMOUNT = "FIXED_AMOUNT",
1989
+ /** Discount as a percentage. */
1990
+ PERCENTAGE = "PERCENTAGE",
1991
+ /** Free shipping. */
1992
+ FREE_SHIPPING = "FREE_SHIPPING"
1993
+ }
1994
+ interface FixedAmountDiscount$1 {
1995
+ /** Fixed amount to discount. */
1996
+ amount?: number;
1997
+ }
1998
+ interface PercentageDiscount$1 {
1999
+ /** Percentage to discount. */
2000
+ percentage?: number;
2001
+ }
2002
+ interface CouponScope$1 {
2003
+ /** Namespace of the coupon scope. */
2004
+ namespace?: string;
2005
+ /** Group of the coupon scope. */
2006
+ group?: Group$1;
2007
+ }
2008
+ interface Group$1 {
2009
+ /** Name of the group. */
2010
+ name?: string;
2011
+ /** Entity ID of the group. */
2012
+ entityId?: string | null;
2013
+ }
2014
+ interface LoyaltyPoints$1 {
2015
+ /**
2016
+ * Loyalty transaction ID.
2017
+ * @readonly
2018
+ */
2019
+ transactionId?: string;
2020
+ /**
2021
+ * Loyalty points amount given.
2022
+ * @readonly
2023
+ */
2024
+ amount?: number;
2025
+ }
2026
+ interface DomainEvent$3 extends DomainEventBodyOneOf$3 {
2027
+ createdEvent?: EntityCreatedEvent$3;
2028
+ updatedEvent?: EntityUpdatedEvent$3;
2029
+ deletedEvent?: EntityDeletedEvent$3;
2030
+ actionEvent?: ActionEvent$3;
2031
+ /**
2032
+ * Unique event ID.
2033
+ * Allows clients to ignore duplicate webhooks.
2034
+ */
2035
+ _id?: string;
2036
+ /**
2037
+ * Assumes actions are also always typed to an entity_type
2038
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2039
+ */
2040
+ entityFqdn?: string;
2041
+ /**
2042
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2043
+ * This is although the created/updated/deleted notion is duplication of the oneof types
2044
+ * Example: created/updated/deleted/started/completed/email_opened
2045
+ */
2046
+ slug?: string;
2047
+ /** ID of the entity associated with the event. */
2048
+ entityId?: string;
2049
+ /** Event timestamp. */
2050
+ eventTime?: Date;
2051
+ /**
2052
+ * Whether the event was triggered as a result of a privacy regulation application
2053
+ * (for example, GDPR).
2054
+ */
2055
+ triggeredByAnonymizeRequest?: boolean | null;
2056
+ /** If present, indicates the action that triggered the event. */
2057
+ originatedFrom?: string | null;
2058
+ /**
2059
+ * A sequence number defining the order of updates to the underlying entity.
2060
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
2061
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2062
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2063
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
2064
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2065
+ */
2066
+ entityEventSequence?: string | null;
2067
+ }
2068
+ /** @oneof */
2069
+ interface DomainEventBodyOneOf$3 {
2070
+ createdEvent?: EntityCreatedEvent$3;
2071
+ updatedEvent?: EntityUpdatedEvent$3;
2072
+ deletedEvent?: EntityDeletedEvent$3;
2073
+ actionEvent?: ActionEvent$3;
2074
+ }
2075
+ interface EntityCreatedEvent$3 {
2076
+ entity?: string;
2077
+ }
2078
+ interface UndeleteInfo$3 {
2079
+ deletedDate?: Date;
2080
+ }
2081
+ interface EntityUpdatedEvent$3 {
2082
+ /**
2083
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
2084
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
2085
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
2086
+ */
2087
+ currentEntity?: string;
2088
+ }
2089
+ interface EntityDeletedEvent$3 {
2090
+ /** Entity that was deleted */
2091
+ deletedEntity?: string | null;
2092
+ }
2093
+ interface ActionEvent$3 {
2094
+ body?: string;
2095
+ }
2096
+ interface Empty$2 {
2097
+ }
2098
+ interface SuccessfulReferralEvent$2 {
2099
+ /** ReferredFriend that completed his referral details. */
2100
+ referredFriendDetails?: ReferredFriendDetails$2;
2101
+ }
2102
+ interface ReferredFriendDetails$2 {
2103
+ /**
2104
+ * ReferredFriend ID.
2105
+ * @readonly
2106
+ */
2107
+ referredFriendId?: string;
2108
+ /**
2109
+ * ReferredFriend Contact ID.
2110
+ * @readonly
2111
+ */
2112
+ contactId?: string;
2113
+ /**
2114
+ * Customer who referred this ReferredFriend.
2115
+ * @readonly
2116
+ */
2117
+ referringCustomerId?: string;
2118
+ }
2119
+ interface ReferredFriendActionEvent {
2120
+ /** ReferredFriend details. */
2121
+ referredFriendDetails?: ReferredFriendDetails$2;
2122
+ /** Trigger details. */
2123
+ trigger?: Trigger;
2124
+ /** Amount. */
2125
+ amount?: string | null;
2126
+ /** Currency. */
2127
+ currency?: string | null;
2128
+ /** Order ID. */
2129
+ orderId?: string | null;
2130
+ }
2131
+ interface Trigger {
2132
+ /** App ID. */
2133
+ appId?: string;
2134
+ /** Activity type. */
2135
+ activityType?: string;
2136
+ }
2137
+ interface MessageEnvelope$3 {
2138
+ /** App instance ID. */
2139
+ instanceId?: string | null;
2140
+ /** Event type. */
2141
+ eventType?: string;
2142
+ /** The identification type and identity data. */
2143
+ identity?: IdentificationData$3;
2144
+ /** Stringify payload. */
2145
+ data?: string;
2146
+ }
2147
+ interface IdentificationData$3 extends IdentificationDataIdOneOf$3 {
2148
+ /** ID of a site visitor that has not logged in to the site. */
2149
+ anonymousVisitorId?: string;
2150
+ /** ID of a site visitor that has logged in to the site. */
2151
+ memberId?: string;
2152
+ /** ID of a Wix user (site owner, contributor, etc.). */
2153
+ wixUserId?: string;
2154
+ /** ID of an app. */
2155
+ appId?: string;
2156
+ /** @readonly */
2157
+ identityType?: WebhookIdentityType$3;
2158
+ }
2159
+ /** @oneof */
2160
+ interface IdentificationDataIdOneOf$3 {
2161
+ /** ID of a site visitor that has not logged in to the site. */
2162
+ anonymousVisitorId?: string;
2163
+ /** ID of a site visitor that has logged in to the site. */
2164
+ memberId?: string;
2165
+ /** ID of a Wix user (site owner, contributor, etc.). */
2166
+ wixUserId?: string;
2167
+ /** ID of an app. */
2168
+ appId?: string;
2169
+ }
2170
+ declare enum WebhookIdentityType$3 {
2171
+ UNKNOWN = "UNKNOWN",
2172
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
2173
+ MEMBER = "MEMBER",
2174
+ WIX_USER = "WIX_USER",
2175
+ APP = "APP"
2176
+ }
2177
+ interface ReferredFriendSignupEventNonNullableFields {
2178
+ referredFriendId: string;
2179
+ }
2180
+ interface V1SuccessfulReferralEventNonNullableFields {
2181
+ referredFriendId: string;
2182
+ referringCustomerId: string;
2183
+ }
2184
+ interface V1TriggerNonNullableFields {
2185
+ appId: string;
2186
+ activityType: string;
2187
+ }
2188
+ interface V1ActionEventNonNullableFields {
2189
+ referredFriendId: string;
2190
+ referringCustomerId: string;
2191
+ trigger?: V1TriggerNonNullableFields;
2192
+ }
2193
+ interface RewardEventNonNullableFields {
2194
+ rewardedReferringCustomerId: string;
2195
+ rewardedReferredFriendId: string;
2196
+ referralRewardId: string;
2197
+ rewardType: Reward$1;
2198
+ }
2199
+ interface ReferralEventNonNullableFields {
2200
+ referredFriendSignupEvent?: ReferredFriendSignupEventNonNullableFields;
2201
+ successfulReferralEvent?: V1SuccessfulReferralEventNonNullableFields;
2202
+ actionEvent?: V1ActionEventNonNullableFields;
2203
+ rewardEvent?: RewardEventNonNullableFields;
2204
+ }
2205
+ interface GetReferralEventResponseNonNullableFields {
2206
+ referralEvent?: ReferralEventNonNullableFields;
2207
+ }
2208
+ interface QueryReferralEventResponseNonNullableFields {
2209
+ referralEvents: ReferralEventNonNullableFields[];
2210
+ }
2211
+ interface GetReferralStatisticsResponseNonNullableFields {
2212
+ totalSignUpsCompleted: number;
2213
+ totalActionsCompleted: number;
2214
+ totalAmountGenerated: string;
2215
+ }
2216
+ interface ReferringCustomerTotalNonNullableFields {
2217
+ referringCustomerId: string;
2218
+ contactId: string;
2219
+ totalSuccessfulReferrals: number;
2220
+ totalAmountGenerated: string;
2221
+ totalFriendsWithActions: number;
2222
+ }
2223
+ interface QueryReferringCustomerTotalsResponseNonNullableFields {
2224
+ referringCustomerTotals: ReferringCustomerTotalNonNullableFields[];
2225
+ }
2226
+ interface FixedAmountDiscountNonNullableFields$1 {
2227
+ amount: number;
2228
+ }
2229
+ interface PercentageDiscountNonNullableFields$1 {
2230
+ percentage: number;
2231
+ }
2232
+ interface GroupNonNullableFields$1 {
2233
+ name: string;
2234
+ }
2235
+ interface CouponScopeNonNullableFields$1 {
2236
+ namespace: string;
2237
+ group?: GroupNonNullableFields$1;
2238
+ }
2239
+ interface CouponNonNullableFields$1 {
2240
+ fixedAmountOptions?: FixedAmountDiscountNonNullableFields$1;
2241
+ percentageOptions?: PercentageDiscountNonNullableFields$1;
2242
+ minimumSubtotal: number;
2243
+ scope?: CouponScopeNonNullableFields$1;
2244
+ name: string;
2245
+ discountType: DiscountType$1;
2246
+ }
2247
+ interface V1CouponNonNullableFields$1 {
2248
+ _id: string;
2249
+ code: string;
2250
+ status: Status$2;
2251
+ couponSpecification?: CouponNonNullableFields$1;
2252
+ }
2253
+ interface LoyaltyPointsNonNullableFields {
2254
+ transactionId: string;
2255
+ amount: number;
2256
+ }
2257
+ interface ReferredFriendActionNonNullableFields {
2258
+ coupon?: V1CouponNonNullableFields$1;
2259
+ loyaltyPoints?: LoyaltyPointsNonNullableFields;
2260
+ referredFriendId: string;
2261
+ contactId: string;
2262
+ trigger?: V1TriggerNonNullableFields;
2263
+ rewardType: Reward$1;
2264
+ totalActions: number;
2265
+ totalAmountSpent: string;
2266
+ }
2267
+ interface QueryReferredFriendActionsResponseNonNullableFields {
2268
+ referredFriendActions: ReferredFriendActionNonNullableFields[];
2269
+ }
2270
+ interface BaseEventMetadata$2 {
2271
+ /** App instance ID. */
2272
+ instanceId?: string | null;
2273
+ /** Event type. */
2274
+ eventType?: string;
2275
+ /** The identification type and identity data. */
2276
+ identity?: IdentificationData$3;
2277
+ }
2278
+ interface EventMetadata$2 extends BaseEventMetadata$2 {
2279
+ /**
2280
+ * Unique event ID.
2281
+ * Allows clients to ignore duplicate webhooks.
2282
+ */
2283
+ _id?: string;
2284
+ /**
2285
+ * Assumes actions are also always typed to an entity_type
2286
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2287
+ */
2288
+ entityFqdn?: string;
2289
+ /**
2290
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2291
+ * This is although the created/updated/deleted notion is duplication of the oneof types
2292
+ * Example: created/updated/deleted/started/completed/email_opened
2293
+ */
2294
+ slug?: string;
2295
+ /** ID of the entity associated with the event. */
2296
+ entityId?: string;
2297
+ /** Event timestamp. */
2298
+ eventTime?: Date;
2299
+ /**
2300
+ * Whether the event was triggered as a result of a privacy regulation application
2301
+ * (for example, GDPR).
2302
+ */
2303
+ triggeredByAnonymizeRequest?: boolean | null;
2304
+ /** If present, indicates the action that triggered the event. */
2305
+ originatedFrom?: string | null;
2306
+ /**
2307
+ * A sequence number defining the order of updates to the underlying entity.
2308
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
2309
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2310
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2311
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
2312
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2313
+ */
2314
+ entityEventSequence?: string | null;
2315
+ }
2316
+ interface ReferralEventCreatedEnvelope {
2317
+ entity: ReferralEvent;
2318
+ metadata: EventMetadata$2;
2319
+ }
2320
+ interface QueryCursorResult$2 {
2321
+ cursors: Cursors$3;
2322
+ hasNext: () => boolean;
2323
+ hasPrev: () => boolean;
2324
+ length: number;
2325
+ pageSize: number;
2326
+ }
2327
+ interface ReferralEventsQueryResult extends QueryCursorResult$2 {
2328
+ items: ReferralEvent[];
2329
+ query: ReferralEventsQueryBuilder;
2330
+ next: () => Promise<ReferralEventsQueryResult>;
2331
+ prev: () => Promise<ReferralEventsQueryResult>;
2332
+ }
2333
+ interface ReferralEventsQueryBuilder {
2334
+ /** @param propertyName - Property whose value is compared with `value`.
2335
+ * @param value - Value to compare against.
2336
+ * @documentationMaturity preview
2337
+ */
2338
+ eq: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2339
+ /** @param propertyName - Property whose value is compared with `value`.
2340
+ * @param value - Value to compare against.
2341
+ * @documentationMaturity preview
2342
+ */
2343
+ ne: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2344
+ /** @param propertyName - Property whose value is compared with `value`.
2345
+ * @param value - Value to compare against.
2346
+ * @documentationMaturity preview
2347
+ */
2348
+ ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2349
+ /** @param propertyName - Property whose value is compared with `value`.
2350
+ * @param value - Value to compare against.
2351
+ * @documentationMaturity preview
2352
+ */
2353
+ gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2354
+ /** @param propertyName - Property whose value is compared with `value`.
2355
+ * @param value - Value to compare against.
2356
+ * @documentationMaturity preview
2357
+ */
2358
+ le: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2359
+ /** @param propertyName - Property whose value is compared with `value`.
2360
+ * @param value - Value to compare against.
2361
+ * @documentationMaturity preview
2362
+ */
2363
+ lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2364
+ /** @param propertyName - Property whose value is compared with `values`.
2365
+ * @param values - List of values to compare against.
2366
+ * @documentationMaturity preview
2367
+ */
2368
+ hasSome: (propertyName: '_createdDate' | '_updatedDate', value: any[]) => ReferralEventsQueryBuilder;
2369
+ /** @documentationMaturity preview */
2370
+ in: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2371
+ /** @documentationMaturity preview */
2372
+ exists: (propertyName: '_createdDate' | '_updatedDate', value: boolean) => ReferralEventsQueryBuilder;
2373
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
2374
+ * @documentationMaturity preview
2375
+ */
2376
+ ascending: (...propertyNames: Array<'_createdDate' | '_updatedDate'>) => ReferralEventsQueryBuilder;
2377
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
2378
+ * @documentationMaturity preview
2379
+ */
2380
+ descending: (...propertyNames: Array<'_createdDate' | '_updatedDate'>) => ReferralEventsQueryBuilder;
2381
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
2382
+ * @documentationMaturity preview
2383
+ */
2384
+ limit: (limit: number) => ReferralEventsQueryBuilder;
2385
+ /** @param cursor - A pointer to specific record
2386
+ * @documentationMaturity preview
2387
+ */
2388
+ skipTo: (cursor: string) => ReferralEventsQueryBuilder;
2389
+ /** @documentationMaturity preview */
2390
+ find: () => Promise<ReferralEventsQueryResult>;
2391
+ }
2392
+ interface QueryReferringCustomerTotalsOptions {
2393
+ /** Query to filter ReferringCustomerTotals. */
2394
+ query?: CursorQuery$3;
2395
+ /** List of contact ids to filter ReferringCustomerTotals. */
2396
+ contactIds?: string[];
2397
+ }
2398
+ interface QueryReferredFriendActionsOptions {
2399
+ /** Query to filter ReferredFriendActions. */
2400
+ query?: CursorQuery$3;
2401
+ /** List of contact ids to filter ReferredFriendActions. */
2402
+ contactIds?: string[];
2403
+ }
2404
+
2405
+ declare function createRESTModule$3<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
2406
+
2407
+ declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2408
+
2409
+ declare const getReferralEvent: ReturnType<typeof createRESTModule$3<typeof publicGetReferralEvent>>;
2410
+ declare const queryReferralEvent: ReturnType<typeof createRESTModule$3<typeof publicQueryReferralEvent>>;
2411
+ declare const getReferralStatistics: ReturnType<typeof createRESTModule$3<typeof publicGetReferralStatistics>>;
2412
+ declare const queryReferringCustomerTotals: ReturnType<typeof createRESTModule$3<typeof publicQueryReferringCustomerTotals>>;
2413
+ declare const queryReferredFriendActions: ReturnType<typeof createRESTModule$3<typeof publicQueryReferredFriendActions>>;
2414
+ declare const onReferralEventCreated: ReturnType<typeof createEventModule$2<typeof publicOnReferralEventCreated>>;
2415
+
2416
+ type context$3_CreateReferralEventRequest = CreateReferralEventRequest;
2417
+ type context$3_CreateReferralEventResponse = CreateReferralEventResponse;
2418
+ type context$3_GetReferralEventRequest = GetReferralEventRequest;
2419
+ type context$3_GetReferralEventResponse = GetReferralEventResponse;
2420
+ type context$3_GetReferralEventResponseNonNullableFields = GetReferralEventResponseNonNullableFields;
2421
+ type context$3_GetReferralStatisticsRequest = GetReferralStatisticsRequest;
2422
+ type context$3_GetReferralStatisticsResponse = GetReferralStatisticsResponse;
2423
+ type context$3_GetReferralStatisticsResponseNonNullableFields = GetReferralStatisticsResponseNonNullableFields;
2424
+ type context$3_QueryReferralEventRequest = QueryReferralEventRequest;
2425
+ type context$3_QueryReferralEventResponse = QueryReferralEventResponse;
2426
+ type context$3_QueryReferralEventResponseNonNullableFields = QueryReferralEventResponseNonNullableFields;
2427
+ type context$3_QueryReferredFriendActionsOptions = QueryReferredFriendActionsOptions;
2428
+ type context$3_QueryReferredFriendActionsRequest = QueryReferredFriendActionsRequest;
2429
+ type context$3_QueryReferredFriendActionsResponse = QueryReferredFriendActionsResponse;
2430
+ type context$3_QueryReferredFriendActionsResponseNonNullableFields = QueryReferredFriendActionsResponseNonNullableFields;
2431
+ type context$3_QueryReferringCustomerTotalsOptions = QueryReferringCustomerTotalsOptions;
2432
+ type context$3_QueryReferringCustomerTotalsRequest = QueryReferringCustomerTotalsRequest;
2433
+ type context$3_QueryReferringCustomerTotalsResponse = QueryReferringCustomerTotalsResponse;
2434
+ type context$3_QueryReferringCustomerTotalsResponseNonNullableFields = QueryReferringCustomerTotalsResponseNonNullableFields;
2435
+ type context$3_ReferralEvent = ReferralEvent;
2436
+ type context$3_ReferralEventCreatedEnvelope = ReferralEventCreatedEnvelope;
2437
+ type context$3_ReferralEventEventTypeOneOf = ReferralEventEventTypeOneOf;
2438
+ type context$3_ReferralEventNonNullableFields = ReferralEventNonNullableFields;
2439
+ type context$3_ReferralEventsQueryBuilder = ReferralEventsQueryBuilder;
2440
+ type context$3_ReferralEventsQueryResult = ReferralEventsQueryResult;
2441
+ type context$3_ReferredFriendAction = ReferredFriendAction;
2442
+ type context$3_ReferredFriendActionEvent = ReferredFriendActionEvent;
2443
+ type context$3_ReferredFriendActionRewardTypeOptionsOneOf = ReferredFriendActionRewardTypeOptionsOneOf;
2444
+ type context$3_ReferredFriendSignupEvent = ReferredFriendSignupEvent;
2445
+ type context$3_ReferringCustomerTotal = ReferringCustomerTotal;
2446
+ type context$3_RewardEvent = RewardEvent;
2447
+ type context$3_RewardEventReceiverOneOf = RewardEventReceiverOneOf;
2448
+ type context$3_Trigger = Trigger;
2449
+ type context$3_V1ActionEvent = V1ActionEvent;
2450
+ type context$3_V1SuccessfulReferralEvent = V1SuccessfulReferralEvent;
2451
+ type context$3_V1Trigger = V1Trigger;
2452
+ declare const context$3_getReferralEvent: typeof getReferralEvent;
2453
+ declare const context$3_getReferralStatistics: typeof getReferralStatistics;
2454
+ declare const context$3_onReferralEventCreated: typeof onReferralEventCreated;
2455
+ declare const context$3_queryReferralEvent: typeof queryReferralEvent;
2456
+ declare const context$3_queryReferredFriendActions: typeof queryReferredFriendActions;
2457
+ declare const context$3_queryReferringCustomerTotals: typeof queryReferringCustomerTotals;
2458
+ declare namespace context$3 {
2459
+ export { type ActionEvent$3 as ActionEvent, type BaseEventMetadata$2 as BaseEventMetadata, type Coupon$1 as Coupon, type CouponDiscountTypeOptionsOneOf$1 as CouponDiscountTypeOptionsOneOf, type CouponScope$1 as CouponScope, type CouponScopeOrMinSubtotalOneOf$1 as CouponScopeOrMinSubtotalOneOf, type context$3_CreateReferralEventRequest as CreateReferralEventRequest, type context$3_CreateReferralEventResponse as CreateReferralEventResponse, type CursorPaging$3 as CursorPaging, type CursorPagingMetadata$3 as CursorPagingMetadata, type CursorQuery$3 as CursorQuery, type CursorQueryPagingMethodOneOf$3 as CursorQueryPagingMethodOneOf, type Cursors$3 as Cursors, DiscountType$1 as DiscountType, type DomainEvent$3 as DomainEvent, type DomainEventBodyOneOf$3 as DomainEventBodyOneOf, type Empty$2 as Empty, type EntityCreatedEvent$3 as EntityCreatedEvent, type EntityDeletedEvent$3 as EntityDeletedEvent, type EntityUpdatedEvent$3 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type FixedAmountDiscount$1 as FixedAmountDiscount, type context$3_GetReferralEventRequest as GetReferralEventRequest, type context$3_GetReferralEventResponse as GetReferralEventResponse, type context$3_GetReferralEventResponseNonNullableFields as GetReferralEventResponseNonNullableFields, type context$3_GetReferralStatisticsRequest as GetReferralStatisticsRequest, type context$3_GetReferralStatisticsResponse as GetReferralStatisticsResponse, type context$3_GetReferralStatisticsResponseNonNullableFields as GetReferralStatisticsResponseNonNullableFields, type Group$1 as Group, type IdentificationData$3 as IdentificationData, type IdentificationDataIdOneOf$3 as IdentificationDataIdOneOf, type LoyaltyPoints$1 as LoyaltyPoints, type MessageEnvelope$3 as MessageEnvelope, type PercentageDiscount$1 as PercentageDiscount, type context$3_QueryReferralEventRequest as QueryReferralEventRequest, type context$3_QueryReferralEventResponse as QueryReferralEventResponse, type context$3_QueryReferralEventResponseNonNullableFields as QueryReferralEventResponseNonNullableFields, type context$3_QueryReferredFriendActionsOptions as QueryReferredFriendActionsOptions, type context$3_QueryReferredFriendActionsRequest as QueryReferredFriendActionsRequest, type context$3_QueryReferredFriendActionsResponse as QueryReferredFriendActionsResponse, type context$3_QueryReferredFriendActionsResponseNonNullableFields as QueryReferredFriendActionsResponseNonNullableFields, type context$3_QueryReferringCustomerTotalsOptions as QueryReferringCustomerTotalsOptions, type context$3_QueryReferringCustomerTotalsRequest as QueryReferringCustomerTotalsRequest, type context$3_QueryReferringCustomerTotalsResponse as QueryReferringCustomerTotalsResponse, type context$3_QueryReferringCustomerTotalsResponseNonNullableFields as QueryReferringCustomerTotalsResponseNonNullableFields, type context$3_ReferralEvent as ReferralEvent, type context$3_ReferralEventCreatedEnvelope as ReferralEventCreatedEnvelope, type context$3_ReferralEventEventTypeOneOf as ReferralEventEventTypeOneOf, type context$3_ReferralEventNonNullableFields as ReferralEventNonNullableFields, type context$3_ReferralEventsQueryBuilder as ReferralEventsQueryBuilder, type context$3_ReferralEventsQueryResult as ReferralEventsQueryResult, type context$3_ReferredFriendAction as ReferredFriendAction, type context$3_ReferredFriendActionEvent as ReferredFriendActionEvent, type context$3_ReferredFriendActionRewardTypeOptionsOneOf as ReferredFriendActionRewardTypeOptionsOneOf, type ReferredFriendDetails$2 as ReferredFriendDetails, type context$3_ReferredFriendSignupEvent as ReferredFriendSignupEvent, type context$3_ReferringCustomerTotal as ReferringCustomerTotal, Reward$1 as Reward, type context$3_RewardEvent as RewardEvent, type context$3_RewardEventReceiverOneOf as RewardEventReceiverOneOf, SortOrder$3 as SortOrder, type Sorting$3 as Sorting, Status$2 as Status, type SuccessfulReferralEvent$2 as SuccessfulReferralEvent, type context$3_Trigger as Trigger, type UndeleteInfo$3 as UndeleteInfo, type context$3_V1ActionEvent as V1ActionEvent, type V1Coupon$1 as V1Coupon, type context$3_V1SuccessfulReferralEvent as V1SuccessfulReferralEvent, type context$3_V1Trigger as V1Trigger, WebhookIdentityType$3 as WebhookIdentityType, context$3_getReferralEvent as getReferralEvent, context$3_getReferralStatistics as getReferralStatistics, context$3_onReferralEventCreated as onReferralEventCreated, context$3_queryReferralEvent as queryReferralEvent, context$3_queryReferredFriendActions as queryReferredFriendActions, context$3_queryReferringCustomerTotals as queryReferringCustomerTotals };
2460
+ }
2461
+
2462
+ /** ReferralReward is the main entity of ReferralRewards that can be used for lorem ipsum dolor */
2463
+ interface ReferralReward extends ReferralRewardReceiverOneOf, ReferralRewardRewardTypeOptionsOneOf {
2464
+ /**
2465
+ * Referring customer ID.
2466
+ * @readonly
2467
+ */
2468
+ rewardedReferringCustomerId?: string;
2469
+ /**
2470
+ * Referred friend ID.
2471
+ * @readonly
2472
+ */
2473
+ rewardedReferredFriendId?: string;
2474
+ /** Coupon reward type options. */
2475
+ coupon?: V1Coupon;
2476
+ /** Loyalty points reward type options. */
2477
+ loyaltyPoints?: V1LoyaltyPoints;
2478
+ /**
2479
+ * ReferralReward ID.
2480
+ * @readonly
2481
+ */
2482
+ _id?: string | null;
2483
+ /** Represents the current state of an item. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision. */
2484
+ revision?: string | null;
2485
+ /**
2486
+ * Represents the time this ReferralReward was created.
2487
+ * @readonly
2488
+ */
2489
+ _createdDate?: Date;
2490
+ /**
2491
+ * Represents the time this ReferralReward was last updated.
2492
+ * @readonly
2493
+ */
2494
+ _updatedDate?: Date;
2495
+ /** Reward type. */
2496
+ rewardType?: RewardTypeType;
2497
+ }
2498
+ /** @oneof */
2499
+ interface ReferralRewardReceiverOneOf {
2500
+ /**
2501
+ * Referring customer ID.
2502
+ * @readonly
2503
+ */
2504
+ rewardedReferringCustomerId?: string;
2505
+ /**
2506
+ * Referred friend ID.
2507
+ * @readonly
2508
+ */
2509
+ rewardedReferredFriendId?: string;
2510
+ }
2511
+ /** @oneof */
2512
+ interface ReferralRewardRewardTypeOptionsOneOf {
2513
+ /** Coupon reward type options. */
2514
+ coupon?: V1Coupon;
2515
+ /** Loyalty points reward type options. */
2516
+ loyaltyPoints?: V1LoyaltyPoints;
2517
+ }
2518
+ declare enum RewardTypeType {
2519
+ /** Unknown reward type. */
2520
+ UNKNOWN = "UNKNOWN",
2521
+ /** Coupon reward type. */
2522
+ COUPON = "COUPON",
2523
+ /** Loyalty points reward type. */
2524
+ LOYALTY_POINTS = "LOYALTY_POINTS",
2525
+ /** No reward. */
2526
+ NOTHING = "NOTHING"
2527
+ }
2528
+ interface V1Coupon {
2529
+ /**
2530
+ * Coupon ID.
2531
+ * @readonly
2532
+ */
2533
+ _id?: string;
2534
+ /**
2535
+ * Coupon code.
2536
+ * @readonly
2537
+ */
2538
+ code?: string;
2539
+ /**
2540
+ * Coupon status.
2541
+ * @readonly
2542
+ */
2543
+ status?: Status$1;
2544
+ /**
2545
+ * Coupon specification.
2546
+ * @readonly
2547
+ */
2548
+ couponSpecification?: Coupon;
2549
+ }
2550
+ declare enum Status$1 {
2551
+ /** Unknown coupon status. */
2552
+ UNKNOWN = "UNKNOWN",
2553
+ /** Coupon is active and can be applied. */
2554
+ ACTIVE = "ACTIVE",
2555
+ /** Coupon was already applied and can not be used anymore. */
2556
+ APPLIED = "APPLIED",
2557
+ /** Coupon was deleted. */
2558
+ DELETED = "DELETED"
2559
+ }
2560
+ interface Coupon extends CouponDiscountTypeOptionsOneOf, CouponScopeOrMinSubtotalOneOf {
2561
+ /** Options for fixed amount discount type */
2562
+ fixedAmountOptions?: FixedAmountDiscount;
2563
+ /** Options for percentage discount type */
2564
+ percentageOptions?: PercentageDiscount;
2565
+ /** Limit the coupon to carts with a subtotal above this number. */
2566
+ minimumSubtotal?: number;
2567
+ /** Specifies the type of line items this coupon will apply to. */
2568
+ scope?: CouponScope;
2569
+ /** Coupon name */
2570
+ name?: string;
2571
+ /** Coupon discount type */
2572
+ discountType?: DiscountType;
2573
+ /** Limit the coupon to only apply to one item in cart. */
2574
+ limitedToOneItem?: boolean | null;
2575
+ /** If true, coupon also applies to subscriptions. */
2576
+ appliesToSubscriptions?: boolean | null;
2577
+ /** Specifies the amount of discounted cycles for subscription item. See Stores Coupons documentation for more info. */
2578
+ discountedCycleCount?: number | null;
2579
+ }
2580
+ /** @oneof */
2581
+ interface CouponDiscountTypeOptionsOneOf {
2582
+ /** Options for fixed amount discount type */
2583
+ fixedAmountOptions?: FixedAmountDiscount;
2584
+ /** Options for percentage discount type */
2585
+ percentageOptions?: PercentageDiscount;
2586
+ }
2587
+ /** @oneof */
2588
+ interface CouponScopeOrMinSubtotalOneOf {
2589
+ /** Limit the coupon to carts with a subtotal above this number. */
2590
+ minimumSubtotal?: number;
2591
+ /** Specifies the type of line items this coupon will apply to. */
2592
+ scope?: CouponScope;
2593
+ }
2594
+ declare enum DiscountType {
2595
+ UNKNOWN = "UNKNOWN",
2596
+ /** Discount as a fixed amount */
2597
+ FIXED_AMOUNT = "FIXED_AMOUNT",
2598
+ /** Discount as a percentage */
2599
+ PERCENTAGE = "PERCENTAGE",
2600
+ /** Free shipping */
2601
+ FREE_SHIPPING = "FREE_SHIPPING"
2602
+ }
2603
+ interface FixedAmountDiscount {
2604
+ /** Fixed amount to discount */
2605
+ amount?: number;
2606
+ }
2607
+ interface PercentageDiscount {
2608
+ percentage?: number;
2609
+ }
2610
+ interface CouponScope {
2611
+ namespace?: string;
2612
+ group?: Group;
2613
+ }
2614
+ interface Group {
2615
+ name?: string;
2616
+ entityId?: string | null;
2617
+ }
2618
+ interface V1LoyaltyPoints {
2619
+ /**
2620
+ * Loyalty transaction ID.
2621
+ * @readonly
2622
+ */
2623
+ transactionId?: string;
2624
+ /**
2625
+ * Loyalty points amount given.
2626
+ * @readonly
2627
+ */
2628
+ amount?: number;
2629
+ }
2630
+ interface GetReferralRewardRequest {
2631
+ /** Id of the ReferralReward to retrieve. */
2632
+ _id: string;
2633
+ }
2634
+ interface GetReferralRewardResponse {
2635
+ /** The retrieved ReferralReward. */
2636
+ referralReward?: ReferralReward;
2637
+ }
2638
+ interface QueryReferralRewardsRequest {
2639
+ /** Query to filter ReferralRewards. */
2640
+ query: CursorQuery$2;
2641
+ /** Filter by contact id or set to "me" for current identity's rewards. */
2642
+ contactId?: string | null;
2643
+ }
2644
+ interface CursorQuery$2 extends CursorQueryPagingMethodOneOf$2 {
2645
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
2646
+ cursorPaging?: CursorPaging$2;
2647
+ /**
2648
+ * Filter object in the following format:
2649
+ * `"filter" : {
2650
+ * "fieldName1": "value1",
2651
+ * "fieldName2":{"$operator":"value2"}
2652
+ * }`
2653
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
2654
+ */
2655
+ filter?: Record<string, any> | null;
2656
+ /**
2657
+ * Sort object in the following format:
2658
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
2659
+ */
2660
+ sort?: Sorting$2[];
2661
+ }
2662
+ /** @oneof */
2663
+ interface CursorQueryPagingMethodOneOf$2 {
2664
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
2665
+ cursorPaging?: CursorPaging$2;
2666
+ }
2667
+ interface Sorting$2 {
2668
+ /** Name of the field to sort by. */
2669
+ fieldName?: string;
2670
+ /** Sort order. */
2671
+ order?: SortOrder$2;
2672
+ }
2673
+ declare enum SortOrder$2 {
2674
+ ASC = "ASC",
2675
+ DESC = "DESC"
2676
+ }
2677
+ interface CursorPaging$2 {
2678
+ /** Maximum number of items to return in the results. */
2679
+ limit?: number | null;
2680
+ /**
2681
+ * Pointer to the next or previous page in the list of results.
2682
+ *
2683
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
2684
+ * Not relevant for the first request.
2685
+ */
2686
+ cursor?: string | null;
2687
+ }
2688
+ interface QueryReferralRewardsResponse {
2689
+ /** The retrieved ReferralRewards. */
2690
+ referralRewards?: ReferralReward[];
2691
+ /** Metadata for paging. */
2692
+ metadata?: CursorPagingMetadata$2;
2693
+ }
2694
+ interface CursorPagingMetadata$2 {
2695
+ /** Number of items returned in the response. */
2696
+ count?: number | null;
2697
+ /** Cursor strings that point to the next page, previous page, or both. */
2698
+ cursors?: Cursors$2;
2699
+ /**
2700
+ * Whether there are more pages to retrieve following the current page.
2701
+ *
2702
+ * + `true`: Another page of results can be retrieved.
2703
+ * + `false`: This is the last page.
2704
+ */
2705
+ hasNext?: boolean | null;
2706
+ }
2707
+ interface Cursors$2 {
2708
+ /** Cursor string pointing to the next page in the list of results. */
2709
+ next?: string | null;
2710
+ /** Cursor pointing to the previous page in the list of results. */
2711
+ prev?: string | null;
2712
+ }
2713
+ interface ValidateReferralRewardRequest {
2714
+ /** Reward to validate. */
2715
+ reward?: Reward;
2716
+ }
2717
+ interface Reward extends RewardOptionsOneOf {
2718
+ /** Options for coupon reward type */
2719
+ couponOptions?: Coupon;
2720
+ /** Options for Loyalty points reward type */
2721
+ loyaltyPointsOptions?: LoyaltyPoints;
2722
+ /** Type of the reward */
2723
+ type?: Type;
2724
+ }
2725
+ /** @oneof */
2726
+ interface RewardOptionsOneOf {
2727
+ /** Options for coupon reward type */
2728
+ couponOptions?: Coupon;
2729
+ /** Options for Loyalty points reward type */
2730
+ loyaltyPointsOptions?: LoyaltyPoints;
2731
+ }
2732
+ declare enum Type {
2733
+ UNKNOWN = "UNKNOWN",
2734
+ /** Coupon reward type */
2735
+ COUPON = "COUPON",
2736
+ /** Loyalty points reward type */
2737
+ LOYALTY_POINTS = "LOYALTY_POINTS",
2738
+ /** No reward type */
2739
+ NOTHING = "NOTHING"
2740
+ }
2741
+ interface LoyaltyPoints {
2742
+ /** Amount of points to give */
2743
+ amount?: number;
2744
+ }
2745
+ interface ValidateReferralRewardResponse {
2746
+ }
2747
+ interface BulkGetReferralRewardsRequest {
2748
+ }
2749
+ interface BulkGetReferralRewardsResponse {
2750
+ /** Found rewards per site. */
2751
+ rewardsInSite?: RewardsInSite[];
2752
+ }
2753
+ interface RewardsInSite {
2754
+ /** Metasite ID. */
2755
+ metaSiteId?: string;
2756
+ /** Rewards. */
2757
+ rewards?: ReferralReward[];
2758
+ }
2759
+ interface DomainEvent$2 extends DomainEventBodyOneOf$2 {
2760
+ createdEvent?: EntityCreatedEvent$2;
2761
+ updatedEvent?: EntityUpdatedEvent$2;
2762
+ deletedEvent?: EntityDeletedEvent$2;
2763
+ actionEvent?: ActionEvent$2;
2764
+ /**
2765
+ * Unique event ID.
2766
+ * Allows clients to ignore duplicate webhooks.
2767
+ */
2768
+ _id?: string;
2769
+ /**
2770
+ * Assumes actions are also always typed to an entity_type
2771
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2772
+ */
981
2773
  entityFqdn?: string;
982
- packageName?: string;
983
- };
984
- type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
985
-
986
- declare global {
987
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
988
- interface SymbolConstructor {
989
- readonly observable: symbol;
990
- }
2774
+ /**
2775
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2776
+ * This is although the created/updated/deleted notion is duplication of the oneof types
2777
+ * Example: created/updated/deleted/started/completed/email_opened
2778
+ */
2779
+ slug?: string;
2780
+ /** ID of the entity associated with the event. */
2781
+ entityId?: string;
2782
+ /** Event timestamp. */
2783
+ eventTime?: Date;
2784
+ /**
2785
+ * Whether the event was triggered as a result of a privacy regulation application
2786
+ * (for example, GDPR).
2787
+ */
2788
+ triggeredByAnonymizeRequest?: boolean | null;
2789
+ /** If present, indicates the action that triggered the event. */
2790
+ originatedFrom?: string | null;
2791
+ /**
2792
+ * A sequence number defining the order of updates to the underlying entity.
2793
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
2794
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2795
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2796
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
2797
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2798
+ */
2799
+ entityEventSequence?: string | null;
991
2800
  }
992
-
993
- declare function getReferralReward$1(httpClient: HttpClient$2): (_id: string) => Promise<ReferralReward & {
2801
+ /** @oneof */
2802
+ interface DomainEventBodyOneOf$2 {
2803
+ createdEvent?: EntityCreatedEvent$2;
2804
+ updatedEvent?: EntityUpdatedEvent$2;
2805
+ deletedEvent?: EntityDeletedEvent$2;
2806
+ actionEvent?: ActionEvent$2;
2807
+ }
2808
+ interface EntityCreatedEvent$2 {
2809
+ entity?: string;
2810
+ }
2811
+ interface UndeleteInfo$2 {
2812
+ deletedDate?: Date;
2813
+ }
2814
+ interface EntityUpdatedEvent$2 {
2815
+ /**
2816
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
2817
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
2818
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
2819
+ */
2820
+ currentEntity?: string;
2821
+ }
2822
+ interface EntityDeletedEvent$2 {
2823
+ /** Entity that was deleted */
2824
+ deletedEntity?: string | null;
2825
+ }
2826
+ interface ActionEvent$2 {
2827
+ body?: string;
2828
+ }
2829
+ interface Empty$1 {
2830
+ }
2831
+ interface SuccessfulReferralEvent$1 {
2832
+ /** ReferredFriend that completed his referral details. */
2833
+ referredFriendDetails?: ReferredFriendDetails$1;
2834
+ }
2835
+ interface ReferredFriendDetails$1 {
2836
+ /**
2837
+ * ReferredFriend ID.
2838
+ * @readonly
2839
+ */
2840
+ referredFriendId?: string;
2841
+ /**
2842
+ * ReferredFriend Contact ID.
2843
+ * @readonly
2844
+ */
2845
+ contactId?: string;
2846
+ /**
2847
+ * Customer who referred this ReferredFriend.
2848
+ * @readonly
2849
+ */
2850
+ referringCustomerId?: string;
2851
+ }
2852
+ interface MessageEnvelope$2 {
2853
+ /** App instance ID. */
2854
+ instanceId?: string | null;
2855
+ /** Event type. */
2856
+ eventType?: string;
2857
+ /** The identification type and identity data. */
2858
+ identity?: IdentificationData$2;
2859
+ /** Stringify payload. */
2860
+ data?: string;
2861
+ }
2862
+ interface IdentificationData$2 extends IdentificationDataIdOneOf$2 {
2863
+ /** ID of a site visitor that has not logged in to the site. */
2864
+ anonymousVisitorId?: string;
2865
+ /** ID of a site visitor that has logged in to the site. */
2866
+ memberId?: string;
2867
+ /** ID of a Wix user (site owner, contributor, etc.). */
2868
+ wixUserId?: string;
2869
+ /** ID of an app. */
2870
+ appId?: string;
2871
+ /** @readonly */
2872
+ identityType?: WebhookIdentityType$2;
2873
+ }
2874
+ /** @oneof */
2875
+ interface IdentificationDataIdOneOf$2 {
2876
+ /** ID of a site visitor that has not logged in to the site. */
2877
+ anonymousVisitorId?: string;
2878
+ /** ID of a site visitor that has logged in to the site. */
2879
+ memberId?: string;
2880
+ /** ID of a Wix user (site owner, contributor, etc.). */
2881
+ wixUserId?: string;
2882
+ /** ID of an app. */
2883
+ appId?: string;
2884
+ }
2885
+ declare enum WebhookIdentityType$2 {
2886
+ UNKNOWN = "UNKNOWN",
2887
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
2888
+ MEMBER = "MEMBER",
2889
+ WIX_USER = "WIX_USER",
2890
+ APP = "APP"
2891
+ }
2892
+ interface FixedAmountDiscountNonNullableFields {
2893
+ amount: number;
2894
+ }
2895
+ interface PercentageDiscountNonNullableFields {
2896
+ percentage: number;
2897
+ }
2898
+ interface GroupNonNullableFields {
2899
+ name: string;
2900
+ }
2901
+ interface CouponScopeNonNullableFields {
2902
+ namespace: string;
2903
+ group?: GroupNonNullableFields;
2904
+ }
2905
+ interface CouponNonNullableFields {
2906
+ fixedAmountOptions?: FixedAmountDiscountNonNullableFields;
2907
+ percentageOptions?: PercentageDiscountNonNullableFields;
2908
+ minimumSubtotal: number;
2909
+ scope?: CouponScopeNonNullableFields;
2910
+ name: string;
2911
+ discountType: DiscountType;
2912
+ }
2913
+ interface V1CouponNonNullableFields {
2914
+ _id: string;
2915
+ code: string;
2916
+ status: Status$1;
2917
+ couponSpecification?: CouponNonNullableFields;
2918
+ }
2919
+ interface V1LoyaltyPointsNonNullableFields {
2920
+ transactionId: string;
2921
+ amount: number;
2922
+ }
2923
+ interface ReferralRewardNonNullableFields {
994
2924
  rewardedReferringCustomerId: string;
995
2925
  rewardedReferredFriendId: string;
996
- coupon?: {
997
- _id: string;
998
- code: string;
999
- status: Status$1;
1000
- couponSpecification?: {
1001
- fixedAmountOptions?: {
1002
- amount: number;
1003
- } | undefined;
1004
- percentageOptions?: {
1005
- percentage: number;
1006
- } | undefined;
1007
- minimumSubtotal: number;
1008
- scope?: {
1009
- namespace: string;
1010
- group?: {
1011
- name: string;
1012
- } | undefined;
1013
- } | undefined;
1014
- name: string;
1015
- discountType: DiscountType;
1016
- } | undefined;
1017
- } | undefined;
1018
- loyaltyPoints?: {
1019
- transactionId: string;
1020
- amount: number;
1021
- } | undefined;
2926
+ coupon?: V1CouponNonNullableFields;
2927
+ loyaltyPoints?: V1LoyaltyPointsNonNullableFields;
1022
2928
  rewardType: RewardTypeType;
1023
- }>;
1024
- declare function queryReferralRewards$1(httpClient: HttpClient$2): (query: CursorQuery, options?: QueryReferralRewardsOptions) => Promise<QueryReferralRewardsResponse & QueryReferralRewardsResponseNonNullableFields>;
2929
+ }
2930
+ interface GetReferralRewardResponseNonNullableFields {
2931
+ referralReward?: ReferralRewardNonNullableFields;
2932
+ }
2933
+ interface QueryReferralRewardsResponseNonNullableFields {
2934
+ referralRewards: ReferralRewardNonNullableFields[];
2935
+ }
2936
+ interface QueryReferralRewardsOptions {
2937
+ /** Filter by contact id or set to "me" for current identity's rewards. */
2938
+ contactId?: string | null;
2939
+ }
2940
+
2941
+ declare function createRESTModule$2<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1025
2942
 
1026
- declare const getReferralReward: BuildRESTFunction$2<typeof getReferralReward$1>;
1027
- declare const queryReferralRewards: BuildRESTFunction$2<typeof queryReferralRewards$1>;
2943
+ declare const getReferralReward: ReturnType<typeof createRESTModule$2<typeof publicGetReferralReward>>;
2944
+ declare const queryReferralRewards: ReturnType<typeof createRESTModule$2<typeof publicQueryReferralRewards>>;
1028
2945
 
2946
+ type context$2_BulkGetReferralRewardsRequest = BulkGetReferralRewardsRequest;
2947
+ type context$2_BulkGetReferralRewardsResponse = BulkGetReferralRewardsResponse;
2948
+ type context$2_Coupon = Coupon;
2949
+ type context$2_CouponDiscountTypeOptionsOneOf = CouponDiscountTypeOptionsOneOf;
2950
+ type context$2_CouponScope = CouponScope;
2951
+ type context$2_CouponScopeOrMinSubtotalOneOf = CouponScopeOrMinSubtotalOneOf;
2952
+ type context$2_DiscountType = DiscountType;
2953
+ declare const context$2_DiscountType: typeof DiscountType;
2954
+ type context$2_FixedAmountDiscount = FixedAmountDiscount;
2955
+ type context$2_GetReferralRewardRequest = GetReferralRewardRequest;
2956
+ type context$2_GetReferralRewardResponse = GetReferralRewardResponse;
2957
+ type context$2_GetReferralRewardResponseNonNullableFields = GetReferralRewardResponseNonNullableFields;
2958
+ type context$2_Group = Group;
2959
+ type context$2_LoyaltyPoints = LoyaltyPoints;
2960
+ type context$2_PercentageDiscount = PercentageDiscount;
2961
+ type context$2_QueryReferralRewardsOptions = QueryReferralRewardsOptions;
2962
+ type context$2_QueryReferralRewardsRequest = QueryReferralRewardsRequest;
2963
+ type context$2_QueryReferralRewardsResponse = QueryReferralRewardsResponse;
2964
+ type context$2_QueryReferralRewardsResponseNonNullableFields = QueryReferralRewardsResponseNonNullableFields;
2965
+ type context$2_ReferralReward = ReferralReward;
2966
+ type context$2_ReferralRewardNonNullableFields = ReferralRewardNonNullableFields;
2967
+ type context$2_ReferralRewardReceiverOneOf = ReferralRewardReceiverOneOf;
2968
+ type context$2_ReferralRewardRewardTypeOptionsOneOf = ReferralRewardRewardTypeOptionsOneOf;
2969
+ type context$2_Reward = Reward;
2970
+ type context$2_RewardOptionsOneOf = RewardOptionsOneOf;
2971
+ type context$2_RewardTypeType = RewardTypeType;
2972
+ declare const context$2_RewardTypeType: typeof RewardTypeType;
2973
+ type context$2_RewardsInSite = RewardsInSite;
2974
+ type context$2_Type = Type;
2975
+ declare const context$2_Type: typeof Type;
2976
+ type context$2_V1Coupon = V1Coupon;
2977
+ type context$2_V1LoyaltyPoints = V1LoyaltyPoints;
2978
+ type context$2_ValidateReferralRewardRequest = ValidateReferralRewardRequest;
2979
+ type context$2_ValidateReferralRewardResponse = ValidateReferralRewardResponse;
1029
2980
  declare const context$2_getReferralReward: typeof getReferralReward;
1030
2981
  declare const context$2_queryReferralRewards: typeof queryReferralRewards;
1031
2982
  declare namespace context$2 {
1032
- export { context$2_getReferralReward as getReferralReward, context$2_queryReferralRewards as queryReferralRewards };
2983
+ export { type ActionEvent$2 as ActionEvent, type context$2_BulkGetReferralRewardsRequest as BulkGetReferralRewardsRequest, type context$2_BulkGetReferralRewardsResponse as BulkGetReferralRewardsResponse, type context$2_Coupon as Coupon, type context$2_CouponDiscountTypeOptionsOneOf as CouponDiscountTypeOptionsOneOf, type context$2_CouponScope as CouponScope, type context$2_CouponScopeOrMinSubtotalOneOf as CouponScopeOrMinSubtotalOneOf, type CursorPaging$2 as CursorPaging, type CursorPagingMetadata$2 as CursorPagingMetadata, type CursorQuery$2 as CursorQuery, type CursorQueryPagingMethodOneOf$2 as CursorQueryPagingMethodOneOf, type Cursors$2 as Cursors, context$2_DiscountType as DiscountType, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type context$2_FixedAmountDiscount as FixedAmountDiscount, type context$2_GetReferralRewardRequest as GetReferralRewardRequest, type context$2_GetReferralRewardResponse as GetReferralRewardResponse, type context$2_GetReferralRewardResponseNonNullableFields as GetReferralRewardResponseNonNullableFields, type context$2_Group as Group, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type context$2_LoyaltyPoints as LoyaltyPoints, type MessageEnvelope$2 as MessageEnvelope, type context$2_PercentageDiscount as PercentageDiscount, type context$2_QueryReferralRewardsOptions as QueryReferralRewardsOptions, type context$2_QueryReferralRewardsRequest as QueryReferralRewardsRequest, type context$2_QueryReferralRewardsResponse as QueryReferralRewardsResponse, type context$2_QueryReferralRewardsResponseNonNullableFields as QueryReferralRewardsResponseNonNullableFields, type context$2_ReferralReward as ReferralReward, type context$2_ReferralRewardNonNullableFields as ReferralRewardNonNullableFields, type context$2_ReferralRewardReceiverOneOf as ReferralRewardReceiverOneOf, type context$2_ReferralRewardRewardTypeOptionsOneOf as ReferralRewardRewardTypeOptionsOneOf, type ReferredFriendDetails$1 as ReferredFriendDetails, type context$2_Reward as Reward, type context$2_RewardOptionsOneOf as RewardOptionsOneOf, context$2_RewardTypeType as RewardTypeType, type context$2_RewardsInSite as RewardsInSite, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, Status$1 as Status, type SuccessfulReferralEvent$1 as SuccessfulReferralEvent, context$2_Type as Type, type UndeleteInfo$2 as UndeleteInfo, type context$2_V1Coupon as V1Coupon, type context$2_V1LoyaltyPoints as V1LoyaltyPoints, type context$2_ValidateReferralRewardRequest as ValidateReferralRewardRequest, type context$2_ValidateReferralRewardResponse as ValidateReferralRewardResponse, WebhookIdentityType$2 as WebhookIdentityType, context$2_getReferralReward as getReferralReward, context$2_queryReferralRewards as queryReferralRewards };
1033
2984
  }
1034
2985
 
1035
2986
  /** ReferredFriend is the main entity of ReferredFriends that can be used for lorem ipsum dolor */
@@ -1057,37 +3008,237 @@ interface ReferredFriend {
1057
3008
  */
1058
3009
  revision?: string | null;
1059
3010
  /**
1060
- * Represents the time this ReferredFriend was created.
3011
+ * Represents the time this ReferredFriend was created.
3012
+ * @readonly
3013
+ */
3014
+ _createdDate?: Date;
3015
+ /**
3016
+ * Represents the time this ReferredFriend was last updated.
3017
+ * @readonly
3018
+ */
3019
+ _updatedDate?: Date;
3020
+ }
3021
+ declare enum Status {
3022
+ /** Unknown status. */
3023
+ UNKNOWN = "UNKNOWN",
3024
+ /** Initial status, when Referred friend joins site as member. */
3025
+ SIGN_UP_COMPLETED = "SIGN_UP_COMPLETED",
3026
+ /** After complete some actions (eg. Purchase Order), Action Completed Status is used. */
3027
+ ACTIONS_COMPLETED = "ACTIONS_COMPLETED"
3028
+ }
3029
+ interface CreateReferredFriendRequest {
3030
+ }
3031
+ interface CreateReferredFriendResponse {
3032
+ /** The created ReferredFriend. */
3033
+ referredFriend?: ReferredFriend;
3034
+ }
3035
+ interface GetReferredFriendRequest {
3036
+ /** Id of the ReferredFriend to retrieve. */
3037
+ referredFriendId: string;
3038
+ }
3039
+ interface GetReferredFriendResponse {
3040
+ /** The retrieved ReferredFriend. */
3041
+ referredFriend?: ReferredFriend;
3042
+ }
3043
+ interface GetReferredFriendByContactIdRequest {
3044
+ /** Contact id or "me" to get current identity's Contact. */
3045
+ contactId: string;
3046
+ }
3047
+ interface GetReferredFriendByContactIdResponse {
3048
+ /** The retrieved ReferredFriend. */
3049
+ referredFriend?: ReferredFriend;
3050
+ }
3051
+ interface UpdateReferredFriendRequest {
3052
+ /** ReferredFriend to be updated, may be partial. */
3053
+ referredFriend: ReferredFriend;
3054
+ }
3055
+ interface UpdateReferredFriendResponse {
3056
+ /** The updated ReferredFriend. */
3057
+ referredFriend?: ReferredFriend;
3058
+ }
3059
+ interface DeleteReferredFriendRequest {
3060
+ /** Id of the ReferredFriend to delete. */
3061
+ referredFriendId: string;
3062
+ /** The revision of the ReferredFriend. */
3063
+ revision?: string;
3064
+ }
3065
+ interface DeleteReferredFriendResponse {
3066
+ }
3067
+ interface QueryReferredFriendRequest {
3068
+ /** Query options. */
3069
+ query: CursorQuery$1;
3070
+ }
3071
+ interface CursorQuery$1 extends CursorQueryPagingMethodOneOf$1 {
3072
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
3073
+ cursorPaging?: CursorPaging$1;
3074
+ /**
3075
+ * Filter object in the following format:
3076
+ * `"filter" : {
3077
+ * "fieldName1": "value1",
3078
+ * "fieldName2":{"$operator":"value2"}
3079
+ * }`
3080
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
3081
+ */
3082
+ filter?: Record<string, any> | null;
3083
+ /**
3084
+ * Sort object in the following format:
3085
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
3086
+ */
3087
+ sort?: Sorting$1[];
3088
+ }
3089
+ /** @oneof */
3090
+ interface CursorQueryPagingMethodOneOf$1 {
3091
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
3092
+ cursorPaging?: CursorPaging$1;
3093
+ }
3094
+ interface Sorting$1 {
3095
+ /** Name of the field to sort by. */
3096
+ fieldName?: string;
3097
+ /** Sort order. */
3098
+ order?: SortOrder$1;
3099
+ }
3100
+ declare enum SortOrder$1 {
3101
+ ASC = "ASC",
3102
+ DESC = "DESC"
3103
+ }
3104
+ interface CursorPaging$1 {
3105
+ /** Maximum number of items to return in the results. */
3106
+ limit?: number | null;
3107
+ /**
3108
+ * Pointer to the next or previous page in the list of results.
3109
+ *
3110
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
3111
+ * Not relevant for the first request.
3112
+ */
3113
+ cursor?: string | null;
3114
+ }
3115
+ interface QueryReferredFriendResponse {
3116
+ /** The retrieved ReferredFriends. */
3117
+ referredFriends?: ReferredFriend[];
3118
+ /** CursorPagingMetadata. */
3119
+ metadata?: CursorPagingMetadata$1;
3120
+ }
3121
+ interface CursorPagingMetadata$1 {
3122
+ /** Number of items returned in the response. */
3123
+ count?: number | null;
3124
+ /** Cursor strings that point to the next page, previous page, or both. */
3125
+ cursors?: Cursors$1;
3126
+ /**
3127
+ * Whether there are more pages to retrieve following the current page.
3128
+ *
3129
+ * + `true`: Another page of results can be retrieved.
3130
+ * + `false`: This is the last page.
3131
+ */
3132
+ hasNext?: boolean | null;
3133
+ }
3134
+ interface Cursors$1 {
3135
+ /** Cursor string pointing to the next page in the list of results. */
3136
+ next?: string | null;
3137
+ /** Cursor pointing to the previous page in the list of results. */
3138
+ prev?: string | null;
3139
+ }
3140
+ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
3141
+ createdEvent?: EntityCreatedEvent$1;
3142
+ updatedEvent?: EntityUpdatedEvent$1;
3143
+ deletedEvent?: EntityDeletedEvent$1;
3144
+ actionEvent?: ActionEvent$1;
3145
+ /**
3146
+ * Unique event ID.
3147
+ * Allows clients to ignore duplicate webhooks.
3148
+ */
3149
+ _id?: string;
3150
+ /**
3151
+ * Assumes actions are also always typed to an entity_type
3152
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
3153
+ */
3154
+ entityFqdn?: string;
3155
+ /**
3156
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
3157
+ * This is although the created/updated/deleted notion is duplication of the oneof types
3158
+ * Example: created/updated/deleted/started/completed/email_opened
3159
+ */
3160
+ slug?: string;
3161
+ /** ID of the entity associated with the event. */
3162
+ entityId?: string;
3163
+ /** Event timestamp. */
3164
+ eventTime?: Date;
3165
+ /**
3166
+ * Whether the event was triggered as a result of a privacy regulation application
3167
+ * (for example, GDPR).
3168
+ */
3169
+ triggeredByAnonymizeRequest?: boolean | null;
3170
+ /** If present, indicates the action that triggered the event. */
3171
+ originatedFrom?: string | null;
3172
+ /**
3173
+ * A sequence number defining the order of updates to the underlying entity.
3174
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
3175
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
3176
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
3177
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
3178
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
3179
+ */
3180
+ entityEventSequence?: string | null;
3181
+ }
3182
+ /** @oneof */
3183
+ interface DomainEventBodyOneOf$1 {
3184
+ createdEvent?: EntityCreatedEvent$1;
3185
+ updatedEvent?: EntityUpdatedEvent$1;
3186
+ deletedEvent?: EntityDeletedEvent$1;
3187
+ actionEvent?: ActionEvent$1;
3188
+ }
3189
+ interface EntityCreatedEvent$1 {
3190
+ entity?: string;
3191
+ }
3192
+ interface UndeleteInfo$1 {
3193
+ deletedDate?: Date;
3194
+ }
3195
+ interface EntityUpdatedEvent$1 {
3196
+ /**
3197
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
3198
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
3199
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
3200
+ */
3201
+ currentEntity?: string;
3202
+ }
3203
+ interface EntityDeletedEvent$1 {
3204
+ /** Entity that was deleted */
3205
+ deletedEntity?: string | null;
3206
+ }
3207
+ interface ActionEvent$1 {
3208
+ body?: string;
3209
+ }
3210
+ interface Empty {
3211
+ }
3212
+ interface SuccessfulReferralEvent {
3213
+ /** ReferredFriend that completed his referral details. */
3214
+ referredFriendDetails?: ReferredFriendDetails;
3215
+ }
3216
+ interface ReferredFriendDetails {
3217
+ /**
3218
+ * ReferredFriend ID.
3219
+ * @readonly
3220
+ */
3221
+ referredFriendId?: string;
3222
+ /**
3223
+ * ReferredFriend Contact ID.
1061
3224
  * @readonly
1062
3225
  */
1063
- _createdDate?: Date;
3226
+ contactId?: string;
1064
3227
  /**
1065
- * Represents the time this ReferredFriend was last updated.
3228
+ * Customer who referred this ReferredFriend.
1066
3229
  * @readonly
1067
3230
  */
1068
- _updatedDate?: Date;
1069
- }
1070
- declare enum Status {
1071
- /** Unknown status. */
1072
- UNKNOWN = "UNKNOWN",
1073
- /** Initial status, when Referred friend joins site as member. */
1074
- SIGN_UP_COMPLETED = "SIGN_UP_COMPLETED",
1075
- /** After complete some actions (eg. Purchase Order), Action Completed Status is used. */
1076
- ACTIONS_COMPLETED = "ACTIONS_COMPLETED"
1077
- }
1078
- interface CreateReferredFriendResponse {
1079
- /** The created ReferredFriend. */
1080
- referredFriend?: ReferredFriend;
1081
- }
1082
- interface GetReferredFriendResponse {
1083
- /** The retrieved ReferredFriend. */
1084
- referredFriend?: ReferredFriend;
3231
+ referringCustomerId?: string;
1085
3232
  }
1086
- interface Cursors$1 {
1087
- /** Cursor string pointing to the next page in the list of results. */
1088
- next?: string | null;
1089
- /** Cursor pointing to the previous page in the list of results. */
1090
- prev?: string | null;
3233
+ interface MessageEnvelope$1 {
3234
+ /** App instance ID. */
3235
+ instanceId?: string | null;
3236
+ /** Event type. */
3237
+ eventType?: string;
3238
+ /** The identification type and identity data. */
3239
+ identity?: IdentificationData$1;
3240
+ /** Stringify payload. */
3241
+ data?: string;
1091
3242
  }
1092
3243
  interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
1093
3244
  /** ID of a site visitor that has not logged in to the site. */
@@ -1119,21 +3270,26 @@ declare enum WebhookIdentityType$1 {
1119
3270
  WIX_USER = "WIX_USER",
1120
3271
  APP = "APP"
1121
3272
  }
3273
+ interface ReferredFriendNonNullableFields {
3274
+ _id: string;
3275
+ contactId: string;
3276
+ referringCustomerId: string;
3277
+ status: Status;
3278
+ }
1122
3279
  interface CreateReferredFriendResponseNonNullableFields {
1123
- referredFriend?: {
1124
- _id: string;
1125
- contactId: string;
1126
- referringCustomerId: string;
1127
- status: Status;
1128
- };
3280
+ referredFriend?: ReferredFriendNonNullableFields;
1129
3281
  }
1130
3282
  interface GetReferredFriendResponseNonNullableFields {
1131
- referredFriend?: {
1132
- _id: string;
1133
- contactId: string;
1134
- referringCustomerId: string;
1135
- status: Status;
1136
- };
3283
+ referredFriend?: ReferredFriendNonNullableFields;
3284
+ }
3285
+ interface GetReferredFriendByContactIdResponseNonNullableFields {
3286
+ referredFriend?: ReferredFriendNonNullableFields;
3287
+ }
3288
+ interface UpdateReferredFriendResponseNonNullableFields {
3289
+ referredFriend?: ReferredFriendNonNullableFields;
3290
+ }
3291
+ interface QueryReferredFriendResponseNonNullableFields {
3292
+ referredFriends: ReferredFriendNonNullableFields[];
1137
3293
  }
1138
3294
  interface BaseEventMetadata$1 {
1139
3295
  /** App instance ID. */
@@ -1308,79 +3464,51 @@ interface ReferredFriendsQueryBuilder {
1308
3464
  find: () => Promise<ReferredFriendsQueryResult>;
1309
3465
  }
1310
3466
 
1311
- type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
1312
- interface HttpClient$1 {
1313
- request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
1314
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1315
- }
1316
- type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
1317
- type HttpResponse$1<T = any> = {
1318
- data: T;
1319
- status: number;
1320
- statusText: string;
1321
- headers: any;
1322
- request?: any;
1323
- };
1324
- type RequestOptions$1<_TResponse = any, Data = any> = {
1325
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
1326
- url: string;
1327
- data?: Data;
1328
- params?: URLSearchParams;
1329
- } & APIMetadata$1;
1330
- type APIMetadata$1 = {
1331
- methodFqn?: string;
1332
- entityFqdn?: string;
1333
- packageName?: string;
1334
- };
1335
- type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
1336
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
1337
- __type: 'event-definition';
1338
- type: Type;
1339
- isDomainEvent?: boolean;
1340
- transformations?: (envelope: unknown) => Payload;
1341
- __payload: Payload;
1342
- };
1343
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
1344
- type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
1345
- type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
1346
-
1347
- declare global {
1348
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1349
- interface SymbolConstructor {
1350
- readonly observable: symbol;
1351
- }
1352
- }
3467
+ declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1353
3468
 
1354
- declare function createReferredFriend$1(httpClient: HttpClient$1): () => Promise<CreateReferredFriendResponse & CreateReferredFriendResponseNonNullableFields>;
1355
- declare function getReferredFriend$1(httpClient: HttpClient$1): (referredFriendId: string) => Promise<GetReferredFriendResponse & GetReferredFriendResponseNonNullableFields>;
1356
- declare function getReferredFriendByContactId$1(httpClient: HttpClient$1): (contactId: string) => Promise<ReferredFriend & {
1357
- _id: string;
1358
- contactId: string;
1359
- referringCustomerId: string;
1360
- status: Status;
1361
- }>;
1362
- declare function updateReferredFriend$1(httpClient: HttpClient$1): (_id: string, referredFriend: UpdateReferredFriend) => Promise<ReferredFriend & {
1363
- _id: string;
1364
- contactId: string;
1365
- referringCustomerId: string;
1366
- status: Status;
1367
- }>;
1368
- declare function deleteReferredFriend$1(httpClient: HttpClient$1): (referredFriendId: string, options?: DeleteReferredFriendOptions) => Promise<void>;
1369
- declare function queryReferredFriend$1(httpClient: HttpClient$1): () => ReferredFriendsQueryBuilder;
1370
- declare const onReferredFriendCreated$1: EventDefinition$1<ReferredFriendCreatedEnvelope, "wix.loyalty.referral.v1.referred_friend_created">;
1371
- declare const onReferredFriendUpdated$1: EventDefinition$1<ReferredFriendUpdatedEnvelope, "wix.loyalty.referral.v1.referred_friend_updated">;
1372
- declare const onReferredFriendDeleted$1: EventDefinition$1<ReferredFriendDeletedEnvelope, "wix.loyalty.referral.v1.referred_friend_deleted">;
3469
+ declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1373
3470
 
1374
- declare const createReferredFriend: BuildRESTFunction$1<typeof createReferredFriend$1>;
1375
- declare const getReferredFriend: BuildRESTFunction$1<typeof getReferredFriend$1>;
1376
- declare const getReferredFriendByContactId: BuildRESTFunction$1<typeof getReferredFriendByContactId$1>;
1377
- declare const updateReferredFriend: BuildRESTFunction$1<typeof updateReferredFriend$1>;
1378
- declare const deleteReferredFriend: BuildRESTFunction$1<typeof deleteReferredFriend$1>;
1379
- declare const queryReferredFriend: BuildRESTFunction$1<typeof queryReferredFriend$1>;
1380
- declare const onReferredFriendCreated: BuildEventDefinition$1<typeof onReferredFriendCreated$1>;
1381
- declare const onReferredFriendUpdated: BuildEventDefinition$1<typeof onReferredFriendUpdated$1>;
1382
- declare const onReferredFriendDeleted: BuildEventDefinition$1<typeof onReferredFriendDeleted$1>;
3471
+ declare const createReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicCreateReferredFriend>>;
3472
+ declare const getReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicGetReferredFriend>>;
3473
+ declare const getReferredFriendByContactId: ReturnType<typeof createRESTModule$1<typeof publicGetReferredFriendByContactId>>;
3474
+ declare const updateReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicUpdateReferredFriend>>;
3475
+ declare const deleteReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicDeleteReferredFriend>>;
3476
+ declare const queryReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicQueryReferredFriend>>;
3477
+ declare const onReferredFriendCreated: ReturnType<typeof createEventModule$1<typeof publicOnReferredFriendCreated>>;
3478
+ declare const onReferredFriendUpdated: ReturnType<typeof createEventModule$1<typeof publicOnReferredFriendUpdated>>;
3479
+ declare const onReferredFriendDeleted: ReturnType<typeof createEventModule$1<typeof publicOnReferredFriendDeleted>>;
1383
3480
 
3481
+ type context$1_CreateReferredFriendRequest = CreateReferredFriendRequest;
3482
+ type context$1_CreateReferredFriendResponse = CreateReferredFriendResponse;
3483
+ type context$1_CreateReferredFriendResponseNonNullableFields = CreateReferredFriendResponseNonNullableFields;
3484
+ type context$1_DeleteReferredFriendOptions = DeleteReferredFriendOptions;
3485
+ type context$1_DeleteReferredFriendRequest = DeleteReferredFriendRequest;
3486
+ type context$1_DeleteReferredFriendResponse = DeleteReferredFriendResponse;
3487
+ type context$1_Empty = Empty;
3488
+ type context$1_GetReferredFriendByContactIdRequest = GetReferredFriendByContactIdRequest;
3489
+ type context$1_GetReferredFriendByContactIdResponse = GetReferredFriendByContactIdResponse;
3490
+ type context$1_GetReferredFriendByContactIdResponseNonNullableFields = GetReferredFriendByContactIdResponseNonNullableFields;
3491
+ type context$1_GetReferredFriendRequest = GetReferredFriendRequest;
3492
+ type context$1_GetReferredFriendResponse = GetReferredFriendResponse;
3493
+ type context$1_GetReferredFriendResponseNonNullableFields = GetReferredFriendResponseNonNullableFields;
3494
+ type context$1_QueryReferredFriendRequest = QueryReferredFriendRequest;
3495
+ type context$1_QueryReferredFriendResponse = QueryReferredFriendResponse;
3496
+ type context$1_QueryReferredFriendResponseNonNullableFields = QueryReferredFriendResponseNonNullableFields;
3497
+ type context$1_ReferredFriend = ReferredFriend;
3498
+ type context$1_ReferredFriendCreatedEnvelope = ReferredFriendCreatedEnvelope;
3499
+ type context$1_ReferredFriendDeletedEnvelope = ReferredFriendDeletedEnvelope;
3500
+ type context$1_ReferredFriendDetails = ReferredFriendDetails;
3501
+ type context$1_ReferredFriendNonNullableFields = ReferredFriendNonNullableFields;
3502
+ type context$1_ReferredFriendUpdatedEnvelope = ReferredFriendUpdatedEnvelope;
3503
+ type context$1_ReferredFriendsQueryBuilder = ReferredFriendsQueryBuilder;
3504
+ type context$1_ReferredFriendsQueryResult = ReferredFriendsQueryResult;
3505
+ type context$1_Status = Status;
3506
+ declare const context$1_Status: typeof Status;
3507
+ type context$1_SuccessfulReferralEvent = SuccessfulReferralEvent;
3508
+ type context$1_UpdateReferredFriend = UpdateReferredFriend;
3509
+ type context$1_UpdateReferredFriendRequest = UpdateReferredFriendRequest;
3510
+ type context$1_UpdateReferredFriendResponse = UpdateReferredFriendResponse;
3511
+ type context$1_UpdateReferredFriendResponseNonNullableFields = UpdateReferredFriendResponseNonNullableFields;
1384
3512
  declare const context$1_createReferredFriend: typeof createReferredFriend;
1385
3513
  declare const context$1_deleteReferredFriend: typeof deleteReferredFriend;
1386
3514
  declare const context$1_getReferredFriend: typeof getReferredFriend;
@@ -1391,7 +3519,7 @@ declare const context$1_onReferredFriendUpdated: typeof onReferredFriendUpdated;
1391
3519
  declare const context$1_queryReferredFriend: typeof queryReferredFriend;
1392
3520
  declare const context$1_updateReferredFriend: typeof updateReferredFriend;
1393
3521
  declare namespace context$1 {
1394
- export { context$1_createReferredFriend as createReferredFriend, context$1_deleteReferredFriend as deleteReferredFriend, context$1_getReferredFriend as getReferredFriend, context$1_getReferredFriendByContactId as getReferredFriendByContactId, context$1_onReferredFriendCreated as onReferredFriendCreated, context$1_onReferredFriendDeleted as onReferredFriendDeleted, context$1_onReferredFriendUpdated as onReferredFriendUpdated, context$1_queryReferredFriend as queryReferredFriend, context$1_updateReferredFriend as updateReferredFriend };
3522
+ export { type ActionEvent$1 as ActionEvent, type BaseEventMetadata$1 as BaseEventMetadata, type context$1_CreateReferredFriendRequest as CreateReferredFriendRequest, type context$1_CreateReferredFriendResponse as CreateReferredFriendResponse, type context$1_CreateReferredFriendResponseNonNullableFields as CreateReferredFriendResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type CursorPagingMetadata$1 as CursorPagingMetadata, type CursorQuery$1 as CursorQuery, type CursorQueryPagingMethodOneOf$1 as CursorQueryPagingMethodOneOf, type Cursors$1 as Cursors, type context$1_DeleteReferredFriendOptions as DeleteReferredFriendOptions, type context$1_DeleteReferredFriendRequest as DeleteReferredFriendRequest, type context$1_DeleteReferredFriendResponse as DeleteReferredFriendResponse, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type context$1_Empty as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type context$1_GetReferredFriendByContactIdRequest as GetReferredFriendByContactIdRequest, type context$1_GetReferredFriendByContactIdResponse as GetReferredFriendByContactIdResponse, type context$1_GetReferredFriendByContactIdResponseNonNullableFields as GetReferredFriendByContactIdResponseNonNullableFields, type context$1_GetReferredFriendRequest as GetReferredFriendRequest, type context$1_GetReferredFriendResponse as GetReferredFriendResponse, type context$1_GetReferredFriendResponseNonNullableFields as GetReferredFriendResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type MessageEnvelope$1 as MessageEnvelope, type context$1_QueryReferredFriendRequest as QueryReferredFriendRequest, type context$1_QueryReferredFriendResponse as QueryReferredFriendResponse, type context$1_QueryReferredFriendResponseNonNullableFields as QueryReferredFriendResponseNonNullableFields, type context$1_ReferredFriend as ReferredFriend, type context$1_ReferredFriendCreatedEnvelope as ReferredFriendCreatedEnvelope, type context$1_ReferredFriendDeletedEnvelope as ReferredFriendDeletedEnvelope, type context$1_ReferredFriendDetails as ReferredFriendDetails, type context$1_ReferredFriendNonNullableFields as ReferredFriendNonNullableFields, type context$1_ReferredFriendUpdatedEnvelope as ReferredFriendUpdatedEnvelope, type context$1_ReferredFriendsQueryBuilder as ReferredFriendsQueryBuilder, type context$1_ReferredFriendsQueryResult as ReferredFriendsQueryResult, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, context$1_Status as Status, type context$1_SuccessfulReferralEvent as SuccessfulReferralEvent, type UndeleteInfo$1 as UndeleteInfo, type context$1_UpdateReferredFriend as UpdateReferredFriend, type context$1_UpdateReferredFriendRequest as UpdateReferredFriendRequest, type context$1_UpdateReferredFriendResponse as UpdateReferredFriendResponse, type context$1_UpdateReferredFriendResponseNonNullableFields as UpdateReferredFriendResponseNonNullableFields, WebhookIdentityType$1 as WebhookIdentityType, context$1_createReferredFriend as createReferredFriend, context$1_deleteReferredFriend as deleteReferredFriend, context$1_getReferredFriend as getReferredFriend, context$1_getReferredFriendByContactId as getReferredFriendByContactId, context$1_onReferredFriendCreated as onReferredFriendCreated, context$1_onReferredFriendDeleted as onReferredFriendDeleted, context$1_onReferredFriendUpdated as onReferredFriendUpdated, context$1_queryReferredFriend as queryReferredFriend, context$1_updateReferredFriend as updateReferredFriend };
1395
3523
  }
1396
3524
 
1397
3525
  /** ReferringCustomer is the main entity of ReferringCustomers. */
@@ -1424,20 +3552,191 @@ interface ReferringCustomer {
1424
3552
  */
1425
3553
  _updatedDate?: Date;
1426
3554
  }
3555
+ interface GenerateReferringCustomerForContactRequest {
3556
+ /** Contact id or "me" to generate current identity's referring customer. */
3557
+ contactId: string;
3558
+ }
1427
3559
  interface GenerateReferringCustomerForContactResponse {
1428
3560
  /** The created ReferringCustomer. */
1429
3561
  referringCustomer?: ReferringCustomer;
1430
3562
  }
3563
+ interface GetReferringCustomerRequest {
3564
+ /** Id of the ReferringCustomer to retrieve. */
3565
+ referringCustomerId: string;
3566
+ }
3567
+ interface GetReferringCustomerResponse {
3568
+ /** The retrieved ReferringCustomer. */
3569
+ referringCustomer?: ReferringCustomer;
3570
+ }
3571
+ interface GetReferringCustomerByReferralCodeRequest {
3572
+ /** Referral Code of the ReferringCustomer to retrieve. */
3573
+ referralCode: string;
3574
+ }
1431
3575
  interface GetReferringCustomerByReferralCodeResponse {
1432
3576
  /** The retrieved ReferringCustomer. */
1433
3577
  referringCustomer?: ReferringCustomer;
1434
3578
  }
3579
+ interface QueryReferringCustomersRequest {
3580
+ /** Query options. */
3581
+ query: CursorQuery;
3582
+ }
3583
+ interface CursorQuery extends CursorQueryPagingMethodOneOf {
3584
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
3585
+ cursorPaging?: CursorPaging;
3586
+ /**
3587
+ * Filter object in the following format:
3588
+ * `"filter" : {
3589
+ * "fieldName1": "value1",
3590
+ * "fieldName2":{"$operator":"value2"}
3591
+ * }`
3592
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
3593
+ */
3594
+ filter?: Record<string, any> | null;
3595
+ /**
3596
+ * Sort object in the following format:
3597
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
3598
+ */
3599
+ sort?: Sorting[];
3600
+ }
3601
+ /** @oneof */
3602
+ interface CursorQueryPagingMethodOneOf {
3603
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
3604
+ cursorPaging?: CursorPaging;
3605
+ }
3606
+ interface Sorting {
3607
+ /** Name of the field to sort by. */
3608
+ fieldName?: string;
3609
+ /** Sort order. */
3610
+ order?: SortOrder;
3611
+ }
3612
+ declare enum SortOrder {
3613
+ ASC = "ASC",
3614
+ DESC = "DESC"
3615
+ }
3616
+ interface CursorPaging {
3617
+ /** Maximum number of items to return in the results. */
3618
+ limit?: number | null;
3619
+ /**
3620
+ * Pointer to the next or previous page in the list of results.
3621
+ *
3622
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
3623
+ * Not relevant for the first request.
3624
+ */
3625
+ cursor?: string | null;
3626
+ }
3627
+ interface QueryReferringCustomersResponse {
3628
+ /** The retrieved ReferringCustomers. */
3629
+ referringCustomers?: ReferringCustomer[];
3630
+ /** Paging metadata. */
3631
+ metadata?: CursorPagingMetadata;
3632
+ }
3633
+ interface CursorPagingMetadata {
3634
+ /** Number of items returned in the response. */
3635
+ count?: number | null;
3636
+ /** Cursor strings that point to the next page, previous page, or both. */
3637
+ cursors?: Cursors;
3638
+ /**
3639
+ * Whether there are more pages to retrieve following the current page.
3640
+ *
3641
+ * + `true`: Another page of results can be retrieved.
3642
+ * + `false`: This is the last page.
3643
+ */
3644
+ hasNext?: boolean | null;
3645
+ }
1435
3646
  interface Cursors {
1436
3647
  /** Cursor string pointing to the next page in the list of results. */
1437
3648
  next?: string | null;
1438
3649
  /** Cursor pointing to the previous page in the list of results. */
1439
3650
  prev?: string | null;
1440
3651
  }
3652
+ interface DeleteReferringCustomerRequest {
3653
+ /** Id of the ReferringCustomer to delete. */
3654
+ referringCustomerId: string;
3655
+ /** The revision of the ReferringCustomer. */
3656
+ revision?: string;
3657
+ }
3658
+ interface DeleteReferringCustomerResponse {
3659
+ }
3660
+ interface DomainEvent extends DomainEventBodyOneOf {
3661
+ createdEvent?: EntityCreatedEvent;
3662
+ updatedEvent?: EntityUpdatedEvent;
3663
+ deletedEvent?: EntityDeletedEvent;
3664
+ actionEvent?: ActionEvent;
3665
+ /**
3666
+ * Unique event ID.
3667
+ * Allows clients to ignore duplicate webhooks.
3668
+ */
3669
+ _id?: string;
3670
+ /**
3671
+ * Assumes actions are also always typed to an entity_type
3672
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
3673
+ */
3674
+ entityFqdn?: string;
3675
+ /**
3676
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
3677
+ * This is although the created/updated/deleted notion is duplication of the oneof types
3678
+ * Example: created/updated/deleted/started/completed/email_opened
3679
+ */
3680
+ slug?: string;
3681
+ /** ID of the entity associated with the event. */
3682
+ entityId?: string;
3683
+ /** Event timestamp. */
3684
+ eventTime?: Date;
3685
+ /**
3686
+ * Whether the event was triggered as a result of a privacy regulation application
3687
+ * (for example, GDPR).
3688
+ */
3689
+ triggeredByAnonymizeRequest?: boolean | null;
3690
+ /** If present, indicates the action that triggered the event. */
3691
+ originatedFrom?: string | null;
3692
+ /**
3693
+ * A sequence number defining the order of updates to the underlying entity.
3694
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
3695
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
3696
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
3697
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
3698
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
3699
+ */
3700
+ entityEventSequence?: string | null;
3701
+ }
3702
+ /** @oneof */
3703
+ interface DomainEventBodyOneOf {
3704
+ createdEvent?: EntityCreatedEvent;
3705
+ updatedEvent?: EntityUpdatedEvent;
3706
+ deletedEvent?: EntityDeletedEvent;
3707
+ actionEvent?: ActionEvent;
3708
+ }
3709
+ interface EntityCreatedEvent {
3710
+ entity?: string;
3711
+ }
3712
+ interface UndeleteInfo {
3713
+ deletedDate?: Date;
3714
+ }
3715
+ interface EntityUpdatedEvent {
3716
+ /**
3717
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
3718
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
3719
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
3720
+ */
3721
+ currentEntity?: string;
3722
+ }
3723
+ interface EntityDeletedEvent {
3724
+ /** Entity that was deleted */
3725
+ deletedEntity?: string | null;
3726
+ }
3727
+ interface ActionEvent {
3728
+ body?: string;
3729
+ }
3730
+ interface MessageEnvelope {
3731
+ /** App instance ID. */
3732
+ instanceId?: string | null;
3733
+ /** Event type. */
3734
+ eventType?: string;
3735
+ /** The identification type and identity data. */
3736
+ identity?: IdentificationData;
3737
+ /** Stringify payload. */
3738
+ data?: string;
3739
+ }
1441
3740
  interface IdentificationData extends IdentificationDataIdOneOf {
1442
3741
  /** ID of a site visitor that has not logged in to the site. */
1443
3742
  anonymousVisitorId?: string;
@@ -1468,19 +3767,22 @@ declare enum WebhookIdentityType {
1468
3767
  WIX_USER = "WIX_USER",
1469
3768
  APP = "APP"
1470
3769
  }
3770
+ interface ReferringCustomerNonNullableFields {
3771
+ _id: string;
3772
+ contactId: string;
3773
+ referralCode: string;
3774
+ }
1471
3775
  interface GenerateReferringCustomerForContactResponseNonNullableFields {
1472
- referringCustomer?: {
1473
- _id: string;
1474
- contactId: string;
1475
- referralCode: string;
1476
- };
3776
+ referringCustomer?: ReferringCustomerNonNullableFields;
3777
+ }
3778
+ interface GetReferringCustomerResponseNonNullableFields {
3779
+ referringCustomer?: ReferringCustomerNonNullableFields;
1477
3780
  }
1478
3781
  interface GetReferringCustomerByReferralCodeResponseNonNullableFields {
1479
- referringCustomer?: {
1480
- _id: string;
1481
- contactId: string;
1482
- referralCode: string;
1483
- };
3782
+ referringCustomer?: ReferringCustomerNonNullableFields;
3783
+ }
3784
+ interface QueryReferringCustomersResponseNonNullableFields {
3785
+ referringCustomers: ReferringCustomerNonNullableFields[];
1484
3786
  }
1485
3787
  interface BaseEventMetadata {
1486
3788
  /** App instance ID. */
@@ -1617,69 +3919,61 @@ interface DeleteReferringCustomerOptions {
1617
3919
  revision?: string;
1618
3920
  }
1619
3921
 
1620
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
1621
- interface HttpClient {
1622
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
1623
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1624
- }
1625
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
1626
- type HttpResponse<T = any> = {
1627
- data: T;
1628
- status: number;
1629
- statusText: string;
1630
- headers: any;
1631
- request?: any;
1632
- };
1633
- type RequestOptions<_TResponse = any, Data = any> = {
1634
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
1635
- url: string;
1636
- data?: Data;
1637
- params?: URLSearchParams;
1638
- } & APIMetadata;
1639
- type APIMetadata = {
1640
- methodFqn?: string;
1641
- entityFqdn?: string;
1642
- packageName?: string;
1643
- };
1644
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
1645
- type EventDefinition<Payload = unknown, Type extends string = string> = {
1646
- __type: 'event-definition';
1647
- type: Type;
1648
- isDomainEvent?: boolean;
1649
- transformations?: (envelope: unknown) => Payload;
1650
- __payload: Payload;
1651
- };
1652
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
1653
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
1654
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
1655
-
1656
- declare global {
1657
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1658
- interface SymbolConstructor {
1659
- readonly observable: symbol;
1660
- }
1661
- }
3922
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1662
3923
 
1663
- declare function generateReferringCustomerForContact$1(httpClient: HttpClient): (contactId: string) => Promise<GenerateReferringCustomerForContactResponse & GenerateReferringCustomerForContactResponseNonNullableFields>;
1664
- declare function getReferringCustomer$1(httpClient: HttpClient): (referringCustomerId: string) => Promise<ReferringCustomer & {
1665
- _id: string;
1666
- contactId: string;
1667
- referralCode: string;
1668
- }>;
1669
- declare function getReferringCustomerByReferralCode$1(httpClient: HttpClient): (referralCode: string) => Promise<GetReferringCustomerByReferralCodeResponse & GetReferringCustomerByReferralCodeResponseNonNullableFields>;
1670
- declare function queryReferringCustomers$1(httpClient: HttpClient): () => ReferringCustomersQueryBuilder;
1671
- declare function deleteReferringCustomer$1(httpClient: HttpClient): (referringCustomerId: string, options?: DeleteReferringCustomerOptions) => Promise<void>;
1672
- declare const onReferringCustomerCreated$1: EventDefinition<ReferringCustomerCreatedEnvelope, "wix.loyalty.referral.v1.referring_customer_created">;
1673
- declare const onReferringCustomerDeleted$1: EventDefinition<ReferringCustomerDeletedEnvelope, "wix.loyalty.referral.v1.referring_customer_deleted">;
3924
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1674
3925
 
1675
- declare const generateReferringCustomerForContact: BuildRESTFunction<typeof generateReferringCustomerForContact$1>;
1676
- declare const getReferringCustomer: BuildRESTFunction<typeof getReferringCustomer$1>;
1677
- declare const getReferringCustomerByReferralCode: BuildRESTFunction<typeof getReferringCustomerByReferralCode$1>;
1678
- declare const queryReferringCustomers: BuildRESTFunction<typeof queryReferringCustomers$1>;
1679
- declare const deleteReferringCustomer: BuildRESTFunction<typeof deleteReferringCustomer$1>;
1680
- declare const onReferringCustomerCreated: BuildEventDefinition<typeof onReferringCustomerCreated$1>;
1681
- declare const onReferringCustomerDeleted: BuildEventDefinition<typeof onReferringCustomerDeleted$1>;
3926
+ declare const generateReferringCustomerForContact: ReturnType<typeof createRESTModule<typeof publicGenerateReferringCustomerForContact>>;
3927
+ declare const getReferringCustomer: ReturnType<typeof createRESTModule<typeof publicGetReferringCustomer>>;
3928
+ declare const getReferringCustomerByReferralCode: ReturnType<typeof createRESTModule<typeof publicGetReferringCustomerByReferralCode>>;
3929
+ declare const queryReferringCustomers: ReturnType<typeof createRESTModule<typeof publicQueryReferringCustomers>>;
3930
+ declare const deleteReferringCustomer: ReturnType<typeof createRESTModule<typeof publicDeleteReferringCustomer>>;
3931
+ declare const onReferringCustomerCreated: ReturnType<typeof createEventModule<typeof publicOnReferringCustomerCreated>>;
3932
+ declare const onReferringCustomerDeleted: ReturnType<typeof createEventModule<typeof publicOnReferringCustomerDeleted>>;
1682
3933
 
3934
+ type context_ActionEvent = ActionEvent;
3935
+ type context_BaseEventMetadata = BaseEventMetadata;
3936
+ type context_CursorPaging = CursorPaging;
3937
+ type context_CursorPagingMetadata = CursorPagingMetadata;
3938
+ type context_CursorQuery = CursorQuery;
3939
+ type context_CursorQueryPagingMethodOneOf = CursorQueryPagingMethodOneOf;
3940
+ type context_Cursors = Cursors;
3941
+ type context_DeleteReferringCustomerOptions = DeleteReferringCustomerOptions;
3942
+ type context_DeleteReferringCustomerRequest = DeleteReferringCustomerRequest;
3943
+ type context_DeleteReferringCustomerResponse = DeleteReferringCustomerResponse;
3944
+ type context_DomainEvent = DomainEvent;
3945
+ type context_DomainEventBodyOneOf = DomainEventBodyOneOf;
3946
+ type context_EntityCreatedEvent = EntityCreatedEvent;
3947
+ type context_EntityDeletedEvent = EntityDeletedEvent;
3948
+ type context_EntityUpdatedEvent = EntityUpdatedEvent;
3949
+ type context_EventMetadata = EventMetadata;
3950
+ type context_GenerateReferringCustomerForContactRequest = GenerateReferringCustomerForContactRequest;
3951
+ type context_GenerateReferringCustomerForContactResponse = GenerateReferringCustomerForContactResponse;
3952
+ type context_GenerateReferringCustomerForContactResponseNonNullableFields = GenerateReferringCustomerForContactResponseNonNullableFields;
3953
+ type context_GetReferringCustomerByReferralCodeRequest = GetReferringCustomerByReferralCodeRequest;
3954
+ type context_GetReferringCustomerByReferralCodeResponse = GetReferringCustomerByReferralCodeResponse;
3955
+ type context_GetReferringCustomerByReferralCodeResponseNonNullableFields = GetReferringCustomerByReferralCodeResponseNonNullableFields;
3956
+ type context_GetReferringCustomerRequest = GetReferringCustomerRequest;
3957
+ type context_GetReferringCustomerResponse = GetReferringCustomerResponse;
3958
+ type context_GetReferringCustomerResponseNonNullableFields = GetReferringCustomerResponseNonNullableFields;
3959
+ type context_IdentificationData = IdentificationData;
3960
+ type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
3961
+ type context_MessageEnvelope = MessageEnvelope;
3962
+ type context_QueryReferringCustomersRequest = QueryReferringCustomersRequest;
3963
+ type context_QueryReferringCustomersResponse = QueryReferringCustomersResponse;
3964
+ type context_QueryReferringCustomersResponseNonNullableFields = QueryReferringCustomersResponseNonNullableFields;
3965
+ type context_ReferringCustomer = ReferringCustomer;
3966
+ type context_ReferringCustomerCreatedEnvelope = ReferringCustomerCreatedEnvelope;
3967
+ type context_ReferringCustomerDeletedEnvelope = ReferringCustomerDeletedEnvelope;
3968
+ type context_ReferringCustomerNonNullableFields = ReferringCustomerNonNullableFields;
3969
+ type context_ReferringCustomersQueryBuilder = ReferringCustomersQueryBuilder;
3970
+ type context_ReferringCustomersQueryResult = ReferringCustomersQueryResult;
3971
+ type context_SortOrder = SortOrder;
3972
+ declare const context_SortOrder: typeof SortOrder;
3973
+ type context_Sorting = Sorting;
3974
+ type context_UndeleteInfo = UndeleteInfo;
3975
+ type context_WebhookIdentityType = WebhookIdentityType;
3976
+ declare const context_WebhookIdentityType: typeof WebhookIdentityType;
1683
3977
  declare const context_deleteReferringCustomer: typeof deleteReferringCustomer;
1684
3978
  declare const context_generateReferringCustomerForContact: typeof generateReferringCustomerForContact;
1685
3979
  declare const context_getReferringCustomer: typeof getReferringCustomer;
@@ -1688,7 +3982,7 @@ declare const context_onReferringCustomerCreated: typeof onReferringCustomerCrea
1688
3982
  declare const context_onReferringCustomerDeleted: typeof onReferringCustomerDeleted;
1689
3983
  declare const context_queryReferringCustomers: typeof queryReferringCustomers;
1690
3984
  declare namespace context {
1691
- export { context_deleteReferringCustomer as deleteReferringCustomer, context_generateReferringCustomerForContact as generateReferringCustomerForContact, context_getReferringCustomer as getReferringCustomer, context_getReferringCustomerByReferralCode as getReferringCustomerByReferralCode, context_onReferringCustomerCreated as onReferringCustomerCreated, context_onReferringCustomerDeleted as onReferringCustomerDeleted, context_queryReferringCustomers as queryReferringCustomers };
3985
+ export { type context_ActionEvent as ActionEvent, type context_BaseEventMetadata as BaseEventMetadata, type context_CursorPaging as CursorPaging, type context_CursorPagingMetadata as CursorPagingMetadata, type context_CursorQuery as CursorQuery, type context_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type context_Cursors as Cursors, type context_DeleteReferringCustomerOptions as DeleteReferringCustomerOptions, type context_DeleteReferringCustomerRequest as DeleteReferringCustomerRequest, type context_DeleteReferringCustomerResponse as DeleteReferringCustomerResponse, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_GenerateReferringCustomerForContactRequest as GenerateReferringCustomerForContactRequest, type context_GenerateReferringCustomerForContactResponse as GenerateReferringCustomerForContactResponse, type context_GenerateReferringCustomerForContactResponseNonNullableFields as GenerateReferringCustomerForContactResponseNonNullableFields, type context_GetReferringCustomerByReferralCodeRequest as GetReferringCustomerByReferralCodeRequest, type context_GetReferringCustomerByReferralCodeResponse as GetReferringCustomerByReferralCodeResponse, type context_GetReferringCustomerByReferralCodeResponseNonNullableFields as GetReferringCustomerByReferralCodeResponseNonNullableFields, type context_GetReferringCustomerRequest as GetReferringCustomerRequest, type context_GetReferringCustomerResponse as GetReferringCustomerResponse, type context_GetReferringCustomerResponseNonNullableFields as GetReferringCustomerResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context_MessageEnvelope as MessageEnvelope, type context_QueryReferringCustomersRequest as QueryReferringCustomersRequest, type context_QueryReferringCustomersResponse as QueryReferringCustomersResponse, type context_QueryReferringCustomersResponseNonNullableFields as QueryReferringCustomersResponseNonNullableFields, type context_ReferringCustomer as ReferringCustomer, type context_ReferringCustomerCreatedEnvelope as ReferringCustomerCreatedEnvelope, type context_ReferringCustomerDeletedEnvelope as ReferringCustomerDeletedEnvelope, type context_ReferringCustomerNonNullableFields as ReferringCustomerNonNullableFields, type context_ReferringCustomersQueryBuilder as ReferringCustomersQueryBuilder, type context_ReferringCustomersQueryResult as ReferringCustomersQueryResult, context_SortOrder as SortOrder, type context_Sorting as Sorting, type context_UndeleteInfo as UndeleteInfo, context_WebhookIdentityType as WebhookIdentityType, context_deleteReferringCustomer as deleteReferringCustomer, context_generateReferringCustomerForContact as generateReferringCustomerForContact, context_getReferringCustomer as getReferringCustomer, context_getReferringCustomerByReferralCode as getReferringCustomerByReferralCode, context_onReferringCustomerCreated as onReferringCustomerCreated, context_onReferringCustomerDeleted as onReferringCustomerDeleted, context_queryReferringCustomers as queryReferringCustomers };
1692
3986
  }
1693
3987
 
1694
- export { context as customers, context$1 as friends, context$2 as rewards, context$3 as tracker };
3988
+ export { context as customers, context$1 as friends, context$4 as programs, context$2 as rewards, context$3 as tracker };