@wix/auto_sdk_crm_contacts 1.0.256 → 1.0.258

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.
Files changed (130) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/contacts-v4-contact-contacts.context.d.ts +36 -0
  11. package/build/cjs/src/contacts-v4-contact-contacts.context.js +61 -0
  12. package/build/cjs/src/contacts-v4-contact-contacts.context.js.map +1 -0
  13. package/build/cjs/src/contacts-v4-contact-contacts.http.d.ts +126 -0
  14. package/build/cjs/src/contacts-v4-contact-contacts.http.js +555 -0
  15. package/build/cjs/src/contacts-v4-contact-contacts.http.js.map +1 -0
  16. package/build/cjs/src/contacts-v4-contact-contacts.meta.d.ts +32 -0
  17. package/build/cjs/src/contacts-v4-contact-contacts.meta.js +180 -0
  18. package/build/cjs/src/contacts-v4-contact-contacts.meta.js.map +1 -0
  19. package/build/{internal/index.d.ts → cjs/src/contacts-v4-contact-contacts.public.d.ts} +18 -43
  20. package/build/cjs/src/contacts-v4-contact-contacts.public.js +193 -0
  21. package/build/cjs/src/contacts-v4-contact-contacts.public.js.map +1 -0
  22. package/build/{contacts-v4-contact-contacts.universal-B3uIE5qF.d.mts → cjs/src/contacts-v4-contact-contacts.types.d.ts} +193 -363
  23. package/build/cjs/src/contacts-v4-contact-contacts.types.js +278 -0
  24. package/build/cjs/src/contacts-v4-contact-contacts.types.js.map +1 -0
  25. package/build/cjs/src/contacts-v4-contact-contacts.universal.d.ts +2398 -0
  26. package/build/cjs/src/contacts-v4-contact-contacts.universal.js +911 -0
  27. package/build/cjs/src/contacts-v4-contact-contacts.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/contacts-v4-contact-contacts.context.d.ts +36 -0
  39. package/build/es/src/contacts-v4-contact-contacts.context.js +36 -0
  40. package/build/es/src/contacts-v4-contact-contacts.context.js.map +1 -0
  41. package/build/es/src/contacts-v4-contact-contacts.http.d.ts +126 -0
  42. package/build/es/src/contacts-v4-contact-contacts.http.js +544 -0
  43. package/build/es/src/contacts-v4-contact-contacts.http.js.map +1 -0
  44. package/build/es/src/contacts-v4-contact-contacts.meta.d.ts +32 -0
  45. package/build/es/src/contacts-v4-contact-contacts.meta.js +146 -0
  46. package/build/es/src/contacts-v4-contact-contacts.meta.js.map +1 -0
  47. package/build/{index.d.ts → es/src/contacts-v4-contact-contacts.public.d.ts} +18 -43
  48. package/build/es/src/contacts-v4-contact-contacts.public.js +160 -0
  49. package/build/es/src/contacts-v4-contact-contacts.public.js.map +1 -0
  50. package/build/{contacts-v4-contact-contacts.universal-B3uIE5qF.d.ts → es/src/contacts-v4-contact-contacts.types.d.ts} +193 -363
  51. package/build/es/src/contacts-v4-contact-contacts.types.js +275 -0
  52. package/build/es/src/contacts-v4-contact-contacts.types.js.map +1 -0
  53. package/build/es/src/contacts-v4-contact-contacts.universal.d.ts +2398 -0
  54. package/build/es/src/contacts-v4-contact-contacts.universal.js +877 -0
  55. package/build/es/src/contacts-v4-contact-contacts.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/contacts-v4-contact-contacts.context.d.ts +36 -0
  66. package/build/internal/cjs/src/contacts-v4-contact-contacts.context.js +61 -0
  67. package/build/internal/cjs/src/contacts-v4-contact-contacts.context.js.map +1 -0
  68. package/build/internal/cjs/src/contacts-v4-contact-contacts.http.d.ts +126 -0
  69. package/build/internal/cjs/src/contacts-v4-contact-contacts.http.js +555 -0
  70. package/build/internal/cjs/src/contacts-v4-contact-contacts.http.js.map +1 -0
  71. package/build/internal/cjs/src/contacts-v4-contact-contacts.meta.d.ts +32 -0
  72. package/build/internal/cjs/src/contacts-v4-contact-contacts.meta.js +180 -0
  73. package/build/internal/cjs/src/contacts-v4-contact-contacts.meta.js.map +1 -0
  74. package/build/internal/{index.d.mts → cjs/src/contacts-v4-contact-contacts.public.d.ts} +18 -43
  75. package/build/internal/cjs/src/contacts-v4-contact-contacts.public.js +193 -0
  76. package/build/internal/cjs/src/contacts-v4-contact-contacts.public.js.map +1 -0
  77. package/build/internal/{contacts-v4-contact-contacts.universal-CdMlf2ui.d.ts → cjs/src/contacts-v4-contact-contacts.types.d.ts} +189 -370
  78. package/build/internal/cjs/src/contacts-v4-contact-contacts.types.js +278 -0
  79. package/build/internal/cjs/src/contacts-v4-contact-contacts.types.js.map +1 -0
  80. package/build/internal/cjs/src/contacts-v4-contact-contacts.universal.d.ts +2409 -0
  81. package/build/internal/cjs/src/contacts-v4-contact-contacts.universal.js +911 -0
  82. package/build/internal/cjs/src/contacts-v4-contact-contacts.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/contacts-v4-contact-contacts.context.d.ts +36 -0
  93. package/build/internal/es/src/contacts-v4-contact-contacts.context.js +36 -0
  94. package/build/internal/es/src/contacts-v4-contact-contacts.context.js.map +1 -0
  95. package/build/internal/es/src/contacts-v4-contact-contacts.http.d.ts +126 -0
  96. package/build/internal/es/src/contacts-v4-contact-contacts.http.js +544 -0
  97. package/build/internal/es/src/contacts-v4-contact-contacts.http.js.map +1 -0
  98. package/build/internal/es/src/contacts-v4-contact-contacts.meta.d.ts +32 -0
  99. package/build/internal/es/src/contacts-v4-contact-contacts.meta.js +146 -0
  100. package/build/internal/es/src/contacts-v4-contact-contacts.meta.js.map +1 -0
  101. package/build/{index.d.mts → internal/es/src/contacts-v4-contact-contacts.public.d.ts} +18 -43
  102. package/build/internal/es/src/contacts-v4-contact-contacts.public.js +160 -0
  103. package/build/internal/es/src/contacts-v4-contact-contacts.public.js.map +1 -0
  104. package/build/internal/{contacts-v4-contact-contacts.universal-CdMlf2ui.d.mts → es/src/contacts-v4-contact-contacts.types.d.ts} +189 -370
  105. package/build/internal/es/src/contacts-v4-contact-contacts.types.js +275 -0
  106. package/build/internal/es/src/contacts-v4-contact-contacts.types.js.map +1 -0
  107. package/build/internal/es/src/contacts-v4-contact-contacts.universal.d.ts +2409 -0
  108. package/build/internal/es/src/contacts-v4-contact-contacts.universal.js +877 -0
  109. package/build/internal/es/src/contacts-v4-contact-contacts.universal.js.map +1 -0
  110. package/package.json +11 -12
  111. package/build/index.js +0 -1338
  112. package/build/index.js.map +0 -1
  113. package/build/index.mjs +0 -1281
  114. package/build/index.mjs.map +0 -1
  115. package/build/internal/index.js +0 -1338
  116. package/build/internal/index.js.map +0 -1
  117. package/build/internal/index.mjs +0 -1281
  118. package/build/internal/index.mjs.map +0 -1
  119. package/build/internal/meta.d.mts +0 -914
  120. package/build/internal/meta.d.ts +0 -914
  121. package/build/internal/meta.js +0 -618
  122. package/build/internal/meta.js.map +0 -1
  123. package/build/internal/meta.mjs +0 -584
  124. package/build/internal/meta.mjs.map +0 -1
  125. package/build/meta.d.mts +0 -914
  126. package/build/meta.d.ts +0 -914
  127. package/build/meta.js +0 -618
  128. package/build/meta.js.map +0 -1
  129. package/build/meta.mjs +0 -584
  130. package/build/meta.mjs.map +0 -1
@@ -0,0 +1,2398 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+ export interface Contact {
3
+ /**
4
+ * Contact ID.
5
+ * @format GUID
6
+ * @readonly
7
+ */
8
+ _id?: string;
9
+ /**
10
+ * Revision number, which increments by 1 each time the contact is updated.
11
+ * To prevent conflicting changes,
12
+ * the existing `revision` must be specified when updating a contact.
13
+ * @readonly
14
+ */
15
+ revision?: number;
16
+ /**
17
+ * Details about the contact's source.
18
+ * @readonly
19
+ */
20
+ source?: ContactSource;
21
+ /**
22
+ * Date and time the contact was created.
23
+ * @readonly
24
+ */
25
+ _createdDate?: Date | null;
26
+ /**
27
+ * Date and time the contact was last updated.
28
+ * @readonly
29
+ */
30
+ _updatedDate?: Date | null;
31
+ /**
32
+ * Details about the contact's last action in the site.
33
+ * @readonly
34
+ */
35
+ lastActivity?: ContactActivity;
36
+ /**
37
+ * Contact's primary phone and email.
38
+ * @readonly
39
+ */
40
+ primaryInfo?: PrimaryContactInfo;
41
+ /** Contact's details. */
42
+ info?: ContactInfo;
43
+ /**
44
+ * Contact's primary email details.
45
+ * @readonly
46
+ */
47
+ primaryEmail?: PrimaryEmail;
48
+ /**
49
+ * Contact's primary phone details.
50
+ * @readonly
51
+ */
52
+ primaryPhone?: PrimaryPhone;
53
+ }
54
+ export interface ContactSource {
55
+ /**
56
+ * Source type.
57
+ * @readonly
58
+ */
59
+ sourceType?: ContactSourceType;
60
+ /**
61
+ * App ID, if the contact was created by an app.
62
+ * @format GUID
63
+ * @readonly
64
+ */
65
+ appId?: string | null;
66
+ }
67
+ export declare enum ContactSourceType {
68
+ OTHER = "OTHER",
69
+ ADMIN = "ADMIN",
70
+ WIX_APP = "WIX_APP",
71
+ IMPORT = "IMPORT",
72
+ THIRD_PARTY = "THIRD_PARTY",
73
+ WIX_BOOKINGS = "WIX_BOOKINGS",
74
+ WIX_CHAT = "WIX_CHAT",
75
+ WIX_EMAIL_MARKETING = "WIX_EMAIL_MARKETING",
76
+ WIX_EVENTS = "WIX_EVENTS",
77
+ WIX_FORMS = "WIX_FORMS",
78
+ WIX_GROUPS = "WIX_GROUPS",
79
+ WIX_HOTELS = "WIX_HOTELS",
80
+ WIX_MARKET_PLACE = "WIX_MARKET_PLACE",
81
+ WIX_MUSIC = "WIX_MUSIC",
82
+ WIX_RESTAURANTS = "WIX_RESTAURANTS",
83
+ WIX_SITE_MEMBERS = "WIX_SITE_MEMBERS",
84
+ WIX_STORES = "WIX_STORES",
85
+ WIX_CODE = "WIX_CODE",
86
+ HOPP = "HOPP"
87
+ }
88
+ export interface ContactActivity {
89
+ /** Date and time of the last action. */
90
+ activityDate?: Date | null;
91
+ /** Contact's last action in the site. */
92
+ activityType?: ContactActivityType;
93
+ }
94
+ export declare enum ContactActivityType {
95
+ /** Visited the site. */
96
+ GENERAL = "GENERAL",
97
+ /** Became a new contact. */
98
+ CONTACT_CREATED = "CONTACT_CREATED",
99
+ /** Logged in. */
100
+ MEMBER_LOGIN = "MEMBER_LOGIN",
101
+ /** Requested a site membership. */
102
+ MEMBER_REGISTER = "MEMBER_REGISTER",
103
+ /** Was approved, blocked, or unblocked. */
104
+ MEMBER_STATUS_CHANGED = "MEMBER_STATUS_CHANGED",
105
+ /** Submitted a form. */
106
+ FORM_SUBMITTED = "FORM_SUBMITTED",
107
+ /** Started a chat. */
108
+ INBOX_FORM_SUBMITTED = "INBOX_FORM_SUBMITTED",
109
+ /** Paid a payment request. */
110
+ INBOX_PAYMENT_REQUEST_PAID = "INBOX_PAYMENT_REQUEST_PAID",
111
+ /** Received a message from the site. */
112
+ INBOX_MESSAGE_TO_CUSTOMER = "INBOX_MESSAGE_TO_CUSTOMER",
113
+ /** Sent a new message to the site. */
114
+ INBOX_MESSAGE_FROM_CUSTOMER = "INBOX_MESSAGE_FROM_CUSTOMER",
115
+ /** Subscribed to a site newsletter through a form. */
116
+ NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED = "NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED",
117
+ /** Unsubscribed from a site newsletter. */
118
+ NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE = "NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE",
119
+ /** Made a purchase. */
120
+ ECOM_PURCHASE = "ECOM_PURCHASE",
121
+ /** Abandoned a shopping cart. */
122
+ ECOM_CART_ABANDON = "ECOM_CART_ABANDON",
123
+ /** Checked out shopping cart and submitted buyer info (but didn’t complete the purchase yet). */
124
+ ECOM_CHECKOUT_BUYER = "ECOM_CHECKOUT_BUYER",
125
+ /** Booked an appointment. */
126
+ BOOKINGS_APPOINTMENT = "BOOKINGS_APPOINTMENT",
127
+ /** Made a Wix Hotels reservation. */
128
+ HOTELS_RESERVATION = "HOTELS_RESERVATION",
129
+ /** Paid for a Wix Hotels reservation. */
130
+ HOTELS_PURCHASE = "HOTELS_PURCHASE",
131
+ /** Confirmed a Wix Hotels reservation. */
132
+ HOTELS_CONFIRMATION = "HOTELS_CONFIRMATION",
133
+ /** Canceled a Wix Hotels reservation. */
134
+ HOTELS_CANCEL = "HOTELS_CANCEL",
135
+ /** Purchased a video. */
136
+ VIDEO_PURCHASE = "VIDEO_PURCHASE",
137
+ /** Rented a video. */
138
+ VIDEO_RENT = "VIDEO_RENT",
139
+ /** Made a purchase with a pay button. */
140
+ CASHIER_BUTTON_PURCHASE = "CASHIER_BUTTON_PURCHASE",
141
+ /** Became a new Wix Marketplace lead. */
142
+ ARENA_NEW_LEAD = "ARENA_NEW_LEAD",
143
+ /** RSVP'd to an event. */
144
+ EVENTS_RSVP = "EVENTS_RSVP",
145
+ /** Paid an invoice. */
146
+ INVOICE_PAY = "INVOICE_PAY",
147
+ /** An invoice is now overdue. */
148
+ INVOICE_OVERDUE = "INVOICE_OVERDUE",
149
+ /** Accepted a price quote. */
150
+ PRICE_QUOTE_ACCEPT = "PRICE_QUOTE_ACCEPT",
151
+ /** A price quote has expired. */
152
+ PRICE_QUOTE_EXPIRE = "PRICE_QUOTE_EXPIRE",
153
+ /** Ordered food with Wix Restaurants. */
154
+ RESTAURANTS_ORDER = "RESTAURANTS_ORDER",
155
+ /** Made a Wix Restaurants reservation. */
156
+ RESTAURANTS_RESERVATION = "RESTAURANTS_RESERVATION",
157
+ /** Opened an email from the site. */
158
+ SHOUTOUT_OPEN = "SHOUTOUT_OPEN",
159
+ /** Clicked a link in an email from the site. */
160
+ SHOUTOUT_CLICK = "SHOUTOUT_CLICK",
161
+ /** Merged with another contact. */
162
+ CONTACT_MERGED = "CONTACT_MERGED",
163
+ /** Subscribed to a site newsletter. */
164
+ NEWSLETTER_SUBSCRIPTION_SUBSCRIBE = "NEWSLETTER_SUBSCRIPTION_SUBSCRIBE",
165
+ /** Subscription status to site newsletters is pending confirmation. */
166
+ NEWSLETTER_SUBSCRIPTION_PENDING = "NEWSLETTER_SUBSCRIPTION_PENDING",
167
+ /** Subscription status to site newsletters is not set. */
168
+ NEWSLETTER_SUBSCRIPTION_NOT_SET = "NEWSLETTER_SUBSCRIPTION_NOT_SET",
169
+ /** Subscribed to phone notifications. */
170
+ PHONE_SUBSCRIPTION_SUBSCRIBE = "PHONE_SUBSCRIPTION_SUBSCRIBE",
171
+ /** Subscription to phone notificatons is pending confirmation. */
172
+ PHONE_SUBSCRIPTION_PENDING = "PHONE_SUBSCRIPTION_PENDING",
173
+ /** Subscription to phone notificatons is not set. */
174
+ PHONE_SUBSCRIPTION_NOT_SET = "PHONE_SUBSCRIPTION_NOT_SET",
175
+ /** Subscribed to phone notifications. */
176
+ PHONE_SUBSCRIPTION_UNSUBSCRIBE = "PHONE_SUBSCRIPTION_UNSUBSCRIBE"
177
+ }
178
+ export interface ActivityIcon {
179
+ /**
180
+ * Icon name
181
+ * @maxLength 50
182
+ */
183
+ name?: string | null;
184
+ /**
185
+ * Icon url
186
+ * @format WEB_URL
187
+ */
188
+ url?: string | null;
189
+ }
190
+ export interface PrimaryContactInfo {
191
+ /**
192
+ * Primary email address.
193
+ *
194
+ * This property reflects the email address in `info.emails`
195
+ * where `primary` is `true`.
196
+ * @format EMAIL
197
+ * @readonly
198
+ */
199
+ email?: string | null;
200
+ /**
201
+ * Primary phone number.
202
+ *
203
+ * This property reflects the phone number in `info.phones`
204
+ * where `primary` is `true`.
205
+ * @readonly
206
+ */
207
+ phone?: string | null;
208
+ }
209
+ export interface ContactInfo {
210
+ /** Contact's first and last name. */
211
+ name?: ContactName;
212
+ /** Contact's email addresses. */
213
+ emails?: ContactEmailsWrapper;
214
+ /** Contact's phone numbers. */
215
+ phones?: ContactPhonesWrapper;
216
+ /** Contact's street addresses. */
217
+ addresses?: ContactAddressesWrapper;
218
+ /**
219
+ * Contact's company name.
220
+ * @maxLength 1000
221
+ */
222
+ company?: string | null;
223
+ /**
224
+ * Contact's job title.
225
+ * @maxLength 1000
226
+ */
227
+ jobTitle?: string | null;
228
+ /**
229
+ * Birth date in `YYYY-MM-DD` format. For example, `2020-03-15`.
230
+ * @format LOCAL_DATE
231
+ */
232
+ birthdate?: string | null;
233
+ /**
234
+ * Locale in
235
+ * [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
236
+ * Typically, this is a lowercase 2-letter language code,
237
+ * followed by a hyphen, followed by an uppercase 2-letter country code.
238
+ * For example, `en-US` for U.S. English, and `de-DE` for Germany German.
239
+ * @format LANGUAGE_TAG
240
+ */
241
+ locale?: string | null;
242
+ /**
243
+ * List of contact's labels.
244
+ *
245
+ * Labels are used to organize contacts. Labels can be
246
+ * added and removed using Label Contact and Unlabel Contact, respectively.
247
+ *
248
+ * To view or manage contact labels, use the Labels API.
249
+ */
250
+ labelKeys?: LabelsWrapper;
251
+ /**
252
+ * Additional custom fields.
253
+ *
254
+ * Empty fields are not returned.
255
+ */
256
+ extendedFields?: ExtendedFieldsWrapper;
257
+ /** Contact's profile picture. */
258
+ picture?: ContactPicture;
259
+ }
260
+ export interface ContactName {
261
+ /**
262
+ * Contact's first name.
263
+ * @maxLength 1000
264
+ */
265
+ first?: string | null;
266
+ /**
267
+ * Contact's last name.
268
+ * @maxLength 1000
269
+ */
270
+ last?: string | null;
271
+ }
272
+ export interface ContactEmailsWrapper {
273
+ /**
274
+ * List of up to 50 email addresses.
275
+ * @maxSize 50
276
+ */
277
+ items?: ContactEmail[];
278
+ }
279
+ export interface ContactEmail {
280
+ /**
281
+ * Email ID.
282
+ * @format GUID
283
+ * @readonly
284
+ */
285
+ _id?: string | null;
286
+ /**
287
+ * Email type.
288
+ *
289
+ * `UNTAGGED` is shown as "Other" in the Contact List.
290
+ */
291
+ tag?: EmailTag;
292
+ /**
293
+ * Email address.
294
+ * @minLength 1
295
+ * @maxLength 320
296
+ */
297
+ email?: string;
298
+ /**
299
+ * Indicates whether this is the contact's primary email address.
300
+ * When changing `primary` to `true` for an email,
301
+ * the contact's other emails become `false`.
302
+ * Changing the primary email of a contact also affects the subscription status to marketing emails that are decided based on the primary email.
303
+ */
304
+ primary?: boolean | null;
305
+ }
306
+ export declare enum EmailTag {
307
+ UNTAGGED = "UNTAGGED",
308
+ MAIN = "MAIN",
309
+ HOME = "HOME",
310
+ WORK = "WORK"
311
+ }
312
+ export interface ContactPhonesWrapper {
313
+ /**
314
+ * List of up to 50 phone numbers.
315
+ * @maxSize 50
316
+ */
317
+ items?: ContactPhone[];
318
+ }
319
+ export interface ContactPhone {
320
+ /**
321
+ * Phone ID.
322
+ * @format GUID
323
+ * @readonly
324
+ */
325
+ _id?: string | null;
326
+ /**
327
+ * Phone type.
328
+ *
329
+ * `UNTAGGED` is shown as "Other" in the Contact List.
330
+ */
331
+ tag?: PhoneTag;
332
+ /**
333
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.
334
+ * @format COUNTRY
335
+ */
336
+ countryCode?: string | null;
337
+ /**
338
+ * Phone number.
339
+ * @minLength 1
340
+ * @maxLength 50
341
+ */
342
+ phone?: string;
343
+ /**
344
+ * [ITU E.164-formatted](https://www.itu.int/rec/T-REC-E.164/)
345
+ * phone number.
346
+ * Automatically generated using `phone` and `countryCode`, pending both values are valid.
347
+ * @readonly
348
+ */
349
+ e164Phone?: string | null;
350
+ /**
351
+ * Indicates whether this is the contact's primary phone number.
352
+ * When changing `primary` to `true` for a phone,
353
+ * the contact's `primary` field for other phones becomes `false`.
354
+ * Changing the primary phone number also affects the subscription status to SMS messages that are decided based on the primary phone.
355
+ */
356
+ primary?: boolean | null;
357
+ }
358
+ export declare enum PhoneTag {
359
+ UNTAGGED = "UNTAGGED",
360
+ MAIN = "MAIN",
361
+ HOME = "HOME",
362
+ MOBILE = "MOBILE",
363
+ WORK = "WORK",
364
+ FAX = "FAX"
365
+ }
366
+ export interface ContactAddressesWrapper {
367
+ /**
368
+ * List of up to 50 addresses.
369
+ * @maxSize 50
370
+ */
371
+ items?: ContactAddress[];
372
+ }
373
+ export interface ContactAddress {
374
+ /**
375
+ * Street address ID.
376
+ * @format GUID
377
+ * @readonly
378
+ */
379
+ _id?: string | null;
380
+ /**
381
+ * Address type.
382
+ * `UNTAGGED` is shown as "Other" in the Contact List.
383
+ */
384
+ tag?: AddressTag;
385
+ /** Street address. */
386
+ address?: Address;
387
+ }
388
+ export declare enum AddressTag {
389
+ UNTAGGED = "UNTAGGED",
390
+ HOME = "HOME",
391
+ WORK = "WORK",
392
+ BILLING = "BILLING",
393
+ SHIPPING = "SHIPPING"
394
+ }
395
+ /** Physical address */
396
+ export interface Address extends AddressStreetOneOf {
397
+ /** Street address object, with number and name in separate fields. */
398
+ streetAddress?: StreetAddress;
399
+ /**
400
+ * Main address line, usually street and number, as free text.
401
+ * @maxLength 1000
402
+ */
403
+ addressLine1?: string | null;
404
+ /**
405
+ * 2-letter country code in an
406
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
407
+ * @format COUNTRY
408
+ */
409
+ country?: string | null;
410
+ /**
411
+ * Code for a subdivision (such as state, prefecture, or province) in an
412
+ * [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.
413
+ * @maxLength 100
414
+ */
415
+ subdivision?: string | null;
416
+ /**
417
+ * City name.
418
+ * @maxLength 1000
419
+ */
420
+ city?: string | null;
421
+ /**
422
+ * Postal or zip code.
423
+ * @maxLength 100
424
+ */
425
+ postalCode?: string | null;
426
+ /**
427
+ * Free text providing more detailed address information,
428
+ * such as apartment, suite, or floor.
429
+ * @maxLength 1000
430
+ */
431
+ addressLine2?: string | null;
432
+ }
433
+ /** @oneof */
434
+ export interface AddressStreetOneOf {
435
+ /** Street address object, with number and name in separate fields. */
436
+ streetAddress?: StreetAddress;
437
+ /**
438
+ * Main address line, usually street and number, as free text.
439
+ * @maxLength 1000
440
+ */
441
+ addressLine?: string | null;
442
+ }
443
+ export interface StreetAddress {
444
+ /**
445
+ * Street number.
446
+ * @maxLength 100
447
+ */
448
+ number?: string;
449
+ /**
450
+ * Street name.
451
+ * @maxLength 1000
452
+ */
453
+ name?: string;
454
+ }
455
+ export interface AddressLocation {
456
+ /** Address's latitude. */
457
+ latitude?: number | null;
458
+ /** Address's longitude. */
459
+ longitude?: number | null;
460
+ }
461
+ export interface Subdivision {
462
+ /** subdivision short code */
463
+ code?: string;
464
+ /** Full subdivision name. */
465
+ name?: string;
466
+ }
467
+ export declare enum SubdivisionType {
468
+ UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
469
+ /** State */
470
+ ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
471
+ /** County */
472
+ ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
473
+ /** City/town */
474
+ ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
475
+ /** Neighborhood/quarter */
476
+ ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
477
+ /** Street/block */
478
+ ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
479
+ /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
480
+ COUNTRY = "COUNTRY"
481
+ }
482
+ export interface AssigneesWrapper {
483
+ /**
484
+ * List of site contributor user IDs.
485
+ * @format GUID
486
+ * @maxSize 50
487
+ */
488
+ items?: string[];
489
+ }
490
+ export interface LabelsWrapper {
491
+ /**
492
+ * List of contact label keys.
493
+ *
494
+ * Contact labels help categorize contacts. Label keys must exist to be added to the contact.
495
+ * Contact labels can be created or retrieved with Find or Create Label or List Labels.
496
+ * @maxSize 2000
497
+ */
498
+ items?: string[];
499
+ }
500
+ export interface ExtendedFieldsWrapper {
501
+ /**
502
+ * Contact's extended fields,
503
+ * where each key is the field key,
504
+ * and each value is the field's value for the contact.
505
+ *
506
+ * To view and manage extended fields, use the Extended Fields API.
507
+ */
508
+ items?: Record<string, any>;
509
+ }
510
+ export interface LocationsWrapper {
511
+ /**
512
+ * List of location ids.
513
+ * @format GUID
514
+ * @maxSize 50
515
+ */
516
+ items?: string[];
517
+ }
518
+ /** TEST contact picture description */
519
+ export interface ContactPicture {
520
+ /**
521
+ * Image.
522
+ * This can contain an image URL or a Wix Media image ID.
523
+ */
524
+ image?: string;
525
+ }
526
+ export declare enum ImageProvider {
527
+ UNKNOWN = "UNKNOWN",
528
+ /** Image stored outside Wix */
529
+ EXTERNAL = "EXTERNAL",
530
+ /** Stored in wix media platform, Must be uploaded by using `GeneratePictureUploadUrl` */
531
+ WIX_MEDIA = "WIX_MEDIA"
532
+ }
533
+ export interface SegmentsWrapper {
534
+ /**
535
+ * List of Contact segment IDs
536
+ * @maxSize 60
537
+ * @format GUID
538
+ */
539
+ items?: string[];
540
+ }
541
+ export interface PrimaryEmail {
542
+ /**
543
+ * Primary email address.
544
+ *
545
+ * This field reflects the email address in `info.emails`
546
+ * where `primary` is `true`.
547
+ * @format EMAIL
548
+ * @readonly
549
+ */
550
+ email?: string | null;
551
+ /**
552
+ * Indicates the recipient's opt-in or opt-out status for marketing emails.
553
+ *
554
+ * Default: `NOT_SET`
555
+ * @readonly
556
+ */
557
+ subscriptionStatus?: SubscriptionStatus;
558
+ /**
559
+ * Indicates last reported status of sent emails.
560
+ *
561
+ * Default: `NOT_SET`
562
+ * @readonly
563
+ */
564
+ deliverabilityStatus?: EmailDeliverabilityStatus;
565
+ }
566
+ export declare enum SubscriptionStatus {
567
+ /** No status exists. */
568
+ NO_SUBSCRIPTION_STATUS = "NO_SUBSCRIPTION_STATUS",
569
+ /** No status specified. */
570
+ NOT_SET = "NOT_SET",
571
+ /** Subscription confirmation was requested, but recipient hasn't confirmed yet. */
572
+ PENDING = "PENDING",
573
+ /** Recipient has opted in to marketing emails or SMS messages. */
574
+ SUBSCRIBED = "SUBSCRIBED",
575
+ /** Recipient has opted out of marketing emails or SMS messages. */
576
+ UNSUBSCRIBED = "UNSUBSCRIBED"
577
+ }
578
+ export declare enum EmailDeliverabilityStatus {
579
+ /** No status reported. */
580
+ NOT_SET = "NOT_SET",
581
+ /** Emails are being successfully delivered. */
582
+ VALID = "VALID",
583
+ /** The last email to the recipient bounced or was rejected. */
584
+ BOUNCED = "BOUNCED",
585
+ /** Recipient registered a spam complaint with their email provider. */
586
+ SPAM_COMPLAINT = "SPAM_COMPLAINT",
587
+ /** Multiple emails have been delivered without any kind of engagement from the recipient. */
588
+ INACTIVE = "INACTIVE"
589
+ }
590
+ export interface PrimaryPhone {
591
+ /**
592
+ * Country code of the primary phone number in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
593
+ * @format COUNTRY
594
+ */
595
+ countryCode?: string | null;
596
+ /**
597
+ * Phone number in [ITU E.164](https://www.itu.int/rec/T-REC-E.164/) format.
598
+ * Automatically generated using `phone` and `countryCode` when both values are valid.
599
+ * @readonly
600
+ */
601
+ e164Phone?: string | null;
602
+ /**
603
+ * Formatted phone. Automatically generated using `phone` and `countryCode`.
604
+ * @readonly
605
+ */
606
+ formattedPhone?: string | null;
607
+ /**
608
+ * Indicates the recipient's opt-in or opt-out status for SMS messages.
609
+ *
610
+ * Default:
611
+ * - `NOT_SET` when the phone is a valid E164 phone.
612
+ * - `NO_SUBSCRIPTION_STATUS` when the phone is not a valid E164 phone.
613
+ * @readonly
614
+ */
615
+ subscriptionStatus?: SubscriptionStatus;
616
+ /**
617
+ * Primary phone number.
618
+ *
619
+ * This field reflects the phone number in `info.phones`
620
+ * where `primary` is `true`.
621
+ * @readonly
622
+ */
623
+ phone?: string | null;
624
+ }
625
+ export declare enum PhoneDeliverabilityStatus {
626
+ /** No status exists. */
627
+ NO_PHONE_DELIVERABILITY_STATUS = "NO_PHONE_DELIVERABILITY_STATUS",
628
+ /** No status reported. */
629
+ NOT_SET = "NOT_SET"
630
+ }
631
+ export interface MemberInfo {
632
+ /**
633
+ * Member ID
634
+ * @format GUID
635
+ */
636
+ memberId?: string | null;
637
+ /** Signup date */
638
+ signupDate?: Date | null;
639
+ /**
640
+ * Login email
641
+ * @format EMAIL
642
+ */
643
+ email?: string | null;
644
+ /** Indicate whether the email is verified */
645
+ emailVerified?: boolean | null;
646
+ /** Indicates whether the member is required to verify their email */
647
+ emailVerificationRequired?: boolean | null;
648
+ /**
649
+ * Member status.
650
+ * - `PENDING`: Member created and is waiting for approval by site owner.
651
+ * - `ACTIVE`: Member can log in to the site.
652
+ * - `OFFLINE`: Member is a [managed writer](https://support.wix.com/en/article/wix-blog-adding-managed-writers-to-your-blog) for the site blog and cannot log in to the site.
653
+ * - `BLOCKED': Member is blocked and cannot log in to the site.
654
+ */
655
+ status?: MemberStatus;
656
+ /** Profile info */
657
+ profileInfo?: ProfileInfo;
658
+ /** User info */
659
+ userInfo?: UserInfo;
660
+ /** Session info */
661
+ sessionInfo?: SessionInfo;
662
+ /** Group info */
663
+ groupInfo?: GroupInfo;
664
+ }
665
+ export declare enum MemberStatus {
666
+ PENDING = "PENDING",
667
+ ACTIVE = "ACTIVE",
668
+ DELETED = "DELETED",
669
+ BLOCKED = "BLOCKED",
670
+ OFFLINE = "OFFLINE"
671
+ }
672
+ export interface ProfileInfo {
673
+ /**
674
+ * Nickname
675
+ * @maxLength 255
676
+ */
677
+ nickname?: string | null;
678
+ /** Privacy status */
679
+ privacyStatus?: PrivacyStatus;
680
+ /** Indicate whether the member is reported */
681
+ reported?: boolean | null;
682
+ /** Indicate whether the member is muted */
683
+ muted?: boolean | null;
684
+ /** Profile photo */
685
+ photo?: string;
686
+ }
687
+ export declare enum PrivacyStatus {
688
+ PRIVATE = "PRIVATE",
689
+ PUBLIC = "PUBLIC"
690
+ }
691
+ export interface UserInfo {
692
+ /**
693
+ * User ID
694
+ * @format GUID
695
+ */
696
+ userId?: string;
697
+ /** The user's role on the website */
698
+ role?: Role;
699
+ }
700
+ export declare enum Role {
701
+ UNSPECIFIED_ROLE = "UNSPECIFIED_ROLE",
702
+ OWNER = "OWNER",
703
+ CONTRIBUTOR = "CONTRIBUTOR"
704
+ }
705
+ export interface SessionInfo {
706
+ /** Last time the member logged in to the website */
707
+ lastWebLogin?: Date | null;
708
+ /** Last time the member logged in to one of the mobile apps */
709
+ lastMobileLogin?: Date | null;
710
+ /**
711
+ * List of mobile apps that the member has ever logged in to
712
+ * @maxSize 50
713
+ * @maxLength 50
714
+ */
715
+ mobileAppNames?: string[];
716
+ }
717
+ export interface GroupInfo {
718
+ /**
719
+ * Group IDs
720
+ * @format GUID
721
+ * @maxSize 1000
722
+ */
723
+ groupIds?: string[];
724
+ }
725
+ export interface ContactSubmitted {
726
+ /** Pass through data, submitted with the contact */
727
+ passThroughData?: string | null;
728
+ /** Submitted activity */
729
+ activity?: ContactActivity;
730
+ /** Submitted Contact (after processing) */
731
+ contact?: Contact;
732
+ }
733
+ export interface ContactChanged {
734
+ /** The Contact before the changes */
735
+ previousContact?: Contact;
736
+ /** The Contact after the changes */
737
+ currentContact?: Contact;
738
+ }
739
+ export interface ContactEmailSubscriptionUpdated {
740
+ /** The updated contact ID. */
741
+ contactId?: string;
742
+ /** The revision of the contact. */
743
+ revision?: number;
744
+ /** The primary email of the contact with the updated subscription and deliverability status. */
745
+ primaryEmail?: PrimaryEmail;
746
+ /** Date and time the contact was updated with the email subscription or deliverability status. */
747
+ _updatedDate?: Date | null;
748
+ }
749
+ export interface ContactPhoneSubscriptionUpdated {
750
+ /** The updated contact ID. */
751
+ contactId?: string;
752
+ /** The revision of the contact. */
753
+ revision?: number;
754
+ /** The primary phone of the contact with the updated subscription status. */
755
+ primaryPhone?: PrimaryPhone;
756
+ /** Date and time the contact was updated with the SMS subscription status. */
757
+ _updatedDate?: Date | null;
758
+ }
759
+ /**
760
+ * This message is an internal message used by this app and it is used to trigger
761
+ * the update of the subscription status of the contact asynchronously.
762
+ * It is published after a contact is created/updated/merged.
763
+ */
764
+ export interface ContactPrimaryInfoUpdated {
765
+ /** The updated contact ID. */
766
+ contactId?: string;
767
+ /** Indication whether the primary email was updated. */
768
+ primaryEmailUpdated?: boolean;
769
+ /** Indication whether primary phone was updated. */
770
+ primaryPhoneUpdated?: boolean;
771
+ /** previous primary email subscription status */
772
+ previousPrimaryEmailSubscriptionStatus?: PrimarySubscriptionStatus;
773
+ /** previous primary phone subscription status */
774
+ previousPrimaryPhoneSubscriptionStatus?: PrimarySubscriptionStatus;
775
+ }
776
+ export interface PrimarySubscriptionStatus {
777
+ /** subscription status */
778
+ subscriptionStatus?: SubscriptionStatus;
779
+ }
780
+ /**
781
+ * This message is an internal message used by this app and it is used to trigger
782
+ * the update of the contact's last activity is done asynchronously.
783
+ */
784
+ export interface LastActivityUpdate {
785
+ /**
786
+ * The contact ID.
787
+ * @format GUID
788
+ */
789
+ contactId?: string;
790
+ /** Activity date. */
791
+ activityDate?: Date | null;
792
+ /**
793
+ * Activity translation key.
794
+ * @maxLength 100
795
+ */
796
+ activityTranslationKey?: string;
797
+ /**
798
+ * Activity icon.
799
+ * @maxLength 100
800
+ */
801
+ icon?: string | null;
802
+ }
803
+ /** Contact creation options. */
804
+ export interface CreateContactRequest {
805
+ /** Contact info. */
806
+ info: ContactInfo;
807
+ /**
808
+ * Controls whether the call will succeed
809
+ * if the new contact information contains an email or a phone number already used by another contact.
810
+ *
811
+ * If set to `true`,
812
+ * the call will succeed even if an email address or phone number is used by another contact.
813
+ * If set to `false`,
814
+ * the call will fail if the given email address is used by another contact or,
815
+ * if the email address is not given and the given phone number is used by another contact.
816
+ *
817
+ * Default: `false`
818
+ */
819
+ allowDuplicates?: boolean;
820
+ }
821
+ /** Contact. */
822
+ export interface CreateContactResponse {
823
+ /** Contact. */
824
+ contact?: Contact;
825
+ }
826
+ export interface DuplicateContactExists {
827
+ /** @format GUID */
828
+ duplicateContactId?: string | null;
829
+ /** @format EMAIL */
830
+ duplicateEmail?: string | null;
831
+ /** @format PHONE */
832
+ duplicatePhone?: string | null;
833
+ }
834
+ export interface UpdateContactRequest {
835
+ /**
836
+ * ID of the contact to update.
837
+ * @format GUID
838
+ */
839
+ contactId: string;
840
+ /**
841
+ * Revision number.
842
+ * When updating, include the existing `revision`
843
+ * to prevent conflicting updates.
844
+ */
845
+ revision: number | null;
846
+ /**
847
+ * Controls whether the call will succeed
848
+ * if the new contact information contains an email or a phone number already used by another contact.
849
+ *
850
+ * If set to `true`,
851
+ * the call will succeed even if an email address or phone number is used by another contact.
852
+ * If set to `false`,
853
+ * the call will fail if the given email address is used by another contact or,
854
+ * if the email address is not given and the given phone number is used by another contact.
855
+ *
856
+ * Default: `false`
857
+ */
858
+ allowDuplicates?: boolean;
859
+ /** Contact info. */
860
+ info: ContactInfo;
861
+ }
862
+ /** Updated contact. */
863
+ export interface UpdateContactResponse {
864
+ /** Updated contact. */
865
+ contact?: Contact;
866
+ }
867
+ export interface MergeContactsRequest {
868
+ /**
869
+ * Target contact ID.
870
+ * @format GUID
871
+ */
872
+ targetContactId: string;
873
+ /**
874
+ * Target contact revision number, which increments by 1 each time the contact is updated.
875
+ * To prevent conflicting changes,
876
+ * the target contact's current `revision` must be specified.
877
+ */
878
+ targetContactRevision: number | null;
879
+ /**
880
+ * IDs of up to 5 contacts to merge into the target contact.
881
+ * When you merge more than one source contact,
882
+ * the first source is given precedence, then the second, and so on.
883
+ * @minSize 1
884
+ * @maxSize 5
885
+ */
886
+ sourceContactIds?: string[];
887
+ }
888
+ export interface MergeContactsResponse {
889
+ /** Updated target contact. */
890
+ contact?: Contact;
891
+ }
892
+ export interface ContactMerged {
893
+ /** ID of the contact the source contacts were merged into. */
894
+ targetContactId?: string;
895
+ /** IDs of contacts that were merged into the target contact. */
896
+ sourceContactIds?: string[];
897
+ /** Updated target contact. */
898
+ targetContact?: Contact;
899
+ }
900
+ export interface PreviewMergeContactsRequest {
901
+ /**
902
+ * Target contact ID.
903
+ * @format GUID
904
+ */
905
+ targetContactId?: string;
906
+ /**
907
+ * IDs of up to 5 contacts to merge into the target contact.
908
+ * When you merge more than one source contact,
909
+ * the first source is given precedence, then the second, and so on.
910
+ * @minSize 1
911
+ * @maxSize 5
912
+ */
913
+ sourceContactIds?: string[];
914
+ }
915
+ export interface PreviewMergeContactsResponse {
916
+ /** Preview of the updated target contact. */
917
+ contact?: Contact;
918
+ }
919
+ export interface DeleteContactRequest {
920
+ /**
921
+ * ID of the contact to delete.
922
+ * @format GUID
923
+ */
924
+ contactId: string;
925
+ }
926
+ export interface DeleteContactResponse {
927
+ }
928
+ export interface LabelContactRequest {
929
+ /**
930
+ * ID of the contact to add labels to.
931
+ * @format GUID
932
+ */
933
+ contactId: string;
934
+ /**
935
+ * List of label keys to add to the contact.
936
+ *
937
+ * Label keys must exist to be added to the contact.
938
+ * Use the Labels API to create or retrieve labels.
939
+ * @minSize 1
940
+ * @maxSize 100
941
+ */
942
+ labelKeys: string[];
943
+ }
944
+ /** Updated contact. */
945
+ export interface LabelContactResponse {
946
+ /** Updated contact. */
947
+ contact?: Contact;
948
+ }
949
+ export interface UnlabelContactRequest {
950
+ /**
951
+ * ID of the contact to remove labels from.
952
+ * @format GUID
953
+ */
954
+ contactId: string;
955
+ /**
956
+ * List of label keys to remove from the contact.
957
+ * @minSize 1
958
+ * @maxSize 100
959
+ */
960
+ labelKeys: string[];
961
+ }
962
+ /** Updated contact. */
963
+ export interface UnlabelContactResponse {
964
+ /** Updated contact. */
965
+ contact?: Contact;
966
+ }
967
+ export interface LabelAndUnlabelContactRequest {
968
+ /**
969
+ * Contact ID.
970
+ * @format GUID
971
+ */
972
+ contactId?: string;
973
+ /**
974
+ * List of label keys to add to the contact.
975
+ *
976
+ * Label keys must exist to be added to the contact.
977
+ * Contact labels can be created or retrieved with
978
+ * [Find or Create Label](https://dev.wix.com/api/rest/contacts/labels/find-or-create-label)
979
+ * or
980
+ * [List Labels](https://dev.wix.com/api/rest/contacts/labels/list-labels).
981
+ * @minSize 1
982
+ * @maxSize 100
983
+ */
984
+ labelKeysToAdd?: string[];
985
+ /**
986
+ * List of label keys to remove from the contact.
987
+ * @minSize 1
988
+ * @maxSize 100
989
+ */
990
+ labelKeysToRemove?: string[];
991
+ }
992
+ export interface LabelAndUnlabelContactResponse {
993
+ /** Updated contact. */
994
+ contact?: Contact;
995
+ }
996
+ export interface ListContactsRequest {
997
+ /** [Sort order](https://dev.wix.com/api/rest/contacts/contacts/sort-and-filter). */
998
+ sort?: Sorting;
999
+ /** [Pagination](https://dev.wix.com/api/rest/getting-started/pagination), defaults to offset = 0 and limit = 50 (max limit 1,000). */
1000
+ paging?: Paging;
1001
+ /**
1002
+ * List of projected fields to return.
1003
+ * If both `fields` and `fieldsets` are sent in the request,
1004
+ * the union of both lists is returned.
1005
+ * `id` and `revision` are always returned.
1006
+ *
1007
+ * Supported properties:
1008
+ * `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
1009
+ * `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
1010
+ * `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
1011
+ * `info.labelKeys`, `info.locations`, `info.extendedFields`
1012
+ * @maxLength 100
1013
+ * @maxSize 100
1014
+ */
1015
+ fields?: string[];
1016
+ /** @maxSize 10 */
1017
+ fieldsets?: ContactFieldSet[];
1018
+ }
1019
+ export interface Sorting {
1020
+ /**
1021
+ * Field to sort by.
1022
+ *
1023
+ * Supported properties:
1024
+ * `createdDate`, `lastActivity.activityDate`, `primaryInfo.email`, `info.name.first`, `info.name.last`, `info.company`,
1025
+ * `info.jobTitle`, `info.birthdate`
1026
+ * @maxLength 100
1027
+ */
1028
+ fieldName?: string;
1029
+ /**
1030
+ * Sort order.
1031
+ * Use `ASC` for ascending order or `DESC` for descending order.
1032
+ *
1033
+ * Defaults to `ASC`.
1034
+ */
1035
+ order?: SortOrder;
1036
+ }
1037
+ export declare enum SortOrder {
1038
+ ASC = "ASC",
1039
+ DESC = "DESC"
1040
+ }
1041
+ export interface Paging {
1042
+ /**
1043
+ * Number of items to return. Learn more about pagination in API Query Language([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language)|[REST](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#paging).
1044
+ *
1045
+ * Default: `50`. <br>
1046
+ * Maximum: `1000`.
1047
+ * @max 1000
1048
+ */
1049
+ limit?: number | null;
1050
+ /** Number of items to skip in the current sort order. */
1051
+ offset?: number | null;
1052
+ }
1053
+ export declare enum ContactFieldSet {
1054
+ /** name, primaryEmail, primaryPhone */
1055
+ BASIC = "BASIC",
1056
+ /** name, phones, emails, addresses */
1057
+ COMMUNICATION_DETAILS = "COMMUNICATION_DETAILS",
1058
+ /** name, primaryInfo(email, phone), extendedFields */
1059
+ EXTENDED = "EXTENDED",
1060
+ /** Full contact object */
1061
+ FULL = "FULL"
1062
+ }
1063
+ /** List of contacts. */
1064
+ export interface ListContactsResponse {
1065
+ /** List of contacts. */
1066
+ contacts?: Contact[];
1067
+ /** Details on the paged set of results returned. */
1068
+ pagingMetadata?: PagingMetadata;
1069
+ }
1070
+ export interface PagingMetadata {
1071
+ /** The number of items returned in this response. */
1072
+ count?: number | null;
1073
+ /** The offset which was requested. */
1074
+ offset?: number | null;
1075
+ /** The total number of items that match the query. */
1076
+ total?: number | null;
1077
+ /** A flag that indicates the server failed to calculate 'total' field. */
1078
+ tooManyToCount?: boolean | null;
1079
+ }
1080
+ export interface QueryContactsRequest {
1081
+ /** Query options. */
1082
+ query?: Query;
1083
+ }
1084
+ export interface Query {
1085
+ /**
1086
+ * Filter object.
1087
+ * See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
1088
+ * for more information.
1089
+ *
1090
+ * For a detailed list of supported filters, see
1091
+ * [Supported Filters](https://dev.wix.com/api/rest/contacts/contacts/supported-filters).
1092
+ */
1093
+ filter?: Record<string, any> | null;
1094
+ /**
1095
+ * Sorting options.
1096
+ * See [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination)
1097
+ * for more information.
1098
+ *
1099
+ * Max: 1 sort object
1100
+ * @maxSize 1
1101
+ */
1102
+ sort?: Sorting[];
1103
+ /** Pagination options. */
1104
+ paging?: Paging;
1105
+ /**
1106
+ * List of projected fields to return.
1107
+ * If both `fields` and `fieldsets` are sent in the request,
1108
+ * the union of both lists is returned.
1109
+ * `id` and `revision` are always returned.
1110
+ *
1111
+ * Supported properties:
1112
+ * `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
1113
+ * `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
1114
+ * `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
1115
+ * `info.labelKeys`, `info.locations`, `info.extendedFields`
1116
+ * @maxLength 100
1117
+ * @maxSize 100
1118
+ */
1119
+ fields?: string[];
1120
+ /**
1121
+ * Predefined sets of fields to return.
1122
+ * If both `fields` and `fieldsets` are sent in the request,
1123
+ * the union of both lists is returned.
1124
+ *
1125
+ * - `BASIC`: Returns `id`, `revision`, `primaryInfo`, `info.name`.
1126
+ * - `COMMUNICATION_DETAILS`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.emails`, `info.phones`, `info.addresses`.
1127
+ * - `EXTENDED`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.extendedFields`.
1128
+ * - `FULL`: Returns all fields.
1129
+ *
1130
+ * Default: If `fields` is omitted from the request, `FULL`.
1131
+ * @maxSize 10
1132
+ */
1133
+ fieldsets?: ContactFieldSet[];
1134
+ }
1135
+ /** List of contacts. */
1136
+ export interface QueryContactsResponse {
1137
+ /** List of contacts. */
1138
+ contacts?: Contact[];
1139
+ /** Details on the paged set of results returned. */
1140
+ pagingMetadata?: PagingMetadata;
1141
+ }
1142
+ export interface ListFacetsRequest {
1143
+ /** Pagination options. */
1144
+ paging?: Paging;
1145
+ /**
1146
+ * Language for localization.
1147
+ * @format LANGUAGE
1148
+ */
1149
+ language?: string | null;
1150
+ }
1151
+ export interface ListFacetsResponse {
1152
+ /** List of facets. */
1153
+ facets?: ContactsFacet[];
1154
+ /** Details on the paged set of results returned. */
1155
+ pagingMetadata?: PagingMetadata;
1156
+ }
1157
+ export interface ContactsFacet {
1158
+ /** Type of facet. */
1159
+ facetType?: ContactsFacetType;
1160
+ /**
1161
+ * Scope for facet keys.
1162
+ * When a facet key exists in a namespace,
1163
+ * each key is unique within that namespace.
1164
+ *
1165
+ * Currently, facets not created by Wix are in the `custom` namespace.
1166
+ */
1167
+ namespace?: string | null;
1168
+ /** Human-readable display name. */
1169
+ namespaceDisplayName?: string | null;
1170
+ /** Facet key, automatically generated. */
1171
+ facetKey?: string | null;
1172
+ /** Human-readable name. Shown in the Wix UI. */
1173
+ facetDisplayName?: string | null;
1174
+ /** Number of contacts the facet applies to. */
1175
+ count?: number | null;
1176
+ /** Filter used to query contacts of this facet. */
1177
+ queryFilter?: Record<string, any> | null;
1178
+ }
1179
+ export declare enum ContactsFacetType {
1180
+ UNKNOWN = "UNKNOWN",
1181
+ ALL_CONTACTS = "ALL_CONTACTS",
1182
+ NOT_LABELED = "NOT_LABELED",
1183
+ LABEL = "LABEL",
1184
+ SUBSCRIPTION_STATUS = "SUBSCRIPTION_STATUS",
1185
+ MEMBERSHIP_STATUS = "MEMBERSHIP_STATUS"
1186
+ }
1187
+ export interface QueryFacetsRequest {
1188
+ /** Pagination options. */
1189
+ paging?: Paging;
1190
+ /**
1191
+ * Language for localization.
1192
+ * @format LANGUAGE
1193
+ */
1194
+ language?: string | null;
1195
+ /**
1196
+ * Filterable fields:
1197
+ * - `'info.extendedFields.emailSubscriptions.effectiveEmail'` (`$exists`).
1198
+ * - `'info.extendedFields.emailSubscriptions.subscriptionStatus'` (`$eq`, `$ne`, `$in`, `$nin`).
1199
+ * - `'info.extendedFields.emailSubscriptions.deliverabilityStatus'` (`$eq`, `$ne`, `$in`, `$nin`).
1200
+ */
1201
+ filter?: Record<string, any> | null;
1202
+ }
1203
+ export interface QueryFacetsResponse {
1204
+ /** List of facets. */
1205
+ facets?: ContactsFacet[];
1206
+ /** Details on the paged set of results returned. */
1207
+ pagingMetadata?: PagingMetadata;
1208
+ }
1209
+ export interface BulkDeleteContactsRequest {
1210
+ /**
1211
+ * Filter object.
1212
+ *
1213
+ * Possible filters:
1214
+ * `$eq`, `$exists`, `$gt`, `$gte`, `$hasAll`, `$hasSome`, `$in`, `$lt`, `$lte`, `$ne`, `$startsWith`.
1215
+ *
1216
+ * See [Sort, Filter, and Search](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/contact-v4/sort-filter-and-search)
1217
+ * for a detailed list of supported filters for contact properties, extended fields, and custom fields.
1218
+ *
1219
+ *
1220
+ * Example:
1221
+ * `{ "filter": { "info.name.last": "Smith" } }`
1222
+ */
1223
+ filter?: Record<string, any> | null;
1224
+ /**
1225
+ * Plain text search for an exact match, up to 100 characters.
1226
+ *
1227
+ * Searchable fields:
1228
+ *
1229
+ * - `info.name.first`
1230
+ * - `info.name.last`
1231
+ * - `info.emails.email`
1232
+ * - `info.phones.phone`
1233
+ * @maxLength 100
1234
+ */
1235
+ search?: string | null;
1236
+ }
1237
+ export interface BulkDeleteContactsResponse {
1238
+ /**
1239
+ * Bulk job ID.
1240
+ * The job's status can be retrieved with Get Bulk Job.
1241
+ * @format GUID
1242
+ */
1243
+ jobId?: string;
1244
+ }
1245
+ export interface BulkUpdateContactsRequest {
1246
+ /**
1247
+ * Filter object.
1248
+ *
1249
+ * Possible filters:
1250
+ * `$eq`, `$exists`, `$gt`, `$gte`, `$hasAll`, `$hasSome`, `$in`, `$lt`, `$lte`, `$ne`, `$startsWith`.
1251
+ *
1252
+ * See [Sort, Filter, and Search](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/contact-v4/sort-filter-and-search)
1253
+ * for a detailed list of supported filters for contact properties, extended fields, and custom fields.
1254
+ *
1255
+ *
1256
+ * Example:
1257
+ * `{ "filter": { "info.name.last": "Smith" } }`
1258
+ */
1259
+ filter?: Record<string, any> | null;
1260
+ /**
1261
+ * Plain text search for an exact match, up to 100 characters.
1262
+ *
1263
+ * Searchable fields:
1264
+ *
1265
+ * - `info.name.first`
1266
+ * - `info.name.last`
1267
+ * - `info.emails.email`
1268
+ * - `info.phones.phone`
1269
+ * @maxLength 100
1270
+ */
1271
+ search?: string | null;
1272
+ /** Contact info. */
1273
+ info?: ContactInfo;
1274
+ }
1275
+ export interface BulkUpdateContactsResponse {
1276
+ /**
1277
+ * Bulk job ID.
1278
+ * The job's status can be retrieved with Get Bulk Job.
1279
+ * @format GUID
1280
+ */
1281
+ jobId?: string;
1282
+ }
1283
+ export interface BulkLabelAndUnlabelContactsRequest {
1284
+ /**
1285
+ * Filter options.
1286
+ * Labels will be removed from contacts that meet the `filter` and `search` criteria.
1287
+ *
1288
+ * See
1289
+ * [Field Support for Filtering, Sorting, and Searching](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/contact-v4/sort-filter-and-search)
1290
+ * for a list of supported filters and fields.
1291
+ */
1292
+ filter?: Record<string, any> | null;
1293
+ /**
1294
+ * Plain text search for an exact match, up to 100 characters.
1295
+ * Labels will be removed from contacts that meet the `filter` and `search` criteria.
1296
+ *
1297
+ * See
1298
+ * [Field Support for Filtering, Sorting, and Searching](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/contact-v4/sort-filter-and-search)
1299
+ * for a list of searchable fields.
1300
+ * @maxLength 100
1301
+ */
1302
+ search?: string | null;
1303
+ /**
1304
+ * List of label keys to add to the contacts.
1305
+ *
1306
+ * Label keys must exist to be added to the contact.
1307
+ * Contact labels can be created or retrieved with
1308
+ * [Find or Create Label](https://dev.wix.com/api/rest/contacts/labels/find-or-create-label)
1309
+ * or
1310
+ * [List Labels](https://dev.wix.com/api/rest/contacts/labels/list-labels)
1311
+ * @maxSize 100
1312
+ */
1313
+ labelKeysToAdd?: string[];
1314
+ /**
1315
+ * List of label keys to remove from the contacts.
1316
+ * @maxSize 100
1317
+ */
1318
+ labelKeysToRemove?: string[];
1319
+ }
1320
+ export interface BulkLabelAndUnlabelContactsResponse {
1321
+ /**
1322
+ * Bulk job ID.
1323
+ * The job's status can be retrieved with Get Bulk Job.
1324
+ * @format GUID
1325
+ */
1326
+ jobId?: string;
1327
+ }
1328
+ export interface BulkUpsertContactsRequest {
1329
+ /**
1330
+ * @minSize 1
1331
+ * @maxSize 100
1332
+ */
1333
+ info?: ContactInfo[];
1334
+ returnFullEntity?: boolean;
1335
+ }
1336
+ export interface BulkUpsertContactsResponse {
1337
+ results?: Item[];
1338
+ metadata?: BulkUpsertContactsResponseMetadata;
1339
+ }
1340
+ export declare enum Action {
1341
+ UNKNOWN = "UNKNOWN",
1342
+ UPDATED = "UPDATED",
1343
+ CREATED = "CREATED"
1344
+ }
1345
+ export interface Error {
1346
+ /** Error code. */
1347
+ code?: string;
1348
+ /** Error details. */
1349
+ message?: string | null;
1350
+ }
1351
+ export interface Metadata {
1352
+ _id?: string | null;
1353
+ originalIndex?: number;
1354
+ action?: Action;
1355
+ success?: boolean;
1356
+ error?: Error;
1357
+ }
1358
+ export interface Item {
1359
+ contact?: Contact;
1360
+ metadata?: Metadata;
1361
+ }
1362
+ export interface BulkUpsertContactsResponseMetadata {
1363
+ totalSuccess?: number;
1364
+ totalFailure?: number;
1365
+ totalCreated?: number;
1366
+ totalUpdated?: number;
1367
+ }
1368
+ export interface UpsertContactRequest {
1369
+ info?: ContactInfo;
1370
+ }
1371
+ export interface UpsertContactResponse {
1372
+ /** Upserted contact. */
1373
+ contact?: Contact;
1374
+ action?: UpsertContactResponseAction;
1375
+ }
1376
+ export declare enum UpsertContactResponseAction {
1377
+ UNKNOWN = "UNKNOWN",
1378
+ UPDATED = "UPDATED",
1379
+ CREATED = "CREATED"
1380
+ }
1381
+ export interface GeneratePictureUploadUrlRequest {
1382
+ /**
1383
+ * ID of the contact whose picture is being updated.
1384
+ * @format GUID
1385
+ */
1386
+ contactId?: string;
1387
+ /**
1388
+ * Mime Type. Must be one of:
1389
+ * `image/png`, `image/jpeg`.
1390
+ * Defaults to `image/png`.
1391
+ */
1392
+ mimeType?: string | null;
1393
+ }
1394
+ export interface GeneratePictureUploadUrlResponse {
1395
+ /**
1396
+ * URL to upload the image
1397
+ * @format WEB_URL
1398
+ */
1399
+ uploadUrl?: string;
1400
+ }
1401
+ export interface GetContactRequest {
1402
+ /**
1403
+ * ID of the contact to retrieve.
1404
+ * @format GUID
1405
+ */
1406
+ _id: string;
1407
+ /**
1408
+ * List of projected fields to return.
1409
+ * If both `fields` and `fieldsets` are sent in the request,
1410
+ * the union of both lists is returned.
1411
+ * `id` and `revision` are always returned.
1412
+ *
1413
+ * Supported properties:
1414
+ * `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
1415
+ * `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
1416
+ * `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
1417
+ * `info.labelKeys`, `info.locations`, `info.extendedFields`
1418
+ * @maxLength 100
1419
+ * @maxSize 100
1420
+ */
1421
+ fields?: string[];
1422
+ /**
1423
+ * Predefined sets of fields to return.
1424
+ * If both `fields` and `fieldsets` are sent in the request,
1425
+ * the union of both lists is returned.
1426
+ *
1427
+ * - `BASIC`: Returns `id`, `revision`, `primaryInfo`, `info.name`.
1428
+ * - `COMMUNICATION_DETAILS`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.emails`, `info.phones`, `info.addresses`.
1429
+ * - `EXTENDED`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.extendedFields`.
1430
+ * - `FULL`: Returns all fields.
1431
+ *
1432
+ * Default: If `fields` is omitted from the request, `FULL`.
1433
+ * @maxSize 10
1434
+ */
1435
+ fieldsets?: ContactFieldSet[];
1436
+ }
1437
+ /** The requested contact. */
1438
+ export interface GetContactResponse {
1439
+ /** The requested contact. */
1440
+ contact?: Contact;
1441
+ /** Contact response type. */
1442
+ responseType?: GetContactResponseType;
1443
+ }
1444
+ export declare enum GetContactResponseType {
1445
+ /** The specified contact was returned. */
1446
+ REGULAR = "REGULAR",
1447
+ /** Not used. */
1448
+ IMPLICIT = "IMPLICIT",
1449
+ /** The specified contact was previously merged with another contact and the new contact was returned. */
1450
+ MERGED = "MERGED"
1451
+ }
1452
+ export interface SyncSubmitContactRequest {
1453
+ contactInfo?: ContactInfo;
1454
+ activity?: ContactActivity;
1455
+ passThroughData?: string | null;
1456
+ /** @format GUID */
1457
+ contactId?: string;
1458
+ submitOperation?: SubmitOperation;
1459
+ /** Need to resolve source in allocator, because of server sign */
1460
+ sourceType?: ContactSourceType;
1461
+ sourceId?: string | null;
1462
+ hideFromContactList?: boolean;
1463
+ }
1464
+ export declare enum SubmitOperation {
1465
+ UNKNOWN = "UNKNOWN",
1466
+ CREATE = "CREATE",
1467
+ UPDATE = "UPDATE"
1468
+ }
1469
+ export interface SyncSubmitContactResponse {
1470
+ }
1471
+ export interface CountContactsRequest {
1472
+ }
1473
+ export interface CountContactsResponse {
1474
+ count?: number;
1475
+ }
1476
+ export interface SearchContactsRequest {
1477
+ /** Search object. Encapsulates filter, sorting, paging and other details */
1478
+ search?: Search;
1479
+ }
1480
+ export interface Search extends SearchPagingMethodOneOf {
1481
+ /** Cursor pointing to page of results. 'cursorPaging.cursor' can not be used together with 'filter' or 'sort' */
1482
+ cursorPaging?: CursorPaging;
1483
+ /** A filter object. See documentation [here](https://bo.wix.com/wix-docs/rnd/platformization-guidelines/api-query-language#platformization-guidelines_api-query-language_defining-in-protobuf) */
1484
+ filter?: Record<string, any> | null;
1485
+ /** Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}] */
1486
+ sort?: Sorting[];
1487
+ /**
1488
+ * List of projected fields to return.
1489
+ *
1490
+ * If used in the request,
1491
+ * all the fields contained in `fields` and `fieldsets` are returned.
1492
+ * If left blank, `fieldsets` is used to determine which fields to return.
1493
+ *
1494
+ * For a list of valid projected fields, see
1495
+ * [Valid Contact Projection Fields](https://dev.wix.com/api/rest/contacts/contacts/fieldsets-and-projected-fields#contacts_contacts_fieldsets-and-projected-fields_valid-contact-projection-fields).
1496
+ * @maxLength 100
1497
+ * @maxSize 100
1498
+ */
1499
+ fields?: string[];
1500
+ /**
1501
+ * Predefined sets of fields to return.
1502
+ *
1503
+ * Defaults to `FULL`.
1504
+ * Ignored if left empty when `fields` is used in the request.
1505
+ *
1506
+ * For more information,
1507
+ * see [Contact Fieldsets](https://dev.wix.com/api/rest/contacts/contacts/fieldsets-and-projected-fields#contacts_contacts_fieldsets-and-projected-fields_contact-fieldsets).
1508
+ * @maxSize 10
1509
+ */
1510
+ fieldsets?: string[];
1511
+ /** free text to match in searchable fields */
1512
+ search?: SearchDetails;
1513
+ }
1514
+ /** @oneof */
1515
+ export interface SearchPagingMethodOneOf {
1516
+ /** Cursor pointing to page of results. 'cursorPaging.cursor' can not be used together with 'filter' or 'sort' */
1517
+ cursorPaging?: CursorPaging;
1518
+ }
1519
+ export interface SearchDetails {
1520
+ /** boolean search mode. Default is `OR` */
1521
+ mode?: Mode;
1522
+ /**
1523
+ * search term or expression
1524
+ * @maxLength 100
1525
+ */
1526
+ expression?: string | null;
1527
+ /**
1528
+ * fields to search in. if empty - server will search in own default fieldsDefault searchable fields:
1529
+ *
1530
+ * - `info.name.first`
1531
+ * - `info.name.last`
1532
+ * - `info.emails.email`
1533
+ * - `info.phones.phone`
1534
+ * @maxLength 100
1535
+ * @maxSize 100
1536
+ */
1537
+ fields?: string[];
1538
+ /** flag if should use auto fuzzy search (allowing typos by a managed proximity algorithm) */
1539
+ fuzzy?: boolean;
1540
+ }
1541
+ export declare enum Mode {
1542
+ /** any */
1543
+ OR = "OR",
1544
+ /** all */
1545
+ AND = "AND"
1546
+ }
1547
+ export interface CursorPaging {
1548
+ /**
1549
+ * The number of contacts to load (default = 50, max = 1000)
1550
+ * @max 1000
1551
+ */
1552
+ limit?: number | null;
1553
+ /** Cursor returned in last query response. Should not be provided on first page request */
1554
+ cursor?: string | null;
1555
+ }
1556
+ export interface SearchContactsResponse {
1557
+ /** List of contacts. */
1558
+ contacts?: Contact[];
1559
+ /** Details on the paged set of results returned. */
1560
+ cursorPagingMetadata?: CursorPagingMetadata;
1561
+ }
1562
+ /** This is the preferred message for cursor-paging enabled services */
1563
+ export interface CursorPagingMetadata {
1564
+ /** Number of items returned in the response. */
1565
+ count?: number | null;
1566
+ /** Cursor strings that point to the next page, previous page, or both. */
1567
+ cursors?: Cursors;
1568
+ /**
1569
+ * Whether there are more pages to retrieve following the current page.
1570
+ *
1571
+ * + `true`: Another page of results can be retrieved.
1572
+ * + `false`: This is the last page.
1573
+ */
1574
+ hasNext?: boolean | null;
1575
+ }
1576
+ export interface Cursors {
1577
+ /** Cursor pointing to next result page */
1578
+ next?: string | null;
1579
+ /** Cursor pointing to previous result page */
1580
+ prev?: string | null;
1581
+ }
1582
+ export interface BulkAddSegmentToContactsRequest {
1583
+ /**
1584
+ * Segment id
1585
+ * @format GUID
1586
+ */
1587
+ segmentId?: string;
1588
+ /**
1589
+ * List of Contact ids
1590
+ * @format GUID
1591
+ * @minSize 1
1592
+ * @maxSize 1000
1593
+ */
1594
+ contactIds?: string[];
1595
+ /**
1596
+ * List of existing segment ids
1597
+ * @format GUID
1598
+ * @maxSize 100
1599
+ */
1600
+ existsSegmentIds?: string[];
1601
+ }
1602
+ export interface BulkAddSegmentToContactsResponse {
1603
+ /** List of action results */
1604
+ results?: ItemMetadata[];
1605
+ /** Metadata on the bulk action */
1606
+ bulkActionMetadata?: BulkActionMetadata;
1607
+ }
1608
+ export interface ItemMetadata {
1609
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
1610
+ _id?: string | null;
1611
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
1612
+ originalIndex?: number;
1613
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
1614
+ success?: boolean;
1615
+ /** Details about the error in case of failure. */
1616
+ error?: ApplicationError;
1617
+ }
1618
+ export interface ApplicationError {
1619
+ /** Error code. */
1620
+ code?: string;
1621
+ /** Description of the error. */
1622
+ description?: string;
1623
+ /** Data related to the error. */
1624
+ data?: Record<string, any> | null;
1625
+ }
1626
+ export interface BulkActionMetadata {
1627
+ /** Number of items that were successfully processed. */
1628
+ totalSuccesses?: number;
1629
+ /** Number of items that couldn't be processed. */
1630
+ totalFailures?: number;
1631
+ /** Number of failures without details because detailed failure threshold was exceeded. */
1632
+ undetailedFailures?: number;
1633
+ }
1634
+ export interface ContactAddedToSegment {
1635
+ /** Id of the segment to which the contact was added */
1636
+ segmentId?: string;
1637
+ /** The contact that was added */
1638
+ contact?: Contact;
1639
+ }
1640
+ export interface BulkRemoveSegmentFromContactsRequest {
1641
+ /**
1642
+ * Segment id
1643
+ * @format GUID
1644
+ */
1645
+ segmentId?: string;
1646
+ /**
1647
+ * List of Contact ids
1648
+ * @format GUID
1649
+ * @minSize 1
1650
+ * @maxSize 1000
1651
+ */
1652
+ contactIds?: string[];
1653
+ }
1654
+ export interface BulkRemoveSegmentFromContactsResponse {
1655
+ /** List of action results */
1656
+ results?: ItemMetadata[];
1657
+ /** Metadata on the bulk action */
1658
+ bulkActionMetadata?: BulkActionMetadata;
1659
+ }
1660
+ export interface ContactRemovedFromSegment {
1661
+ /** Id of the segment from which the contact was removed */
1662
+ segmentId?: string;
1663
+ /** The contact that was removed */
1664
+ contact?: Contact;
1665
+ }
1666
+ export interface ListContactIdsBySegmentRequest {
1667
+ /**
1668
+ * Segment id
1669
+ * @format GUID
1670
+ */
1671
+ segmentId?: string;
1672
+ /** Cursor paging. */
1673
+ cursorPaging?: CursorPaging;
1674
+ }
1675
+ export interface ListContactIdsBySegmentResponse {
1676
+ /**
1677
+ * List of contact IDs
1678
+ * @format GUID
1679
+ * @maxSize 1000
1680
+ */
1681
+ contactIds?: string[];
1682
+ /** Paging metadata */
1683
+ cursorPagingMetadata?: CursorPagingMetadata;
1684
+ }
1685
+ export interface DomainEvent extends DomainEventBodyOneOf {
1686
+ createdEvent?: EntityCreatedEvent;
1687
+ updatedEvent?: EntityUpdatedEvent;
1688
+ deletedEvent?: EntityDeletedEvent;
1689
+ actionEvent?: ActionEvent;
1690
+ /**
1691
+ * Unique event ID.
1692
+ * Allows clients to ignore duplicate webhooks.
1693
+ */
1694
+ _id?: string;
1695
+ /**
1696
+ * Assumes actions are also always typed to an entity_type
1697
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
1698
+ */
1699
+ entityFqdn?: string;
1700
+ /**
1701
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
1702
+ * This is although the created/updated/deleted notion is duplication of the oneof types
1703
+ * Example: created/updated/deleted/started/completed/email_opened
1704
+ */
1705
+ slug?: string;
1706
+ /** ID of the entity associated with the event. */
1707
+ entityId?: string;
1708
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1709
+ eventTime?: Date | null;
1710
+ /**
1711
+ * Whether the event was triggered as a result of a privacy regulation application
1712
+ * (for example, GDPR).
1713
+ */
1714
+ triggeredByAnonymizeRequest?: boolean | null;
1715
+ /** If present, indicates the action that triggered the event. */
1716
+ originatedFrom?: string | null;
1717
+ /**
1718
+ * A sequence number defining the order of updates to the underlying entity.
1719
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
1720
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1721
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1722
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
1723
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1724
+ */
1725
+ entityEventSequence?: string | null;
1726
+ }
1727
+ /** @oneof */
1728
+ export interface DomainEventBodyOneOf {
1729
+ createdEvent?: EntityCreatedEvent;
1730
+ updatedEvent?: EntityUpdatedEvent;
1731
+ deletedEvent?: EntityDeletedEvent;
1732
+ actionEvent?: ActionEvent;
1733
+ }
1734
+ export interface EntityCreatedEvent {
1735
+ entity?: string;
1736
+ }
1737
+ export interface RestoreInfo {
1738
+ deletedDate?: Date | null;
1739
+ }
1740
+ export interface EntityUpdatedEvent {
1741
+ /**
1742
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
1743
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
1744
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
1745
+ */
1746
+ currentEntity?: string;
1747
+ }
1748
+ export interface EntityDeletedEvent {
1749
+ /** Entity that was deleted */
1750
+ deletedEntity?: string | null;
1751
+ }
1752
+ export interface ActionEvent {
1753
+ body?: string;
1754
+ }
1755
+ export interface MessageEnvelope {
1756
+ /**
1757
+ * App instance ID.
1758
+ * @format GUID
1759
+ */
1760
+ instanceId?: string | null;
1761
+ /**
1762
+ * Event type.
1763
+ * @maxLength 150
1764
+ */
1765
+ eventType?: string;
1766
+ /** The identification type and identity data. */
1767
+ identity?: IdentificationData;
1768
+ /** Stringify payload. */
1769
+ data?: string;
1770
+ }
1771
+ export interface IdentificationData extends IdentificationDataIdOneOf {
1772
+ /**
1773
+ * ID of a site visitor that has not logged in to the site.
1774
+ * @format GUID
1775
+ */
1776
+ anonymousVisitorId?: string;
1777
+ /**
1778
+ * ID of a site visitor that has logged in to the site.
1779
+ * @format GUID
1780
+ */
1781
+ memberId?: string;
1782
+ /**
1783
+ * ID of a Wix user (site owner, contributor, etc.).
1784
+ * @format GUID
1785
+ */
1786
+ wixUserId?: string;
1787
+ /**
1788
+ * ID of an app.
1789
+ * @format GUID
1790
+ */
1791
+ appId?: string;
1792
+ /** @readonly */
1793
+ identityType?: WebhookIdentityType;
1794
+ }
1795
+ /** @oneof */
1796
+ export interface IdentificationDataIdOneOf {
1797
+ /**
1798
+ * ID of a site visitor that has not logged in to the site.
1799
+ * @format GUID
1800
+ */
1801
+ anonymousVisitorId?: string;
1802
+ /**
1803
+ * ID of a site visitor that has logged in to the site.
1804
+ * @format GUID
1805
+ */
1806
+ memberId?: string;
1807
+ /**
1808
+ * ID of a Wix user (site owner, contributor, etc.).
1809
+ * @format GUID
1810
+ */
1811
+ wixUserId?: string;
1812
+ /**
1813
+ * ID of an app.
1814
+ * @format GUID
1815
+ */
1816
+ appId?: string;
1817
+ }
1818
+ export declare enum WebhookIdentityType {
1819
+ UNKNOWN = "UNKNOWN",
1820
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1821
+ MEMBER = "MEMBER",
1822
+ WIX_USER = "WIX_USER",
1823
+ APP = "APP"
1824
+ }
1825
+ export interface BaseEventMetadata {
1826
+ /**
1827
+ * App instance ID.
1828
+ * @format GUID
1829
+ */
1830
+ instanceId?: string | null;
1831
+ /**
1832
+ * Event type.
1833
+ * @maxLength 150
1834
+ */
1835
+ eventType?: string;
1836
+ /** The identification type and identity data. */
1837
+ identity?: IdentificationData;
1838
+ }
1839
+ export interface EventMetadata extends BaseEventMetadata {
1840
+ /**
1841
+ * Unique event ID.
1842
+ * Allows clients to ignore duplicate webhooks.
1843
+ */
1844
+ _id?: string;
1845
+ /**
1846
+ * Assumes actions are also always typed to an entity_type
1847
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
1848
+ */
1849
+ entityFqdn?: string;
1850
+ /**
1851
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
1852
+ * This is although the created/updated/deleted notion is duplication of the oneof types
1853
+ * Example: created/updated/deleted/started/completed/email_opened
1854
+ */
1855
+ slug?: string;
1856
+ /** ID of the entity associated with the event. */
1857
+ entityId?: string;
1858
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1859
+ eventTime?: Date | null;
1860
+ /**
1861
+ * Whether the event was triggered as a result of a privacy regulation application
1862
+ * (for example, GDPR).
1863
+ */
1864
+ triggeredByAnonymizeRequest?: boolean | null;
1865
+ /** If present, indicates the action that triggered the event. */
1866
+ originatedFrom?: string | null;
1867
+ /**
1868
+ * A sequence number defining the order of updates to the underlying entity.
1869
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
1870
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1871
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1872
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
1873
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1874
+ */
1875
+ entityEventSequence?: string | null;
1876
+ }
1877
+ export interface ContactCreatedEnvelope {
1878
+ entity: Contact;
1879
+ metadata: EventMetadata;
1880
+ }
1881
+ /**
1882
+ * Triggered when a contact is created.
1883
+ * @permissionScope Manage Events
1884
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1885
+ * @permissionScope Manage Challenges
1886
+ * @permissionScopeId SCOPE.CHALLENGES.MANAGE
1887
+ * @permissionScope Read Contacts
1888
+ * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
1889
+ * @permissionScope Read Members and Contacts - all read permissions
1890
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
1891
+ * @permissionScope Manage Restaurants - all permissions
1892
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1893
+ * @permissionScope Manage Contacts
1894
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
1895
+ * @permissionScope Set Up Automations
1896
+ * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
1897
+ * @permissionScope Manage Members and Contacts - all permissions
1898
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
1899
+ * @permissionId CONTACTS.VIEW
1900
+ * @webhook
1901
+ * @eventType wix.contacts.v4.contact_created
1902
+ * @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
1903
+ * @slug created
1904
+ */
1905
+ export declare function onContactCreated(handler: (event: ContactCreatedEnvelope) => void | Promise<void>): void;
1906
+ export interface ContactDeletedEnvelope {
1907
+ metadata: EventMetadata;
1908
+ }
1909
+ /**
1910
+ * Triggered when a contact is deleted.
1911
+ *
1912
+ * If a contact is deleted as part of a merge, the `originatedFrom` property is sent as `merge`.
1913
+ * Otherwise, `originatedFrom` isn't returned.
1914
+ * @permissionScope Manage Events
1915
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1916
+ * @permissionScope Manage Challenges
1917
+ * @permissionScopeId SCOPE.CHALLENGES.MANAGE
1918
+ * @permissionScope Read Contacts
1919
+ * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
1920
+ * @permissionScope Read Members and Contacts - all read permissions
1921
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
1922
+ * @permissionScope Manage Restaurants - all permissions
1923
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1924
+ * @permissionScope Manage Contacts
1925
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
1926
+ * @permissionScope Set Up Automations
1927
+ * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
1928
+ * @permissionScope Manage Members and Contacts - all permissions
1929
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
1930
+ * @permissionId CONTACTS.VIEW
1931
+ * @webhook
1932
+ * @eventType wix.contacts.v4.contact_deleted
1933
+ * @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
1934
+ * @slug deleted
1935
+ */
1936
+ export declare function onContactDeleted(handler: (event: ContactDeletedEnvelope) => void | Promise<void>): void;
1937
+ export interface ContactMergedEnvelope {
1938
+ data: ContactMerged;
1939
+ metadata: EventMetadata;
1940
+ }
1941
+ /**
1942
+ * Triggered when one or more source contacts are merged into a target contact.
1943
+ * @permissionScope Manage Events
1944
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1945
+ * @permissionScope Manage Challenges
1946
+ * @permissionScopeId SCOPE.CHALLENGES.MANAGE
1947
+ * @permissionScope Read Contacts
1948
+ * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
1949
+ * @permissionScope Read Members and Contacts - all read permissions
1950
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
1951
+ * @permissionScope Manage Restaurants - all permissions
1952
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1953
+ * @permissionScope Manage Contacts
1954
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
1955
+ * @permissionScope Set Up Automations
1956
+ * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
1957
+ * @permissionScope Manage Members and Contacts - all permissions
1958
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
1959
+ * @permissionId CONTACTS.VIEW
1960
+ * @webhook
1961
+ * @eventType wix.contacts.v4.contact_merged
1962
+ * @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
1963
+ * @slug merged
1964
+ */
1965
+ export declare function onContactMerged(handler: (event: ContactMergedEnvelope) => void | Promise<void>): void;
1966
+ export interface ContactUpdatedEnvelope {
1967
+ entity: Contact;
1968
+ metadata: EventMetadata;
1969
+ }
1970
+ /**
1971
+ * Triggered when a contact is updated.
1972
+ * @permissionScope Manage Events
1973
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1974
+ * @permissionScope Manage Challenges
1975
+ * @permissionScopeId SCOPE.CHALLENGES.MANAGE
1976
+ * @permissionScope Read Contacts
1977
+ * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
1978
+ * @permissionScope Read Members and Contacts - all read permissions
1979
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
1980
+ * @permissionScope Manage Restaurants - all permissions
1981
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1982
+ * @permissionScope Manage Contacts
1983
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
1984
+ * @permissionScope Set Up Automations
1985
+ * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
1986
+ * @permissionScope Manage Members and Contacts - all permissions
1987
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
1988
+ * @permissionId CONTACTS.VIEW
1989
+ * @webhook
1990
+ * @eventType wix.contacts.v4.contact_updated
1991
+ * @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
1992
+ * @slug updated
1993
+ */
1994
+ export declare function onContactUpdated(handler: (event: ContactUpdatedEnvelope) => void | Promise<void>): void;
1995
+ type ContactNonNullablePaths = `_id` | `revision` | `source.sourceType` | `lastActivity.activityType` | `info.emails.items` | `info.emails.items.${number}.tag` | `info.emails.items.${number}.email` | `info.phones.items` | `info.phones.items.${number}.tag` | `info.phones.items.${number}.phone` | `info.addresses.items` | `info.addresses.items.${number}.tag` | `info.addresses.items.${number}.address.streetAddress.number` | `info.addresses.items.${number}.address.streetAddress.name` | `info.labelKeys.items` | `primaryEmail.subscriptionStatus` | `primaryEmail.deliverabilityStatus` | `primaryPhone.subscriptionStatus`;
1996
+ /**
1997
+ * Creates a new contact.
1998
+ *
1999
+ * The `info` object must include at least one of the following:
2000
+ * - Name
2001
+ * - Phone number
2002
+ * - Email address
2003
+ *
2004
+ * By default, if the call contains an email already in use by another contact,
2005
+ * the new contact won't be created. To override this behavior, set `allowDuplicates` to `true`.
2006
+ * @param info - Contact info.
2007
+ * @public
2008
+ * @requiredField info
2009
+ * @param options - Create contact options.
2010
+ * @permissionId CONTACTS.MODIFY
2011
+ * @permissionScope Manage Contacts
2012
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
2013
+ * @permissionScope Manage Members and Contacts - all permissions
2014
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
2015
+ * @applicableIdentity APP
2016
+ * @returns Contact.
2017
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.CreateContact
2018
+ */
2019
+ export declare function createContact(info: ContactInfo, options?: CreateContactOptions): Promise<NonNullablePaths<CreateContactResponse, {
2020
+ [P in ContactNonNullablePaths]: `contact.${P}`;
2021
+ }[ContactNonNullablePaths]>>;
2022
+ export interface CreateContactOptions {
2023
+ /**
2024
+ * Controls whether the call will succeed
2025
+ * if the new contact information contains an email or a phone number already used by another contact.
2026
+ *
2027
+ * If set to `true`,
2028
+ * the call will succeed even if an email address or phone number is used by another contact.
2029
+ * If set to `false`,
2030
+ * the call will fail if the given email address is used by another contact or,
2031
+ * if the email address is not given and the given phone number is used by another contact.
2032
+ *
2033
+ * Default: `false`
2034
+ */
2035
+ allowDuplicates?: boolean;
2036
+ }
2037
+ /**
2038
+ * Updates a contact.
2039
+ *
2040
+ * Each time the contact is updated,
2041
+ * `revision` increments by 1.
2042
+ * The existing `revision` must be included when updating the contact.
2043
+ * This ensures you're working with the latest contact information,
2044
+ * and it prevents unintended overwrites.
2045
+ *
2046
+ * You can't call Update Contact to update the `primaryEmail` of a contact who is also a member.
2047
+ * Instead, use the Members API to update the member's login email, which will also update the contact's primary email.
2048
+ *
2049
+ * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers. Make sure to specify the contact ID when calling Update Contact.
2050
+ * @param contactId - ID of the contact to update.
2051
+ * @param info - Contact info.
2052
+ * @param revision - Revision number.
2053
+ * When updating, include the existing `revision`
2054
+ * to prevent conflicting updates.
2055
+ * @public
2056
+ * @requiredField contactId
2057
+ * @requiredField info
2058
+ * @requiredField revision
2059
+ * @param options - Contact update options.
2060
+ * @permissionId CONTACTS.MODIFY
2061
+ * @permissionId CONTACTS.MODIFY_MEMBERSHIP_STATUS
2062
+ * @permissionId CONTACTS.MODIFY_MEMBER_PRIMARY_EMAIL_PERMISSION
2063
+ * @permissionScope Manage Contacts
2064
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
2065
+ * @permissionScope Manage Members and Contacts - all permissions
2066
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
2067
+ * @applicableIdentity APP
2068
+ * @returns Updated contact.
2069
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UpdateContact
2070
+ */
2071
+ export declare function updateContact(contactId: string, info: ContactInfo, revision: number, options?: UpdateContactOptions): Promise<NonNullablePaths<UpdateContactResponse, {
2072
+ [P in ContactNonNullablePaths]: `contact.${P}`;
2073
+ }[ContactNonNullablePaths]>>;
2074
+ export interface UpdateContactOptions {
2075
+ /**
2076
+ * Controls whether the call will succeed
2077
+ * if the new contact information contains an email or a phone number already used by another contact.
2078
+ *
2079
+ * If set to `true`,
2080
+ * the call will succeed even if an email address or phone number is used by another contact.
2081
+ * If set to `false`,
2082
+ * the call will fail if the given email address is used by another contact or,
2083
+ * if the email address is not given and the given phone number is used by another contact.
2084
+ *
2085
+ * Default: `false`
2086
+ */
2087
+ allowDuplicates?: boolean;
2088
+ }
2089
+ /**
2090
+ * Merges source contacts into a target contact.
2091
+ *
2092
+ * Merging contacts has the following effects on the target contact:
2093
+ *
2094
+ * - No target contact data is overwritten or deleted.
2095
+ * - Arrays (emails, phone numbers, addresses, and labels) from the source contacts are added to the target contact's arrays.
2096
+ * - If you merge more than one source contact, the 1st source contact specified is added first, then the 2nd, and so on.
2097
+ * - If there is duplicate information between the target contact and the source contact, the information isn't duplicated in the target contact's arrays.
2098
+ *
2099
+ * <blockquote class="important">
2100
+ *
2101
+ * __Important:__
2102
+ * Merges cannot be undone.
2103
+ * In REST, call Preview Merge Contacts to test before merging.
2104
+ *
2105
+ * </blockquote>
2106
+ *
2107
+ * When you merge contacts, source contacts are typically deleted.
2108
+ * However, if a source contact is a site member or a Wix user,
2109
+ * the merge will fail because site members and Wix users can't be deleted.
2110
+ * This means that site members and Wix users can only be specified as target contacts in a merge.
2111
+ *
2112
+ * After merging, calling Get Contact with a deleted source contact ID returns the target contact ID.
2113
+ * Specifying a deleted source contact ID is not supported on any other method.
2114
+ *
2115
+ * When contacts are merged:
2116
+ *
2117
+ * - The Contact Merged event is triggered.
2118
+ * - The Contact Updated event is triggered for the target contact. `originatedFrom` is set to `merge`.
2119
+ * - The Contact Deleted event is triggered for each source contact. `originatedFrom` is set to `merge`.
2120
+ * @param targetContactId - Target contact ID.
2121
+ * @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
2122
+ * To prevent conflicting changes,
2123
+ * the target contact's current `revision` must be specified.
2124
+ * @public
2125
+ * @requiredField targetContactId
2126
+ * @requiredField targetContactRevision
2127
+ * @param options - Merge contacts options.
2128
+ * @permissionId CONTACTS.MERGE
2129
+ * @permissionScope Manage Contacts
2130
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
2131
+ * @permissionScope Manage Members and Contacts - all permissions
2132
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
2133
+ * @applicableIdentity APP
2134
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.MergeContacts
2135
+ */
2136
+ export declare function mergeContacts(targetContactId: string, targetContactRevision: number, options?: MergeContactsOptions): Promise<NonNullablePaths<MergeContactsResponse, {
2137
+ [P in ContactNonNullablePaths]: `contact.${P}`;
2138
+ }[ContactNonNullablePaths]>>;
2139
+ export interface MergeContactsOptions {
2140
+ /**
2141
+ * IDs of up to 5 contacts to merge into the target contact.
2142
+ * When you merge more than one source contact,
2143
+ * the first source is given precedence, then the second, and so on.
2144
+ * @minSize 1
2145
+ * @maxSize 5
2146
+ */
2147
+ sourceContactIds?: string[];
2148
+ }
2149
+ /**
2150
+ * Deletes a contact.
2151
+ *
2152
+ * Deleting a contact permanently removes it from the contact list.
2153
+ * If a contact is also a site member or Wix user, or has a valid billing subscription,
2154
+ * the contact can't be deleted. The related site member or Wix user must first be deleted
2155
+ * and any valid billing subscriptions must be canceled, before the contact can be deleted.
2156
+ *
2157
+ * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
2158
+ * Make sure to specify the contact ID when calling Delete Contact.
2159
+ * @param contactId - ID of the contact to delete.
2160
+ * @public
2161
+ * @requiredField contactId
2162
+ * @permissionId CONTACTS.MODIFY
2163
+ * @permissionId MEMBERS.MEMBER_DELETE
2164
+ * @permissionScope Manage Contacts
2165
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
2166
+ * @permissionScope Manage Members and Contacts - all permissions
2167
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
2168
+ * @permissionScope Manage Members
2169
+ * @permissionScopeId SCOPE.DC-MEMBERS.MANAGE-MEMBERS
2170
+ * @applicableIdentity APP
2171
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.DeleteContact
2172
+ */
2173
+ export declare function deleteContact(contactId: string): Promise<void>;
2174
+ /**
2175
+ * Adds labels to a contact.
2176
+ *
2177
+ * Use the Labels API to create or retrieve labels.
2178
+ *
2179
+ * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
2180
+ * Make sure to specify the contact ID when calling Label Contact.
2181
+ * @param contactId - ID of the contact to add labels to.
2182
+ * @param labelKeys - List of label keys to add to the contact.
2183
+ *
2184
+ * Label keys must exist to be added to the contact.
2185
+ * Use the Labels API to create or retrieve labels.
2186
+ * @public
2187
+ * @requiredField contactId
2188
+ * @requiredField labelKeys
2189
+ * @permissionId CONTACTS.MODIFY
2190
+ * @permissionScope Manage Contacts
2191
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
2192
+ * @permissionScope Manage Members and Contacts - all permissions
2193
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
2194
+ * @applicableIdentity APP
2195
+ * @returns Updated contact.
2196
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.LabelContact
2197
+ */
2198
+ export declare function labelContact(contactId: string, labelKeys: string[]): Promise<NonNullablePaths<LabelContactResponse, {
2199
+ [P in ContactNonNullablePaths]: `contact.${P}`;
2200
+ }[ContactNonNullablePaths]>>;
2201
+ /**
2202
+ * Removes labels from a contact.
2203
+ *
2204
+ * If a label is no longer needed
2205
+ * and you want to remove it from all contacts,
2206
+ * you can delete by calling Delete Label from the Labels API.
2207
+ *
2208
+ * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
2209
+ * Make sure to specify the contact ID when calling Unlabel Contact.
2210
+ * @param contactId - ID of the contact to remove labels from.
2211
+ * @param labelKeys - List of label keys to remove from the contact.
2212
+ * @public
2213
+ * @requiredField contactId
2214
+ * @requiredField labelKeys
2215
+ * @permissionId CONTACTS.MODIFY
2216
+ * @permissionScope Manage Contacts
2217
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
2218
+ * @permissionScope Manage Members and Contacts - all permissions
2219
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
2220
+ * @applicableIdentity APP
2221
+ * @returns Updated contact.
2222
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UnlabelContact
2223
+ */
2224
+ export declare function unlabelContact(contactId: string, labelKeys: string[]): Promise<NonNullablePaths<UnlabelContactResponse, {
2225
+ [P in ContactNonNullablePaths]: `contact.${P}`;
2226
+ }[ContactNonNullablePaths]>>;
2227
+ /**
2228
+ * Creates a query to retrieve a list of contacts.
2229
+ *
2230
+ * The `queryContacts()` function builds a query to retrieve a list of contacts and returns a `ContactsQueryBuilder` object.
2231
+ *
2232
+ * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
2233
+ *
2234
+ * You can refine the query by chaining `ContactsQueryBuilder` functions onto the query. `ContactsQueryBuilder` functions enable you to sort, filter, and control the results `queryContacts()` returns.
2235
+ *
2236
+ * `queryContacts()` runs with these `ContactsQueryBuilder` defaults, which you can override:
2237
+ *
2238
+ * - `skip(0)`
2239
+ * - `limit(50)`
2240
+ * - `descending("_createdDate")`
2241
+ *
2242
+ * The functions that are chained to `queryContacts()` are applied in the order they are called. For example, if you apply `ascending('info.company')` and then `descending('info.name.last')`, the results are sorted first by the company name, and then, if there are multiple results with the same company, the items are sorted by last name.
2243
+ * @public
2244
+ * @param options - Query contact options.
2245
+ * @permissionScope Manage Events
2246
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2247
+ * @permissionScope Manage Challenges
2248
+ * @permissionScopeId SCOPE.CHALLENGES.MANAGE
2249
+ * @permissionScope Read Contacts
2250
+ * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
2251
+ * @permissionScope Read Members and Contacts - all read permissions
2252
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
2253
+ * @permissionScope Manage Restaurants - all permissions
2254
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2255
+ * @permissionScope Manage Contacts
2256
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
2257
+ * @permissionScope Set Up Automations
2258
+ * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
2259
+ * @permissionScope Manage Members and Contacts - all permissions
2260
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
2261
+ * @permissionId CONTACTS.VIEW
2262
+ * @applicableIdentity APP
2263
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.QueryContacts
2264
+ */
2265
+ export declare function queryContacts(options?: QueryContactsOptions): ContactsQueryBuilder;
2266
+ export interface QueryContactsOptions {
2267
+ }
2268
+ interface QueryOffsetResult {
2269
+ currentPage: number | undefined;
2270
+ totalPages: number | undefined;
2271
+ totalCount: number | undefined;
2272
+ hasNext: () => boolean;
2273
+ hasPrev: () => boolean;
2274
+ length: number;
2275
+ pageSize: number;
2276
+ }
2277
+ export interface ContactsQueryResult extends QueryOffsetResult {
2278
+ items: Contact[];
2279
+ query: ContactsQueryBuilder;
2280
+ next: () => Promise<ContactsQueryResult>;
2281
+ prev: () => Promise<ContactsQueryResult>;
2282
+ }
2283
+ export interface ContactsQueryBuilder {
2284
+ /** @param propertyName - Property whose value is compared with `value`.
2285
+ * @param value - Value to compare against.
2286
+ */
2287
+ 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;
2288
+ /** @param propertyName - Property whose value is compared with `value`.
2289
+ * @param value - Value to compare against.
2290
+ */
2291
+ 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;
2292
+ /** @param propertyName - Property whose value is compared with `value`.
2293
+ * @param value - Value to compare against.
2294
+ */
2295
+ ge: (propertyName: '_createdDate' | '_updatedDate' | 'lastActivity.activityDate', value: any) => ContactsQueryBuilder;
2296
+ /** @param propertyName - Property whose value is compared with `value`.
2297
+ * @param value - Value to compare against.
2298
+ */
2299
+ gt: (propertyName: '_createdDate' | '_updatedDate' | 'lastActivity.activityDate', value: any) => ContactsQueryBuilder;
2300
+ /** @param propertyName - Property whose value is compared with `value`.
2301
+ * @param value - Value to compare against.
2302
+ */
2303
+ le: (propertyName: '_createdDate' | '_updatedDate' | 'lastActivity.activityDate', value: any) => ContactsQueryBuilder;
2304
+ /** @param propertyName - Property whose value is compared with `value`.
2305
+ * @param value - Value to compare against.
2306
+ */
2307
+ lt: (propertyName: '_createdDate' | '_updatedDate' | 'lastActivity.activityDate', value: any) => ContactsQueryBuilder;
2308
+ /** @param propertyName - Property whose value is compared with `string`.
2309
+ * @param string - String to compare against. Case-insensitive.
2310
+ */
2311
+ startsWith: (propertyName: 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle', value: string) => ContactsQueryBuilder;
2312
+ /** @param propertyName - Property whose value is compared with `values`.
2313
+ * @param values - List of values to compare against.
2314
+ */
2315
+ hasSome: (propertyName: 'info.labelKeys', value: any[]) => ContactsQueryBuilder;
2316
+ in: (propertyName: '_id' | 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.locale', value: any) => ContactsQueryBuilder;
2317
+ exists: (propertyName: '_id' | 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.locale', value: boolean) => ContactsQueryBuilder;
2318
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
2319
+ ascending: (...propertyNames: Array<'_createdDate' | 'lastActivity.activityDate' | 'primaryInfo.email' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.birthdate'>) => ContactsQueryBuilder;
2320
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
2321
+ descending: (...propertyNames: Array<'_createdDate' | 'lastActivity.activityDate' | 'primaryInfo.email' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.birthdate'>) => ContactsQueryBuilder;
2322
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */
2323
+ limit: (limit: number) => ContactsQueryBuilder;
2324
+ /** @param skip - Number of items to skip in the query results before returning the results. */
2325
+ skip: (skip: number) => ContactsQueryBuilder;
2326
+ find: () => Promise<ContactsQueryResult>;
2327
+ }
2328
+ /**
2329
+ * Retrieves a contact.
2330
+ *
2331
+ * #### Getting Merged Contacts
2332
+ *
2333
+ * When a source contact is merged
2334
+ * with a target contact, the source contact is deleted.
2335
+ * When calling Get Contact for a merged contact,
2336
+ * you can use the source or target contact ID.
2337
+ * In both bases, the target contact is returned.
2338
+ *
2339
+ * This is supported only when calling Get Contact on merged contacts.
2340
+ * Previously deleted source contact IDs can't be used for any other method.
2341
+ * @param _id - ID of the contact to retrieve.
2342
+ * @public
2343
+ * @requiredField _id
2344
+ * @param options - Get contact options.
2345
+ * @permissionId CONTACTS.VIEW
2346
+ * @permissionScope Manage Events
2347
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2348
+ * @permissionScope Manage Challenges
2349
+ * @permissionScopeId SCOPE.CHALLENGES.MANAGE
2350
+ * @permissionScope Read Contacts
2351
+ * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
2352
+ * @permissionScope Read Members and Contacts - all read permissions
2353
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
2354
+ * @permissionScope Manage Restaurants - all permissions
2355
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2356
+ * @permissionScope Manage Contacts
2357
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
2358
+ * @permissionScope Set Up Automations
2359
+ * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
2360
+ * @permissionScope Manage Members and Contacts - all permissions
2361
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
2362
+ * @applicableIdentity APP
2363
+ * @returns The requested contact.
2364
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.GetContact
2365
+ */
2366
+ export declare function getContact(_id: string, options?: GetContactOptions): Promise<NonNullablePaths<Contact, ContactNonNullablePaths>>;
2367
+ export interface GetContactOptions {
2368
+ /**
2369
+ * List of projected fields to return.
2370
+ * If both `fields` and `fieldsets` are sent in the request,
2371
+ * the union of both lists is returned.
2372
+ * `id` and `revision` are always returned.
2373
+ *
2374
+ * Supported properties:
2375
+ * `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
2376
+ * `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
2377
+ * `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
2378
+ * `info.labelKeys`, `info.locations`, `info.extendedFields`
2379
+ * @maxLength 100
2380
+ * @maxSize 100
2381
+ */
2382
+ fields?: string[];
2383
+ /**
2384
+ * Predefined sets of fields to return.
2385
+ * If both `fields` and `fieldsets` are sent in the request,
2386
+ * the union of both lists is returned.
2387
+ *
2388
+ * - `BASIC`: Returns `id`, `revision`, `primaryInfo`, `info.name`.
2389
+ * - `COMMUNICATION_DETAILS`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.emails`, `info.phones`, `info.addresses`.
2390
+ * - `EXTENDED`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.extendedFields`.
2391
+ * - `FULL`: Returns all fields.
2392
+ *
2393
+ * Default: If `fields` is omitted from the request, `FULL`.
2394
+ * @maxSize 10
2395
+ */
2396
+ fieldsets?: ContactFieldSet[];
2397
+ }
2398
+ export {};