@wix/referral 1.0.6 → 1.0.8

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