@wix/crm 1.0.131 → 1.0.132
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/package.json +2 -2
- package/type-bundles/context.bundle.d.ts +285 -75
- package/type-bundles/index.bundle.d.ts +285 -75
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2
|
-
interface HttpClient {
|
|
3
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
1
|
+
type RESTFunctionDescriptor$5<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$5) => T;
|
|
2
|
+
interface HttpClient$5 {
|
|
3
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$5<TResponse, TData>): Promise<HttpResponse$5<TResponse>>;
|
|
4
4
|
fetchWithAuth: typeof fetch;
|
|
5
5
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
6
6
|
}
|
|
7
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
8
|
-
type HttpResponse<T = any> = {
|
|
7
|
+
type RequestOptionsFactory$5<TResponse = any, TData = any> = (context: any) => RequestOptions$5<TResponse, TData>;
|
|
8
|
+
type HttpResponse$5<T = any> = {
|
|
9
9
|
data: T;
|
|
10
10
|
status: number;
|
|
11
11
|
statusText: string;
|
|
12
12
|
headers: any;
|
|
13
13
|
request?: any;
|
|
14
14
|
};
|
|
15
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
15
|
+
type RequestOptions$5<_TResponse = any, Data = any> = {
|
|
16
16
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
17
17
|
url: string;
|
|
18
18
|
data?: Data;
|
|
19
19
|
params?: URLSearchParams;
|
|
20
|
-
} & APIMetadata;
|
|
21
|
-
type APIMetadata = {
|
|
20
|
+
} & APIMetadata$5;
|
|
21
|
+
type APIMetadata$5 = {
|
|
22
22
|
methodFqn?: string;
|
|
23
23
|
entityFqdn?: string;
|
|
24
24
|
packageName?: string;
|
|
25
25
|
};
|
|
26
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
27
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
26
|
+
type BuildRESTFunction$5<T extends RESTFunctionDescriptor$5> = T extends RESTFunctionDescriptor$5<infer U> ? U : never;
|
|
27
|
+
type EventDefinition$4<Payload = unknown, Type extends string = string> = {
|
|
28
28
|
__type: 'event-definition';
|
|
29
29
|
type: Type;
|
|
30
30
|
isDomainEvent?: boolean;
|
|
31
31
|
transformations?: (envelope: unknown) => Payload;
|
|
32
32
|
__payload: Payload;
|
|
33
33
|
};
|
|
34
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
35
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
36
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
34
|
+
declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
|
|
35
|
+
type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
|
|
36
|
+
type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
|
|
37
37
|
|
|
38
38
|
declare global {
|
|
39
39
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -420,7 +420,7 @@ interface GetAttachmentIdentifiers {
|
|
|
420
420
|
attachmentId: string;
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
-
declare function generateAttachmentUploadUrl$1(httpClient: HttpClient): GenerateAttachmentUploadUrlSignature;
|
|
423
|
+
declare function generateAttachmentUploadUrl$1(httpClient: HttpClient$5): GenerateAttachmentUploadUrlSignature;
|
|
424
424
|
interface GenerateAttachmentUploadUrlSignature {
|
|
425
425
|
/**
|
|
426
426
|
* Generates an upload URL to allow external clients to upload a file as an attachment to a given contact.
|
|
@@ -432,7 +432,7 @@ interface GenerateAttachmentUploadUrlSignature {
|
|
|
432
432
|
*/
|
|
433
433
|
(contactId: string, fileName: string, options: GenerateAttachmentUploadUrlOptions): Promise<GenerateAttachmentUploadUrlResponse & GenerateAttachmentUploadUrlResponseNonNullableFields>;
|
|
434
434
|
}
|
|
435
|
-
declare function listAttachments$1(httpClient: HttpClient): ListAttachmentsSignature;
|
|
435
|
+
declare function listAttachments$1(httpClient: HttpClient$5): ListAttachmentsSignature;
|
|
436
436
|
interface ListAttachmentsSignature {
|
|
437
437
|
/**
|
|
438
438
|
* List Attachments.
|
|
@@ -440,14 +440,14 @@ interface ListAttachmentsSignature {
|
|
|
440
440
|
*/
|
|
441
441
|
(contactId: string, options?: ListAttachmentsOptions | undefined): Promise<ListAttachmentsResponse & ListAttachmentsResponseNonNullableFields>;
|
|
442
442
|
}
|
|
443
|
-
declare function deleteAttachment$1(httpClient: HttpClient): DeleteAttachmentSignature;
|
|
443
|
+
declare function deleteAttachment$1(httpClient: HttpClient$5): DeleteAttachmentSignature;
|
|
444
444
|
interface DeleteAttachmentSignature {
|
|
445
445
|
/**
|
|
446
446
|
* Deletes an attachment from contact
|
|
447
447
|
*/
|
|
448
448
|
(identifiers: DeleteAttachmentIdentifiers): Promise<void>;
|
|
449
449
|
}
|
|
450
|
-
declare function getAttachment$1(httpClient: HttpClient): GetAttachmentSignature;
|
|
450
|
+
declare function getAttachment$1(httpClient: HttpClient$5): GetAttachmentSignature;
|
|
451
451
|
interface GetAttachmentSignature {
|
|
452
452
|
/**
|
|
453
453
|
* Retrieves an attachment.
|
|
@@ -455,15 +455,15 @@ interface GetAttachmentSignature {
|
|
|
455
455
|
*/
|
|
456
456
|
(identifiers: GetAttachmentIdentifiers): Promise<ContactAttachment & ContactAttachmentNonNullableFields>;
|
|
457
457
|
}
|
|
458
|
-
declare const onAttachmentCreated$1: EventDefinition<AttachmentCreatedEnvelope, "wix.contacts.v4.attachment_created">;
|
|
459
|
-
declare const onAttachmentDeleted$1: EventDefinition<AttachmentDeletedEnvelope, "wix.contacts.v4.attachment_deleted">;
|
|
458
|
+
declare const onAttachmentCreated$1: EventDefinition$4<AttachmentCreatedEnvelope, "wix.contacts.v4.attachment_created">;
|
|
459
|
+
declare const onAttachmentDeleted$1: EventDefinition$4<AttachmentDeletedEnvelope, "wix.contacts.v4.attachment_deleted">;
|
|
460
460
|
|
|
461
|
-
declare function createEventModule$4<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
461
|
+
declare function createEventModule$4<T extends EventDefinition$4<any, string>>(eventDefinition: T): BuildEventDefinition$4<T> & T;
|
|
462
462
|
|
|
463
|
-
declare const generateAttachmentUploadUrl: BuildRESTFunction<typeof generateAttachmentUploadUrl$1> & typeof generateAttachmentUploadUrl$1;
|
|
464
|
-
declare const listAttachments: BuildRESTFunction<typeof listAttachments$1> & typeof listAttachments$1;
|
|
465
|
-
declare const deleteAttachment: BuildRESTFunction<typeof deleteAttachment$1> & typeof deleteAttachment$1;
|
|
466
|
-
declare const getAttachment: BuildRESTFunction<typeof getAttachment$1> & typeof getAttachment$1;
|
|
463
|
+
declare const generateAttachmentUploadUrl: BuildRESTFunction$5<typeof generateAttachmentUploadUrl$1> & typeof generateAttachmentUploadUrl$1;
|
|
464
|
+
declare const listAttachments: BuildRESTFunction$5<typeof listAttachments$1> & typeof listAttachments$1;
|
|
465
|
+
declare const deleteAttachment: BuildRESTFunction$5<typeof deleteAttachment$1> & typeof deleteAttachment$1;
|
|
466
|
+
declare const getAttachment: BuildRESTFunction$5<typeof getAttachment$1> & typeof getAttachment$1;
|
|
467
467
|
|
|
468
468
|
type _publicOnAttachmentCreatedType = typeof onAttachmentCreated$1;
|
|
469
469
|
/**
|
|
@@ -524,6 +524,50 @@ declare namespace context$5 {
|
|
|
524
524
|
export { type ActionEvent$4 as ActionEvent, type context$5_AttachmentCreatedEnvelope as AttachmentCreatedEnvelope, type context$5_AttachmentDeletedEnvelope as AttachmentDeletedEnvelope, type context$5_AttachmentMedia as AttachmentMedia, type context$5_AttachmentMediaMediaOneOf as AttachmentMediaMediaOneOf, type context$5_AttachmentMetadata as AttachmentMetadata, type context$5_AttachmentSource as AttachmentSource, context$5_AttachmentType as AttachmentType, type BaseEventMetadata$4 as BaseEventMetadata, type context$5_ContactAttachment as ContactAttachment, type context$5_ContactAttachmentMediaOneOf as ContactAttachmentMediaOneOf, type context$5_ContactAttachmentNonNullableFields as ContactAttachmentNonNullableFields, type context$5_CreateDemoAttachmentRequest as CreateDemoAttachmentRequest, type context$5_CreateDemoAttachmentResponse as CreateDemoAttachmentResponse, type context$5_CrmAttachment as CrmAttachment, context$5_CrmAttachmentAttachmentType as CrmAttachmentAttachmentType, type context$5_CrmAttachmentUploadedEvent as CrmAttachmentUploadedEvent, type context$5_DeleteAttachmentIdentifiers as DeleteAttachmentIdentifiers, type context$5_DeleteAttachmentRequest as DeleteAttachmentRequest, type context$5_DeleteAttachmentResponse as DeleteAttachmentResponse, context$5_DemoContactType as DemoContactType, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$4 as EntityCreatedEvent, type EntityDeletedEvent$4 as EntityDeletedEvent, type EntityUpdatedEvent$4 as EntityUpdatedEvent, type EventMetadata$4 as EventMetadata, type context$5_GenerateAttachmentUploadUrlOptions as GenerateAttachmentUploadUrlOptions, type context$5_GenerateAttachmentUploadUrlRequest as GenerateAttachmentUploadUrlRequest, type context$5_GenerateAttachmentUploadUrlResponse as GenerateAttachmentUploadUrlResponse, type context$5_GenerateAttachmentUploadUrlResponseNonNullableFields as GenerateAttachmentUploadUrlResponseNonNullableFields, type context$5_GetAttachmentIdentifiers as GetAttachmentIdentifiers, type context$5_GetAttachmentRequest as GetAttachmentRequest, type context$5_GetAttachmentResponse as GetAttachmentResponse, type context$5_GetAttachmentResponseNonNullableFields as GetAttachmentResponseNonNullableFields, type IdentificationData$5 as IdentificationData, type IdentificationDataIdOneOf$5 as IdentificationDataIdOneOf, type context$5_ListAttachmentsOptions as ListAttachmentsOptions, type context$5_ListAttachmentsRequest as ListAttachmentsRequest, type context$5_ListAttachmentsResponse as ListAttachmentsResponse, type context$5_ListAttachmentsResponseNonNullableFields as ListAttachmentsResponseNonNullableFields, type context$5_MediaFileUploadedEvent as MediaFileUploadedEvent, type MessageEnvelope$5 as MessageEnvelope, type Paging$4 as Paging, type PagingMetadata$3 as PagingMetadata, WebhookIdentityType$5 as WebhookIdentityType, type context$5__publicOnAttachmentCreatedType as _publicOnAttachmentCreatedType, type context$5__publicOnAttachmentDeletedType as _publicOnAttachmentDeletedType, context$5_deleteAttachment as deleteAttachment, context$5_generateAttachmentUploadUrl as generateAttachmentUploadUrl, context$5_getAttachment as getAttachment, context$5_listAttachments as listAttachments, context$5_onAttachmentCreated as onAttachmentCreated, context$5_onAttachmentDeleted as onAttachmentDeleted, onAttachmentCreated$1 as publicOnAttachmentCreated, onAttachmentDeleted$1 as publicOnAttachmentDeleted };
|
|
525
525
|
}
|
|
526
526
|
|
|
527
|
+
type RESTFunctionDescriptor$4<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$4) => T;
|
|
528
|
+
interface HttpClient$4 {
|
|
529
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$4<TResponse, TData>): Promise<HttpResponse$4<TResponse>>;
|
|
530
|
+
fetchWithAuth: typeof fetch;
|
|
531
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
532
|
+
}
|
|
533
|
+
type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
|
|
534
|
+
type HttpResponse$4<T = any> = {
|
|
535
|
+
data: T;
|
|
536
|
+
status: number;
|
|
537
|
+
statusText: string;
|
|
538
|
+
headers: any;
|
|
539
|
+
request?: any;
|
|
540
|
+
};
|
|
541
|
+
type RequestOptions$4<_TResponse = any, Data = any> = {
|
|
542
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
543
|
+
url: string;
|
|
544
|
+
data?: Data;
|
|
545
|
+
params?: URLSearchParams;
|
|
546
|
+
} & APIMetadata$4;
|
|
547
|
+
type APIMetadata$4 = {
|
|
548
|
+
methodFqn?: string;
|
|
549
|
+
entityFqdn?: string;
|
|
550
|
+
packageName?: string;
|
|
551
|
+
};
|
|
552
|
+
type BuildRESTFunction$4<T extends RESTFunctionDescriptor$4> = T extends RESTFunctionDescriptor$4<infer U> ? U : never;
|
|
553
|
+
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
554
|
+
__type: 'event-definition';
|
|
555
|
+
type: Type;
|
|
556
|
+
isDomainEvent?: boolean;
|
|
557
|
+
transformations?: (envelope: unknown) => Payload;
|
|
558
|
+
__payload: Payload;
|
|
559
|
+
};
|
|
560
|
+
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
561
|
+
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
562
|
+
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
563
|
+
|
|
564
|
+
declare global {
|
|
565
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
566
|
+
interface SymbolConstructor {
|
|
567
|
+
readonly observable: symbol;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
527
571
|
interface Contact {
|
|
528
572
|
/**
|
|
529
573
|
* Contact ID.
|
|
@@ -2439,7 +2483,7 @@ interface GetContactOptions {
|
|
|
2439
2483
|
fieldsets?: ContactFieldSet[];
|
|
2440
2484
|
}
|
|
2441
2485
|
|
|
2442
|
-
declare function createContact$1(httpClient: HttpClient): CreateContactSignature;
|
|
2486
|
+
declare function createContact$1(httpClient: HttpClient$4): CreateContactSignature;
|
|
2443
2487
|
interface CreateContactSignature {
|
|
2444
2488
|
/**
|
|
2445
2489
|
* Creates a new contact.
|
|
@@ -2460,7 +2504,7 @@ interface CreateContactSignature {
|
|
|
2460
2504
|
*/
|
|
2461
2505
|
(info: ContactInfo$2, options?: CreateContactOptions | undefined): Promise<CreateContactResponse & CreateContactResponseNonNullableFields>;
|
|
2462
2506
|
}
|
|
2463
|
-
declare function updateContact$1(httpClient: HttpClient): UpdateContactSignature;
|
|
2507
|
+
declare function updateContact$1(httpClient: HttpClient$4): UpdateContactSignature;
|
|
2464
2508
|
interface UpdateContactSignature {
|
|
2465
2509
|
/**
|
|
2466
2510
|
* Updates a contact's properties.
|
|
@@ -2480,7 +2524,7 @@ interface UpdateContactSignature {
|
|
|
2480
2524
|
*/
|
|
2481
2525
|
(contactId: string, info: ContactInfo$2, revision: number | null, options?: UpdateContactOptions | undefined): Promise<UpdateContactResponse & UpdateContactResponseNonNullableFields>;
|
|
2482
2526
|
}
|
|
2483
|
-
declare function mergeContacts$1(httpClient: HttpClient): MergeContactsSignature;
|
|
2527
|
+
declare function mergeContacts$1(httpClient: HttpClient$4): MergeContactsSignature;
|
|
2484
2528
|
interface MergeContactsSignature {
|
|
2485
2529
|
/**
|
|
2486
2530
|
* Merges source contacts into a target contact.
|
|
@@ -2506,7 +2550,7 @@ interface MergeContactsSignature {
|
|
|
2506
2550
|
*/
|
|
2507
2551
|
(targetContactId: string, targetContactRevision: number | null, options?: MergeContactsOptions | undefined): Promise<MergeContactsResponse & MergeContactsResponseNonNullableFields>;
|
|
2508
2552
|
}
|
|
2509
|
-
declare function deleteContact$1(httpClient: HttpClient): DeleteContactSignature;
|
|
2553
|
+
declare function deleteContact$1(httpClient: HttpClient$4): DeleteContactSignature;
|
|
2510
2554
|
interface DeleteContactSignature {
|
|
2511
2555
|
/**
|
|
2512
2556
|
* Deletes a contact who is not a site member or contributor.
|
|
@@ -2524,7 +2568,7 @@ interface DeleteContactSignature {
|
|
|
2524
2568
|
*/
|
|
2525
2569
|
(contactId: string): Promise<void>;
|
|
2526
2570
|
}
|
|
2527
|
-
declare function labelContact$1(httpClient: HttpClient): LabelContactSignature;
|
|
2571
|
+
declare function labelContact$1(httpClient: HttpClient$4): LabelContactSignature;
|
|
2528
2572
|
interface LabelContactSignature {
|
|
2529
2573
|
/**
|
|
2530
2574
|
* Adds labels to a contact.
|
|
@@ -2546,7 +2590,7 @@ interface LabelContactSignature {
|
|
|
2546
2590
|
*/
|
|
2547
2591
|
(contactId: string, labelKeys: string[]): Promise<LabelContactResponse & LabelContactResponseNonNullableFields>;
|
|
2548
2592
|
}
|
|
2549
|
-
declare function unlabelContact$1(httpClient: HttpClient): UnlabelContactSignature;
|
|
2593
|
+
declare function unlabelContact$1(httpClient: HttpClient$4): UnlabelContactSignature;
|
|
2550
2594
|
interface UnlabelContactSignature {
|
|
2551
2595
|
/**
|
|
2552
2596
|
* Removes labels from a contact.
|
|
@@ -2562,7 +2606,7 @@ interface UnlabelContactSignature {
|
|
|
2562
2606
|
*/
|
|
2563
2607
|
(contactId: string, labelKeys: string[]): Promise<UnlabelContactResponse & UnlabelContactResponseNonNullableFields>;
|
|
2564
2608
|
}
|
|
2565
|
-
declare function queryContacts$1(httpClient: HttpClient): QueryContactsSignature;
|
|
2609
|
+
declare function queryContacts$1(httpClient: HttpClient$4): QueryContactsSignature;
|
|
2566
2610
|
interface QueryContactsSignature {
|
|
2567
2611
|
/**
|
|
2568
2612
|
* Creates a query to retrieve a list of contacts.
|
|
@@ -2584,7 +2628,7 @@ interface QueryContactsSignature {
|
|
|
2584
2628
|
*/
|
|
2585
2629
|
(options?: QueryContactsOptions | undefined): ContactsQueryBuilder;
|
|
2586
2630
|
}
|
|
2587
|
-
declare function getContact$1(httpClient: HttpClient): GetContactSignature;
|
|
2631
|
+
declare function getContact$1(httpClient: HttpClient$4): GetContactSignature;
|
|
2588
2632
|
interface GetContactSignature {
|
|
2589
2633
|
/**
|
|
2590
2634
|
* Retrieves a contact.
|
|
@@ -2605,21 +2649,21 @@ interface GetContactSignature {
|
|
|
2605
2649
|
*/
|
|
2606
2650
|
(_id: string, options?: GetContactOptions | undefined): Promise<Contact & ContactNonNullableFields>;
|
|
2607
2651
|
}
|
|
2608
|
-
declare const onContactCreated$1: EventDefinition<ContactCreatedEnvelope, "wix.contacts.v4.contact_created">;
|
|
2609
|
-
declare const onContactUpdated$1: EventDefinition<ContactUpdatedEnvelope, "wix.contacts.v4.contact_updated">;
|
|
2610
|
-
declare const onContactMerged$1: EventDefinition<ContactMergedEnvelope, "wix.contacts.v4.contact_merged">;
|
|
2611
|
-
declare const onContactDeleted$1: EventDefinition<ContactDeletedEnvelope, "wix.contacts.v4.contact_deleted">;
|
|
2652
|
+
declare const onContactCreated$1: EventDefinition$3<ContactCreatedEnvelope, "wix.contacts.v4.contact_created">;
|
|
2653
|
+
declare const onContactUpdated$1: EventDefinition$3<ContactUpdatedEnvelope, "wix.contacts.v4.contact_updated">;
|
|
2654
|
+
declare const onContactMerged$1: EventDefinition$3<ContactMergedEnvelope, "wix.contacts.v4.contact_merged">;
|
|
2655
|
+
declare const onContactDeleted$1: EventDefinition$3<ContactDeletedEnvelope, "wix.contacts.v4.contact_deleted">;
|
|
2612
2656
|
|
|
2613
|
-
declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
2657
|
+
declare function createEventModule$3<T extends EventDefinition$3<any, string>>(eventDefinition: T): BuildEventDefinition$3<T> & T;
|
|
2614
2658
|
|
|
2615
|
-
declare const createContact: BuildRESTFunction<typeof createContact$1> & typeof createContact$1;
|
|
2616
|
-
declare const updateContact: BuildRESTFunction<typeof updateContact$1> & typeof updateContact$1;
|
|
2617
|
-
declare const mergeContacts: BuildRESTFunction<typeof mergeContacts$1> & typeof mergeContacts$1;
|
|
2618
|
-
declare const deleteContact: BuildRESTFunction<typeof deleteContact$1> & typeof deleteContact$1;
|
|
2619
|
-
declare const labelContact: BuildRESTFunction<typeof labelContact$1> & typeof labelContact$1;
|
|
2620
|
-
declare const unlabelContact: BuildRESTFunction<typeof unlabelContact$1> & typeof unlabelContact$1;
|
|
2621
|
-
declare const queryContacts: BuildRESTFunction<typeof queryContacts$1> & typeof queryContacts$1;
|
|
2622
|
-
declare const getContact: BuildRESTFunction<typeof getContact$1> & typeof getContact$1;
|
|
2659
|
+
declare const createContact: BuildRESTFunction$4<typeof createContact$1> & typeof createContact$1;
|
|
2660
|
+
declare const updateContact: BuildRESTFunction$4<typeof updateContact$1> & typeof updateContact$1;
|
|
2661
|
+
declare const mergeContacts: BuildRESTFunction$4<typeof mergeContacts$1> & typeof mergeContacts$1;
|
|
2662
|
+
declare const deleteContact: BuildRESTFunction$4<typeof deleteContact$1> & typeof deleteContact$1;
|
|
2663
|
+
declare const labelContact: BuildRESTFunction$4<typeof labelContact$1> & typeof labelContact$1;
|
|
2664
|
+
declare const unlabelContact: BuildRESTFunction$4<typeof unlabelContact$1> & typeof unlabelContact$1;
|
|
2665
|
+
declare const queryContacts: BuildRESTFunction$4<typeof queryContacts$1> & typeof queryContacts$1;
|
|
2666
|
+
declare const getContact: BuildRESTFunction$4<typeof getContact$1> & typeof getContact$1;
|
|
2623
2667
|
|
|
2624
2668
|
type _publicOnContactCreatedType = typeof onContactCreated$1;
|
|
2625
2669
|
/**
|
|
@@ -2806,6 +2850,50 @@ declare namespace context$4 {
|
|
|
2806
2850
|
export { context$4_Action as Action, type ActionEvent$3 as ActionEvent, type ActivityIcon$1 as ActivityIcon, type Address$1 as Address, type AddressLocation$1 as AddressLocation, type AddressStreetOneOf$1 as AddressStreetOneOf, AddressTag$1 as AddressTag, type context$4_ApplicationError as ApplicationError, type AssigneesWrapper$1 as AssigneesWrapper, type BaseEventMetadata$3 as BaseEventMetadata, type context$4_BulkActionMetadata as BulkActionMetadata, type context$4_BulkAddSegmentToContactsRequest as BulkAddSegmentToContactsRequest, type context$4_BulkAddSegmentToContactsResponse as BulkAddSegmentToContactsResponse, type context$4_BulkDeleteContactsRequest as BulkDeleteContactsRequest, type context$4_BulkDeleteContactsResponse as BulkDeleteContactsResponse, type context$4_BulkLabelAndUnlabelContactsRequest as BulkLabelAndUnlabelContactsRequest, type context$4_BulkLabelAndUnlabelContactsResponse as BulkLabelAndUnlabelContactsResponse, type context$4_BulkRemoveSegmentFromContactsRequest as BulkRemoveSegmentFromContactsRequest, type context$4_BulkRemoveSegmentFromContactsResponse as BulkRemoveSegmentFromContactsResponse, type context$4_BulkUpdateContactsRequest as BulkUpdateContactsRequest, type context$4_BulkUpdateContactsResponse as BulkUpdateContactsResponse, type context$4_BulkUpsertContactsRequest as BulkUpsertContactsRequest, type context$4_BulkUpsertContactsResponse as BulkUpsertContactsResponse, type context$4_BulkUpsertContactsResponseMetadata as BulkUpsertContactsResponseMetadata, type context$4_Contact as Contact, type ContactActivity$1 as ContactActivity, ContactActivityType$1 as ContactActivityType, type context$4_ContactAddedToSegment as ContactAddedToSegment, type ContactAddress$1 as ContactAddress, type ContactAddressesWrapper$1 as ContactAddressesWrapper, type context$4_ContactChanged as ContactChanged, type context$4_ContactCreatedEnvelope as ContactCreatedEnvelope, type context$4_ContactDeletedEnvelope as ContactDeletedEnvelope, type ContactEmail$1 as ContactEmail, type context$4_ContactEmailSubscriptionUpdated as ContactEmailSubscriptionUpdated, type ContactEmailsWrapper$1 as ContactEmailsWrapper, context$4_ContactFieldSet as ContactFieldSet, type ContactInfo$2 as ContactInfo, type context$4_ContactMerged as ContactMerged, type context$4_ContactMergedEnvelope as ContactMergedEnvelope, type ContactName$1 as ContactName, type context$4_ContactNonNullableFields as ContactNonNullableFields, type ContactPhone$1 as ContactPhone, type context$4_ContactPhoneSubscriptionUpdated as ContactPhoneSubscriptionUpdated, type ContactPhonesWrapper$1 as ContactPhonesWrapper, type ContactPicture$1 as ContactPicture, type context$4_ContactPrimaryInfoUpdated as ContactPrimaryInfoUpdated, type context$4_ContactRemovedFromSegment as ContactRemovedFromSegment, type context$4_ContactSource as ContactSource, ContactSourceType$1 as ContactSourceType, type context$4_ContactSubmitted as ContactSubmitted, type context$4_ContactUpdatedEnvelope as ContactUpdatedEnvelope, type context$4_ContactsFacet as ContactsFacet, context$4_ContactsFacetType as ContactsFacetType, type context$4_ContactsQueryBuilder as ContactsQueryBuilder, type context$4_ContactsQueryResult as ContactsQueryResult, type context$4_CountContactsRequest as CountContactsRequest, type context$4_CountContactsResponse as CountContactsResponse, type context$4_CreateContactOptions as CreateContactOptions, type context$4_CreateContactRequest as CreateContactRequest, type context$4_CreateContactResponse as CreateContactResponse, type context$4_CreateContactResponseNonNullableFields as CreateContactResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type CursorPagingMetadata$1 as CursorPagingMetadata, type Cursors$1 as Cursors, type context$4_DeleteContactRequest as DeleteContactRequest, type context$4_DeleteContactResponse as DeleteContactResponse, type DomainEvent$3 as DomainEvent, type DomainEventBodyOneOf$3 as DomainEventBodyOneOf, type context$4_DuplicateContactExists as DuplicateContactExists, context$4_EmailDeliverabilityStatus as EmailDeliverabilityStatus, EmailTag$1 as EmailTag, type EntityCreatedEvent$3 as EntityCreatedEvent, type EntityDeletedEvent$3 as EntityDeletedEvent, type EntityUpdatedEvent$3 as EntityUpdatedEvent, type context$4_Error as Error, type EventMetadata$3 as EventMetadata, type ExtendedFieldsWrapper$1 as ExtendedFieldsWrapper, type context$4_GeneratePictureUploadUrlRequest as GeneratePictureUploadUrlRequest, type context$4_GeneratePictureUploadUrlResponse as GeneratePictureUploadUrlResponse, type context$4_GetContactOptions as GetContactOptions, type context$4_GetContactRequest as GetContactRequest, type context$4_GetContactResponse as GetContactResponse, type context$4_GetContactResponseNonNullableFields as GetContactResponseNonNullableFields, context$4_GetContactResponseType as GetContactResponseType, type context$4_GroupInfo as GroupInfo, type IdentificationData$4 as IdentificationData, type IdentificationDataIdOneOf$4 as IdentificationDataIdOneOf, ImageProvider$1 as ImageProvider, type context$4_Item as Item, type context$4_ItemMetadata as ItemMetadata, type context$4_LabelAndUnlabelContactRequest as LabelAndUnlabelContactRequest, type context$4_LabelAndUnlabelContactResponse as LabelAndUnlabelContactResponse, type context$4_LabelContactRequest as LabelContactRequest, type context$4_LabelContactResponse as LabelContactResponse, type context$4_LabelContactResponseNonNullableFields as LabelContactResponseNonNullableFields, type LabelsWrapper$1 as LabelsWrapper, type context$4_LastActivityUpdate as LastActivityUpdate, type context$4_ListContactIdsBySegmentRequest as ListContactIdsBySegmentRequest, type context$4_ListContactIdsBySegmentResponse as ListContactIdsBySegmentResponse, type context$4_ListContactsRequest as ListContactsRequest, type context$4_ListContactsResponse as ListContactsResponse, type context$4_ListFacetsRequest as ListFacetsRequest, type context$4_ListFacetsResponse as ListFacetsResponse, type LocationsWrapper$1 as LocationsWrapper, type context$4_MemberInfo as MemberInfo, context$4_MemberStatus as MemberStatus, type context$4_MergeContactsOptions as MergeContactsOptions, type context$4_MergeContactsRequest as MergeContactsRequest, type context$4_MergeContactsResponse as MergeContactsResponse, type context$4_MergeContactsResponseNonNullableFields as MergeContactsResponseNonNullableFields, type MessageEnvelope$4 as MessageEnvelope, type context$4_Metadata as Metadata, context$4_Mode as Mode, type Paging$3 as Paging, type PagingMetadata$2 as PagingMetadata, context$4_PhoneDeliverabilityStatus as PhoneDeliverabilityStatus, PhoneTag$1 as PhoneTag, type context$4_PreviewMergeContactsRequest as PreviewMergeContactsRequest, type context$4_PreviewMergeContactsResponse as PreviewMergeContactsResponse, type context$4_PrimaryContactInfo as PrimaryContactInfo, type context$4_PrimaryEmail as PrimaryEmail, type context$4_PrimaryPhone as PrimaryPhone, type context$4_PrimarySubscriptionStatus as PrimarySubscriptionStatus, context$4_PrivacyStatus as PrivacyStatus, type context$4_ProfileInfo as ProfileInfo, type Query$2 as Query, type context$4_QueryContactsOptions as QueryContactsOptions, type context$4_QueryContactsRequest as QueryContactsRequest, type context$4_QueryContactsResponse as QueryContactsResponse, type context$4_QueryContactsResponseNonNullableFields as QueryContactsResponseNonNullableFields, type context$4_QueryFacetsRequest as QueryFacetsRequest, type context$4_QueryFacetsResponse as QueryFacetsResponse, type RestoreInfo$2 as RestoreInfo, context$4_Role as Role, type context$4_Search as Search, type context$4_SearchContactsRequest as SearchContactsRequest, type context$4_SearchContactsResponse as SearchContactsResponse, type context$4_SearchDetails as SearchDetails, type context$4_SearchPagingMethodOneOf as SearchPagingMethodOneOf, type context$4_SegmentsWrapper as SegmentsWrapper, type context$4_SessionInfo as SessionInfo, SortOrder$3 as SortOrder, type Sorting$3 as Sorting, type StreetAddress$1 as StreetAddress, type Subdivision$1 as Subdivision, SubdivisionType$1 as SubdivisionType, SubmitOperation$1 as SubmitOperation, context$4_SubscriptionStatus as SubscriptionStatus, type context$4_SyncSubmitContactRequest as SyncSubmitContactRequest, type context$4_SyncSubmitContactResponse as SyncSubmitContactResponse, type context$4_UnlabelContactRequest as UnlabelContactRequest, type context$4_UnlabelContactResponse as UnlabelContactResponse, type context$4_UnlabelContactResponseNonNullableFields as UnlabelContactResponseNonNullableFields, type context$4_UpdateContactOptions as UpdateContactOptions, type context$4_UpdateContactRequest as UpdateContactRequest, type context$4_UpdateContactResponse as UpdateContactResponse, type context$4_UpdateContactResponseNonNullableFields as UpdateContactResponseNonNullableFields, type context$4_UpsertContactRequest as UpsertContactRequest, type context$4_UpsertContactResponse as UpsertContactResponse, context$4_UpsertContactResponseAction as UpsertContactResponseAction, type context$4_UserInfo as UserInfo, WebhookIdentityType$4 as WebhookIdentityType, type context$4__publicOnContactCreatedType as _publicOnContactCreatedType, type context$4__publicOnContactDeletedType as _publicOnContactDeletedType, type context$4__publicOnContactMergedType as _publicOnContactMergedType, type context$4__publicOnContactUpdatedType as _publicOnContactUpdatedType, context$4_createContact as createContact, context$4_deleteContact as deleteContact, context$4_getContact as getContact, context$4_labelContact as labelContact, context$4_mergeContacts as mergeContacts, context$4_onContactCreated as onContactCreated, context$4_onContactDeleted as onContactDeleted, context$4_onContactMerged as onContactMerged, context$4_onContactUpdated as onContactUpdated, onContactCreated$1 as publicOnContactCreated, onContactDeleted$1 as publicOnContactDeleted, onContactMerged$1 as publicOnContactMerged, onContactUpdated$1 as publicOnContactUpdated, context$4_queryContacts as queryContacts, context$4_unlabelContact as unlabelContact, context$4_updateContact as updateContact };
|
|
2807
2851
|
}
|
|
2808
2852
|
|
|
2853
|
+
type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
|
|
2854
|
+
interface HttpClient$3 {
|
|
2855
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
|
|
2856
|
+
fetchWithAuth: typeof fetch;
|
|
2857
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
2858
|
+
}
|
|
2859
|
+
type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
|
|
2860
|
+
type HttpResponse$3<T = any> = {
|
|
2861
|
+
data: T;
|
|
2862
|
+
status: number;
|
|
2863
|
+
statusText: string;
|
|
2864
|
+
headers: any;
|
|
2865
|
+
request?: any;
|
|
2866
|
+
};
|
|
2867
|
+
type RequestOptions$3<_TResponse = any, Data = any> = {
|
|
2868
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
2869
|
+
url: string;
|
|
2870
|
+
data?: Data;
|
|
2871
|
+
params?: URLSearchParams;
|
|
2872
|
+
} & APIMetadata$3;
|
|
2873
|
+
type APIMetadata$3 = {
|
|
2874
|
+
methodFqn?: string;
|
|
2875
|
+
entityFqdn?: string;
|
|
2876
|
+
packageName?: string;
|
|
2877
|
+
};
|
|
2878
|
+
type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
|
|
2879
|
+
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
2880
|
+
__type: 'event-definition';
|
|
2881
|
+
type: Type;
|
|
2882
|
+
isDomainEvent?: boolean;
|
|
2883
|
+
transformations?: (envelope: unknown) => Payload;
|
|
2884
|
+
__payload: Payload;
|
|
2885
|
+
};
|
|
2886
|
+
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
2887
|
+
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
2888
|
+
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
2889
|
+
|
|
2890
|
+
declare global {
|
|
2891
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
2892
|
+
interface SymbolConstructor {
|
|
2893
|
+
readonly observable: symbol;
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2809
2897
|
/** Extended field that was found or created. */
|
|
2810
2898
|
interface ExtendedField {
|
|
2811
2899
|
/**
|
|
@@ -3377,7 +3465,7 @@ interface FieldsQueryBuilder {
|
|
|
3377
3465
|
find: () => Promise<FieldsQueryResult>;
|
|
3378
3466
|
}
|
|
3379
3467
|
|
|
3380
|
-
declare function findOrCreateExtendedField$1(httpClient: HttpClient): FindOrCreateExtendedFieldSignature;
|
|
3468
|
+
declare function findOrCreateExtendedField$1(httpClient: HttpClient$3): FindOrCreateExtendedFieldSignature;
|
|
3381
3469
|
interface FindOrCreateExtendedFieldSignature {
|
|
3382
3470
|
/**
|
|
3383
3471
|
* Retrieves a custom field with a given name, or creates one if it doesn't exist.
|
|
@@ -3406,7 +3494,7 @@ interface FindOrCreateExtendedFieldSignature {
|
|
|
3406
3494
|
*/
|
|
3407
3495
|
(displayName: string, dataType: FieldDataType): Promise<FindOrCreateExtendedFieldResponse & FindOrCreateExtendedFieldResponseNonNullableFields>;
|
|
3408
3496
|
}
|
|
3409
|
-
declare function getExtendedField$1(httpClient: HttpClient): GetExtendedFieldSignature;
|
|
3497
|
+
declare function getExtendedField$1(httpClient: HttpClient$3): GetExtendedFieldSignature;
|
|
3410
3498
|
interface GetExtendedFieldSignature {
|
|
3411
3499
|
/**
|
|
3412
3500
|
* Retrieves an extended field.
|
|
@@ -3425,7 +3513,7 @@ interface GetExtendedFieldSignature {
|
|
|
3425
3513
|
*/
|
|
3426
3514
|
(key: string): Promise<ExtendedField & ExtendedFieldNonNullableFields>;
|
|
3427
3515
|
}
|
|
3428
|
-
declare function renameExtendedField$1(httpClient: HttpClient): RenameExtendedFieldSignature;
|
|
3516
|
+
declare function renameExtendedField$1(httpClient: HttpClient$3): RenameExtendedFieldSignature;
|
|
3429
3517
|
interface RenameExtendedFieldSignature {
|
|
3430
3518
|
/**
|
|
3431
3519
|
* Renames an extended field.
|
|
@@ -3445,7 +3533,7 @@ interface RenameExtendedFieldSignature {
|
|
|
3445
3533
|
*/
|
|
3446
3534
|
(key: string, field: RenameExtendedField): Promise<ExtendedField & ExtendedFieldNonNullableFields>;
|
|
3447
3535
|
}
|
|
3448
|
-
declare function deleteExtendedField$1(httpClient: HttpClient): DeleteExtendedFieldSignature;
|
|
3536
|
+
declare function deleteExtendedField$1(httpClient: HttpClient$3): DeleteExtendedFieldSignature;
|
|
3449
3537
|
interface DeleteExtendedFieldSignature {
|
|
3450
3538
|
/**
|
|
3451
3539
|
* Deletes an extended field.
|
|
@@ -3458,7 +3546,7 @@ interface DeleteExtendedFieldSignature {
|
|
|
3458
3546
|
*/
|
|
3459
3547
|
(key: string): Promise<void>;
|
|
3460
3548
|
}
|
|
3461
|
-
declare function queryExtendedFields$1(httpClient: HttpClient): QueryExtendedFieldsSignature;
|
|
3549
|
+
declare function queryExtendedFields$1(httpClient: HttpClient$3): QueryExtendedFieldsSignature;
|
|
3462
3550
|
interface QueryExtendedFieldsSignature {
|
|
3463
3551
|
/**
|
|
3464
3552
|
* Creates a query to retrieve a list of extended fields.
|
|
@@ -3478,17 +3566,17 @@ interface QueryExtendedFieldsSignature {
|
|
|
3478
3566
|
*/
|
|
3479
3567
|
(): FieldsQueryBuilder;
|
|
3480
3568
|
}
|
|
3481
|
-
declare const onExtendedFieldCreated$1: EventDefinition<ExtendedFieldCreatedEnvelope, "wix.contacts.v4.extended-field_created">;
|
|
3482
|
-
declare const onExtendedFieldUpdated$1: EventDefinition<ExtendedFieldUpdatedEnvelope, "wix.contacts.v4.extended-field_updated">;
|
|
3483
|
-
declare const onExtendedFieldDeleted$1: EventDefinition<ExtendedFieldDeletedEnvelope, "wix.contacts.v4.extended-field_deleted">;
|
|
3569
|
+
declare const onExtendedFieldCreated$1: EventDefinition$2<ExtendedFieldCreatedEnvelope, "wix.contacts.v4.extended-field_created">;
|
|
3570
|
+
declare const onExtendedFieldUpdated$1: EventDefinition$2<ExtendedFieldUpdatedEnvelope, "wix.contacts.v4.extended-field_updated">;
|
|
3571
|
+
declare const onExtendedFieldDeleted$1: EventDefinition$2<ExtendedFieldDeletedEnvelope, "wix.contacts.v4.extended-field_deleted">;
|
|
3484
3572
|
|
|
3485
|
-
declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
3573
|
+
declare function createEventModule$2<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
|
|
3486
3574
|
|
|
3487
|
-
declare const findOrCreateExtendedField: BuildRESTFunction<typeof findOrCreateExtendedField$1> & typeof findOrCreateExtendedField$1;
|
|
3488
|
-
declare const getExtendedField: BuildRESTFunction<typeof getExtendedField$1> & typeof getExtendedField$1;
|
|
3489
|
-
declare const renameExtendedField: BuildRESTFunction<typeof renameExtendedField$1> & typeof renameExtendedField$1;
|
|
3490
|
-
declare const deleteExtendedField: BuildRESTFunction<typeof deleteExtendedField$1> & typeof deleteExtendedField$1;
|
|
3491
|
-
declare const queryExtendedFields: BuildRESTFunction<typeof queryExtendedFields$1> & typeof queryExtendedFields$1;
|
|
3575
|
+
declare const findOrCreateExtendedField: BuildRESTFunction$3<typeof findOrCreateExtendedField$1> & typeof findOrCreateExtendedField$1;
|
|
3576
|
+
declare const getExtendedField: BuildRESTFunction$3<typeof getExtendedField$1> & typeof getExtendedField$1;
|
|
3577
|
+
declare const renameExtendedField: BuildRESTFunction$3<typeof renameExtendedField$1> & typeof renameExtendedField$1;
|
|
3578
|
+
declare const deleteExtendedField: BuildRESTFunction$3<typeof deleteExtendedField$1> & typeof deleteExtendedField$1;
|
|
3579
|
+
declare const queryExtendedFields: BuildRESTFunction$3<typeof queryExtendedFields$1> & typeof queryExtendedFields$1;
|
|
3492
3580
|
|
|
3493
3581
|
type _publicOnExtendedFieldCreatedType = typeof onExtendedFieldCreated$1;
|
|
3494
3582
|
/**
|
|
@@ -3553,6 +3641,50 @@ declare namespace context$3 {
|
|
|
3553
3641
|
export { type ActionEvent$2 as ActionEvent, type BaseEventMetadata$2 as BaseEventMetadata, type context$3_DeleteExtendedFieldRequest as DeleteExtendedFieldRequest, type context$3_DeleteExtendedFieldResponse as DeleteExtendedFieldResponse, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type context$3_ExtendedField as ExtendedField, type context$3_ExtendedFieldCreatedEnvelope as ExtendedFieldCreatedEnvelope, type context$3_ExtendedFieldDeletedEnvelope as ExtendedFieldDeletedEnvelope, type context$3_ExtendedFieldNonNullableFields as ExtendedFieldNonNullableFields, type context$3_ExtendedFieldUpdatedEnvelope as ExtendedFieldUpdatedEnvelope, context$3_FieldDataType as FieldDataType, context$3_FieldType as FieldType, type context$3_FieldsQueryBuilder as FieldsQueryBuilder, type context$3_FieldsQueryResult as FieldsQueryResult, type context$3_FindOrCreateExtendedFieldRequest as FindOrCreateExtendedFieldRequest, type context$3_FindOrCreateExtendedFieldResponse as FindOrCreateExtendedFieldResponse, type context$3_FindOrCreateExtendedFieldResponseNonNullableFields as FindOrCreateExtendedFieldResponseNonNullableFields, type GdprListRequest$1 as GdprListRequest, type GdprListResponse$1 as GdprListResponse, type context$3_GetExtendedFieldByLegacyIdRequest as GetExtendedFieldByLegacyIdRequest, type context$3_GetExtendedFieldByLegacyIdResponse as GetExtendedFieldByLegacyIdResponse, type context$3_GetExtendedFieldRequest as GetExtendedFieldRequest, type context$3_GetExtendedFieldResponse as GetExtendedFieldResponse, type context$3_GetExtendedFieldResponseNonNullableFields as GetExtendedFieldResponseNonNullableFields, type IdentificationData$3 as IdentificationData, type IdentificationDataIdOneOf$3 as IdentificationDataIdOneOf, type context$3_ListExtendedFieldsRequest as ListExtendedFieldsRequest, type context$3_ListExtendedFieldsResponse as ListExtendedFieldsResponse, type MessageEnvelope$3 as MessageEnvelope, type Paging$2 as Paging, type PagingMetadata$1 as PagingMetadata, type PurgeRequest$1 as PurgeRequest, type PurgeResponse$1 as PurgeResponse, type Query$1 as Query, type context$3_QueryExtendedFieldsRequest as QueryExtendedFieldsRequest, type context$3_QueryExtendedFieldsResponse as QueryExtendedFieldsResponse, type context$3_QueryExtendedFieldsResponseNonNullableFields as QueryExtendedFieldsResponseNonNullableFields, type context$3_RenameExtendedField as RenameExtendedField, type RestoreInfo$1 as RestoreInfo, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, type context$3_UpdateExtendedFieldRequest as UpdateExtendedFieldRequest, type context$3_UpdateExtendedFieldResponse as UpdateExtendedFieldResponse, type context$3_UpdateExtendedFieldResponseNonNullableFields as UpdateExtendedFieldResponseNonNullableFields, WebhookIdentityType$3 as WebhookIdentityType, type context$3__publicOnExtendedFieldCreatedType as _publicOnExtendedFieldCreatedType, type context$3__publicOnExtendedFieldDeletedType as _publicOnExtendedFieldDeletedType, type context$3__publicOnExtendedFieldUpdatedType as _publicOnExtendedFieldUpdatedType, context$3_deleteExtendedField as deleteExtendedField, context$3_findOrCreateExtendedField as findOrCreateExtendedField, context$3_getExtendedField as getExtendedField, context$3_onExtendedFieldCreated as onExtendedFieldCreated, context$3_onExtendedFieldDeleted as onExtendedFieldDeleted, context$3_onExtendedFieldUpdated as onExtendedFieldUpdated, onExtendedFieldCreated$1 as publicOnExtendedFieldCreated, onExtendedFieldDeleted$1 as publicOnExtendedFieldDeleted, onExtendedFieldUpdated$1 as publicOnExtendedFieldUpdated, context$3_queryExtendedFields as queryExtendedFields, context$3_renameExtendedField as renameExtendedField };
|
|
3554
3642
|
}
|
|
3555
3643
|
|
|
3644
|
+
type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
|
|
3645
|
+
interface HttpClient$2 {
|
|
3646
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
|
|
3647
|
+
fetchWithAuth: typeof fetch;
|
|
3648
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
3649
|
+
}
|
|
3650
|
+
type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
|
|
3651
|
+
type HttpResponse$2<T = any> = {
|
|
3652
|
+
data: T;
|
|
3653
|
+
status: number;
|
|
3654
|
+
statusText: string;
|
|
3655
|
+
headers: any;
|
|
3656
|
+
request?: any;
|
|
3657
|
+
};
|
|
3658
|
+
type RequestOptions$2<_TResponse = any, Data = any> = {
|
|
3659
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
3660
|
+
url: string;
|
|
3661
|
+
data?: Data;
|
|
3662
|
+
params?: URLSearchParams;
|
|
3663
|
+
} & APIMetadata$2;
|
|
3664
|
+
type APIMetadata$2 = {
|
|
3665
|
+
methodFqn?: string;
|
|
3666
|
+
entityFqdn?: string;
|
|
3667
|
+
packageName?: string;
|
|
3668
|
+
};
|
|
3669
|
+
type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
|
|
3670
|
+
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
3671
|
+
__type: 'event-definition';
|
|
3672
|
+
type: Type;
|
|
3673
|
+
isDomainEvent?: boolean;
|
|
3674
|
+
transformations?: (envelope: unknown) => Payload;
|
|
3675
|
+
__payload: Payload;
|
|
3676
|
+
};
|
|
3677
|
+
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
3678
|
+
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
3679
|
+
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
3680
|
+
|
|
3681
|
+
declare global {
|
|
3682
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
3683
|
+
interface SymbolConstructor {
|
|
3684
|
+
readonly observable: symbol;
|
|
3685
|
+
}
|
|
3686
|
+
}
|
|
3687
|
+
|
|
3556
3688
|
/** Label that was found or created. */
|
|
3557
3689
|
interface ContactLabel {
|
|
3558
3690
|
/**
|
|
@@ -4147,7 +4279,7 @@ interface LabelsQueryBuilder {
|
|
|
4147
4279
|
find: () => Promise<LabelsQueryResult>;
|
|
4148
4280
|
}
|
|
4149
4281
|
|
|
4150
|
-
declare function findOrCreateLabel$1(httpClient: HttpClient): FindOrCreateLabelSignature;
|
|
4282
|
+
declare function findOrCreateLabel$1(httpClient: HttpClient$2): FindOrCreateLabelSignature;
|
|
4151
4283
|
interface FindOrCreateLabelSignature {
|
|
4152
4284
|
/**
|
|
4153
4285
|
* Retrieves a label with a given name, or creates one if it doesn't exist.
|
|
@@ -4170,7 +4302,7 @@ interface FindOrCreateLabelSignature {
|
|
|
4170
4302
|
*/
|
|
4171
4303
|
(displayName: string, options?: FindOrCreateLabelOptions | undefined): Promise<FindOrCreateLabelResponse & FindOrCreateLabelResponseNonNullableFields>;
|
|
4172
4304
|
}
|
|
4173
|
-
declare function getLabel$1(httpClient: HttpClient): GetLabelSignature;
|
|
4305
|
+
declare function getLabel$1(httpClient: HttpClient$2): GetLabelSignature;
|
|
4174
4306
|
interface GetLabelSignature {
|
|
4175
4307
|
/**
|
|
4176
4308
|
* Retrieves a label by the specified label key.
|
|
@@ -4185,7 +4317,7 @@ interface GetLabelSignature {
|
|
|
4185
4317
|
*/
|
|
4186
4318
|
(key: string, options?: GetLabelOptions | undefined): Promise<ContactLabel & ContactLabelNonNullableFields>;
|
|
4187
4319
|
}
|
|
4188
|
-
declare function renameLabel$1(httpClient: HttpClient): RenameLabelSignature;
|
|
4320
|
+
declare function renameLabel$1(httpClient: HttpClient$2): RenameLabelSignature;
|
|
4189
4321
|
interface RenameLabelSignature {
|
|
4190
4322
|
/**
|
|
4191
4323
|
* Renames a label.
|
|
@@ -4202,7 +4334,7 @@ interface RenameLabelSignature {
|
|
|
4202
4334
|
*/
|
|
4203
4335
|
(key: string, label: RenameLabel, options?: RenameLabelOptions | undefined): Promise<ContactLabel & ContactLabelNonNullableFields>;
|
|
4204
4336
|
}
|
|
4205
|
-
declare function deleteLabel$1(httpClient: HttpClient): DeleteLabelSignature;
|
|
4337
|
+
declare function deleteLabel$1(httpClient: HttpClient$2): DeleteLabelSignature;
|
|
4206
4338
|
interface DeleteLabelSignature {
|
|
4207
4339
|
/**
|
|
4208
4340
|
* Deletes a label from the site and removes it from contacts it applies to.
|
|
@@ -4214,7 +4346,7 @@ interface DeleteLabelSignature {
|
|
|
4214
4346
|
*/
|
|
4215
4347
|
(key: string): Promise<void>;
|
|
4216
4348
|
}
|
|
4217
|
-
declare function queryLabels$1(httpClient: HttpClient): QueryLabelsSignature;
|
|
4349
|
+
declare function queryLabels$1(httpClient: HttpClient$2): QueryLabelsSignature;
|
|
4218
4350
|
interface QueryLabelsSignature {
|
|
4219
4351
|
/**
|
|
4220
4352
|
* Creates a query to retrieve a list of labels.
|
|
@@ -4237,17 +4369,17 @@ interface QueryLabelsSignature {
|
|
|
4237
4369
|
*/
|
|
4238
4370
|
(options?: QueryLabelsOptions | undefined): LabelsQueryBuilder;
|
|
4239
4371
|
}
|
|
4240
|
-
declare const onLabelCreated$1: EventDefinition<LabelCreatedEnvelope, "wix.contacts.v4.label_created">;
|
|
4241
|
-
declare const onLabelUpdated$1: EventDefinition<LabelUpdatedEnvelope, "wix.contacts.v4.label_updated">;
|
|
4242
|
-
declare const onLabelDeleted$1: EventDefinition<LabelDeletedEnvelope, "wix.contacts.v4.label_deleted">;
|
|
4372
|
+
declare const onLabelCreated$1: EventDefinition$1<LabelCreatedEnvelope, "wix.contacts.v4.label_created">;
|
|
4373
|
+
declare const onLabelUpdated$1: EventDefinition$1<LabelUpdatedEnvelope, "wix.contacts.v4.label_updated">;
|
|
4374
|
+
declare const onLabelDeleted$1: EventDefinition$1<LabelDeletedEnvelope, "wix.contacts.v4.label_deleted">;
|
|
4243
4375
|
|
|
4244
|
-
declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
4376
|
+
declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
|
|
4245
4377
|
|
|
4246
|
-
declare const findOrCreateLabel: BuildRESTFunction<typeof findOrCreateLabel$1> & typeof findOrCreateLabel$1;
|
|
4247
|
-
declare const getLabel: BuildRESTFunction<typeof getLabel$1> & typeof getLabel$1;
|
|
4248
|
-
declare const renameLabel: BuildRESTFunction<typeof renameLabel$1> & typeof renameLabel$1;
|
|
4249
|
-
declare const deleteLabel: BuildRESTFunction<typeof deleteLabel$1> & typeof deleteLabel$1;
|
|
4250
|
-
declare const queryLabels: BuildRESTFunction<typeof queryLabels$1> & typeof queryLabels$1;
|
|
4378
|
+
declare const findOrCreateLabel: BuildRESTFunction$2<typeof findOrCreateLabel$1> & typeof findOrCreateLabel$1;
|
|
4379
|
+
declare const getLabel: BuildRESTFunction$2<typeof getLabel$1> & typeof getLabel$1;
|
|
4380
|
+
declare const renameLabel: BuildRESTFunction$2<typeof renameLabel$1> & typeof renameLabel$1;
|
|
4381
|
+
declare const deleteLabel: BuildRESTFunction$2<typeof deleteLabel$1> & typeof deleteLabel$1;
|
|
4382
|
+
declare const queryLabels: BuildRESTFunction$2<typeof queryLabels$1> & typeof queryLabels$1;
|
|
4251
4383
|
|
|
4252
4384
|
type _publicOnLabelCreatedType = typeof onLabelCreated$1;
|
|
4253
4385
|
/**
|
|
@@ -4325,6 +4457,40 @@ declare namespace context$2 {
|
|
|
4325
4457
|
export { type ActionEvent$1 as ActionEvent, type BaseEventMetadata$1 as BaseEventMetadata, type context$2_ContactLabel as ContactLabel, type context$2_ContactLabelNamespace as ContactLabelNamespace, type context$2_ContactLabelNonNullableFields as ContactLabelNonNullableFields, type context$2_DeleteLabelRequest as DeleteLabelRequest, type context$2_DeleteLabelResponse as DeleteLabelResponse, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type context$2_FindOrCreateLabelOptions as FindOrCreateLabelOptions, type context$2_FindOrCreateLabelRequest as FindOrCreateLabelRequest, type context$2_FindOrCreateLabelResponse as FindOrCreateLabelResponse, type context$2_FindOrCreateLabelResponseNonNullableFields as FindOrCreateLabelResponseNonNullableFields, type context$2_GdprListRequest as GdprListRequest, type context$2_GdprListResponse as GdprListResponse, type context$2_GetLabelByLegacyIdRequest as GetLabelByLegacyIdRequest, type context$2_GetLabelByLegacyIdResponse as GetLabelByLegacyIdResponse, type context$2_GetLabelOptions as GetLabelOptions, type context$2_GetLabelRequest as GetLabelRequest, type context$2_GetLabelResponse as GetLabelResponse, type context$2_GetLabelResponseNonNullableFields as GetLabelResponseNonNullableFields, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type context$2_LabelCreatedEnvelope as LabelCreatedEnvelope, type context$2_LabelDeletedEnvelope as LabelDeletedEnvelope, context$2_LabelType as LabelType, type context$2_LabelUpdatedEnvelope as LabelUpdatedEnvelope, type context$2_LabelsQueryBuilder as LabelsQueryBuilder, type context$2_LabelsQueryResult as LabelsQueryResult, type context$2_LabelsQuotaReached as LabelsQuotaReached, type context$2_ListLabelNamespacesRequest as ListLabelNamespacesRequest, type context$2_ListLabelNamespacesResponse as ListLabelNamespacesResponse, type context$2_ListLabelsRequest as ListLabelsRequest, type context$2_ListLabelsResponse as ListLabelsResponse, type MessageEnvelope$2 as MessageEnvelope, type Paging$1 as Paging, type context$2_PagingMetadata as PagingMetadata, type context$2_PurgeRequest as PurgeRequest, type context$2_PurgeResponse as PurgeResponse, type context$2_Query as Query, type context$2_QueryLabelsOptions as QueryLabelsOptions, type context$2_QueryLabelsRequest as QueryLabelsRequest, type context$2_QueryLabelsResponse as QueryLabelsResponse, type context$2_QueryLabelsResponseNonNullableFields as QueryLabelsResponseNonNullableFields, type context$2_RenameLabel as RenameLabel, type context$2_RenameLabelOptions as RenameLabelOptions, type context$2_RestoreInfo as RestoreInfo, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, type context$2_UpdateLabelRequest as UpdateLabelRequest, type context$2_UpdateLabelResponse as UpdateLabelResponse, type context$2_UpdateLabelResponseNonNullableFields as UpdateLabelResponseNonNullableFields, WebhookIdentityType$2 as WebhookIdentityType, type context$2__publicOnLabelCreatedType as _publicOnLabelCreatedType, type context$2__publicOnLabelDeletedType as _publicOnLabelDeletedType, type context$2__publicOnLabelUpdatedType as _publicOnLabelUpdatedType, context$2_deleteLabel as deleteLabel, context$2_findOrCreateLabel as findOrCreateLabel, context$2_getLabel as getLabel, context$2_onLabelCreated as onLabelCreated, context$2_onLabelDeleted as onLabelDeleted, context$2_onLabelUpdated as onLabelUpdated, onLabelCreated$1 as publicOnLabelCreated, onLabelDeleted$1 as publicOnLabelDeleted, onLabelUpdated$1 as publicOnLabelUpdated, context$2_queryLabels as queryLabels, context$2_renameLabel as renameLabel };
|
|
4326
4458
|
}
|
|
4327
4459
|
|
|
4460
|
+
type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
|
|
4461
|
+
interface HttpClient$1 {
|
|
4462
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
|
4463
|
+
fetchWithAuth: typeof fetch;
|
|
4464
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
4465
|
+
}
|
|
4466
|
+
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
|
4467
|
+
type HttpResponse$1<T = any> = {
|
|
4468
|
+
data: T;
|
|
4469
|
+
status: number;
|
|
4470
|
+
statusText: string;
|
|
4471
|
+
headers: any;
|
|
4472
|
+
request?: any;
|
|
4473
|
+
};
|
|
4474
|
+
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
4475
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
4476
|
+
url: string;
|
|
4477
|
+
data?: Data;
|
|
4478
|
+
params?: URLSearchParams;
|
|
4479
|
+
} & APIMetadata$1;
|
|
4480
|
+
type APIMetadata$1 = {
|
|
4481
|
+
methodFqn?: string;
|
|
4482
|
+
entityFqdn?: string;
|
|
4483
|
+
packageName?: string;
|
|
4484
|
+
};
|
|
4485
|
+
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
|
4486
|
+
|
|
4487
|
+
declare global {
|
|
4488
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
4489
|
+
interface SymbolConstructor {
|
|
4490
|
+
readonly observable: symbol;
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4493
|
+
|
|
4328
4494
|
/** Dummy message for fqdn validation */
|
|
4329
4495
|
interface SubmitContact {
|
|
4330
4496
|
/** Submit Contact Id */
|
|
@@ -4913,7 +5079,7 @@ interface AppendOrCreateContactOptions {
|
|
|
4913
5079
|
contactId?: string | null;
|
|
4914
5080
|
}
|
|
4915
5081
|
|
|
4916
|
-
declare function appendOrCreateContact$1(httpClient: HttpClient): AppendOrCreateContactSignature;
|
|
5082
|
+
declare function appendOrCreateContact$1(httpClient: HttpClient$1): AppendOrCreateContactSignature;
|
|
4917
5083
|
interface AppendOrCreateContactSignature {
|
|
4918
5084
|
/**
|
|
4919
5085
|
* Appends an existing contact or creates a contact if it doesn't exist.
|
|
@@ -4924,7 +5090,7 @@ interface AppendOrCreateContactSignature {
|
|
|
4924
5090
|
(options?: AppendOrCreateContactOptions | undefined): Promise<SubmitContactResponse & SubmitContactResponseNonNullableFields>;
|
|
4925
5091
|
}
|
|
4926
5092
|
|
|
4927
|
-
declare const appendOrCreateContact: BuildRESTFunction<typeof appendOrCreateContact$1> & typeof appendOrCreateContact$1;
|
|
5093
|
+
declare const appendOrCreateContact: BuildRESTFunction$1<typeof appendOrCreateContact$1> & typeof appendOrCreateContact$1;
|
|
4928
5094
|
|
|
4929
5095
|
type context$1_ActivityIcon = ActivityIcon;
|
|
4930
5096
|
type context$1_Address = Address;
|
|
@@ -4977,6 +5143,50 @@ declare namespace context$1 {
|
|
|
4977
5143
|
export { type context$1_ActivityIcon as ActivityIcon, type context$1_Address as Address, type context$1_AddressLocation as AddressLocation, type context$1_AddressStreetOneOf as AddressStreetOneOf, context$1_AddressTag as AddressTag, type context$1_AppendOrCreateContactOptions as AppendOrCreateContactOptions, type context$1_AssigneesWrapper as AssigneesWrapper, type context$1_ContactActivity as ContactActivity, context$1_ContactActivityType as ContactActivityType, type context$1_ContactAddress as ContactAddress, type context$1_ContactAddressesWrapper as ContactAddressesWrapper, type context$1_ContactEmail as ContactEmail, type context$1_ContactEmailsWrapper as ContactEmailsWrapper, type ContactInfo$1 as ContactInfo, type context$1_ContactName as ContactName, type context$1_ContactPhone as ContactPhone, type context$1_ContactPhonesWrapper as ContactPhonesWrapper, type context$1_ContactPicture as ContactPicture, context$1_ContactSourceType as ContactSourceType, type context$1_ContactToSubmit as ContactToSubmit, context$1_EmailTag as EmailTag, type context$1_ExtendedFieldsWrapper as ExtendedFieldsWrapper, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, context$1_IdentityType as IdentityType, context$1_ImageProvider as ImageProvider, type context$1_LabelsWrapper as LabelsWrapper, type context$1_LocationsWrapper as LocationsWrapper, type MessageEnvelope$1 as MessageEnvelope, context$1_PhoneTag as PhoneTag, type context$1_StreetAddress as StreetAddress, type context$1_Subdivision as Subdivision, context$1_SubdivisionType as SubdivisionType, type context$1_SubmitContact as SubmitContact, type context$1_SubmitContactOptions as SubmitContactOptions, type context$1_SubmitContactRequest as SubmitContactRequest, type context$1_SubmitContactResponse as SubmitContactResponse, type context$1_SubmitContactResponseNonNullableFields as SubmitContactResponseNonNullableFields, context$1_SubmitOperation as SubmitOperation, type context$1_SubmitVisitorIdRequest as SubmitVisitorIdRequest, type context$1_SubmitVisitorIdResponse as SubmitVisitorIdResponse, WebhookIdentityType$1 as WebhookIdentityType, context$1_appendOrCreateContact as appendOrCreateContact };
|
|
4978
5144
|
}
|
|
4979
5145
|
|
|
5146
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
5147
|
+
interface HttpClient {
|
|
5148
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
5149
|
+
fetchWithAuth: typeof fetch;
|
|
5150
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
5151
|
+
}
|
|
5152
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
5153
|
+
type HttpResponse<T = any> = {
|
|
5154
|
+
data: T;
|
|
5155
|
+
status: number;
|
|
5156
|
+
statusText: string;
|
|
5157
|
+
headers: any;
|
|
5158
|
+
request?: any;
|
|
5159
|
+
};
|
|
5160
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
5161
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
5162
|
+
url: string;
|
|
5163
|
+
data?: Data;
|
|
5164
|
+
params?: URLSearchParams;
|
|
5165
|
+
} & APIMetadata;
|
|
5166
|
+
type APIMetadata = {
|
|
5167
|
+
methodFqn?: string;
|
|
5168
|
+
entityFqdn?: string;
|
|
5169
|
+
packageName?: string;
|
|
5170
|
+
};
|
|
5171
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
5172
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
5173
|
+
__type: 'event-definition';
|
|
5174
|
+
type: Type;
|
|
5175
|
+
isDomainEvent?: boolean;
|
|
5176
|
+
transformations?: (envelope: unknown) => Payload;
|
|
5177
|
+
__payload: Payload;
|
|
5178
|
+
};
|
|
5179
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
5180
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
5181
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
5182
|
+
|
|
5183
|
+
declare global {
|
|
5184
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
5185
|
+
interface SymbolConstructor {
|
|
5186
|
+
readonly observable: symbol;
|
|
5187
|
+
}
|
|
5188
|
+
}
|
|
5189
|
+
|
|
4980
5190
|
interface Task {
|
|
4981
5191
|
/**
|
|
4982
5192
|
* Task ID.
|