@wix/referral 1.0.4 → 1.0.5

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.
@@ -106,9 +106,9 @@ declare enum Reward {
106
106
  /** No reward. */
107
107
  NOTHING = "NOTHING"
108
108
  }
109
- interface CursorQuery extends CursorQueryPagingMethodOneOf {
109
+ interface CursorQuery$1 extends CursorQueryPagingMethodOneOf$1 {
110
110
  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
111
- cursorPaging?: CursorPaging;
111
+ cursorPaging?: CursorPaging$1;
112
112
  /**
113
113
  * Filter object in the following format:
114
114
  * `"filter" : {
@@ -122,24 +122,24 @@ interface CursorQuery extends CursorQueryPagingMethodOneOf {
122
122
  * Sort object in the following format:
123
123
  * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
124
124
  */
125
- sort?: Sorting[];
125
+ sort?: Sorting$1[];
126
126
  }
127
127
  /** @oneof */
128
- interface CursorQueryPagingMethodOneOf {
128
+ interface CursorQueryPagingMethodOneOf$1 {
129
129
  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
130
- cursorPaging?: CursorPaging;
130
+ cursorPaging?: CursorPaging$1;
131
131
  }
132
- interface Sorting {
132
+ interface Sorting$1 {
133
133
  /** Name of the field to sort by. */
134
134
  fieldName?: string;
135
135
  /** Sort order. */
136
- order?: SortOrder;
136
+ order?: SortOrder$1;
137
137
  }
138
- declare enum SortOrder {
138
+ declare enum SortOrder$1 {
139
139
  ASC = "ASC",
140
140
  DESC = "DESC"
141
141
  }
142
- interface CursorPaging {
142
+ interface CursorPaging$1 {
143
143
  /** Maximum number of items to return in the results. */
144
144
  limit?: number | null;
145
145
  /**
@@ -150,11 +150,11 @@ interface CursorPaging {
150
150
  */
151
151
  cursor?: string | null;
152
152
  }
153
- interface CursorPagingMetadata {
153
+ interface CursorPagingMetadata$1 {
154
154
  /** Number of items returned in the response. */
155
155
  count?: number | null;
156
156
  /** Cursor strings that point to the next page, previous page, or both. */
157
- cursors?: Cursors$2;
157
+ cursors?: Cursors$3;
158
158
  /**
159
159
  * Whether there are more pages to retrieve following the current page.
160
160
  *
@@ -163,7 +163,7 @@ interface CursorPagingMetadata {
163
163
  */
164
164
  hasNext?: boolean | null;
165
165
  }
166
- interface Cursors$2 {
166
+ interface Cursors$3 {
167
167
  /** Cursor string pointing to the next page in the list of results. */
168
168
  next?: string | null;
169
169
  /** Cursor pointing to the previous page in the list of results. */
@@ -181,7 +181,7 @@ interface QueryReferringCustomerTotalsResponse {
181
181
  /** List of ReferringCustomerTotals that match the query. */
182
182
  referringCustomerTotals?: ReferringCustomerTotal[];
183
183
  /** Paging metadata. */
184
- metadata?: CursorPagingMetadata;
184
+ metadata?: CursorPagingMetadata$1;
185
185
  }
186
186
  interface ReferringCustomerTotal {
187
187
  /**
@@ -224,11 +224,11 @@ interface QueryReferredFriendActionsResponse {
224
224
  /** List of ReferredFriendActions that match the query. */
225
225
  referredFriendActions?: ReferredFriendAction[];
226
226
  /** Paging metadata. */
227
- metadata?: CursorPagingMetadata;
227
+ metadata?: CursorPagingMetadata$1;
228
228
  }
229
229
  interface ReferredFriendAction extends ReferredFriendActionRewardTypeOptionsOneOf {
230
230
  /** Coupon reward type options. */
231
- coupon?: V1Coupon;
231
+ coupon?: V1Coupon$1;
232
232
  /** Loyalty points reward type options. */
233
233
  loyaltyPoints?: LoyaltyPoints;
234
234
  /**
@@ -269,11 +269,11 @@ interface ReferredFriendAction extends ReferredFriendActionRewardTypeOptionsOneO
269
269
  /** @oneof */
270
270
  interface ReferredFriendActionRewardTypeOptionsOneOf {
271
271
  /** Coupon reward type options. */
272
- coupon?: V1Coupon;
272
+ coupon?: V1Coupon$1;
273
273
  /** Loyalty points reward type options. */
274
274
  loyaltyPoints?: LoyaltyPoints;
275
275
  }
276
- interface V1Coupon {
276
+ interface V1Coupon$1 {
277
277
  /**
278
278
  * Coupon ID.
279
279
  * @readonly
@@ -288,14 +288,14 @@ interface V1Coupon {
288
288
  * Coupon status.
289
289
  * @readonly
290
290
  */
291
- status?: Status$1;
291
+ status?: Status$2;
292
292
  /**
293
293
  * Coupon specification.
294
294
  * @readonly
295
295
  */
296
- couponSpecification?: Coupon;
296
+ couponSpecification?: Coupon$1;
297
297
  }
298
- declare enum Status$1 {
298
+ declare enum Status$2 {
299
299
  /** Unknown coupon status. */
300
300
  UNKNOWN = "UNKNOWN",
301
301
  /** Coupon is active and can be applied. */
@@ -305,19 +305,19 @@ declare enum Status$1 {
305
305
  /** Coupon was deleted. */
306
306
  DELETED = "DELETED"
307
307
  }
308
- interface Coupon extends CouponDiscountTypeOptionsOneOf, CouponScopeOrMinSubtotalOneOf {
308
+ interface Coupon$1 extends CouponDiscountTypeOptionsOneOf$1, CouponScopeOrMinSubtotalOneOf$1 {
309
309
  /** Options for fixed amount discount type */
310
- fixedAmountOptions?: FixedAmountDiscount;
310
+ fixedAmountOptions?: FixedAmountDiscount$1;
311
311
  /** Options for percentage discount type */
312
- percentageOptions?: PercentageDiscount;
312
+ percentageOptions?: PercentageDiscount$1;
313
313
  /** Limit the coupon to carts with a subtotal above this number. */
314
314
  minimumSubtotal?: number;
315
315
  /** Specifies the type of line items this coupon will apply to. */
316
- scope?: CouponScope;
316
+ scope?: CouponScope$1;
317
317
  /** Coupon name */
318
318
  name?: string;
319
319
  /** Coupon discount type */
320
- discountType?: DiscountType;
320
+ discountType?: DiscountType$1;
321
321
  /** Limit the coupon to only apply to one item in cart. */
322
322
  limitedToOneItem?: boolean | null;
323
323
  /** If true, coupon also applies to subscriptions. */
@@ -326,20 +326,20 @@ interface Coupon extends CouponDiscountTypeOptionsOneOf, CouponScopeOrMinSubtota
326
326
  discountedCycleCount?: number | null;
327
327
  }
328
328
  /** @oneof */
329
- interface CouponDiscountTypeOptionsOneOf {
329
+ interface CouponDiscountTypeOptionsOneOf$1 {
330
330
  /** Options for fixed amount discount type */
331
- fixedAmountOptions?: FixedAmountDiscount;
331
+ fixedAmountOptions?: FixedAmountDiscount$1;
332
332
  /** Options for percentage discount type */
333
- percentageOptions?: PercentageDiscount;
333
+ percentageOptions?: PercentageDiscount$1;
334
334
  }
335
335
  /** @oneof */
336
- interface CouponScopeOrMinSubtotalOneOf {
336
+ interface CouponScopeOrMinSubtotalOneOf$1 {
337
337
  /** Limit the coupon to carts with a subtotal above this number. */
338
338
  minimumSubtotal?: number;
339
339
  /** Specifies the type of line items this coupon will apply to. */
340
- scope?: CouponScope;
340
+ scope?: CouponScope$1;
341
341
  }
342
- declare enum DiscountType {
342
+ declare enum DiscountType$1 {
343
343
  UNKNOWN = "UNKNOWN",
344
344
  /** Discount as a fixed amount */
345
345
  FIXED_AMOUNT = "FIXED_AMOUNT",
@@ -348,18 +348,18 @@ declare enum DiscountType {
348
348
  /** Free shipping */
349
349
  FREE_SHIPPING = "FREE_SHIPPING"
350
350
  }
351
- interface FixedAmountDiscount {
351
+ interface FixedAmountDiscount$1 {
352
352
  /** Fixed amount to discount */
353
353
  amount?: number;
354
354
  }
355
- interface PercentageDiscount {
355
+ interface PercentageDiscount$1 {
356
356
  percentage?: number;
357
357
  }
358
- interface CouponScope {
358
+ interface CouponScope$1 {
359
359
  namespace?: string;
360
- group?: Group;
360
+ group?: Group$1;
361
361
  }
362
- interface Group {
362
+ interface Group$1 {
363
363
  name?: string;
364
364
  entityId?: string | null;
365
365
  }
@@ -424,7 +424,7 @@ interface QueryReferredFriendActionsResponseNonNullableFields {
424
424
  coupon?: {
425
425
  _id: string;
426
426
  code: string;
427
- status: Status$1;
427
+ status: Status$2;
428
428
  couponSpecification?: {
429
429
  fixedAmountOptions?: {
430
430
  amount: number;
@@ -440,7 +440,7 @@ interface QueryReferredFriendActionsResponseNonNullableFields {
440
440
  };
441
441
  };
442
442
  name: string;
443
- discountType: DiscountType;
443
+ discountType: DiscountType$1;
444
444
  };
445
445
  };
446
446
  loyaltyPoints?: {
@@ -509,7 +509,7 @@ interface ReferralEventCreatedEnvelope {
509
509
  metadata: EventMetadata$2;
510
510
  }
511
511
  interface QueryCursorResult$2 {
512
- cursors: Cursors$2;
512
+ cursors: Cursors$3;
513
513
  hasNext: () => boolean;
514
514
  hasPrev: () => boolean;
515
515
  length: number;
@@ -582,42 +582,42 @@ interface ReferralEventsQueryBuilder {
582
582
  }
583
583
  interface QueryReferringCustomerTotalsOptions {
584
584
  /** Query to filter ReferringCustomerTotals. */
585
- query?: CursorQuery;
585
+ query?: CursorQuery$1;
586
586
  /** List of contact ids to filter ReferringCustomerTotals. */
587
587
  contactIds?: string[];
588
588
  }
589
589
  interface QueryReferredFriendActionsOptions {
590
590
  /** Query to filter ReferredFriendActions. */
591
- query?: CursorQuery;
591
+ query?: CursorQuery$1;
592
592
  /** List of contact ids to filter ReferredFriendActions. */
593
593
  contactIds?: string[];
594
594
  }
595
595
 
596
- type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
597
- interface HttpClient$2 {
598
- request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
596
+ type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
597
+ interface HttpClient$3 {
598
+ request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
599
599
  fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
600
600
  }
601
- type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
602
- type HttpResponse$2<T = any> = {
601
+ type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
602
+ type HttpResponse$3<T = any> = {
603
603
  data: T;
604
604
  status: number;
605
605
  statusText: string;
606
606
  headers: any;
607
607
  request?: any;
608
608
  };
609
- type RequestOptions$2<_TResponse = any, Data = any> = {
609
+ type RequestOptions$3<_TResponse = any, Data = any> = {
610
610
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
611
611
  url: string;
612
612
  data?: Data;
613
613
  params?: URLSearchParams;
614
- } & APIMetadata$2;
615
- type APIMetadata$2 = {
614
+ } & APIMetadata$3;
615
+ type APIMetadata$3 = {
616
616
  methodFqn?: string;
617
617
  entityFqdn?: string;
618
618
  packageName?: string;
619
619
  };
620
- type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
620
+ type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
621
621
  type EventDefinition$2<Payload = unknown, Type extends string = string> = {
622
622
  __type: 'event-definition';
623
623
  type: Type;
@@ -636,7 +636,7 @@ declare global {
636
636
  }
637
637
  }
638
638
 
639
- declare function getReferralEvent$1(httpClient: HttpClient$2): (referralEventId: string) => Promise<ReferralEvent & {
639
+ declare function getReferralEvent$1(httpClient: HttpClient$3): (referralEventId: string) => Promise<ReferralEvent & {
640
640
  referredFriendSignupEvent?: {
641
641
  referredFriendId: string;
642
642
  } | undefined;
@@ -659,27 +659,377 @@ declare function getReferralEvent$1(httpClient: HttpClient$2): (referralEventId:
659
659
  rewardType: Reward;
660
660
  } | undefined;
661
661
  }>;
662
- declare function queryReferralEvent$1(httpClient: HttpClient$2): () => ReferralEventsQueryBuilder;
663
- declare function getReferralStatistics$1(httpClient: HttpClient$2): () => Promise<GetReferralStatisticsResponse & GetReferralStatisticsResponseNonNullableFields>;
664
- declare function queryReferringCustomerTotals$1(httpClient: HttpClient$2): (options?: QueryReferringCustomerTotalsOptions) => Promise<QueryReferringCustomerTotalsResponse & QueryReferringCustomerTotalsResponseNonNullableFields>;
665
- declare function queryReferredFriendActions$1(httpClient: HttpClient$2): (options?: QueryReferredFriendActionsOptions) => Promise<QueryReferredFriendActionsResponse & QueryReferredFriendActionsResponseNonNullableFields>;
662
+ declare function queryReferralEvent$1(httpClient: HttpClient$3): () => ReferralEventsQueryBuilder;
663
+ declare function getReferralStatistics$1(httpClient: HttpClient$3): () => Promise<GetReferralStatisticsResponse & GetReferralStatisticsResponseNonNullableFields>;
664
+ declare function queryReferringCustomerTotals$1(httpClient: HttpClient$3): (options?: QueryReferringCustomerTotalsOptions) => Promise<QueryReferringCustomerTotalsResponse & QueryReferringCustomerTotalsResponseNonNullableFields>;
665
+ declare function queryReferredFriendActions$1(httpClient: HttpClient$3): (options?: QueryReferredFriendActionsOptions) => Promise<QueryReferredFriendActionsResponse & QueryReferredFriendActionsResponseNonNullableFields>;
666
666
  declare const onReferralEventCreated$1: EventDefinition$2<ReferralEventCreatedEnvelope, "wix.loyalty.referral.v1.referral_event_created">;
667
667
 
668
- declare const getReferralEvent: BuildRESTFunction$2<typeof getReferralEvent$1>;
669
- declare const queryReferralEvent: BuildRESTFunction$2<typeof queryReferralEvent$1>;
670
- declare const getReferralStatistics: BuildRESTFunction$2<typeof getReferralStatistics$1>;
671
- declare const queryReferringCustomerTotals: BuildRESTFunction$2<typeof queryReferringCustomerTotals$1>;
672
- declare const queryReferredFriendActions: BuildRESTFunction$2<typeof queryReferredFriendActions$1>;
668
+ declare const getReferralEvent: BuildRESTFunction$3<typeof getReferralEvent$1>;
669
+ declare const queryReferralEvent: BuildRESTFunction$3<typeof queryReferralEvent$1>;
670
+ declare const getReferralStatistics: BuildRESTFunction$3<typeof getReferralStatistics$1>;
671
+ declare const queryReferringCustomerTotals: BuildRESTFunction$3<typeof queryReferringCustomerTotals$1>;
672
+ declare const queryReferredFriendActions: BuildRESTFunction$3<typeof queryReferredFriendActions$1>;
673
673
  declare const onReferralEventCreated: BuildEventDefinition$2<typeof onReferralEventCreated$1>;
674
674
 
675
- declare const context$2_getReferralEvent: typeof getReferralEvent;
676
- declare const context$2_getReferralStatistics: typeof getReferralStatistics;
677
- declare const context$2_onReferralEventCreated: typeof onReferralEventCreated;
678
- declare const context$2_queryReferralEvent: typeof queryReferralEvent;
679
- declare const context$2_queryReferredFriendActions: typeof queryReferredFriendActions;
680
- declare const context$2_queryReferringCustomerTotals: typeof queryReferringCustomerTotals;
675
+ declare const context$3_getReferralEvent: typeof getReferralEvent;
676
+ declare const context$3_getReferralStatistics: typeof getReferralStatistics;
677
+ declare const context$3_onReferralEventCreated: typeof onReferralEventCreated;
678
+ declare const context$3_queryReferralEvent: typeof queryReferralEvent;
679
+ declare const context$3_queryReferredFriendActions: typeof queryReferredFriendActions;
680
+ declare const context$3_queryReferringCustomerTotals: typeof queryReferringCustomerTotals;
681
+ declare namespace context$3 {
682
+ export { context$3_getReferralEvent as getReferralEvent, context$3_getReferralStatistics as getReferralStatistics, context$3_onReferralEventCreated as onReferralEventCreated, context$3_queryReferralEvent as queryReferralEvent, context$3_queryReferredFriendActions as queryReferredFriendActions, context$3_queryReferringCustomerTotals as queryReferringCustomerTotals };
683
+ }
684
+
685
+ /** ReferralReward is the main entity of ReferralRewards that can be used for lorem ipsum dolor */
686
+ interface ReferralReward extends ReferralRewardReceiverOneOf, ReferralRewardRewardTypeOptionsOneOf {
687
+ /**
688
+ * Referring customer ID.
689
+ * @readonly
690
+ */
691
+ rewardedReferringCustomerId?: string;
692
+ /**
693
+ * Referred friend ID.
694
+ * @readonly
695
+ */
696
+ rewardedReferredFriendId?: string;
697
+ /** Coupon reward type options. */
698
+ coupon?: V1Coupon;
699
+ /** Loyalty points reward type options. */
700
+ loyaltyPoints?: V1LoyaltyPoints;
701
+ /**
702
+ * ReferralReward ID.
703
+ * @readonly
704
+ */
705
+ _id?: string | null;
706
+ /** Represents the current state of an item. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision. */
707
+ revision?: string | null;
708
+ /**
709
+ * Represents the time this ReferralReward was created.
710
+ * @readonly
711
+ */
712
+ _createdDate?: Date;
713
+ /**
714
+ * Represents the time this ReferralReward was last updated.
715
+ * @readonly
716
+ */
717
+ _updatedDate?: Date;
718
+ /** Reward type. */
719
+ rewardType?: RewardTypeType;
720
+ }
721
+ /** @oneof */
722
+ interface ReferralRewardReceiverOneOf {
723
+ /**
724
+ * Referring customer ID.
725
+ * @readonly
726
+ */
727
+ rewardedReferringCustomerId?: string;
728
+ /**
729
+ * Referred friend ID.
730
+ * @readonly
731
+ */
732
+ rewardedReferredFriendId?: string;
733
+ }
734
+ /** @oneof */
735
+ interface ReferralRewardRewardTypeOptionsOneOf {
736
+ /** Coupon reward type options. */
737
+ coupon?: V1Coupon;
738
+ /** Loyalty points reward type options. */
739
+ loyaltyPoints?: V1LoyaltyPoints;
740
+ }
741
+ declare enum RewardTypeType {
742
+ /** Unknown reward type. */
743
+ UNKNOWN = "UNKNOWN",
744
+ /** Coupon reward type. */
745
+ COUPON = "COUPON",
746
+ /** Loyalty points reward type. */
747
+ LOYALTY_POINTS = "LOYALTY_POINTS",
748
+ /** No reward. */
749
+ NOTHING = "NOTHING"
750
+ }
751
+ interface V1Coupon {
752
+ /**
753
+ * Coupon ID.
754
+ * @readonly
755
+ */
756
+ _id?: string;
757
+ /**
758
+ * Coupon code.
759
+ * @readonly
760
+ */
761
+ code?: string;
762
+ /**
763
+ * Coupon status.
764
+ * @readonly
765
+ */
766
+ status?: Status$1;
767
+ /**
768
+ * Coupon specification.
769
+ * @readonly
770
+ */
771
+ couponSpecification?: Coupon;
772
+ }
773
+ declare enum Status$1 {
774
+ /** Unknown coupon status. */
775
+ UNKNOWN = "UNKNOWN",
776
+ /** Coupon is active and can be applied. */
777
+ ACTIVE = "ACTIVE",
778
+ /** Coupon was already applied and can not be used anymore. */
779
+ APPLIED = "APPLIED",
780
+ /** Coupon was deleted. */
781
+ DELETED = "DELETED"
782
+ }
783
+ interface Coupon extends CouponDiscountTypeOptionsOneOf, CouponScopeOrMinSubtotalOneOf {
784
+ /** Options for fixed amount discount type */
785
+ fixedAmountOptions?: FixedAmountDiscount;
786
+ /** Options for percentage discount type */
787
+ percentageOptions?: PercentageDiscount;
788
+ /** Limit the coupon to carts with a subtotal above this number. */
789
+ minimumSubtotal?: number;
790
+ /** Specifies the type of line items this coupon will apply to. */
791
+ scope?: CouponScope;
792
+ /** Coupon name */
793
+ name?: string;
794
+ /** Coupon discount type */
795
+ discountType?: DiscountType;
796
+ /** Limit the coupon to only apply to one item in cart. */
797
+ limitedToOneItem?: boolean | null;
798
+ /** If true, coupon also applies to subscriptions. */
799
+ appliesToSubscriptions?: boolean | null;
800
+ /** Specifies the amount of discounted cycles for subscription item. See Stores Coupons documentation for more info. */
801
+ discountedCycleCount?: number | null;
802
+ }
803
+ /** @oneof */
804
+ interface CouponDiscountTypeOptionsOneOf {
805
+ /** Options for fixed amount discount type */
806
+ fixedAmountOptions?: FixedAmountDiscount;
807
+ /** Options for percentage discount type */
808
+ percentageOptions?: PercentageDiscount;
809
+ }
810
+ /** @oneof */
811
+ interface CouponScopeOrMinSubtotalOneOf {
812
+ /** Limit the coupon to carts with a subtotal above this number. */
813
+ minimumSubtotal?: number;
814
+ /** Specifies the type of line items this coupon will apply to. */
815
+ scope?: CouponScope;
816
+ }
817
+ declare enum DiscountType {
818
+ UNKNOWN = "UNKNOWN",
819
+ /** Discount as a fixed amount */
820
+ FIXED_AMOUNT = "FIXED_AMOUNT",
821
+ /** Discount as a percentage */
822
+ PERCENTAGE = "PERCENTAGE",
823
+ /** Free shipping */
824
+ FREE_SHIPPING = "FREE_SHIPPING"
825
+ }
826
+ interface FixedAmountDiscount {
827
+ /** Fixed amount to discount */
828
+ amount?: number;
829
+ }
830
+ interface PercentageDiscount {
831
+ percentage?: number;
832
+ }
833
+ interface CouponScope {
834
+ namespace?: string;
835
+ group?: Group;
836
+ }
837
+ interface Group {
838
+ name?: string;
839
+ entityId?: string | null;
840
+ }
841
+ interface V1LoyaltyPoints {
842
+ /**
843
+ * Loyalty transaction ID.
844
+ * @readonly
845
+ */
846
+ transactionId?: string;
847
+ /**
848
+ * Loyalty points amount given.
849
+ * @readonly
850
+ */
851
+ amount?: number;
852
+ }
853
+ interface CursorQuery extends CursorQueryPagingMethodOneOf {
854
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
855
+ cursorPaging?: CursorPaging;
856
+ /**
857
+ * Filter object in the following format:
858
+ * `"filter" : {
859
+ * "fieldName1": "value1",
860
+ * "fieldName2":{"$operator":"value2"}
861
+ * }`
862
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
863
+ */
864
+ filter?: Record<string, any> | null;
865
+ /**
866
+ * Sort object in the following format:
867
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
868
+ */
869
+ sort?: Sorting[];
870
+ }
871
+ /** @oneof */
872
+ interface CursorQueryPagingMethodOneOf {
873
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
874
+ cursorPaging?: CursorPaging;
875
+ }
876
+ interface Sorting {
877
+ /** Name of the field to sort by. */
878
+ fieldName?: string;
879
+ /** Sort order. */
880
+ order?: SortOrder;
881
+ }
882
+ declare enum SortOrder {
883
+ ASC = "ASC",
884
+ DESC = "DESC"
885
+ }
886
+ interface CursorPaging {
887
+ /** Maximum number of items to return in the results. */
888
+ limit?: number | null;
889
+ /**
890
+ * Pointer to the next or previous page in the list of results.
891
+ *
892
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
893
+ * Not relevant for the first request.
894
+ */
895
+ cursor?: string | null;
896
+ }
897
+ interface QueryReferralRewardsResponse {
898
+ /** The retrieved ReferralRewards. */
899
+ referralRewards?: ReferralReward[];
900
+ /** Metadata for paging. */
901
+ metadata?: CursorPagingMetadata;
902
+ }
903
+ interface CursorPagingMetadata {
904
+ /** Number of items returned in the response. */
905
+ count?: number | null;
906
+ /** Cursor strings that point to the next page, previous page, or both. */
907
+ cursors?: Cursors$2;
908
+ /**
909
+ * Whether there are more pages to retrieve following the current page.
910
+ *
911
+ * + `true`: Another page of results can be retrieved.
912
+ * + `false`: This is the last page.
913
+ */
914
+ hasNext?: boolean | null;
915
+ }
916
+ interface Cursors$2 {
917
+ /** Cursor string pointing to the next page in the list of results. */
918
+ next?: string | null;
919
+ /** Cursor pointing to the previous page in the list of results. */
920
+ prev?: string | null;
921
+ }
922
+ interface QueryReferralRewardsResponseNonNullableFields {
923
+ referralRewards: {
924
+ rewardedReferringCustomerId: string;
925
+ rewardedReferredFriendId: string;
926
+ coupon?: {
927
+ _id: string;
928
+ code: string;
929
+ status: Status$1;
930
+ couponSpecification?: {
931
+ fixedAmountOptions?: {
932
+ amount: number;
933
+ };
934
+ percentageOptions?: {
935
+ percentage: number;
936
+ };
937
+ minimumSubtotal: number;
938
+ scope?: {
939
+ namespace: string;
940
+ group?: {
941
+ name: string;
942
+ };
943
+ };
944
+ name: string;
945
+ discountType: DiscountType;
946
+ };
947
+ };
948
+ loyaltyPoints?: {
949
+ transactionId: string;
950
+ amount: number;
951
+ };
952
+ rewardType: RewardTypeType;
953
+ }[];
954
+ }
955
+ interface QueryReferralRewardsOptions {
956
+ /** Filter by contact id or set to "me" for current identity's rewards. */
957
+ contactId?: string | null;
958
+ }
959
+
960
+ type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
961
+ interface HttpClient$2 {
962
+ request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
963
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
964
+ }
965
+ type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
966
+ type HttpResponse$2<T = any> = {
967
+ data: T;
968
+ status: number;
969
+ statusText: string;
970
+ headers: any;
971
+ request?: any;
972
+ };
973
+ type RequestOptions$2<_TResponse = any, Data = any> = {
974
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
975
+ url: string;
976
+ data?: Data;
977
+ params?: URLSearchParams;
978
+ } & APIMetadata$2;
979
+ type APIMetadata$2 = {
980
+ methodFqn?: string;
981
+ entityFqdn?: string;
982
+ packageName?: string;
983
+ };
984
+ type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
985
+
986
+ declare global {
987
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
988
+ interface SymbolConstructor {
989
+ readonly observable: symbol;
990
+ }
991
+ }
992
+
993
+ declare function getReferralReward$1(httpClient: HttpClient$2): (_id: string) => Promise<ReferralReward & {
994
+ rewardedReferringCustomerId: string;
995
+ rewardedReferredFriendId: string;
996
+ coupon?: {
997
+ _id: string;
998
+ code: string;
999
+ status: Status$1;
1000
+ couponSpecification?: {
1001
+ fixedAmountOptions?: {
1002
+ amount: number;
1003
+ } | undefined;
1004
+ percentageOptions?: {
1005
+ percentage: number;
1006
+ } | undefined;
1007
+ minimumSubtotal: number;
1008
+ scope?: {
1009
+ namespace: string;
1010
+ group?: {
1011
+ name: string;
1012
+ } | undefined;
1013
+ } | undefined;
1014
+ name: string;
1015
+ discountType: DiscountType;
1016
+ } | undefined;
1017
+ } | undefined;
1018
+ loyaltyPoints?: {
1019
+ transactionId: string;
1020
+ amount: number;
1021
+ } | undefined;
1022
+ rewardType: RewardTypeType;
1023
+ }>;
1024
+ declare function queryReferralRewards$1(httpClient: HttpClient$2): (query: CursorQuery, options?: QueryReferralRewardsOptions) => Promise<QueryReferralRewardsResponse & QueryReferralRewardsResponseNonNullableFields>;
1025
+
1026
+ declare const getReferralReward: BuildRESTFunction$2<typeof getReferralReward$1>;
1027
+ declare const queryReferralRewards: BuildRESTFunction$2<typeof queryReferralRewards$1>;
1028
+
1029
+ declare const context$2_getReferralReward: typeof getReferralReward;
1030
+ declare const context$2_queryReferralRewards: typeof queryReferralRewards;
681
1031
  declare namespace context$2 {
682
- export { context$2_getReferralEvent as getReferralEvent, context$2_getReferralStatistics as getReferralStatistics, context$2_onReferralEventCreated as onReferralEventCreated, context$2_queryReferralEvent as queryReferralEvent, context$2_queryReferredFriendActions as queryReferredFriendActions, context$2_queryReferringCustomerTotals as queryReferringCustomerTotals };
1032
+ export { context$2_getReferralReward as getReferralReward, context$2_queryReferralRewards as queryReferralRewards };
683
1033
  }
684
1034
 
685
1035
  /** ReferredFriend is the main entity of ReferredFriends that can be used for lorem ipsum dolor */
@@ -1341,4 +1691,4 @@ declare namespace context {
1341
1691
  export { context_deleteReferringCustomer as deleteReferringCustomer, context_generateReferringCustomerForContact as generateReferringCustomerForContact, context_getReferringCustomer as getReferringCustomer, context_getReferringCustomerByReferralCode as getReferringCustomerByReferralCode, context_onReferringCustomerCreated as onReferringCustomerCreated, context_onReferringCustomerDeleted as onReferringCustomerDeleted, context_queryReferringCustomers as queryReferringCustomers };
1342
1692
  }
1343
1693
 
1344
- export { context as customers, context$1 as friends, context$2 as tracker };
1694
+ export { context as customers, context$1 as friends, context$2 as rewards, context$3 as tracker };