@wix/crm 1.0.106 → 1.0.107

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