@wix/referral 1.0.1 → 1.0.2
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.
- package/build/cjs/context.d.ts +2 -0
- package/build/cjs/context.js +3 -1
- package/build/cjs/context.js.map +1 -1
- package/build/cjs/index.d.ts +2 -0
- package/build/cjs/index.js +3 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +2 -0
- package/build/cjs/meta.js +3 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +2 -0
- package/build/es/context.js +2 -0
- package/build/es/context.js.map +1 -1
- package/build/es/index.d.ts +2 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +2 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -1
- package/package.json +5 -4
- package/type-bundles/context.bundle.d.ts +717 -50
- package/type-bundles/index.bundle.d.ts +1246 -138
- package/type-bundles/meta.bundle.d.ts +839 -55
|
@@ -124,11 +124,11 @@ interface GetReferralEventResponse {
|
|
|
124
124
|
}
|
|
125
125
|
interface QueryReferralEventRequest {
|
|
126
126
|
/** Query to filter ReferralEvents. */
|
|
127
|
-
query: CursorQuery;
|
|
127
|
+
query: CursorQuery$2;
|
|
128
128
|
}
|
|
129
|
-
interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
129
|
+
interface CursorQuery$2 extends CursorQueryPagingMethodOneOf$2 {
|
|
130
130
|
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
131
|
-
cursorPaging?: CursorPaging;
|
|
131
|
+
cursorPaging?: CursorPaging$2;
|
|
132
132
|
/**
|
|
133
133
|
* Filter object in the following format:
|
|
134
134
|
* `"filter" : {
|
|
@@ -142,24 +142,24 @@ interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
|
142
142
|
* Sort object in the following format:
|
|
143
143
|
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
144
144
|
*/
|
|
145
|
-
sort?: Sorting[];
|
|
145
|
+
sort?: Sorting$2[];
|
|
146
146
|
}
|
|
147
147
|
/** @oneof */
|
|
148
|
-
interface CursorQueryPagingMethodOneOf {
|
|
148
|
+
interface CursorQueryPagingMethodOneOf$2 {
|
|
149
149
|
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
150
|
-
cursorPaging?: CursorPaging;
|
|
150
|
+
cursorPaging?: CursorPaging$2;
|
|
151
151
|
}
|
|
152
|
-
interface Sorting {
|
|
152
|
+
interface Sorting$2 {
|
|
153
153
|
/** Name of the field to sort by. */
|
|
154
154
|
fieldName?: string;
|
|
155
155
|
/** Sort order. */
|
|
156
|
-
order?: SortOrder;
|
|
156
|
+
order?: SortOrder$2;
|
|
157
157
|
}
|
|
158
|
-
declare enum SortOrder {
|
|
158
|
+
declare enum SortOrder$2 {
|
|
159
159
|
ASC = "ASC",
|
|
160
160
|
DESC = "DESC"
|
|
161
161
|
}
|
|
162
|
-
interface CursorPaging {
|
|
162
|
+
interface CursorPaging$2 {
|
|
163
163
|
/** Maximum number of items to return in the results. */
|
|
164
164
|
limit?: number | null;
|
|
165
165
|
/**
|
|
@@ -174,13 +174,13 @@ interface QueryReferralEventResponse {
|
|
|
174
174
|
/** List of ReferralEvents that match the query. */
|
|
175
175
|
referralEvents?: ReferralEvent[];
|
|
176
176
|
/** Paging metadata. */
|
|
177
|
-
metadata?: CursorPagingMetadata;
|
|
177
|
+
metadata?: CursorPagingMetadata$2;
|
|
178
178
|
}
|
|
179
|
-
interface CursorPagingMetadata {
|
|
179
|
+
interface CursorPagingMetadata$2 {
|
|
180
180
|
/** Number of items returned in the response. */
|
|
181
181
|
count?: number | null;
|
|
182
182
|
/** Cursor strings that point to the next page, previous page, or both. */
|
|
183
|
-
cursors?: Cursors;
|
|
183
|
+
cursors?: Cursors$2;
|
|
184
184
|
/**
|
|
185
185
|
* Whether there are more pages to retrieve following the current page.
|
|
186
186
|
*
|
|
@@ -189,7 +189,7 @@ interface CursorPagingMetadata {
|
|
|
189
189
|
*/
|
|
190
190
|
hasNext?: boolean | null;
|
|
191
191
|
}
|
|
192
|
-
interface Cursors {
|
|
192
|
+
interface Cursors$2 {
|
|
193
193
|
/** Cursor string pointing to the next page in the list of results. */
|
|
194
194
|
next?: string | null;
|
|
195
195
|
/** Cursor pointing to the previous page in the list of results. */
|
|
@@ -207,7 +207,7 @@ interface GetReferralStatisticsResponse {
|
|
|
207
207
|
}
|
|
208
208
|
interface QueryReferringCustomerTotalsRequest {
|
|
209
209
|
/** Query to filter ReferringCustomerTotals. */
|
|
210
|
-
query?: CursorQuery;
|
|
210
|
+
query?: CursorQuery$2;
|
|
211
211
|
/** List of contact ids to filter ReferringCustomerTotals. */
|
|
212
212
|
contactIds?: string[];
|
|
213
213
|
}
|
|
@@ -215,7 +215,7 @@ interface QueryReferringCustomerTotalsResponse {
|
|
|
215
215
|
/** List of ReferringCustomerTotals that match the query. */
|
|
216
216
|
referringCustomerTotals?: ReferringCustomerTotal[];
|
|
217
217
|
/** Paging metadata. */
|
|
218
|
-
metadata?: CursorPagingMetadata;
|
|
218
|
+
metadata?: CursorPagingMetadata$2;
|
|
219
219
|
}
|
|
220
220
|
interface ReferringCustomerTotal {
|
|
221
221
|
/**
|
|
@@ -256,7 +256,7 @@ interface ReferringCustomerTotal {
|
|
|
256
256
|
}
|
|
257
257
|
interface QueryReferredFriendActionsRequest {
|
|
258
258
|
/** Query to filter ReferredFriendActions. */
|
|
259
|
-
query?: CursorQuery;
|
|
259
|
+
query?: CursorQuery$2;
|
|
260
260
|
/** List of contact ids to filter ReferredFriendActions. */
|
|
261
261
|
contactIds?: string[];
|
|
262
262
|
}
|
|
@@ -264,7 +264,7 @@ interface QueryReferredFriendActionsResponse {
|
|
|
264
264
|
/** List of ReferredFriendActions that match the query. */
|
|
265
265
|
referredFriendActions?: ReferredFriendAction[];
|
|
266
266
|
/** Paging metadata. */
|
|
267
|
-
metadata?: CursorPagingMetadata;
|
|
267
|
+
metadata?: CursorPagingMetadata$2;
|
|
268
268
|
}
|
|
269
269
|
interface ReferredFriendAction extends ReferredFriendActionRewardTypeOptionsOneOf {
|
|
270
270
|
/** Coupon reward type options. */
|
|
@@ -328,14 +328,14 @@ interface V1Coupon {
|
|
|
328
328
|
* Coupon status.
|
|
329
329
|
* @readonly
|
|
330
330
|
*/
|
|
331
|
-
status?: Status;
|
|
331
|
+
status?: Status$1;
|
|
332
332
|
/**
|
|
333
333
|
* Coupon specification.
|
|
334
334
|
* @readonly
|
|
335
335
|
*/
|
|
336
336
|
couponSpecification?: Coupon;
|
|
337
337
|
}
|
|
338
|
-
declare enum Status {
|
|
338
|
+
declare enum Status$1 {
|
|
339
339
|
/** Unknown coupon status. */
|
|
340
340
|
UNKNOWN = "UNKNOWN",
|
|
341
341
|
/** Coupon is active and can be applied. */
|
|
@@ -415,11 +415,11 @@ interface LoyaltyPoints {
|
|
|
415
415
|
*/
|
|
416
416
|
amount?: number;
|
|
417
417
|
}
|
|
418
|
-
interface DomainEvent extends DomainEventBodyOneOf {
|
|
419
|
-
createdEvent?: EntityCreatedEvent;
|
|
420
|
-
updatedEvent?: EntityUpdatedEvent;
|
|
421
|
-
deletedEvent?: EntityDeletedEvent;
|
|
422
|
-
actionEvent?: ActionEvent;
|
|
418
|
+
interface DomainEvent$2 extends DomainEventBodyOneOf$2 {
|
|
419
|
+
createdEvent?: EntityCreatedEvent$2;
|
|
420
|
+
updatedEvent?: EntityUpdatedEvent$2;
|
|
421
|
+
deletedEvent?: EntityDeletedEvent$2;
|
|
422
|
+
actionEvent?: ActionEvent$2;
|
|
423
423
|
/**
|
|
424
424
|
* Unique event ID.
|
|
425
425
|
* Allows clients to ignore duplicate webhooks.
|
|
@@ -458,19 +458,19 @@ interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
458
458
|
entityEventSequence?: string | null;
|
|
459
459
|
}
|
|
460
460
|
/** @oneof */
|
|
461
|
-
interface DomainEventBodyOneOf {
|
|
462
|
-
createdEvent?: EntityCreatedEvent;
|
|
463
|
-
updatedEvent?: EntityUpdatedEvent;
|
|
464
|
-
deletedEvent?: EntityDeletedEvent;
|
|
465
|
-
actionEvent?: ActionEvent;
|
|
461
|
+
interface DomainEventBodyOneOf$2 {
|
|
462
|
+
createdEvent?: EntityCreatedEvent$2;
|
|
463
|
+
updatedEvent?: EntityUpdatedEvent$2;
|
|
464
|
+
deletedEvent?: EntityDeletedEvent$2;
|
|
465
|
+
actionEvent?: ActionEvent$2;
|
|
466
466
|
}
|
|
467
|
-
interface EntityCreatedEvent {
|
|
467
|
+
interface EntityCreatedEvent$2 {
|
|
468
468
|
entity?: string;
|
|
469
469
|
}
|
|
470
|
-
interface UndeleteInfo {
|
|
470
|
+
interface UndeleteInfo$2 {
|
|
471
471
|
deletedDate?: Date;
|
|
472
472
|
}
|
|
473
|
-
interface EntityUpdatedEvent {
|
|
473
|
+
interface EntityUpdatedEvent$2 {
|
|
474
474
|
/**
|
|
475
475
|
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
476
476
|
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
@@ -478,58 +478,65 @@ interface EntityUpdatedEvent {
|
|
|
478
478
|
*/
|
|
479
479
|
currentEntity?: string;
|
|
480
480
|
}
|
|
481
|
-
interface EntityDeletedEvent {
|
|
481
|
+
interface EntityDeletedEvent$2 {
|
|
482
482
|
/** Entity that was deleted */
|
|
483
483
|
deletedEntity?: string | null;
|
|
484
484
|
}
|
|
485
|
-
interface ActionEvent {
|
|
485
|
+
interface ActionEvent$2 {
|
|
486
486
|
body?: string;
|
|
487
487
|
}
|
|
488
|
-
interface Empty {
|
|
488
|
+
interface Empty$1 {
|
|
489
489
|
}
|
|
490
|
-
interface SuccessfulReferralEvent {
|
|
491
|
-
/** ReferredFriend that completed his referral details */
|
|
492
|
-
referredFriendDetails?: ReferredFriendDetails;
|
|
490
|
+
interface SuccessfulReferralEvent$1 {
|
|
491
|
+
/** ReferredFriend that completed his referral details. */
|
|
492
|
+
referredFriendDetails?: ReferredFriendDetails$1;
|
|
493
493
|
}
|
|
494
|
-
interface ReferredFriendDetails {
|
|
494
|
+
interface ReferredFriendDetails$1 {
|
|
495
495
|
/**
|
|
496
|
-
* ReferredFriend ID
|
|
496
|
+
* ReferredFriend ID.
|
|
497
497
|
* @readonly
|
|
498
498
|
*/
|
|
499
499
|
referredFriendId?: string;
|
|
500
500
|
/**
|
|
501
|
-
* ReferredFriend Contact ID
|
|
501
|
+
* ReferredFriend Contact ID.
|
|
502
502
|
* @readonly
|
|
503
503
|
*/
|
|
504
504
|
contactId?: string;
|
|
505
505
|
/**
|
|
506
|
-
* Customer who referred this ReferredFriend
|
|
506
|
+
* Customer who referred this ReferredFriend.
|
|
507
507
|
* @readonly
|
|
508
508
|
*/
|
|
509
509
|
referringCustomerId?: string;
|
|
510
510
|
}
|
|
511
511
|
interface ReferredFriendActionEvent {
|
|
512
|
-
|
|
512
|
+
/** ReferredFriend details. */
|
|
513
|
+
referredFriendDetails?: ReferredFriendDetails$1;
|
|
514
|
+
/** Trigger details. */
|
|
513
515
|
trigger?: Trigger;
|
|
516
|
+
/** Amount. */
|
|
514
517
|
amount?: string | null;
|
|
518
|
+
/** Currency. */
|
|
515
519
|
currency?: string | null;
|
|
520
|
+
/** Order ID. */
|
|
516
521
|
orderId?: string | null;
|
|
517
522
|
}
|
|
518
523
|
interface Trigger {
|
|
524
|
+
/** App ID. */
|
|
519
525
|
appId?: string;
|
|
526
|
+
/** Activity type. */
|
|
520
527
|
activityType?: string;
|
|
521
528
|
}
|
|
522
|
-
interface MessageEnvelope {
|
|
529
|
+
interface MessageEnvelope$2 {
|
|
523
530
|
/** App instance ID. */
|
|
524
531
|
instanceId?: string | null;
|
|
525
532
|
/** Event type. */
|
|
526
533
|
eventType?: string;
|
|
527
534
|
/** The identification type and identity data. */
|
|
528
|
-
identity?: IdentificationData;
|
|
535
|
+
identity?: IdentificationData$2;
|
|
529
536
|
/** Stringify payload. */
|
|
530
537
|
data?: string;
|
|
531
538
|
}
|
|
532
|
-
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
539
|
+
interface IdentificationData$2 extends IdentificationDataIdOneOf$2 {
|
|
533
540
|
/** ID of a site visitor that has not logged in to the site. */
|
|
534
541
|
anonymousVisitorId?: string;
|
|
535
542
|
/** ID of a site visitor that has logged in to the site. */
|
|
@@ -539,10 +546,10 @@ interface IdentificationData extends IdentificationDataIdOneOf {
|
|
|
539
546
|
/** ID of an app. */
|
|
540
547
|
appId?: string;
|
|
541
548
|
/** @readonly */
|
|
542
|
-
identityType?: WebhookIdentityType;
|
|
549
|
+
identityType?: WebhookIdentityType$2;
|
|
543
550
|
}
|
|
544
551
|
/** @oneof */
|
|
545
|
-
interface IdentificationDataIdOneOf {
|
|
552
|
+
interface IdentificationDataIdOneOf$2 {
|
|
546
553
|
/** ID of a site visitor that has not logged in to the site. */
|
|
547
554
|
anonymousVisitorId?: string;
|
|
548
555
|
/** ID of a site visitor that has logged in to the site. */
|
|
@@ -552,7 +559,7 @@ interface IdentificationDataIdOneOf {
|
|
|
552
559
|
/** ID of an app. */
|
|
553
560
|
appId?: string;
|
|
554
561
|
}
|
|
555
|
-
declare enum WebhookIdentityType {
|
|
562
|
+
declare enum WebhookIdentityType$2 {
|
|
556
563
|
UNKNOWN = "UNKNOWN",
|
|
557
564
|
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
558
565
|
MEMBER = "MEMBER",
|
|
@@ -628,7 +635,7 @@ interface QueryReferredFriendActionsResponseNonNullableFields {
|
|
|
628
635
|
coupon?: {
|
|
629
636
|
_id: string;
|
|
630
637
|
code: string;
|
|
631
|
-
status: Status;
|
|
638
|
+
status: Status$1;
|
|
632
639
|
couponSpecification?: {
|
|
633
640
|
fixedAmountOptions?: {
|
|
634
641
|
amount: number;
|
|
@@ -662,15 +669,15 @@ interface QueryReferredFriendActionsResponseNonNullableFields {
|
|
|
662
669
|
totalAmountSpent: string;
|
|
663
670
|
}[];
|
|
664
671
|
}
|
|
665
|
-
interface BaseEventMetadata {
|
|
672
|
+
interface BaseEventMetadata$2 {
|
|
666
673
|
/** App instance ID. */
|
|
667
674
|
instanceId?: string | null;
|
|
668
675
|
/** Event type. */
|
|
669
676
|
eventType?: string;
|
|
670
677
|
/** The identification type and identity data. */
|
|
671
|
-
identity?: IdentificationData;
|
|
678
|
+
identity?: IdentificationData$2;
|
|
672
679
|
}
|
|
673
|
-
interface EventMetadata extends BaseEventMetadata {
|
|
680
|
+
interface EventMetadata$2 extends BaseEventMetadata$2 {
|
|
674
681
|
/**
|
|
675
682
|
* Unique event ID.
|
|
676
683
|
* Allows clients to ignore duplicate webhooks.
|
|
@@ -710,16 +717,16 @@ interface EventMetadata extends BaseEventMetadata {
|
|
|
710
717
|
}
|
|
711
718
|
interface ReferralEventCreatedEnvelope {
|
|
712
719
|
entity: ReferralEvent;
|
|
713
|
-
metadata: EventMetadata;
|
|
720
|
+
metadata: EventMetadata$2;
|
|
714
721
|
}
|
|
715
|
-
interface QueryCursorResult {
|
|
716
|
-
cursors: Cursors;
|
|
722
|
+
interface QueryCursorResult$2 {
|
|
723
|
+
cursors: Cursors$2;
|
|
717
724
|
hasNext: () => boolean;
|
|
718
725
|
hasPrev: () => boolean;
|
|
719
726
|
length: number;
|
|
720
727
|
pageSize: number;
|
|
721
728
|
}
|
|
722
|
-
interface ReferralEventsQueryResult extends QueryCursorResult {
|
|
729
|
+
interface ReferralEventsQueryResult extends QueryCursorResult$2 {
|
|
723
730
|
items: ReferralEvent[];
|
|
724
731
|
query: ReferralEventsQueryBuilder;
|
|
725
732
|
next: () => Promise<ReferralEventsQueryResult>;
|
|
@@ -786,52 +793,60 @@ interface ReferralEventsQueryBuilder {
|
|
|
786
793
|
}
|
|
787
794
|
interface QueryReferringCustomerTotalsOptions {
|
|
788
795
|
/** Query to filter ReferringCustomerTotals. */
|
|
789
|
-
query?: CursorQuery;
|
|
796
|
+
query?: CursorQuery$2;
|
|
790
797
|
/** List of contact ids to filter ReferringCustomerTotals. */
|
|
791
798
|
contactIds?: string[];
|
|
792
799
|
}
|
|
793
800
|
interface QueryReferredFriendActionsOptions {
|
|
794
801
|
/** Query to filter ReferredFriendActions. */
|
|
795
|
-
query?: CursorQuery;
|
|
802
|
+
query?: CursorQuery$2;
|
|
796
803
|
/** List of contact ids to filter ReferredFriendActions. */
|
|
797
804
|
contactIds?: string[];
|
|
798
805
|
}
|
|
799
806
|
|
|
800
|
-
interface HttpClient {
|
|
801
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
807
|
+
interface HttpClient$2 {
|
|
808
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
|
|
809
|
+
fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
|
|
802
810
|
}
|
|
803
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
804
|
-
type HttpResponse<T = any> = {
|
|
811
|
+
type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
|
|
812
|
+
type HttpResponse$2<T = any> = {
|
|
805
813
|
data: T;
|
|
806
814
|
status: number;
|
|
807
815
|
statusText: string;
|
|
808
816
|
headers: any;
|
|
809
817
|
request?: any;
|
|
810
818
|
};
|
|
811
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
819
|
+
type RequestOptions$2<_TResponse = any, Data = any> = {
|
|
812
820
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
813
821
|
url: string;
|
|
814
822
|
data?: Data;
|
|
815
823
|
params?: URLSearchParams;
|
|
816
|
-
} & APIMetadata;
|
|
817
|
-
type APIMetadata = {
|
|
824
|
+
} & APIMetadata$2;
|
|
825
|
+
type APIMetadata$2 = {
|
|
818
826
|
methodFqn?: string;
|
|
819
827
|
entityFqdn?: string;
|
|
820
828
|
packageName?: string;
|
|
821
829
|
};
|
|
822
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
830
|
+
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
823
831
|
__type: 'event-definition';
|
|
824
832
|
type: Type;
|
|
825
833
|
isDomainEvent?: boolean;
|
|
826
|
-
transformations?: unknown;
|
|
834
|
+
transformations?: (envelope: unknown) => Payload;
|
|
827
835
|
__payload: Payload;
|
|
828
836
|
};
|
|
829
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean,
|
|
837
|
+
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
830
838
|
|
|
831
|
-
declare
|
|
839
|
+
declare global {
|
|
840
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
841
|
+
interface SymbolConstructor {
|
|
842
|
+
readonly observable: symbol;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
declare const __metadata$2: {
|
|
832
847
|
PACKAGE_NAME: string;
|
|
833
848
|
};
|
|
834
|
-
declare function getReferralEvent(httpClient: HttpClient): (referralEventId: string) => Promise<ReferralEvent & {
|
|
849
|
+
declare function getReferralEvent(httpClient: HttpClient$2): (referralEventId: string) => Promise<ReferralEvent & {
|
|
835
850
|
referredFriendSignupEvent?: {
|
|
836
851
|
referredFriendId: string;
|
|
837
852
|
} | undefined;
|
|
@@ -854,96 +869,1189 @@ declare function getReferralEvent(httpClient: HttpClient): (referralEventId: str
|
|
|
854
869
|
rewardType: Reward;
|
|
855
870
|
} | undefined;
|
|
856
871
|
}>;
|
|
857
|
-
declare function queryReferralEvent(httpClient: HttpClient): () => ReferralEventsQueryBuilder;
|
|
858
|
-
declare function getReferralStatistics(httpClient: HttpClient): () => Promise<GetReferralStatisticsResponse & GetReferralStatisticsResponseNonNullableFields>;
|
|
859
|
-
declare function queryReferringCustomerTotals(httpClient: HttpClient): (options?: QueryReferringCustomerTotalsOptions) => Promise<QueryReferringCustomerTotalsResponse & QueryReferringCustomerTotalsResponseNonNullableFields>;
|
|
860
|
-
declare function queryReferredFriendActions(httpClient: HttpClient): (options?: QueryReferredFriendActionsOptions) => Promise<QueryReferredFriendActionsResponse & QueryReferredFriendActionsResponseNonNullableFields>;
|
|
861
|
-
declare const onReferralEventCreated: EventDefinition<ReferralEventCreatedEnvelope, "wix.loyalty.referral.v1.referral_event_created">;
|
|
872
|
+
declare function queryReferralEvent(httpClient: HttpClient$2): () => ReferralEventsQueryBuilder;
|
|
873
|
+
declare function getReferralStatistics(httpClient: HttpClient$2): () => Promise<GetReferralStatisticsResponse & GetReferralStatisticsResponseNonNullableFields>;
|
|
874
|
+
declare function queryReferringCustomerTotals(httpClient: HttpClient$2): (options?: QueryReferringCustomerTotalsOptions) => Promise<QueryReferringCustomerTotalsResponse & QueryReferringCustomerTotalsResponseNonNullableFields>;
|
|
875
|
+
declare function queryReferredFriendActions(httpClient: HttpClient$2): (options?: QueryReferredFriendActionsOptions) => Promise<QueryReferredFriendActionsResponse & QueryReferredFriendActionsResponseNonNullableFields>;
|
|
876
|
+
declare const onReferralEventCreated: EventDefinition$2<ReferralEventCreatedEnvelope, "wix.loyalty.referral.v1.referral_event_created">;
|
|
877
|
+
|
|
878
|
+
type index_d$2_Coupon = Coupon;
|
|
879
|
+
type index_d$2_CouponDiscountTypeOptionsOneOf = CouponDiscountTypeOptionsOneOf;
|
|
880
|
+
type index_d$2_CouponScope = CouponScope;
|
|
881
|
+
type index_d$2_CouponScopeOrMinSubtotalOneOf = CouponScopeOrMinSubtotalOneOf;
|
|
882
|
+
type index_d$2_CreateReferralEventRequest = CreateReferralEventRequest;
|
|
883
|
+
type index_d$2_CreateReferralEventResponse = CreateReferralEventResponse;
|
|
884
|
+
type index_d$2_DiscountType = DiscountType;
|
|
885
|
+
declare const index_d$2_DiscountType: typeof DiscountType;
|
|
886
|
+
type index_d$2_FixedAmountDiscount = FixedAmountDiscount;
|
|
887
|
+
type index_d$2_GetReferralEventRequest = GetReferralEventRequest;
|
|
888
|
+
type index_d$2_GetReferralEventResponse = GetReferralEventResponse;
|
|
889
|
+
type index_d$2_GetReferralEventResponseNonNullableFields = GetReferralEventResponseNonNullableFields;
|
|
890
|
+
type index_d$2_GetReferralStatisticsRequest = GetReferralStatisticsRequest;
|
|
891
|
+
type index_d$2_GetReferralStatisticsResponse = GetReferralStatisticsResponse;
|
|
892
|
+
type index_d$2_GetReferralStatisticsResponseNonNullableFields = GetReferralStatisticsResponseNonNullableFields;
|
|
893
|
+
type index_d$2_Group = Group;
|
|
894
|
+
type index_d$2_LoyaltyPoints = LoyaltyPoints;
|
|
895
|
+
type index_d$2_PercentageDiscount = PercentageDiscount;
|
|
896
|
+
type index_d$2_QueryReferralEventRequest = QueryReferralEventRequest;
|
|
897
|
+
type index_d$2_QueryReferralEventResponse = QueryReferralEventResponse;
|
|
898
|
+
type index_d$2_QueryReferralEventResponseNonNullableFields = QueryReferralEventResponseNonNullableFields;
|
|
899
|
+
type index_d$2_QueryReferredFriendActionsOptions = QueryReferredFriendActionsOptions;
|
|
900
|
+
type index_d$2_QueryReferredFriendActionsRequest = QueryReferredFriendActionsRequest;
|
|
901
|
+
type index_d$2_QueryReferredFriendActionsResponse = QueryReferredFriendActionsResponse;
|
|
902
|
+
type index_d$2_QueryReferredFriendActionsResponseNonNullableFields = QueryReferredFriendActionsResponseNonNullableFields;
|
|
903
|
+
type index_d$2_QueryReferringCustomerTotalsOptions = QueryReferringCustomerTotalsOptions;
|
|
904
|
+
type index_d$2_QueryReferringCustomerTotalsRequest = QueryReferringCustomerTotalsRequest;
|
|
905
|
+
type index_d$2_QueryReferringCustomerTotalsResponse = QueryReferringCustomerTotalsResponse;
|
|
906
|
+
type index_d$2_QueryReferringCustomerTotalsResponseNonNullableFields = QueryReferringCustomerTotalsResponseNonNullableFields;
|
|
907
|
+
type index_d$2_ReferralEvent = ReferralEvent;
|
|
908
|
+
type index_d$2_ReferralEventCreatedEnvelope = ReferralEventCreatedEnvelope;
|
|
909
|
+
type index_d$2_ReferralEventEventTypeOneOf = ReferralEventEventTypeOneOf;
|
|
910
|
+
type index_d$2_ReferralEventsQueryBuilder = ReferralEventsQueryBuilder;
|
|
911
|
+
type index_d$2_ReferralEventsQueryResult = ReferralEventsQueryResult;
|
|
912
|
+
type index_d$2_ReferredFriendAction = ReferredFriendAction;
|
|
913
|
+
type index_d$2_ReferredFriendActionEvent = ReferredFriendActionEvent;
|
|
914
|
+
type index_d$2_ReferredFriendActionRewardTypeOptionsOneOf = ReferredFriendActionRewardTypeOptionsOneOf;
|
|
915
|
+
type index_d$2_ReferredFriendSignupEvent = ReferredFriendSignupEvent;
|
|
916
|
+
type index_d$2_ReferringCustomerTotal = ReferringCustomerTotal;
|
|
917
|
+
type index_d$2_Reward = Reward;
|
|
918
|
+
declare const index_d$2_Reward: typeof Reward;
|
|
919
|
+
type index_d$2_RewardEvent = RewardEvent;
|
|
920
|
+
type index_d$2_RewardEventReceiverOneOf = RewardEventReceiverOneOf;
|
|
921
|
+
type index_d$2_Trigger = Trigger;
|
|
922
|
+
type index_d$2_V1ActionEvent = V1ActionEvent;
|
|
923
|
+
type index_d$2_V1Coupon = V1Coupon;
|
|
924
|
+
type index_d$2_V1SuccessfulReferralEvent = V1SuccessfulReferralEvent;
|
|
925
|
+
type index_d$2_V1Trigger = V1Trigger;
|
|
926
|
+
declare const index_d$2_getReferralEvent: typeof getReferralEvent;
|
|
927
|
+
declare const index_d$2_getReferralStatistics: typeof getReferralStatistics;
|
|
928
|
+
declare const index_d$2_onReferralEventCreated: typeof onReferralEventCreated;
|
|
929
|
+
declare const index_d$2_queryReferralEvent: typeof queryReferralEvent;
|
|
930
|
+
declare const index_d$2_queryReferredFriendActions: typeof queryReferredFriendActions;
|
|
931
|
+
declare const index_d$2_queryReferringCustomerTotals: typeof queryReferringCustomerTotals;
|
|
932
|
+
declare namespace index_d$2 {
|
|
933
|
+
export { type ActionEvent$2 as ActionEvent, type BaseEventMetadata$2 as BaseEventMetadata, type index_d$2_Coupon as Coupon, type index_d$2_CouponDiscountTypeOptionsOneOf as CouponDiscountTypeOptionsOneOf, type index_d$2_CouponScope as CouponScope, type index_d$2_CouponScopeOrMinSubtotalOneOf as CouponScopeOrMinSubtotalOneOf, type index_d$2_CreateReferralEventRequest as CreateReferralEventRequest, type index_d$2_CreateReferralEventResponse as CreateReferralEventResponse, type CursorPaging$2 as CursorPaging, type CursorPagingMetadata$2 as CursorPagingMetadata, type CursorQuery$2 as CursorQuery, type CursorQueryPagingMethodOneOf$2 as CursorQueryPagingMethodOneOf, type Cursors$2 as Cursors, index_d$2_DiscountType as DiscountType, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type index_d$2_FixedAmountDiscount as FixedAmountDiscount, type index_d$2_GetReferralEventRequest as GetReferralEventRequest, type index_d$2_GetReferralEventResponse as GetReferralEventResponse, type index_d$2_GetReferralEventResponseNonNullableFields as GetReferralEventResponseNonNullableFields, type index_d$2_GetReferralStatisticsRequest as GetReferralStatisticsRequest, type index_d$2_GetReferralStatisticsResponse as GetReferralStatisticsResponse, type index_d$2_GetReferralStatisticsResponseNonNullableFields as GetReferralStatisticsResponseNonNullableFields, type index_d$2_Group as Group, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type index_d$2_LoyaltyPoints as LoyaltyPoints, type MessageEnvelope$2 as MessageEnvelope, type index_d$2_PercentageDiscount as PercentageDiscount, type index_d$2_QueryReferralEventRequest as QueryReferralEventRequest, type index_d$2_QueryReferralEventResponse as QueryReferralEventResponse, type index_d$2_QueryReferralEventResponseNonNullableFields as QueryReferralEventResponseNonNullableFields, type index_d$2_QueryReferredFriendActionsOptions as QueryReferredFriendActionsOptions, type index_d$2_QueryReferredFriendActionsRequest as QueryReferredFriendActionsRequest, type index_d$2_QueryReferredFriendActionsResponse as QueryReferredFriendActionsResponse, type index_d$2_QueryReferredFriendActionsResponseNonNullableFields as QueryReferredFriendActionsResponseNonNullableFields, type index_d$2_QueryReferringCustomerTotalsOptions as QueryReferringCustomerTotalsOptions, type index_d$2_QueryReferringCustomerTotalsRequest as QueryReferringCustomerTotalsRequest, type index_d$2_QueryReferringCustomerTotalsResponse as QueryReferringCustomerTotalsResponse, type index_d$2_QueryReferringCustomerTotalsResponseNonNullableFields as QueryReferringCustomerTotalsResponseNonNullableFields, type index_d$2_ReferralEvent as ReferralEvent, type index_d$2_ReferralEventCreatedEnvelope as ReferralEventCreatedEnvelope, type index_d$2_ReferralEventEventTypeOneOf as ReferralEventEventTypeOneOf, type index_d$2_ReferralEventsQueryBuilder as ReferralEventsQueryBuilder, type index_d$2_ReferralEventsQueryResult as ReferralEventsQueryResult, type index_d$2_ReferredFriendAction as ReferredFriendAction, type index_d$2_ReferredFriendActionEvent as ReferredFriendActionEvent, type index_d$2_ReferredFriendActionRewardTypeOptionsOneOf as ReferredFriendActionRewardTypeOptionsOneOf, type ReferredFriendDetails$1 as ReferredFriendDetails, type index_d$2_ReferredFriendSignupEvent as ReferredFriendSignupEvent, type index_d$2_ReferringCustomerTotal as ReferringCustomerTotal, index_d$2_Reward as Reward, type index_d$2_RewardEvent as RewardEvent, type index_d$2_RewardEventReceiverOneOf as RewardEventReceiverOneOf, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, Status$1 as Status, type SuccessfulReferralEvent$1 as SuccessfulReferralEvent, type index_d$2_Trigger as Trigger, type UndeleteInfo$2 as UndeleteInfo, type index_d$2_V1ActionEvent as V1ActionEvent, type index_d$2_V1Coupon as V1Coupon, type index_d$2_V1SuccessfulReferralEvent as V1SuccessfulReferralEvent, type index_d$2_V1Trigger as V1Trigger, WebhookIdentityType$2 as WebhookIdentityType, __metadata$2 as __metadata, index_d$2_getReferralEvent as getReferralEvent, index_d$2_getReferralStatistics as getReferralStatistics, index_d$2_onReferralEventCreated as onReferralEventCreated, index_d$2_queryReferralEvent as queryReferralEvent, index_d$2_queryReferredFriendActions as queryReferredFriendActions, index_d$2_queryReferringCustomerTotals as queryReferringCustomerTotals };
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
/** ReferredFriend is the main entity of ReferredFriends that can be used for lorem ipsum dolor */
|
|
937
|
+
interface ReferredFriend {
|
|
938
|
+
/**
|
|
939
|
+
* ReferredFriend ID.
|
|
940
|
+
* @readonly
|
|
941
|
+
*/
|
|
942
|
+
_id?: string;
|
|
943
|
+
/**
|
|
944
|
+
* ReferredFriend Contact ID.
|
|
945
|
+
* @readonly
|
|
946
|
+
*/
|
|
947
|
+
contactId?: string;
|
|
948
|
+
/**
|
|
949
|
+
* Customer who referred.
|
|
950
|
+
* @readonly
|
|
951
|
+
*/
|
|
952
|
+
referringCustomerId?: string;
|
|
953
|
+
/** Status of the ReferredFriend. */
|
|
954
|
+
status?: Status;
|
|
955
|
+
/**
|
|
956
|
+
* Represents the current state of an item. Each time the item is modified, its `revision` changes by the server. for an update operation to succeed, you MUST pass the latest revision.
|
|
957
|
+
* @readonly
|
|
958
|
+
*/
|
|
959
|
+
revision?: string | null;
|
|
960
|
+
/**
|
|
961
|
+
* Represents the time this ReferredFriend was created.
|
|
962
|
+
* @readonly
|
|
963
|
+
*/
|
|
964
|
+
_createdDate?: Date;
|
|
965
|
+
/**
|
|
966
|
+
* Represents the time this ReferredFriend was last updated.
|
|
967
|
+
* @readonly
|
|
968
|
+
*/
|
|
969
|
+
_updatedDate?: Date;
|
|
970
|
+
}
|
|
971
|
+
declare enum Status {
|
|
972
|
+
/** Unknown status. */
|
|
973
|
+
UNKNOWN = "UNKNOWN",
|
|
974
|
+
/** Initial status, when Referred friend joins site as member. */
|
|
975
|
+
SIGN_UP_COMPLETED = "SIGN_UP_COMPLETED",
|
|
976
|
+
/** After complete some actions (eg. Purchase Order), Action Completed Status is used. */
|
|
977
|
+
ACTIONS_COMPLETED = "ACTIONS_COMPLETED"
|
|
978
|
+
}
|
|
979
|
+
interface CreateReferredFriendRequest {
|
|
980
|
+
}
|
|
981
|
+
interface CreateReferredFriendResponse {
|
|
982
|
+
/** The created ReferredFriend. */
|
|
983
|
+
referredFriend?: ReferredFriend;
|
|
984
|
+
}
|
|
985
|
+
interface GetReferredFriendRequest {
|
|
986
|
+
/** Id of the ReferredFriend to retrieve. */
|
|
987
|
+
referredFriendId: string;
|
|
988
|
+
}
|
|
989
|
+
interface GetReferredFriendResponse {
|
|
990
|
+
/** The retrieved ReferredFriend. */
|
|
991
|
+
referredFriend?: ReferredFriend;
|
|
992
|
+
}
|
|
993
|
+
interface GetReferredFriendByContactIdRequest {
|
|
994
|
+
/** Contact id or "me" to get current identity's Contact. */
|
|
995
|
+
contactId: string;
|
|
996
|
+
}
|
|
997
|
+
interface GetReferredFriendByContactIdResponse {
|
|
998
|
+
/** The retrieved ReferredFriend. */
|
|
999
|
+
referredFriend?: ReferredFriend;
|
|
1000
|
+
}
|
|
1001
|
+
interface UpdateReferredFriendRequest {
|
|
1002
|
+
/** ReferredFriend to be updated, may be partial. */
|
|
1003
|
+
referredFriend: ReferredFriend;
|
|
1004
|
+
}
|
|
1005
|
+
interface UpdateReferredFriendResponse {
|
|
1006
|
+
/** The updated ReferredFriend. */
|
|
1007
|
+
referredFriend?: ReferredFriend;
|
|
1008
|
+
}
|
|
1009
|
+
interface DeleteReferredFriendRequest {
|
|
1010
|
+
/** Id of the ReferredFriend to delete. */
|
|
1011
|
+
referredFriendId: string;
|
|
1012
|
+
/** The revision of the ReferredFriend. */
|
|
1013
|
+
revision?: string;
|
|
1014
|
+
}
|
|
1015
|
+
interface DeleteReferredFriendResponse {
|
|
1016
|
+
}
|
|
1017
|
+
interface QueryReferredFriendRequest {
|
|
1018
|
+
/** Query options. */
|
|
1019
|
+
query: CursorQuery$1;
|
|
1020
|
+
}
|
|
1021
|
+
interface CursorQuery$1 extends CursorQueryPagingMethodOneOf$1 {
|
|
1022
|
+
/** 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`. */
|
|
1023
|
+
cursorPaging?: CursorPaging$1;
|
|
1024
|
+
/**
|
|
1025
|
+
* Filter object in the following format:
|
|
1026
|
+
* `"filter" : {
|
|
1027
|
+
* "fieldName1": "value1",
|
|
1028
|
+
* "fieldName2":{"$operator":"value2"}
|
|
1029
|
+
* }`
|
|
1030
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
1031
|
+
*/
|
|
1032
|
+
filter?: Record<string, any> | null;
|
|
1033
|
+
/**
|
|
1034
|
+
* Sort object in the following format:
|
|
1035
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
1036
|
+
*/
|
|
1037
|
+
sort?: Sorting$1[];
|
|
1038
|
+
}
|
|
1039
|
+
/** @oneof */
|
|
1040
|
+
interface CursorQueryPagingMethodOneOf$1 {
|
|
1041
|
+
/** 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`. */
|
|
1042
|
+
cursorPaging?: CursorPaging$1;
|
|
1043
|
+
}
|
|
1044
|
+
interface Sorting$1 {
|
|
1045
|
+
/** Name of the field to sort by. */
|
|
1046
|
+
fieldName?: string;
|
|
1047
|
+
/** Sort order. */
|
|
1048
|
+
order?: SortOrder$1;
|
|
1049
|
+
}
|
|
1050
|
+
declare enum SortOrder$1 {
|
|
1051
|
+
ASC = "ASC",
|
|
1052
|
+
DESC = "DESC"
|
|
1053
|
+
}
|
|
1054
|
+
interface CursorPaging$1 {
|
|
1055
|
+
/** Maximum number of items to return in the results. */
|
|
1056
|
+
limit?: number | null;
|
|
1057
|
+
/**
|
|
1058
|
+
* Pointer to the next or previous page in the list of results.
|
|
1059
|
+
*
|
|
1060
|
+
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
1061
|
+
* Not relevant for the first request.
|
|
1062
|
+
*/
|
|
1063
|
+
cursor?: string | null;
|
|
1064
|
+
}
|
|
1065
|
+
interface QueryReferredFriendResponse {
|
|
1066
|
+
/** The retrieved ReferredFriends. */
|
|
1067
|
+
referredFriends?: ReferredFriend[];
|
|
1068
|
+
/** CursorPagingMetadata. */
|
|
1069
|
+
metadata?: CursorPagingMetadata$1;
|
|
1070
|
+
}
|
|
1071
|
+
interface CursorPagingMetadata$1 {
|
|
1072
|
+
/** Number of items returned in the response. */
|
|
1073
|
+
count?: number | null;
|
|
1074
|
+
/** Cursor strings that point to the next page, previous page, or both. */
|
|
1075
|
+
cursors?: Cursors$1;
|
|
1076
|
+
/**
|
|
1077
|
+
* Whether there are more pages to retrieve following the current page.
|
|
1078
|
+
*
|
|
1079
|
+
* + `true`: Another page of results can be retrieved.
|
|
1080
|
+
* + `false`: This is the last page.
|
|
1081
|
+
*/
|
|
1082
|
+
hasNext?: boolean | null;
|
|
1083
|
+
}
|
|
1084
|
+
interface Cursors$1 {
|
|
1085
|
+
/** Cursor string pointing to the next page in the list of results. */
|
|
1086
|
+
next?: string | null;
|
|
1087
|
+
/** Cursor pointing to the previous page in the list of results. */
|
|
1088
|
+
prev?: string | null;
|
|
1089
|
+
}
|
|
1090
|
+
interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
|
|
1091
|
+
createdEvent?: EntityCreatedEvent$1;
|
|
1092
|
+
updatedEvent?: EntityUpdatedEvent$1;
|
|
1093
|
+
deletedEvent?: EntityDeletedEvent$1;
|
|
1094
|
+
actionEvent?: ActionEvent$1;
|
|
1095
|
+
/**
|
|
1096
|
+
* Unique event ID.
|
|
1097
|
+
* Allows clients to ignore duplicate webhooks.
|
|
1098
|
+
*/
|
|
1099
|
+
_id?: string;
|
|
1100
|
+
/**
|
|
1101
|
+
* Assumes actions are also always typed to an entity_type
|
|
1102
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
1103
|
+
*/
|
|
1104
|
+
entityFqdn?: string;
|
|
1105
|
+
/**
|
|
1106
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
1107
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
1108
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
1109
|
+
*/
|
|
1110
|
+
slug?: string;
|
|
1111
|
+
/** ID of the entity associated with the event. */
|
|
1112
|
+
entityId?: string;
|
|
1113
|
+
/** Event timestamp. */
|
|
1114
|
+
eventTime?: Date;
|
|
1115
|
+
/**
|
|
1116
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
1117
|
+
* (for example, GDPR).
|
|
1118
|
+
*/
|
|
1119
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
1120
|
+
/** If present, indicates the action that triggered the event. */
|
|
1121
|
+
originatedFrom?: string | null;
|
|
1122
|
+
/**
|
|
1123
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
1124
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
1125
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
1126
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
1127
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
1128
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
1129
|
+
*/
|
|
1130
|
+
entityEventSequence?: string | null;
|
|
1131
|
+
}
|
|
1132
|
+
/** @oneof */
|
|
1133
|
+
interface DomainEventBodyOneOf$1 {
|
|
1134
|
+
createdEvent?: EntityCreatedEvent$1;
|
|
1135
|
+
updatedEvent?: EntityUpdatedEvent$1;
|
|
1136
|
+
deletedEvent?: EntityDeletedEvent$1;
|
|
1137
|
+
actionEvent?: ActionEvent$1;
|
|
1138
|
+
}
|
|
1139
|
+
interface EntityCreatedEvent$1 {
|
|
1140
|
+
entity?: string;
|
|
1141
|
+
}
|
|
1142
|
+
interface UndeleteInfo$1 {
|
|
1143
|
+
deletedDate?: Date;
|
|
1144
|
+
}
|
|
1145
|
+
interface EntityUpdatedEvent$1 {
|
|
1146
|
+
/**
|
|
1147
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
1148
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
1149
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
1150
|
+
*/
|
|
1151
|
+
currentEntity?: string;
|
|
1152
|
+
}
|
|
1153
|
+
interface EntityDeletedEvent$1 {
|
|
1154
|
+
/** Entity that was deleted */
|
|
1155
|
+
deletedEntity?: string | null;
|
|
1156
|
+
}
|
|
1157
|
+
interface ActionEvent$1 {
|
|
1158
|
+
body?: string;
|
|
1159
|
+
}
|
|
1160
|
+
interface Empty {
|
|
1161
|
+
}
|
|
1162
|
+
interface SuccessfulReferralEvent {
|
|
1163
|
+
/** ReferredFriend that completed his referral details. */
|
|
1164
|
+
referredFriendDetails?: ReferredFriendDetails;
|
|
1165
|
+
}
|
|
1166
|
+
interface ReferredFriendDetails {
|
|
1167
|
+
/**
|
|
1168
|
+
* ReferredFriend ID.
|
|
1169
|
+
* @readonly
|
|
1170
|
+
*/
|
|
1171
|
+
referredFriendId?: string;
|
|
1172
|
+
/**
|
|
1173
|
+
* ReferredFriend Contact ID.
|
|
1174
|
+
* @readonly
|
|
1175
|
+
*/
|
|
1176
|
+
contactId?: string;
|
|
1177
|
+
/**
|
|
1178
|
+
* Customer who referred this ReferredFriend.
|
|
1179
|
+
* @readonly
|
|
1180
|
+
*/
|
|
1181
|
+
referringCustomerId?: string;
|
|
1182
|
+
}
|
|
1183
|
+
interface MessageEnvelope$1 {
|
|
1184
|
+
/** App instance ID. */
|
|
1185
|
+
instanceId?: string | null;
|
|
1186
|
+
/** Event type. */
|
|
1187
|
+
eventType?: string;
|
|
1188
|
+
/** The identification type and identity data. */
|
|
1189
|
+
identity?: IdentificationData$1;
|
|
1190
|
+
/** Stringify payload. */
|
|
1191
|
+
data?: string;
|
|
1192
|
+
}
|
|
1193
|
+
interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
|
|
1194
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1195
|
+
anonymousVisitorId?: string;
|
|
1196
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1197
|
+
memberId?: string;
|
|
1198
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1199
|
+
wixUserId?: string;
|
|
1200
|
+
/** ID of an app. */
|
|
1201
|
+
appId?: string;
|
|
1202
|
+
/** @readonly */
|
|
1203
|
+
identityType?: WebhookIdentityType$1;
|
|
1204
|
+
}
|
|
1205
|
+
/** @oneof */
|
|
1206
|
+
interface IdentificationDataIdOneOf$1 {
|
|
1207
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1208
|
+
anonymousVisitorId?: string;
|
|
1209
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1210
|
+
memberId?: string;
|
|
1211
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1212
|
+
wixUserId?: string;
|
|
1213
|
+
/** ID of an app. */
|
|
1214
|
+
appId?: string;
|
|
1215
|
+
}
|
|
1216
|
+
declare enum WebhookIdentityType$1 {
|
|
1217
|
+
UNKNOWN = "UNKNOWN",
|
|
1218
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
1219
|
+
MEMBER = "MEMBER",
|
|
1220
|
+
WIX_USER = "WIX_USER",
|
|
1221
|
+
APP = "APP"
|
|
1222
|
+
}
|
|
1223
|
+
interface CreateReferredFriendResponseNonNullableFields {
|
|
1224
|
+
referredFriend?: {
|
|
1225
|
+
_id: string;
|
|
1226
|
+
contactId: string;
|
|
1227
|
+
referringCustomerId: string;
|
|
1228
|
+
status: Status;
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
interface GetReferredFriendResponseNonNullableFields {
|
|
1232
|
+
referredFriend?: {
|
|
1233
|
+
_id: string;
|
|
1234
|
+
contactId: string;
|
|
1235
|
+
referringCustomerId: string;
|
|
1236
|
+
status: Status;
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1239
|
+
interface GetReferredFriendByContactIdResponseNonNullableFields {
|
|
1240
|
+
referredFriend?: {
|
|
1241
|
+
_id: string;
|
|
1242
|
+
contactId: string;
|
|
1243
|
+
referringCustomerId: string;
|
|
1244
|
+
status: Status;
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
interface UpdateReferredFriendResponseNonNullableFields {
|
|
1248
|
+
referredFriend?: {
|
|
1249
|
+
_id: string;
|
|
1250
|
+
contactId: string;
|
|
1251
|
+
referringCustomerId: string;
|
|
1252
|
+
status: Status;
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
interface QueryReferredFriendResponseNonNullableFields {
|
|
1256
|
+
referredFriends: {
|
|
1257
|
+
_id: string;
|
|
1258
|
+
contactId: string;
|
|
1259
|
+
referringCustomerId: string;
|
|
1260
|
+
status: Status;
|
|
1261
|
+
}[];
|
|
1262
|
+
}
|
|
1263
|
+
interface BaseEventMetadata$1 {
|
|
1264
|
+
/** App instance ID. */
|
|
1265
|
+
instanceId?: string | null;
|
|
1266
|
+
/** Event type. */
|
|
1267
|
+
eventType?: string;
|
|
1268
|
+
/** The identification type and identity data. */
|
|
1269
|
+
identity?: IdentificationData$1;
|
|
1270
|
+
}
|
|
1271
|
+
interface EventMetadata$1 extends BaseEventMetadata$1 {
|
|
1272
|
+
/**
|
|
1273
|
+
* Unique event ID.
|
|
1274
|
+
* Allows clients to ignore duplicate webhooks.
|
|
1275
|
+
*/
|
|
1276
|
+
_id?: string;
|
|
1277
|
+
/**
|
|
1278
|
+
* Assumes actions are also always typed to an entity_type
|
|
1279
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
1280
|
+
*/
|
|
1281
|
+
entityFqdn?: string;
|
|
1282
|
+
/**
|
|
1283
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
1284
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
1285
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
1286
|
+
*/
|
|
1287
|
+
slug?: string;
|
|
1288
|
+
/** ID of the entity associated with the event. */
|
|
1289
|
+
entityId?: string;
|
|
1290
|
+
/** Event timestamp. */
|
|
1291
|
+
eventTime?: Date;
|
|
1292
|
+
/**
|
|
1293
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
1294
|
+
* (for example, GDPR).
|
|
1295
|
+
*/
|
|
1296
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
1297
|
+
/** If present, indicates the action that triggered the event. */
|
|
1298
|
+
originatedFrom?: string | null;
|
|
1299
|
+
/**
|
|
1300
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
1301
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
1302
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
1303
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
1304
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
1305
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
1306
|
+
*/
|
|
1307
|
+
entityEventSequence?: string | null;
|
|
1308
|
+
}
|
|
1309
|
+
interface ReferredFriendCreatedEnvelope {
|
|
1310
|
+
entity: ReferredFriend;
|
|
1311
|
+
metadata: EventMetadata$1;
|
|
1312
|
+
}
|
|
1313
|
+
interface ReferredFriendUpdatedEnvelope {
|
|
1314
|
+
entity: ReferredFriend;
|
|
1315
|
+
metadata: EventMetadata$1;
|
|
1316
|
+
}
|
|
1317
|
+
interface ReferredFriendDeletedEnvelope {
|
|
1318
|
+
metadata: EventMetadata$1;
|
|
1319
|
+
}
|
|
1320
|
+
interface UpdateReferredFriend {
|
|
1321
|
+
/**
|
|
1322
|
+
* ReferredFriend ID.
|
|
1323
|
+
* @readonly
|
|
1324
|
+
*/
|
|
1325
|
+
_id?: string;
|
|
1326
|
+
/**
|
|
1327
|
+
* ReferredFriend Contact ID.
|
|
1328
|
+
* @readonly
|
|
1329
|
+
*/
|
|
1330
|
+
contactId?: string;
|
|
1331
|
+
/**
|
|
1332
|
+
* Customer who referred.
|
|
1333
|
+
* @readonly
|
|
1334
|
+
*/
|
|
1335
|
+
referringCustomerId?: string;
|
|
1336
|
+
/** Status of the ReferredFriend. */
|
|
1337
|
+
status?: Status;
|
|
1338
|
+
/**
|
|
1339
|
+
* Represents the current state of an item. Each time the item is modified, its `revision` changes by the server. for an update operation to succeed, you MUST pass the latest revision.
|
|
1340
|
+
* @readonly
|
|
1341
|
+
*/
|
|
1342
|
+
revision?: string | null;
|
|
1343
|
+
/**
|
|
1344
|
+
* Represents the time this ReferredFriend was created.
|
|
1345
|
+
* @readonly
|
|
1346
|
+
*/
|
|
1347
|
+
_createdDate?: Date;
|
|
1348
|
+
/**
|
|
1349
|
+
* Represents the time this ReferredFriend was last updated.
|
|
1350
|
+
* @readonly
|
|
1351
|
+
*/
|
|
1352
|
+
_updatedDate?: Date;
|
|
1353
|
+
}
|
|
1354
|
+
interface DeleteReferredFriendOptions {
|
|
1355
|
+
/** The revision of the ReferredFriend. */
|
|
1356
|
+
revision?: string;
|
|
1357
|
+
}
|
|
1358
|
+
interface QueryCursorResult$1 {
|
|
1359
|
+
cursors: Cursors$1;
|
|
1360
|
+
hasNext: () => boolean;
|
|
1361
|
+
hasPrev: () => boolean;
|
|
1362
|
+
length: number;
|
|
1363
|
+
pageSize: number;
|
|
1364
|
+
}
|
|
1365
|
+
interface ReferredFriendsQueryResult extends QueryCursorResult$1 {
|
|
1366
|
+
items: ReferredFriend[];
|
|
1367
|
+
query: ReferredFriendsQueryBuilder;
|
|
1368
|
+
next: () => Promise<ReferredFriendsQueryResult>;
|
|
1369
|
+
prev: () => Promise<ReferredFriendsQueryResult>;
|
|
1370
|
+
}
|
|
1371
|
+
interface ReferredFriendsQueryBuilder {
|
|
1372
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1373
|
+
* @param value - Value to compare against.
|
|
1374
|
+
* @documentationMaturity preview
|
|
1375
|
+
*/
|
|
1376
|
+
eq: (propertyName: 'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
|
|
1377
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1378
|
+
* @param value - Value to compare against.
|
|
1379
|
+
* @documentationMaturity preview
|
|
1380
|
+
*/
|
|
1381
|
+
ne: (propertyName: 'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
|
|
1382
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1383
|
+
* @param value - Value to compare against.
|
|
1384
|
+
* @documentationMaturity preview
|
|
1385
|
+
*/
|
|
1386
|
+
ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
|
|
1387
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1388
|
+
* @param value - Value to compare against.
|
|
1389
|
+
* @documentationMaturity preview
|
|
1390
|
+
*/
|
|
1391
|
+
gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
|
|
1392
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1393
|
+
* @param value - Value to compare against.
|
|
1394
|
+
* @documentationMaturity preview
|
|
1395
|
+
*/
|
|
1396
|
+
le: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
|
|
1397
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1398
|
+
* @param value - Value to compare against.
|
|
1399
|
+
* @documentationMaturity preview
|
|
1400
|
+
*/
|
|
1401
|
+
lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
|
|
1402
|
+
/** @param propertyName - Property whose value is compared with `string`.
|
|
1403
|
+
* @param string - String to compare against. Case-insensitive.
|
|
1404
|
+
* @documentationMaturity preview
|
|
1405
|
+
*/
|
|
1406
|
+
startsWith: (propertyName: 'referringCustomerId', value: string) => ReferredFriendsQueryBuilder;
|
|
1407
|
+
/** @param propertyName - Property whose value is compared with `values`.
|
|
1408
|
+
* @param values - List of values to compare against.
|
|
1409
|
+
* @documentationMaturity preview
|
|
1410
|
+
*/
|
|
1411
|
+
hasSome: (propertyName: 'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate', value: any[]) => ReferredFriendsQueryBuilder;
|
|
1412
|
+
/** @documentationMaturity preview */
|
|
1413
|
+
in: (propertyName: 'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
|
|
1414
|
+
/** @documentationMaturity preview */
|
|
1415
|
+
exists: (propertyName: 'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate', value: boolean) => ReferredFriendsQueryBuilder;
|
|
1416
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
1417
|
+
* @documentationMaturity preview
|
|
1418
|
+
*/
|
|
1419
|
+
ascending: (...propertyNames: Array<'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate'>) => ReferredFriendsQueryBuilder;
|
|
1420
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
1421
|
+
* @documentationMaturity preview
|
|
1422
|
+
*/
|
|
1423
|
+
descending: (...propertyNames: Array<'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate'>) => ReferredFriendsQueryBuilder;
|
|
1424
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
1425
|
+
* @documentationMaturity preview
|
|
1426
|
+
*/
|
|
1427
|
+
limit: (limit: number) => ReferredFriendsQueryBuilder;
|
|
1428
|
+
/** @param cursor - A pointer to specific record
|
|
1429
|
+
* @documentationMaturity preview
|
|
1430
|
+
*/
|
|
1431
|
+
skipTo: (cursor: string) => ReferredFriendsQueryBuilder;
|
|
1432
|
+
/** @documentationMaturity preview */
|
|
1433
|
+
find: () => Promise<ReferredFriendsQueryResult>;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
interface HttpClient$1 {
|
|
1437
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
|
1438
|
+
fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
|
|
1439
|
+
}
|
|
1440
|
+
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
|
1441
|
+
type HttpResponse$1<T = any> = {
|
|
1442
|
+
data: T;
|
|
1443
|
+
status: number;
|
|
1444
|
+
statusText: string;
|
|
1445
|
+
headers: any;
|
|
1446
|
+
request?: any;
|
|
1447
|
+
};
|
|
1448
|
+
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
1449
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1450
|
+
url: string;
|
|
1451
|
+
data?: Data;
|
|
1452
|
+
params?: URLSearchParams;
|
|
1453
|
+
} & APIMetadata$1;
|
|
1454
|
+
type APIMetadata$1 = {
|
|
1455
|
+
methodFqn?: string;
|
|
1456
|
+
entityFqdn?: string;
|
|
1457
|
+
packageName?: string;
|
|
1458
|
+
};
|
|
1459
|
+
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
1460
|
+
__type: 'event-definition';
|
|
1461
|
+
type: Type;
|
|
1462
|
+
isDomainEvent?: boolean;
|
|
1463
|
+
transformations?: (envelope: unknown) => Payload;
|
|
1464
|
+
__payload: Payload;
|
|
1465
|
+
};
|
|
1466
|
+
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
1467
|
+
|
|
1468
|
+
declare global {
|
|
1469
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1470
|
+
interface SymbolConstructor {
|
|
1471
|
+
readonly observable: symbol;
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
declare const __metadata$1: {
|
|
1476
|
+
PACKAGE_NAME: string;
|
|
1477
|
+
};
|
|
1478
|
+
declare function createReferredFriend(httpClient: HttpClient$1): () => Promise<CreateReferredFriendResponse & CreateReferredFriendResponseNonNullableFields>;
|
|
1479
|
+
declare function getReferredFriend(httpClient: HttpClient$1): (referredFriendId: string) => Promise<GetReferredFriendResponse & GetReferredFriendResponseNonNullableFields>;
|
|
1480
|
+
declare function getReferredFriendByContactId(httpClient: HttpClient$1): (contactId: string) => Promise<ReferredFriend & {
|
|
1481
|
+
_id: string;
|
|
1482
|
+
contactId: string;
|
|
1483
|
+
referringCustomerId: string;
|
|
1484
|
+
status: Status;
|
|
1485
|
+
}>;
|
|
1486
|
+
declare function updateReferredFriend(httpClient: HttpClient$1): (_id: string, referredFriend: UpdateReferredFriend) => Promise<ReferredFriend & {
|
|
1487
|
+
_id: string;
|
|
1488
|
+
contactId: string;
|
|
1489
|
+
referringCustomerId: string;
|
|
1490
|
+
status: Status;
|
|
1491
|
+
}>;
|
|
1492
|
+
declare function deleteReferredFriend(httpClient: HttpClient$1): (referredFriendId: string, options?: DeleteReferredFriendOptions) => Promise<void>;
|
|
1493
|
+
declare function queryReferredFriend(httpClient: HttpClient$1): () => ReferredFriendsQueryBuilder;
|
|
1494
|
+
declare const onReferredFriendCreated: EventDefinition$1<ReferredFriendCreatedEnvelope, "wix.loyalty.referral.v1.referred_friend_created">;
|
|
1495
|
+
declare const onReferredFriendUpdated: EventDefinition$1<ReferredFriendUpdatedEnvelope, "wix.loyalty.referral.v1.referred_friend_updated">;
|
|
1496
|
+
declare const onReferredFriendDeleted: EventDefinition$1<ReferredFriendDeletedEnvelope, "wix.loyalty.referral.v1.referred_friend_deleted">;
|
|
1497
|
+
|
|
1498
|
+
type index_d$1_CreateReferredFriendRequest = CreateReferredFriendRequest;
|
|
1499
|
+
type index_d$1_CreateReferredFriendResponse = CreateReferredFriendResponse;
|
|
1500
|
+
type index_d$1_CreateReferredFriendResponseNonNullableFields = CreateReferredFriendResponseNonNullableFields;
|
|
1501
|
+
type index_d$1_DeleteReferredFriendOptions = DeleteReferredFriendOptions;
|
|
1502
|
+
type index_d$1_DeleteReferredFriendRequest = DeleteReferredFriendRequest;
|
|
1503
|
+
type index_d$1_DeleteReferredFriendResponse = DeleteReferredFriendResponse;
|
|
1504
|
+
type index_d$1_Empty = Empty;
|
|
1505
|
+
type index_d$1_GetReferredFriendByContactIdRequest = GetReferredFriendByContactIdRequest;
|
|
1506
|
+
type index_d$1_GetReferredFriendByContactIdResponse = GetReferredFriendByContactIdResponse;
|
|
1507
|
+
type index_d$1_GetReferredFriendByContactIdResponseNonNullableFields = GetReferredFriendByContactIdResponseNonNullableFields;
|
|
1508
|
+
type index_d$1_GetReferredFriendRequest = GetReferredFriendRequest;
|
|
1509
|
+
type index_d$1_GetReferredFriendResponse = GetReferredFriendResponse;
|
|
1510
|
+
type index_d$1_GetReferredFriendResponseNonNullableFields = GetReferredFriendResponseNonNullableFields;
|
|
1511
|
+
type index_d$1_QueryReferredFriendRequest = QueryReferredFriendRequest;
|
|
1512
|
+
type index_d$1_QueryReferredFriendResponse = QueryReferredFriendResponse;
|
|
1513
|
+
type index_d$1_QueryReferredFriendResponseNonNullableFields = QueryReferredFriendResponseNonNullableFields;
|
|
1514
|
+
type index_d$1_ReferredFriend = ReferredFriend;
|
|
1515
|
+
type index_d$1_ReferredFriendCreatedEnvelope = ReferredFriendCreatedEnvelope;
|
|
1516
|
+
type index_d$1_ReferredFriendDeletedEnvelope = ReferredFriendDeletedEnvelope;
|
|
1517
|
+
type index_d$1_ReferredFriendDetails = ReferredFriendDetails;
|
|
1518
|
+
type index_d$1_ReferredFriendUpdatedEnvelope = ReferredFriendUpdatedEnvelope;
|
|
1519
|
+
type index_d$1_ReferredFriendsQueryBuilder = ReferredFriendsQueryBuilder;
|
|
1520
|
+
type index_d$1_ReferredFriendsQueryResult = ReferredFriendsQueryResult;
|
|
1521
|
+
type index_d$1_Status = Status;
|
|
1522
|
+
declare const index_d$1_Status: typeof Status;
|
|
1523
|
+
type index_d$1_SuccessfulReferralEvent = SuccessfulReferralEvent;
|
|
1524
|
+
type index_d$1_UpdateReferredFriend = UpdateReferredFriend;
|
|
1525
|
+
type index_d$1_UpdateReferredFriendRequest = UpdateReferredFriendRequest;
|
|
1526
|
+
type index_d$1_UpdateReferredFriendResponse = UpdateReferredFriendResponse;
|
|
1527
|
+
type index_d$1_UpdateReferredFriendResponseNonNullableFields = UpdateReferredFriendResponseNonNullableFields;
|
|
1528
|
+
declare const index_d$1_createReferredFriend: typeof createReferredFriend;
|
|
1529
|
+
declare const index_d$1_deleteReferredFriend: typeof deleteReferredFriend;
|
|
1530
|
+
declare const index_d$1_getReferredFriend: typeof getReferredFriend;
|
|
1531
|
+
declare const index_d$1_getReferredFriendByContactId: typeof getReferredFriendByContactId;
|
|
1532
|
+
declare const index_d$1_onReferredFriendCreated: typeof onReferredFriendCreated;
|
|
1533
|
+
declare const index_d$1_onReferredFriendDeleted: typeof onReferredFriendDeleted;
|
|
1534
|
+
declare const index_d$1_onReferredFriendUpdated: typeof onReferredFriendUpdated;
|
|
1535
|
+
declare const index_d$1_queryReferredFriend: typeof queryReferredFriend;
|
|
1536
|
+
declare const index_d$1_updateReferredFriend: typeof updateReferredFriend;
|
|
1537
|
+
declare namespace index_d$1 {
|
|
1538
|
+
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 };
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
/** ReferringCustomer is the main entity of ReferringCustomers. */
|
|
1542
|
+
interface ReferringCustomer {
|
|
1543
|
+
/**
|
|
1544
|
+
* ReferringCustomer id.
|
|
1545
|
+
* @readonly
|
|
1546
|
+
*/
|
|
1547
|
+
_id?: string;
|
|
1548
|
+
/**
|
|
1549
|
+
* Contact id.
|
|
1550
|
+
* @readonly
|
|
1551
|
+
*/
|
|
1552
|
+
contactId?: string;
|
|
1553
|
+
/**
|
|
1554
|
+
* Referral code.
|
|
1555
|
+
* @readonly
|
|
1556
|
+
*/
|
|
1557
|
+
referralCode?: string;
|
|
1558
|
+
/** Represents the current state of an item. Each time the item is modified, its `revision` changes by the server. for an update operation to succeed, you MUST pass the latest revision. */
|
|
1559
|
+
revision?: string | null;
|
|
1560
|
+
/**
|
|
1561
|
+
* Represents the time this ReferringCustomer was created.
|
|
1562
|
+
* @readonly
|
|
1563
|
+
*/
|
|
1564
|
+
_createdDate?: Date;
|
|
1565
|
+
/**
|
|
1566
|
+
* Represents the time this ReferringCustomer was last updated.
|
|
1567
|
+
* @readonly
|
|
1568
|
+
*/
|
|
1569
|
+
_updatedDate?: Date;
|
|
1570
|
+
}
|
|
1571
|
+
interface GenerateReferringCustomerForContactRequest {
|
|
1572
|
+
/** Contact id or "me" to generate current identity's referring customer. */
|
|
1573
|
+
contactId: string;
|
|
1574
|
+
}
|
|
1575
|
+
interface GenerateReferringCustomerForContactResponse {
|
|
1576
|
+
/** The created ReferringCustomer. */
|
|
1577
|
+
referringCustomer?: ReferringCustomer;
|
|
1578
|
+
}
|
|
1579
|
+
interface GetReferringCustomerRequest {
|
|
1580
|
+
/** Id of the ReferringCustomer to retrieve. */
|
|
1581
|
+
referringCustomerId: string;
|
|
1582
|
+
}
|
|
1583
|
+
interface GetReferringCustomerResponse {
|
|
1584
|
+
/** The retrieved ReferringCustomer. */
|
|
1585
|
+
referringCustomer?: ReferringCustomer;
|
|
1586
|
+
}
|
|
1587
|
+
interface GetReferringCustomerByReferralCodeRequest {
|
|
1588
|
+
/** Referral Code of the ReferringCustomer to retrieve. */
|
|
1589
|
+
referralCode: string;
|
|
1590
|
+
}
|
|
1591
|
+
interface GetReferringCustomerByReferralCodeResponse {
|
|
1592
|
+
/** The retrieved ReferringCustomer. */
|
|
1593
|
+
referringCustomer?: ReferringCustomer;
|
|
1594
|
+
}
|
|
1595
|
+
interface QueryReferringCustomersRequest {
|
|
1596
|
+
/** Query options. */
|
|
1597
|
+
query: CursorQuery;
|
|
1598
|
+
}
|
|
1599
|
+
interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
1600
|
+
/** 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`. */
|
|
1601
|
+
cursorPaging?: CursorPaging;
|
|
1602
|
+
/**
|
|
1603
|
+
* Filter object in the following format:
|
|
1604
|
+
* `"filter" : {
|
|
1605
|
+
* "fieldName1": "value1",
|
|
1606
|
+
* "fieldName2":{"$operator":"value2"}
|
|
1607
|
+
* }`
|
|
1608
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
1609
|
+
*/
|
|
1610
|
+
filter?: Record<string, any> | null;
|
|
1611
|
+
/**
|
|
1612
|
+
* Sort object in the following format:
|
|
1613
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
1614
|
+
*/
|
|
1615
|
+
sort?: Sorting[];
|
|
1616
|
+
}
|
|
1617
|
+
/** @oneof */
|
|
1618
|
+
interface CursorQueryPagingMethodOneOf {
|
|
1619
|
+
/** 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`. */
|
|
1620
|
+
cursorPaging?: CursorPaging;
|
|
1621
|
+
}
|
|
1622
|
+
interface Sorting {
|
|
1623
|
+
/** Name of the field to sort by. */
|
|
1624
|
+
fieldName?: string;
|
|
1625
|
+
/** Sort order. */
|
|
1626
|
+
order?: SortOrder;
|
|
1627
|
+
}
|
|
1628
|
+
declare enum SortOrder {
|
|
1629
|
+
ASC = "ASC",
|
|
1630
|
+
DESC = "DESC"
|
|
1631
|
+
}
|
|
1632
|
+
interface CursorPaging {
|
|
1633
|
+
/** Maximum number of items to return in the results. */
|
|
1634
|
+
limit?: number | null;
|
|
1635
|
+
/**
|
|
1636
|
+
* Pointer to the next or previous page in the list of results.
|
|
1637
|
+
*
|
|
1638
|
+
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
1639
|
+
* Not relevant for the first request.
|
|
1640
|
+
*/
|
|
1641
|
+
cursor?: string | null;
|
|
1642
|
+
}
|
|
1643
|
+
interface QueryReferringCustomersResponse {
|
|
1644
|
+
/** The retrieved ReferringCustomers. */
|
|
1645
|
+
referringCustomers?: ReferringCustomer[];
|
|
1646
|
+
/** Paging metadata. */
|
|
1647
|
+
metadata?: CursorPagingMetadata;
|
|
1648
|
+
}
|
|
1649
|
+
interface CursorPagingMetadata {
|
|
1650
|
+
/** Number of items returned in the response. */
|
|
1651
|
+
count?: number | null;
|
|
1652
|
+
/** Cursor strings that point to the next page, previous page, or both. */
|
|
1653
|
+
cursors?: Cursors;
|
|
1654
|
+
/**
|
|
1655
|
+
* Whether there are more pages to retrieve following the current page.
|
|
1656
|
+
*
|
|
1657
|
+
* + `true`: Another page of results can be retrieved.
|
|
1658
|
+
* + `false`: This is the last page.
|
|
1659
|
+
*/
|
|
1660
|
+
hasNext?: boolean | null;
|
|
1661
|
+
}
|
|
1662
|
+
interface Cursors {
|
|
1663
|
+
/** Cursor string pointing to the next page in the list of results. */
|
|
1664
|
+
next?: string | null;
|
|
1665
|
+
/** Cursor pointing to the previous page in the list of results. */
|
|
1666
|
+
prev?: string | null;
|
|
1667
|
+
}
|
|
1668
|
+
interface DeleteReferringCustomerRequest {
|
|
1669
|
+
/** Id of the ReferringCustomer to delete. */
|
|
1670
|
+
referringCustomerId: string;
|
|
1671
|
+
/** The revision of the ReferringCustomer. */
|
|
1672
|
+
revision?: string;
|
|
1673
|
+
}
|
|
1674
|
+
interface DeleteReferringCustomerResponse {
|
|
1675
|
+
}
|
|
1676
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
|
1677
|
+
createdEvent?: EntityCreatedEvent;
|
|
1678
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
1679
|
+
deletedEvent?: EntityDeletedEvent;
|
|
1680
|
+
actionEvent?: ActionEvent;
|
|
1681
|
+
/**
|
|
1682
|
+
* Unique event ID.
|
|
1683
|
+
* Allows clients to ignore duplicate webhooks.
|
|
1684
|
+
*/
|
|
1685
|
+
_id?: string;
|
|
1686
|
+
/**
|
|
1687
|
+
* Assumes actions are also always typed to an entity_type
|
|
1688
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
1689
|
+
*/
|
|
1690
|
+
entityFqdn?: string;
|
|
1691
|
+
/**
|
|
1692
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
1693
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
1694
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
1695
|
+
*/
|
|
1696
|
+
slug?: string;
|
|
1697
|
+
/** ID of the entity associated with the event. */
|
|
1698
|
+
entityId?: string;
|
|
1699
|
+
/** Event timestamp. */
|
|
1700
|
+
eventTime?: Date;
|
|
1701
|
+
/**
|
|
1702
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
1703
|
+
* (for example, GDPR).
|
|
1704
|
+
*/
|
|
1705
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
1706
|
+
/** If present, indicates the action that triggered the event. */
|
|
1707
|
+
originatedFrom?: string | null;
|
|
1708
|
+
/**
|
|
1709
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
1710
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
1711
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
1712
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
1713
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
1714
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
1715
|
+
*/
|
|
1716
|
+
entityEventSequence?: string | null;
|
|
1717
|
+
}
|
|
1718
|
+
/** @oneof */
|
|
1719
|
+
interface DomainEventBodyOneOf {
|
|
1720
|
+
createdEvent?: EntityCreatedEvent;
|
|
1721
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
1722
|
+
deletedEvent?: EntityDeletedEvent;
|
|
1723
|
+
actionEvent?: ActionEvent;
|
|
1724
|
+
}
|
|
1725
|
+
interface EntityCreatedEvent {
|
|
1726
|
+
entity?: string;
|
|
1727
|
+
}
|
|
1728
|
+
interface UndeleteInfo {
|
|
1729
|
+
deletedDate?: Date;
|
|
1730
|
+
}
|
|
1731
|
+
interface EntityUpdatedEvent {
|
|
1732
|
+
/**
|
|
1733
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
1734
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
1735
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
1736
|
+
*/
|
|
1737
|
+
currentEntity?: string;
|
|
1738
|
+
}
|
|
1739
|
+
interface EntityDeletedEvent {
|
|
1740
|
+
/** Entity that was deleted */
|
|
1741
|
+
deletedEntity?: string | null;
|
|
1742
|
+
}
|
|
1743
|
+
interface ActionEvent {
|
|
1744
|
+
body?: string;
|
|
1745
|
+
}
|
|
1746
|
+
interface MessageEnvelope {
|
|
1747
|
+
/** App instance ID. */
|
|
1748
|
+
instanceId?: string | null;
|
|
1749
|
+
/** Event type. */
|
|
1750
|
+
eventType?: string;
|
|
1751
|
+
/** The identification type and identity data. */
|
|
1752
|
+
identity?: IdentificationData;
|
|
1753
|
+
/** Stringify payload. */
|
|
1754
|
+
data?: string;
|
|
1755
|
+
}
|
|
1756
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
1757
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1758
|
+
anonymousVisitorId?: string;
|
|
1759
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1760
|
+
memberId?: string;
|
|
1761
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1762
|
+
wixUserId?: string;
|
|
1763
|
+
/** ID of an app. */
|
|
1764
|
+
appId?: string;
|
|
1765
|
+
/** @readonly */
|
|
1766
|
+
identityType?: WebhookIdentityType;
|
|
1767
|
+
}
|
|
1768
|
+
/** @oneof */
|
|
1769
|
+
interface IdentificationDataIdOneOf {
|
|
1770
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1771
|
+
anonymousVisitorId?: string;
|
|
1772
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1773
|
+
memberId?: string;
|
|
1774
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1775
|
+
wixUserId?: string;
|
|
1776
|
+
/** ID of an app. */
|
|
1777
|
+
appId?: string;
|
|
1778
|
+
}
|
|
1779
|
+
declare enum WebhookIdentityType {
|
|
1780
|
+
UNKNOWN = "UNKNOWN",
|
|
1781
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
1782
|
+
MEMBER = "MEMBER",
|
|
1783
|
+
WIX_USER = "WIX_USER",
|
|
1784
|
+
APP = "APP"
|
|
1785
|
+
}
|
|
1786
|
+
interface GenerateReferringCustomerForContactResponseNonNullableFields {
|
|
1787
|
+
referringCustomer?: {
|
|
1788
|
+
_id: string;
|
|
1789
|
+
contactId: string;
|
|
1790
|
+
referralCode: string;
|
|
1791
|
+
};
|
|
1792
|
+
}
|
|
1793
|
+
interface GetReferringCustomerResponseNonNullableFields {
|
|
1794
|
+
referringCustomer?: {
|
|
1795
|
+
_id: string;
|
|
1796
|
+
contactId: string;
|
|
1797
|
+
referralCode: string;
|
|
1798
|
+
};
|
|
1799
|
+
}
|
|
1800
|
+
interface GetReferringCustomerByReferralCodeResponseNonNullableFields {
|
|
1801
|
+
referringCustomer?: {
|
|
1802
|
+
_id: string;
|
|
1803
|
+
contactId: string;
|
|
1804
|
+
referralCode: string;
|
|
1805
|
+
};
|
|
1806
|
+
}
|
|
1807
|
+
interface QueryReferringCustomersResponseNonNullableFields {
|
|
1808
|
+
referringCustomers: {
|
|
1809
|
+
_id: string;
|
|
1810
|
+
contactId: string;
|
|
1811
|
+
referralCode: string;
|
|
1812
|
+
}[];
|
|
1813
|
+
}
|
|
1814
|
+
interface BaseEventMetadata {
|
|
1815
|
+
/** App instance ID. */
|
|
1816
|
+
instanceId?: string | null;
|
|
1817
|
+
/** Event type. */
|
|
1818
|
+
eventType?: string;
|
|
1819
|
+
/** The identification type and identity data. */
|
|
1820
|
+
identity?: IdentificationData;
|
|
1821
|
+
}
|
|
1822
|
+
interface EventMetadata extends BaseEventMetadata {
|
|
1823
|
+
/**
|
|
1824
|
+
* Unique event ID.
|
|
1825
|
+
* Allows clients to ignore duplicate webhooks.
|
|
1826
|
+
*/
|
|
1827
|
+
_id?: string;
|
|
1828
|
+
/**
|
|
1829
|
+
* Assumes actions are also always typed to an entity_type
|
|
1830
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
1831
|
+
*/
|
|
1832
|
+
entityFqdn?: string;
|
|
1833
|
+
/**
|
|
1834
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
1835
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
1836
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
1837
|
+
*/
|
|
1838
|
+
slug?: string;
|
|
1839
|
+
/** ID of the entity associated with the event. */
|
|
1840
|
+
entityId?: string;
|
|
1841
|
+
/** Event timestamp. */
|
|
1842
|
+
eventTime?: Date;
|
|
1843
|
+
/**
|
|
1844
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
1845
|
+
* (for example, GDPR).
|
|
1846
|
+
*/
|
|
1847
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
1848
|
+
/** If present, indicates the action that triggered the event. */
|
|
1849
|
+
originatedFrom?: string | null;
|
|
1850
|
+
/**
|
|
1851
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
1852
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
1853
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
1854
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
1855
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
1856
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
1857
|
+
*/
|
|
1858
|
+
entityEventSequence?: string | null;
|
|
1859
|
+
}
|
|
1860
|
+
interface ReferringCustomerCreatedEnvelope {
|
|
1861
|
+
entity: ReferringCustomer;
|
|
1862
|
+
metadata: EventMetadata;
|
|
1863
|
+
}
|
|
1864
|
+
interface ReferringCustomerDeletedEnvelope {
|
|
1865
|
+
metadata: EventMetadata;
|
|
1866
|
+
}
|
|
1867
|
+
interface QueryCursorResult {
|
|
1868
|
+
cursors: Cursors;
|
|
1869
|
+
hasNext: () => boolean;
|
|
1870
|
+
hasPrev: () => boolean;
|
|
1871
|
+
length: number;
|
|
1872
|
+
pageSize: number;
|
|
1873
|
+
}
|
|
1874
|
+
interface ReferringCustomersQueryResult extends QueryCursorResult {
|
|
1875
|
+
items: ReferringCustomer[];
|
|
1876
|
+
query: ReferringCustomersQueryBuilder;
|
|
1877
|
+
next: () => Promise<ReferringCustomersQueryResult>;
|
|
1878
|
+
prev: () => Promise<ReferringCustomersQueryResult>;
|
|
1879
|
+
}
|
|
1880
|
+
interface ReferringCustomersQueryBuilder {
|
|
1881
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1882
|
+
* @param value - Value to compare against.
|
|
1883
|
+
* @documentationMaturity preview
|
|
1884
|
+
*/
|
|
1885
|
+
eq: (propertyName: 'contactId' | 'referralCode' | '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
|
|
1886
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1887
|
+
* @param value - Value to compare against.
|
|
1888
|
+
* @documentationMaturity preview
|
|
1889
|
+
*/
|
|
1890
|
+
ne: (propertyName: 'contactId' | 'referralCode' | '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
|
|
1891
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1892
|
+
* @param value - Value to compare against.
|
|
1893
|
+
* @documentationMaturity preview
|
|
1894
|
+
*/
|
|
1895
|
+
ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
|
|
1896
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1897
|
+
* @param value - Value to compare against.
|
|
1898
|
+
* @documentationMaturity preview
|
|
1899
|
+
*/
|
|
1900
|
+
gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
|
|
1901
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1902
|
+
* @param value - Value to compare against.
|
|
1903
|
+
* @documentationMaturity preview
|
|
1904
|
+
*/
|
|
1905
|
+
le: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
|
|
1906
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
1907
|
+
* @param value - Value to compare against.
|
|
1908
|
+
* @documentationMaturity preview
|
|
1909
|
+
*/
|
|
1910
|
+
lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
|
|
1911
|
+
/** @param propertyName - Property whose value is compared with `string`.
|
|
1912
|
+
* @param string - String to compare against. Case-insensitive.
|
|
1913
|
+
* @documentationMaturity preview
|
|
1914
|
+
*/
|
|
1915
|
+
startsWith: (propertyName: 'contactId' | 'referralCode', value: string) => ReferringCustomersQueryBuilder;
|
|
1916
|
+
/** @param propertyName - Property whose value is compared with `values`.
|
|
1917
|
+
* @param values - List of values to compare against.
|
|
1918
|
+
* @documentationMaturity preview
|
|
1919
|
+
*/
|
|
1920
|
+
hasSome: (propertyName: 'contactId' | 'referralCode' | '_createdDate' | '_updatedDate', value: any[]) => ReferringCustomersQueryBuilder;
|
|
1921
|
+
/** @documentationMaturity preview */
|
|
1922
|
+
in: (propertyName: 'contactId' | 'referralCode' | '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
|
|
1923
|
+
/** @documentationMaturity preview */
|
|
1924
|
+
exists: (propertyName: 'contactId' | 'referralCode' | '_createdDate' | '_updatedDate', value: boolean) => ReferringCustomersQueryBuilder;
|
|
1925
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
1926
|
+
* @documentationMaturity preview
|
|
1927
|
+
*/
|
|
1928
|
+
ascending: (...propertyNames: Array<'contactId' | 'referralCode' | '_createdDate' | '_updatedDate'>) => ReferringCustomersQueryBuilder;
|
|
1929
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
1930
|
+
* @documentationMaturity preview
|
|
1931
|
+
*/
|
|
1932
|
+
descending: (...propertyNames: Array<'contactId' | 'referralCode' | '_createdDate' | '_updatedDate'>) => ReferringCustomersQueryBuilder;
|
|
1933
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
1934
|
+
* @documentationMaturity preview
|
|
1935
|
+
*/
|
|
1936
|
+
limit: (limit: number) => ReferringCustomersQueryBuilder;
|
|
1937
|
+
/** @param cursor - A pointer to specific record
|
|
1938
|
+
* @documentationMaturity preview
|
|
1939
|
+
*/
|
|
1940
|
+
skipTo: (cursor: string) => ReferringCustomersQueryBuilder;
|
|
1941
|
+
/** @documentationMaturity preview */
|
|
1942
|
+
find: () => Promise<ReferringCustomersQueryResult>;
|
|
1943
|
+
}
|
|
1944
|
+
interface DeleteReferringCustomerOptions {
|
|
1945
|
+
/** The revision of the ReferringCustomer. */
|
|
1946
|
+
revision?: string;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
interface HttpClient {
|
|
1950
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
1951
|
+
fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
|
|
1952
|
+
}
|
|
1953
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
1954
|
+
type HttpResponse<T = any> = {
|
|
1955
|
+
data: T;
|
|
1956
|
+
status: number;
|
|
1957
|
+
statusText: string;
|
|
1958
|
+
headers: any;
|
|
1959
|
+
request?: any;
|
|
1960
|
+
};
|
|
1961
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
1962
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1963
|
+
url: string;
|
|
1964
|
+
data?: Data;
|
|
1965
|
+
params?: URLSearchParams;
|
|
1966
|
+
} & APIMetadata;
|
|
1967
|
+
type APIMetadata = {
|
|
1968
|
+
methodFqn?: string;
|
|
1969
|
+
entityFqdn?: string;
|
|
1970
|
+
packageName?: string;
|
|
1971
|
+
};
|
|
1972
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
1973
|
+
__type: 'event-definition';
|
|
1974
|
+
type: Type;
|
|
1975
|
+
isDomainEvent?: boolean;
|
|
1976
|
+
transformations?: (envelope: unknown) => Payload;
|
|
1977
|
+
__payload: Payload;
|
|
1978
|
+
};
|
|
1979
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
1980
|
+
|
|
1981
|
+
declare global {
|
|
1982
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1983
|
+
interface SymbolConstructor {
|
|
1984
|
+
readonly observable: symbol;
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
declare const __metadata: {
|
|
1989
|
+
PACKAGE_NAME: string;
|
|
1990
|
+
};
|
|
1991
|
+
declare function generateReferringCustomerForContact(httpClient: HttpClient): (contactId: string) => Promise<GenerateReferringCustomerForContactResponse & GenerateReferringCustomerForContactResponseNonNullableFields>;
|
|
1992
|
+
declare function getReferringCustomer(httpClient: HttpClient): (referringCustomerId: string) => Promise<ReferringCustomer & {
|
|
1993
|
+
_id: string;
|
|
1994
|
+
contactId: string;
|
|
1995
|
+
referralCode: string;
|
|
1996
|
+
}>;
|
|
1997
|
+
declare function getReferringCustomerByReferralCode(httpClient: HttpClient): (referralCode: string) => Promise<GetReferringCustomerByReferralCodeResponse & GetReferringCustomerByReferralCodeResponseNonNullableFields>;
|
|
1998
|
+
declare function queryReferringCustomers(httpClient: HttpClient): () => ReferringCustomersQueryBuilder;
|
|
1999
|
+
declare function deleteReferringCustomer(httpClient: HttpClient): (referringCustomerId: string, options?: DeleteReferringCustomerOptions) => Promise<void>;
|
|
2000
|
+
declare const onReferringCustomerCreated: EventDefinition<ReferringCustomerCreatedEnvelope, "wix.loyalty.referral.v1.referring_customer_created">;
|
|
2001
|
+
declare const onReferringCustomerDeleted: EventDefinition<ReferringCustomerDeletedEnvelope, "wix.loyalty.referral.v1.referring_customer_deleted">;
|
|
862
2002
|
|
|
863
2003
|
type index_d_ActionEvent = ActionEvent;
|
|
864
2004
|
type index_d_BaseEventMetadata = BaseEventMetadata;
|
|
865
|
-
type index_d_Coupon = Coupon;
|
|
866
|
-
type index_d_CouponDiscountTypeOptionsOneOf = CouponDiscountTypeOptionsOneOf;
|
|
867
|
-
type index_d_CouponScope = CouponScope;
|
|
868
|
-
type index_d_CouponScopeOrMinSubtotalOneOf = CouponScopeOrMinSubtotalOneOf;
|
|
869
|
-
type index_d_CreateReferralEventRequest = CreateReferralEventRequest;
|
|
870
|
-
type index_d_CreateReferralEventResponse = CreateReferralEventResponse;
|
|
871
2005
|
type index_d_CursorPaging = CursorPaging;
|
|
872
2006
|
type index_d_CursorPagingMetadata = CursorPagingMetadata;
|
|
873
2007
|
type index_d_CursorQuery = CursorQuery;
|
|
874
2008
|
type index_d_CursorQueryPagingMethodOneOf = CursorQueryPagingMethodOneOf;
|
|
875
2009
|
type index_d_Cursors = Cursors;
|
|
876
|
-
type
|
|
877
|
-
|
|
2010
|
+
type index_d_DeleteReferringCustomerOptions = DeleteReferringCustomerOptions;
|
|
2011
|
+
type index_d_DeleteReferringCustomerRequest = DeleteReferringCustomerRequest;
|
|
2012
|
+
type index_d_DeleteReferringCustomerResponse = DeleteReferringCustomerResponse;
|
|
878
2013
|
type index_d_DomainEvent = DomainEvent;
|
|
879
2014
|
type index_d_DomainEventBodyOneOf = DomainEventBodyOneOf;
|
|
880
|
-
type index_d_Empty = Empty;
|
|
881
2015
|
type index_d_EntityCreatedEvent = EntityCreatedEvent;
|
|
882
2016
|
type index_d_EntityDeletedEvent = EntityDeletedEvent;
|
|
883
2017
|
type index_d_EntityUpdatedEvent = EntityUpdatedEvent;
|
|
884
2018
|
type index_d_EventMetadata = EventMetadata;
|
|
885
|
-
type
|
|
886
|
-
type
|
|
887
|
-
type
|
|
888
|
-
type
|
|
889
|
-
type
|
|
890
|
-
type
|
|
891
|
-
type
|
|
892
|
-
type
|
|
2019
|
+
type index_d_GenerateReferringCustomerForContactRequest = GenerateReferringCustomerForContactRequest;
|
|
2020
|
+
type index_d_GenerateReferringCustomerForContactResponse = GenerateReferringCustomerForContactResponse;
|
|
2021
|
+
type index_d_GenerateReferringCustomerForContactResponseNonNullableFields = GenerateReferringCustomerForContactResponseNonNullableFields;
|
|
2022
|
+
type index_d_GetReferringCustomerByReferralCodeRequest = GetReferringCustomerByReferralCodeRequest;
|
|
2023
|
+
type index_d_GetReferringCustomerByReferralCodeResponse = GetReferringCustomerByReferralCodeResponse;
|
|
2024
|
+
type index_d_GetReferringCustomerByReferralCodeResponseNonNullableFields = GetReferringCustomerByReferralCodeResponseNonNullableFields;
|
|
2025
|
+
type index_d_GetReferringCustomerRequest = GetReferringCustomerRequest;
|
|
2026
|
+
type index_d_GetReferringCustomerResponse = GetReferringCustomerResponse;
|
|
2027
|
+
type index_d_GetReferringCustomerResponseNonNullableFields = GetReferringCustomerResponseNonNullableFields;
|
|
893
2028
|
type index_d_IdentificationData = IdentificationData;
|
|
894
2029
|
type index_d_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
|
|
895
|
-
type index_d_LoyaltyPoints = LoyaltyPoints;
|
|
896
2030
|
type index_d_MessageEnvelope = MessageEnvelope;
|
|
897
|
-
type
|
|
898
|
-
type
|
|
899
|
-
type
|
|
900
|
-
type
|
|
901
|
-
type
|
|
902
|
-
type
|
|
903
|
-
type
|
|
904
|
-
type
|
|
905
|
-
type index_d_QueryReferringCustomerTotalsOptions = QueryReferringCustomerTotalsOptions;
|
|
906
|
-
type index_d_QueryReferringCustomerTotalsRequest = QueryReferringCustomerTotalsRequest;
|
|
907
|
-
type index_d_QueryReferringCustomerTotalsResponse = QueryReferringCustomerTotalsResponse;
|
|
908
|
-
type index_d_QueryReferringCustomerTotalsResponseNonNullableFields = QueryReferringCustomerTotalsResponseNonNullableFields;
|
|
909
|
-
type index_d_ReferralEvent = ReferralEvent;
|
|
910
|
-
type index_d_ReferralEventCreatedEnvelope = ReferralEventCreatedEnvelope;
|
|
911
|
-
type index_d_ReferralEventEventTypeOneOf = ReferralEventEventTypeOneOf;
|
|
912
|
-
type index_d_ReferralEventsQueryBuilder = ReferralEventsQueryBuilder;
|
|
913
|
-
type index_d_ReferralEventsQueryResult = ReferralEventsQueryResult;
|
|
914
|
-
type index_d_ReferredFriendAction = ReferredFriendAction;
|
|
915
|
-
type index_d_ReferredFriendActionEvent = ReferredFriendActionEvent;
|
|
916
|
-
type index_d_ReferredFriendActionRewardTypeOptionsOneOf = ReferredFriendActionRewardTypeOptionsOneOf;
|
|
917
|
-
type index_d_ReferredFriendDetails = ReferredFriendDetails;
|
|
918
|
-
type index_d_ReferredFriendSignupEvent = ReferredFriendSignupEvent;
|
|
919
|
-
type index_d_ReferringCustomerTotal = ReferringCustomerTotal;
|
|
920
|
-
type index_d_Reward = Reward;
|
|
921
|
-
declare const index_d_Reward: typeof Reward;
|
|
922
|
-
type index_d_RewardEvent = RewardEvent;
|
|
923
|
-
type index_d_RewardEventReceiverOneOf = RewardEventReceiverOneOf;
|
|
2031
|
+
type index_d_QueryReferringCustomersRequest = QueryReferringCustomersRequest;
|
|
2032
|
+
type index_d_QueryReferringCustomersResponse = QueryReferringCustomersResponse;
|
|
2033
|
+
type index_d_QueryReferringCustomersResponseNonNullableFields = QueryReferringCustomersResponseNonNullableFields;
|
|
2034
|
+
type index_d_ReferringCustomer = ReferringCustomer;
|
|
2035
|
+
type index_d_ReferringCustomerCreatedEnvelope = ReferringCustomerCreatedEnvelope;
|
|
2036
|
+
type index_d_ReferringCustomerDeletedEnvelope = ReferringCustomerDeletedEnvelope;
|
|
2037
|
+
type index_d_ReferringCustomersQueryBuilder = ReferringCustomersQueryBuilder;
|
|
2038
|
+
type index_d_ReferringCustomersQueryResult = ReferringCustomersQueryResult;
|
|
924
2039
|
type index_d_SortOrder = SortOrder;
|
|
925
2040
|
declare const index_d_SortOrder: typeof SortOrder;
|
|
926
2041
|
type index_d_Sorting = Sorting;
|
|
927
|
-
type index_d_Status = Status;
|
|
928
|
-
declare const index_d_Status: typeof Status;
|
|
929
|
-
type index_d_SuccessfulReferralEvent = SuccessfulReferralEvent;
|
|
930
|
-
type index_d_Trigger = Trigger;
|
|
931
2042
|
type index_d_UndeleteInfo = UndeleteInfo;
|
|
932
|
-
type index_d_V1ActionEvent = V1ActionEvent;
|
|
933
|
-
type index_d_V1Coupon = V1Coupon;
|
|
934
|
-
type index_d_V1SuccessfulReferralEvent = V1SuccessfulReferralEvent;
|
|
935
|
-
type index_d_V1Trigger = V1Trigger;
|
|
936
2043
|
type index_d_WebhookIdentityType = WebhookIdentityType;
|
|
937
2044
|
declare const index_d_WebhookIdentityType: typeof WebhookIdentityType;
|
|
938
2045
|
declare const index_d___metadata: typeof __metadata;
|
|
939
|
-
declare const
|
|
940
|
-
declare const
|
|
941
|
-
declare const
|
|
942
|
-
declare const
|
|
943
|
-
declare const
|
|
944
|
-
declare const
|
|
2046
|
+
declare const index_d_deleteReferringCustomer: typeof deleteReferringCustomer;
|
|
2047
|
+
declare const index_d_generateReferringCustomerForContact: typeof generateReferringCustomerForContact;
|
|
2048
|
+
declare const index_d_getReferringCustomer: typeof getReferringCustomer;
|
|
2049
|
+
declare const index_d_getReferringCustomerByReferralCode: typeof getReferringCustomerByReferralCode;
|
|
2050
|
+
declare const index_d_onReferringCustomerCreated: typeof onReferringCustomerCreated;
|
|
2051
|
+
declare const index_d_onReferringCustomerDeleted: typeof onReferringCustomerDeleted;
|
|
2052
|
+
declare const index_d_queryReferringCustomers: typeof queryReferringCustomers;
|
|
945
2053
|
declare namespace index_d {
|
|
946
|
-
export { type index_d_ActionEvent as ActionEvent, type index_d_BaseEventMetadata as BaseEventMetadata, type
|
|
2054
|
+
export { type index_d_ActionEvent as ActionEvent, type index_d_BaseEventMetadata as BaseEventMetadata, type index_d_CursorPaging as CursorPaging, type index_d_CursorPagingMetadata as CursorPagingMetadata, type index_d_CursorQuery as CursorQuery, type index_d_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type index_d_Cursors as Cursors, type index_d_DeleteReferringCustomerOptions as DeleteReferringCustomerOptions, type index_d_DeleteReferringCustomerRequest as DeleteReferringCustomerRequest, type index_d_DeleteReferringCustomerResponse as DeleteReferringCustomerResponse, type index_d_DomainEvent as DomainEvent, type index_d_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d_EntityCreatedEvent as EntityCreatedEvent, type index_d_EntityDeletedEvent as EntityDeletedEvent, type index_d_EntityUpdatedEvent as EntityUpdatedEvent, type index_d_EventMetadata as EventMetadata, type index_d_GenerateReferringCustomerForContactRequest as GenerateReferringCustomerForContactRequest, type index_d_GenerateReferringCustomerForContactResponse as GenerateReferringCustomerForContactResponse, type index_d_GenerateReferringCustomerForContactResponseNonNullableFields as GenerateReferringCustomerForContactResponseNonNullableFields, type index_d_GetReferringCustomerByReferralCodeRequest as GetReferringCustomerByReferralCodeRequest, type index_d_GetReferringCustomerByReferralCodeResponse as GetReferringCustomerByReferralCodeResponse, type index_d_GetReferringCustomerByReferralCodeResponseNonNullableFields as GetReferringCustomerByReferralCodeResponseNonNullableFields, type index_d_GetReferringCustomerRequest as GetReferringCustomerRequest, type index_d_GetReferringCustomerResponse as GetReferringCustomerResponse, type index_d_GetReferringCustomerResponseNonNullableFields as GetReferringCustomerResponseNonNullableFields, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d_MessageEnvelope as MessageEnvelope, type index_d_QueryReferringCustomersRequest as QueryReferringCustomersRequest, type index_d_QueryReferringCustomersResponse as QueryReferringCustomersResponse, type index_d_QueryReferringCustomersResponseNonNullableFields as QueryReferringCustomersResponseNonNullableFields, type index_d_ReferringCustomer as ReferringCustomer, type index_d_ReferringCustomerCreatedEnvelope as ReferringCustomerCreatedEnvelope, type index_d_ReferringCustomerDeletedEnvelope as ReferringCustomerDeletedEnvelope, type index_d_ReferringCustomersQueryBuilder as ReferringCustomersQueryBuilder, type index_d_ReferringCustomersQueryResult as ReferringCustomersQueryResult, index_d_SortOrder as SortOrder, type index_d_Sorting as Sorting, type index_d_UndeleteInfo as UndeleteInfo, index_d_WebhookIdentityType as WebhookIdentityType, index_d___metadata as __metadata, index_d_deleteReferringCustomer as deleteReferringCustomer, index_d_generateReferringCustomerForContact as generateReferringCustomerForContact, index_d_getReferringCustomer as getReferringCustomer, index_d_getReferringCustomerByReferralCode as getReferringCustomerByReferralCode, index_d_onReferringCustomerCreated as onReferringCustomerCreated, index_d_onReferringCustomerDeleted as onReferringCustomerDeleted, index_d_queryReferringCustomers as queryReferringCustomers };
|
|
947
2055
|
}
|
|
948
2056
|
|
|
949
|
-
export { index_d as tracker };
|
|
2057
|
+
export { index_d as customers, index_d$1 as friends, index_d$2 as tracker };
|