@wix/crm 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +4 -1
- package/build/cjs/index.js +5 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.http.d.ts +192 -0
- package/build/cjs/src/contacts-v4-contact.http.js +522 -0
- package/build/cjs/src/contacts-v4-contact.http.js.map +1 -0
- package/build/cjs/src/contacts-v4-contact.public.d.ts +14 -0
- package/build/cjs/src/contacts-v4-contact.public.js +64 -0
- package/build/cjs/src/contacts-v4-contact.public.js.map +1 -0
- package/build/cjs/src/contacts-v4-contact.types.d.ts +1310 -0
- package/build/cjs/src/contacts-v4-contact.types.js +202 -0
- package/build/cjs/src/contacts-v4-contact.types.js.map +1 -0
- package/build/cjs/src/contacts-v4-contact.universal.d.ts +1663 -0
- package/build/cjs/src/contacts-v4-contact.universal.js +903 -0
- package/build/cjs/src/contacts-v4-contact.universal.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.http.d.ts +31 -0
- package/build/cjs/src/contacts-v4-extended-field.http.js +215 -0
- package/build/cjs/src/contacts-v4-extended-field.http.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.public.d.ts +12 -0
- package/build/cjs/src/contacts-v4-extended-field.public.js +40 -0
- package/build/cjs/src/contacts-v4-extended-field.public.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.types.d.ts +257 -0
- package/build/cjs/src/contacts-v4-extended-field.types.js +23 -0
- package/build/cjs/src/contacts-v4-extended-field.types.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.universal.d.ts +476 -0
- package/build/cjs/src/contacts-v4-extended-field.universal.js +393 -0
- package/build/cjs/src/contacts-v4-extended-field.universal.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.http.d.ts +31 -0
- package/build/cjs/src/contacts-v4-label.http.js +191 -0
- package/build/cjs/src/contacts-v4-label.http.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.public.d.ts +11 -0
- package/build/cjs/src/contacts-v4-label.public.js +33 -0
- package/build/cjs/src/contacts-v4-label.public.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.types.d.ts +253 -0
- package/build/cjs/src/contacts-v4-label.types.js +17 -0
- package/build/cjs/src/contacts-v4-label.types.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.universal.d.ts +442 -0
- package/build/cjs/src/contacts-v4-label.universal.js +326 -0
- package/build/cjs/src/contacts-v4-label.universal.js.map +1 -0
- package/build/es/index.d.ts +4 -1
- package/build/es/index.js +4 -1
- package/build/es/index.js.map +1 -1
- package/build/es/src/contacts-v4-contact.http.d.ts +192 -0
- package/build/es/src/contacts-v4-contact.http.js +512 -0
- package/build/es/src/contacts-v4-contact.http.js.map +1 -0
- package/build/es/src/contacts-v4-contact.public.d.ts +14 -0
- package/build/es/src/contacts-v4-contact.public.js +39 -0
- package/build/es/src/contacts-v4-contact.public.js.map +1 -0
- package/build/es/src/contacts-v4-contact.types.d.ts +1310 -0
- package/build/es/src/contacts-v4-contact.types.js +199 -0
- package/build/es/src/contacts-v4-contact.types.js.map +1 -0
- package/build/es/src/contacts-v4-contact.universal.d.ts +1663 -0
- package/build/es/src/contacts-v4-contact.universal.js +874 -0
- package/build/es/src/contacts-v4-contact.universal.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.http.d.ts +31 -0
- package/build/es/src/contacts-v4-extended-field.http.js +207 -0
- package/build/es/src/contacts-v4-extended-field.http.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.public.d.ts +12 -0
- package/build/es/src/contacts-v4-extended-field.public.js +29 -0
- package/build/es/src/contacts-v4-extended-field.public.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.types.d.ts +257 -0
- package/build/es/src/contacts-v4-extended-field.types.js +20 -0
- package/build/es/src/contacts-v4-extended-field.types.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.universal.d.ts +476 -0
- package/build/es/src/contacts-v4-extended-field.universal.js +366 -0
- package/build/es/src/contacts-v4-extended-field.universal.js.map +1 -0
- package/build/es/src/contacts-v4-label.http.d.ts +31 -0
- package/build/es/src/contacts-v4-label.http.js +184 -0
- package/build/es/src/contacts-v4-label.http.js.map +1 -0
- package/build/es/src/contacts-v4-label.public.d.ts +11 -0
- package/build/es/src/contacts-v4-label.public.js +24 -0
- package/build/es/src/contacts-v4-label.public.js.map +1 -0
- package/build/es/src/contacts-v4-label.types.d.ts +253 -0
- package/build/es/src/contacts-v4-label.types.js +14 -0
- package/build/es/src/contacts-v4-label.types.js.map +1 -0
- package/build/es/src/contacts-v4-label.universal.d.ts +442 -0
- package/build/es/src/contacts-v4-label.universal.js +300 -0
- package/build/es/src/contacts-v4-label.universal.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,1310 @@
|
|
|
1
|
+
export interface Contact {
|
|
2
|
+
/**
|
|
3
|
+
* Contact ID.
|
|
4
|
+
* @readonly
|
|
5
|
+
*/
|
|
6
|
+
id?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Revision number, which increments by 1 each time the contact is updated.
|
|
9
|
+
* To prevent conflicting changes,
|
|
10
|
+
* the existing `revision` must be used when updating a contact.
|
|
11
|
+
* @readonly
|
|
12
|
+
*/
|
|
13
|
+
revision?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Details about the contact's source.
|
|
16
|
+
* @readonly
|
|
17
|
+
*/
|
|
18
|
+
source?: ContactSource;
|
|
19
|
+
/**
|
|
20
|
+
* Date and time the contact was created.
|
|
21
|
+
* @readonly
|
|
22
|
+
*/
|
|
23
|
+
createdDate?: Date;
|
|
24
|
+
/**
|
|
25
|
+
* Date and time the contact was last updated.
|
|
26
|
+
* @readonly
|
|
27
|
+
*/
|
|
28
|
+
updatedDate?: Date;
|
|
29
|
+
/**
|
|
30
|
+
* Details about the contact's last action in the site.
|
|
31
|
+
* @readonly
|
|
32
|
+
*/
|
|
33
|
+
lastActivity?: ContactActivity;
|
|
34
|
+
/**
|
|
35
|
+
* Contact's primary phone and email.
|
|
36
|
+
* @readonly
|
|
37
|
+
*/
|
|
38
|
+
primaryInfo?: PrimaryContactInfo;
|
|
39
|
+
/**
|
|
40
|
+
* Contact's profile picture.
|
|
41
|
+
* This can contain an image URL and a Wix Media image ID.
|
|
42
|
+
*
|
|
43
|
+
* > **Deprecation Notice:**
|
|
44
|
+
* > This property has been replaced with
|
|
45
|
+
* > `info.picture`
|
|
46
|
+
* > and will be removed on March 31, 2022. If your app uses this property,
|
|
47
|
+
* > we recommend updating your code as soon as possible.
|
|
48
|
+
* @readonly
|
|
49
|
+
*/
|
|
50
|
+
picture?: Image;
|
|
51
|
+
/** Contact's details. */
|
|
52
|
+
info?: ContactInfo;
|
|
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 a Wix app.
|
|
62
|
+
*
|
|
63
|
+
* > **Deprecation Notice:**
|
|
64
|
+
* > This property has been replaced with
|
|
65
|
+
* > `appId`
|
|
66
|
+
* > and will be removed on March 31, 2022. If your app uses this property,
|
|
67
|
+
* > we recommend updating your code as soon as possible.
|
|
68
|
+
* @readonly
|
|
69
|
+
*/
|
|
70
|
+
wixAppId?: string | null;
|
|
71
|
+
/**
|
|
72
|
+
* App ID, if the contact was created by an app.
|
|
73
|
+
* @readonly
|
|
74
|
+
*/
|
|
75
|
+
appId?: string | null;
|
|
76
|
+
}
|
|
77
|
+
export declare enum ContactSourceType {
|
|
78
|
+
OTHER = "OTHER",
|
|
79
|
+
ADMIN = "ADMIN",
|
|
80
|
+
WIX_APP = "WIX_APP",
|
|
81
|
+
IMPORT = "IMPORT",
|
|
82
|
+
THIRD_PARTY = "THIRD_PARTY",
|
|
83
|
+
WIX_BOOKINGS = "WIX_BOOKINGS",
|
|
84
|
+
WIX_CHAT = "WIX_CHAT",
|
|
85
|
+
WIX_EMAIL_MARKETING = "WIX_EMAIL_MARKETING",
|
|
86
|
+
WIX_EVENTS = "WIX_EVENTS",
|
|
87
|
+
WIX_FORMS = "WIX_FORMS",
|
|
88
|
+
WIX_GROUPS = "WIX_GROUPS",
|
|
89
|
+
WIX_HOTELS = "WIX_HOTELS",
|
|
90
|
+
WIX_MARKET_PLACE = "WIX_MARKET_PLACE",
|
|
91
|
+
WIX_MUSIC = "WIX_MUSIC",
|
|
92
|
+
WIX_RESTAURANTS = "WIX_RESTAURANTS",
|
|
93
|
+
WIX_SITE_MEMBERS = "WIX_SITE_MEMBERS",
|
|
94
|
+
WIX_STORES = "WIX_STORES",
|
|
95
|
+
WIX_CODE = "WIX_CODE"
|
|
96
|
+
}
|
|
97
|
+
export interface ContactActivity {
|
|
98
|
+
/** Date and time of the last action. */
|
|
99
|
+
activityDate?: Date;
|
|
100
|
+
/**
|
|
101
|
+
* Contact's last action in the site.
|
|
102
|
+
*
|
|
103
|
+
* For descriptions of each value, see
|
|
104
|
+
* [Last Activity Types](https://dev.wix.com/api/rest/contacts/contacts/last-activity-types).
|
|
105
|
+
*/
|
|
106
|
+
activityType?: ContactActivityType;
|
|
107
|
+
}
|
|
108
|
+
export declare enum ContactActivityType {
|
|
109
|
+
/** Last visit to your site (any unknown activity) */
|
|
110
|
+
GENERAL = "GENERAL",
|
|
111
|
+
/** This cannot be reported, used when contact created, will throw exception */
|
|
112
|
+
CONTACT_CREATED = "CONTACT_CREATED",
|
|
113
|
+
/** "auth/login" */
|
|
114
|
+
MEMBER_LOGIN = "MEMBER_LOGIN",
|
|
115
|
+
/** "auth/register" */
|
|
116
|
+
MEMBER_REGISTER = "MEMBER_REGISTER",
|
|
117
|
+
/** "auth/status-change" */
|
|
118
|
+
MEMBER_STATUS_CHANGED = "MEMBER_STATUS_CHANGED",
|
|
119
|
+
/** "contact/contact-form", (but also "form/contact-form", "form/form") */
|
|
120
|
+
FORM_SUBMITTED = "FORM_SUBMITTED",
|
|
121
|
+
/** "form/lead-capture-form" */
|
|
122
|
+
INBOX_FORM_SUBMITTED = "INBOX_FORM_SUBMITTED",
|
|
123
|
+
/** "chat/payment-request-paid" */
|
|
124
|
+
INBOX_PAYMENT_REQUEST_PAID = "INBOX_PAYMENT_REQUEST_PAID",
|
|
125
|
+
/** "messaging/email" - Direction BUSINESS_TO_CUSTOMER */
|
|
126
|
+
INBOX_MESSAGE_TO_CUSTOMER = "INBOX_MESSAGE_TO_CUSTOMER",
|
|
127
|
+
/** "messaging/email" - Direction CUSTOMER_TO_BUSINESS */
|
|
128
|
+
INBOX_MESSAGE_FROM_CUSTOMER = "INBOX_MESSAGE_FROM_CUSTOMER",
|
|
129
|
+
/** "contact/subscription-form" (but also "form/subscription-form") */
|
|
130
|
+
NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED = "NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED",
|
|
131
|
+
/** "contact/unsubscribe" */
|
|
132
|
+
NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE = "NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE",
|
|
133
|
+
/** "e_commerce/purchase" */
|
|
134
|
+
ECOM_PURCHASE = "ECOM_PURCHASE",
|
|
135
|
+
/** "e_commerce/cart-abandon" */
|
|
136
|
+
ECOM_CART_ABANDON = "ECOM_CART_ABANDON",
|
|
137
|
+
/** "e_commerce/checkout-buyer" */
|
|
138
|
+
ECOM_CHECKOUT_BUYER = "ECOM_CHECKOUT_BUYER",
|
|
139
|
+
/** "scheduler/appointment" */
|
|
140
|
+
BOOKINGS_APPOINTMENT = "BOOKINGS_APPOINTMENT",
|
|
141
|
+
/** "hotels/reservation" */
|
|
142
|
+
HOTELS_RESERVATION = "HOTELS_RESERVATION",
|
|
143
|
+
/** "hotels/purchase" */
|
|
144
|
+
HOTELS_PURCHASE = "HOTELS_PURCHASE",
|
|
145
|
+
/** "hotels/confirmation" */
|
|
146
|
+
HOTELS_CONFIRMATION = "HOTELS_CONFIRMATION",
|
|
147
|
+
/** "hotels/cancel" */
|
|
148
|
+
HOTELS_CANCEL = "HOTELS_CANCEL",
|
|
149
|
+
/** "video/purchase" */
|
|
150
|
+
VIDEO_PURCHASE = "VIDEO_PURCHASE",
|
|
151
|
+
/** "video/rent" */
|
|
152
|
+
VIDEO_RENT = "VIDEO_RENT",
|
|
153
|
+
/** "cashier/button_purchase" */
|
|
154
|
+
CASHIER_BUTTON_PURCHASE = "CASHIER_BUTTON_PURCHASE",
|
|
155
|
+
/** "arena/new-lead" */
|
|
156
|
+
ARENA_NEW_LEAD = "ARENA_NEW_LEAD",
|
|
157
|
+
/** "events/rsvp" */
|
|
158
|
+
EVENTS_RSVP = "EVENTS_RSVP",
|
|
159
|
+
/** "invoice/pay" */
|
|
160
|
+
INVOICE_PAY = "INVOICE_PAY",
|
|
161
|
+
/** "invoice/overdue" */
|
|
162
|
+
INVOICE_OVERDUE = "INVOICE_OVERDUE",
|
|
163
|
+
/** "price-quote/accept" */
|
|
164
|
+
PRICE_QUOTE_ACCEPT = "PRICE_QUOTE_ACCEPT",
|
|
165
|
+
/** "price-quote/expire" */
|
|
166
|
+
PRICE_QUOTE_EXPIRE = "PRICE_QUOTE_EXPIRE",
|
|
167
|
+
/** "restaurants/order" */
|
|
168
|
+
RESTAURANTS_ORDER = "RESTAURANTS_ORDER",
|
|
169
|
+
/** "restaurants/reservation" */
|
|
170
|
+
RESTAURANTS_RESERVATION = "RESTAURANTS_RESERVATION",
|
|
171
|
+
/** "shoutout/open" */
|
|
172
|
+
SHOUTOUT_OPEN = "SHOUTOUT_OPEN",
|
|
173
|
+
/** "shoutout/click" */
|
|
174
|
+
SHOUTOUT_CLICK = "SHOUTOUT_CLICK",
|
|
175
|
+
CONTACT_MERGED = "CONTACT_MERGED"
|
|
176
|
+
}
|
|
177
|
+
export interface PrimaryContactInfo {
|
|
178
|
+
/**
|
|
179
|
+
* Primary email address.
|
|
180
|
+
*
|
|
181
|
+
* This property reflects the email address in `info.emails`
|
|
182
|
+
* where `primary` is `true`.
|
|
183
|
+
* @readonly
|
|
184
|
+
*/
|
|
185
|
+
email?: string | null;
|
|
186
|
+
/**
|
|
187
|
+
* Primary phone number.
|
|
188
|
+
*
|
|
189
|
+
* This property reflects the phone number in `info.phones`
|
|
190
|
+
* where `primary` is `true`.
|
|
191
|
+
* @readonly
|
|
192
|
+
*/
|
|
193
|
+
phone?: string | null;
|
|
194
|
+
}
|
|
195
|
+
export interface Image {
|
|
196
|
+
/**
|
|
197
|
+
* WixMedia image ID.
|
|
198
|
+
* This property is written by Wix when an image is uploaded to the Wix Media Manager.
|
|
199
|
+
*/
|
|
200
|
+
id?: string;
|
|
201
|
+
/** Image source: Either a Media Manager URL or external URL. */
|
|
202
|
+
url?: string;
|
|
203
|
+
/** Height of the original image. */
|
|
204
|
+
height?: number;
|
|
205
|
+
/** Width of the original image. */
|
|
206
|
+
width?: number;
|
|
207
|
+
/** Image alt text. Optional. */
|
|
208
|
+
altText?: string | null;
|
|
209
|
+
/**
|
|
210
|
+
* Image URL expiration date (when relevant). Optional
|
|
211
|
+
* @readonly
|
|
212
|
+
*/
|
|
213
|
+
urlExpirationDate?: Date;
|
|
214
|
+
}
|
|
215
|
+
export interface ContactInfo {
|
|
216
|
+
/** Contact's first and last name. */
|
|
217
|
+
name?: ContactName;
|
|
218
|
+
/** Contact's email addresses. */
|
|
219
|
+
emails?: ContactEmailsWrapper;
|
|
220
|
+
/** Contact's phone numbers. */
|
|
221
|
+
phones?: ContactPhonesWrapper;
|
|
222
|
+
/** Contact's street addresses. */
|
|
223
|
+
addresses?: ContactAddressesWrapper;
|
|
224
|
+
/** Contact's company name. */
|
|
225
|
+
company?: string | null;
|
|
226
|
+
/**
|
|
227
|
+
* Contact's job title.
|
|
228
|
+
* Corresponds to the **Position** field in the Dashboard.
|
|
229
|
+
*/
|
|
230
|
+
jobTitle?: string | null;
|
|
231
|
+
/** Birth date in `YYYY-MM-DD` format. For example, `2020-03-15`. */
|
|
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
|
+
*/
|
|
240
|
+
locale?: string | null;
|
|
241
|
+
/**
|
|
242
|
+
* List of contact's labels.
|
|
243
|
+
* Labels are used to organize contacts.
|
|
244
|
+
* When setting the `labelKeys` property,
|
|
245
|
+
* only labels that already exist in the site's Contacts List can be used.
|
|
246
|
+
* Labels can be added and removed using
|
|
247
|
+
* [Label Contact](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/label-contact) and
|
|
248
|
+
* [Unlabel Contact](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/unlabel-contact),
|
|
249
|
+
* respectively.
|
|
250
|
+
*
|
|
251
|
+
* To view or manage site labels, use the
|
|
252
|
+
* [Labels API](https://dev.wix.com/api/rest/contacts/labels).
|
|
253
|
+
*/
|
|
254
|
+
labelKeys?: LabelsWrapper;
|
|
255
|
+
/**
|
|
256
|
+
* Additional custom fields.
|
|
257
|
+
* This includes fields managed by Wix, by 3rd-party apps, and by the site.
|
|
258
|
+
*
|
|
259
|
+
* Empty fields are not returned.
|
|
260
|
+
*/
|
|
261
|
+
extendedFields?: ExtendedFieldsWrapper;
|
|
262
|
+
/** Contact's profile picture. */
|
|
263
|
+
picture?: ContactPicture;
|
|
264
|
+
}
|
|
265
|
+
export interface ContactName {
|
|
266
|
+
/** Contact's first name. */
|
|
267
|
+
first?: string | null;
|
|
268
|
+
/** Contact's last name. */
|
|
269
|
+
last?: string | null;
|
|
270
|
+
}
|
|
271
|
+
export interface ContactEmailsWrapper {
|
|
272
|
+
/** List of up to 50 email addresses. */
|
|
273
|
+
items?: ContactEmail[];
|
|
274
|
+
}
|
|
275
|
+
export interface ContactEmail {
|
|
276
|
+
/**
|
|
277
|
+
* Email ID.
|
|
278
|
+
* @readonly
|
|
279
|
+
*/
|
|
280
|
+
id?: string | null;
|
|
281
|
+
/**
|
|
282
|
+
* Email type.
|
|
283
|
+
*
|
|
284
|
+
* `UNTAGGED` is shown as "Other" in the Contact List.
|
|
285
|
+
*/
|
|
286
|
+
tag?: EmailTag;
|
|
287
|
+
/** Email address. */
|
|
288
|
+
email?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Indicates whether this is the contact's primary email address.
|
|
291
|
+
* When changing `primary` to `true` for an email,
|
|
292
|
+
* the contact's other emails become `false`.
|
|
293
|
+
*/
|
|
294
|
+
primary?: boolean | null;
|
|
295
|
+
}
|
|
296
|
+
export declare enum EmailTag {
|
|
297
|
+
UNTAGGED = "UNTAGGED",
|
|
298
|
+
MAIN = "MAIN",
|
|
299
|
+
HOME = "HOME",
|
|
300
|
+
WORK = "WORK"
|
|
301
|
+
}
|
|
302
|
+
export interface ContactPhonesWrapper {
|
|
303
|
+
/** List of up to 50 phone numbers. */
|
|
304
|
+
items?: ContactPhone[];
|
|
305
|
+
}
|
|
306
|
+
export interface ContactPhone {
|
|
307
|
+
/**
|
|
308
|
+
* Phone ID.
|
|
309
|
+
* @readonly
|
|
310
|
+
*/
|
|
311
|
+
id?: string | null;
|
|
312
|
+
/**
|
|
313
|
+
* Phone type.
|
|
314
|
+
*
|
|
315
|
+
* `UNTAGGED` is shown as "Other" in the Contact List.
|
|
316
|
+
*/
|
|
317
|
+
tag?: PhoneTag;
|
|
318
|
+
/** [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. */
|
|
319
|
+
countryCode?: string | null;
|
|
320
|
+
/** Phone number. */
|
|
321
|
+
phone?: string;
|
|
322
|
+
/**
|
|
323
|
+
* [ITU E.164-formatted](https://www.itu.int/rec/T-REC-E.164/)
|
|
324
|
+
* phone number.
|
|
325
|
+
* Automatically generated using `phone` and `countryCode`,
|
|
326
|
+
* as long as both of those values are valid.
|
|
327
|
+
* @readonly
|
|
328
|
+
*/
|
|
329
|
+
e164Phone?: string | null;
|
|
330
|
+
/**
|
|
331
|
+
* Whether this is the contact's primary phone number.
|
|
332
|
+
* When changing `primary` to `true` for a phone,
|
|
333
|
+
* the contact's other phones become `false`.
|
|
334
|
+
*/
|
|
335
|
+
primary?: boolean | null;
|
|
336
|
+
}
|
|
337
|
+
export declare enum PhoneTag {
|
|
338
|
+
UNTAGGED = "UNTAGGED",
|
|
339
|
+
MAIN = "MAIN",
|
|
340
|
+
HOME = "HOME",
|
|
341
|
+
MOBILE = "MOBILE",
|
|
342
|
+
WORK = "WORK",
|
|
343
|
+
FAX = "FAX"
|
|
344
|
+
}
|
|
345
|
+
export interface ContactAddressesWrapper {
|
|
346
|
+
/** List of up to 50 addresses. */
|
|
347
|
+
items?: ContactAddress[];
|
|
348
|
+
}
|
|
349
|
+
export interface ContactAddress {
|
|
350
|
+
/**
|
|
351
|
+
* Street address ID.
|
|
352
|
+
* @readonly
|
|
353
|
+
*/
|
|
354
|
+
id?: string | null;
|
|
355
|
+
/**
|
|
356
|
+
* Address type.
|
|
357
|
+
* `UNTAGGED` is shown as "Other" in the Contact List.
|
|
358
|
+
*/
|
|
359
|
+
tag?: AddressTag;
|
|
360
|
+
/** Street address. */
|
|
361
|
+
address?: Address;
|
|
362
|
+
}
|
|
363
|
+
export declare enum AddressTag {
|
|
364
|
+
UNTAGGED = "UNTAGGED",
|
|
365
|
+
HOME = "HOME",
|
|
366
|
+
WORK = "WORK",
|
|
367
|
+
BILLING = "BILLING",
|
|
368
|
+
SHIPPING = "SHIPPING"
|
|
369
|
+
}
|
|
370
|
+
/** Physical address */
|
|
371
|
+
export interface Address extends AddressStreetOneOf {
|
|
372
|
+
/** Street address object, with number and name in separate fields. */
|
|
373
|
+
streetAddress?: StreetAddress;
|
|
374
|
+
/** Main address line, usually street and number, as free text. */
|
|
375
|
+
addressLine?: string | null;
|
|
376
|
+
/**
|
|
377
|
+
* 2-letter country code in an
|
|
378
|
+
* [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
|
|
379
|
+
*/
|
|
380
|
+
country?: string | null;
|
|
381
|
+
/**
|
|
382
|
+
* Code for a subdivision (such as state, prefecture, or province) in an
|
|
383
|
+
* [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.
|
|
384
|
+
*/
|
|
385
|
+
subdivision?: string | null;
|
|
386
|
+
/** City name. */
|
|
387
|
+
city?: string | null;
|
|
388
|
+
/** Postal or zip code. */
|
|
389
|
+
postalCode?: string | null;
|
|
390
|
+
/**
|
|
391
|
+
* Free text providing more detailed address information,
|
|
392
|
+
* such as apartment, suite, or floor.
|
|
393
|
+
*/
|
|
394
|
+
addressLine2?: string | null;
|
|
395
|
+
}
|
|
396
|
+
/** @oneof */
|
|
397
|
+
export interface AddressStreetOneOf {
|
|
398
|
+
/** Street address object, with number and name in separate fields. */
|
|
399
|
+
streetAddress?: StreetAddress;
|
|
400
|
+
/** Main address line, usually street and number, as free text. */
|
|
401
|
+
addressLine?: string | null;
|
|
402
|
+
}
|
|
403
|
+
export interface StreetAddress {
|
|
404
|
+
/** Street number. */
|
|
405
|
+
number?: string;
|
|
406
|
+
/** Street name. */
|
|
407
|
+
name?: string;
|
|
408
|
+
}
|
|
409
|
+
export interface AddressLocation {
|
|
410
|
+
/** Address's latitude. */
|
|
411
|
+
latitude?: number | null;
|
|
412
|
+
/** Address's longitude. */
|
|
413
|
+
longitude?: number | null;
|
|
414
|
+
}
|
|
415
|
+
export interface Subdivision {
|
|
416
|
+
/** subdivision short code */
|
|
417
|
+
code?: string;
|
|
418
|
+
/** Full subdivision name. */
|
|
419
|
+
name?: string;
|
|
420
|
+
}
|
|
421
|
+
export declare enum SubdivisionType {
|
|
422
|
+
UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
|
|
423
|
+
/** state */
|
|
424
|
+
ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
|
|
425
|
+
/** county */
|
|
426
|
+
ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
|
|
427
|
+
/** cities/towns */
|
|
428
|
+
ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
|
|
429
|
+
/** neighborhood/quarter */
|
|
430
|
+
ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
|
|
431
|
+
/** street/block */
|
|
432
|
+
ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
|
|
433
|
+
/** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
434
|
+
COUNTRY = "COUNTRY"
|
|
435
|
+
}
|
|
436
|
+
export interface AssigneesWrapper {
|
|
437
|
+
/** List of site contributor user IDs. */
|
|
438
|
+
items?: string[];
|
|
439
|
+
}
|
|
440
|
+
export interface LabelsWrapper {
|
|
441
|
+
/**
|
|
442
|
+
* List of contact label keys.
|
|
443
|
+
* [Contact labels](https://support.wix.com/en/article/adding-labels-to-contacts-in-your-contact-list)
|
|
444
|
+
* help categorize contacts.
|
|
445
|
+
*
|
|
446
|
+
* Label keys must exist to be added to the contact.
|
|
447
|
+
* Contact labels can be created or retrieved with
|
|
448
|
+
* [Find or Create Label](https://dev.wix.com/api/rest/contacts/labels/find-or-create-label)
|
|
449
|
+
* or
|
|
450
|
+
* [List Labels](https://dev.wix.com/api/rest/contacts/labels/list-labels)
|
|
451
|
+
*/
|
|
452
|
+
items?: string[];
|
|
453
|
+
}
|
|
454
|
+
export interface ExtendedFieldsWrapper {
|
|
455
|
+
/**
|
|
456
|
+
* Contact's extended fields,
|
|
457
|
+
* where each key is the field key,
|
|
458
|
+
* and each value is the field's value for the contact.
|
|
459
|
+
*
|
|
460
|
+
* To view and manage extended fields, use the
|
|
461
|
+
* [Extended Fields API](https://dev.wix.com/api/rest/contacts/extended-fields).
|
|
462
|
+
*/
|
|
463
|
+
items?: Record<string, any>;
|
|
464
|
+
}
|
|
465
|
+
export interface LocationsWrapper {
|
|
466
|
+
/** List of location ids. */
|
|
467
|
+
items?: string[];
|
|
468
|
+
}
|
|
469
|
+
/** TEST contact picture description */
|
|
470
|
+
export interface ContactPicture {
|
|
471
|
+
/**
|
|
472
|
+
* Image.
|
|
473
|
+
* This can contain an image URL or a Wix Media image ID.
|
|
474
|
+
*/
|
|
475
|
+
image?: Image;
|
|
476
|
+
}
|
|
477
|
+
export declare enum ImageProvider {
|
|
478
|
+
UNKNOWN = "UNKNOWN",
|
|
479
|
+
/** Image stored outside Wix */
|
|
480
|
+
EXTERNAL = "EXTERNAL",
|
|
481
|
+
/** Stored in wix media platform, Must be uploaded by using `GeneratePictureUploadUrl` */
|
|
482
|
+
WIX_MEDIA = "WIX_MEDIA"
|
|
483
|
+
}
|
|
484
|
+
export interface SegmentsWrapper {
|
|
485
|
+
/** List of Contact segment IDs */
|
|
486
|
+
items?: string[];
|
|
487
|
+
}
|
|
488
|
+
export interface EstimateFilterSizeRequest {
|
|
489
|
+
/** Contacts filter expression. */
|
|
490
|
+
filter?: Record<string, any> | null;
|
|
491
|
+
/** Should "inactive" contacts be excluded or not (default value "false"). */
|
|
492
|
+
activeContactsOnly?: boolean;
|
|
493
|
+
/** Contacts plain text search expression (searches in name, phone and email fields). */
|
|
494
|
+
search?: string | null;
|
|
495
|
+
}
|
|
496
|
+
export interface EstimateFilterSizeResponse {
|
|
497
|
+
/** Mailing list size estimation. */
|
|
498
|
+
estimation?: number;
|
|
499
|
+
}
|
|
500
|
+
export interface EstimateAudienceSizeRequest {
|
|
501
|
+
/** Contact IDs of a campaign audience. */
|
|
502
|
+
contactIds?: string[];
|
|
503
|
+
/** Label IDs of a campaign audience. */
|
|
504
|
+
labelIds?: string[];
|
|
505
|
+
/** Contacts filter expression (json). */
|
|
506
|
+
contactsFilter?: Record<string, any> | null;
|
|
507
|
+
/** Contacts plain text search expression (searches in name, phone and email fields). */
|
|
508
|
+
search?: string | null;
|
|
509
|
+
/** Segment ids of a campaign audience. */
|
|
510
|
+
segmentIds?: string[];
|
|
511
|
+
/** Should "inactive" contacts be excluded or not (default value "false"). */
|
|
512
|
+
activeContactsOnly?: boolean;
|
|
513
|
+
/** Id of a campaign that is to be resent. */
|
|
514
|
+
resendCampaignId?: string | null;
|
|
515
|
+
}
|
|
516
|
+
export interface EstimateAudienceSizeResponse {
|
|
517
|
+
/** Audience size estimation. */
|
|
518
|
+
estimation?: number;
|
|
519
|
+
}
|
|
520
|
+
export interface ContactSubmitted {
|
|
521
|
+
/** Pass through data, submitted with the contact */
|
|
522
|
+
passThroughData?: string | null;
|
|
523
|
+
/** Submitted activity */
|
|
524
|
+
activity?: ContactActivity;
|
|
525
|
+
/** Submitted Contact (after processing) */
|
|
526
|
+
contact?: Contact;
|
|
527
|
+
}
|
|
528
|
+
export interface ContactChanged {
|
|
529
|
+
/** The Contact before the changes */
|
|
530
|
+
previousContact?: Contact;
|
|
531
|
+
/** The Contact after the changes */
|
|
532
|
+
currentContact?: Contact;
|
|
533
|
+
}
|
|
534
|
+
/** Contact creation options. */
|
|
535
|
+
export interface CreateContactRequest {
|
|
536
|
+
/** Contact info. */
|
|
537
|
+
info: ContactInfo;
|
|
538
|
+
/**
|
|
539
|
+
* Controls whether the call will succeed
|
|
540
|
+
* if the new contact information contains an email or a phone number already used by another contact.
|
|
541
|
+
*
|
|
542
|
+
* If set to `true`,
|
|
543
|
+
* the call will succeed even if an email address or phone number is used by another contact.
|
|
544
|
+
* If set to `false`,
|
|
545
|
+
* the call will fail if the given email address is used by another contact or,
|
|
546
|
+
* if the email address is not given and the given phone number is used by another contact.
|
|
547
|
+
*
|
|
548
|
+
* Defaults to `false`.
|
|
549
|
+
*/
|
|
550
|
+
allowDuplicates?: boolean;
|
|
551
|
+
}
|
|
552
|
+
/** Contact. */
|
|
553
|
+
export interface CreateContactResponse {
|
|
554
|
+
/** Contact. */
|
|
555
|
+
contact?: Contact;
|
|
556
|
+
}
|
|
557
|
+
export interface DuplicateContactExists {
|
|
558
|
+
duplicateContactId?: string | null;
|
|
559
|
+
duplicateEmail?: string | null;
|
|
560
|
+
duplicatePhone?: string | null;
|
|
561
|
+
}
|
|
562
|
+
export interface UpdateContactRequest {
|
|
563
|
+
/** ID of the contact to update. */
|
|
564
|
+
contactId: string;
|
|
565
|
+
/**
|
|
566
|
+
* Revision number.
|
|
567
|
+
* When updating, include the existing `revision`
|
|
568
|
+
* to prevent conflicting updates.
|
|
569
|
+
*/
|
|
570
|
+
revision: number | null;
|
|
571
|
+
/**
|
|
572
|
+
* Controls whether the call will succeed
|
|
573
|
+
* if the new contact information contains an email or a phone number already used by another contact.
|
|
574
|
+
*
|
|
575
|
+
* If set to `true`,
|
|
576
|
+
* the call will succeed even if an email address or phone number is used by another contact.
|
|
577
|
+
* If set to `false`,
|
|
578
|
+
* the call will fail if the given email address is used by another contact or,
|
|
579
|
+
* if the email address is not given and the given phone number is used by another contact.
|
|
580
|
+
*
|
|
581
|
+
* Defaults to `false`.
|
|
582
|
+
*/
|
|
583
|
+
allowDuplicates?: boolean;
|
|
584
|
+
/** Contact info. */
|
|
585
|
+
info: ContactInfo;
|
|
586
|
+
}
|
|
587
|
+
/** Updated contact. */
|
|
588
|
+
export interface UpdateContactResponse {
|
|
589
|
+
/** Updated contact. */
|
|
590
|
+
contact?: Contact;
|
|
591
|
+
}
|
|
592
|
+
export interface MergeContactsRequest {
|
|
593
|
+
/** Target contact ID. */
|
|
594
|
+
targetContactId: string;
|
|
595
|
+
/**
|
|
596
|
+
* Target contact revision number, which increments by 1 each time the contact is updated.
|
|
597
|
+
* To prevent conflicting changes,
|
|
598
|
+
* the target contact's current revision must be passed.
|
|
599
|
+
*/
|
|
600
|
+
targetContactRevision: number | null;
|
|
601
|
+
/**
|
|
602
|
+
* IDs of up to 5 contacts to merge into the target contact.
|
|
603
|
+
* If merging more than one source contact,
|
|
604
|
+
* the first source is given precedence, then the second, and so on.
|
|
605
|
+
*/
|
|
606
|
+
sourceContactIds?: string[];
|
|
607
|
+
}
|
|
608
|
+
export interface MergeContactsResponse {
|
|
609
|
+
/** Updated target contact. */
|
|
610
|
+
contact?: Contact;
|
|
611
|
+
}
|
|
612
|
+
export interface ContactMerged {
|
|
613
|
+
/** ID of the contact the source contacts were merged into. */
|
|
614
|
+
targetContactId?: string;
|
|
615
|
+
/** IDs of contacts that were merged into the target contact. */
|
|
616
|
+
sourceContactIds?: string[];
|
|
617
|
+
/** Updated target contact. */
|
|
618
|
+
targetContact?: Contact;
|
|
619
|
+
}
|
|
620
|
+
export interface PreviewMergeContactsRequest {
|
|
621
|
+
/** Target contact ID. */
|
|
622
|
+
targetContactId?: string;
|
|
623
|
+
/**
|
|
624
|
+
* IDs of up to 5 contacts to merge into the target contact.
|
|
625
|
+
* If merging more than one source contact,
|
|
626
|
+
* the first source is given precedence, then the second, and so on.
|
|
627
|
+
*/
|
|
628
|
+
sourceContactIds?: string[];
|
|
629
|
+
}
|
|
630
|
+
export interface PreviewMergeContactsResponse {
|
|
631
|
+
/** Preview of the updated target contact. */
|
|
632
|
+
contact?: Contact;
|
|
633
|
+
}
|
|
634
|
+
export interface DeleteContactRequest {
|
|
635
|
+
/** ID of the contact to delete. */
|
|
636
|
+
contactId: string;
|
|
637
|
+
}
|
|
638
|
+
export interface DeleteContactResponse {
|
|
639
|
+
}
|
|
640
|
+
export interface LabelContactRequest {
|
|
641
|
+
/** ID of the contact to add labels to. */
|
|
642
|
+
contactId: string;
|
|
643
|
+
/**
|
|
644
|
+
* List of label keys to add to the contact.
|
|
645
|
+
*
|
|
646
|
+
* Label keys must exist to be added to the contact.
|
|
647
|
+
* Contact labels can be created or retrieved with
|
|
648
|
+
* [Find or Create Label](https://dev.wix.com/api/rest/contacts/labels/find-or-create-label)
|
|
649
|
+
* or
|
|
650
|
+
* [List Labels](https://dev.wix.com/api/rest/contacts/labels/list-labels).
|
|
651
|
+
*/
|
|
652
|
+
labelKeys: string[];
|
|
653
|
+
}
|
|
654
|
+
/** Updated contact. */
|
|
655
|
+
export interface LabelContactResponse {
|
|
656
|
+
/** Updated contact. */
|
|
657
|
+
contact?: Contact;
|
|
658
|
+
}
|
|
659
|
+
export interface UnlabelContactRequest {
|
|
660
|
+
/** ID of the contact to remove labels from. */
|
|
661
|
+
contactId: string;
|
|
662
|
+
/** List of label keys to remove from the contact. */
|
|
663
|
+
labelKeys: string[];
|
|
664
|
+
}
|
|
665
|
+
/** Updated contact. */
|
|
666
|
+
export interface UnlabelContactResponse {
|
|
667
|
+
/** Updated contact. */
|
|
668
|
+
contact?: Contact;
|
|
669
|
+
}
|
|
670
|
+
export interface LabelAndUnlabelContactRequest {
|
|
671
|
+
/** Contact ID. */
|
|
672
|
+
contactId?: string;
|
|
673
|
+
/**
|
|
674
|
+
* List of label keys to add to the contact.
|
|
675
|
+
*
|
|
676
|
+
* Label keys must exist to be added to the contact.
|
|
677
|
+
* Contact labels can be created or retrieved with
|
|
678
|
+
* [Find or Create Label](https://dev.wix.com/api/rest/contacts/labels/find-or-create-label)
|
|
679
|
+
* or
|
|
680
|
+
* [List Labels](https://dev.wix.com/api/rest/contacts/labels/list-labels).
|
|
681
|
+
*/
|
|
682
|
+
labelKeysToAdd?: string[];
|
|
683
|
+
/** List of label keys to remove from the contact. */
|
|
684
|
+
labelKeysToRemove?: string[];
|
|
685
|
+
}
|
|
686
|
+
export interface LabelAndUnlabelContactResponse {
|
|
687
|
+
/** Updated contact. */
|
|
688
|
+
contact?: Contact;
|
|
689
|
+
}
|
|
690
|
+
export interface ListContactsRequest {
|
|
691
|
+
/** [Sort order](https://dev.wix.com/api/rest/contacts/contacts/sort-and-filter). */
|
|
692
|
+
sort?: Sorting;
|
|
693
|
+
/** [Pagination](https://dev.wix.com/api/rest/getting-started/pagination), defaults to offset = 0 and limit = 50 (max limit 1,000). */
|
|
694
|
+
paging?: Paging;
|
|
695
|
+
/**
|
|
696
|
+
* List of projected fields to return.
|
|
697
|
+
* If both `fields` and `fieldsets` are sent in the request,
|
|
698
|
+
* the union of both lists is returned.
|
|
699
|
+
* `id` and `revision` are always returned.
|
|
700
|
+
*
|
|
701
|
+
* Supported properties:
|
|
702
|
+
* `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
|
|
703
|
+
* `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
|
|
704
|
+
* `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
|
|
705
|
+
* `info.labelKeys`, `info.locations`, `info.extendedFields`
|
|
706
|
+
*/
|
|
707
|
+
fields?: string[];
|
|
708
|
+
fieldsets?: ContactFieldSet[];
|
|
709
|
+
}
|
|
710
|
+
export interface Sorting {
|
|
711
|
+
/**
|
|
712
|
+
* Field to sort by.
|
|
713
|
+
*
|
|
714
|
+
* Supported properties:
|
|
715
|
+
* `createdDate`, `lastActivity.activityDate`, `primaryInfo.email`,
|
|
716
|
+
* `info.name.first`, `info.name.last`, `info.company`, `info.jobTitle`,
|
|
717
|
+
* `info.birthdate`
|
|
718
|
+
*/
|
|
719
|
+
fieldName?: string;
|
|
720
|
+
/**
|
|
721
|
+
* Sort order.
|
|
722
|
+
* Use `ASC` for ascending order or `DESC` for descending order.
|
|
723
|
+
*
|
|
724
|
+
* Defaults to `ASC`.
|
|
725
|
+
*/
|
|
726
|
+
order?: SortOrder;
|
|
727
|
+
}
|
|
728
|
+
export declare enum SortOrder {
|
|
729
|
+
ASC = "ASC",
|
|
730
|
+
DESC = "DESC"
|
|
731
|
+
}
|
|
732
|
+
export interface Paging {
|
|
733
|
+
/**
|
|
734
|
+
* Number of items to return. See [Pagination](https://dev.wix.com/api/rest/getting-started/pagination) for more information.
|
|
735
|
+
*
|
|
736
|
+
* Defaults to `50`. <br>
|
|
737
|
+
* Maximum: `1000`.
|
|
738
|
+
*/
|
|
739
|
+
limit?: number | null;
|
|
740
|
+
/** Number of items to skip in the current sort order. */
|
|
741
|
+
offset?: number | null;
|
|
742
|
+
}
|
|
743
|
+
export declare enum ContactFieldSet {
|
|
744
|
+
/** name, primaryEmail, primaryPhone */
|
|
745
|
+
BASIC = "BASIC",
|
|
746
|
+
/** name, phones, emails, addressses */
|
|
747
|
+
COMMUNICATION_DETAILS = "COMMUNICATION_DETAILS",
|
|
748
|
+
/** name, primaryInfo(email, phone), extendedFields */
|
|
749
|
+
EXTENDED = "EXTENDED",
|
|
750
|
+
/** Full contact object */
|
|
751
|
+
FULL = "FULL"
|
|
752
|
+
}
|
|
753
|
+
/** List of contacts. */
|
|
754
|
+
export interface ListContactsResponse {
|
|
755
|
+
/** List of contacts. */
|
|
756
|
+
contacts?: Contact[];
|
|
757
|
+
/** Details on the paged set of results returned. */
|
|
758
|
+
pagingMetadata?: PagingMetadata;
|
|
759
|
+
}
|
|
760
|
+
export interface PagingMetadata {
|
|
761
|
+
/** The number of items returned in this response */
|
|
762
|
+
count?: number | null;
|
|
763
|
+
/** The offset which was requested */
|
|
764
|
+
offset?: number | null;
|
|
765
|
+
/** The total number of items that match the query */
|
|
766
|
+
total?: number | null;
|
|
767
|
+
/** A flag that indicates the server failed to calculate 'total' field */
|
|
768
|
+
tooManyToCount?: boolean | null;
|
|
769
|
+
}
|
|
770
|
+
export interface QueryContactsRequest {
|
|
771
|
+
/**
|
|
772
|
+
* Plain text search for an exact match.
|
|
773
|
+
*
|
|
774
|
+
* Supported properties:
|
|
775
|
+
* `info.name.first`, `info.name.last`, `info.emails.email`, `info.phones.phone`
|
|
776
|
+
*
|
|
777
|
+
* Max: 100 characters
|
|
778
|
+
*/
|
|
779
|
+
search?: string | null;
|
|
780
|
+
/** Query options. */
|
|
781
|
+
query?: Query;
|
|
782
|
+
}
|
|
783
|
+
export interface Query {
|
|
784
|
+
/**
|
|
785
|
+
* Filter object.
|
|
786
|
+
* See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
|
|
787
|
+
* for more information.
|
|
788
|
+
*
|
|
789
|
+
* For a detailed list of supported filters, see
|
|
790
|
+
* [Supported Filters](https://dev.wix.com/api/rest/contacts/contacts/supported-filters).
|
|
791
|
+
*/
|
|
792
|
+
filter?: Record<string, any> | null;
|
|
793
|
+
/**
|
|
794
|
+
* Sorting options.
|
|
795
|
+
* See [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination)
|
|
796
|
+
* for more information.
|
|
797
|
+
*
|
|
798
|
+
* Max: 1 sort object
|
|
799
|
+
*/
|
|
800
|
+
sort?: Sorting[];
|
|
801
|
+
/** Pagination options. */
|
|
802
|
+
paging?: Paging;
|
|
803
|
+
/**
|
|
804
|
+
* List of projected fields to return.
|
|
805
|
+
* If both `fields` and `fieldsets` are sent in the request,
|
|
806
|
+
* the union of both lists is returned.
|
|
807
|
+
* `id` and `revision` are always returned.
|
|
808
|
+
*
|
|
809
|
+
* Supported properties:
|
|
810
|
+
* `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
|
|
811
|
+
* `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
|
|
812
|
+
* `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
|
|
813
|
+
* `info.labelKeys`, `info.locations`, `info.extendedFields`
|
|
814
|
+
*/
|
|
815
|
+
fields?: string[];
|
|
816
|
+
/**
|
|
817
|
+
* Predefined sets of fields to return.
|
|
818
|
+
* If both `fields` and `fieldsets` are sent in the request,
|
|
819
|
+
* the union of both lists is returned.
|
|
820
|
+
*
|
|
821
|
+
* - `BASIC`: Returns `id`, `revision`, `primaryInfo`, `info.name`.
|
|
822
|
+
* - `COMMUNICATION_DETAILS`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.emails`, `info.phones`, `info.addresses`.
|
|
823
|
+
* - `EXTENDED`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.extendedFields`.
|
|
824
|
+
* - `FULL`: Returns all fields.
|
|
825
|
+
*
|
|
826
|
+
* Default: If `fields` is omitted from the request, `FULL`.
|
|
827
|
+
*/
|
|
828
|
+
fieldsets?: ContactFieldSet[];
|
|
829
|
+
}
|
|
830
|
+
/** List of contacts. */
|
|
831
|
+
export interface QueryContactsResponse {
|
|
832
|
+
/** List of contacts. */
|
|
833
|
+
contacts?: Contact[];
|
|
834
|
+
/** Details on the paged set of results returned. */
|
|
835
|
+
pagingMetadata?: PagingMetadata;
|
|
836
|
+
}
|
|
837
|
+
export interface ListFacetsRequest {
|
|
838
|
+
/** Allow paginating, default: offset = 0 and limit = 1000 */
|
|
839
|
+
paging?: Paging;
|
|
840
|
+
/** Language for localization */
|
|
841
|
+
language?: string | null;
|
|
842
|
+
}
|
|
843
|
+
export interface ListFacetsResponse {
|
|
844
|
+
/** List of facets. */
|
|
845
|
+
facets?: ContactsFacet[];
|
|
846
|
+
/** Details on the paged set of results returned. */
|
|
847
|
+
pagingMetadata?: PagingMetadata;
|
|
848
|
+
}
|
|
849
|
+
export interface ContactsFacet {
|
|
850
|
+
/** Type of facet. */
|
|
851
|
+
facetType?: ContactsFacetType;
|
|
852
|
+
/**
|
|
853
|
+
* Scope for facet keys.
|
|
854
|
+
* When a facet key exists in a namespace,
|
|
855
|
+
* each key is unique within that namespace.
|
|
856
|
+
*
|
|
857
|
+
* Currently, facets not created by Wix are in the `custom` namespace.
|
|
858
|
+
*/
|
|
859
|
+
namespace?: string | null;
|
|
860
|
+
/** Human-readable display name. */
|
|
861
|
+
namespaceDisplayName?: string | null;
|
|
862
|
+
/** Facet key, automatically generated. */
|
|
863
|
+
facetKey?: string | null;
|
|
864
|
+
/** Human-readable name. Shown in the Wix UI. */
|
|
865
|
+
facetDisplayName?: string | null;
|
|
866
|
+
/** Number of contacts the facet is applied to. */
|
|
867
|
+
count?: number | null;
|
|
868
|
+
/** Filter used for query contacts of this facet */
|
|
869
|
+
queryFilter?: Record<string, any> | null;
|
|
870
|
+
}
|
|
871
|
+
export declare enum ContactsFacetType {
|
|
872
|
+
UNKNOWN = "UNKNOWN",
|
|
873
|
+
ALL_CONTACTS = "ALL_CONTACTS",
|
|
874
|
+
NOT_LABELED = "NOT_LABELED",
|
|
875
|
+
LABEL = "LABEL",
|
|
876
|
+
SUBSCRIPTION_STATUS = "SUBSCRIPTION_STATUS",
|
|
877
|
+
MEMBERSHIP_STATUS = "MEMBERSHIP_STATUS"
|
|
878
|
+
}
|
|
879
|
+
export interface QueryFacetsRequest {
|
|
880
|
+
/** Allow paginating, default: offset = 0 and limit = 1000 */
|
|
881
|
+
paging?: Paging;
|
|
882
|
+
/** Language for localization */
|
|
883
|
+
language?: string | null;
|
|
884
|
+
/**
|
|
885
|
+
* Only allowed fields:
|
|
886
|
+
* #info.extendedFields.emailSubscriptions.effectiveEmail ($exists)
|
|
887
|
+
* #info.extendedFields.emailSubscriptions.deliverabilityStatus ($eq, $ne, $in, $nin)
|
|
888
|
+
* #info.extendedFields.emailSubscriptions.subscriptionStatus ($eq, $ne, $in)
|
|
889
|
+
*/
|
|
890
|
+
filter?: Record<string, any> | null;
|
|
891
|
+
}
|
|
892
|
+
export interface QueryFacetsResponse {
|
|
893
|
+
/** List of facets. */
|
|
894
|
+
facets?: ContactsFacet[];
|
|
895
|
+
/** Details on the paged set of results returned. */
|
|
896
|
+
pagingMetadata?: PagingMetadata;
|
|
897
|
+
}
|
|
898
|
+
export interface BulkDeleteContactsRequest {
|
|
899
|
+
/**
|
|
900
|
+
* Filter object.
|
|
901
|
+
*
|
|
902
|
+
* Possible filters:
|
|
903
|
+
* `$eq`, `$exists`, `$gt`, `$gte`, `$hasAll`, `$hasSome`, `$in`, `$lt`, `$lte`, `$ne`, `$startsWith`.
|
|
904
|
+
*
|
|
905
|
+
* For a detailed list of supported filters, see
|
|
906
|
+
* filtering and sorting for
|
|
907
|
+
* [contact properties](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#contact-properties-filtering-sorting-and-searching),
|
|
908
|
+
* [extended fields](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#extended-fields-filtering-sorting-and-searching),
|
|
909
|
+
* and [custom fields](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#custom-fields-filtering-sorting-and-searching).
|
|
910
|
+
*
|
|
911
|
+
* Example:
|
|
912
|
+
* `{ "filter": { "info.name.last": "Smith" } }`
|
|
913
|
+
*/
|
|
914
|
+
filter?: Record<string, any> | null;
|
|
915
|
+
/**
|
|
916
|
+
* Plain text search for an exact match, up to 100 characters.
|
|
917
|
+
*
|
|
918
|
+
* Searchable fields:
|
|
919
|
+
*
|
|
920
|
+
* - `info.name.first`
|
|
921
|
+
* - `info.name.last`
|
|
922
|
+
* - `info.emails.email`
|
|
923
|
+
* - `info.phones.phone`
|
|
924
|
+
*/
|
|
925
|
+
search?: string | null;
|
|
926
|
+
}
|
|
927
|
+
export interface BulkDeleteContactsResponse {
|
|
928
|
+
/**
|
|
929
|
+
* Bulk job ID.
|
|
930
|
+
* The job's status can be retrieved with
|
|
931
|
+
* [Get Bulk Job](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/get-bulk-job) or
|
|
932
|
+
* [List Bulk Jobs](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/list-bulk-jobs).
|
|
933
|
+
*/
|
|
934
|
+
jobId?: string;
|
|
935
|
+
}
|
|
936
|
+
export interface BulkUpdateContactsRequest {
|
|
937
|
+
/**
|
|
938
|
+
* Filter object.
|
|
939
|
+
*
|
|
940
|
+
* Possible filters:
|
|
941
|
+
* `$eq`, `$exists`, `$gt`, `$gte`, `$hasAll`, `$hasSome`, `$in`, `$lt`, `$lte`, `$ne`, `$startsWith`.
|
|
942
|
+
*
|
|
943
|
+
* For a detailed list of supported filters, see
|
|
944
|
+
* filtering and sorting for
|
|
945
|
+
* [contact properties](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#contact-properties-filtering-sorting-and-searching),
|
|
946
|
+
* [extended fields](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#extended-fields-filtering-sorting-and-searching),
|
|
947
|
+
* and [custom fields](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#custom-fields-filtering-sorting-and-searching).
|
|
948
|
+
*
|
|
949
|
+
* Example:
|
|
950
|
+
* `{ "filter": { "info.name.last": "Smith" } }`
|
|
951
|
+
*/
|
|
952
|
+
filter?: Record<string, any> | null;
|
|
953
|
+
/**
|
|
954
|
+
* Plain text search for an exact match, up to 100 characters.
|
|
955
|
+
*
|
|
956
|
+
* Searchable fields:
|
|
957
|
+
*
|
|
958
|
+
* - `info.name.first`
|
|
959
|
+
* - `info.name.last`
|
|
960
|
+
* - `info.emails.email`
|
|
961
|
+
* - `info.phones.phone`
|
|
962
|
+
*/
|
|
963
|
+
search?: string | null;
|
|
964
|
+
/** Contact info. */
|
|
965
|
+
info?: ContactInfo;
|
|
966
|
+
}
|
|
967
|
+
export interface BulkUpdateContactsResponse {
|
|
968
|
+
/**
|
|
969
|
+
* Bulk job ID.
|
|
970
|
+
* The job's status can be retrieved with
|
|
971
|
+
* [Get Bulk Job](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/get-bulk-job) or
|
|
972
|
+
* [List Bulk Jobs](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/list-bulk-jobs).
|
|
973
|
+
*/
|
|
974
|
+
jobId?: string;
|
|
975
|
+
}
|
|
976
|
+
export interface BulkLabelAndUnlabelContactsRequest {
|
|
977
|
+
/**
|
|
978
|
+
* Filter options.
|
|
979
|
+
* Labels will be removed from contacts that meet the `filter` and `search` criteria.
|
|
980
|
+
*
|
|
981
|
+
* See
|
|
982
|
+
* [Field Support for Filtering, Sorting, and Searching](https://dev.wix.com/api/rest/contacts/contacts/sort-and-filter#contacts_contacts_sort-and-filter_field-support-for-filtering-sorting-and-searching)
|
|
983
|
+
* for a list of supported filters and fields.
|
|
984
|
+
*/
|
|
985
|
+
filter?: Record<string, any> | null;
|
|
986
|
+
/**
|
|
987
|
+
* Plain text search for an exact match, up to 100 characters.
|
|
988
|
+
* Labels will be removed from contacts that meet the `filter` and `search` criteria.
|
|
989
|
+
*
|
|
990
|
+
* See
|
|
991
|
+
* [Field Support for Filtering, Sorting, and Searching](https://dev.wix.com/api/rest/contacts/contacts/sort-and-filter#contacts_contacts_sort-and-filter_field-support-for-filtering-sorting-and-searching)
|
|
992
|
+
* for a list of searchable fields.
|
|
993
|
+
*/
|
|
994
|
+
search?: string | null;
|
|
995
|
+
/**
|
|
996
|
+
* List of label keys to add to the contacts.
|
|
997
|
+
*
|
|
998
|
+
* Label keys must exist to be added to the contact.
|
|
999
|
+
* Contact labels can be created or retrieved with
|
|
1000
|
+
* [Find or Create Label](https://dev.wix.com/api/rest/contacts/labels/find-or-create-label)
|
|
1001
|
+
* or
|
|
1002
|
+
* [List Labels](https://dev.wix.com/api/rest/contacts/labels/list-labels)
|
|
1003
|
+
*/
|
|
1004
|
+
labelKeysToAdd?: string[];
|
|
1005
|
+
/** List of label keys to remove from the contacts. */
|
|
1006
|
+
labelKeysToRemove?: string[];
|
|
1007
|
+
}
|
|
1008
|
+
export interface BulkLabelAndUnlabelContactsResponse {
|
|
1009
|
+
/**
|
|
1010
|
+
* Bulk job ID.
|
|
1011
|
+
* The job's status can be retrieved with
|
|
1012
|
+
* [Get Bulk Job](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/get-bulk-job) or
|
|
1013
|
+
* [List Bulk Jobs](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/list-bulk-jobs).
|
|
1014
|
+
*/
|
|
1015
|
+
jobId?: string;
|
|
1016
|
+
}
|
|
1017
|
+
export interface BulkUpsertContactsRequest {
|
|
1018
|
+
info?: ContactInfo[];
|
|
1019
|
+
returnFullEntity?: boolean;
|
|
1020
|
+
}
|
|
1021
|
+
export interface BulkUpsertContactsResponse {
|
|
1022
|
+
results?: Item[];
|
|
1023
|
+
metadata?: BulkUpsertContactsResponseMetadata;
|
|
1024
|
+
}
|
|
1025
|
+
export declare enum Action {
|
|
1026
|
+
UNKNOWN = "UNKNOWN",
|
|
1027
|
+
UPDATED = "UPDATED",
|
|
1028
|
+
CREATED = "CREATED"
|
|
1029
|
+
}
|
|
1030
|
+
export interface Error {
|
|
1031
|
+
/** Error code. */
|
|
1032
|
+
code?: string;
|
|
1033
|
+
/** Error details. */
|
|
1034
|
+
message?: string | null;
|
|
1035
|
+
}
|
|
1036
|
+
export interface Metadata {
|
|
1037
|
+
id?: string | null;
|
|
1038
|
+
originalIndex?: number;
|
|
1039
|
+
action?: Action;
|
|
1040
|
+
success?: boolean;
|
|
1041
|
+
error?: Error;
|
|
1042
|
+
}
|
|
1043
|
+
export interface Item {
|
|
1044
|
+
contact?: Contact;
|
|
1045
|
+
metadata?: Metadata;
|
|
1046
|
+
}
|
|
1047
|
+
export interface BulkUpsertContactsResponseMetadata {
|
|
1048
|
+
totalSuccess?: number;
|
|
1049
|
+
totalFailure?: number;
|
|
1050
|
+
totalCreated?: number;
|
|
1051
|
+
totalUpdated?: number;
|
|
1052
|
+
}
|
|
1053
|
+
export interface UpsertContactRequest {
|
|
1054
|
+
info?: ContactInfo;
|
|
1055
|
+
}
|
|
1056
|
+
export interface UpsertContactResponse {
|
|
1057
|
+
/** Upserted contact. */
|
|
1058
|
+
contact?: Contact;
|
|
1059
|
+
action?: UpsertContactResponseAction;
|
|
1060
|
+
}
|
|
1061
|
+
export declare enum UpsertContactResponseAction {
|
|
1062
|
+
UNKNOWN = "UNKNOWN",
|
|
1063
|
+
UPDATED = "UPDATED",
|
|
1064
|
+
CREATED = "CREATED"
|
|
1065
|
+
}
|
|
1066
|
+
export interface GeneratePictureUploadUrlRequest {
|
|
1067
|
+
/** ID of the contact whose picture is being updated. */
|
|
1068
|
+
contactId?: string;
|
|
1069
|
+
/**
|
|
1070
|
+
* Mime Type. Must be one of:
|
|
1071
|
+
* `image/png`, `image/jpeg`.
|
|
1072
|
+
* Defaults to `image/png`.
|
|
1073
|
+
*/
|
|
1074
|
+
mimeType?: string | null;
|
|
1075
|
+
}
|
|
1076
|
+
export interface GeneratePictureUploadUrlResponse {
|
|
1077
|
+
/** URL to upload the image */
|
|
1078
|
+
uploadUrl?: string;
|
|
1079
|
+
}
|
|
1080
|
+
export interface GetContactRequest {
|
|
1081
|
+
/** ID of the contact to retrieve. */
|
|
1082
|
+
id: string;
|
|
1083
|
+
/**
|
|
1084
|
+
* List of projected fields to return.
|
|
1085
|
+
* If both `fields` and `fieldsets` are sent in the request,
|
|
1086
|
+
* the union of both lists is returned.
|
|
1087
|
+
* `id` and `revision` are always returned.
|
|
1088
|
+
*
|
|
1089
|
+
* Supported properties:
|
|
1090
|
+
* `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
|
|
1091
|
+
* `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
|
|
1092
|
+
* `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
|
|
1093
|
+
* `info.labelKeys`, `info.locations`, `info.extendedFields`
|
|
1094
|
+
*/
|
|
1095
|
+
fields?: string[];
|
|
1096
|
+
/**
|
|
1097
|
+
* Predefined sets of fields to return.
|
|
1098
|
+
* If both `fields` and `fieldsets` are sent in the request,
|
|
1099
|
+
* the union of both lists is returned.
|
|
1100
|
+
*
|
|
1101
|
+
* - `BASIC`: Returns `id`, `revision`, `primaryInfo`, `info.name`.
|
|
1102
|
+
* - `COMMUNICATION_DETAILS`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.emails`, `info.phones`, `info.addresses`.
|
|
1103
|
+
* - `EXTENDED`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.extendedFields`.
|
|
1104
|
+
* - `FULL`: Returns all fields.
|
|
1105
|
+
*
|
|
1106
|
+
* Default: If `fields` is omitted from the request, `FULL`.
|
|
1107
|
+
*/
|
|
1108
|
+
fieldsets?: ContactFieldSet[];
|
|
1109
|
+
}
|
|
1110
|
+
/** The requested contact. */
|
|
1111
|
+
export interface GetContactResponse {
|
|
1112
|
+
/** The requested contact. */
|
|
1113
|
+
contact?: Contact;
|
|
1114
|
+
/**
|
|
1115
|
+
* Contact response type.
|
|
1116
|
+
*
|
|
1117
|
+
* - `REGULAR`: The specified contact was returned.
|
|
1118
|
+
* - `IMPLICIT`: Not used.
|
|
1119
|
+
* - `MERGED`: The specified contact was previously merged with another contact, and the new contact was
|
|
1120
|
+
*/
|
|
1121
|
+
responseType?: GetContactResponseType;
|
|
1122
|
+
}
|
|
1123
|
+
export declare enum GetContactResponseType {
|
|
1124
|
+
/** Normal contact */
|
|
1125
|
+
REGULAR = "REGULAR",
|
|
1126
|
+
/** Contact that id was already allocated for it, but the contact not yet created. */
|
|
1127
|
+
IMPLICIT = "IMPLICIT",
|
|
1128
|
+
/** Contact was merged into another contact */
|
|
1129
|
+
MERGED = "MERGED"
|
|
1130
|
+
}
|
|
1131
|
+
export interface SyncSubmitContactRequest {
|
|
1132
|
+
contactInfo?: ContactInfo;
|
|
1133
|
+
activity?: ContactActivity;
|
|
1134
|
+
passThroughData?: string | null;
|
|
1135
|
+
contactId?: string;
|
|
1136
|
+
submitOperation?: SubmitOperation;
|
|
1137
|
+
/** Need to resolve source in allocator, because of server sign */
|
|
1138
|
+
sourceType?: ContactSourceType;
|
|
1139
|
+
sourceId?: string | null;
|
|
1140
|
+
hideFromContactList?: boolean;
|
|
1141
|
+
}
|
|
1142
|
+
export declare enum SubmitOperation {
|
|
1143
|
+
UNKNOWN = "UNKNOWN",
|
|
1144
|
+
CREATE = "CREATE",
|
|
1145
|
+
UPDATE = "UPDATE"
|
|
1146
|
+
}
|
|
1147
|
+
export interface SyncSubmitContactResponse {
|
|
1148
|
+
}
|
|
1149
|
+
export interface CountContactsRequest {
|
|
1150
|
+
}
|
|
1151
|
+
export interface CountContactsResponse {
|
|
1152
|
+
count?: number;
|
|
1153
|
+
}
|
|
1154
|
+
export interface SearchContactsRequest {
|
|
1155
|
+
/** Search object. Encapsulates filter, sorting, paging and other details */
|
|
1156
|
+
search?: Search;
|
|
1157
|
+
}
|
|
1158
|
+
export interface Search extends SearchPagingMethodOneOf {
|
|
1159
|
+
/** Cursor pointing to page of results. 'cursorPaging.cursor' can not be used together with 'filter' or 'sort' */
|
|
1160
|
+
cursorPaging?: CursorPaging;
|
|
1161
|
+
/** 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) */
|
|
1162
|
+
filter?: Record<string, any> | null;
|
|
1163
|
+
/** Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}] */
|
|
1164
|
+
sort?: Sorting[];
|
|
1165
|
+
/**
|
|
1166
|
+
* List of projected fields to return.
|
|
1167
|
+
*
|
|
1168
|
+
* If used in the request,
|
|
1169
|
+
* all the fields contained in `fields` and `fieldsets` are returned.
|
|
1170
|
+
* If left blank, `fieldsets` is used to determine which fields to return.
|
|
1171
|
+
*
|
|
1172
|
+
* For a list of valid projected fields, see
|
|
1173
|
+
* [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).
|
|
1174
|
+
*/
|
|
1175
|
+
fields?: string[];
|
|
1176
|
+
/**
|
|
1177
|
+
* Predefined sets of fields to return.
|
|
1178
|
+
*
|
|
1179
|
+
* Defaults to `FULL`.
|
|
1180
|
+
* Ignored if left empty when `fields` is used in the request.
|
|
1181
|
+
*
|
|
1182
|
+
* For more information,
|
|
1183
|
+
* see [Contact Fieldsets](https://dev.wix.com/api/rest/contacts/contacts/fieldsets-and-projected-fields#contacts_contacts_fieldsets-and-projected-fields_contact-fieldsets).
|
|
1184
|
+
*/
|
|
1185
|
+
fieldsets?: string[];
|
|
1186
|
+
/** free text to match in searchable fields */
|
|
1187
|
+
search?: SearchDetails;
|
|
1188
|
+
}
|
|
1189
|
+
/** @oneof */
|
|
1190
|
+
export interface SearchPagingMethodOneOf {
|
|
1191
|
+
/** Cursor pointing to page of results. 'cursorPaging.cursor' can not be used together with 'filter' or 'sort' */
|
|
1192
|
+
cursorPaging?: CursorPaging;
|
|
1193
|
+
}
|
|
1194
|
+
export interface SearchDetails {
|
|
1195
|
+
/** boolean search mode. Default is `OR` */
|
|
1196
|
+
mode?: Mode;
|
|
1197
|
+
/** search term or expression */
|
|
1198
|
+
expression?: string | null;
|
|
1199
|
+
/**
|
|
1200
|
+
* fields to search in. if empty - server will search in own default fieldsDefault searchable fields:
|
|
1201
|
+
*
|
|
1202
|
+
* - `info.name.first`
|
|
1203
|
+
* - `info.name.last`
|
|
1204
|
+
* - `info.emails.email`
|
|
1205
|
+
* - `info.phones.phone`
|
|
1206
|
+
*/
|
|
1207
|
+
fields?: string[];
|
|
1208
|
+
/** flag if should use auto fuzzy search (allowing typos by a managed proximity algorithm) */
|
|
1209
|
+
fuzzy?: boolean;
|
|
1210
|
+
}
|
|
1211
|
+
export declare enum Mode {
|
|
1212
|
+
/** any */
|
|
1213
|
+
OR = "OR",
|
|
1214
|
+
/** all */
|
|
1215
|
+
AND = "AND"
|
|
1216
|
+
}
|
|
1217
|
+
export interface CursorPaging {
|
|
1218
|
+
/** The number of contacts to load (default = 50, max = 1000) */
|
|
1219
|
+
limit?: number | null;
|
|
1220
|
+
/** Cursor returned in last query response. Should not be provided on first page request */
|
|
1221
|
+
cursor?: string | null;
|
|
1222
|
+
}
|
|
1223
|
+
export interface SearchContactsResponse {
|
|
1224
|
+
/** List of contacts. */
|
|
1225
|
+
contacts?: Contact[];
|
|
1226
|
+
/** Details on the paged set of results returned. */
|
|
1227
|
+
pagingMetadata?: PagingMetadataV2;
|
|
1228
|
+
}
|
|
1229
|
+
export interface PagingMetadataV2 {
|
|
1230
|
+
/** The number of items returned in this response */
|
|
1231
|
+
count?: number | null;
|
|
1232
|
+
/** The offset which was requested. Returned if offset paging was used */
|
|
1233
|
+
offset?: number | null;
|
|
1234
|
+
/** The total number of items that match the query. Returned if offset paging was used and 'too_many_to_count' flag is not set */
|
|
1235
|
+
total?: number | null;
|
|
1236
|
+
/** A flag that indicates the server failed to calculate 'total' field */
|
|
1237
|
+
tooManyToCount?: boolean | null;
|
|
1238
|
+
/** Cursors to navigate through result pages. Returned if cursor paging was used */
|
|
1239
|
+
cursors?: Cursors;
|
|
1240
|
+
}
|
|
1241
|
+
export interface Cursors {
|
|
1242
|
+
/** Cursor pointing to next result page */
|
|
1243
|
+
next?: string | null;
|
|
1244
|
+
/** Cursor pointing to previous result page */
|
|
1245
|
+
prev?: string | null;
|
|
1246
|
+
}
|
|
1247
|
+
export interface BulkAddSegmentToContactsRequest {
|
|
1248
|
+
/** Segment id */
|
|
1249
|
+
segmentId?: string;
|
|
1250
|
+
/** List of Contact ids */
|
|
1251
|
+
contactIds?: string[];
|
|
1252
|
+
/** List of existing segment ids */
|
|
1253
|
+
existsSegmentIds?: string[];
|
|
1254
|
+
}
|
|
1255
|
+
export interface BulkAddSegmentToContactsResponse {
|
|
1256
|
+
/** List of action results */
|
|
1257
|
+
results?: ItemMetadata[];
|
|
1258
|
+
/** Metadata on the bulk action */
|
|
1259
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1260
|
+
}
|
|
1261
|
+
export interface ItemMetadata {
|
|
1262
|
+
/** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
|
|
1263
|
+
id?: string | null;
|
|
1264
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
1265
|
+
originalIndex?: number;
|
|
1266
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
1267
|
+
success?: boolean;
|
|
1268
|
+
/** Details about the error in case of failure. */
|
|
1269
|
+
error?: ApplicationError;
|
|
1270
|
+
}
|
|
1271
|
+
export interface ApplicationError {
|
|
1272
|
+
/** Error code. */
|
|
1273
|
+
code?: string;
|
|
1274
|
+
/** Description of the error. */
|
|
1275
|
+
description?: string;
|
|
1276
|
+
/** Data related to the error. */
|
|
1277
|
+
data?: Record<string, any> | null;
|
|
1278
|
+
}
|
|
1279
|
+
export interface BulkActionMetadata {
|
|
1280
|
+
/** Number of items that were successfully processed. */
|
|
1281
|
+
totalSuccesses?: number;
|
|
1282
|
+
/** Number of items that couldn't be processed. */
|
|
1283
|
+
totalFailures?: number;
|
|
1284
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
1285
|
+
undetailedFailures?: number;
|
|
1286
|
+
}
|
|
1287
|
+
export interface ContactAddedToSegment {
|
|
1288
|
+
/** Id of the segment to which the contact was added */
|
|
1289
|
+
segmentId?: string;
|
|
1290
|
+
/** The contact that was added */
|
|
1291
|
+
contact?: Contact;
|
|
1292
|
+
}
|
|
1293
|
+
export interface BulkRemoveSegmentFromContactsRequest {
|
|
1294
|
+
/** Segment id */
|
|
1295
|
+
segmentId?: string;
|
|
1296
|
+
/** List of Contact ids */
|
|
1297
|
+
contactIds?: string[];
|
|
1298
|
+
}
|
|
1299
|
+
export interface BulkRemoveSegmentFromContactsResponse {
|
|
1300
|
+
/** List of action results */
|
|
1301
|
+
results?: ItemMetadata[];
|
|
1302
|
+
/** Metadata on the bulk action */
|
|
1303
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1304
|
+
}
|
|
1305
|
+
export interface ContactRemovedFromSegment {
|
|
1306
|
+
/** Id of the segment from which the contact was removed */
|
|
1307
|
+
segmentId?: string;
|
|
1308
|
+
/** The contact that was removed */
|
|
1309
|
+
contact?: Contact;
|
|
1310
|
+
}
|