@wix/referral 1.0.1 → 1.0.3

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