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