@wix/crm 1.0.106 → 1.0.108

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.
@@ -0,0 +1,2547 @@
1
+ interface ContactAttachment extends ContactAttachmentMediaOneOf {
2
+ /** The attachment's image (if the attachment is of type IMAGE) */
3
+ image?: string;
4
+ /** The attachment's document (if the attachment is of type OTHER) */
5
+ document?: string;
6
+ /**
7
+ * The id of the attachment.
8
+ * @readonly
9
+ */
10
+ _id?: string;
11
+ /**
12
+ * Image preview (reduced image size) of the attachment (if the attachment is of type IMAGE).
13
+ * @readonly
14
+ */
15
+ previewImage?: string;
16
+ /**
17
+ * The file name of the attachment.
18
+ * @readonly
19
+ */
20
+ fileName?: string;
21
+ /**
22
+ * The mime type of the attachment.
23
+ * @readonly
24
+ */
25
+ mimeType?: string;
26
+ /**
27
+ * The type of the attachment
28
+ * @readonly
29
+ */
30
+ attachmentType?: AttachmentType;
31
+ }
32
+ /** @oneof */
33
+ interface ContactAttachmentMediaOneOf {
34
+ /** The attachment's image (if the attachment is of type IMAGE) */
35
+ image?: string;
36
+ /** The attachment's document (if the attachment is of type OTHER) */
37
+ document?: string;
38
+ }
39
+ declare enum AttachmentType {
40
+ UNKNOWN = "UNKNOWN",
41
+ IMAGE = "IMAGE",
42
+ OTHER = "OTHER"
43
+ }
44
+ interface GenerateAttachmentUploadUrlResponse {
45
+ /** The URL for uploading a file as an attachment to the contact. */
46
+ uploadUrl?: string;
47
+ }
48
+ interface Paging {
49
+ /** Number of items to return (default 100, max 100). */
50
+ limit?: number | null;
51
+ /** number of items to skip in the current sort order */
52
+ offset?: number | null;
53
+ }
54
+ interface ListAttachmentsResponse {
55
+ /** The requested attachments */
56
+ attachments?: ContactAttachment[];
57
+ /** Metadata for the page of results. */
58
+ metadata?: PagingMetadata;
59
+ }
60
+ interface PagingMetadata {
61
+ /** The number of items returned in this response */
62
+ count?: number | null;
63
+ /** The offset which was requested */
64
+ offset?: number | null;
65
+ /** The total number of items that match the query */
66
+ total?: number | null;
67
+ /** A flag that indicates the server failed to calculate 'total' field */
68
+ tooManyToCount?: boolean | null;
69
+ }
70
+ interface IdentificationData$4 extends IdentificationDataIdOneOf$4 {
71
+ /** ID of a site visitor that has not logged in to the site. */
72
+ anonymousVisitorId?: string;
73
+ /** ID of a site visitor that has logged in to the site. */
74
+ memberId?: string;
75
+ /** ID of a Wix user (site owner, contributor, etc.). */
76
+ wixUserId?: string;
77
+ /** ID of an app. */
78
+ appId?: string;
79
+ /** @readonly */
80
+ identityType?: WebhookIdentityType$4;
81
+ }
82
+ /** @oneof */
83
+ interface IdentificationDataIdOneOf$4 {
84
+ /** ID of a site visitor that has not logged in to the site. */
85
+ anonymousVisitorId?: string;
86
+ /** ID of a site visitor that has logged in to the site. */
87
+ memberId?: string;
88
+ /** ID of a Wix user (site owner, contributor, etc.). */
89
+ wixUserId?: string;
90
+ /** ID of an app. */
91
+ appId?: string;
92
+ }
93
+ declare enum WebhookIdentityType$4 {
94
+ UNKNOWN = "UNKNOWN",
95
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
96
+ MEMBER = "MEMBER",
97
+ WIX_USER = "WIX_USER",
98
+ APP = "APP"
99
+ }
100
+ interface GenerateAttachmentUploadUrlResponseNonNullableFields {
101
+ uploadUrl: string;
102
+ }
103
+ interface ListAttachmentsResponseNonNullableFields {
104
+ attachments: {
105
+ image: string;
106
+ document: string;
107
+ _id: string;
108
+ previewImage: string;
109
+ fileName: string;
110
+ mimeType: string;
111
+ attachmentType: AttachmentType;
112
+ }[];
113
+ }
114
+ interface BaseEventMetadata$4 {
115
+ /** App instance ID. */
116
+ instanceId?: string | null;
117
+ /** Event type. */
118
+ eventType?: string;
119
+ /** The identification type and identity data. */
120
+ identity?: IdentificationData$4;
121
+ }
122
+ interface EventMetadata$4 extends BaseEventMetadata$4 {
123
+ /**
124
+ * Unique event ID.
125
+ * Allows clients to ignore duplicate webhooks.
126
+ */
127
+ _id?: string;
128
+ /**
129
+ * Assumes actions are also always typed to an entity_type
130
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
131
+ */
132
+ entityFqdn?: string;
133
+ /**
134
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
135
+ * This is although the created/updated/deleted notion is duplication of the oneof types
136
+ * Example: created/updated/deleted/started/completed/email_opened
137
+ */
138
+ slug?: string;
139
+ /** ID of the entity associated with the event. */
140
+ entityId?: string;
141
+ /** Event timestamp. */
142
+ eventTime?: Date;
143
+ /**
144
+ * Whether the event was triggered as a result of a privacy regulation application
145
+ * (for example, GDPR).
146
+ */
147
+ triggeredByAnonymizeRequest?: boolean | null;
148
+ /** If present, indicates the action that triggered the event. */
149
+ originatedFrom?: string | null;
150
+ /**
151
+ * A sequence number defining the order of updates to the underlying entity.
152
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
153
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
154
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
155
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
156
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
157
+ */
158
+ entityEventSequence?: string | null;
159
+ }
160
+ interface AttachmentCreatedEnvelope {
161
+ entity: ContactAttachment;
162
+ metadata: EventMetadata$4;
163
+ }
164
+ interface AttachmentDeletedEnvelope {
165
+ metadata: EventMetadata$4;
166
+ }
167
+ interface GenerateAttachmentUploadUrlOptions {
168
+ /** Mime type e.g: `application/pdf` */
169
+ mimeType: string;
170
+ }
171
+ interface ListAttachmentsOptions {
172
+ /** Allow paginating, default: limit = 100 and offset = 0 */
173
+ paging?: Paging;
174
+ }
175
+ interface DeleteAttachmentIdentifiers {
176
+ /** Contact ID */
177
+ contactId: string;
178
+ /** Attachment ID. */
179
+ attachmentId: string;
180
+ }
181
+ interface GetAttachmentIdentifiers {
182
+ /** Contact ID */
183
+ contactId: string;
184
+ /** Attachment ID. */
185
+ attachmentId: string;
186
+ }
187
+
188
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
189
+ interface HttpClient {
190
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
191
+ }
192
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
193
+ type HttpResponse<T = any> = {
194
+ data: T;
195
+ status: number;
196
+ statusText: string;
197
+ headers: any;
198
+ request?: any;
199
+ };
200
+ type RequestOptions<_TResponse = any, Data = any> = {
201
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
202
+ url: string;
203
+ data?: Data;
204
+ params?: URLSearchParams;
205
+ } & APIMetadata;
206
+ type APIMetadata = {
207
+ methodFqn?: string;
208
+ entityFqdn?: string;
209
+ packageName?: string;
210
+ };
211
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
212
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
213
+ __type: 'event-definition';
214
+ type: Type;
215
+ isDomainEvent?: boolean;
216
+ transformations?: unknown;
217
+ __payload: Payload;
218
+ };
219
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
220
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
221
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
222
+
223
+ declare function generateAttachmentUploadUrl$1(httpClient: HttpClient): (contactId: string, fileName: string, options: GenerateAttachmentUploadUrlOptions) => Promise<GenerateAttachmentUploadUrlResponse & GenerateAttachmentUploadUrlResponseNonNullableFields>;
224
+ declare function listAttachments$1(httpClient: HttpClient): (contactId: string, options?: ListAttachmentsOptions) => Promise<ListAttachmentsResponse & ListAttachmentsResponseNonNullableFields>;
225
+ declare function deleteAttachment$1(httpClient: HttpClient): (identifiers: DeleteAttachmentIdentifiers) => Promise<void>;
226
+ declare function getAttachment$1(httpClient: HttpClient): (identifiers: GetAttachmentIdentifiers) => Promise<ContactAttachment & {
227
+ image: string;
228
+ document: string;
229
+ _id: string;
230
+ previewImage: string;
231
+ fileName: string;
232
+ mimeType: string;
233
+ attachmentType: AttachmentType;
234
+ }>;
235
+ declare const onAttachmentCreated$1: EventDefinition<AttachmentCreatedEnvelope, "wix.contacts.v4.attachment_created">;
236
+ declare const onAttachmentDeleted$1: EventDefinition<AttachmentDeletedEnvelope, "wix.contacts.v4.attachment_deleted">;
237
+
238
+ declare const generateAttachmentUploadUrl: BuildRESTFunction<typeof generateAttachmentUploadUrl$1>;
239
+ declare const listAttachments: BuildRESTFunction<typeof listAttachments$1>;
240
+ declare const deleteAttachment: BuildRESTFunction<typeof deleteAttachment$1>;
241
+ declare const getAttachment: BuildRESTFunction<typeof getAttachment$1>;
242
+ declare const onAttachmentCreated: BuildEventDefinition<typeof onAttachmentCreated$1>;
243
+ declare const onAttachmentDeleted: BuildEventDefinition<typeof onAttachmentDeleted$1>;
244
+
245
+ declare const context$5_deleteAttachment: typeof deleteAttachment;
246
+ declare const context$5_generateAttachmentUploadUrl: typeof generateAttachmentUploadUrl;
247
+ declare const context$5_getAttachment: typeof getAttachment;
248
+ declare const context$5_listAttachments: typeof listAttachments;
249
+ declare const context$5_onAttachmentCreated: typeof onAttachmentCreated;
250
+ declare const context$5_onAttachmentDeleted: typeof onAttachmentDeleted;
251
+ declare namespace context$5 {
252
+ export { 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 };
253
+ }
254
+
255
+ interface Contact {
256
+ /**
257
+ * Contact ID.
258
+ * @readonly
259
+ */
260
+ _id?: string;
261
+ /**
262
+ * Revision number, which increments by 1 each time the contact is updated.
263
+ * To prevent conflicting changes,
264
+ * the existing `revision` must be used when updating a contact.
265
+ * @readonly
266
+ */
267
+ revision?: number;
268
+ /**
269
+ * Details about the contact's source.
270
+ * @readonly
271
+ */
272
+ source?: ContactSource;
273
+ /**
274
+ * Date and time the contact was created.
275
+ * @readonly
276
+ */
277
+ _createdDate?: Date;
278
+ /**
279
+ * Date and time the contact was last updated.
280
+ * @readonly
281
+ */
282
+ _updatedDate?: Date;
283
+ /**
284
+ * Details about the contact's last action in the site.
285
+ * @readonly
286
+ */
287
+ lastActivity?: ContactActivity;
288
+ /**
289
+ * Contact's primary phone and email.
290
+ *
291
+ * This property reflects the email address in `contactInfo.emails` where `primary` is `true`.
292
+ * @readonly
293
+ */
294
+ primaryInfo?: PrimaryContactInfo;
295
+ /** Contact's details. */
296
+ info?: ContactInfo$2;
297
+ }
298
+ interface ContactSource {
299
+ /**
300
+ * Source type.
301
+ * @readonly
302
+ */
303
+ sourceType?: ContactSourceType;
304
+ /**
305
+ * App ID, if the contact was created by an app.
306
+ * @readonly
307
+ */
308
+ appId?: string | null;
309
+ }
310
+ declare enum ContactSourceType {
311
+ OTHER = "OTHER",
312
+ ADMIN = "ADMIN",
313
+ WIX_APP = "WIX_APP",
314
+ IMPORT = "IMPORT",
315
+ THIRD_PARTY = "THIRD_PARTY",
316
+ WIX_BOOKINGS = "WIX_BOOKINGS",
317
+ WIX_CHAT = "WIX_CHAT",
318
+ WIX_EMAIL_MARKETING = "WIX_EMAIL_MARKETING",
319
+ WIX_EVENTS = "WIX_EVENTS",
320
+ WIX_FORMS = "WIX_FORMS",
321
+ WIX_GROUPS = "WIX_GROUPS",
322
+ WIX_HOTELS = "WIX_HOTELS",
323
+ WIX_MARKET_PLACE = "WIX_MARKET_PLACE",
324
+ WIX_MUSIC = "WIX_MUSIC",
325
+ WIX_RESTAURANTS = "WIX_RESTAURANTS",
326
+ WIX_SITE_MEMBERS = "WIX_SITE_MEMBERS",
327
+ WIX_STORES = "WIX_STORES",
328
+ WIX_CODE = "WIX_CODE",
329
+ HOPP = "HOPP"
330
+ }
331
+ interface ContactActivity {
332
+ /** Date and time of the last action. */
333
+ activityDate?: Date;
334
+ /** */
335
+ activityType?: ContactActivityType;
336
+ }
337
+ declare enum ContactActivityType {
338
+ /** Last visit to your site (any unknown activity) */
339
+ GENERAL = "GENERAL",
340
+ /** This cannot be reported, used when contact created, will throw exception */
341
+ CONTACT_CREATED = "CONTACT_CREATED",
342
+ /** "auth/login" */
343
+ MEMBER_LOGIN = "MEMBER_LOGIN",
344
+ /** "auth/register" */
345
+ MEMBER_REGISTER = "MEMBER_REGISTER",
346
+ /** "auth/status-change" */
347
+ MEMBER_STATUS_CHANGED = "MEMBER_STATUS_CHANGED",
348
+ /** "contact/contact-form", (but also "form/contact-form", "form/form") */
349
+ FORM_SUBMITTED = "FORM_SUBMITTED",
350
+ /** "form/lead-capture-form" */
351
+ INBOX_FORM_SUBMITTED = "INBOX_FORM_SUBMITTED",
352
+ /** "chat/payment-request-paid" */
353
+ INBOX_PAYMENT_REQUEST_PAID = "INBOX_PAYMENT_REQUEST_PAID",
354
+ /** "messaging/email" - Direction BUSINESS_TO_CUSTOMER */
355
+ INBOX_MESSAGE_TO_CUSTOMER = "INBOX_MESSAGE_TO_CUSTOMER",
356
+ /** "messaging/email" - Direction CUSTOMER_TO_BUSINESS */
357
+ INBOX_MESSAGE_FROM_CUSTOMER = "INBOX_MESSAGE_FROM_CUSTOMER",
358
+ /** "contact/subscription-form" (but also "form/subscription-form") */
359
+ NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED = "NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED",
360
+ /** "contact/unsubscribe" */
361
+ NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE = "NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE",
362
+ /** "e_commerce/purchase" */
363
+ ECOM_PURCHASE = "ECOM_PURCHASE",
364
+ /** "e_commerce/cart-abandon" */
365
+ ECOM_CART_ABANDON = "ECOM_CART_ABANDON",
366
+ /** "e_commerce/checkout-buyer" */
367
+ ECOM_CHECKOUT_BUYER = "ECOM_CHECKOUT_BUYER",
368
+ /** "scheduler/appointment" */
369
+ BOOKINGS_APPOINTMENT = "BOOKINGS_APPOINTMENT",
370
+ /** "hotels/reservation" */
371
+ HOTELS_RESERVATION = "HOTELS_RESERVATION",
372
+ /** "hotels/purchase" */
373
+ HOTELS_PURCHASE = "HOTELS_PURCHASE",
374
+ /** "hotels/confirmation" */
375
+ HOTELS_CONFIRMATION = "HOTELS_CONFIRMATION",
376
+ /** "hotels/cancel" */
377
+ HOTELS_CANCEL = "HOTELS_CANCEL",
378
+ /** "video/purchase" */
379
+ VIDEO_PURCHASE = "VIDEO_PURCHASE",
380
+ /** "video/rent" */
381
+ VIDEO_RENT = "VIDEO_RENT",
382
+ /** "cashier/button_purchase" */
383
+ CASHIER_BUTTON_PURCHASE = "CASHIER_BUTTON_PURCHASE",
384
+ /** "arena/new-lead" */
385
+ ARENA_NEW_LEAD = "ARENA_NEW_LEAD",
386
+ /** "events/rsvp" */
387
+ EVENTS_RSVP = "EVENTS_RSVP",
388
+ /** "invoice/pay" */
389
+ INVOICE_PAY = "INVOICE_PAY",
390
+ /** "invoice/overdue" */
391
+ INVOICE_OVERDUE = "INVOICE_OVERDUE",
392
+ /** "price-quote/accept" */
393
+ PRICE_QUOTE_ACCEPT = "PRICE_QUOTE_ACCEPT",
394
+ /** "price-quote/expire" */
395
+ PRICE_QUOTE_EXPIRE = "PRICE_QUOTE_EXPIRE",
396
+ /** "restaurants/order" */
397
+ RESTAURANTS_ORDER = "RESTAURANTS_ORDER",
398
+ /** "restaurants/reservation" */
399
+ RESTAURANTS_RESERVATION = "RESTAURANTS_RESERVATION",
400
+ /** "shoutout/open" */
401
+ SHOUTOUT_OPEN = "SHOUTOUT_OPEN",
402
+ /** "shoutout/click" */
403
+ SHOUTOUT_CLICK = "SHOUTOUT_CLICK",
404
+ CONTACT_MERGED = "CONTACT_MERGED",
405
+ /** "contact/subscribe" */
406
+ NEWSLETTER_SUBSCRIPTION_SUBSCRIBE = "NEWSLETTER_SUBSCRIPTION_SUBSCRIBE",
407
+ /** "contact/subscription-pending" */
408
+ NEWSLETTER_SUBSCRIPTION_PENDING = "NEWSLETTER_SUBSCRIPTION_PENDING",
409
+ /** "contact/subscription-not-set" */
410
+ NEWSLETTER_SUBSCRIPTION_NOT_SET = "NEWSLETTER_SUBSCRIPTION_NOT_SET",
411
+ /** "contact/phone-subscription-subscribe" */
412
+ PHONE_SUBSCRIPTION_SUBSCRIBE = "PHONE_SUBSCRIPTION_SUBSCRIBE",
413
+ /** "contact/phone-subscription-pending" */
414
+ PHONE_SUBSCRIPTION_PENDING = "PHONE_SUBSCRIPTION_PENDING",
415
+ /** "contact/phone-subscription-not-set" */
416
+ PHONE_SUBSCRIPTION_NOT_SET = "PHONE_SUBSCRIPTION_NOT_SET",
417
+ /** "contact/phone-subscription-unsubscribe" */
418
+ PHONE_SUBSCRIPTION_UNSUBSCRIBE = "PHONE_SUBSCRIPTION_UNSUBSCRIBE"
419
+ }
420
+ interface PrimaryContactInfo {
421
+ /**
422
+ * Primary email address.
423
+ *
424
+ * This property reflects the email address in `info.emails`
425
+ * where `primary` is `true`.
426
+ * @readonly
427
+ */
428
+ email?: string | null;
429
+ /**
430
+ * Primary phone number.
431
+ *
432
+ * This property reflects the phone number in `contactInfo.phones` where `primary` is `true`.
433
+ * @readonly
434
+ */
435
+ phone?: string | null;
436
+ }
437
+ interface ContactInfo$2 {
438
+ /** Contact's first and last name. */
439
+ name?: ContactName$1;
440
+ /** Contact's email addresses. */
441
+ emails?: ContactEmailsWrapper$1;
442
+ /** Contact's phone numbers. */
443
+ phones?: ContactPhonesWrapper$1;
444
+ /** Contact's street addresses. */
445
+ addresses?: ContactAddressesWrapper$1;
446
+ /** Contact's company name. */
447
+ company?: string | null;
448
+ /**
449
+ * Contact's job title.
450
+ * Corresponds to the **Position** field in the Dashboard.
451
+ */
452
+ jobTitle?: string | null;
453
+ /** Birth date in `YYYY-MM-DD` format. For example, `2020-03-15`. */
454
+ birthdate?: string | null;
455
+ /**
456
+ * Locale in
457
+ * [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
458
+ * Typically, this is a lowercase 2-letter language code,
459
+ * followed by a hyphen, followed by an uppercase 2-letter country code.
460
+ * For example, `en-US` for U.S. English, and `de-DE` for Germany German.
461
+ */
462
+ locale?: string | null;
463
+ /**
464
+ * List of label keys applied to the contact.
465
+ *
466
+ * Label keys must exist to be added to the contact.
467
+ * Contact labels can be created with the
468
+ * `findOrCreateLabel()` function. You can use the
469
+ * `queryLabels()` function to view the currently existing labels.
470
+ *
471
+ */
472
+ labelKeys?: LabelsWrapper$1;
473
+ /**
474
+ * Additional custom fields.
475
+ * This includes fields managed by Wix, by 3rd-party apps, and by the site.
476
+ *
477
+ * Empty fields are not returned.
478
+ */
479
+ extendedFields?: ExtendedFieldsWrapper$1;
480
+ /** Contact's profile picture. */
481
+ picture?: ContactPicture$1;
482
+ }
483
+ interface ContactName$1 {
484
+ /** Contact's first name. */
485
+ first?: string | null;
486
+ /** Contact's last name. */
487
+ last?: string | null;
488
+ }
489
+ interface ContactEmailsWrapper$1 {
490
+ /** List of up to 50 email addresses. */
491
+ items?: ContactEmail$1[];
492
+ }
493
+ interface ContactEmail$1 {
494
+ /**
495
+ * Email ID.
496
+ * @readonly
497
+ */
498
+ _id?: string | null;
499
+ /**
500
+ * Email type.
501
+ *
502
+ * `"UNTAGGED"` is shown as "Other" in the Contact List.
503
+ */
504
+ tag?: EmailTag$1;
505
+ /** Email address. */
506
+ email?: string;
507
+ /**
508
+ * Indicates whether this is the contact's primary email address.
509
+ * When changing `primary` to `true` for an email,
510
+ * the contact's other emails become `false`.
511
+ * It also affects the subscription status to marketing emails that are decided based on the primary email.
512
+ */
513
+ primary?: boolean | null;
514
+ }
515
+ declare enum EmailTag$1 {
516
+ UNTAGGED = "UNTAGGED",
517
+ MAIN = "MAIN",
518
+ HOME = "HOME",
519
+ WORK = "WORK"
520
+ }
521
+ interface ContactPhonesWrapper$1 {
522
+ /** List of up to 50 phone numbers. */
523
+ items?: ContactPhone$1[];
524
+ }
525
+ interface ContactPhone$1 {
526
+ /**
527
+ * Phone ID.
528
+ * @readonly
529
+ */
530
+ _id?: string | null;
531
+ /**
532
+ * Phone type.
533
+ *
534
+ * `"UNTAGGED"` is shown as "Other" in the Contact List.
535
+ */
536
+ tag?: PhoneTag$1;
537
+ /** [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. */
538
+ countryCode?: string | null;
539
+ /** Phone number. */
540
+ phone?: string;
541
+ /**
542
+ * [ITU E.164-formatted](https://www.itu.int/rec/T-REC-E.164/)
543
+ * phone number.
544
+ * Automatically generated using `phone` and `countryCode`, pending both values are valid.
545
+ * @readonly
546
+ */
547
+ e164Phone?: string | null;
548
+ /**
549
+ * Whether this is the contact's primary phone number.
550
+ * When changing `primary` to `true` for a phone,
551
+ * the contact's `primary` field for other phones becomes `false`.
552
+ * It also affects the subscription status to SMS messages that are decided based on the primary phone.
553
+ */
554
+ primary?: boolean | null;
555
+ }
556
+ declare enum PhoneTag$1 {
557
+ UNTAGGED = "UNTAGGED",
558
+ MAIN = "MAIN",
559
+ HOME = "HOME",
560
+ MOBILE = "MOBILE",
561
+ WORK = "WORK",
562
+ FAX = "FAX"
563
+ }
564
+ interface ContactAddressesWrapper$1 {
565
+ /** List of up to 50 addresses. */
566
+ items?: ContactAddress$1[];
567
+ }
568
+ interface ContactAddress$1 {
569
+ /**
570
+ * Street address ID.
571
+ * @readonly
572
+ */
573
+ _id?: string | null;
574
+ /**
575
+ * Address type.
576
+ *
577
+ * `"UNTAGGED"` is shown as "Other" in the Contact List.
578
+ *
579
+ *
580
+ */
581
+ tag?: AddressTag$1;
582
+ /** Street address. */
583
+ address?: Address$1;
584
+ }
585
+ declare enum AddressTag$1 {
586
+ UNTAGGED = "UNTAGGED",
587
+ HOME = "HOME",
588
+ WORK = "WORK",
589
+ BILLING = "BILLING",
590
+ SHIPPING = "SHIPPING"
591
+ }
592
+ /** Physical address */
593
+ interface Address$1 extends AddressStreetOneOf$1 {
594
+ /** Street address object, with number and name in separate fields. */
595
+ streetAddress?: StreetAddress$1;
596
+ /** Main address line, usually street and number, as free text. */
597
+ addressLine1?: string | null;
598
+ /**
599
+ * 2-letter country code in an
600
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
601
+ */
602
+ country?: string | null;
603
+ /**
604
+ * Code for a subdivision (such as state, prefecture, or province) in an
605
+ * [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.
606
+ */
607
+ subdivision?: string | null;
608
+ /** City name. */
609
+ city?: string | null;
610
+ /** Postal or zip code. */
611
+ postalCode?: string | null;
612
+ /**
613
+ * Free text providing more detailed address information,
614
+ * such as apartment, suite, or floor.
615
+ */
616
+ addressLine2?: string | null;
617
+ }
618
+ /** @oneof */
619
+ interface AddressStreetOneOf$1 {
620
+ /** Street address object, with number and name in separate fields. */
621
+ streetAddress?: StreetAddress$1;
622
+ /** Main address line, usually street and number, as free text. */
623
+ addressLine?: string | null;
624
+ }
625
+ interface StreetAddress$1 {
626
+ /** Street number. */
627
+ number?: string;
628
+ /** Street name. */
629
+ name?: string;
630
+ }
631
+ interface LabelsWrapper$1 {
632
+ /**
633
+ * List of contact label keys.
634
+ * [Contact labels](https://support.wix.com/en/article/adding-labels-to-contacts-in-your-contact-list)
635
+ * help categorize contacts.
636
+ *
637
+ * Label keys must exist to be added to the contact.
638
+ * Contact labels can be created or retrieved with
639
+ * [Find or Create Label](https://dev.wix.com/api/rest/contacts/labels/find-or-create-label)
640
+ * or
641
+ * [List Labels](https://dev.wix.com/api/rest/contacts/labels/list-labels)
642
+ */
643
+ items?: string[];
644
+ }
645
+ interface ExtendedFieldsWrapper$1 {
646
+ /**
647
+ * Set of key-value pairs.
648
+ *
649
+ * Contact's extended fields which allow you to store additional information about your contacts.
650
+ *
651
+ * To view or create extended fields, use
652
+ * `findOrCreateExtendedField()`,
653
+ * `getExtendedField()`, or
654
+ * `queryExtendedFields()` in the Extended Fields API.
655
+ */
656
+ items?: Record<string, any>;
657
+ }
658
+ /** TEST contact picture description */
659
+ interface ContactPicture$1 {
660
+ /**
661
+ * Image.
662
+ * This can contain an image URL or a Wix Media image ID.
663
+ */
664
+ image?: string;
665
+ }
666
+ /** Contact. */
667
+ interface CreateContactResponse {
668
+ /** Contact. */
669
+ contact?: Contact;
670
+ }
671
+ /** Updated contact. */
672
+ interface UpdateContactResponse {
673
+ /** Updated contact. */
674
+ contact?: Contact;
675
+ }
676
+ interface MergeContactsResponse {
677
+ /** Updated target contact. */
678
+ contact?: Contact;
679
+ }
680
+ interface ContactMerged {
681
+ /** ID of the contact the source contacts were merged into. */
682
+ targetContactId?: string;
683
+ /** IDs of contacts that were merged into the target contact. */
684
+ sourceContactIds?: string[];
685
+ /** Updated target contact. */
686
+ targetContact?: Contact;
687
+ }
688
+ /** Updated contact. */
689
+ interface LabelContactResponse {
690
+ /** Updated contact. */
691
+ contact?: Contact;
692
+ }
693
+ /** Updated contact. */
694
+ interface UnlabelContactResponse {
695
+ /** Updated contact. */
696
+ contact?: Contact;
697
+ }
698
+ declare enum ContactFieldSet {
699
+ /** name, primaryEmail, primaryPhone */
700
+ BASIC = "BASIC",
701
+ /** name, phones, emails, addresses */
702
+ COMMUNICATION_DETAILS = "COMMUNICATION_DETAILS",
703
+ /** name, primaryInfo(email, phone), extendedFields */
704
+ EXTENDED = "EXTENDED",
705
+ /** Full contact object */
706
+ FULL = "FULL"
707
+ }
708
+ interface IdentificationData$3 extends IdentificationDataIdOneOf$3 {
709
+ /** ID of a site visitor that has not logged in to the site. */
710
+ anonymousVisitorId?: string;
711
+ /** ID of a site visitor that has logged in to the site. */
712
+ memberId?: string;
713
+ /** ID of a Wix user (site owner, contributor, etc.). */
714
+ wixUserId?: string;
715
+ /** ID of an app. */
716
+ appId?: string;
717
+ /** @readonly */
718
+ identityType?: WebhookIdentityType$3;
719
+ }
720
+ /** @oneof */
721
+ interface IdentificationDataIdOneOf$3 {
722
+ /** ID of a site visitor that has not logged in to the site. */
723
+ anonymousVisitorId?: string;
724
+ /** ID of a site visitor that has logged in to the site. */
725
+ memberId?: string;
726
+ /** ID of a Wix user (site owner, contributor, etc.). */
727
+ wixUserId?: string;
728
+ /** ID of an app. */
729
+ appId?: string;
730
+ }
731
+ declare enum WebhookIdentityType$3 {
732
+ UNKNOWN = "UNKNOWN",
733
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
734
+ MEMBER = "MEMBER",
735
+ WIX_USER = "WIX_USER",
736
+ APP = "APP"
737
+ }
738
+ interface CreateContactResponseNonNullableFields {
739
+ contact?: {
740
+ _id: string;
741
+ revision: number;
742
+ source?: {
743
+ sourceType: ContactSourceType;
744
+ };
745
+ lastActivity?: {
746
+ activityType: ContactActivityType;
747
+ };
748
+ info?: {
749
+ emails?: {
750
+ items: {
751
+ tag: EmailTag$1;
752
+ email: string;
753
+ }[];
754
+ };
755
+ phones?: {
756
+ items: {
757
+ tag: PhoneTag$1;
758
+ phone: string;
759
+ }[];
760
+ };
761
+ addresses?: {
762
+ items: {
763
+ tag: AddressTag$1;
764
+ }[];
765
+ };
766
+ labelKeys?: {
767
+ items: string[];
768
+ };
769
+ picture?: {
770
+ image: string;
771
+ };
772
+ };
773
+ };
774
+ }
775
+ interface UpdateContactResponseNonNullableFields {
776
+ contact?: {
777
+ _id: string;
778
+ revision: number;
779
+ source?: {
780
+ sourceType: ContactSourceType;
781
+ };
782
+ lastActivity?: {
783
+ activityType: ContactActivityType;
784
+ };
785
+ info?: {
786
+ emails?: {
787
+ items: {
788
+ tag: EmailTag$1;
789
+ email: string;
790
+ }[];
791
+ };
792
+ phones?: {
793
+ items: {
794
+ tag: PhoneTag$1;
795
+ phone: string;
796
+ }[];
797
+ };
798
+ addresses?: {
799
+ items: {
800
+ tag: AddressTag$1;
801
+ }[];
802
+ };
803
+ labelKeys?: {
804
+ items: string[];
805
+ };
806
+ picture?: {
807
+ image: string;
808
+ };
809
+ };
810
+ };
811
+ }
812
+ interface MergeContactsResponseNonNullableFields {
813
+ contact?: {
814
+ _id: string;
815
+ revision: number;
816
+ source?: {
817
+ sourceType: ContactSourceType;
818
+ };
819
+ lastActivity?: {
820
+ activityType: ContactActivityType;
821
+ };
822
+ info?: {
823
+ emails?: {
824
+ items: {
825
+ tag: EmailTag$1;
826
+ email: string;
827
+ }[];
828
+ };
829
+ phones?: {
830
+ items: {
831
+ tag: PhoneTag$1;
832
+ phone: string;
833
+ }[];
834
+ };
835
+ addresses?: {
836
+ items: {
837
+ tag: AddressTag$1;
838
+ }[];
839
+ };
840
+ labelKeys?: {
841
+ items: string[];
842
+ };
843
+ picture?: {
844
+ image: string;
845
+ };
846
+ };
847
+ };
848
+ }
849
+ interface LabelContactResponseNonNullableFields {
850
+ contact?: {
851
+ _id: string;
852
+ revision: number;
853
+ source?: {
854
+ sourceType: ContactSourceType;
855
+ };
856
+ lastActivity?: {
857
+ activityType: ContactActivityType;
858
+ };
859
+ info?: {
860
+ emails?: {
861
+ items: {
862
+ tag: EmailTag$1;
863
+ email: string;
864
+ }[];
865
+ };
866
+ phones?: {
867
+ items: {
868
+ tag: PhoneTag$1;
869
+ phone: string;
870
+ }[];
871
+ };
872
+ addresses?: {
873
+ items: {
874
+ tag: AddressTag$1;
875
+ }[];
876
+ };
877
+ labelKeys?: {
878
+ items: string[];
879
+ };
880
+ picture?: {
881
+ image: string;
882
+ };
883
+ };
884
+ };
885
+ }
886
+ interface UnlabelContactResponseNonNullableFields {
887
+ contact?: {
888
+ _id: string;
889
+ revision: number;
890
+ source?: {
891
+ sourceType: ContactSourceType;
892
+ };
893
+ lastActivity?: {
894
+ activityType: ContactActivityType;
895
+ };
896
+ info?: {
897
+ emails?: {
898
+ items: {
899
+ tag: EmailTag$1;
900
+ email: string;
901
+ }[];
902
+ };
903
+ phones?: {
904
+ items: {
905
+ tag: PhoneTag$1;
906
+ phone: string;
907
+ }[];
908
+ };
909
+ addresses?: {
910
+ items: {
911
+ tag: AddressTag$1;
912
+ }[];
913
+ };
914
+ labelKeys?: {
915
+ items: string[];
916
+ };
917
+ picture?: {
918
+ image: string;
919
+ };
920
+ };
921
+ };
922
+ }
923
+ interface BaseEventMetadata$3 {
924
+ /** App instance ID. */
925
+ instanceId?: string | null;
926
+ /** Event type. */
927
+ eventType?: string;
928
+ /** The identification type and identity data. */
929
+ identity?: IdentificationData$3;
930
+ }
931
+ interface EventMetadata$3 extends BaseEventMetadata$3 {
932
+ /**
933
+ * Unique event ID.
934
+ * Allows clients to ignore duplicate webhooks.
935
+ */
936
+ _id?: string;
937
+ /**
938
+ * Assumes actions are also always typed to an entity_type
939
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
940
+ */
941
+ entityFqdn?: string;
942
+ /**
943
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
944
+ * This is although the created/updated/deleted notion is duplication of the oneof types
945
+ * Example: created/updated/deleted/started/completed/email_opened
946
+ */
947
+ slug?: string;
948
+ /** ID of the entity associated with the event. */
949
+ entityId?: string;
950
+ /** Event timestamp. */
951
+ eventTime?: Date;
952
+ /**
953
+ * Whether the event was triggered as a result of a privacy regulation application
954
+ * (for example, GDPR).
955
+ */
956
+ triggeredByAnonymizeRequest?: boolean | null;
957
+ /** If present, indicates the action that triggered the event. */
958
+ originatedFrom?: string | null;
959
+ /**
960
+ * A sequence number defining the order of updates to the underlying entity.
961
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
962
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
963
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
964
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
965
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
966
+ */
967
+ entityEventSequence?: string | null;
968
+ }
969
+ interface ContactCreatedEnvelope {
970
+ entity: Contact;
971
+ metadata: EventMetadata$3;
972
+ }
973
+ interface ContactUpdatedEnvelope {
974
+ entity: Contact;
975
+ metadata: EventMetadata$3;
976
+ }
977
+ interface ContactMergedEnvelope {
978
+ data: ContactMerged;
979
+ metadata: EventMetadata$3;
980
+ }
981
+ interface ContactDeletedEnvelope {
982
+ metadata: EventMetadata$3;
983
+ }
984
+ interface CreateContactOptions {
985
+ /**
986
+ * Controls whether the call will succeed
987
+ * if the new contact information contains an email or a phone number already used by another contact.
988
+ *
989
+ * If set to `true`,
990
+ * the call will succeed even if an email address or phone number is used by another contact.
991
+ * If set to `false`,
992
+ * the call will fail if the given email address is used by another contact or,
993
+ * if the email address is not given and the given phone number is used by another contact.
994
+ *
995
+ * Default: `false`
996
+ */
997
+ allowDuplicates?: boolean;
998
+ }
999
+ interface UpdateContactOptions {
1000
+ /**
1001
+ * Controls whether the call will succeed if the new contact information contains an email already used by another contact.
1002
+ *
1003
+ * If set to `true`, the call will succeed even if an email address is used by another contact. If set to `false`, the call will fail if an email address is used by another contact.
1004
+ *
1005
+ * Defaults to `false`.
1006
+ */
1007
+ allowDuplicates?: boolean;
1008
+ }
1009
+ interface MergeContactsOptions {
1010
+ /**
1011
+ * IDs of up to 5 contacts to merge into the target contact.
1012
+ * If merging more than one source contact,
1013
+ * the first source is given precedence, then the second, and so on.
1014
+ */
1015
+ sourceContactIds?: string[];
1016
+ }
1017
+ interface QueryContactsOptions {
1018
+ /** @internal */
1019
+ search?: string | null | undefined;
1020
+ }
1021
+ interface QueryOffsetResult$2 {
1022
+ currentPage: number | undefined;
1023
+ totalPages: number | undefined;
1024
+ totalCount: number | undefined;
1025
+ hasNext: () => boolean;
1026
+ hasPrev: () => boolean;
1027
+ length: number;
1028
+ pageSize: number;
1029
+ }
1030
+ interface ContactsQueryResult extends QueryOffsetResult$2 {
1031
+ items: Contact[];
1032
+ query: ContactsQueryBuilder;
1033
+ next: () => Promise<ContactsQueryResult>;
1034
+ prev: () => Promise<ContactsQueryResult>;
1035
+ }
1036
+ interface ContactsQueryBuilder {
1037
+ /** @param propertyName - Property whose value is compared with `value`.
1038
+ * @param value - Value to compare against.
1039
+ * @documentationMaturity preview
1040
+ */
1041
+ eq: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'lastActivity.activityDate' | 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.birthdate' | 'info.locale', value: any) => ContactsQueryBuilder;
1042
+ /** @param propertyName - Property whose value is compared with `value`.
1043
+ * @param value - Value to compare against.
1044
+ * @documentationMaturity preview
1045
+ */
1046
+ ne: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'lastActivity.activityDate' | 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.birthdate' | 'info.locale', value: any) => ContactsQueryBuilder;
1047
+ /** @param propertyName - Property whose value is compared with `value`.
1048
+ * @param value - Value to compare against.
1049
+ * @documentationMaturity preview
1050
+ */
1051
+ ge: (propertyName: '_createdDate' | '_updatedDate' | 'lastActivity.activityDate', value: any) => ContactsQueryBuilder;
1052
+ /** @param propertyName - Property whose value is compared with `value`.
1053
+ * @param value - Value to compare against.
1054
+ * @documentationMaturity preview
1055
+ */
1056
+ gt: (propertyName: '_createdDate' | '_updatedDate' | 'lastActivity.activityDate', value: any) => ContactsQueryBuilder;
1057
+ /** @param propertyName - Property whose value is compared with `value`.
1058
+ * @param value - Value to compare against.
1059
+ * @documentationMaturity preview
1060
+ */
1061
+ le: (propertyName: '_createdDate' | '_updatedDate' | 'lastActivity.activityDate', value: any) => ContactsQueryBuilder;
1062
+ /** @param propertyName - Property whose value is compared with `value`.
1063
+ * @param value - Value to compare against.
1064
+ * @documentationMaturity preview
1065
+ */
1066
+ lt: (propertyName: '_createdDate' | '_updatedDate' | 'lastActivity.activityDate', value: any) => ContactsQueryBuilder;
1067
+ /** @param propertyName - Property whose value is compared with `string`.
1068
+ * @param string - String to compare against. Case-insensitive.
1069
+ * @documentationMaturity preview
1070
+ */
1071
+ startsWith: (propertyName: 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle', value: string) => ContactsQueryBuilder;
1072
+ /** @documentationMaturity preview */
1073
+ in: (propertyName: '_id' | 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.locale', value: any) => ContactsQueryBuilder;
1074
+ /** @documentationMaturity preview */
1075
+ exists: (propertyName: '_id' | 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.locale', value: boolean) => ContactsQueryBuilder;
1076
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1077
+ * @documentationMaturity preview
1078
+ */
1079
+ ascending: (...propertyNames: Array<'_createdDate' | 'lastActivity.activityDate' | 'primaryInfo.email' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.birthdate'>) => ContactsQueryBuilder;
1080
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1081
+ * @documentationMaturity preview
1082
+ */
1083
+ descending: (...propertyNames: Array<'_createdDate' | 'lastActivity.activityDate' | 'primaryInfo.email' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.birthdate'>) => ContactsQueryBuilder;
1084
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
1085
+ * @documentationMaturity preview
1086
+ */
1087
+ limit: (limit: number) => ContactsQueryBuilder;
1088
+ /** @param skip - Number of items to skip in the query results before returning the results.
1089
+ * @documentationMaturity preview
1090
+ */
1091
+ skip: (skip: number) => ContactsQueryBuilder;
1092
+ /** @documentationMaturity preview */
1093
+ find: () => Promise<ContactsQueryResult>;
1094
+ }
1095
+ interface GetContactOptions {
1096
+ /**
1097
+ * List of projected fields to return.
1098
+ * If both `fields` and `fieldsets` are sent in the request,
1099
+ * the union of both lists is returned.
1100
+ * `id` and `revision` are always returned.
1101
+ *
1102
+ * Supported properties:
1103
+ * `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
1104
+ * `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
1105
+ * `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
1106
+ * `info.labelKeys`, `info.locations`, `info.extendedFields`
1107
+ */
1108
+ fields?: string[];
1109
+ /**
1110
+ * Predefined sets of fields to return.
1111
+ * If both `fields` and `fieldsets` are sent in the request,
1112
+ * the union of both lists is returned.
1113
+ *
1114
+ * - `BASIC`: Returns `id`, `revision`, `primaryInfo`, `info.name`.
1115
+ * - `COMMUNICATION_DETAILS`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.emails`, `info.phones`, `info.addresses`.
1116
+ * - `EXTENDED`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.extendedFields`.
1117
+ * - `FULL`: Returns all fields.
1118
+ *
1119
+ * Default: If `fields` is omitted from the request, `FULL`.
1120
+ */
1121
+ fieldsets?: ContactFieldSet[];
1122
+ }
1123
+
1124
+ declare function createContact$1(httpClient: HttpClient): (info: ContactInfo$2, options?: CreateContactOptions) => Promise<CreateContactResponse & CreateContactResponseNonNullableFields>;
1125
+ declare function updateContact$1(httpClient: HttpClient): (contactId: string, info: ContactInfo$2, revision: number | null, options?: UpdateContactOptions) => Promise<UpdateContactResponse & UpdateContactResponseNonNullableFields>;
1126
+ declare function mergeContacts$1(httpClient: HttpClient): (targetContactId: string, targetContactRevision: number | null, options?: MergeContactsOptions) => Promise<MergeContactsResponse & MergeContactsResponseNonNullableFields>;
1127
+ declare function deleteContact$1(httpClient: HttpClient): (contactId: string) => Promise<void>;
1128
+ declare function labelContact$1(httpClient: HttpClient): (contactId: string, labelKeys: string[]) => Promise<LabelContactResponse & LabelContactResponseNonNullableFields>;
1129
+ declare function unlabelContact$1(httpClient: HttpClient): (contactId: string, labelKeys: string[]) => Promise<UnlabelContactResponse & UnlabelContactResponseNonNullableFields>;
1130
+ declare function queryContacts$1(httpClient: HttpClient): (options?: QueryContactsOptions) => ContactsQueryBuilder;
1131
+ declare function getContact$1(httpClient: HttpClient): (_id: string, options?: GetContactOptions) => Promise<Contact & {
1132
+ _id: string;
1133
+ revision: number;
1134
+ source?: {
1135
+ sourceType: ContactSourceType;
1136
+ } | undefined;
1137
+ lastActivity?: {
1138
+ activityType: ContactActivityType;
1139
+ } | undefined;
1140
+ info?: {
1141
+ emails?: {
1142
+ items: {
1143
+ tag: EmailTag$1;
1144
+ email: string;
1145
+ }[];
1146
+ } | undefined;
1147
+ phones?: {
1148
+ items: {
1149
+ tag: PhoneTag$1;
1150
+ phone: string;
1151
+ }[];
1152
+ } | undefined;
1153
+ addresses?: {
1154
+ items: {
1155
+ tag: AddressTag$1;
1156
+ }[];
1157
+ } | undefined;
1158
+ labelKeys?: {
1159
+ items: string[];
1160
+ } | undefined;
1161
+ picture?: {
1162
+ image: string;
1163
+ } | undefined;
1164
+ } | undefined;
1165
+ }>;
1166
+ declare const onContactCreated$1: EventDefinition<ContactCreatedEnvelope, "wix.contacts.v4.contact_created">;
1167
+ declare const onContactUpdated$1: EventDefinition<ContactUpdatedEnvelope, "wix.contacts.v4.contact_updated">;
1168
+ declare const onContactMerged$1: EventDefinition<ContactMergedEnvelope, "wix.contacts.v4.contact_merged">;
1169
+ declare const onContactDeleted$1: EventDefinition<ContactDeletedEnvelope, "wix.contacts.v4.contact_deleted">;
1170
+
1171
+ declare const createContact: BuildRESTFunction<typeof createContact$1>;
1172
+ declare const updateContact: BuildRESTFunction<typeof updateContact$1>;
1173
+ declare const mergeContacts: BuildRESTFunction<typeof mergeContacts$1>;
1174
+ declare const deleteContact: BuildRESTFunction<typeof deleteContact$1>;
1175
+ declare const labelContact: BuildRESTFunction<typeof labelContact$1>;
1176
+ declare const unlabelContact: BuildRESTFunction<typeof unlabelContact$1>;
1177
+ declare const queryContacts: BuildRESTFunction<typeof queryContacts$1>;
1178
+ declare const getContact: BuildRESTFunction<typeof getContact$1>;
1179
+ declare const onContactCreated: BuildEventDefinition<typeof onContactCreated$1>;
1180
+ declare const onContactUpdated: BuildEventDefinition<typeof onContactUpdated$1>;
1181
+ declare const onContactMerged: BuildEventDefinition<typeof onContactMerged$1>;
1182
+ declare const onContactDeleted: BuildEventDefinition<typeof onContactDeleted$1>;
1183
+
1184
+ declare const context$4_createContact: typeof createContact;
1185
+ declare const context$4_deleteContact: typeof deleteContact;
1186
+ declare const context$4_getContact: typeof getContact;
1187
+ declare const context$4_labelContact: typeof labelContact;
1188
+ declare const context$4_mergeContacts: typeof mergeContacts;
1189
+ declare const context$4_onContactCreated: typeof onContactCreated;
1190
+ declare const context$4_onContactDeleted: typeof onContactDeleted;
1191
+ declare const context$4_onContactMerged: typeof onContactMerged;
1192
+ declare const context$4_onContactUpdated: typeof onContactUpdated;
1193
+ declare const context$4_queryContacts: typeof queryContacts;
1194
+ declare const context$4_unlabelContact: typeof unlabelContact;
1195
+ declare const context$4_updateContact: typeof updateContact;
1196
+ declare namespace context$4 {
1197
+ export { 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, context$4_queryContacts as queryContacts, context$4_unlabelContact as unlabelContact, context$4_updateContact as updateContact };
1198
+ }
1199
+
1200
+ /** Extended field that was found or created. */
1201
+ interface ExtendedField {
1202
+ /**
1203
+ * Extended field namespace.
1204
+ *
1205
+ * Extended fields created by site collaborators or 3rd-party apps
1206
+ * are automatically assigned to the `custom` namespace.
1207
+ * @readonly
1208
+ */
1209
+ namespace?: string | null;
1210
+ /**
1211
+ * Extended field key.
1212
+ *
1213
+ * When accessing contact data,
1214
+ * extended field data is available at `fields[key]`.
1215
+ * For example, if the key is "custom.notes",
1216
+ * the value can be accessed at `fields["custom.notes"]`.
1217
+ *
1218
+ * `key` is generated when the extended field is created
1219
+ * and cannot be modified, even if `displayName` changes.
1220
+ * @readonly
1221
+ */
1222
+ key?: string;
1223
+ /** Display name shown in the Contact List. */
1224
+ displayName?: string;
1225
+ /**
1226
+ * Type of data the field holds.
1227
+ *
1228
+ * One of:
1229
+ * - `"TEXT"`: Accepts strings.
1230
+ * - `"NUMBER"`: Accepts floats.
1231
+ * - `"DATE"`: Accepts dates formatted as `YYYY-MM-DD`.
1232
+ * - `"URL"`: Accepts strings. Prepends `https://` if no protocol is included.
1233
+ * @readonly
1234
+ */
1235
+ dataType?: FieldDataType;
1236
+ /**
1237
+ * Indicates whether the extended field is a system field or custom field.
1238
+ *
1239
+ * One of:
1240
+ * - `"SYSTEM"`: System field managed by Wix. System fields cannot be modified by 3rd-party apps or site contributors.
1241
+ * - `"USER_DEFINED"`: Custom field that can be modified by 3rd-party apps or site admins.
1242
+ * @readonly
1243
+ */
1244
+ fieldType?: FieldType;
1245
+ /**
1246
+ * Date and time the field was created.
1247
+ * @readonly
1248
+ */
1249
+ _createdDate?: Date;
1250
+ /**
1251
+ * Date and time the field was last updated.
1252
+ * @readonly
1253
+ */
1254
+ _updatedDate?: Date;
1255
+ /**
1256
+ * Field description, if the field is a system field.
1257
+ * @readonly
1258
+ */
1259
+ description?: string | null;
1260
+ }
1261
+ declare enum FieldDataType {
1262
+ UNKNOWN_DATA_TYPE = "UNKNOWN_DATA_TYPE",
1263
+ TEXT = "TEXT",
1264
+ NUMBER = "NUMBER",
1265
+ DATE = "DATE",
1266
+ URL = "URL"
1267
+ }
1268
+ declare enum FieldType {
1269
+ UNKNOWN = "UNKNOWN",
1270
+ SYSTEM = "SYSTEM",
1271
+ USER_DEFINED = "USER_DEFINED"
1272
+ }
1273
+ /** Extended field that was found or created. */
1274
+ interface FindOrCreateExtendedFieldResponse {
1275
+ /** Extended field that was found or created. */
1276
+ field?: ExtendedField;
1277
+ /**
1278
+ * Indicates whether the extended field was just created or already existed.
1279
+ *
1280
+ * If the field was just created, returns `true`.
1281
+ * If the field already existed, returns `false`.
1282
+ */
1283
+ newField?: boolean;
1284
+ }
1285
+ interface IdentificationData$2 extends IdentificationDataIdOneOf$2 {
1286
+ /** ID of a site visitor that has not logged in to the site. */
1287
+ anonymousVisitorId?: string;
1288
+ /** ID of a site visitor that has logged in to the site. */
1289
+ memberId?: string;
1290
+ /** ID of a Wix user (site owner, contributor, etc.). */
1291
+ wixUserId?: string;
1292
+ /** ID of an app. */
1293
+ appId?: string;
1294
+ /** @readonly */
1295
+ identityType?: WebhookIdentityType$2;
1296
+ }
1297
+ /** @oneof */
1298
+ interface IdentificationDataIdOneOf$2 {
1299
+ /** ID of a site visitor that has not logged in to the site. */
1300
+ anonymousVisitorId?: string;
1301
+ /** ID of a site visitor that has logged in to the site. */
1302
+ memberId?: string;
1303
+ /** ID of a Wix user (site owner, contributor, etc.). */
1304
+ wixUserId?: string;
1305
+ /** ID of an app. */
1306
+ appId?: string;
1307
+ }
1308
+ declare enum WebhookIdentityType$2 {
1309
+ UNKNOWN = "UNKNOWN",
1310
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1311
+ MEMBER = "MEMBER",
1312
+ WIX_USER = "WIX_USER",
1313
+ APP = "APP"
1314
+ }
1315
+ interface FindOrCreateExtendedFieldResponseNonNullableFields {
1316
+ field?: {
1317
+ key: string;
1318
+ displayName: string;
1319
+ dataType: FieldDataType;
1320
+ fieldType: FieldType;
1321
+ };
1322
+ newField: boolean;
1323
+ }
1324
+ interface BaseEventMetadata$2 {
1325
+ /** App instance ID. */
1326
+ instanceId?: string | null;
1327
+ /** Event type. */
1328
+ eventType?: string;
1329
+ /** The identification type and identity data. */
1330
+ identity?: IdentificationData$2;
1331
+ }
1332
+ interface EventMetadata$2 extends BaseEventMetadata$2 {
1333
+ /**
1334
+ * Unique event ID.
1335
+ * Allows clients to ignore duplicate webhooks.
1336
+ */
1337
+ _id?: string;
1338
+ /**
1339
+ * Assumes actions are also always typed to an entity_type
1340
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
1341
+ */
1342
+ entityFqdn?: string;
1343
+ /**
1344
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
1345
+ * This is although the created/updated/deleted notion is duplication of the oneof types
1346
+ * Example: created/updated/deleted/started/completed/email_opened
1347
+ */
1348
+ slug?: string;
1349
+ /** ID of the entity associated with the event. */
1350
+ entityId?: string;
1351
+ /** Event timestamp. */
1352
+ eventTime?: Date;
1353
+ /**
1354
+ * Whether the event was triggered as a result of a privacy regulation application
1355
+ * (for example, GDPR).
1356
+ */
1357
+ triggeredByAnonymizeRequest?: boolean | null;
1358
+ /** If present, indicates the action that triggered the event. */
1359
+ originatedFrom?: string | null;
1360
+ /**
1361
+ * A sequence number defining the order of updates to the underlying entity.
1362
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
1363
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1364
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1365
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
1366
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1367
+ */
1368
+ entityEventSequence?: string | null;
1369
+ }
1370
+ interface ExtendedFieldCreatedEnvelope {
1371
+ entity: ExtendedField;
1372
+ metadata: EventMetadata$2;
1373
+ }
1374
+ interface ExtendedFieldUpdatedEnvelope {
1375
+ entity: ExtendedField;
1376
+ metadata: EventMetadata$2;
1377
+ }
1378
+ interface ExtendedFieldDeletedEnvelope {
1379
+ metadata: EventMetadata$2;
1380
+ }
1381
+ interface RenameExtendedField {
1382
+ /**
1383
+ * Extended field namespace.
1384
+ *
1385
+ * Extended fields created by site collaborators or 3rd-party apps
1386
+ * are automatically assigned to the `custom` namespace.
1387
+ * @readonly
1388
+ */
1389
+ namespace?: string | null;
1390
+ /** Display name shown in the Contact List. */
1391
+ displayName?: string;
1392
+ /**
1393
+ * Type of data the field holds.
1394
+ *
1395
+ * One of:
1396
+ * - `"TEXT"`: Accepts strings.
1397
+ * - `"NUMBER"`: Accepts floats.
1398
+ * - `"DATE"`: Accepts dates formatted as `YYYY-MM-DD`.
1399
+ * - `"URL"`: Accepts strings. Prepends `https://` if no protocol is included.
1400
+ * @readonly
1401
+ */
1402
+ dataType?: FieldDataType;
1403
+ /**
1404
+ * Indicates whether the extended field is a system field or custom field.
1405
+ *
1406
+ * One of:
1407
+ * - `"SYSTEM"`: System field managed by Wix. System fields cannot be modified by 3rd-party apps or site contributors.
1408
+ * - `"USER_DEFINED"`: Custom field that can be modified by 3rd-party apps or site admins.
1409
+ * @readonly
1410
+ */
1411
+ fieldType?: FieldType;
1412
+ /**
1413
+ * Date and time the field was created.
1414
+ * @readonly
1415
+ */
1416
+ _createdDate?: Date;
1417
+ /**
1418
+ * Date and time the field was last updated.
1419
+ * @readonly
1420
+ */
1421
+ _updatedDate?: Date;
1422
+ /**
1423
+ * Field description, if the field is a system field.
1424
+ * @readonly
1425
+ */
1426
+ description?: string | null;
1427
+ }
1428
+ interface QueryOffsetResult$1 {
1429
+ currentPage: number | undefined;
1430
+ totalPages: number | undefined;
1431
+ totalCount: number | undefined;
1432
+ hasNext: () => boolean;
1433
+ hasPrev: () => boolean;
1434
+ length: number;
1435
+ pageSize: number;
1436
+ }
1437
+ interface FieldsQueryResult extends QueryOffsetResult$1 {
1438
+ items: ExtendedField[];
1439
+ query: FieldsQueryBuilder;
1440
+ next: () => Promise<FieldsQueryResult>;
1441
+ prev: () => Promise<FieldsQueryResult>;
1442
+ }
1443
+ interface FieldsQueryBuilder {
1444
+ /** @param propertyName - Property whose value is compared with `value`.
1445
+ * @param value - Value to compare against.
1446
+ * @documentationMaturity preview
1447
+ */
1448
+ eq: (propertyName: 'namespace' | 'key' | 'displayName' | 'dataType' | 'fieldType' | '_createdDate' | '_updatedDate', value: any) => FieldsQueryBuilder;
1449
+ /** @param propertyName - Property whose value is compared with `value`.
1450
+ * @param value - Value to compare against.
1451
+ * @documentationMaturity preview
1452
+ */
1453
+ ne: (propertyName: 'namespace' | 'key' | 'displayName' | 'dataType' | '_createdDate' | '_updatedDate', value: any) => FieldsQueryBuilder;
1454
+ /** @param propertyName - Property whose value is compared with `value`.
1455
+ * @param value - Value to compare against.
1456
+ * @documentationMaturity preview
1457
+ */
1458
+ ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => FieldsQueryBuilder;
1459
+ /** @param propertyName - Property whose value is compared with `value`.
1460
+ * @param value - Value to compare against.
1461
+ * @documentationMaturity preview
1462
+ */
1463
+ gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => FieldsQueryBuilder;
1464
+ /** @param propertyName - Property whose value is compared with `value`.
1465
+ * @param value - Value to compare against.
1466
+ * @documentationMaturity preview
1467
+ */
1468
+ le: (propertyName: '_createdDate' | '_updatedDate', value: any) => FieldsQueryBuilder;
1469
+ /** @param propertyName - Property whose value is compared with `value`.
1470
+ * @param value - Value to compare against.
1471
+ * @documentationMaturity preview
1472
+ */
1473
+ lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => FieldsQueryBuilder;
1474
+ /** @param propertyName - Property whose value is compared with `string`.
1475
+ * @param string - String to compare against. Case-insensitive.
1476
+ * @documentationMaturity preview
1477
+ */
1478
+ startsWith: (propertyName: 'displayName', value: string) => FieldsQueryBuilder;
1479
+ /** @documentationMaturity preview */
1480
+ in: (propertyName: 'key' | 'displayName', value: any) => FieldsQueryBuilder;
1481
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1482
+ * @documentationMaturity preview
1483
+ */
1484
+ ascending: (...propertyNames: Array<'displayName' | '_createdDate' | '_updatedDate'>) => FieldsQueryBuilder;
1485
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1486
+ * @documentationMaturity preview
1487
+ */
1488
+ descending: (...propertyNames: Array<'displayName' | '_createdDate' | '_updatedDate'>) => FieldsQueryBuilder;
1489
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
1490
+ * @documentationMaturity preview
1491
+ */
1492
+ limit: (limit: number) => FieldsQueryBuilder;
1493
+ /** @param skip - Number of items to skip in the query results before returning the results.
1494
+ * @documentationMaturity preview
1495
+ */
1496
+ skip: (skip: number) => FieldsQueryBuilder;
1497
+ /** @documentationMaturity preview */
1498
+ find: () => Promise<FieldsQueryResult>;
1499
+ }
1500
+
1501
+ declare function findOrCreateExtendedField$1(httpClient: HttpClient): (displayName: string, dataType: FieldDataType) => Promise<FindOrCreateExtendedFieldResponse & FindOrCreateExtendedFieldResponseNonNullableFields>;
1502
+ declare function getExtendedField$1(httpClient: HttpClient): (key: string) => Promise<ExtendedField & {
1503
+ key: string;
1504
+ displayName: string;
1505
+ dataType: FieldDataType;
1506
+ fieldType: FieldType;
1507
+ }>;
1508
+ declare function renameExtendedField$1(httpClient: HttpClient): (key: string, field: RenameExtendedField) => Promise<ExtendedField & {
1509
+ key: string;
1510
+ displayName: string;
1511
+ dataType: FieldDataType;
1512
+ fieldType: FieldType;
1513
+ }>;
1514
+ declare function deleteExtendedField$1(httpClient: HttpClient): (key: string) => Promise<void>;
1515
+ declare function queryExtendedFields$1(httpClient: HttpClient): () => FieldsQueryBuilder;
1516
+ declare const onExtendedFieldCreated$1: EventDefinition<ExtendedFieldCreatedEnvelope, "wix.contacts.v4.extended-field_created">;
1517
+ declare const onExtendedFieldUpdated$1: EventDefinition<ExtendedFieldUpdatedEnvelope, "wix.contacts.v4.extended-field_updated">;
1518
+ declare const onExtendedFieldDeleted$1: EventDefinition<ExtendedFieldDeletedEnvelope, "wix.contacts.v4.extended-field_deleted">;
1519
+
1520
+ declare const findOrCreateExtendedField: BuildRESTFunction<typeof findOrCreateExtendedField$1>;
1521
+ declare const getExtendedField: BuildRESTFunction<typeof getExtendedField$1>;
1522
+ declare const renameExtendedField: BuildRESTFunction<typeof renameExtendedField$1>;
1523
+ declare const deleteExtendedField: BuildRESTFunction<typeof deleteExtendedField$1>;
1524
+ declare const queryExtendedFields: BuildRESTFunction<typeof queryExtendedFields$1>;
1525
+ declare const onExtendedFieldCreated: BuildEventDefinition<typeof onExtendedFieldCreated$1>;
1526
+ declare const onExtendedFieldUpdated: BuildEventDefinition<typeof onExtendedFieldUpdated$1>;
1527
+ declare const onExtendedFieldDeleted: BuildEventDefinition<typeof onExtendedFieldDeleted$1>;
1528
+
1529
+ declare const context$3_deleteExtendedField: typeof deleteExtendedField;
1530
+ declare const context$3_findOrCreateExtendedField: typeof findOrCreateExtendedField;
1531
+ declare const context$3_getExtendedField: typeof getExtendedField;
1532
+ declare const context$3_onExtendedFieldCreated: typeof onExtendedFieldCreated;
1533
+ declare const context$3_onExtendedFieldDeleted: typeof onExtendedFieldDeleted;
1534
+ declare const context$3_onExtendedFieldUpdated: typeof onExtendedFieldUpdated;
1535
+ declare const context$3_queryExtendedFields: typeof queryExtendedFields;
1536
+ declare const context$3_renameExtendedField: typeof renameExtendedField;
1537
+ declare namespace context$3 {
1538
+ export { 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, context$3_queryExtendedFields as queryExtendedFields, context$3_renameExtendedField as renameExtendedField };
1539
+ }
1540
+
1541
+ /** Label that was found or created. */
1542
+ interface ContactLabel {
1543
+ /**
1544
+ * Label namespace.
1545
+ *
1546
+ * Labels created by site admins or 3rd-party apps
1547
+ * are automatically assigned to the `custom` namespace.
1548
+ * @readonly
1549
+ */
1550
+ namespace?: string | null;
1551
+ /**
1552
+ * Display name for the namespace,
1553
+ * used to organize the list of labels in the site Dashboard.
1554
+ * @readonly
1555
+ */
1556
+ namespaceDisplayName?: string | null;
1557
+ /**
1558
+ * Label key.
1559
+ *
1560
+ * `key` is generated when the label is created.
1561
+ * It cannot be modified, even if `displayName` is updated.
1562
+ * @readonly
1563
+ */
1564
+ key?: string;
1565
+ /** Label display name shown in the Dashboard. */
1566
+ displayName?: string;
1567
+ /**
1568
+ * Label type.
1569
+ *
1570
+ * - `"SYSTEM"`: The label is a default system label for the Contact List.
1571
+ * - `"USER_DEFINED"`: The label was created by a site contributor or 3rd-party app.
1572
+ * - `"WIX_APP_DEFINED"`: The label was created by a Wix app.
1573
+ * @readonly
1574
+ */
1575
+ labelType?: LabelType;
1576
+ /**
1577
+ * Date and time the label was created.
1578
+ * @readonly
1579
+ */
1580
+ _createdDate?: Date;
1581
+ /**
1582
+ * Date and time the label was last updated.
1583
+ * @readonly
1584
+ */
1585
+ _updatedDate?: Date;
1586
+ }
1587
+ declare enum LabelType {
1588
+ /** Need UNKNOWN to be able to fetch all labels */
1589
+ UNKNOWN = "UNKNOWN",
1590
+ SYSTEM = "SYSTEM",
1591
+ USER_DEFINED = "USER_DEFINED",
1592
+ WIX_APP_DEFINED = "WIX_APP_DEFINED"
1593
+ }
1594
+ /** Label that was found or created. */
1595
+ interface FindOrCreateLabelResponse {
1596
+ /** Label that was found or created. */
1597
+ label?: ContactLabel;
1598
+ /**
1599
+ * Indicates whether the label was just created or already existed.
1600
+ *
1601
+ * If the label was just created, returns `true`.
1602
+ * If it already existed, returns `false`.
1603
+ */
1604
+ newLabel?: boolean;
1605
+ }
1606
+ interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
1607
+ /** ID of a site visitor that has not logged in to the site. */
1608
+ anonymousVisitorId?: string;
1609
+ /** ID of a site visitor that has logged in to the site. */
1610
+ memberId?: string;
1611
+ /** ID of a Wix user (site owner, contributor, etc.). */
1612
+ wixUserId?: string;
1613
+ /** ID of an app. */
1614
+ appId?: string;
1615
+ /** @readonly */
1616
+ identityType?: WebhookIdentityType$1;
1617
+ }
1618
+ /** @oneof */
1619
+ interface IdentificationDataIdOneOf$1 {
1620
+ /** ID of a site visitor that has not logged in to the site. */
1621
+ anonymousVisitorId?: string;
1622
+ /** ID of a site visitor that has logged in to the site. */
1623
+ memberId?: string;
1624
+ /** ID of a Wix user (site owner, contributor, etc.). */
1625
+ wixUserId?: string;
1626
+ /** ID of an app. */
1627
+ appId?: string;
1628
+ }
1629
+ declare enum WebhookIdentityType$1 {
1630
+ UNKNOWN = "UNKNOWN",
1631
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1632
+ MEMBER = "MEMBER",
1633
+ WIX_USER = "WIX_USER",
1634
+ APP = "APP"
1635
+ }
1636
+ interface FindOrCreateLabelResponseNonNullableFields {
1637
+ label?: {
1638
+ key: string;
1639
+ displayName: string;
1640
+ labelType: LabelType;
1641
+ };
1642
+ newLabel: boolean;
1643
+ }
1644
+ interface BaseEventMetadata$1 {
1645
+ /** App instance ID. */
1646
+ instanceId?: string | null;
1647
+ /** Event type. */
1648
+ eventType?: string;
1649
+ /** The identification type and identity data. */
1650
+ identity?: IdentificationData$1;
1651
+ }
1652
+ interface EventMetadata$1 extends BaseEventMetadata$1 {
1653
+ /**
1654
+ * Unique event ID.
1655
+ * Allows clients to ignore duplicate webhooks.
1656
+ */
1657
+ _id?: string;
1658
+ /**
1659
+ * Assumes actions are also always typed to an entity_type
1660
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
1661
+ */
1662
+ entityFqdn?: string;
1663
+ /**
1664
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
1665
+ * This is although the created/updated/deleted notion is duplication of the oneof types
1666
+ * Example: created/updated/deleted/started/completed/email_opened
1667
+ */
1668
+ slug?: string;
1669
+ /** ID of the entity associated with the event. */
1670
+ entityId?: string;
1671
+ /** Event timestamp. */
1672
+ eventTime?: Date;
1673
+ /**
1674
+ * Whether the event was triggered as a result of a privacy regulation application
1675
+ * (for example, GDPR).
1676
+ */
1677
+ triggeredByAnonymizeRequest?: boolean | null;
1678
+ /** If present, indicates the action that triggered the event. */
1679
+ originatedFrom?: string | null;
1680
+ /**
1681
+ * A sequence number defining the order of updates to the underlying entity.
1682
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
1683
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1684
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1685
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
1686
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1687
+ */
1688
+ entityEventSequence?: string | null;
1689
+ }
1690
+ interface LabelCreatedEnvelope {
1691
+ entity: ContactLabel;
1692
+ metadata: EventMetadata$1;
1693
+ }
1694
+ interface LabelUpdatedEnvelope {
1695
+ entity: ContactLabel;
1696
+ metadata: EventMetadata$1;
1697
+ }
1698
+ interface LabelDeletedEnvelope {
1699
+ metadata: EventMetadata$1;
1700
+ }
1701
+ interface FindOrCreateLabelOptions {
1702
+ /**
1703
+ * Language for localization.
1704
+ *
1705
+ * 2-letter language code in
1706
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
1707
+ */
1708
+ language?: string | null;
1709
+ }
1710
+ interface GetLabelOptions {
1711
+ /**
1712
+ * Language for localization.
1713
+ *
1714
+ * 2-letter language code in
1715
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
1716
+ */
1717
+ language?: string | null;
1718
+ }
1719
+ interface RenameLabel {
1720
+ /**
1721
+ * Label namespace.
1722
+ *
1723
+ * Labels created by site admins or 3rd-party apps
1724
+ * are automatically assigned to the `custom` namespace.
1725
+ * @readonly
1726
+ */
1727
+ namespace?: string | null;
1728
+ /**
1729
+ * Display name for the namespace,
1730
+ * used to organize the list of labels in the site Dashboard.
1731
+ * @readonly
1732
+ */
1733
+ namespaceDisplayName?: string | null;
1734
+ /** Label display name shown in the Dashboard. */
1735
+ displayName?: string;
1736
+ /**
1737
+ * Label type.
1738
+ *
1739
+ * - `"SYSTEM"`: The label is a default system label for the Contact List.
1740
+ * - `"USER_DEFINED"`: The label was created by a site contributor or 3rd-party app.
1741
+ * - `"WIX_APP_DEFINED"`: The label was created by a Wix app.
1742
+ * @readonly
1743
+ */
1744
+ labelType?: LabelType;
1745
+ /**
1746
+ * Date and time the label was created.
1747
+ * @readonly
1748
+ */
1749
+ _createdDate?: Date;
1750
+ /**
1751
+ * Date and time the label was last updated.
1752
+ * @readonly
1753
+ */
1754
+ _updatedDate?: Date;
1755
+ }
1756
+ interface RenameLabelOptions {
1757
+ /**
1758
+ * Language for localization.
1759
+ *
1760
+ * 2-letter language code in
1761
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
1762
+ */
1763
+ language?: string | null;
1764
+ }
1765
+ interface QueryLabelsOptions {
1766
+ /**
1767
+ * Language for localization.
1768
+ *
1769
+ * 2-letter language code in
1770
+ * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
1771
+ */
1772
+ language?: string | null | undefined;
1773
+ }
1774
+ interface QueryOffsetResult {
1775
+ currentPage: number | undefined;
1776
+ totalPages: number | undefined;
1777
+ totalCount: number | undefined;
1778
+ hasNext: () => boolean;
1779
+ hasPrev: () => boolean;
1780
+ length: number;
1781
+ pageSize: number;
1782
+ }
1783
+ interface LabelsQueryResult extends QueryOffsetResult {
1784
+ items: ContactLabel[];
1785
+ query: LabelsQueryBuilder;
1786
+ next: () => Promise<LabelsQueryResult>;
1787
+ prev: () => Promise<LabelsQueryResult>;
1788
+ }
1789
+ interface LabelsQueryBuilder {
1790
+ /** @param propertyName - Property whose value is compared with `value`.
1791
+ * @param value - Value to compare against.
1792
+ * @documentationMaturity preview
1793
+ */
1794
+ eq: (propertyName: 'namespace' | 'key' | 'displayName' | 'labelType' | '_createdDate' | '_updatedDate', value: any) => LabelsQueryBuilder;
1795
+ /** @param propertyName - Property whose value is compared with `value`.
1796
+ * @param value - Value to compare against.
1797
+ * @documentationMaturity preview
1798
+ */
1799
+ ne: (propertyName: 'namespace' | 'key' | 'displayName' | '_createdDate' | '_updatedDate', value: any) => LabelsQueryBuilder;
1800
+ /** @param propertyName - Property whose value is compared with `value`.
1801
+ * @param value - Value to compare against.
1802
+ * @documentationMaturity preview
1803
+ */
1804
+ ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => LabelsQueryBuilder;
1805
+ /** @param propertyName - Property whose value is compared with `value`.
1806
+ * @param value - Value to compare against.
1807
+ * @documentationMaturity preview
1808
+ */
1809
+ gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => LabelsQueryBuilder;
1810
+ /** @param propertyName - Property whose value is compared with `value`.
1811
+ * @param value - Value to compare against.
1812
+ * @documentationMaturity preview
1813
+ */
1814
+ le: (propertyName: '_createdDate' | '_updatedDate', value: any) => LabelsQueryBuilder;
1815
+ /** @param propertyName - Property whose value is compared with `value`.
1816
+ * @param value - Value to compare against.
1817
+ * @documentationMaturity preview
1818
+ */
1819
+ lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => LabelsQueryBuilder;
1820
+ /** @param propertyName - Property whose value is compared with `string`.
1821
+ * @param string - String to compare against. Case-insensitive.
1822
+ * @documentationMaturity preview
1823
+ */
1824
+ startsWith: (propertyName: 'displayName', value: string) => LabelsQueryBuilder;
1825
+ /** @documentationMaturity preview */
1826
+ in: (propertyName: 'key' | 'displayName', value: any) => LabelsQueryBuilder;
1827
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1828
+ * @documentationMaturity preview
1829
+ */
1830
+ ascending: (...propertyNames: Array<'displayName' | '_createdDate' | '_updatedDate'>) => LabelsQueryBuilder;
1831
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1832
+ * @documentationMaturity preview
1833
+ */
1834
+ descending: (...propertyNames: Array<'displayName' | '_createdDate' | '_updatedDate'>) => LabelsQueryBuilder;
1835
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
1836
+ * @documentationMaturity preview
1837
+ */
1838
+ limit: (limit: number) => LabelsQueryBuilder;
1839
+ /** @param skip - Number of items to skip in the query results before returning the results.
1840
+ * @documentationMaturity preview
1841
+ */
1842
+ skip: (skip: number) => LabelsQueryBuilder;
1843
+ /** @documentationMaturity preview */
1844
+ find: () => Promise<LabelsQueryResult>;
1845
+ }
1846
+
1847
+ declare function findOrCreateLabel$1(httpClient: HttpClient): (displayName: string, options?: FindOrCreateLabelOptions) => Promise<FindOrCreateLabelResponse & FindOrCreateLabelResponseNonNullableFields>;
1848
+ declare function getLabel$1(httpClient: HttpClient): (key: string, options?: GetLabelOptions) => Promise<ContactLabel & {
1849
+ key: string;
1850
+ displayName: string;
1851
+ labelType: LabelType;
1852
+ }>;
1853
+ declare function renameLabel$1(httpClient: HttpClient): (key: string, label: RenameLabel, options?: RenameLabelOptions) => Promise<ContactLabel & {
1854
+ key: string;
1855
+ displayName: string;
1856
+ labelType: LabelType;
1857
+ }>;
1858
+ declare function deleteLabel$1(httpClient: HttpClient): (key: string) => Promise<void>;
1859
+ declare function queryLabels$1(httpClient: HttpClient): (options?: QueryLabelsOptions) => LabelsQueryBuilder;
1860
+ declare const onLabelCreated$1: EventDefinition<LabelCreatedEnvelope, "wix.contacts.v4.label_created">;
1861
+ declare const onLabelUpdated$1: EventDefinition<LabelUpdatedEnvelope, "wix.contacts.v4.label_updated">;
1862
+ declare const onLabelDeleted$1: EventDefinition<LabelDeletedEnvelope, "wix.contacts.v4.label_deleted">;
1863
+
1864
+ declare const findOrCreateLabel: BuildRESTFunction<typeof findOrCreateLabel$1>;
1865
+ declare const getLabel: BuildRESTFunction<typeof getLabel$1>;
1866
+ declare const renameLabel: BuildRESTFunction<typeof renameLabel$1>;
1867
+ declare const deleteLabel: BuildRESTFunction<typeof deleteLabel$1>;
1868
+ declare const queryLabels: BuildRESTFunction<typeof queryLabels$1>;
1869
+ declare const onLabelCreated: BuildEventDefinition<typeof onLabelCreated$1>;
1870
+ declare const onLabelUpdated: BuildEventDefinition<typeof onLabelUpdated$1>;
1871
+ declare const onLabelDeleted: BuildEventDefinition<typeof onLabelDeleted$1>;
1872
+
1873
+ declare const context$2_deleteLabel: typeof deleteLabel;
1874
+ declare const context$2_findOrCreateLabel: typeof findOrCreateLabel;
1875
+ declare const context$2_getLabel: typeof getLabel;
1876
+ declare const context$2_onLabelCreated: typeof onLabelCreated;
1877
+ declare const context$2_onLabelDeleted: typeof onLabelDeleted;
1878
+ declare const context$2_onLabelUpdated: typeof onLabelUpdated;
1879
+ declare const context$2_queryLabels: typeof queryLabels;
1880
+ declare const context$2_renameLabel: typeof renameLabel;
1881
+ declare namespace context$2 {
1882
+ export { 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, context$2_queryLabels as queryLabels, context$2_renameLabel as renameLabel };
1883
+ }
1884
+
1885
+ interface ContactInfo$1 {
1886
+ /** Contact's first and last name. */
1887
+ name?: ContactName;
1888
+ /** Contact's email addresses. */
1889
+ emails?: ContactEmailsWrapper;
1890
+ /** Contact's phone numbers. */
1891
+ phones?: ContactPhonesWrapper;
1892
+ /** Contact's street addresses. */
1893
+ addresses?: ContactAddressesWrapper;
1894
+ /** Contact's company name. */
1895
+ company?: string | null;
1896
+ /**
1897
+ * Contact's job title.
1898
+ * Corresponds to the **Position** field in the Dashboard.
1899
+ */
1900
+ jobTitle?: string | null;
1901
+ /** Birth date in `YYYY-MM-DD` format. For example, `2020-03-15`. */
1902
+ birthdate?: string | null;
1903
+ /**
1904
+ * Locale in
1905
+ * [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
1906
+ * Typically, this is a lowercase 2-letter language code,
1907
+ * followed by a hyphen, followed by an uppercase 2-letter country code.
1908
+ * For example, `en-US` for U.S. English, and `de-DE` for Germany German.
1909
+ */
1910
+ locale?: string | null;
1911
+ /**
1912
+ * List of contact's labels.
1913
+ * Labels are used to organize contacts.
1914
+ * When setting the `labelKeys` property,
1915
+ * only labels that already exist in the site's Contacts List can be used.
1916
+ * Labels can be added and removed using
1917
+ * [Label Contact](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/label-contact) and
1918
+ * [Unlabel Contact](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/unlabel-contact),
1919
+ * respectively.
1920
+ *
1921
+ * To view or manage site labels, use the
1922
+ * [Labels API](https://dev.wix.com/api/rest/contacts/labels).
1923
+ */
1924
+ labelKeys?: LabelsWrapper;
1925
+ /**
1926
+ * Additional custom fields.
1927
+ * This includes fields managed by Wix, by 3rd-party apps, and by the site.
1928
+ *
1929
+ * Empty fields are not returned.
1930
+ */
1931
+ extendedFields?: ExtendedFieldsWrapper;
1932
+ /** Contact's profile picture. */
1933
+ picture?: ContactPicture;
1934
+ }
1935
+ interface ContactName {
1936
+ /** Contact's first name. */
1937
+ first?: string | null;
1938
+ /** Contact's last name. */
1939
+ last?: string | null;
1940
+ }
1941
+ interface ContactEmailsWrapper {
1942
+ /** List of up to 50 email addresses. */
1943
+ items?: ContactEmail[];
1944
+ }
1945
+ interface ContactEmail {
1946
+ /**
1947
+ * Email ID.
1948
+ * @readonly
1949
+ */
1950
+ _id?: string | null;
1951
+ /**
1952
+ * Email type.
1953
+ *
1954
+ * `UNTAGGED` is shown as "Other" in the Contact List.
1955
+ */
1956
+ tag?: EmailTag;
1957
+ /** Email address. */
1958
+ email?: string;
1959
+ /**
1960
+ * Indicates whether this is the contact's primary email address.
1961
+ * When changing `primary` to `true` for an email,
1962
+ * the contact's other emails become `false`.
1963
+ * It also affects the subscription status to marketing emails that are decided based on the primary email.
1964
+ */
1965
+ primary?: boolean | null;
1966
+ }
1967
+ declare enum EmailTag {
1968
+ UNTAGGED = "UNTAGGED",
1969
+ MAIN = "MAIN",
1970
+ HOME = "HOME",
1971
+ WORK = "WORK"
1972
+ }
1973
+ interface ContactPhonesWrapper {
1974
+ /** List of up to 50 phone numbers. */
1975
+ items?: ContactPhone[];
1976
+ }
1977
+ interface ContactPhone {
1978
+ /**
1979
+ * Phone ID.
1980
+ * @readonly
1981
+ */
1982
+ _id?: string | null;
1983
+ /**
1984
+ * Phone type.
1985
+ *
1986
+ * `UNTAGGED` is shown as "Other" in the Contact List.
1987
+ */
1988
+ tag?: PhoneTag;
1989
+ /** [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. */
1990
+ countryCode?: string | null;
1991
+ /** Phone number. */
1992
+ phone?: string;
1993
+ /**
1994
+ * [ITU E.164-formatted](https://www.itu.int/rec/T-REC-E.164/)
1995
+ * phone number.
1996
+ * Automatically generated using `phone` and `countryCode`, pending both values are valid.
1997
+ * @readonly
1998
+ */
1999
+ e164Phone?: string | null;
2000
+ /**
2001
+ * Whether this is the contact's primary phone number.
2002
+ * When changing `primary` to `true` for a phone,
2003
+ * the contact's `primary` field for other phones becomes `false`.
2004
+ * It also affects the subscription status to SMS messages that are decided based on the primary phone.
2005
+ */
2006
+ primary?: boolean | null;
2007
+ }
2008
+ declare enum PhoneTag {
2009
+ UNTAGGED = "UNTAGGED",
2010
+ MAIN = "MAIN",
2011
+ HOME = "HOME",
2012
+ MOBILE = "MOBILE",
2013
+ WORK = "WORK",
2014
+ FAX = "FAX"
2015
+ }
2016
+ interface ContactAddressesWrapper {
2017
+ /** List of up to 50 addresses. */
2018
+ items?: ContactAddress[];
2019
+ }
2020
+ interface ContactAddress {
2021
+ /**
2022
+ * Street address ID.
2023
+ * @readonly
2024
+ */
2025
+ _id?: string | null;
2026
+ /**
2027
+ * Address type.
2028
+ * `UNTAGGED` is shown as "Other" in the Contact List.
2029
+ */
2030
+ tag?: AddressTag;
2031
+ /** Street address. */
2032
+ address?: Address;
2033
+ }
2034
+ declare enum AddressTag {
2035
+ UNTAGGED = "UNTAGGED",
2036
+ HOME = "HOME",
2037
+ WORK = "WORK",
2038
+ BILLING = "BILLING",
2039
+ SHIPPING = "SHIPPING"
2040
+ }
2041
+ /** Physical address */
2042
+ interface Address extends AddressStreetOneOf {
2043
+ /** Street address object, with number and name in separate fields. */
2044
+ streetAddress?: StreetAddress;
2045
+ /** Main address line, usually street and number, as free text. */
2046
+ addressLine1?: string | null;
2047
+ /**
2048
+ * 2-letter country code in an
2049
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
2050
+ */
2051
+ country?: string | null;
2052
+ /**
2053
+ * Code for a subdivision (such as state, prefecture, or province) in an
2054
+ * [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.
2055
+ */
2056
+ subdivision?: string | null;
2057
+ /** City name. */
2058
+ city?: string | null;
2059
+ /** Postal or zip code. */
2060
+ postalCode?: string | null;
2061
+ /**
2062
+ * Free text providing more detailed address information,
2063
+ * such as apartment, suite, or floor.
2064
+ */
2065
+ addressLine2?: string | null;
2066
+ }
2067
+ /** @oneof */
2068
+ interface AddressStreetOneOf {
2069
+ /** Street address object, with number and name in separate fields. */
2070
+ streetAddress?: StreetAddress;
2071
+ /** Main address line, usually street and number, as free text. */
2072
+ addressLine?: string | null;
2073
+ }
2074
+ interface StreetAddress {
2075
+ /** Street number. */
2076
+ number?: string;
2077
+ /** Street name. */
2078
+ name?: string;
2079
+ }
2080
+ interface LabelsWrapper {
2081
+ /**
2082
+ * List of contact label keys.
2083
+ * [Contact labels](https://support.wix.com/en/article/adding-labels-to-contacts-in-your-contact-list)
2084
+ * help categorize contacts.
2085
+ *
2086
+ * Label keys must exist to be added to the contact.
2087
+ * Contact labels can be created or retrieved with
2088
+ * [Find or Create Label](https://dev.wix.com/api/rest/contacts/labels/find-or-create-label)
2089
+ * or
2090
+ * [List Labels](https://dev.wix.com/api/rest/contacts/labels/list-labels)
2091
+ */
2092
+ items?: string[];
2093
+ }
2094
+ interface ExtendedFieldsWrapper {
2095
+ /**
2096
+ * Contact's extended fields,
2097
+ * where each key is the field key,
2098
+ * and each value is the field's value for the contact.
2099
+ *
2100
+ * To view and manage extended fields, use the
2101
+ * [Extended Fields API](https://dev.wix.com/api/rest/contacts/extended-fields).
2102
+ */
2103
+ items?: Record<string, any>;
2104
+ }
2105
+ /** TEST contact picture description */
2106
+ interface ContactPicture {
2107
+ /**
2108
+ * Image.
2109
+ * This can contain an image URL or a Wix Media image ID.
2110
+ */
2111
+ image?: string;
2112
+ }
2113
+ interface SubmitContactResponse {
2114
+ /** ID of the contact that was found or created. */
2115
+ contactId?: string;
2116
+ /**
2117
+ * Identity type of the returned contact.
2118
+ *
2119
+ * - `CONTACT`: The returned contact ID belongs to a new or existing contact.
2120
+ * - `MEMBER`: The returned contact ID belongs to the currently logged-in site member.
2121
+ * - `NOT_AUTHENTICATED_MEMBER`: The returned contact ID belongs to a site member who is not currently logged in.
2122
+ */
2123
+ identityType?: IdentityType;
2124
+ /**
2125
+ * Indicates whether the contact was just created or already existed.
2126
+ *
2127
+ * If the contact was just created, returns `true`.
2128
+ * If it already existed, returns `false`.
2129
+ */
2130
+ newContact?: boolean;
2131
+ }
2132
+ declare enum IdentityType {
2133
+ UNKNOWN = "UNKNOWN",
2134
+ /** Existing or new contact */
2135
+ CONTACT = "CONTACT",
2136
+ /** Member is logged in, matching logic skipped */
2137
+ MEMBER = "MEMBER",
2138
+ /** Matching contact is a member, Merge logic won't be applied */
2139
+ NOT_AUTHENTICATED_MEMBER = "NOT_AUTHENTICATED_MEMBER"
2140
+ }
2141
+ interface SubmitContactResponseNonNullableFields {
2142
+ contactId: string;
2143
+ identityType: IdentityType;
2144
+ newContact: boolean;
2145
+ }
2146
+ interface AppendOrCreateContactOptions {
2147
+ /**
2148
+ * Contact's information.
2149
+ * To reconcile with an existing contact,
2150
+ * a phone or email must be provided,
2151
+ * or the current session identity must be attached to a contact or member.
2152
+ *
2153
+ * If no existing contact can be found,
2154
+ * a new contact is created with the specified information.
2155
+ *
2156
+ * <!--ONLY:REST-->
2157
+ * Required if there's no contextual identity or given `contactId`.
2158
+ * <!--END:ONLY:REST-->
2159
+ */
2160
+ info?: ContactInfo$1;
2161
+ /** Pass through data, to be posted on Contact Submitted Domain Event (optional). */
2162
+ passThroughData?: string | null;
2163
+ /**
2164
+ * Existing Contact ID (optional).
2165
+ * Requires permission `CONTACTS.SUBMIT_WITH_OVERRIDES`
2166
+ */
2167
+ contactId?: string | null;
2168
+ }
2169
+
2170
+ declare function appendOrCreateContact$1(httpClient: HttpClient): (options?: AppendOrCreateContactOptions) => Promise<SubmitContactResponse & SubmitContactResponseNonNullableFields>;
2171
+
2172
+ declare const appendOrCreateContact: BuildRESTFunction<typeof appendOrCreateContact$1>;
2173
+
2174
+ declare const context$1_appendOrCreateContact: typeof appendOrCreateContact;
2175
+ declare namespace context$1 {
2176
+ export { context$1_appendOrCreateContact as appendOrCreateContact };
2177
+ }
2178
+
2179
+ interface Task {
2180
+ /**
2181
+ * Task ID.
2182
+ * @readonly
2183
+ */
2184
+ _id?: string | null;
2185
+ /**
2186
+ * Revision number, which increments by 1 each time the task is updated. To prevent conflicting changes, the existing `revision` must be used when updating a task.
2187
+ * @readonly
2188
+ */
2189
+ revision?: string | null;
2190
+ /** Title of the task. */
2191
+ title?: string | null;
2192
+ /** Description of the task. */
2193
+ description?: string | null;
2194
+ /**
2195
+ * Date and time the task was created.
2196
+ * @readonly
2197
+ */
2198
+ _createdDate?: Date;
2199
+ /**
2200
+ * Date and time the task was last updated.
2201
+ * @readonly
2202
+ */
2203
+ _updatedDate?: Date;
2204
+ /** Due date for the task. */
2205
+ dueDate?: Date;
2206
+ /**
2207
+ * Status of the task.
2208
+ *
2209
+ * Default: `ACTION_NEEDED`
2210
+ */
2211
+ status?: TaskStatus;
2212
+ /** Details about the task source. */
2213
+ source?: TaskSource;
2214
+ /** Information about the contact associated with the task. */
2215
+ contact?: ContactInfo;
2216
+ }
2217
+ /** Possible statuses in which the task may be. */
2218
+ declare enum TaskStatus {
2219
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
2220
+ ACTION_NEEDED = "ACTION_NEEDED",
2221
+ COMPLETED = "COMPLETED"
2222
+ }
2223
+ interface TaskSource {
2224
+ /**
2225
+ * How the task was created.
2226
+ * @readonly
2227
+ */
2228
+ sourceType?: SourceType;
2229
+ /**
2230
+ * App ID, if the task was created by an app.
2231
+ * @readonly
2232
+ */
2233
+ appId?: string | null;
2234
+ /**
2235
+ * User ID, if the task was created by a user.
2236
+ * @readonly
2237
+ */
2238
+ userId?: string | null;
2239
+ }
2240
+ /** Possible sources that can create tasks. */
2241
+ declare enum SourceType {
2242
+ UNKNOWN_SOURCE_TYPE = "UNKNOWN_SOURCE_TYPE",
2243
+ APP = "APP",
2244
+ USER = "USER"
2245
+ }
2246
+ interface ContactInfo {
2247
+ /** ID of the contact associated with the task. */
2248
+ _id?: string | null;
2249
+ /**
2250
+ * Contact's first name.
2251
+ * @readonly
2252
+ */
2253
+ firstName?: string | null;
2254
+ /**
2255
+ * Contact's last name.
2256
+ * @readonly
2257
+ */
2258
+ lastName?: string | null;
2259
+ /**
2260
+ * Contact's image url.
2261
+ * @readonly
2262
+ */
2263
+ imageUrl?: string | null;
2264
+ /**
2265
+ * Contact's primary email.
2266
+ * @readonly
2267
+ */
2268
+ email?: string | null;
2269
+ /**
2270
+ * Contact's primary phone.
2271
+ * @readonly
2272
+ */
2273
+ phone?: string | null;
2274
+ }
2275
+ interface TaskOverdue {
2276
+ /** The overdue task. */
2277
+ task?: Task;
2278
+ }
2279
+ interface Cursors {
2280
+ /** Cursor pointing to next page in the list of results. */
2281
+ next?: string | null;
2282
+ /** Cursor pointing to previous page in the list of results. */
2283
+ prev?: string | null;
2284
+ }
2285
+ interface CountTasksResponse {
2286
+ /** The number of tasks that match the provided filter. */
2287
+ count?: number;
2288
+ }
2289
+ interface IdentificationData extends IdentificationDataIdOneOf {
2290
+ /** ID of a site visitor that has not logged in to the site. */
2291
+ anonymousVisitorId?: string;
2292
+ /** ID of a site visitor that has logged in to the site. */
2293
+ memberId?: string;
2294
+ /** ID of a Wix user (site owner, contributor, etc.). */
2295
+ wixUserId?: string;
2296
+ /** ID of an app. */
2297
+ appId?: string;
2298
+ /** @readonly */
2299
+ identityType?: WebhookIdentityType;
2300
+ }
2301
+ /** @oneof */
2302
+ interface IdentificationDataIdOneOf {
2303
+ /** ID of a site visitor that has not logged in to the site. */
2304
+ anonymousVisitorId?: string;
2305
+ /** ID of a site visitor that has logged in to the site. */
2306
+ memberId?: string;
2307
+ /** ID of a Wix user (site owner, contributor, etc.). */
2308
+ wixUserId?: string;
2309
+ /** ID of an app. */
2310
+ appId?: string;
2311
+ }
2312
+ declare enum WebhookIdentityType {
2313
+ UNKNOWN = "UNKNOWN",
2314
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
2315
+ MEMBER = "MEMBER",
2316
+ WIX_USER = "WIX_USER",
2317
+ APP = "APP"
2318
+ }
2319
+ interface CountTasksResponseNonNullableFields {
2320
+ count: number;
2321
+ }
2322
+ interface BaseEventMetadata {
2323
+ /** App instance ID. */
2324
+ instanceId?: string | null;
2325
+ /** Event type. */
2326
+ eventType?: string;
2327
+ /** The identification type and identity data. */
2328
+ identity?: IdentificationData;
2329
+ }
2330
+ interface EventMetadata extends BaseEventMetadata {
2331
+ /**
2332
+ * Unique event ID.
2333
+ * Allows clients to ignore duplicate webhooks.
2334
+ */
2335
+ _id?: string;
2336
+ /**
2337
+ * Assumes actions are also always typed to an entity_type
2338
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2339
+ */
2340
+ entityFqdn?: string;
2341
+ /**
2342
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2343
+ * This is although the created/updated/deleted notion is duplication of the oneof types
2344
+ * Example: created/updated/deleted/started/completed/email_opened
2345
+ */
2346
+ slug?: string;
2347
+ /** ID of the entity associated with the event. */
2348
+ entityId?: string;
2349
+ /** Event timestamp. */
2350
+ eventTime?: Date;
2351
+ /**
2352
+ * Whether the event was triggered as a result of a privacy regulation application
2353
+ * (for example, GDPR).
2354
+ */
2355
+ triggeredByAnonymizeRequest?: boolean | null;
2356
+ /** If present, indicates the action that triggered the event. */
2357
+ originatedFrom?: string | null;
2358
+ /**
2359
+ * A sequence number defining the order of updates to the underlying entity.
2360
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
2361
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2362
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2363
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
2364
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2365
+ */
2366
+ entityEventSequence?: string | null;
2367
+ }
2368
+ interface TaskOverdueEnvelope {
2369
+ data: TaskOverdue;
2370
+ metadata: EventMetadata;
2371
+ }
2372
+ interface TaskCreatedEnvelope {
2373
+ entity: Task;
2374
+ metadata: EventMetadata;
2375
+ }
2376
+ interface TaskUpdatedEnvelope {
2377
+ entity: Task;
2378
+ metadata: EventMetadata;
2379
+ }
2380
+ interface TaskDeletedEnvelope {
2381
+ metadata: EventMetadata;
2382
+ }
2383
+ interface UpdateTask {
2384
+ /**
2385
+ * Task ID.
2386
+ * @readonly
2387
+ */
2388
+ _id?: string | null;
2389
+ /**
2390
+ * Revision number, which increments by 1 each time the task is updated. To prevent conflicting changes, the existing `revision` must be used when updating a task.
2391
+ * @readonly
2392
+ */
2393
+ revision?: string | null;
2394
+ /** Title of the task. */
2395
+ title?: string | null;
2396
+ /** Description of the task. */
2397
+ description?: string | null;
2398
+ /**
2399
+ * Date and time the task was created.
2400
+ * @readonly
2401
+ */
2402
+ _createdDate?: Date;
2403
+ /**
2404
+ * Date and time the task was last updated.
2405
+ * @readonly
2406
+ */
2407
+ _updatedDate?: Date;
2408
+ /** Due date for the task. */
2409
+ dueDate?: Date;
2410
+ /**
2411
+ * Status of the task.
2412
+ *
2413
+ * Default: `ACTION_NEEDED`
2414
+ */
2415
+ status?: TaskStatus;
2416
+ /** Details about the task source. */
2417
+ source?: TaskSource;
2418
+ /** Information about the contact associated with the task. */
2419
+ contact?: ContactInfo;
2420
+ }
2421
+ interface QueryCursorResult {
2422
+ cursors: Cursors;
2423
+ hasNext: () => boolean;
2424
+ hasPrev: () => boolean;
2425
+ length: number;
2426
+ pageSize: number;
2427
+ }
2428
+ interface TasksQueryResult extends QueryCursorResult {
2429
+ items: Task[];
2430
+ query: TasksQueryBuilder;
2431
+ next: () => Promise<TasksQueryResult>;
2432
+ prev: () => Promise<TasksQueryResult>;
2433
+ }
2434
+ interface TasksQueryBuilder {
2435
+ /** @param propertyName - Property whose value is compared with `value`.
2436
+ * @param value - Value to compare against.
2437
+ */
2438
+ eq: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'dueDate' | 'status' | 'contact.id', value: any) => TasksQueryBuilder;
2439
+ /** @param propertyName - Property whose value is compared with `value`.
2440
+ * @param value - Value to compare against.
2441
+ */
2442
+ ne: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'dueDate' | 'status' | 'contact.id', value: any) => TasksQueryBuilder;
2443
+ /** @param propertyName - Property whose value is compared with `value`.
2444
+ * @param value - Value to compare against.
2445
+ */
2446
+ ge: (propertyName: '_createdDate' | '_updatedDate' | 'dueDate', value: any) => TasksQueryBuilder;
2447
+ /** @param propertyName - Property whose value is compared with `value`.
2448
+ * @param value - Value to compare against.
2449
+ */
2450
+ gt: (propertyName: '_createdDate' | '_updatedDate' | 'dueDate', value: any) => TasksQueryBuilder;
2451
+ /** @param propertyName - Property whose value is compared with `value`.
2452
+ * @param value - Value to compare against.
2453
+ */
2454
+ le: (propertyName: '_createdDate' | '_updatedDate' | 'dueDate', value: any) => TasksQueryBuilder;
2455
+ /** @param propertyName - Property whose value is compared with `value`.
2456
+ * @param value - Value to compare against.
2457
+ */
2458
+ lt: (propertyName: '_createdDate' | '_updatedDate' | 'dueDate', value: any) => TasksQueryBuilder;
2459
+ in: (propertyName: '_id' | 'status' | 'contact.id', value: any) => TasksQueryBuilder;
2460
+ exists: (propertyName: 'contact.id', value: boolean) => TasksQueryBuilder;
2461
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
2462
+ ascending: (...propertyNames: Array<'_id' | '_createdDate' | '_updatedDate' | 'dueDate'>) => TasksQueryBuilder;
2463
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
2464
+ descending: (...propertyNames: Array<'_id' | '_createdDate' | '_updatedDate' | 'dueDate'>) => TasksQueryBuilder;
2465
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */
2466
+ limit: (limit: number) => TasksQueryBuilder;
2467
+ /** @param cursor - A pointer to specific record */
2468
+ skipTo: (cursor: string) => TasksQueryBuilder;
2469
+ find: () => Promise<TasksQueryResult>;
2470
+ }
2471
+ interface CountTasksOptions {
2472
+ /**
2473
+ * Filter which tasks to count. See the list of supported filters in `queryContacts`.
2474
+ *
2475
+ * Filterable fields include:
2476
+ * - `_id`
2477
+ * - `_createdDate`
2478
+ * - `_updatedDate`
2479
+ * - `dueDate`
2480
+ * - `status`
2481
+ * - `contact.id`
2482
+ */
2483
+ filter?: Record<string, any> | null;
2484
+ }
2485
+ interface MoveTaskAfterOptions {
2486
+ /**
2487
+ * The task ID after which the moved task is positioned in the display.
2488
+ * If `beforeTaskId` is not provided, the moved task is positioned first in the display of tasks.
2489
+ */
2490
+ beforeTaskId?: string | null;
2491
+ }
2492
+
2493
+ declare function createTask$1(httpClient: HttpClient): (task: Task) => Promise<Task & {
2494
+ status: TaskStatus;
2495
+ source?: {
2496
+ sourceType: SourceType;
2497
+ } | undefined;
2498
+ }>;
2499
+ declare function getTask$1(httpClient: HttpClient): (taskId: string) => Promise<Task & {
2500
+ status: TaskStatus;
2501
+ source?: {
2502
+ sourceType: SourceType;
2503
+ } | undefined;
2504
+ }>;
2505
+ declare function updateTask$1(httpClient: HttpClient): (_id: string | null, task: UpdateTask) => Promise<Task & {
2506
+ status: TaskStatus;
2507
+ source?: {
2508
+ sourceType: SourceType;
2509
+ } | undefined;
2510
+ }>;
2511
+ declare function deleteTask$1(httpClient: HttpClient): (taskId: string) => Promise<void>;
2512
+ declare function queryTasks$1(httpClient: HttpClient): () => TasksQueryBuilder;
2513
+ declare function countTasks$1(httpClient: HttpClient): (options?: CountTasksOptions) => Promise<CountTasksResponse & CountTasksResponseNonNullableFields>;
2514
+ declare function moveTaskAfter$1(httpClient: HttpClient): (taskId: string, options?: MoveTaskAfterOptions) => Promise<void>;
2515
+ declare const onTaskOverdue$1: EventDefinition<TaskOverdueEnvelope, "wix.crm.tasks.v2.task_task_overdue">;
2516
+ declare const onTaskCreated$1: EventDefinition<TaskCreatedEnvelope, "wix.crm.tasks.v2.task_created">;
2517
+ declare const onTaskUpdated$1: EventDefinition<TaskUpdatedEnvelope, "wix.crm.tasks.v2.task_updated">;
2518
+ declare const onTaskDeleted$1: EventDefinition<TaskDeletedEnvelope, "wix.crm.tasks.v2.task_deleted">;
2519
+
2520
+ declare const createTask: BuildRESTFunction<typeof createTask$1>;
2521
+ declare const getTask: BuildRESTFunction<typeof getTask$1>;
2522
+ declare const updateTask: BuildRESTFunction<typeof updateTask$1>;
2523
+ declare const deleteTask: BuildRESTFunction<typeof deleteTask$1>;
2524
+ declare const queryTasks: BuildRESTFunction<typeof queryTasks$1>;
2525
+ declare const countTasks: BuildRESTFunction<typeof countTasks$1>;
2526
+ declare const moveTaskAfter: BuildRESTFunction<typeof moveTaskAfter$1>;
2527
+ declare const onTaskOverdue: BuildEventDefinition<typeof onTaskOverdue$1>;
2528
+ declare const onTaskCreated: BuildEventDefinition<typeof onTaskCreated$1>;
2529
+ declare const onTaskUpdated: BuildEventDefinition<typeof onTaskUpdated$1>;
2530
+ declare const onTaskDeleted: BuildEventDefinition<typeof onTaskDeleted$1>;
2531
+
2532
+ declare const context_countTasks: typeof countTasks;
2533
+ declare const context_createTask: typeof createTask;
2534
+ declare const context_deleteTask: typeof deleteTask;
2535
+ declare const context_getTask: typeof getTask;
2536
+ declare const context_moveTaskAfter: typeof moveTaskAfter;
2537
+ declare const context_onTaskCreated: typeof onTaskCreated;
2538
+ declare const context_onTaskDeleted: typeof onTaskDeleted;
2539
+ declare const context_onTaskOverdue: typeof onTaskOverdue;
2540
+ declare const context_onTaskUpdated: typeof onTaskUpdated;
2541
+ declare const context_queryTasks: typeof queryTasks;
2542
+ declare const context_updateTask: typeof updateTask;
2543
+ declare namespace context {
2544
+ export { context_countTasks as countTasks, context_createTask as createTask, context_deleteTask as deleteTask, context_getTask as getTask, context_moveTaskAfter as moveTaskAfter, context_onTaskCreated as onTaskCreated, context_onTaskDeleted as onTaskDeleted, context_onTaskOverdue as onTaskOverdue, context_onTaskUpdated as onTaskUpdated, context_queryTasks as queryTasks, context_updateTask as updateTask };
2545
+ }
2546
+
2547
+ export { context$5 as attachments, context$4 as contacts, context$3 as extendedFields, context$2 as labels, context$1 as submittedContact, context as tasks };