@wix/referral 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,11 +30,16 @@ interface ReferralProgram {
30
30
  * @readonly
31
31
  * @deprecated Set to true if user has required plan to activate program.
32
32
  * @replacedBy GetReferralProgramPremiumFeatures
33
- * @removalDate 2024-09-01
33
+ * @targetRemovalDate 2024-09-01
34
34
  */
35
35
  isPremium?: boolean;
36
36
  /** Emails configuration. */
37
37
  emails?: Emails;
38
+ /**
39
+ * Information about available premium features
40
+ * @readonly
41
+ */
42
+ premiumFeatures?: PremiumFeatures;
38
43
  }
39
44
  declare enum ProgramStatus {
40
45
  /** unknown status. */
@@ -173,6 +178,13 @@ declare enum App {
173
178
  /** Wix restaurants. */
174
179
  RESTAURANTS = "RESTAURANTS"
175
180
  }
181
+ interface PremiumFeatures {
182
+ /**
183
+ * Set to true if user has referral program feature.
184
+ * @readonly
185
+ */
186
+ referralProgram?: boolean;
187
+ }
176
188
  interface GetReferralProgramRequest {
177
189
  }
178
190
  interface GetReferralProgramResponse {
@@ -196,26 +208,32 @@ interface QueryReferralProgramsRequest {
196
208
  query: CursorQuery$4;
197
209
  }
198
210
  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`. */
211
+ /**
212
+ * Cursor paging options.
213
+ *
214
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
215
+ */
200
216
  cursorPaging?: CursorPaging$4;
201
217
  /**
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`
218
+ * Filter object.
219
+ *
220
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
208
221
  */
209
222
  filter?: Record<string, any> | null;
210
223
  /**
211
- * Sort object in the following format:
212
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
224
+ * Sort object.
225
+ *
226
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
213
227
  */
214
228
  sort?: Sorting$4[];
215
229
  }
216
230
  /** @oneof */
217
231
  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`. */
232
+ /**
233
+ * Cursor paging options.
234
+ *
235
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
236
+ */
219
237
  cursorPaging?: CursorPaging$4;
220
238
  }
221
239
  interface Sorting$4 {
@@ -342,7 +360,7 @@ interface DomainEvent$4 extends DomainEventBodyOneOf$4 {
342
360
  slug?: string;
343
361
  /** ID of the entity associated with the event. */
344
362
  entityId?: string;
345
- /** Event timestamp. */
363
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
346
364
  eventTime?: Date;
347
365
  /**
348
366
  * Whether the event was triggered as a result of a privacy regulation application
@@ -371,7 +389,7 @@ interface DomainEventBodyOneOf$4 {
371
389
  interface EntityCreatedEvent$4 {
372
390
  entity?: string;
373
391
  }
374
- interface UndeleteInfo$4 {
392
+ interface RestoreInfo {
375
393
  deletedDate?: Date;
376
394
  }
377
395
  interface EntityUpdatedEvent$4 {
@@ -570,7 +588,9 @@ declare enum Namespace {
570
588
  * There's a blank site behind the scene but it's blank).
571
589
  * The Mobile company will be the owner of this namespace.
572
590
  */
573
- BRANDED_FIRST = "BRANDED_FIRST"
591
+ BRANDED_FIRST = "BRANDED_FIRST",
592
+ /** Nownia.com Siteless account management for Ai Scheduling Assistant. */
593
+ NOWNIA = "NOWNIA"
574
594
  }
575
595
  /** Site transferred to another user. */
576
596
  interface SiteTransferred {
@@ -1255,302 +1275,75 @@ declare enum WebhookIdentityType$4 {
1255
1275
  WIX_USER = "WIX_USER",
1256
1276
  APP = "APP"
1257
1277
  }
1278
+ interface FixedAmountDiscountNonNullableFields$2 {
1279
+ amount: number;
1280
+ }
1281
+ interface PercentageDiscountNonNullableFields$2 {
1282
+ percentage: number;
1283
+ }
1284
+ interface GroupNonNullableFields$2 {
1285
+ name: string;
1286
+ }
1287
+ interface CouponScopeNonNullableFields$2 {
1288
+ namespace: string;
1289
+ group?: GroupNonNullableFields$2;
1290
+ }
1291
+ interface CouponNonNullableFields$2 {
1292
+ fixedAmountOptions?: FixedAmountDiscountNonNullableFields$2;
1293
+ percentageOptions?: PercentageDiscountNonNullableFields$2;
1294
+ minimumSubtotal: number;
1295
+ scope?: CouponScopeNonNullableFields$2;
1296
+ name: string;
1297
+ discountType: DiscountType$2;
1298
+ }
1299
+ interface LoyaltyPointsNonNullableFields$1 {
1300
+ amount: number;
1301
+ }
1302
+ interface RewardNonNullableFields {
1303
+ couponOptions?: CouponNonNullableFields$2;
1304
+ loyaltyPointsOptions?: LoyaltyPointsNonNullableFields$1;
1305
+ type: Type$1;
1306
+ }
1307
+ interface EmailsNonNullableFields {
1308
+ encourageToReferFriends: App[];
1309
+ notifyCustomersAboutReward: boolean;
1310
+ }
1311
+ interface PremiumFeaturesNonNullableFields {
1312
+ referralProgram: boolean;
1313
+ }
1314
+ interface ReferralProgramNonNullableFields {
1315
+ status: ProgramStatus;
1316
+ referredFriendReward?: RewardNonNullableFields;
1317
+ referringCustomerReward?: RewardNonNullableFields;
1318
+ successfulReferralActions: Action[];
1319
+ isPremium: boolean;
1320
+ emails?: EmailsNonNullableFields;
1321
+ premiumFeatures?: PremiumFeaturesNonNullableFields;
1322
+ }
1258
1323
  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
- };
1324
+ referralProgram?: ReferralProgramNonNullableFields;
1314
1325
  }
1315
1326
  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
- }[];
1327
+ referralPrograms: ReferralProgramNonNullableFields[];
1371
1328
  }
1372
1329
  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
- };
1330
+ referralProgram?: ReferralProgramNonNullableFields;
1428
1331
  }
1429
1332
  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
- };
1333
+ referralProgram?: ReferralProgramNonNullableFields;
1485
1334
  }
1486
1335
  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
- };
1336
+ referralProgram?: ReferralProgramNonNullableFields;
1337
+ }
1338
+ interface AISocialMediaPostSuggestionNonNullableFields {
1339
+ postContent: string;
1340
+ hashtags: string[];
1542
1341
  }
1543
1342
  interface GetAISocialMediaPostsSuggestionsResponseNonNullableFields {
1544
- suggestions: {
1545
- postContent: string;
1546
- hashtags: string[];
1547
- }[];
1343
+ suggestions: AISocialMediaPostSuggestionNonNullableFields[];
1548
1344
  }
1549
1345
  interface GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields {
1550
- suggestions: {
1551
- postContent: string;
1552
- hashtags: string[];
1553
- }[];
1346
+ suggestions: AISocialMediaPostSuggestionNonNullableFields[];
1554
1347
  }
1555
1348
  interface GetReferralProgramPremiumFeaturesResponseNonNullableFields {
1556
1349
  referralProgram: boolean;
@@ -1582,7 +1375,7 @@ interface EventMetadata$3 extends BaseEventMetadata$3 {
1582
1375
  slug?: string;
1583
1376
  /** ID of the entity associated with the event. */
1584
1377
  entityId?: string;
1585
- /** Event timestamp. */
1378
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1586
1379
  eventTime?: Date;
1587
1380
  /**
1588
1381
  * Whether the event was triggered as a result of a privacy regulation application
@@ -1639,37 +1432,42 @@ interface GenerateAiSocialMediaPostsSuggestionsOptions {
1639
1432
  topic?: string;
1640
1433
  }
1641
1434
 
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>;
1435
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
1436
+ interface HttpClient {
1437
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
1438
+ fetchWithAuth: typeof fetch;
1439
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
1645
1440
  }
1646
- type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
1647
- type HttpResponse$4<T = any> = {
1441
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
1442
+ type HttpResponse<T = any> = {
1648
1443
  data: T;
1649
1444
  status: number;
1650
1445
  statusText: string;
1651
1446
  headers: any;
1652
1447
  request?: any;
1653
1448
  };
1654
- type RequestOptions$4<_TResponse = any, Data = any> = {
1449
+ type RequestOptions<_TResponse = any, Data = any> = {
1655
1450
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
1656
1451
  url: string;
1657
1452
  data?: Data;
1658
1453
  params?: URLSearchParams;
1659
- } & APIMetadata$4;
1660
- type APIMetadata$4 = {
1454
+ } & APIMetadata;
1455
+ type APIMetadata = {
1661
1456
  methodFqn?: string;
1662
1457
  entityFqdn?: string;
1663
1458
  packageName?: string;
1664
1459
  };
1665
- type EventDefinition$3<Payload = unknown, Type extends string = string> = {
1460
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
1461
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
1666
1462
  __type: 'event-definition';
1667
1463
  type: Type;
1668
1464
  isDomainEvent?: boolean;
1669
1465
  transformations?: (envelope: unknown) => Payload;
1670
1466
  __payload: Payload;
1671
1467
  };
1672
- declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
1468
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
1469
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
1470
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
1673
1471
 
1674
1472
  declare global {
1675
1473
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -1678,18 +1476,19 @@ declare global {
1678
1476
  }
1679
1477
  }
1680
1478
 
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">;
1479
+ declare function createRESTModule$4<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1480
+
1481
+ declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1482
+
1483
+ declare const getReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicGetReferralProgram>>;
1484
+ declare const queryReferralPrograms: ReturnType<typeof createRESTModule$4<typeof publicQueryReferralPrograms>>;
1485
+ declare const updateReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicUpdateReferralProgram>>;
1486
+ declare const activateReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicActivateReferralProgram>>;
1487
+ declare const pauseReferralProgram: ReturnType<typeof createRESTModule$4<typeof publicPauseReferralProgram>>;
1488
+ declare const getAiSocialMediaPostsSuggestions: ReturnType<typeof createRESTModule$4<typeof publicGetAiSocialMediaPostsSuggestions>>;
1489
+ declare const generateAiSocialMediaPostsSuggestions: ReturnType<typeof createRESTModule$4<typeof publicGenerateAiSocialMediaPostsSuggestions>>;
1490
+ declare const getReferralProgramPremiumFeatures: ReturnType<typeof createRESTModule$4<typeof publicGetReferralProgramPremiumFeatures>>;
1491
+ declare const onProgramUpdated: ReturnType<typeof createEventModule$3<typeof publicOnProgramUpdated>>;
1693
1492
 
1694
1493
  type index_d$4_AISocialMediaPostSuggestion = AISocialMediaPostSuggestion;
1695
1494
  type index_d$4_Action = Action;
@@ -1745,6 +1544,7 @@ type index_d$4_Page = Page;
1745
1544
  type index_d$4_PauseReferralProgramRequest = PauseReferralProgramRequest;
1746
1545
  type index_d$4_PauseReferralProgramResponse = PauseReferralProgramResponse;
1747
1546
  type index_d$4_PauseReferralProgramResponseNonNullableFields = PauseReferralProgramResponseNonNullableFields;
1547
+ type index_d$4_PremiumFeatures = PremiumFeatures;
1748
1548
  type index_d$4_PriceIncreaseTrigger = PriceIncreaseTrigger;
1749
1549
  declare const index_d$4_PriceIncreaseTrigger: typeof PriceIncreaseTrigger;
1750
1550
  type index_d$4_ProductAdjustment = ProductAdjustment;
@@ -1766,6 +1566,7 @@ type index_d$4_RecurringChargeSucceeded = RecurringChargeSucceeded;
1766
1566
  type index_d$4_ReferralProgram = ReferralProgram;
1767
1567
  type index_d$4_ReferralProgramsQueryBuilder = ReferralProgramsQueryBuilder;
1768
1568
  type index_d$4_ReferralProgramsQueryResult = ReferralProgramsQueryResult;
1569
+ type index_d$4_RestoreInfo = RestoreInfo;
1769
1570
  type index_d$4_ServiceProvisioned = ServiceProvisioned;
1770
1571
  type index_d$4_ServiceRemoved = ServiceRemoved;
1771
1572
  type index_d$4_SiteCreated = SiteCreated;
@@ -1813,7 +1614,7 @@ declare const index_d$4_pauseReferralProgram: typeof pauseReferralProgram;
1813
1614
  declare const index_d$4_queryReferralPrograms: typeof queryReferralPrograms;
1814
1615
  declare const index_d$4_updateReferralProgram: typeof updateReferralProgram;
1815
1616
  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 };
1617
+ 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, type index_d$4_PremiumFeatures as PremiumFeatures, 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
1618
  }
1818
1619
 
1819
1620
  /** ReferralEvent. */
@@ -2390,108 +2191,98 @@ declare enum WebhookIdentityType$3 {
2390
2191
  WIX_USER = "WIX_USER",
2391
2192
  APP = "APP"
2392
2193
  }
2194
+ interface ReferredFriendSignupEventNonNullableFields {
2195
+ referredFriendId: string;
2196
+ }
2197
+ interface V1SuccessfulReferralEventNonNullableFields {
2198
+ referredFriendId: string;
2199
+ referringCustomerId: string;
2200
+ }
2201
+ interface V1TriggerNonNullableFields {
2202
+ appId: string;
2203
+ activityType: string;
2204
+ }
2205
+ interface V1ActionEventNonNullableFields {
2206
+ referredFriendId: string;
2207
+ referringCustomerId: string;
2208
+ trigger?: V1TriggerNonNullableFields;
2209
+ }
2210
+ interface RewardEventNonNullableFields {
2211
+ rewardedReferringCustomerId: string;
2212
+ rewardedReferredFriendId: string;
2213
+ referralRewardId: string;
2214
+ rewardType: Reward$1;
2215
+ }
2216
+ interface ReferralEventNonNullableFields {
2217
+ referredFriendSignupEvent?: ReferredFriendSignupEventNonNullableFields;
2218
+ successfulReferralEvent?: V1SuccessfulReferralEventNonNullableFields;
2219
+ actionEvent?: V1ActionEventNonNullableFields;
2220
+ rewardEvent?: RewardEventNonNullableFields;
2221
+ }
2393
2222
  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
- };
2223
+ referralEvent?: ReferralEventNonNullableFields;
2417
2224
  }
2418
2225
  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
- }[];
2226
+ referralEvents: ReferralEventNonNullableFields[];
2442
2227
  }
2443
2228
  interface GetReferralStatisticsResponseNonNullableFields {
2444
2229
  totalSignUpsCompleted: number;
2445
2230
  totalActionsCompleted: number;
2446
2231
  totalAmountGenerated: string;
2447
2232
  }
2233
+ interface ReferringCustomerTotalNonNullableFields {
2234
+ referringCustomerId: string;
2235
+ contactId: string;
2236
+ totalSuccessfulReferrals: number;
2237
+ totalAmountGenerated: string;
2238
+ totalFriendsWithActions: number;
2239
+ }
2448
2240
  interface QueryReferringCustomerTotalsResponseNonNullableFields {
2449
- referringCustomerTotals: {
2450
- referringCustomerId: string;
2451
- contactId: string;
2452
- totalSuccessfulReferrals: number;
2453
- totalAmountGenerated: string;
2454
- totalFriendsWithActions: number;
2455
- }[];
2241
+ referringCustomerTotals: ReferringCustomerTotalNonNullableFields[];
2242
+ }
2243
+ interface FixedAmountDiscountNonNullableFields$1 {
2244
+ amount: number;
2245
+ }
2246
+ interface PercentageDiscountNonNullableFields$1 {
2247
+ percentage: number;
2248
+ }
2249
+ interface GroupNonNullableFields$1 {
2250
+ name: string;
2251
+ }
2252
+ interface CouponScopeNonNullableFields$1 {
2253
+ namespace: string;
2254
+ group?: GroupNonNullableFields$1;
2255
+ }
2256
+ interface CouponNonNullableFields$1 {
2257
+ fixedAmountOptions?: FixedAmountDiscountNonNullableFields$1;
2258
+ percentageOptions?: PercentageDiscountNonNullableFields$1;
2259
+ minimumSubtotal: number;
2260
+ scope?: CouponScopeNonNullableFields$1;
2261
+ name: string;
2262
+ discountType: DiscountType$1;
2263
+ }
2264
+ interface V1CouponNonNullableFields$1 {
2265
+ _id: string;
2266
+ code: string;
2267
+ status: Status$2;
2268
+ couponSpecification?: CouponNonNullableFields$1;
2269
+ }
2270
+ interface LoyaltyPointsNonNullableFields {
2271
+ transactionId: string;
2272
+ amount: number;
2273
+ }
2274
+ interface ReferredFriendActionNonNullableFields {
2275
+ coupon?: V1CouponNonNullableFields$1;
2276
+ loyaltyPoints?: LoyaltyPointsNonNullableFields;
2277
+ referredFriendId: string;
2278
+ contactId: string;
2279
+ trigger?: V1TriggerNonNullableFields;
2280
+ rewardType: Reward$1;
2281
+ totalActions: number;
2282
+ totalAmountSpent: string;
2456
2283
  }
2457
2284
  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
- }[];
2285
+ referredFriendActions: ReferredFriendActionNonNullableFields[];
2495
2286
  }
2496
2287
  interface BaseEventMetadata$2 {
2497
2288
  /** App instance ID. */
@@ -2628,76 +2419,16 @@ interface QueryReferredFriendActionsOptions {
2628
2419
  contactIds?: string[];
2629
2420
  }
2630
2421
 
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>;
2422
+ declare function createRESTModule$3<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
2662
2423
 
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
- }
2424
+ declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2669
2425
 
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">;
2426
+ declare const getReferralEvent: ReturnType<typeof createRESTModule$3<typeof publicGetReferralEvent>>;
2427
+ declare const queryReferralEvent: ReturnType<typeof createRESTModule$3<typeof publicQueryReferralEvent>>;
2428
+ declare const getReferralStatistics: ReturnType<typeof createRESTModule$3<typeof publicGetReferralStatistics>>;
2429
+ declare const queryReferringCustomerTotals: ReturnType<typeof createRESTModule$3<typeof publicQueryReferringCustomerTotals>>;
2430
+ declare const queryReferredFriendActions: ReturnType<typeof createRESTModule$3<typeof publicQueryReferredFriendActions>>;
2431
+ declare const onReferralEventCreated: ReturnType<typeof createEventModule$2<typeof publicOnReferralEventCreated>>;
2701
2432
 
2702
2433
  type index_d$3_CreateReferralEventRequest = CreateReferralEventRequest;
2703
2434
  type index_d$3_CreateReferralEventResponse = CreateReferralEventResponse;
@@ -2721,6 +2452,7 @@ type index_d$3_QueryReferringCustomerTotalsResponseNonNullableFields = QueryRefe
2721
2452
  type index_d$3_ReferralEvent = ReferralEvent;
2722
2453
  type index_d$3_ReferralEventCreatedEnvelope = ReferralEventCreatedEnvelope;
2723
2454
  type index_d$3_ReferralEventEventTypeOneOf = ReferralEventEventTypeOneOf;
2455
+ type index_d$3_ReferralEventNonNullableFields = ReferralEventNonNullableFields;
2724
2456
  type index_d$3_ReferralEventsQueryBuilder = ReferralEventsQueryBuilder;
2725
2457
  type index_d$3_ReferralEventsQueryResult = ReferralEventsQueryResult;
2726
2458
  type index_d$3_ReferredFriendAction = ReferredFriendAction;
@@ -2741,7 +2473,7 @@ declare const index_d$3_queryReferralEvent: typeof queryReferralEvent;
2741
2473
  declare const index_d$3_queryReferredFriendActions: typeof queryReferredFriendActions;
2742
2474
  declare const index_d$3_queryReferringCustomerTotals: typeof queryReferringCustomerTotals;
2743
2475
  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 };
2476
+ export { type ActionEvent$3 as ActionEvent, type BaseEventMetadata$2 as BaseEventMetadata, type Coupon$1 as Coupon, type CouponDiscountTypeOptionsOneOf$1 as CouponDiscountTypeOptionsOneOf, type CouponScope$1 as CouponScope, type CouponScopeOrMinSubtotalOneOf$1 as CouponScopeOrMinSubtotalOneOf, type 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
2477
  }
2746
2478
 
2747
2479
  /** ReferralReward is the main entity of ReferralRewards that can be used for lorem ipsum dolor */
@@ -3174,143 +2906,59 @@ declare enum WebhookIdentityType$2 {
3174
2906
  WIX_USER = "WIX_USER",
3175
2907
  APP = "APP"
3176
2908
  }
2909
+ interface FixedAmountDiscountNonNullableFields {
2910
+ amount: number;
2911
+ }
2912
+ interface PercentageDiscountNonNullableFields {
2913
+ percentage: number;
2914
+ }
2915
+ interface GroupNonNullableFields {
2916
+ name: string;
2917
+ }
2918
+ interface CouponScopeNonNullableFields {
2919
+ namespace: string;
2920
+ group?: GroupNonNullableFields;
2921
+ }
2922
+ interface CouponNonNullableFields {
2923
+ fixedAmountOptions?: FixedAmountDiscountNonNullableFields;
2924
+ percentageOptions?: PercentageDiscountNonNullableFields;
2925
+ minimumSubtotal: number;
2926
+ scope?: CouponScopeNonNullableFields;
2927
+ name: string;
2928
+ discountType: DiscountType;
2929
+ }
2930
+ interface V1CouponNonNullableFields {
2931
+ _id: string;
2932
+ code: string;
2933
+ status: Status$1;
2934
+ couponSpecification?: CouponNonNullableFields;
2935
+ }
2936
+ interface V1LoyaltyPointsNonNullableFields {
2937
+ transactionId: string;
2938
+ amount: number;
2939
+ }
2940
+ interface ReferralRewardNonNullableFields {
2941
+ rewardedReferringCustomerId: string;
2942
+ rewardedReferredFriendId: string;
2943
+ coupon?: V1CouponNonNullableFields;
2944
+ loyaltyPoints?: V1LoyaltyPointsNonNullableFields;
2945
+ rewardType: RewardTypeType;
2946
+ }
3177
2947
  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
- };
2948
+ referralReward?: ReferralRewardNonNullableFields;
3209
2949
  }
3210
2950
  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
- }[];
2951
+ referralRewards: ReferralRewardNonNullableFields[];
3242
2952
  }
3243
2953
  interface QueryReferralRewardsOptions {
3244
2954
  /** Filter by contact id or set to "me" for current identity's rewards. */
3245
2955
  contactId?: string | null;
3246
2956
  }
3247
2957
 
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
- };
3271
-
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
- }
2958
+ declare function createRESTModule$2<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
3278
2959
 
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>;
2960
+ declare const getReferralReward: ReturnType<typeof createRESTModule$2<typeof publicGetReferralReward>>;
2961
+ declare const queryReferralRewards: ReturnType<typeof createRESTModule$2<typeof publicQueryReferralRewards>>;
3314
2962
 
3315
2963
  type index_d$2_BulkGetReferralRewardsRequest = BulkGetReferralRewardsRequest;
3316
2964
  type index_d$2_BulkGetReferralRewardsResponse = BulkGetReferralRewardsResponse;
@@ -3332,6 +2980,7 @@ type index_d$2_QueryReferralRewardsRequest = QueryReferralRewardsRequest;
3332
2980
  type index_d$2_QueryReferralRewardsResponse = QueryReferralRewardsResponse;
3333
2981
  type index_d$2_QueryReferralRewardsResponseNonNullableFields = QueryReferralRewardsResponseNonNullableFields;
3334
2982
  type index_d$2_ReferralReward = ReferralReward;
2983
+ type index_d$2_ReferralRewardNonNullableFields = ReferralRewardNonNullableFields;
3335
2984
  type index_d$2_ReferralRewardReceiverOneOf = ReferralRewardReceiverOneOf;
3336
2985
  type index_d$2_ReferralRewardRewardTypeOptionsOneOf = ReferralRewardRewardTypeOptionsOneOf;
3337
2986
  type index_d$2_Reward = Reward;
@@ -3348,7 +2997,7 @@ type index_d$2_ValidateReferralRewardResponse = ValidateReferralRewardResponse;
3348
2997
  declare const index_d$2_getReferralReward: typeof getReferralReward;
3349
2998
  declare const index_d$2_queryReferralRewards: typeof queryReferralRewards;
3350
2999
  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 };
3000
+ 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
3001
  }
3353
3002
 
3354
3003
  /** ReferredFriend is the main entity of ReferredFriends that can be used for lorem ipsum dolor */
@@ -3638,45 +3287,26 @@ declare enum WebhookIdentityType$1 {
3638
3287
  WIX_USER = "WIX_USER",
3639
3288
  APP = "APP"
3640
3289
  }
3290
+ interface ReferredFriendNonNullableFields {
3291
+ _id: string;
3292
+ contactId: string;
3293
+ referringCustomerId: string;
3294
+ status: Status;
3295
+ }
3641
3296
  interface CreateReferredFriendResponseNonNullableFields {
3642
- referredFriend?: {
3643
- _id: string;
3644
- contactId: string;
3645
- referringCustomerId: string;
3646
- status: Status;
3647
- };
3297
+ referredFriend?: ReferredFriendNonNullableFields;
3648
3298
  }
3649
3299
  interface GetReferredFriendResponseNonNullableFields {
3650
- referredFriend?: {
3651
- _id: string;
3652
- contactId: string;
3653
- referringCustomerId: string;
3654
- status: Status;
3655
- };
3300
+ referredFriend?: ReferredFriendNonNullableFields;
3656
3301
  }
3657
3302
  interface GetReferredFriendByContactIdResponseNonNullableFields {
3658
- referredFriend?: {
3659
- _id: string;
3660
- contactId: string;
3661
- referringCustomerId: string;
3662
- status: Status;
3663
- };
3303
+ referredFriend?: ReferredFriendNonNullableFields;
3664
3304
  }
3665
3305
  interface UpdateReferredFriendResponseNonNullableFields {
3666
- referredFriend?: {
3667
- _id: string;
3668
- contactId: string;
3669
- referringCustomerId: string;
3670
- status: Status;
3671
- };
3306
+ referredFriend?: ReferredFriendNonNullableFields;
3672
3307
  }
3673
3308
  interface QueryReferredFriendResponseNonNullableFields {
3674
- referredFriends: {
3675
- _id: string;
3676
- contactId: string;
3677
- referringCustomerId: string;
3678
- status: Status;
3679
- }[];
3309
+ referredFriends: ReferredFriendNonNullableFields[];
3680
3310
  }
3681
3311
  interface BaseEventMetadata$1 {
3682
3312
  /** App instance ID. */
@@ -3851,67 +3481,19 @@ interface ReferredFriendsQueryBuilder {
3851
3481
  find: () => Promise<ReferredFriendsQueryResult>;
3852
3482
  }
3853
3483
 
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>;
3484
+ declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
3885
3485
 
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
- }
3486
+ declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
3892
3487
 
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">;
3488
+ declare const createReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicCreateReferredFriend>>;
3489
+ declare const getReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicGetReferredFriend>>;
3490
+ declare const getReferredFriendByContactId: ReturnType<typeof createRESTModule$1<typeof publicGetReferredFriendByContactId>>;
3491
+ declare const updateReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicUpdateReferredFriend>>;
3492
+ declare const deleteReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicDeleteReferredFriend>>;
3493
+ declare const queryReferredFriend: ReturnType<typeof createRESTModule$1<typeof publicQueryReferredFriend>>;
3494
+ declare const onReferredFriendCreated: ReturnType<typeof createEventModule$1<typeof publicOnReferredFriendCreated>>;
3495
+ declare const onReferredFriendUpdated: ReturnType<typeof createEventModule$1<typeof publicOnReferredFriendUpdated>>;
3496
+ declare const onReferredFriendDeleted: ReturnType<typeof createEventModule$1<typeof publicOnReferredFriendDeleted>>;
3915
3497
 
3916
3498
  type index_d$1_CreateReferredFriendRequest = CreateReferredFriendRequest;
3917
3499
  type index_d$1_CreateReferredFriendResponse = CreateReferredFriendResponse;
@@ -3933,6 +3515,7 @@ type index_d$1_ReferredFriend = ReferredFriend;
3933
3515
  type index_d$1_ReferredFriendCreatedEnvelope = ReferredFriendCreatedEnvelope;
3934
3516
  type index_d$1_ReferredFriendDeletedEnvelope = ReferredFriendDeletedEnvelope;
3935
3517
  type index_d$1_ReferredFriendDetails = ReferredFriendDetails;
3518
+ type index_d$1_ReferredFriendNonNullableFields = ReferredFriendNonNullableFields;
3936
3519
  type index_d$1_ReferredFriendUpdatedEnvelope = ReferredFriendUpdatedEnvelope;
3937
3520
  type index_d$1_ReferredFriendsQueryBuilder = ReferredFriendsQueryBuilder;
3938
3521
  type index_d$1_ReferredFriendsQueryResult = ReferredFriendsQueryResult;
@@ -3953,7 +3536,7 @@ declare const index_d$1_onReferredFriendUpdated: typeof onReferredFriendUpdated;
3953
3536
  declare const index_d$1_queryReferredFriend: typeof queryReferredFriend;
3954
3537
  declare const index_d$1_updateReferredFriend: typeof updateReferredFriend;
3955
3538
  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 };
3539
+ 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
3540
  }
3958
3541
 
3959
3542
  /** ReferringCustomer is the main entity of ReferringCustomers. */
@@ -4201,33 +3784,22 @@ declare enum WebhookIdentityType {
4201
3784
  WIX_USER = "WIX_USER",
4202
3785
  APP = "APP"
4203
3786
  }
3787
+ interface ReferringCustomerNonNullableFields {
3788
+ _id: string;
3789
+ contactId: string;
3790
+ referralCode: string;
3791
+ }
4204
3792
  interface GenerateReferringCustomerForContactResponseNonNullableFields {
4205
- referringCustomer?: {
4206
- _id: string;
4207
- contactId: string;
4208
- referralCode: string;
4209
- };
3793
+ referringCustomer?: ReferringCustomerNonNullableFields;
4210
3794
  }
4211
3795
  interface GetReferringCustomerResponseNonNullableFields {
4212
- referringCustomer?: {
4213
- _id: string;
4214
- contactId: string;
4215
- referralCode: string;
4216
- };
3796
+ referringCustomer?: ReferringCustomerNonNullableFields;
4217
3797
  }
4218
3798
  interface GetReferringCustomerByReferralCodeResponseNonNullableFields {
4219
- referringCustomer?: {
4220
- _id: string;
4221
- contactId: string;
4222
- referralCode: string;
4223
- };
3799
+ referringCustomer?: ReferringCustomerNonNullableFields;
4224
3800
  }
4225
3801
  interface QueryReferringCustomersResponseNonNullableFields {
4226
- referringCustomers: {
4227
- _id: string;
4228
- contactId: string;
4229
- referralCode: string;
4230
- }[];
3802
+ referringCustomers: ReferringCustomerNonNullableFields[];
4231
3803
  }
4232
3804
  interface BaseEventMetadata {
4233
3805
  /** App instance ID. */
@@ -4364,59 +3936,17 @@ interface DeleteReferringCustomerOptions {
4364
3936
  revision?: string;
4365
3937
  }
4366
3938
 
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>;
3939
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
4398
3940
 
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
- }
3941
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
4405
3942
 
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">;
3943
+ declare const generateReferringCustomerForContact: ReturnType<typeof createRESTModule<typeof publicGenerateReferringCustomerForContact>>;
3944
+ declare const getReferringCustomer: ReturnType<typeof createRESTModule<typeof publicGetReferringCustomer>>;
3945
+ declare const getReferringCustomerByReferralCode: ReturnType<typeof createRESTModule<typeof publicGetReferringCustomerByReferralCode>>;
3946
+ declare const queryReferringCustomers: ReturnType<typeof createRESTModule<typeof publicQueryReferringCustomers>>;
3947
+ declare const deleteReferringCustomer: ReturnType<typeof createRESTModule<typeof publicDeleteReferringCustomer>>;
3948
+ declare const onReferringCustomerCreated: ReturnType<typeof createEventModule<typeof publicOnReferringCustomerCreated>>;
3949
+ declare const onReferringCustomerDeleted: ReturnType<typeof createEventModule<typeof publicOnReferringCustomerDeleted>>;
4420
3950
 
4421
3951
  type index_d_ActionEvent = ActionEvent;
4422
3952
  type index_d_BaseEventMetadata = BaseEventMetadata;
@@ -4452,6 +3982,7 @@ type index_d_QueryReferringCustomersResponseNonNullableFields = QueryReferringCu
4452
3982
  type index_d_ReferringCustomer = ReferringCustomer;
4453
3983
  type index_d_ReferringCustomerCreatedEnvelope = ReferringCustomerCreatedEnvelope;
4454
3984
  type index_d_ReferringCustomerDeletedEnvelope = ReferringCustomerDeletedEnvelope;
3985
+ type index_d_ReferringCustomerNonNullableFields = ReferringCustomerNonNullableFields;
4455
3986
  type index_d_ReferringCustomersQueryBuilder = ReferringCustomersQueryBuilder;
4456
3987
  type index_d_ReferringCustomersQueryResult = ReferringCustomersQueryResult;
4457
3988
  type index_d_SortOrder = SortOrder;
@@ -4460,7 +3991,6 @@ type index_d_Sorting = Sorting;
4460
3991
  type index_d_UndeleteInfo = UndeleteInfo;
4461
3992
  type index_d_WebhookIdentityType = WebhookIdentityType;
4462
3993
  declare const index_d_WebhookIdentityType: typeof WebhookIdentityType;
4463
- declare const index_d___metadata: typeof __metadata;
4464
3994
  declare const index_d_deleteReferringCustomer: typeof deleteReferringCustomer;
4465
3995
  declare const index_d_generateReferringCustomerForContact: typeof generateReferringCustomerForContact;
4466
3996
  declare const index_d_getReferringCustomer: typeof getReferringCustomer;
@@ -4469,7 +3999,7 @@ declare const index_d_onReferringCustomerCreated: typeof onReferringCustomerCrea
4469
3999
  declare const index_d_onReferringCustomerDeleted: typeof onReferringCustomerDeleted;
4470
4000
  declare const index_d_queryReferringCustomers: typeof queryReferringCustomers;
4471
4001
  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 };
4002
+ 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
4003
  }
4474
4004
 
4475
4005
  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 };