@wix/referral 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,7 @@ 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. */
@@ -196,26 +196,32 @@ interface QueryReferralProgramsRequest {
196
196
  query: CursorQuery$4;
197
197
  }
198
198
  interface CursorQuery$4 extends CursorQueryPagingMethodOneOf$4 {
199
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
199
+ /**
200
+ * Cursor paging options.
201
+ *
202
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
203
+ */
200
204
  cursorPaging?: CursorPaging$4;
201
205
  /**
202
- * Filter object in the following format:
203
- * `"filter" : {
204
- * "fieldName1": "value1",
205
- * "fieldName2":{"$operator":"value2"}
206
- * }`
207
- * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
206
+ * Filter object.
207
+ *
208
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
208
209
  */
209
210
  filter?: Record<string, any> | null;
210
211
  /**
211
- * Sort object in the following format:
212
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
212
+ * Sort object.
213
+ *
214
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
213
215
  */
214
216
  sort?: Sorting$4[];
215
217
  }
216
218
  /** @oneof */
217
219
  interface CursorQueryPagingMethodOneOf$4 {
218
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
220
+ /**
221
+ * Cursor paging options.
222
+ *
223
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
224
+ */
219
225
  cursorPaging?: CursorPaging$4;
220
226
  }
221
227
  interface Sorting$4 {
@@ -342,7 +348,7 @@ interface DomainEvent$4 extends DomainEventBodyOneOf$4 {
342
348
  slug?: string;
343
349
  /** ID of the entity associated with the event. */
344
350
  entityId?: string;
345
- /** Event timestamp. */
351
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
346
352
  eventTime?: Date;
347
353
  /**
348
354
  * Whether the event was triggered as a result of a privacy regulation application
@@ -371,7 +377,7 @@ interface DomainEventBodyOneOf$4 {
371
377
  interface EntityCreatedEvent$4 {
372
378
  entity?: string;
373
379
  }
374
- interface UndeleteInfo$4 {
380
+ interface RestoreInfo {
375
381
  deletedDate?: Date;
376
382
  }
377
383
  interface EntityUpdatedEvent$4 {
@@ -570,7 +576,9 @@ declare enum Namespace {
570
576
  * There's a blank site behind the scene but it's blank).
571
577
  * The Mobile company will be the owner of this namespace.
572
578
  */
573
- BRANDED_FIRST = "BRANDED_FIRST"
579
+ BRANDED_FIRST = "BRANDED_FIRST",
580
+ /** Nownia.com Siteless account management for Ai Scheduling Assistant. */
581
+ NOWNIA = "NOWNIA"
574
582
  }
575
583
  /** Site transferred to another user. */
576
584
  interface SiteTransferred {
@@ -1255,302 +1263,71 @@ declare enum WebhookIdentityType$4 {
1255
1263
  WIX_USER = "WIX_USER",
1256
1264
  APP = "APP"
1257
1265
  }
1266
+ interface FixedAmountDiscountNonNullableFields$2 {
1267
+ amount: number;
1268
+ }
1269
+ interface PercentageDiscountNonNullableFields$2 {
1270
+ percentage: number;
1271
+ }
1272
+ interface GroupNonNullableFields$2 {
1273
+ name: string;
1274
+ }
1275
+ interface CouponScopeNonNullableFields$2 {
1276
+ namespace: string;
1277
+ group?: GroupNonNullableFields$2;
1278
+ }
1279
+ interface CouponNonNullableFields$2 {
1280
+ fixedAmountOptions?: FixedAmountDiscountNonNullableFields$2;
1281
+ percentageOptions?: PercentageDiscountNonNullableFields$2;
1282
+ minimumSubtotal: number;
1283
+ scope?: CouponScopeNonNullableFields$2;
1284
+ name: string;
1285
+ discountType: DiscountType$2;
1286
+ }
1287
+ interface LoyaltyPointsNonNullableFields$1 {
1288
+ amount: number;
1289
+ }
1290
+ interface RewardNonNullableFields {
1291
+ couponOptions?: CouponNonNullableFields$2;
1292
+ loyaltyPointsOptions?: LoyaltyPointsNonNullableFields$1;
1293
+ type: Type$1;
1294
+ }
1295
+ interface EmailsNonNullableFields {
1296
+ encourageToReferFriends: App[];
1297
+ notifyCustomersAboutReward: boolean;
1298
+ }
1299
+ interface ReferralProgramNonNullableFields {
1300
+ status: ProgramStatus;
1301
+ referredFriendReward?: RewardNonNullableFields;
1302
+ referringCustomerReward?: RewardNonNullableFields;
1303
+ successfulReferralActions: Action[];
1304
+ isPremium: boolean;
1305
+ emails?: EmailsNonNullableFields;
1306
+ }
1258
1307
  interface GetReferralProgramResponseNonNullableFields {
1259
- referralProgram?: {
1260
- status: ProgramStatus;
1261
- referredFriendReward?: {
1262
- couponOptions?: {
1263
- fixedAmountOptions?: {
1264
- amount: number;
1265
- };
1266
- percentageOptions?: {
1267
- percentage: number;
1268
- };
1269
- minimumSubtotal: number;
1270
- scope?: {
1271
- namespace: string;
1272
- group?: {
1273
- name: string;
1274
- };
1275
- };
1276
- name: string;
1277
- discountType: DiscountType$2;
1278
- };
1279
- loyaltyPointsOptions?: {
1280
- amount: number;
1281
- };
1282
- type: Type$1;
1283
- };
1284
- referringCustomerReward?: {
1285
- couponOptions?: {
1286
- fixedAmountOptions?: {
1287
- amount: number;
1288
- };
1289
- percentageOptions?: {
1290
- percentage: number;
1291
- };
1292
- minimumSubtotal: number;
1293
- scope?: {
1294
- namespace: string;
1295
- group?: {
1296
- name: string;
1297
- };
1298
- };
1299
- name: string;
1300
- discountType: DiscountType$2;
1301
- };
1302
- loyaltyPointsOptions?: {
1303
- amount: number;
1304
- };
1305
- type: Type$1;
1306
- };
1307
- successfulReferralActions: Action[];
1308
- isPremium: boolean;
1309
- emails?: {
1310
- encourageToReferFriends: App[];
1311
- notifyCustomersAboutReward: boolean;
1312
- };
1313
- };
1308
+ referralProgram?: ReferralProgramNonNullableFields;
1314
1309
  }
1315
1310
  interface QueryReferralProgramsResponseNonNullableFields {
1316
- referralPrograms: {
1317
- status: ProgramStatus;
1318
- referredFriendReward?: {
1319
- couponOptions?: {
1320
- fixedAmountOptions?: {
1321
- amount: number;
1322
- };
1323
- percentageOptions?: {
1324
- percentage: number;
1325
- };
1326
- minimumSubtotal: number;
1327
- scope?: {
1328
- namespace: string;
1329
- group?: {
1330
- name: string;
1331
- };
1332
- };
1333
- name: string;
1334
- discountType: DiscountType$2;
1335
- };
1336
- loyaltyPointsOptions?: {
1337
- amount: number;
1338
- };
1339
- type: Type$1;
1340
- };
1341
- referringCustomerReward?: {
1342
- couponOptions?: {
1343
- fixedAmountOptions?: {
1344
- amount: number;
1345
- };
1346
- percentageOptions?: {
1347
- percentage: number;
1348
- };
1349
- minimumSubtotal: number;
1350
- scope?: {
1351
- namespace: string;
1352
- group?: {
1353
- name: string;
1354
- };
1355
- };
1356
- name: string;
1357
- discountType: DiscountType$2;
1358
- };
1359
- loyaltyPointsOptions?: {
1360
- amount: number;
1361
- };
1362
- type: Type$1;
1363
- };
1364
- successfulReferralActions: Action[];
1365
- isPremium: boolean;
1366
- emails?: {
1367
- encourageToReferFriends: App[];
1368
- notifyCustomersAboutReward: boolean;
1369
- };
1370
- }[];
1311
+ referralPrograms: ReferralProgramNonNullableFields[];
1371
1312
  }
1372
1313
  interface UpdateReferralProgramResponseNonNullableFields {
1373
- referralProgram?: {
1374
- status: ProgramStatus;
1375
- referredFriendReward?: {
1376
- couponOptions?: {
1377
- fixedAmountOptions?: {
1378
- amount: number;
1379
- };
1380
- percentageOptions?: {
1381
- percentage: number;
1382
- };
1383
- minimumSubtotal: number;
1384
- scope?: {
1385
- namespace: string;
1386
- group?: {
1387
- name: string;
1388
- };
1389
- };
1390
- name: string;
1391
- discountType: DiscountType$2;
1392
- };
1393
- loyaltyPointsOptions?: {
1394
- amount: number;
1395
- };
1396
- type: Type$1;
1397
- };
1398
- referringCustomerReward?: {
1399
- couponOptions?: {
1400
- fixedAmountOptions?: {
1401
- amount: number;
1402
- };
1403
- percentageOptions?: {
1404
- percentage: number;
1405
- };
1406
- minimumSubtotal: number;
1407
- scope?: {
1408
- namespace: string;
1409
- group?: {
1410
- name: string;
1411
- };
1412
- };
1413
- name: string;
1414
- discountType: DiscountType$2;
1415
- };
1416
- loyaltyPointsOptions?: {
1417
- amount: number;
1418
- };
1419
- type: Type$1;
1420
- };
1421
- successfulReferralActions: Action[];
1422
- isPremium: boolean;
1423
- emails?: {
1424
- encourageToReferFriends: App[];
1425
- notifyCustomersAboutReward: boolean;
1426
- };
1427
- };
1314
+ referralProgram?: ReferralProgramNonNullableFields;
1428
1315
  }
1429
1316
  interface ActivateReferralProgramResponseNonNullableFields {
1430
- referralProgram?: {
1431
- status: ProgramStatus;
1432
- referredFriendReward?: {
1433
- couponOptions?: {
1434
- fixedAmountOptions?: {
1435
- amount: number;
1436
- };
1437
- percentageOptions?: {
1438
- percentage: number;
1439
- };
1440
- minimumSubtotal: number;
1441
- scope?: {
1442
- namespace: string;
1443
- group?: {
1444
- name: string;
1445
- };
1446
- };
1447
- name: string;
1448
- discountType: DiscountType$2;
1449
- };
1450
- loyaltyPointsOptions?: {
1451
- amount: number;
1452
- };
1453
- type: Type$1;
1454
- };
1455
- referringCustomerReward?: {
1456
- couponOptions?: {
1457
- fixedAmountOptions?: {
1458
- amount: number;
1459
- };
1460
- percentageOptions?: {
1461
- percentage: number;
1462
- };
1463
- minimumSubtotal: number;
1464
- scope?: {
1465
- namespace: string;
1466
- group?: {
1467
- name: string;
1468
- };
1469
- };
1470
- name: string;
1471
- discountType: DiscountType$2;
1472
- };
1473
- loyaltyPointsOptions?: {
1474
- amount: number;
1475
- };
1476
- type: Type$1;
1477
- };
1478
- successfulReferralActions: Action[];
1479
- isPremium: boolean;
1480
- emails?: {
1481
- encourageToReferFriends: App[];
1482
- notifyCustomersAboutReward: boolean;
1483
- };
1484
- };
1317
+ referralProgram?: ReferralProgramNonNullableFields;
1485
1318
  }
1486
1319
  interface PauseReferralProgramResponseNonNullableFields {
1487
- referralProgram?: {
1488
- status: ProgramStatus;
1489
- referredFriendReward?: {
1490
- couponOptions?: {
1491
- fixedAmountOptions?: {
1492
- amount: number;
1493
- };
1494
- percentageOptions?: {
1495
- percentage: number;
1496
- };
1497
- minimumSubtotal: number;
1498
- scope?: {
1499
- namespace: string;
1500
- group?: {
1501
- name: string;
1502
- };
1503
- };
1504
- name: string;
1505
- discountType: DiscountType$2;
1506
- };
1507
- loyaltyPointsOptions?: {
1508
- amount: number;
1509
- };
1510
- type: Type$1;
1511
- };
1512
- referringCustomerReward?: {
1513
- couponOptions?: {
1514
- fixedAmountOptions?: {
1515
- amount: number;
1516
- };
1517
- percentageOptions?: {
1518
- percentage: number;
1519
- };
1520
- minimumSubtotal: number;
1521
- scope?: {
1522
- namespace: string;
1523
- group?: {
1524
- name: string;
1525
- };
1526
- };
1527
- name: string;
1528
- discountType: DiscountType$2;
1529
- };
1530
- loyaltyPointsOptions?: {
1531
- amount: number;
1532
- };
1533
- type: Type$1;
1534
- };
1535
- successfulReferralActions: Action[];
1536
- isPremium: boolean;
1537
- emails?: {
1538
- encourageToReferFriends: App[];
1539
- notifyCustomersAboutReward: boolean;
1540
- };
1541
- };
1320
+ referralProgram?: ReferralProgramNonNullableFields;
1321
+ }
1322
+ interface AISocialMediaPostSuggestionNonNullableFields {
1323
+ postContent: string;
1324
+ hashtags: string[];
1542
1325
  }
1543
1326
  interface GetAISocialMediaPostsSuggestionsResponseNonNullableFields {
1544
- suggestions: {
1545
- postContent: string;
1546
- hashtags: string[];
1547
- }[];
1327
+ suggestions: AISocialMediaPostSuggestionNonNullableFields[];
1548
1328
  }
1549
1329
  interface GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields {
1550
- suggestions: {
1551
- postContent: string;
1552
- hashtags: string[];
1553
- }[];
1330
+ suggestions: AISocialMediaPostSuggestionNonNullableFields[];
1554
1331
  }
1555
1332
  interface GetReferralProgramPremiumFeaturesResponseNonNullableFields {
1556
1333
  referralProgram: boolean;
@@ -1582,7 +1359,7 @@ interface EventMetadata$3 extends BaseEventMetadata$3 {
1582
1359
  slug?: string;
1583
1360
  /** ID of the entity associated with the event. */
1584
1361
  entityId?: string;
1585
- /** Event timestamp. */
1362
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1586
1363
  eventTime?: Date;
1587
1364
  /**
1588
1365
  * Whether the event was triggered as a result of a privacy regulation application
@@ -1639,37 +1416,42 @@ interface GenerateAiSocialMediaPostsSuggestionsOptions {
1639
1416
  topic?: string;
1640
1417
  }
1641
1418
 
1642
- interface HttpClient$4 {
1643
- request<TResponse, TData = any>(req: RequestOptionsFactory$4<TResponse, TData>): Promise<HttpResponse$4<TResponse>>;
1644
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1419
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
1420
+ interface HttpClient {
1421
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
1422
+ fetchWithAuth: typeof fetch;
1423
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
1645
1424
  }
1646
- type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
1647
- type HttpResponse$4<T = any> = {
1425
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
1426
+ type HttpResponse<T = any> = {
1648
1427
  data: T;
1649
1428
  status: number;
1650
1429
  statusText: string;
1651
1430
  headers: any;
1652
1431
  request?: any;
1653
1432
  };
1654
- type RequestOptions$4<_TResponse = any, Data = any> = {
1433
+ type RequestOptions<_TResponse = any, Data = any> = {
1655
1434
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
1656
1435
  url: string;
1657
1436
  data?: Data;
1658
1437
  params?: URLSearchParams;
1659
- } & APIMetadata$4;
1660
- type APIMetadata$4 = {
1438
+ } & APIMetadata;
1439
+ type APIMetadata = {
1661
1440
  methodFqn?: string;
1662
1441
  entityFqdn?: string;
1663
1442
  packageName?: string;
1664
1443
  };
1665
- type EventDefinition$3<Payload = unknown, Type extends string = string> = {
1444
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
1445
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
1666
1446
  __type: 'event-definition';
1667
1447
  type: Type;
1668
1448
  isDomainEvent?: boolean;
1669
1449
  transformations?: (envelope: unknown) => Payload;
1670
1450
  __payload: Payload;
1671
1451
  };
1672
- declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
1452
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
1453
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
1454
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
1673
1455
 
1674
1456
  declare global {
1675
1457
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -1678,18 +1460,19 @@ declare global {
1678
1460
  }
1679
1461
  }
1680
1462
 
1681
- declare const __metadata$4: {
1682
- PACKAGE_NAME: string;
1683
- };
1684
- declare function getReferralProgram(httpClient: HttpClient$4): () => Promise<GetReferralProgramResponse & GetReferralProgramResponseNonNullableFields>;
1685
- declare function queryReferralPrograms(httpClient: HttpClient$4): () => ReferralProgramsQueryBuilder;
1686
- declare function updateReferralProgram(httpClient: HttpClient$4): (referralProgram: ReferralProgram) => Promise<UpdateReferralProgramResponse & UpdateReferralProgramResponseNonNullableFields>;
1687
- declare function activateReferralProgram(httpClient: HttpClient$4): () => Promise<ActivateReferralProgramResponse & ActivateReferralProgramResponseNonNullableFields>;
1688
- declare function pauseReferralProgram(httpClient: HttpClient$4): () => Promise<PauseReferralProgramResponse & PauseReferralProgramResponseNonNullableFields>;
1689
- declare function getAiSocialMediaPostsSuggestions(httpClient: HttpClient$4): (options?: GetAiSocialMediaPostsSuggestionsOptions) => Promise<GetAISocialMediaPostsSuggestionsResponse & GetAISocialMediaPostsSuggestionsResponseNonNullableFields>;
1690
- declare function generateAiSocialMediaPostsSuggestions(httpClient: HttpClient$4): (options?: GenerateAiSocialMediaPostsSuggestionsOptions) => Promise<GenerateAISocialMediaPostsSuggestionsResponse & GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields>;
1691
- declare function getReferralProgramPremiumFeatures(httpClient: HttpClient$4): () => Promise<GetReferralProgramPremiumFeaturesResponse & GetReferralProgramPremiumFeaturesResponseNonNullableFields>;
1692
- declare const onProgramUpdated: EventDefinition$3<ProgramUpdatedEnvelope, "wix.loyalty.referral.v1.program_updated">;
1463
+ declare function createRESTModule$4<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1464
+
1465
+ declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1466
+
1467
+ declare const getReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicGetReferralProgram>>;
1468
+ declare const queryReferralPrograms: ReturnType<typeof createRESTModule$4<typeof publicQueryReferralPrograms>>;
1469
+ declare const updateReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicUpdateReferralProgram>>;
1470
+ declare const activateReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicActivateReferralProgram>>;
1471
+ declare const pauseReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicPauseReferralProgram>>;
1472
+ declare const getAiSocialMediaPostsSuggestions: ReturnType<typeof createRESTModule$4<typeof publicGetAiSocialMediaPostsSuggestions>>;
1473
+ declare const generateAiSocialMediaPostsSuggestions: ReturnType<typeof createRESTModule$4<typeof publicGenerateAiSocialMediaPostsSuggestions>>;
1474
+ declare const getReferralProgramPremiumFeatures: ReturnType<typeof createRESTModule$4<typeof publicGetReferralProgramPremiumFeatures>>;
1475
+ declare const onProgramUpdated: ReturnType<typeof createEventModule$3<typeof publicOnProgramUpdated>>;
1693
1476
 
1694
1477
  type index_d$4_AISocialMediaPostSuggestion = AISocialMediaPostSuggestion;
1695
1478
  type index_d$4_Action = Action;
@@ -1766,6 +1549,7 @@ type index_d$4_RecurringChargeSucceeded = RecurringChargeSucceeded;
1766
1549
  type index_d$4_ReferralProgram = ReferralProgram;
1767
1550
  type index_d$4_ReferralProgramsQueryBuilder = ReferralProgramsQueryBuilder;
1768
1551
  type index_d$4_ReferralProgramsQueryResult = ReferralProgramsQueryResult;
1552
+ type index_d$4_RestoreInfo = RestoreInfo;
1769
1553
  type index_d$4_ServiceProvisioned = ServiceProvisioned;
1770
1554
  type index_d$4_ServiceRemoved = ServiceRemoved;
1771
1555
  type index_d$4_SiteCreated = SiteCreated;
@@ -1813,7 +1597,7 @@ declare const index_d$4_pauseReferralProgram: typeof pauseReferralProgram;
1813
1597
  declare const index_d$4_queryReferralPrograms: typeof queryReferralPrograms;
1814
1598
  declare const index_d$4_updateReferralProgram: typeof updateReferralProgram;
1815
1599
  declare namespace index_d$4 {
1816
- export { type index_d$4_AISocialMediaPostSuggestion as AISocialMediaPostSuggestion, index_d$4_Action as Action, type ActionEvent$4 as ActionEvent, type index_d$4_ActivateReferralProgramRequest as ActivateReferralProgramRequest, type index_d$4_ActivateReferralProgramResponse as ActivateReferralProgramResponse, type index_d$4_ActivateReferralProgramResponseNonNullableFields as ActivateReferralProgramResponseNonNullableFields, index_d$4_App as App, type index_d$4_Asset as Asset, type BaseEventMetadata$3 as BaseEventMetadata, type index_d$4_BillingReference as BillingReference, type index_d$4_BulkGetReferralProgramRequest as BulkGetReferralProgramRequest, type index_d$4_BulkGetReferralProgramResponse as BulkGetReferralProgramResponse, type index_d$4_CancellationDetails as CancellationDetails, index_d$4_ContractSwitchReason as ContractSwitchReason, index_d$4_ContractSwitchType as ContractSwitchType, type index_d$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 index_d$4_Cycle as Cycle, type index_d$4_CycleCycleSelectorOneOf as CycleCycleSelectorOneOf, type index_d$4_DeleteContext as DeleteContext, index_d$4_DeleteStatus as DeleteStatus, DiscountType$2 as DiscountType, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type index_d$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 index_d$4_GenerateAISocialMediaPostsSuggestionsRequest as GenerateAISocialMediaPostsSuggestionsRequest, type index_d$4_GenerateAISocialMediaPostsSuggestionsResponse as GenerateAISocialMediaPostsSuggestionsResponse, type index_d$4_GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields as GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields, type index_d$4_GenerateAiSocialMediaPostsSuggestionsOptions as GenerateAiSocialMediaPostsSuggestionsOptions, type index_d$4_GetAISocialMediaPostsSuggestionsRequest as GetAISocialMediaPostsSuggestionsRequest, type index_d$4_GetAISocialMediaPostsSuggestionsResponse as GetAISocialMediaPostsSuggestionsResponse, type index_d$4_GetAISocialMediaPostsSuggestionsResponseNonNullableFields as GetAISocialMediaPostsSuggestionsResponseNonNullableFields, type index_d$4_GetAiSocialMediaPostsSuggestionsOptions as GetAiSocialMediaPostsSuggestionsOptions, type index_d$4_GetReferralProgramPremiumFeaturesRequest as GetReferralProgramPremiumFeaturesRequest, type index_d$4_GetReferralProgramPremiumFeaturesResponse as GetReferralProgramPremiumFeaturesResponse, type index_d$4_GetReferralProgramPremiumFeaturesResponseNonNullableFields as GetReferralProgramPremiumFeaturesResponseNonNullableFields, type index_d$4_GetReferralProgramRequest as GetReferralProgramRequest, type index_d$4_GetReferralProgramResponse as GetReferralProgramResponse, type index_d$4_GetReferralProgramResponseNonNullableFields as GetReferralProgramResponseNonNullableFields, type Group$2 as Group, type index_d$4_HtmlSitePublished as HtmlSitePublished, type IdentificationData$4 as IdentificationData, type IdentificationDataIdOneOf$4 as IdentificationDataIdOneOf, index_d$4_Initiator as Initiator, type index_d$4_Interval as Interval, index_d$4_IntervalUnit as IntervalUnit, type LoyaltyPoints$2 as LoyaltyPoints, type MessageEnvelope$4 as MessageEnvelope, type index_d$4_MetaSiteSpecialEvent as MetaSiteSpecialEvent, type index_d$4_MetaSiteSpecialEventPayloadOneOf as MetaSiteSpecialEventPayloadOneOf, index_d$4_Namespace as Namespace, type index_d$4_NamespaceChanged as NamespaceChanged, type index_d$4_OneTime as OneTime, type index_d$4_Page as Page, type index_d$4_PauseReferralProgramRequest as PauseReferralProgramRequest, type index_d$4_PauseReferralProgramResponse as PauseReferralProgramResponse, type index_d$4_PauseReferralProgramResponseNonNullableFields as PauseReferralProgramResponseNonNullableFields, type PercentageDiscount$2 as PercentageDiscount, index_d$4_PriceIncreaseTrigger as PriceIncreaseTrigger, index_d$4_ProductAdjustment as ProductAdjustment, type index_d$4_ProductPriceIncreaseData as ProductPriceIncreaseData, type index_d$4_ProgramInSite as ProgramInSite, index_d$4_ProgramStatus as ProgramStatus, type index_d$4_ProgramUpdatedEnvelope as ProgramUpdatedEnvelope, index_d$4_ProviderName as ProviderName, type index_d$4_QueryReferralProgramsRequest as QueryReferralProgramsRequest, type index_d$4_QueryReferralProgramsResponse as QueryReferralProgramsResponse, type index_d$4_QueryReferralProgramsResponseNonNullableFields as QueryReferralProgramsResponseNonNullableFields, type index_d$4_ReactivationData as ReactivationData, index_d$4_ReactivationReasonEnum as ReactivationReasonEnum, type index_d$4_RecurringChargeSucceeded as RecurringChargeSucceeded, type index_d$4_ReferralProgram as ReferralProgram, type index_d$4_ReferralProgramsQueryBuilder as ReferralProgramsQueryBuilder, type index_d$4_ReferralProgramsQueryResult as ReferralProgramsQueryResult, type Reward$2 as Reward, type RewardOptionsOneOf$1 as RewardOptionsOneOf, type index_d$4_ServiceProvisioned as ServiceProvisioned, type index_d$4_ServiceRemoved as ServiceRemoved, type index_d$4_SiteCreated as SiteCreated, index_d$4_SiteCreatedContext as SiteCreatedContext, type index_d$4_SiteDeleted as SiteDeleted, type index_d$4_SiteHardDeleted as SiteHardDeleted, type index_d$4_SiteMarkedAsTemplate as SiteMarkedAsTemplate, type index_d$4_SiteMarkedAsWixSite as SiteMarkedAsWixSite, type index_d$4_SitePublished as SitePublished, type index_d$4_SiteRenamed as SiteRenamed, type index_d$4_SiteTransferred as SiteTransferred, type index_d$4_SiteUndeleted as SiteUndeleted, type index_d$4_SiteUnpublished as SiteUnpublished, SortOrder$4 as SortOrder, type Sorting$4 as Sorting, index_d$4_State as State, type index_d$4_StudioAssigned as StudioAssigned, type index_d$4_StudioUnassigned as StudioUnassigned, type index_d$4_Subscription as Subscription, type index_d$4_SubscriptionAssigned as SubscriptionAssigned, type index_d$4_SubscriptionAutoRenewTurnedOff as SubscriptionAutoRenewTurnedOff, type index_d$4_SubscriptionAutoRenewTurnedOn as SubscriptionAutoRenewTurnedOn, type index_d$4_SubscriptionCancelled as SubscriptionCancelled, type index_d$4_SubscriptionCreated as SubscriptionCreated, type index_d$4_SubscriptionEvent as SubscriptionEvent, type index_d$4_SubscriptionEventEventOneOf as SubscriptionEventEventOneOf, type index_d$4_SubscriptionNearEndOfPeriod as SubscriptionNearEndOfPeriod, type index_d$4_SubscriptionPendingChange as SubscriptionPendingChange, index_d$4_SubscriptionStatus as SubscriptionStatus, type index_d$4_SubscriptionTransferred as SubscriptionTransferred, type index_d$4_SubscriptionUnassigned as SubscriptionUnassigned, Type$1 as Type, index_d$4_UnassignReason as UnassignReason, type UndeleteInfo$4 as UndeleteInfo, type index_d$4_UpdateReferralProgramRequest as UpdateReferralProgramRequest, type index_d$4_UpdateReferralProgramResponse as UpdateReferralProgramResponse, type index_d$4_UpdateReferralProgramResponseNonNullableFields as UpdateReferralProgramResponseNonNullableFields, WebhookIdentityType$4 as WebhookIdentityType, __metadata$4 as __metadata, index_d$4_activateReferralProgram as activateReferralProgram, index_d$4_generateAiSocialMediaPostsSuggestions as generateAiSocialMediaPostsSuggestions, index_d$4_getAiSocialMediaPostsSuggestions as getAiSocialMediaPostsSuggestions, index_d$4_getReferralProgram as getReferralProgram, index_d$4_getReferralProgramPremiumFeatures as getReferralProgramPremiumFeatures, index_d$4_onProgramUpdated as onProgramUpdated, index_d$4_pauseReferralProgram as pauseReferralProgram, index_d$4_queryReferralPrograms as queryReferralPrograms, index_d$4_updateReferralProgram as updateReferralProgram };
1600
+ export { type index_d$4_AISocialMediaPostSuggestion as AISocialMediaPostSuggestion, index_d$4_Action as Action, type ActionEvent$4 as ActionEvent, type index_d$4_ActivateReferralProgramRequest as ActivateReferralProgramRequest, type index_d$4_ActivateReferralProgramResponse as ActivateReferralProgramResponse, type index_d$4_ActivateReferralProgramResponseNonNullableFields as ActivateReferralProgramResponseNonNullableFields, index_d$4_App as App, type index_d$4_Asset as Asset, type BaseEventMetadata$3 as BaseEventMetadata, type index_d$4_BillingReference as BillingReference, type index_d$4_BulkGetReferralProgramRequest as BulkGetReferralProgramRequest, type index_d$4_BulkGetReferralProgramResponse as BulkGetReferralProgramResponse, type index_d$4_CancellationDetails as CancellationDetails, index_d$4_ContractSwitchReason as ContractSwitchReason, index_d$4_ContractSwitchType as ContractSwitchType, type index_d$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 index_d$4_Cycle as Cycle, type index_d$4_CycleCycleSelectorOneOf as CycleCycleSelectorOneOf, type index_d$4_DeleteContext as DeleteContext, index_d$4_DeleteStatus as DeleteStatus, DiscountType$2 as DiscountType, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type index_d$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 index_d$4_GenerateAISocialMediaPostsSuggestionsRequest as GenerateAISocialMediaPostsSuggestionsRequest, type index_d$4_GenerateAISocialMediaPostsSuggestionsResponse as GenerateAISocialMediaPostsSuggestionsResponse, type index_d$4_GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields as GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields, type index_d$4_GenerateAiSocialMediaPostsSuggestionsOptions as GenerateAiSocialMediaPostsSuggestionsOptions, type index_d$4_GetAISocialMediaPostsSuggestionsRequest as GetAISocialMediaPostsSuggestionsRequest, type index_d$4_GetAISocialMediaPostsSuggestionsResponse as GetAISocialMediaPostsSuggestionsResponse, type index_d$4_GetAISocialMediaPostsSuggestionsResponseNonNullableFields as GetAISocialMediaPostsSuggestionsResponseNonNullableFields, type index_d$4_GetAiSocialMediaPostsSuggestionsOptions as GetAiSocialMediaPostsSuggestionsOptions, type index_d$4_GetReferralProgramPremiumFeaturesRequest as GetReferralProgramPremiumFeaturesRequest, type index_d$4_GetReferralProgramPremiumFeaturesResponse as GetReferralProgramPremiumFeaturesResponse, type index_d$4_GetReferralProgramPremiumFeaturesResponseNonNullableFields as GetReferralProgramPremiumFeaturesResponseNonNullableFields, type index_d$4_GetReferralProgramRequest as GetReferralProgramRequest, type index_d$4_GetReferralProgramResponse as GetReferralProgramResponse, type index_d$4_GetReferralProgramResponseNonNullableFields as GetReferralProgramResponseNonNullableFields, type Group$2 as Group, type index_d$4_HtmlSitePublished as HtmlSitePublished, type IdentificationData$4 as IdentificationData, type IdentificationDataIdOneOf$4 as IdentificationDataIdOneOf, index_d$4_Initiator as Initiator, type index_d$4_Interval as Interval, index_d$4_IntervalUnit as IntervalUnit, type LoyaltyPoints$2 as LoyaltyPoints, type MessageEnvelope$4 as MessageEnvelope, type index_d$4_MetaSiteSpecialEvent as MetaSiteSpecialEvent, type index_d$4_MetaSiteSpecialEventPayloadOneOf as MetaSiteSpecialEventPayloadOneOf, index_d$4_Namespace as Namespace, type index_d$4_NamespaceChanged as NamespaceChanged, type index_d$4_OneTime as OneTime, type index_d$4_Page as Page, type index_d$4_PauseReferralProgramRequest as PauseReferralProgramRequest, type index_d$4_PauseReferralProgramResponse as PauseReferralProgramResponse, type index_d$4_PauseReferralProgramResponseNonNullableFields as PauseReferralProgramResponseNonNullableFields, type PercentageDiscount$2 as PercentageDiscount, index_d$4_PriceIncreaseTrigger as PriceIncreaseTrigger, index_d$4_ProductAdjustment as ProductAdjustment, type index_d$4_ProductPriceIncreaseData as ProductPriceIncreaseData, type index_d$4_ProgramInSite as ProgramInSite, index_d$4_ProgramStatus as ProgramStatus, type index_d$4_ProgramUpdatedEnvelope as ProgramUpdatedEnvelope, index_d$4_ProviderName as ProviderName, type index_d$4_QueryReferralProgramsRequest as QueryReferralProgramsRequest, type index_d$4_QueryReferralProgramsResponse as QueryReferralProgramsResponse, type index_d$4_QueryReferralProgramsResponseNonNullableFields as QueryReferralProgramsResponseNonNullableFields, type index_d$4_ReactivationData as ReactivationData, index_d$4_ReactivationReasonEnum as ReactivationReasonEnum, type index_d$4_RecurringChargeSucceeded as RecurringChargeSucceeded, type index_d$4_ReferralProgram as ReferralProgram, type index_d$4_ReferralProgramsQueryBuilder as ReferralProgramsQueryBuilder, type index_d$4_ReferralProgramsQueryResult as ReferralProgramsQueryResult, type index_d$4_RestoreInfo as RestoreInfo, type Reward$2 as Reward, type RewardOptionsOneOf$1 as RewardOptionsOneOf, type index_d$4_ServiceProvisioned as ServiceProvisioned, type index_d$4_ServiceRemoved as ServiceRemoved, type index_d$4_SiteCreated as SiteCreated, index_d$4_SiteCreatedContext as SiteCreatedContext, type index_d$4_SiteDeleted as SiteDeleted, type index_d$4_SiteHardDeleted as SiteHardDeleted, type index_d$4_SiteMarkedAsTemplate as SiteMarkedAsTemplate, type index_d$4_SiteMarkedAsWixSite as SiteMarkedAsWixSite, type index_d$4_SitePublished as SitePublished, type index_d$4_SiteRenamed as SiteRenamed, type index_d$4_SiteTransferred as SiteTransferred, type index_d$4_SiteUndeleted as SiteUndeleted, type index_d$4_SiteUnpublished as SiteUnpublished, SortOrder$4 as SortOrder, type Sorting$4 as Sorting, index_d$4_State as State, type index_d$4_StudioAssigned as StudioAssigned, type index_d$4_StudioUnassigned as StudioUnassigned, type index_d$4_Subscription as Subscription, type index_d$4_SubscriptionAssigned as SubscriptionAssigned, type index_d$4_SubscriptionAutoRenewTurnedOff as SubscriptionAutoRenewTurnedOff, type index_d$4_SubscriptionAutoRenewTurnedOn as SubscriptionAutoRenewTurnedOn, type index_d$4_SubscriptionCancelled as SubscriptionCancelled, type index_d$4_SubscriptionCreated as SubscriptionCreated, type index_d$4_SubscriptionEvent as SubscriptionEvent, type index_d$4_SubscriptionEventEventOneOf as SubscriptionEventEventOneOf, type index_d$4_SubscriptionNearEndOfPeriod as SubscriptionNearEndOfPeriod, type index_d$4_SubscriptionPendingChange as SubscriptionPendingChange, index_d$4_SubscriptionStatus as SubscriptionStatus, type index_d$4_SubscriptionTransferred as SubscriptionTransferred, type index_d$4_SubscriptionUnassigned as SubscriptionUnassigned, Type$1 as Type, index_d$4_UnassignReason as UnassignReason, type index_d$4_UpdateReferralProgramRequest as UpdateReferralProgramRequest, type index_d$4_UpdateReferralProgramResponse as UpdateReferralProgramResponse, type index_d$4_UpdateReferralProgramResponseNonNullableFields as UpdateReferralProgramResponseNonNullableFields, WebhookIdentityType$4 as WebhookIdentityType, index_d$4_activateReferralProgram as activateReferralProgram, index_d$4_generateAiSocialMediaPostsSuggestions as generateAiSocialMediaPostsSuggestions, index_d$4_getAiSocialMediaPostsSuggestions as getAiSocialMediaPostsSuggestions, index_d$4_getReferralProgram as getReferralProgram, index_d$4_getReferralProgramPremiumFeatures as getReferralProgramPremiumFeatures, index_d$4_onProgramUpdated as onProgramUpdated, index_d$4_pauseReferralProgram as pauseReferralProgram, index_d$4_queryReferralPrograms as queryReferralPrograms, index_d$4_updateReferralProgram as updateReferralProgram };
1817
1601
  }
1818
1602
 
1819
1603
  /** ReferralEvent. */
@@ -2390,108 +2174,98 @@ declare enum WebhookIdentityType$3 {
2390
2174
  WIX_USER = "WIX_USER",
2391
2175
  APP = "APP"
2392
2176
  }
2177
+ interface ReferredFriendSignupEventNonNullableFields {
2178
+ referredFriendId: string;
2179
+ }
2180
+ interface V1SuccessfulReferralEventNonNullableFields {
2181
+ referredFriendId: string;
2182
+ referringCustomerId: string;
2183
+ }
2184
+ interface V1TriggerNonNullableFields {
2185
+ appId: string;
2186
+ activityType: string;
2187
+ }
2188
+ interface V1ActionEventNonNullableFields {
2189
+ referredFriendId: string;
2190
+ referringCustomerId: string;
2191
+ trigger?: V1TriggerNonNullableFields;
2192
+ }
2193
+ interface RewardEventNonNullableFields {
2194
+ rewardedReferringCustomerId: string;
2195
+ rewardedReferredFriendId: string;
2196
+ referralRewardId: string;
2197
+ rewardType: Reward$1;
2198
+ }
2199
+ interface ReferralEventNonNullableFields {
2200
+ referredFriendSignupEvent?: ReferredFriendSignupEventNonNullableFields;
2201
+ successfulReferralEvent?: V1SuccessfulReferralEventNonNullableFields;
2202
+ actionEvent?: V1ActionEventNonNullableFields;
2203
+ rewardEvent?: RewardEventNonNullableFields;
2204
+ }
2393
2205
  interface GetReferralEventResponseNonNullableFields {
2394
- referralEvent?: {
2395
- referredFriendSignupEvent?: {
2396
- referredFriendId: string;
2397
- };
2398
- successfulReferralEvent?: {
2399
- referredFriendId: string;
2400
- referringCustomerId: string;
2401
- };
2402
- actionEvent?: {
2403
- referredFriendId: string;
2404
- referringCustomerId: string;
2405
- trigger?: {
2406
- appId: string;
2407
- activityType: string;
2408
- };
2409
- };
2410
- rewardEvent?: {
2411
- rewardedReferringCustomerId: string;
2412
- rewardedReferredFriendId: string;
2413
- referralRewardId: string;
2414
- rewardType: Reward$1;
2415
- };
2416
- };
2206
+ referralEvent?: ReferralEventNonNullableFields;
2417
2207
  }
2418
2208
  interface QueryReferralEventResponseNonNullableFields {
2419
- referralEvents: {
2420
- referredFriendSignupEvent?: {
2421
- referredFriendId: string;
2422
- };
2423
- successfulReferralEvent?: {
2424
- referredFriendId: string;
2425
- referringCustomerId: string;
2426
- };
2427
- actionEvent?: {
2428
- referredFriendId: string;
2429
- referringCustomerId: string;
2430
- trigger?: {
2431
- appId: string;
2432
- activityType: string;
2433
- };
2434
- };
2435
- rewardEvent?: {
2436
- rewardedReferringCustomerId: string;
2437
- rewardedReferredFriendId: string;
2438
- referralRewardId: string;
2439
- rewardType: Reward$1;
2440
- };
2441
- }[];
2209
+ referralEvents: ReferralEventNonNullableFields[];
2442
2210
  }
2443
2211
  interface GetReferralStatisticsResponseNonNullableFields {
2444
2212
  totalSignUpsCompleted: number;
2445
2213
  totalActionsCompleted: number;
2446
2214
  totalAmountGenerated: string;
2447
2215
  }
2216
+ interface ReferringCustomerTotalNonNullableFields {
2217
+ referringCustomerId: string;
2218
+ contactId: string;
2219
+ totalSuccessfulReferrals: number;
2220
+ totalAmountGenerated: string;
2221
+ totalFriendsWithActions: number;
2222
+ }
2448
2223
  interface QueryReferringCustomerTotalsResponseNonNullableFields {
2449
- referringCustomerTotals: {
2450
- referringCustomerId: string;
2451
- contactId: string;
2452
- totalSuccessfulReferrals: number;
2453
- totalAmountGenerated: string;
2454
- totalFriendsWithActions: number;
2455
- }[];
2224
+ referringCustomerTotals: ReferringCustomerTotalNonNullableFields[];
2225
+ }
2226
+ interface FixedAmountDiscountNonNullableFields$1 {
2227
+ amount: number;
2228
+ }
2229
+ interface PercentageDiscountNonNullableFields$1 {
2230
+ percentage: number;
2231
+ }
2232
+ interface GroupNonNullableFields$1 {
2233
+ name: string;
2234
+ }
2235
+ interface CouponScopeNonNullableFields$1 {
2236
+ namespace: string;
2237
+ group?: GroupNonNullableFields$1;
2238
+ }
2239
+ interface CouponNonNullableFields$1 {
2240
+ fixedAmountOptions?: FixedAmountDiscountNonNullableFields$1;
2241
+ percentageOptions?: PercentageDiscountNonNullableFields$1;
2242
+ minimumSubtotal: number;
2243
+ scope?: CouponScopeNonNullableFields$1;
2244
+ name: string;
2245
+ discountType: DiscountType$1;
2246
+ }
2247
+ interface V1CouponNonNullableFields$1 {
2248
+ _id: string;
2249
+ code: string;
2250
+ status: Status$2;
2251
+ couponSpecification?: CouponNonNullableFields$1;
2252
+ }
2253
+ interface LoyaltyPointsNonNullableFields {
2254
+ transactionId: string;
2255
+ amount: number;
2256
+ }
2257
+ interface ReferredFriendActionNonNullableFields {
2258
+ coupon?: V1CouponNonNullableFields$1;
2259
+ loyaltyPoints?: LoyaltyPointsNonNullableFields;
2260
+ referredFriendId: string;
2261
+ contactId: string;
2262
+ trigger?: V1TriggerNonNullableFields;
2263
+ rewardType: Reward$1;
2264
+ totalActions: number;
2265
+ totalAmountSpent: string;
2456
2266
  }
2457
2267
  interface QueryReferredFriendActionsResponseNonNullableFields {
2458
- referredFriendActions: {
2459
- coupon?: {
2460
- _id: string;
2461
- code: string;
2462
- status: Status$2;
2463
- couponSpecification?: {
2464
- fixedAmountOptions?: {
2465
- amount: number;
2466
- };
2467
- percentageOptions?: {
2468
- percentage: number;
2469
- };
2470
- minimumSubtotal: number;
2471
- scope?: {
2472
- namespace: string;
2473
- group?: {
2474
- name: string;
2475
- };
2476
- };
2477
- name: string;
2478
- discountType: DiscountType$1;
2479
- };
2480
- };
2481
- loyaltyPoints?: {
2482
- transactionId: string;
2483
- amount: number;
2484
- };
2485
- referredFriendId: string;
2486
- contactId: string;
2487
- trigger?: {
2488
- appId: string;
2489
- activityType: string;
2490
- };
2491
- rewardType: Reward$1;
2492
- totalActions: number;
2493
- totalAmountSpent: string;
2494
- }[];
2268
+ referredFriendActions: ReferredFriendActionNonNullableFields[];
2495
2269
  }
2496
2270
  interface BaseEventMetadata$2 {
2497
2271
  /** App instance ID. */
@@ -2628,76 +2402,16 @@ interface QueryReferredFriendActionsOptions {
2628
2402
  contactIds?: string[];
2629
2403
  }
2630
2404
 
2631
- interface HttpClient$3 {
2632
- request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
2633
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
2634
- }
2635
- type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
2636
- type HttpResponse$3<T = any> = {
2637
- data: T;
2638
- status: number;
2639
- statusText: string;
2640
- headers: any;
2641
- request?: any;
2642
- };
2643
- type RequestOptions$3<_TResponse = any, Data = any> = {
2644
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2645
- url: string;
2646
- data?: Data;
2647
- params?: URLSearchParams;
2648
- } & APIMetadata$3;
2649
- type APIMetadata$3 = {
2650
- methodFqn?: string;
2651
- entityFqdn?: string;
2652
- packageName?: string;
2653
- };
2654
- type EventDefinition$2<Payload = unknown, Type extends string = string> = {
2655
- __type: 'event-definition';
2656
- type: Type;
2657
- isDomainEvent?: boolean;
2658
- transformations?: (envelope: unknown) => Payload;
2659
- __payload: Payload;
2660
- };
2661
- declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
2405
+ declare function createRESTModule$3<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
2662
2406
 
2663
- declare global {
2664
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2665
- interface SymbolConstructor {
2666
- readonly observable: symbol;
2667
- }
2668
- }
2407
+ declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2669
2408
 
2670
- declare const __metadata$3: {
2671
- PACKAGE_NAME: string;
2672
- };
2673
- declare function getReferralEvent(httpClient: HttpClient$3): (referralEventId: string) => Promise<ReferralEvent & {
2674
- referredFriendSignupEvent?: {
2675
- referredFriendId: string;
2676
- } | undefined;
2677
- successfulReferralEvent?: {
2678
- referredFriendId: string;
2679
- referringCustomerId: string;
2680
- } | undefined;
2681
- actionEvent?: {
2682
- referredFriendId: string;
2683
- referringCustomerId: string;
2684
- trigger?: {
2685
- appId: string;
2686
- activityType: string;
2687
- } | undefined;
2688
- } | undefined;
2689
- rewardEvent?: {
2690
- rewardedReferringCustomerId: string;
2691
- rewardedReferredFriendId: string;
2692
- referralRewardId: string;
2693
- rewardType: Reward$1;
2694
- } | undefined;
2695
- }>;
2696
- declare function queryReferralEvent(httpClient: HttpClient$3): () => ReferralEventsQueryBuilder;
2697
- declare function getReferralStatistics(httpClient: HttpClient$3): () => Promise<GetReferralStatisticsResponse & GetReferralStatisticsResponseNonNullableFields>;
2698
- declare function queryReferringCustomerTotals(httpClient: HttpClient$3): (options?: QueryReferringCustomerTotalsOptions) => Promise<QueryReferringCustomerTotalsResponse & QueryReferringCustomerTotalsResponseNonNullableFields>;
2699
- declare function queryReferredFriendActions(httpClient: HttpClient$3): (options?: QueryReferredFriendActionsOptions) => Promise<QueryReferredFriendActionsResponse & QueryReferredFriendActionsResponseNonNullableFields>;
2700
- declare const onReferralEventCreated: EventDefinition$2<ReferralEventCreatedEnvelope, "wix.loyalty.referral.v1.referral_event_created">;
2409
+ declare const getReferralEvent: ReturnType<typeof createRESTModule$3<typeof publicGetReferralEvent>>;
2410
+ declare const queryReferralEvent: ReturnType<typeof createRESTModule$3<typeof publicQueryReferralEvent>>;
2411
+ declare const getReferralStatistics: ReturnType<typeof createRESTModule$3<typeof publicGetReferralStatistics>>;
2412
+ declare const queryReferringCustomerTotals: ReturnType<typeof createRESTModule$3<typeof publicQueryReferringCustomerTotals>>;
2413
+ declare const queryReferredFriendActions: ReturnType<typeof createRESTModule$3<typeof publicQueryReferredFriendActions>>;
2414
+ declare const onReferralEventCreated: ReturnType<typeof createEventModule$2<typeof publicOnReferralEventCreated>>;
2701
2415
 
2702
2416
  type index_d$3_CreateReferralEventRequest = CreateReferralEventRequest;
2703
2417
  type index_d$3_CreateReferralEventResponse = CreateReferralEventResponse;
@@ -2721,6 +2435,7 @@ type index_d$3_QueryReferringCustomerTotalsResponseNonNullableFields = QueryRefe
2721
2435
  type index_d$3_ReferralEvent = ReferralEvent;
2722
2436
  type index_d$3_ReferralEventCreatedEnvelope = ReferralEventCreatedEnvelope;
2723
2437
  type index_d$3_ReferralEventEventTypeOneOf = ReferralEventEventTypeOneOf;
2438
+ type index_d$3_ReferralEventNonNullableFields = ReferralEventNonNullableFields;
2724
2439
  type index_d$3_ReferralEventsQueryBuilder = ReferralEventsQueryBuilder;
2725
2440
  type index_d$3_ReferralEventsQueryResult = ReferralEventsQueryResult;
2726
2441
  type index_d$3_ReferredFriendAction = ReferredFriendAction;
@@ -2741,7 +2456,7 @@ declare const index_d$3_queryReferralEvent: typeof queryReferralEvent;
2741
2456
  declare const index_d$3_queryReferredFriendActions: typeof queryReferredFriendActions;
2742
2457
  declare const index_d$3_queryReferringCustomerTotals: typeof queryReferringCustomerTotals;
2743
2458
  declare namespace index_d$3 {
2744
- 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 index_d$3_CreateReferralEventRequest as CreateReferralEventRequest, type index_d$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 index_d$3_GetReferralEventRequest as GetReferralEventRequest, type index_d$3_GetReferralEventResponse as GetReferralEventResponse, type index_d$3_GetReferralEventResponseNonNullableFields as GetReferralEventResponseNonNullableFields, type index_d$3_GetReferralStatisticsRequest as GetReferralStatisticsRequest, type index_d$3_GetReferralStatisticsResponse as GetReferralStatisticsResponse, type index_d$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 index_d$3_QueryReferralEventRequest as QueryReferralEventRequest, type index_d$3_QueryReferralEventResponse as QueryReferralEventResponse, type index_d$3_QueryReferralEventResponseNonNullableFields as QueryReferralEventResponseNonNullableFields, type index_d$3_QueryReferredFriendActionsOptions as QueryReferredFriendActionsOptions, type index_d$3_QueryReferredFriendActionsRequest as QueryReferredFriendActionsRequest, type index_d$3_QueryReferredFriendActionsResponse as QueryReferredFriendActionsResponse, type index_d$3_QueryReferredFriendActionsResponseNonNullableFields as QueryReferredFriendActionsResponseNonNullableFields, type index_d$3_QueryReferringCustomerTotalsOptions as QueryReferringCustomerTotalsOptions, type index_d$3_QueryReferringCustomerTotalsRequest as QueryReferringCustomerTotalsRequest, type index_d$3_QueryReferringCustomerTotalsResponse as QueryReferringCustomerTotalsResponse, type index_d$3_QueryReferringCustomerTotalsResponseNonNullableFields as QueryReferringCustomerTotalsResponseNonNullableFields, type index_d$3_ReferralEvent as ReferralEvent, type index_d$3_ReferralEventCreatedEnvelope as ReferralEventCreatedEnvelope, type index_d$3_ReferralEventEventTypeOneOf as ReferralEventEventTypeOneOf, type index_d$3_ReferralEventsQueryBuilder as ReferralEventsQueryBuilder, type index_d$3_ReferralEventsQueryResult as ReferralEventsQueryResult, type index_d$3_ReferredFriendAction as ReferredFriendAction, type index_d$3_ReferredFriendActionEvent as ReferredFriendActionEvent, type index_d$3_ReferredFriendActionRewardTypeOptionsOneOf as ReferredFriendActionRewardTypeOptionsOneOf, type ReferredFriendDetails$2 as ReferredFriendDetails, type index_d$3_ReferredFriendSignupEvent as ReferredFriendSignupEvent, type index_d$3_ReferringCustomerTotal as ReferringCustomerTotal, Reward$1 as Reward, type index_d$3_RewardEvent as RewardEvent, type index_d$3_RewardEventReceiverOneOf as RewardEventReceiverOneOf, SortOrder$3 as SortOrder, type Sorting$3 as Sorting, Status$2 as Status, type SuccessfulReferralEvent$2 as SuccessfulReferralEvent, type index_d$3_Trigger as Trigger, type UndeleteInfo$3 as UndeleteInfo, type index_d$3_V1ActionEvent as V1ActionEvent, type V1Coupon$1 as V1Coupon, type index_d$3_V1SuccessfulReferralEvent as V1SuccessfulReferralEvent, type index_d$3_V1Trigger as V1Trigger, WebhookIdentityType$3 as WebhookIdentityType, __metadata$3 as __metadata, index_d$3_getReferralEvent as getReferralEvent, index_d$3_getReferralStatistics as getReferralStatistics, index_d$3_onReferralEventCreated as onReferralEventCreated, index_d$3_queryReferralEvent as queryReferralEvent, index_d$3_queryReferredFriendActions as queryReferredFriendActions, index_d$3_queryReferringCustomerTotals as queryReferringCustomerTotals };
2459
+ export { type ActionEvent$3 as ActionEvent, type BaseEventMetadata$2 as BaseEventMetadata, type Coupon$1 as Coupon, type CouponDiscountTypeOptionsOneOf$1 as CouponDiscountTypeOptionsOneOf, type CouponScope$1 as CouponScope, type CouponScopeOrMinSubtotalOneOf$1 as CouponScopeOrMinSubtotalOneOf, type index_d$3_CreateReferralEventRequest as CreateReferralEventRequest, type index_d$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 index_d$3_GetReferralEventRequest as GetReferralEventRequest, type index_d$3_GetReferralEventResponse as GetReferralEventResponse, type index_d$3_GetReferralEventResponseNonNullableFields as GetReferralEventResponseNonNullableFields, type index_d$3_GetReferralStatisticsRequest as GetReferralStatisticsRequest, type index_d$3_GetReferralStatisticsResponse as GetReferralStatisticsResponse, type index_d$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 index_d$3_QueryReferralEventRequest as QueryReferralEventRequest, type index_d$3_QueryReferralEventResponse as QueryReferralEventResponse, type index_d$3_QueryReferralEventResponseNonNullableFields as QueryReferralEventResponseNonNullableFields, type index_d$3_QueryReferredFriendActionsOptions as QueryReferredFriendActionsOptions, type index_d$3_QueryReferredFriendActionsRequest as QueryReferredFriendActionsRequest, type index_d$3_QueryReferredFriendActionsResponse as QueryReferredFriendActionsResponse, type index_d$3_QueryReferredFriendActionsResponseNonNullableFields as QueryReferredFriendActionsResponseNonNullableFields, type index_d$3_QueryReferringCustomerTotalsOptions as QueryReferringCustomerTotalsOptions, type index_d$3_QueryReferringCustomerTotalsRequest as QueryReferringCustomerTotalsRequest, type index_d$3_QueryReferringCustomerTotalsResponse as QueryReferringCustomerTotalsResponse, type index_d$3_QueryReferringCustomerTotalsResponseNonNullableFields as QueryReferringCustomerTotalsResponseNonNullableFields, type index_d$3_ReferralEvent as ReferralEvent, type index_d$3_ReferralEventCreatedEnvelope as ReferralEventCreatedEnvelope, type index_d$3_ReferralEventEventTypeOneOf as ReferralEventEventTypeOneOf, type index_d$3_ReferralEventNonNullableFields as ReferralEventNonNullableFields, type index_d$3_ReferralEventsQueryBuilder as ReferralEventsQueryBuilder, type index_d$3_ReferralEventsQueryResult as ReferralEventsQueryResult, type index_d$3_ReferredFriendAction as ReferredFriendAction, type index_d$3_ReferredFriendActionEvent as ReferredFriendActionEvent, type index_d$3_ReferredFriendActionRewardTypeOptionsOneOf as ReferredFriendActionRewardTypeOptionsOneOf, type ReferredFriendDetails$2 as ReferredFriendDetails, type index_d$3_ReferredFriendSignupEvent as ReferredFriendSignupEvent, type index_d$3_ReferringCustomerTotal as ReferringCustomerTotal, Reward$1 as Reward, type index_d$3_RewardEvent as RewardEvent, type index_d$3_RewardEventReceiverOneOf as RewardEventReceiverOneOf, SortOrder$3 as SortOrder, type Sorting$3 as Sorting, Status$2 as Status, type SuccessfulReferralEvent$2 as SuccessfulReferralEvent, type index_d$3_Trigger as Trigger, type UndeleteInfo$3 as UndeleteInfo, type index_d$3_V1ActionEvent as V1ActionEvent, type V1Coupon$1 as V1Coupon, type index_d$3_V1SuccessfulReferralEvent as V1SuccessfulReferralEvent, type index_d$3_V1Trigger as V1Trigger, WebhookIdentityType$3 as WebhookIdentityType, index_d$3_getReferralEvent as getReferralEvent, index_d$3_getReferralStatistics as getReferralStatistics, index_d$3_onReferralEventCreated as onReferralEventCreated, index_d$3_queryReferralEvent as queryReferralEvent, index_d$3_queryReferredFriendActions as queryReferredFriendActions, index_d$3_queryReferringCustomerTotals as queryReferringCustomerTotals };
2745
2460
  }
2746
2461
 
2747
2462
  /** ReferralReward is the main entity of ReferralRewards that can be used for lorem ipsum dolor */
@@ -3174,143 +2889,59 @@ declare enum WebhookIdentityType$2 {
3174
2889
  WIX_USER = "WIX_USER",
3175
2890
  APP = "APP"
3176
2891
  }
2892
+ interface FixedAmountDiscountNonNullableFields {
2893
+ amount: number;
2894
+ }
2895
+ interface PercentageDiscountNonNullableFields {
2896
+ percentage: number;
2897
+ }
2898
+ interface GroupNonNullableFields {
2899
+ name: string;
2900
+ }
2901
+ interface CouponScopeNonNullableFields {
2902
+ namespace: string;
2903
+ group?: GroupNonNullableFields;
2904
+ }
2905
+ interface CouponNonNullableFields {
2906
+ fixedAmountOptions?: FixedAmountDiscountNonNullableFields;
2907
+ percentageOptions?: PercentageDiscountNonNullableFields;
2908
+ minimumSubtotal: number;
2909
+ scope?: CouponScopeNonNullableFields;
2910
+ name: string;
2911
+ discountType: DiscountType;
2912
+ }
2913
+ interface V1CouponNonNullableFields {
2914
+ _id: string;
2915
+ code: string;
2916
+ status: Status$1;
2917
+ couponSpecification?: CouponNonNullableFields;
2918
+ }
2919
+ interface V1LoyaltyPointsNonNullableFields {
2920
+ transactionId: string;
2921
+ amount: number;
2922
+ }
2923
+ interface ReferralRewardNonNullableFields {
2924
+ rewardedReferringCustomerId: string;
2925
+ rewardedReferredFriendId: string;
2926
+ coupon?: V1CouponNonNullableFields;
2927
+ loyaltyPoints?: V1LoyaltyPointsNonNullableFields;
2928
+ rewardType: RewardTypeType;
2929
+ }
3177
2930
  interface GetReferralRewardResponseNonNullableFields {
3178
- referralReward?: {
3179
- rewardedReferringCustomerId: string;
3180
- rewardedReferredFriendId: string;
3181
- coupon?: {
3182
- _id: string;
3183
- code: string;
3184
- status: Status$1;
3185
- couponSpecification?: {
3186
- fixedAmountOptions?: {
3187
- amount: number;
3188
- };
3189
- percentageOptions?: {
3190
- percentage: number;
3191
- };
3192
- minimumSubtotal: number;
3193
- scope?: {
3194
- namespace: string;
3195
- group?: {
3196
- name: string;
3197
- };
3198
- };
3199
- name: string;
3200
- discountType: DiscountType;
3201
- };
3202
- };
3203
- loyaltyPoints?: {
3204
- transactionId: string;
3205
- amount: number;
3206
- };
3207
- rewardType: RewardTypeType;
3208
- };
2931
+ referralReward?: ReferralRewardNonNullableFields;
3209
2932
  }
3210
2933
  interface QueryReferralRewardsResponseNonNullableFields {
3211
- referralRewards: {
3212
- rewardedReferringCustomerId: string;
3213
- rewardedReferredFriendId: string;
3214
- coupon?: {
3215
- _id: string;
3216
- code: string;
3217
- status: Status$1;
3218
- couponSpecification?: {
3219
- fixedAmountOptions?: {
3220
- amount: number;
3221
- };
3222
- percentageOptions?: {
3223
- percentage: number;
3224
- };
3225
- minimumSubtotal: number;
3226
- scope?: {
3227
- namespace: string;
3228
- group?: {
3229
- name: string;
3230
- };
3231
- };
3232
- name: string;
3233
- discountType: DiscountType;
3234
- };
3235
- };
3236
- loyaltyPoints?: {
3237
- transactionId: string;
3238
- amount: number;
3239
- };
3240
- rewardType: RewardTypeType;
3241
- }[];
2934
+ referralRewards: ReferralRewardNonNullableFields[];
3242
2935
  }
3243
2936
  interface QueryReferralRewardsOptions {
3244
2937
  /** Filter by contact id or set to "me" for current identity's rewards. */
3245
2938
  contactId?: string | null;
3246
2939
  }
3247
2940
 
3248
- interface HttpClient$2 {
3249
- request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
3250
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
3251
- }
3252
- type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
3253
- type HttpResponse$2<T = any> = {
3254
- data: T;
3255
- status: number;
3256
- statusText: string;
3257
- headers: any;
3258
- request?: any;
3259
- };
3260
- type RequestOptions$2<_TResponse = any, Data = any> = {
3261
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
3262
- url: string;
3263
- data?: Data;
3264
- params?: URLSearchParams;
3265
- } & APIMetadata$2;
3266
- type APIMetadata$2 = {
3267
- methodFqn?: string;
3268
- entityFqdn?: string;
3269
- packageName?: string;
3270
- };
2941
+ declare function createRESTModule$2<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
3271
2942
 
3272
- declare global {
3273
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3274
- interface SymbolConstructor {
3275
- readonly observable: symbol;
3276
- }
3277
- }
3278
-
3279
- declare const __metadata$2: {
3280
- PACKAGE_NAME: string;
3281
- };
3282
- declare function getReferralReward(httpClient: HttpClient$2): (_id: string) => Promise<ReferralReward & {
3283
- rewardedReferringCustomerId: string;
3284
- rewardedReferredFriendId: string;
3285
- coupon?: {
3286
- _id: string;
3287
- code: string;
3288
- status: Status$1;
3289
- couponSpecification?: {
3290
- fixedAmountOptions?: {
3291
- amount: number;
3292
- } | undefined;
3293
- percentageOptions?: {
3294
- percentage: number;
3295
- } | undefined;
3296
- minimumSubtotal: number;
3297
- scope?: {
3298
- namespace: string;
3299
- group?: {
3300
- name: string;
3301
- } | undefined;
3302
- } | undefined;
3303
- name: string;
3304
- discountType: DiscountType;
3305
- } | undefined;
3306
- } | undefined;
3307
- loyaltyPoints?: {
3308
- transactionId: string;
3309
- amount: number;
3310
- } | undefined;
3311
- rewardType: RewardTypeType;
3312
- }>;
3313
- declare function queryReferralRewards(httpClient: HttpClient$2): (query: CursorQuery$2, options?: QueryReferralRewardsOptions) => Promise<QueryReferralRewardsResponse & QueryReferralRewardsResponseNonNullableFields>;
2943
+ declare const getReferralReward: ReturnType<typeof createRESTModule$2<typeof publicGetReferralReward>>;
2944
+ declare const queryReferralRewards: ReturnType<typeof createRESTModule$2<typeof publicQueryReferralRewards>>;
3314
2945
 
3315
2946
  type index_d$2_BulkGetReferralRewardsRequest = BulkGetReferralRewardsRequest;
3316
2947
  type index_d$2_BulkGetReferralRewardsResponse = BulkGetReferralRewardsResponse;
@@ -3332,6 +2963,7 @@ type index_d$2_QueryReferralRewardsRequest = QueryReferralRewardsRequest;
3332
2963
  type index_d$2_QueryReferralRewardsResponse = QueryReferralRewardsResponse;
3333
2964
  type index_d$2_QueryReferralRewardsResponseNonNullableFields = QueryReferralRewardsResponseNonNullableFields;
3334
2965
  type index_d$2_ReferralReward = ReferralReward;
2966
+ type index_d$2_ReferralRewardNonNullableFields = ReferralRewardNonNullableFields;
3335
2967
  type index_d$2_ReferralRewardReceiverOneOf = ReferralRewardReceiverOneOf;
3336
2968
  type index_d$2_ReferralRewardRewardTypeOptionsOneOf = ReferralRewardRewardTypeOptionsOneOf;
3337
2969
  type index_d$2_Reward = Reward;
@@ -3348,7 +2980,7 @@ type index_d$2_ValidateReferralRewardResponse = ValidateReferralRewardResponse;
3348
2980
  declare const index_d$2_getReferralReward: typeof getReferralReward;
3349
2981
  declare const index_d$2_queryReferralRewards: typeof queryReferralRewards;
3350
2982
  declare namespace index_d$2 {
3351
- export { type ActionEvent$2 as ActionEvent, type index_d$2_BulkGetReferralRewardsRequest as BulkGetReferralRewardsRequest, type index_d$2_BulkGetReferralRewardsResponse as BulkGetReferralRewardsResponse, type index_d$2_Coupon as Coupon, type index_d$2_CouponDiscountTypeOptionsOneOf as CouponDiscountTypeOptionsOneOf, type index_d$2_CouponScope as CouponScope, type index_d$2_CouponScopeOrMinSubtotalOneOf as CouponScopeOrMinSubtotalOneOf, type CursorPaging$2 as CursorPaging, type CursorPagingMetadata$2 as CursorPagingMetadata, type CursorQuery$2 as CursorQuery, type CursorQueryPagingMethodOneOf$2 as CursorQueryPagingMethodOneOf, type Cursors$2 as Cursors, index_d$2_DiscountType as DiscountType, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type index_d$2_FixedAmountDiscount as FixedAmountDiscount, type index_d$2_GetReferralRewardRequest as GetReferralRewardRequest, type index_d$2_GetReferralRewardResponse as GetReferralRewardResponse, type index_d$2_GetReferralRewardResponseNonNullableFields as GetReferralRewardResponseNonNullableFields, type index_d$2_Group as Group, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type index_d$2_LoyaltyPoints as LoyaltyPoints, type MessageEnvelope$2 as MessageEnvelope, type index_d$2_PercentageDiscount as PercentageDiscount, type index_d$2_QueryReferralRewardsOptions as QueryReferralRewardsOptions, type index_d$2_QueryReferralRewardsRequest as QueryReferralRewardsRequest, type index_d$2_QueryReferralRewardsResponse as QueryReferralRewardsResponse, type index_d$2_QueryReferralRewardsResponseNonNullableFields as QueryReferralRewardsResponseNonNullableFields, type index_d$2_ReferralReward as ReferralReward, type index_d$2_ReferralRewardReceiverOneOf as ReferralRewardReceiverOneOf, type index_d$2_ReferralRewardRewardTypeOptionsOneOf as ReferralRewardRewardTypeOptionsOneOf, type ReferredFriendDetails$1 as ReferredFriendDetails, type index_d$2_Reward as Reward, type index_d$2_RewardOptionsOneOf as RewardOptionsOneOf, index_d$2_RewardTypeType as RewardTypeType, type index_d$2_RewardsInSite as RewardsInSite, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, Status$1 as Status, type SuccessfulReferralEvent$1 as SuccessfulReferralEvent, index_d$2_Type as Type, type UndeleteInfo$2 as UndeleteInfo, type index_d$2_V1Coupon as V1Coupon, type index_d$2_V1LoyaltyPoints as V1LoyaltyPoints, type index_d$2_ValidateReferralRewardRequest as ValidateReferralRewardRequest, type index_d$2_ValidateReferralRewardResponse as ValidateReferralRewardResponse, WebhookIdentityType$2 as WebhookIdentityType, __metadata$2 as __metadata, index_d$2_getReferralReward as getReferralReward, index_d$2_queryReferralRewards as queryReferralRewards };
2983
+ export { type ActionEvent$2 as ActionEvent, type index_d$2_BulkGetReferralRewardsRequest as BulkGetReferralRewardsRequest, type index_d$2_BulkGetReferralRewardsResponse as BulkGetReferralRewardsResponse, type index_d$2_Coupon as Coupon, type index_d$2_CouponDiscountTypeOptionsOneOf as CouponDiscountTypeOptionsOneOf, type index_d$2_CouponScope as CouponScope, type index_d$2_CouponScopeOrMinSubtotalOneOf as CouponScopeOrMinSubtotalOneOf, type CursorPaging$2 as CursorPaging, type CursorPagingMetadata$2 as CursorPagingMetadata, type CursorQuery$2 as CursorQuery, type CursorQueryPagingMethodOneOf$2 as CursorQueryPagingMethodOneOf, type Cursors$2 as Cursors, index_d$2_DiscountType as DiscountType, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type index_d$2_FixedAmountDiscount as FixedAmountDiscount, type index_d$2_GetReferralRewardRequest as GetReferralRewardRequest, type index_d$2_GetReferralRewardResponse as GetReferralRewardResponse, type index_d$2_GetReferralRewardResponseNonNullableFields as GetReferralRewardResponseNonNullableFields, type index_d$2_Group as Group, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type index_d$2_LoyaltyPoints as LoyaltyPoints, type MessageEnvelope$2 as MessageEnvelope, type index_d$2_PercentageDiscount as PercentageDiscount, type index_d$2_QueryReferralRewardsOptions as QueryReferralRewardsOptions, type index_d$2_QueryReferralRewardsRequest as QueryReferralRewardsRequest, type index_d$2_QueryReferralRewardsResponse as QueryReferralRewardsResponse, type index_d$2_QueryReferralRewardsResponseNonNullableFields as QueryReferralRewardsResponseNonNullableFields, type index_d$2_ReferralReward as ReferralReward, type index_d$2_ReferralRewardNonNullableFields as ReferralRewardNonNullableFields, type index_d$2_ReferralRewardReceiverOneOf as ReferralRewardReceiverOneOf, type index_d$2_ReferralRewardRewardTypeOptionsOneOf as ReferralRewardRewardTypeOptionsOneOf, type ReferredFriendDetails$1 as ReferredFriendDetails, type index_d$2_Reward as Reward, type index_d$2_RewardOptionsOneOf as RewardOptionsOneOf, index_d$2_RewardTypeType as RewardTypeType, type index_d$2_RewardsInSite as RewardsInSite, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, Status$1 as Status, type SuccessfulReferralEvent$1 as SuccessfulReferralEvent, index_d$2_Type as Type, type UndeleteInfo$2 as UndeleteInfo, type index_d$2_V1Coupon as V1Coupon, type index_d$2_V1LoyaltyPoints as V1LoyaltyPoints, type index_d$2_ValidateReferralRewardRequest as ValidateReferralRewardRequest, type index_d$2_ValidateReferralRewardResponse as ValidateReferralRewardResponse, WebhookIdentityType$2 as WebhookIdentityType, index_d$2_getReferralReward as getReferralReward, index_d$2_queryReferralRewards as queryReferralRewards };
3352
2984
  }
3353
2985
 
3354
2986
  /** ReferredFriend is the main entity of ReferredFriends that can be used for lorem ipsum dolor */
@@ -3638,45 +3270,26 @@ declare enum WebhookIdentityType$1 {
3638
3270
  WIX_USER = "WIX_USER",
3639
3271
  APP = "APP"
3640
3272
  }
3273
+ interface ReferredFriendNonNullableFields {
3274
+ _id: string;
3275
+ contactId: string;
3276
+ referringCustomerId: string;
3277
+ status: Status;
3278
+ }
3641
3279
  interface CreateReferredFriendResponseNonNullableFields {
3642
- referredFriend?: {
3643
- _id: string;
3644
- contactId: string;
3645
- referringCustomerId: string;
3646
- status: Status;
3647
- };
3280
+ referredFriend?: ReferredFriendNonNullableFields;
3648
3281
  }
3649
3282
  interface GetReferredFriendResponseNonNullableFields {
3650
- referredFriend?: {
3651
- _id: string;
3652
- contactId: string;
3653
- referringCustomerId: string;
3654
- status: Status;
3655
- };
3283
+ referredFriend?: ReferredFriendNonNullableFields;
3656
3284
  }
3657
3285
  interface GetReferredFriendByContactIdResponseNonNullableFields {
3658
- referredFriend?: {
3659
- _id: string;
3660
- contactId: string;
3661
- referringCustomerId: string;
3662
- status: Status;
3663
- };
3286
+ referredFriend?: ReferredFriendNonNullableFields;
3664
3287
  }
3665
3288
  interface UpdateReferredFriendResponseNonNullableFields {
3666
- referredFriend?: {
3667
- _id: string;
3668
- contactId: string;
3669
- referringCustomerId: string;
3670
- status: Status;
3671
- };
3289
+ referredFriend?: ReferredFriendNonNullableFields;
3672
3290
  }
3673
3291
  interface QueryReferredFriendResponseNonNullableFields {
3674
- referredFriends: {
3675
- _id: string;
3676
- contactId: string;
3677
- referringCustomerId: string;
3678
- status: Status;
3679
- }[];
3292
+ referredFriends: ReferredFriendNonNullableFields[];
3680
3293
  }
3681
3294
  interface BaseEventMetadata$1 {
3682
3295
  /** App instance ID. */
@@ -3851,67 +3464,19 @@ interface ReferredFriendsQueryBuilder {
3851
3464
  find: () => Promise<ReferredFriendsQueryResult>;
3852
3465
  }
3853
3466
 
3854
- interface HttpClient$1 {
3855
- request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
3856
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
3857
- }
3858
- type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
3859
- type HttpResponse$1<T = any> = {
3860
- data: T;
3861
- status: number;
3862
- statusText: string;
3863
- headers: any;
3864
- request?: any;
3865
- };
3866
- type RequestOptions$1<_TResponse = any, Data = any> = {
3867
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
3868
- url: string;
3869
- data?: Data;
3870
- params?: URLSearchParams;
3871
- } & APIMetadata$1;
3872
- type APIMetadata$1 = {
3873
- methodFqn?: string;
3874
- entityFqdn?: string;
3875
- packageName?: string;
3876
- };
3877
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
3878
- __type: 'event-definition';
3879
- type: Type;
3880
- isDomainEvent?: boolean;
3881
- transformations?: (envelope: unknown) => Payload;
3882
- __payload: Payload;
3883
- };
3884
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
3467
+ declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
3885
3468
 
3886
- declare global {
3887
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3888
- interface SymbolConstructor {
3889
- readonly observable: symbol;
3890
- }
3891
- }
3469
+ declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
3892
3470
 
3893
- declare const __metadata$1: {
3894
- PACKAGE_NAME: string;
3895
- };
3896
- declare function createReferredFriend(httpClient: HttpClient$1): () => Promise<CreateReferredFriendResponse & CreateReferredFriendResponseNonNullableFields>;
3897
- declare function getReferredFriend(httpClient: HttpClient$1): (referredFriendId: string) => Promise<GetReferredFriendResponse & GetReferredFriendResponseNonNullableFields>;
3898
- declare function getReferredFriendByContactId(httpClient: HttpClient$1): (contactId: string) => Promise<ReferredFriend & {
3899
- _id: string;
3900
- contactId: string;
3901
- referringCustomerId: string;
3902
- status: Status;
3903
- }>;
3904
- declare function updateReferredFriend(httpClient: HttpClient$1): (_id: string, referredFriend: UpdateReferredFriend) => Promise<ReferredFriend & {
3905
- _id: string;
3906
- contactId: string;
3907
- referringCustomerId: string;
3908
- status: Status;
3909
- }>;
3910
- declare function deleteReferredFriend(httpClient: HttpClient$1): (referredFriendId: string, options?: DeleteReferredFriendOptions) => Promise<void>;
3911
- declare function queryReferredFriend(httpClient: HttpClient$1): () => ReferredFriendsQueryBuilder;
3912
- declare const onReferredFriendCreated: EventDefinition$1<ReferredFriendCreatedEnvelope, "wix.loyalty.referral.v1.referred_friend_created">;
3913
- declare const onReferredFriendUpdated: EventDefinition$1<ReferredFriendUpdatedEnvelope, "wix.loyalty.referral.v1.referred_friend_updated">;
3914
- declare const onReferredFriendDeleted: EventDefinition$1<ReferredFriendDeletedEnvelope, "wix.loyalty.referral.v1.referred_friend_deleted">;
3471
+ declare const createReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicCreateReferredFriend>>;
3472
+ declare const getReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicGetReferredFriend>>;
3473
+ declare const getReferredFriendByContactId: ReturnType<typeof createRESTModule$1<typeof publicGetReferredFriendByContactId>>;
3474
+ declare const updateReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicUpdateReferredFriend>>;
3475
+ declare const deleteReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicDeleteReferredFriend>>;
3476
+ declare const queryReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicQueryReferredFriend>>;
3477
+ declare const onReferredFriendCreated: ReturnType<typeof createEventModule$1<typeof publicOnReferredFriendCreated>>;
3478
+ declare const onReferredFriendUpdated: ReturnType<typeof createEventModule$1<typeof publicOnReferredFriendUpdated>>;
3479
+ declare const onReferredFriendDeleted: ReturnType<typeof createEventModule$1<typeof publicOnReferredFriendDeleted>>;
3915
3480
 
3916
3481
  type index_d$1_CreateReferredFriendRequest = CreateReferredFriendRequest;
3917
3482
  type index_d$1_CreateReferredFriendResponse = CreateReferredFriendResponse;
@@ -3933,6 +3498,7 @@ type index_d$1_ReferredFriend = ReferredFriend;
3933
3498
  type index_d$1_ReferredFriendCreatedEnvelope = ReferredFriendCreatedEnvelope;
3934
3499
  type index_d$1_ReferredFriendDeletedEnvelope = ReferredFriendDeletedEnvelope;
3935
3500
  type index_d$1_ReferredFriendDetails = ReferredFriendDetails;
3501
+ type index_d$1_ReferredFriendNonNullableFields = ReferredFriendNonNullableFields;
3936
3502
  type index_d$1_ReferredFriendUpdatedEnvelope = ReferredFriendUpdatedEnvelope;
3937
3503
  type index_d$1_ReferredFriendsQueryBuilder = ReferredFriendsQueryBuilder;
3938
3504
  type index_d$1_ReferredFriendsQueryResult = ReferredFriendsQueryResult;
@@ -3953,7 +3519,7 @@ declare const index_d$1_onReferredFriendUpdated: typeof onReferredFriendUpdated;
3953
3519
  declare const index_d$1_queryReferredFriend: typeof queryReferredFriend;
3954
3520
  declare const index_d$1_updateReferredFriend: typeof updateReferredFriend;
3955
3521
  declare namespace index_d$1 {
3956
- export { type ActionEvent$1 as ActionEvent, type BaseEventMetadata$1 as BaseEventMetadata, type index_d$1_CreateReferredFriendRequest as CreateReferredFriendRequest, type index_d$1_CreateReferredFriendResponse as CreateReferredFriendResponse, type index_d$1_CreateReferredFriendResponseNonNullableFields as CreateReferredFriendResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type CursorPagingMetadata$1 as CursorPagingMetadata, type CursorQuery$1 as CursorQuery, type CursorQueryPagingMethodOneOf$1 as CursorQueryPagingMethodOneOf, type Cursors$1 as Cursors, type index_d$1_DeleteReferredFriendOptions as DeleteReferredFriendOptions, type index_d$1_DeleteReferredFriendRequest as DeleteReferredFriendRequest, type index_d$1_DeleteReferredFriendResponse as DeleteReferredFriendResponse, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type index_d$1_Empty as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type index_d$1_GetReferredFriendByContactIdRequest as GetReferredFriendByContactIdRequest, type index_d$1_GetReferredFriendByContactIdResponse as GetReferredFriendByContactIdResponse, type index_d$1_GetReferredFriendByContactIdResponseNonNullableFields as GetReferredFriendByContactIdResponseNonNullableFields, type index_d$1_GetReferredFriendRequest as GetReferredFriendRequest, type index_d$1_GetReferredFriendResponse as GetReferredFriendResponse, type index_d$1_GetReferredFriendResponseNonNullableFields as GetReferredFriendResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type MessageEnvelope$1 as MessageEnvelope, type index_d$1_QueryReferredFriendRequest as QueryReferredFriendRequest, type index_d$1_QueryReferredFriendResponse as QueryReferredFriendResponse, type index_d$1_QueryReferredFriendResponseNonNullableFields as QueryReferredFriendResponseNonNullableFields, type index_d$1_ReferredFriend as ReferredFriend, type index_d$1_ReferredFriendCreatedEnvelope as ReferredFriendCreatedEnvelope, type index_d$1_ReferredFriendDeletedEnvelope as ReferredFriendDeletedEnvelope, type index_d$1_ReferredFriendDetails as ReferredFriendDetails, type index_d$1_ReferredFriendUpdatedEnvelope as ReferredFriendUpdatedEnvelope, type index_d$1_ReferredFriendsQueryBuilder as ReferredFriendsQueryBuilder, type index_d$1_ReferredFriendsQueryResult as ReferredFriendsQueryResult, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, index_d$1_Status as Status, type index_d$1_SuccessfulReferralEvent as SuccessfulReferralEvent, type UndeleteInfo$1 as UndeleteInfo, type index_d$1_UpdateReferredFriend as UpdateReferredFriend, type index_d$1_UpdateReferredFriendRequest as UpdateReferredFriendRequest, type index_d$1_UpdateReferredFriendResponse as UpdateReferredFriendResponse, type index_d$1_UpdateReferredFriendResponseNonNullableFields as UpdateReferredFriendResponseNonNullableFields, WebhookIdentityType$1 as WebhookIdentityType, __metadata$1 as __metadata, index_d$1_createReferredFriend as createReferredFriend, index_d$1_deleteReferredFriend as deleteReferredFriend, index_d$1_getReferredFriend as getReferredFriend, index_d$1_getReferredFriendByContactId as getReferredFriendByContactId, index_d$1_onReferredFriendCreated as onReferredFriendCreated, index_d$1_onReferredFriendDeleted as onReferredFriendDeleted, index_d$1_onReferredFriendUpdated as onReferredFriendUpdated, index_d$1_queryReferredFriend as queryReferredFriend, index_d$1_updateReferredFriend as updateReferredFriend };
3522
+ export { type ActionEvent$1 as ActionEvent, type BaseEventMetadata$1 as BaseEventMetadata, type index_d$1_CreateReferredFriendRequest as CreateReferredFriendRequest, type index_d$1_CreateReferredFriendResponse as CreateReferredFriendResponse, type index_d$1_CreateReferredFriendResponseNonNullableFields as CreateReferredFriendResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type CursorPagingMetadata$1 as CursorPagingMetadata, type CursorQuery$1 as CursorQuery, type CursorQueryPagingMethodOneOf$1 as CursorQueryPagingMethodOneOf, type Cursors$1 as Cursors, type index_d$1_DeleteReferredFriendOptions as DeleteReferredFriendOptions, type index_d$1_DeleteReferredFriendRequest as DeleteReferredFriendRequest, type index_d$1_DeleteReferredFriendResponse as DeleteReferredFriendResponse, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type index_d$1_Empty as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type index_d$1_GetReferredFriendByContactIdRequest as GetReferredFriendByContactIdRequest, type index_d$1_GetReferredFriendByContactIdResponse as GetReferredFriendByContactIdResponse, type index_d$1_GetReferredFriendByContactIdResponseNonNullableFields as GetReferredFriendByContactIdResponseNonNullableFields, type index_d$1_GetReferredFriendRequest as GetReferredFriendRequest, type index_d$1_GetReferredFriendResponse as GetReferredFriendResponse, type index_d$1_GetReferredFriendResponseNonNullableFields as GetReferredFriendResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type MessageEnvelope$1 as MessageEnvelope, type index_d$1_QueryReferredFriendRequest as QueryReferredFriendRequest, type index_d$1_QueryReferredFriendResponse as QueryReferredFriendResponse, type index_d$1_QueryReferredFriendResponseNonNullableFields as QueryReferredFriendResponseNonNullableFields, type index_d$1_ReferredFriend as ReferredFriend, type index_d$1_ReferredFriendCreatedEnvelope as ReferredFriendCreatedEnvelope, type index_d$1_ReferredFriendDeletedEnvelope as ReferredFriendDeletedEnvelope, type index_d$1_ReferredFriendDetails as ReferredFriendDetails, type index_d$1_ReferredFriendNonNullableFields as ReferredFriendNonNullableFields, type index_d$1_ReferredFriendUpdatedEnvelope as ReferredFriendUpdatedEnvelope, type index_d$1_ReferredFriendsQueryBuilder as ReferredFriendsQueryBuilder, type index_d$1_ReferredFriendsQueryResult as ReferredFriendsQueryResult, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, index_d$1_Status as Status, type index_d$1_SuccessfulReferralEvent as SuccessfulReferralEvent, type UndeleteInfo$1 as UndeleteInfo, type index_d$1_UpdateReferredFriend as UpdateReferredFriend, type index_d$1_UpdateReferredFriendRequest as UpdateReferredFriendRequest, type index_d$1_UpdateReferredFriendResponse as UpdateReferredFriendResponse, type index_d$1_UpdateReferredFriendResponseNonNullableFields as UpdateReferredFriendResponseNonNullableFields, WebhookIdentityType$1 as WebhookIdentityType, index_d$1_createReferredFriend as createReferredFriend, index_d$1_deleteReferredFriend as deleteReferredFriend, index_d$1_getReferredFriend as getReferredFriend, index_d$1_getReferredFriendByContactId as getReferredFriendByContactId, index_d$1_onReferredFriendCreated as onReferredFriendCreated, index_d$1_onReferredFriendDeleted as onReferredFriendDeleted, index_d$1_onReferredFriendUpdated as onReferredFriendUpdated, index_d$1_queryReferredFriend as queryReferredFriend, index_d$1_updateReferredFriend as updateReferredFriend };
3957
3523
  }
3958
3524
 
3959
3525
  /** ReferringCustomer is the main entity of ReferringCustomers. */
@@ -4201,33 +3767,22 @@ declare enum WebhookIdentityType {
4201
3767
  WIX_USER = "WIX_USER",
4202
3768
  APP = "APP"
4203
3769
  }
3770
+ interface ReferringCustomerNonNullableFields {
3771
+ _id: string;
3772
+ contactId: string;
3773
+ referralCode: string;
3774
+ }
4204
3775
  interface GenerateReferringCustomerForContactResponseNonNullableFields {
4205
- referringCustomer?: {
4206
- _id: string;
4207
- contactId: string;
4208
- referralCode: string;
4209
- };
3776
+ referringCustomer?: ReferringCustomerNonNullableFields;
4210
3777
  }
4211
3778
  interface GetReferringCustomerResponseNonNullableFields {
4212
- referringCustomer?: {
4213
- _id: string;
4214
- contactId: string;
4215
- referralCode: string;
4216
- };
3779
+ referringCustomer?: ReferringCustomerNonNullableFields;
4217
3780
  }
4218
3781
  interface GetReferringCustomerByReferralCodeResponseNonNullableFields {
4219
- referringCustomer?: {
4220
- _id: string;
4221
- contactId: string;
4222
- referralCode: string;
4223
- };
3782
+ referringCustomer?: ReferringCustomerNonNullableFields;
4224
3783
  }
4225
3784
  interface QueryReferringCustomersResponseNonNullableFields {
4226
- referringCustomers: {
4227
- _id: string;
4228
- contactId: string;
4229
- referralCode: string;
4230
- }[];
3785
+ referringCustomers: ReferringCustomerNonNullableFields[];
4231
3786
  }
4232
3787
  interface BaseEventMetadata {
4233
3788
  /** App instance ID. */
@@ -4364,59 +3919,17 @@ interface DeleteReferringCustomerOptions {
4364
3919
  revision?: string;
4365
3920
  }
4366
3921
 
4367
- interface HttpClient {
4368
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
4369
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
4370
- }
4371
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
4372
- type HttpResponse<T = any> = {
4373
- data: T;
4374
- status: number;
4375
- statusText: string;
4376
- headers: any;
4377
- request?: any;
4378
- };
4379
- type RequestOptions<_TResponse = any, Data = any> = {
4380
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
4381
- url: string;
4382
- data?: Data;
4383
- params?: URLSearchParams;
4384
- } & APIMetadata;
4385
- type APIMetadata = {
4386
- methodFqn?: string;
4387
- entityFqdn?: string;
4388
- packageName?: string;
4389
- };
4390
- type EventDefinition<Payload = unknown, Type extends string = string> = {
4391
- __type: 'event-definition';
4392
- type: Type;
4393
- isDomainEvent?: boolean;
4394
- transformations?: (envelope: unknown) => Payload;
4395
- __payload: Payload;
4396
- };
4397
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
3922
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
4398
3923
 
4399
- declare global {
4400
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
4401
- interface SymbolConstructor {
4402
- readonly observable: symbol;
4403
- }
4404
- }
3924
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
4405
3925
 
4406
- declare const __metadata: {
4407
- PACKAGE_NAME: string;
4408
- };
4409
- declare function generateReferringCustomerForContact(httpClient: HttpClient): (contactId: string) => Promise<GenerateReferringCustomerForContactResponse & GenerateReferringCustomerForContactResponseNonNullableFields>;
4410
- declare function getReferringCustomer(httpClient: HttpClient): (referringCustomerId: string) => Promise<ReferringCustomer & {
4411
- _id: string;
4412
- contactId: string;
4413
- referralCode: string;
4414
- }>;
4415
- declare function getReferringCustomerByReferralCode(httpClient: HttpClient): (referralCode: string) => Promise<GetReferringCustomerByReferralCodeResponse & GetReferringCustomerByReferralCodeResponseNonNullableFields>;
4416
- declare function queryReferringCustomers(httpClient: HttpClient): () => ReferringCustomersQueryBuilder;
4417
- declare function deleteReferringCustomer(httpClient: HttpClient): (referringCustomerId: string, options?: DeleteReferringCustomerOptions) => Promise<void>;
4418
- declare const onReferringCustomerCreated: EventDefinition<ReferringCustomerCreatedEnvelope, "wix.loyalty.referral.v1.referring_customer_created">;
4419
- declare const onReferringCustomerDeleted: EventDefinition<ReferringCustomerDeletedEnvelope, "wix.loyalty.referral.v1.referring_customer_deleted">;
3926
+ declare const generateReferringCustomerForContact: ReturnType<typeof createRESTModule<typeof publicGenerateReferringCustomerForContact>>;
3927
+ declare const getReferringCustomer: ReturnType<typeof createRESTModule<typeof publicGetReferringCustomer>>;
3928
+ declare const getReferringCustomerByReferralCode: ReturnType<typeof createRESTModule<typeof publicGetReferringCustomerByReferralCode>>;
3929
+ declare const queryReferringCustomers: ReturnType<typeof createRESTModule<typeof publicQueryReferringCustomers>>;
3930
+ declare const deleteReferringCustomer: ReturnType<typeof createRESTModule<typeof publicDeleteReferringCustomer>>;
3931
+ declare const onReferringCustomerCreated: ReturnType<typeof createEventModule<typeof publicOnReferringCustomerCreated>>;
3932
+ declare const onReferringCustomerDeleted: ReturnType<typeof createEventModule<typeof publicOnReferringCustomerDeleted>>;
4420
3933
 
4421
3934
  type index_d_ActionEvent = ActionEvent;
4422
3935
  type index_d_BaseEventMetadata = BaseEventMetadata;
@@ -4452,6 +3965,7 @@ type index_d_QueryReferringCustomersResponseNonNullableFields = QueryReferringCu
4452
3965
  type index_d_ReferringCustomer = ReferringCustomer;
4453
3966
  type index_d_ReferringCustomerCreatedEnvelope = ReferringCustomerCreatedEnvelope;
4454
3967
  type index_d_ReferringCustomerDeletedEnvelope = ReferringCustomerDeletedEnvelope;
3968
+ type index_d_ReferringCustomerNonNullableFields = ReferringCustomerNonNullableFields;
4455
3969
  type index_d_ReferringCustomersQueryBuilder = ReferringCustomersQueryBuilder;
4456
3970
  type index_d_ReferringCustomersQueryResult = ReferringCustomersQueryResult;
4457
3971
  type index_d_SortOrder = SortOrder;
@@ -4460,7 +3974,6 @@ type index_d_Sorting = Sorting;
4460
3974
  type index_d_UndeleteInfo = UndeleteInfo;
4461
3975
  type index_d_WebhookIdentityType = WebhookIdentityType;
4462
3976
  declare const index_d_WebhookIdentityType: typeof WebhookIdentityType;
4463
- declare const index_d___metadata: typeof __metadata;
4464
3977
  declare const index_d_deleteReferringCustomer: typeof deleteReferringCustomer;
4465
3978
  declare const index_d_generateReferringCustomerForContact: typeof generateReferringCustomerForContact;
4466
3979
  declare const index_d_getReferringCustomer: typeof getReferringCustomer;
@@ -4469,7 +3982,7 @@ declare const index_d_onReferringCustomerCreated: typeof onReferringCustomerCrea
4469
3982
  declare const index_d_onReferringCustomerDeleted: typeof onReferringCustomerDeleted;
4470
3983
  declare const index_d_queryReferringCustomers: typeof queryReferringCustomers;
4471
3984
  declare namespace index_d {
4472
- export { type index_d_ActionEvent as ActionEvent, type index_d_BaseEventMetadata as BaseEventMetadata, type index_d_CursorPaging as CursorPaging, type index_d_CursorPagingMetadata as CursorPagingMetadata, type index_d_CursorQuery as CursorQuery, type index_d_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type index_d_Cursors as Cursors, type index_d_DeleteReferringCustomerOptions as DeleteReferringCustomerOptions, type index_d_DeleteReferringCustomerRequest as DeleteReferringCustomerRequest, type index_d_DeleteReferringCustomerResponse as DeleteReferringCustomerResponse, type index_d_DomainEvent as DomainEvent, type index_d_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d_EntityCreatedEvent as EntityCreatedEvent, type index_d_EntityDeletedEvent as EntityDeletedEvent, type index_d_EntityUpdatedEvent as EntityUpdatedEvent, type index_d_EventMetadata as EventMetadata, type index_d_GenerateReferringCustomerForContactRequest as GenerateReferringCustomerForContactRequest, type index_d_GenerateReferringCustomerForContactResponse as GenerateReferringCustomerForContactResponse, type index_d_GenerateReferringCustomerForContactResponseNonNullableFields as GenerateReferringCustomerForContactResponseNonNullableFields, type index_d_GetReferringCustomerByReferralCodeRequest as GetReferringCustomerByReferralCodeRequest, type index_d_GetReferringCustomerByReferralCodeResponse as GetReferringCustomerByReferralCodeResponse, type index_d_GetReferringCustomerByReferralCodeResponseNonNullableFields as GetReferringCustomerByReferralCodeResponseNonNullableFields, type index_d_GetReferringCustomerRequest as GetReferringCustomerRequest, type index_d_GetReferringCustomerResponse as GetReferringCustomerResponse, type index_d_GetReferringCustomerResponseNonNullableFields as GetReferringCustomerResponseNonNullableFields, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d_MessageEnvelope as MessageEnvelope, type index_d_QueryReferringCustomersRequest as QueryReferringCustomersRequest, type index_d_QueryReferringCustomersResponse as QueryReferringCustomersResponse, type index_d_QueryReferringCustomersResponseNonNullableFields as QueryReferringCustomersResponseNonNullableFields, type index_d_ReferringCustomer as ReferringCustomer, type index_d_ReferringCustomerCreatedEnvelope as ReferringCustomerCreatedEnvelope, type index_d_ReferringCustomerDeletedEnvelope as ReferringCustomerDeletedEnvelope, type index_d_ReferringCustomersQueryBuilder as ReferringCustomersQueryBuilder, type index_d_ReferringCustomersQueryResult as ReferringCustomersQueryResult, index_d_SortOrder as SortOrder, type index_d_Sorting as Sorting, type index_d_UndeleteInfo as UndeleteInfo, index_d_WebhookIdentityType as WebhookIdentityType, index_d___metadata as __metadata, index_d_deleteReferringCustomer as deleteReferringCustomer, index_d_generateReferringCustomerForContact as generateReferringCustomerForContact, index_d_getReferringCustomer as getReferringCustomer, index_d_getReferringCustomerByReferralCode as getReferringCustomerByReferralCode, index_d_onReferringCustomerCreated as onReferringCustomerCreated, index_d_onReferringCustomerDeleted as onReferringCustomerDeleted, index_d_queryReferringCustomers as queryReferringCustomers };
3985
+ export { type index_d_ActionEvent as ActionEvent, type index_d_BaseEventMetadata as BaseEventMetadata, type index_d_CursorPaging as CursorPaging, type index_d_CursorPagingMetadata as CursorPagingMetadata, type index_d_CursorQuery as CursorQuery, type index_d_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type index_d_Cursors as Cursors, type index_d_DeleteReferringCustomerOptions as DeleteReferringCustomerOptions, type index_d_DeleteReferringCustomerRequest as DeleteReferringCustomerRequest, type index_d_DeleteReferringCustomerResponse as DeleteReferringCustomerResponse, type index_d_DomainEvent as DomainEvent, type index_d_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d_EntityCreatedEvent as EntityCreatedEvent, type index_d_EntityDeletedEvent as EntityDeletedEvent, type index_d_EntityUpdatedEvent as EntityUpdatedEvent, type index_d_EventMetadata as EventMetadata, type index_d_GenerateReferringCustomerForContactRequest as GenerateReferringCustomerForContactRequest, type index_d_GenerateReferringCustomerForContactResponse as GenerateReferringCustomerForContactResponse, type index_d_GenerateReferringCustomerForContactResponseNonNullableFields as GenerateReferringCustomerForContactResponseNonNullableFields, type index_d_GetReferringCustomerByReferralCodeRequest as GetReferringCustomerByReferralCodeRequest, type index_d_GetReferringCustomerByReferralCodeResponse as GetReferringCustomerByReferralCodeResponse, type index_d_GetReferringCustomerByReferralCodeResponseNonNullableFields as GetReferringCustomerByReferralCodeResponseNonNullableFields, type index_d_GetReferringCustomerRequest as GetReferringCustomerRequest, type index_d_GetReferringCustomerResponse as GetReferringCustomerResponse, type index_d_GetReferringCustomerResponseNonNullableFields as GetReferringCustomerResponseNonNullableFields, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d_MessageEnvelope as MessageEnvelope, type index_d_QueryReferringCustomersRequest as QueryReferringCustomersRequest, type index_d_QueryReferringCustomersResponse as QueryReferringCustomersResponse, type index_d_QueryReferringCustomersResponseNonNullableFields as QueryReferringCustomersResponseNonNullableFields, type index_d_ReferringCustomer as ReferringCustomer, type index_d_ReferringCustomerCreatedEnvelope as ReferringCustomerCreatedEnvelope, type index_d_ReferringCustomerDeletedEnvelope as ReferringCustomerDeletedEnvelope, type index_d_ReferringCustomerNonNullableFields as ReferringCustomerNonNullableFields, type index_d_ReferringCustomersQueryBuilder as ReferringCustomersQueryBuilder, type index_d_ReferringCustomersQueryResult as ReferringCustomersQueryResult, index_d_SortOrder as SortOrder, type index_d_Sorting as Sorting, type index_d_UndeleteInfo as UndeleteInfo, index_d_WebhookIdentityType as WebhookIdentityType, index_d_deleteReferringCustomer as deleteReferringCustomer, index_d_generateReferringCustomerForContact as generateReferringCustomerForContact, index_d_getReferringCustomer as getReferringCustomer, index_d_getReferringCustomerByReferralCode as getReferringCustomerByReferralCode, index_d_onReferringCustomerCreated as onReferringCustomerCreated, index_d_onReferringCustomerDeleted as onReferringCustomerDeleted, index_d_queryReferringCustomers as queryReferringCustomers };
4473
3986
  }
4474
3987
 
4475
3988
  export { index_d as customers, index_d$1 as friends, index_d$4 as programs, index_d$2 as rewards, index_d$3 as tracker };