@wix/crm 1.0.80 → 1.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/context.d.ts +5 -0
- package/build/cjs/context.js +32 -0
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +7 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +7 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +7 -2
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.context.d.ts +9 -0
- package/build/cjs/src/contacts-v4-contact.context.js +82 -0
- package/build/cjs/src/contacts-v4-contact.context.js.map +1 -0
- package/build/cjs/src/contacts-v4-contact.http.d.ts +20 -94
- package/build/cjs/src/contacts-v4-contact.http.js +211 -249
- package/build/cjs/src/contacts-v4-contact.http.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.meta.d.ts +1 -1
- package/build/cjs/src/contacts-v4-contact.meta.js +5 -1
- package/build/cjs/src/contacts-v4-contact.meta.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.public.d.ts +7 -6
- package/build/cjs/src/contacts-v4-contact.public.js +10 -2
- package/build/cjs/src/contacts-v4-contact.public.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.types.d.ts +265 -5
- package/build/cjs/src/contacts-v4-contact.types.js +40 -19
- package/build/cjs/src/contacts-v4-contact.types.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.universal.d.ts +234 -155
- package/build/cjs/src/contacts-v4-contact.universal.js +145 -168
- package/build/cjs/src/contacts-v4-contact.universal.js.map +1 -1
- package/build/cjs/src/contacts-v4-extended-field.context.d.ts +7 -0
- package/build/cjs/src/contacts-v4-extended-field.context.js +60 -0
- package/build/cjs/src/contacts-v4-extended-field.context.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.http.d.ts +7 -14
- package/build/cjs/src/contacts-v4-extended-field.http.js +60 -70
- package/build/cjs/src/contacts-v4-extended-field.http.js.map +1 -1
- package/build/cjs/src/contacts-v4-extended-field.meta.d.ts +1 -1
- package/build/cjs/src/contacts-v4-extended-field.meta.js +5 -1
- package/build/cjs/src/contacts-v4-extended-field.meta.js.map +1 -1
- package/build/cjs/src/contacts-v4-extended-field.public.d.ts +2 -1
- package/build/cjs/src/contacts-v4-extended-field.public.js +5 -1
- package/build/cjs/src/contacts-v4-extended-field.public.js.map +1 -1
- package/build/cjs/src/contacts-v4-extended-field.types.d.ts +68 -1
- package/build/cjs/src/contacts-v4-extended-field.types.js +3 -3
- package/build/cjs/src/contacts-v4-extended-field.types.js.map +1 -1
- package/build/cjs/src/contacts-v4-extended-field.universal.d.ts +116 -30
- package/build/cjs/src/contacts-v4-extended-field.universal.js +62 -51
- package/build/cjs/src/contacts-v4-extended-field.universal.js.map +1 -1
- package/build/cjs/src/contacts-v4-label.context.d.ts +7 -0
- package/build/cjs/src/contacts-v4-label.context.js +60 -0
- package/build/cjs/src/contacts-v4-label.context.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.http.d.ts +13 -14
- package/build/cjs/src/contacts-v4-label.http.js +66 -72
- package/build/cjs/src/contacts-v4-label.http.js.map +1 -1
- package/build/cjs/src/contacts-v4-label.meta.d.ts +1 -1
- package/build/cjs/src/contacts-v4-label.meta.js +5 -1
- package/build/cjs/src/contacts-v4-label.meta.js.map +1 -1
- package/build/cjs/src/contacts-v4-label.public.d.ts +6 -5
- package/build/cjs/src/contacts-v4-label.public.js +5 -1
- package/build/cjs/src/contacts-v4-label.public.js.map +1 -1
- package/build/cjs/src/contacts-v4-label.types.d.ts +76 -9
- package/build/cjs/src/contacts-v4-label.types.js +2 -2
- package/build/cjs/src/contacts-v4-label.types.js.map +1 -1
- package/build/cjs/src/contacts-v4-label.universal.d.ts +125 -40
- package/build/cjs/src/contacts-v4-label.universal.js +76 -62
- package/build/cjs/src/contacts-v4-label.universal.js.map +1 -1
- package/build/cjs/src/contacts-v4-submit-contact.context.d.ts +3 -0
- package/build/cjs/src/contacts-v4-submit-contact.context.js +16 -0
- package/build/cjs/src/contacts-v4-submit-contact.context.js.map +1 -0
- package/build/cjs/src/contacts-v4-submit-contact.http.js +20 -34
- package/build/cjs/src/contacts-v4-submit-contact.http.js.map +1 -1
- package/build/cjs/src/contacts-v4-submit-contact.meta.d.ts +1 -1
- package/build/cjs/src/contacts-v4-submit-contact.meta.js +5 -1
- package/build/cjs/src/contacts-v4-submit-contact.meta.js.map +1 -1
- package/build/cjs/src/contacts-v4-submit-contact.public.d.ts +2 -2
- package/build/cjs/src/contacts-v4-submit-contact.types.d.ts +8 -3
- package/build/cjs/src/contacts-v4-submit-contact.types.js +9 -9
- package/build/cjs/src/contacts-v4-submit-contact.types.js.map +1 -1
- package/build/cjs/src/contacts-v4-submit-contact.universal.d.ts +8 -9
- package/build/cjs/src/contacts-v4-submit-contact.universal.js +25 -28
- package/build/cjs/src/contacts-v4-submit-contact.universal.js.map +1 -1
- package/build/cjs/src/crm-tasks-v2-task.context.d.ts +9 -0
- package/build/cjs/src/crm-tasks-v2-task.context.js +82 -0
- package/build/cjs/src/crm-tasks-v2-task.context.js.map +1 -0
- package/build/cjs/src/crm-tasks-v2-task.http.d.ts +60 -0
- package/build/cjs/src/crm-tasks-v2-task.http.js +268 -0
- package/build/cjs/src/crm-tasks-v2-task.http.js.map +1 -0
- package/build/cjs/src/crm-tasks-v2-task.meta.d.ts +27 -0
- package/build/cjs/src/crm-tasks-v2-task.meta.js +161 -0
- package/build/cjs/src/crm-tasks-v2-task.meta.js.map +1 -0
- package/build/cjs/src/crm-tasks-v2-task.public.d.ts +30 -0
- package/build/cjs/src/crm-tasks-v2-task.public.js +58 -0
- package/build/cjs/src/crm-tasks-v2-task.public.js.map +1 -0
- package/build/cjs/src/crm-tasks-v2-task.types.d.ts +430 -0
- package/build/cjs/src/crm-tasks-v2-task.types.js +29 -0
- package/build/cjs/src/crm-tasks-v2-task.types.js.map +1 -0
- package/build/cjs/src/crm-tasks-v2-task.universal.d.ts +678 -0
- package/build/cjs/src/crm-tasks-v2-task.universal.js +520 -0
- package/build/cjs/src/crm-tasks-v2-task.universal.js.map +1 -0
- package/build/cjs/src/ping-notifications-v3-notification.public.d.ts +1 -1
- package/build/cjs/src/ping-notifications-v3-notification.types.js +1 -1
- package/build/cjs/src/ping-notifications-v3-notification.types.js.map +1 -1
- package/build/cjs/src/ping-notifications-v3-notification.universal.js +6 -2
- package/build/cjs/src/ping-notifications-v3-notification.universal.js.map +1 -1
- package/build/es/context.d.ts +5 -0
- package/build/es/context.js +6 -0
- package/build/es/context.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +1 -0
- package/build/es/index.js.map +1 -1
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +1 -0
- package/build/es/index.typings.js.map +1 -1
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +1 -0
- package/build/es/meta.js.map +1 -1
- package/build/es/src/contacts-v4-contact.context.d.ts +9 -0
- package/build/es/src/contacts-v4-contact.context.js +72 -0
- package/build/es/src/contacts-v4-contact.context.js.map +1 -0
- package/build/es/src/contacts-v4-contact.http.d.ts +20 -94
- package/build/es/src/contacts-v4-contact.http.js +211 -249
- package/build/es/src/contacts-v4-contact.http.js.map +1 -1
- package/build/es/src/contacts-v4-contact.meta.d.ts +1 -1
- package/build/es/src/contacts-v4-contact.public.d.ts +7 -6
- package/build/es/src/contacts-v4-contact.public.js +3 -2
- package/build/es/src/contacts-v4-contact.public.js.map +1 -1
- package/build/es/src/contacts-v4-contact.types.d.ts +265 -5
- package/build/es/src/contacts-v4-contact.types.js +21 -0
- package/build/es/src/contacts-v4-contact.types.js.map +1 -1
- package/build/es/src/contacts-v4-contact.universal.d.ts +234 -155
- package/build/es/src/contacts-v4-contact.universal.js +122 -149
- package/build/es/src/contacts-v4-contact.universal.js.map +1 -1
- package/build/es/src/contacts-v4-extended-field.context.d.ts +7 -0
- package/build/es/src/contacts-v4-extended-field.context.js +52 -0
- package/build/es/src/contacts-v4-extended-field.context.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.http.d.ts +7 -14
- package/build/es/src/contacts-v4-extended-field.http.js +60 -70
- package/build/es/src/contacts-v4-extended-field.http.js.map +1 -1
- package/build/es/src/contacts-v4-extended-field.meta.d.ts +1 -1
- package/build/es/src/contacts-v4-extended-field.public.d.ts +2 -1
- package/build/es/src/contacts-v4-extended-field.public.js +1 -0
- package/build/es/src/contacts-v4-extended-field.public.js.map +1 -1
- package/build/es/src/contacts-v4-extended-field.types.d.ts +68 -1
- package/build/es/src/contacts-v4-extended-field.universal.d.ts +116 -30
- package/build/es/src/contacts-v4-extended-field.universal.js +53 -46
- package/build/es/src/contacts-v4-extended-field.universal.js.map +1 -1
- package/build/es/src/contacts-v4-label.context.d.ts +7 -0
- package/build/es/src/contacts-v4-label.context.js +52 -0
- package/build/es/src/contacts-v4-label.context.js.map +1 -0
- package/build/es/src/contacts-v4-label.http.d.ts +13 -14
- package/build/es/src/contacts-v4-label.http.js +66 -72
- package/build/es/src/contacts-v4-label.http.js.map +1 -1
- package/build/es/src/contacts-v4-label.meta.d.ts +1 -1
- package/build/es/src/contacts-v4-label.public.d.ts +6 -5
- package/build/es/src/contacts-v4-label.public.js +1 -0
- package/build/es/src/contacts-v4-label.public.js.map +1 -1
- package/build/es/src/contacts-v4-label.types.d.ts +76 -9
- package/build/es/src/contacts-v4-label.universal.d.ts +125 -40
- package/build/es/src/contacts-v4-label.universal.js +68 -58
- package/build/es/src/contacts-v4-label.universal.js.map +1 -1
- package/build/es/src/contacts-v4-submit-contact.context.d.ts +3 -0
- package/build/es/src/contacts-v4-submit-contact.context.js +12 -0
- package/build/es/src/contacts-v4-submit-contact.context.js.map +1 -0
- package/build/es/src/contacts-v4-submit-contact.http.js +20 -34
- package/build/es/src/contacts-v4-submit-contact.http.js.map +1 -1
- package/build/es/src/contacts-v4-submit-contact.meta.d.ts +1 -1
- package/build/es/src/contacts-v4-submit-contact.public.d.ts +2 -2
- package/build/es/src/contacts-v4-submit-contact.types.d.ts +8 -3
- package/build/es/src/contacts-v4-submit-contact.types.js.map +1 -1
- package/build/es/src/contacts-v4-submit-contact.universal.d.ts +8 -9
- package/build/es/src/contacts-v4-submit-contact.universal.js +11 -18
- package/build/es/src/contacts-v4-submit-contact.universal.js.map +1 -1
- package/build/es/src/crm-tasks-v2-task.context.d.ts +9 -0
- package/build/es/src/crm-tasks-v2-task.context.js +72 -0
- package/build/es/src/crm-tasks-v2-task.context.js.map +1 -0
- package/build/es/src/crm-tasks-v2-task.http.d.ts +60 -0
- package/build/es/src/crm-tasks-v2-task.http.js +258 -0
- package/build/es/src/crm-tasks-v2-task.http.js.map +1 -0
- package/build/es/src/crm-tasks-v2-task.meta.d.ts +27 -0
- package/build/es/src/crm-tasks-v2-task.meta.js +128 -0
- package/build/es/src/crm-tasks-v2-task.meta.js.map +1 -0
- package/build/es/src/crm-tasks-v2-task.public.d.ts +30 -0
- package/build/es/src/crm-tasks-v2-task.public.js +40 -0
- package/build/es/src/crm-tasks-v2-task.public.js.map +1 -0
- package/build/es/src/crm-tasks-v2-task.types.d.ts +430 -0
- package/build/es/src/crm-tasks-v2-task.types.js +26 -0
- package/build/es/src/crm-tasks-v2-task.types.js.map +1 -0
- package/build/es/src/crm-tasks-v2-task.universal.d.ts +678 -0
- package/build/es/src/crm-tasks-v2-task.universal.js +487 -0
- package/build/es/src/crm-tasks-v2-task.universal.js.map +1 -0
- package/build/es/src/ping-notifications-v3-notification.public.d.ts +1 -1
- package/build/es/src/ping-notifications-v3-notification.universal.js.map +1 -1
- package/context/package.json +6 -0
- package/package.json +12 -6
|
@@ -3,7 +3,7 @@ export interface ExtendedField {
|
|
|
3
3
|
/**
|
|
4
4
|
* Extended field namespace.
|
|
5
5
|
*
|
|
6
|
-
* Extended fields created by site
|
|
6
|
+
* Extended fields created by site collaborators or 3rd-party apps
|
|
7
7
|
* are automatically assigned to the `custom` namespace.
|
|
8
8
|
* @readonly
|
|
9
9
|
*/
|
|
@@ -255,6 +255,73 @@ export interface QueryExtendedFieldsResponse {
|
|
|
255
255
|
/** Details on the paged set of results returned. */
|
|
256
256
|
pagingMetadata?: PagingMetadata;
|
|
257
257
|
}
|
|
258
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
259
|
+
createdEvent?: EntityCreatedEvent;
|
|
260
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
261
|
+
deletedEvent?: EntityDeletedEvent;
|
|
262
|
+
actionEvent?: ActionEvent;
|
|
263
|
+
/**
|
|
264
|
+
* Unique event ID.
|
|
265
|
+
* Allows clients to ignore duplicate webhooks.
|
|
266
|
+
*/
|
|
267
|
+
id?: string;
|
|
268
|
+
/**
|
|
269
|
+
* Assumes actions are also always typed to an entity_type
|
|
270
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
271
|
+
*/
|
|
272
|
+
entityFqdn?: string;
|
|
273
|
+
/**
|
|
274
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
275
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
276
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
277
|
+
*/
|
|
278
|
+
slug?: string;
|
|
279
|
+
/** ID of the entity associated with the event. */
|
|
280
|
+
entityId?: string;
|
|
281
|
+
/** Event timestamp. */
|
|
282
|
+
eventTime?: Date;
|
|
283
|
+
/**
|
|
284
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
285
|
+
* (for example, GDPR).
|
|
286
|
+
*/
|
|
287
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
288
|
+
/** If present, indicates the action that triggered the event. */
|
|
289
|
+
originatedFrom?: string | null;
|
|
290
|
+
/**
|
|
291
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
292
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
293
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
294
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
295
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
296
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
297
|
+
*/
|
|
298
|
+
entityEventSequence?: string | null;
|
|
299
|
+
}
|
|
300
|
+
/** @oneof */
|
|
301
|
+
export interface DomainEventBodyOneOf {
|
|
302
|
+
createdEvent?: EntityCreatedEvent;
|
|
303
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
304
|
+
deletedEvent?: EntityDeletedEvent;
|
|
305
|
+
actionEvent?: ActionEvent;
|
|
306
|
+
}
|
|
307
|
+
export interface EntityCreatedEvent {
|
|
308
|
+
entityAsJson?: string;
|
|
309
|
+
}
|
|
310
|
+
export interface EntityUpdatedEvent {
|
|
311
|
+
/**
|
|
312
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
313
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
314
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
315
|
+
*/
|
|
316
|
+
currentEntityAsJson?: string;
|
|
317
|
+
}
|
|
318
|
+
export interface EntityDeletedEvent {
|
|
319
|
+
/** Entity that was deleted */
|
|
320
|
+
deletedEntityAsJson?: string | null;
|
|
321
|
+
}
|
|
322
|
+
export interface ActionEvent {
|
|
323
|
+
bodyAsJson?: string;
|
|
324
|
+
}
|
|
258
325
|
export interface FindOrCreateExtendedFieldResponseNonNullableFields {
|
|
259
326
|
field?: {
|
|
260
327
|
key: string;
|
|
@@ -8,16 +8,16 @@ var FieldDataType;
|
|
|
8
8
|
FieldDataType["NUMBER"] = "NUMBER";
|
|
9
9
|
FieldDataType["DATE"] = "DATE";
|
|
10
10
|
FieldDataType["URL"] = "URL";
|
|
11
|
-
})(FieldDataType
|
|
11
|
+
})(FieldDataType || (exports.FieldDataType = FieldDataType = {}));
|
|
12
12
|
var FieldType;
|
|
13
13
|
(function (FieldType) {
|
|
14
14
|
FieldType["UNKNOWN"] = "UNKNOWN";
|
|
15
15
|
FieldType["SYSTEM"] = "SYSTEM";
|
|
16
16
|
FieldType["USER_DEFINED"] = "USER_DEFINED";
|
|
17
|
-
})(FieldType
|
|
17
|
+
})(FieldType || (exports.FieldType = FieldType = {}));
|
|
18
18
|
var SortOrder;
|
|
19
19
|
(function (SortOrder) {
|
|
20
20
|
SortOrder["ASC"] = "ASC";
|
|
21
21
|
SortOrder["DESC"] = "DESC";
|
|
22
|
-
})(SortOrder
|
|
22
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
23
23
|
//# sourceMappingURL=contacts-v4-extended-field.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts-v4-extended-field.types.js","sourceRoot":"","sources":["../../../src/contacts-v4-extended-field.types.ts"],"names":[],"mappings":";;;AA4DA,IAAY,aAMX;AAND,WAAY,aAAa;IACvB,wDAAuC,CAAA;IACvC,8BAAa,CAAA;IACb,kCAAiB,CAAA;IACjB,8BAAa,CAAA;IACb,4BAAW,CAAA;AACb,CAAC,EANW,aAAa,
|
|
1
|
+
{"version":3,"file":"contacts-v4-extended-field.types.js","sourceRoot":"","sources":["../../../src/contacts-v4-extended-field.types.ts"],"names":[],"mappings":";;;AA4DA,IAAY,aAMX;AAND,WAAY,aAAa;IACvB,wDAAuC,CAAA;IACvC,8BAAa,CAAA;IACb,kCAAiB,CAAA;IACjB,8BAAa,CAAA;IACb,4BAAW,CAAA;AACb,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB;AAED,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,gCAAmB,CAAA;IACnB,8BAAiB,CAAA;IACjB,0CAA6B,CAAA;AAC/B,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB;AA+BD,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB"}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
verboseLogging: {
|
|
3
|
-
on: () => boolean;
|
|
4
|
-
off: () => boolean;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
1
|
+
import { EventDefinition } from '@wix/sdk-types';
|
|
7
2
|
/** Extended field that was found or created. */
|
|
8
3
|
export interface ExtendedField {
|
|
9
4
|
/**
|
|
10
5
|
* Extended field namespace.
|
|
11
6
|
*
|
|
12
|
-
* Extended fields created by site
|
|
7
|
+
* Extended fields created by site collaborators or 3rd-party apps
|
|
13
8
|
* are automatically assigned to the `custom` namespace.
|
|
14
9
|
* @readonly
|
|
15
10
|
*/
|
|
@@ -44,8 +39,8 @@ export interface ExtendedField {
|
|
|
44
39
|
* Indicates whether the extended field is a system field or custom field.
|
|
45
40
|
*
|
|
46
41
|
* One of:
|
|
47
|
-
* - `"SYSTEM"`:
|
|
48
|
-
* - `"USER_DEFINED"`:
|
|
42
|
+
* - `"SYSTEM"`: System field managed by Wix. System fields cannot be modified by 3rd-party apps or site contributors.
|
|
43
|
+
* - `"USER_DEFINED"`: Custom field that can be modified by 3rd-party apps or site admins.
|
|
49
44
|
* @readonly
|
|
50
45
|
*/
|
|
51
46
|
fieldType?: FieldType;
|
|
@@ -263,6 +258,81 @@ export interface QueryExtendedFieldsResponse {
|
|
|
263
258
|
/** Details on the paged set of results returned. */
|
|
264
259
|
pagingMetadata?: PagingMetadata;
|
|
265
260
|
}
|
|
261
|
+
export interface DomainEvent<T = string> extends DomainEventBodyOneOf<T> {
|
|
262
|
+
createdEvent?: EntityCreatedEvent<T>;
|
|
263
|
+
updatedEvent?: EntityUpdatedEvent<T>;
|
|
264
|
+
deletedEvent?: EntityDeletedEvent<T>;
|
|
265
|
+
actionEvent?: ActionEvent<T>;
|
|
266
|
+
/**
|
|
267
|
+
* Unique event ID.
|
|
268
|
+
* Allows clients to ignore duplicate webhooks.
|
|
269
|
+
*/
|
|
270
|
+
_id?: string;
|
|
271
|
+
/**
|
|
272
|
+
* Assumes actions are also always typed to an entity_type
|
|
273
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
274
|
+
*/
|
|
275
|
+
entityFqdn?: string;
|
|
276
|
+
/**
|
|
277
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
278
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
279
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
280
|
+
*/
|
|
281
|
+
slug?: string;
|
|
282
|
+
/** ID of the entity associated with the event. */
|
|
283
|
+
entityId?: string;
|
|
284
|
+
/** Event timestamp. */
|
|
285
|
+
eventTime?: Date;
|
|
286
|
+
/**
|
|
287
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
288
|
+
* (for example, GDPR).
|
|
289
|
+
*/
|
|
290
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
291
|
+
/** If present, indicates the action that triggered the event. */
|
|
292
|
+
originatedFrom?: string | null;
|
|
293
|
+
/**
|
|
294
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
295
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
296
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
297
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
298
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
299
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
300
|
+
*/
|
|
301
|
+
entityEventSequence?: string | null;
|
|
302
|
+
}
|
|
303
|
+
export interface DomainCreatedEvent<T> extends Omit<DomainEvent<T>, 'deletedEvent' | 'updatedEvent' | 'actionEvent'> {
|
|
304
|
+
}
|
|
305
|
+
export interface DomainDeletedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'updatedEvent' | 'actionEvent'> {
|
|
306
|
+
}
|
|
307
|
+
export interface DomainUpdatedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'actionEvent'> {
|
|
308
|
+
}
|
|
309
|
+
export interface DomainActionEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'updatedEvent'> {
|
|
310
|
+
}
|
|
311
|
+
/** @oneof */
|
|
312
|
+
export interface DomainEventBodyOneOf<T> {
|
|
313
|
+
createdEvent?: EntityCreatedEvent<T>;
|
|
314
|
+
updatedEvent?: EntityUpdatedEvent<T>;
|
|
315
|
+
deletedEvent?: EntityDeletedEvent<T>;
|
|
316
|
+
actionEvent?: ActionEvent<T>;
|
|
317
|
+
}
|
|
318
|
+
export interface EntityCreatedEvent<T> {
|
|
319
|
+
entity?: T;
|
|
320
|
+
}
|
|
321
|
+
export interface EntityUpdatedEvent<T> {
|
|
322
|
+
/**
|
|
323
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
324
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
325
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
326
|
+
*/
|
|
327
|
+
currentEntity?: T;
|
|
328
|
+
}
|
|
329
|
+
export interface EntityDeletedEvent<T> {
|
|
330
|
+
/** Entity that was deleted */
|
|
331
|
+
deletedEntity?: T | null;
|
|
332
|
+
}
|
|
333
|
+
export interface ActionEvent<T> {
|
|
334
|
+
body?: T;
|
|
335
|
+
}
|
|
266
336
|
export interface FindOrCreateExtendedFieldResponseNonNullableFields {
|
|
267
337
|
field?: {
|
|
268
338
|
key: string;
|
|
@@ -296,6 +366,9 @@ export interface QueryExtendedFieldsResponseNonNullableFields {
|
|
|
296
366
|
fieldType: FieldType;
|
|
297
367
|
}[];
|
|
298
368
|
}
|
|
369
|
+
export declare const onExtendedFieldCreated: EventDefinition<DomainCreatedEvent<ExtendedField>, "wix.contacts.v4.extended_field_created">;
|
|
370
|
+
export declare const onExtendedFieldUpdated: EventDefinition<DomainUpdatedEvent<ExtendedField>, "wix.contacts.v4.extended_field_updated">;
|
|
371
|
+
export declare const onExtendedFieldDeleted: EventDefinition<DomainDeletedEvent<ExtendedField>, "wix.contacts.v4.extended_field_deleted">;
|
|
299
372
|
/**
|
|
300
373
|
* Retrieves a custom field with a given name, or creates one if it doesn't exist.
|
|
301
374
|
*
|
|
@@ -303,9 +376,7 @@ export interface QueryExtendedFieldsResponseNonNullableFields {
|
|
|
303
376
|
*
|
|
304
377
|
* Successful calls to `findOrCreateExtendedField()` always return an extended field, which can be passed to subsequent function calls.
|
|
305
378
|
*
|
|
306
|
-
* To find an existing extended field without potentially creating a new one, use
|
|
307
|
-
*
|
|
308
|
-
* >**Note:** Only visitors with **Manage Contacts** permissions can find or create extended fields.
|
|
379
|
+
* To find an existing extended field without potentially creating a new one, use `getExtendedField()` or `queryExtendedFields()`.
|
|
309
380
|
*
|
|
310
381
|
* @param displayName - Display name to find or create.
|
|
311
382
|
*
|
|
@@ -322,9 +393,13 @@ export interface QueryExtendedFieldsResponseNonNullableFields {
|
|
|
322
393
|
* - `"DATE"`: Accepts dates formatted as `YYYY-MM-DD`.
|
|
323
394
|
* - `"URL"`: Accepts strings. Prepends `https://` if no protocol is included.
|
|
324
395
|
* @public
|
|
396
|
+
* @documentationMaturity preview
|
|
325
397
|
* @requiredField dataType
|
|
326
398
|
* @requiredField displayName
|
|
327
399
|
* @permissionScope Manage Contact Extended Fields
|
|
400
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-EX-FIELDS
|
|
401
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
402
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
328
403
|
* @applicableIdentity APP
|
|
329
404
|
* @returns Extended field that was found or created.
|
|
330
405
|
*/
|
|
@@ -334,7 +409,6 @@ export declare function findOrCreateExtendedField(displayName: string, dataType:
|
|
|
334
409
|
*
|
|
335
410
|
* The `getExtendedField()` function returns a Promise that resolves when the extended field is retrieved.
|
|
336
411
|
*
|
|
337
|
-
* >**Note:** Only visitors with **Manage Contacts** permissions can retrieve extended fields.
|
|
338
412
|
* @public
|
|
339
413
|
* @documentationMaturity preview
|
|
340
414
|
* @requiredField key
|
|
@@ -346,7 +420,12 @@ export declare function findOrCreateExtendedField(displayName: string, dataType:
|
|
|
346
420
|
* the value can be accessed at `fields["custom.notes"]`.
|
|
347
421
|
*
|
|
348
422
|
* Once set, `key` cannot be modified, even if `displayName` changes.
|
|
423
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
424
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
349
425
|
* @permissionScope Manage Contact Extended Fields
|
|
426
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-EX-FIELDS
|
|
427
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
428
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
350
429
|
* @applicableIdentity APP
|
|
351
430
|
* @returns The specified field.
|
|
352
431
|
*/
|
|
@@ -356,7 +435,6 @@ export declare function getExtendedField(key: string): Promise<ExtendedField & N
|
|
|
356
435
|
*
|
|
357
436
|
* The `renameExtendedField()` function returns a Promise that resolves when the specified extended field's display name is changed
|
|
358
437
|
*
|
|
359
|
-
* > **Note:** Only visitors with **Manage Contacts** permissions can rename extended fields.
|
|
360
438
|
* @public
|
|
361
439
|
* @documentationMaturity preview
|
|
362
440
|
* @requiredField field
|
|
@@ -370,8 +448,11 @@ export declare function getExtendedField(key: string): Promise<ExtendedField & N
|
|
|
370
448
|
* the value can be accessed at `fields["custom.notes"]`.
|
|
371
449
|
*
|
|
372
450
|
* Once set, `key` cannot be modified, even if `displayName` changes.
|
|
373
|
-
* @param field - Extended field
|
|
451
|
+
* @param field - Extended field to rename.
|
|
374
452
|
* @permissionScope Manage Contact Extended Fields
|
|
453
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-EX-FIELDS
|
|
454
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
455
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
375
456
|
* @applicableIdentity APP
|
|
376
457
|
* @returns Updated extended field.
|
|
377
458
|
*/
|
|
@@ -380,7 +461,7 @@ export interface RenameExtendedField {
|
|
|
380
461
|
/**
|
|
381
462
|
* Extended field namespace.
|
|
382
463
|
*
|
|
383
|
-
* Extended fields created by site
|
|
464
|
+
* Extended fields created by site collaborators or 3rd-party apps
|
|
384
465
|
* are automatically assigned to the `custom` namespace.
|
|
385
466
|
* @readonly
|
|
386
467
|
*/
|
|
@@ -402,8 +483,8 @@ export interface RenameExtendedField {
|
|
|
402
483
|
* Indicates whether the extended field is a system field or custom field.
|
|
403
484
|
*
|
|
404
485
|
* One of:
|
|
405
|
-
* - `"SYSTEM"`:
|
|
406
|
-
* - `"USER_DEFINED"`:
|
|
486
|
+
* - `"SYSTEM"`: System field managed by Wix. System fields cannot be modified by 3rd-party apps or site contributors.
|
|
487
|
+
* - `"USER_DEFINED"`: Custom field that can be modified by 3rd-party apps or site admins.
|
|
407
488
|
* @readonly
|
|
408
489
|
*/
|
|
409
490
|
fieldType?: FieldType;
|
|
@@ -430,42 +511,47 @@ export interface RenameExtendedField {
|
|
|
430
511
|
*
|
|
431
512
|
* When an extended field is deleted, any contact data stored in the field is permanently deleted as well.
|
|
432
513
|
*
|
|
433
|
-
* >**Note:** Only visitors with **Manage Contacts** permissions can delete extended fields.
|
|
434
514
|
* @param key - Extended field key.
|
|
435
515
|
* @public
|
|
436
516
|
* @documentationMaturity preview
|
|
437
517
|
* @requiredField key
|
|
438
518
|
* @permissionScope Manage Contact Extended Fields
|
|
519
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-EX-FIELDS
|
|
520
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
521
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
439
522
|
* @applicableIdentity APP
|
|
440
523
|
*/
|
|
441
524
|
export declare function deleteExtendedField(key: string): Promise<void>;
|
|
442
525
|
/**
|
|
443
526
|
* Creates a query to retrieve a list of extended fields.
|
|
444
527
|
*
|
|
445
|
-
* The `queryExtendedFields()` function builds a query to retrieve a list of extended fields and returns an
|
|
528
|
+
* The `queryExtendedFields()` function builds a query to retrieve a list of extended fields and returns an `FieldsQueryBuilder` object.
|
|
446
529
|
*
|
|
447
|
-
* The returned object contains the query definition, which is used to run the query using the
|
|
530
|
+
* The returned object contains the query definition, which is used to run the query using the `find()` function.
|
|
448
531
|
*
|
|
449
532
|
* You can refine the query by chaining `FieldsQueryBuilder` functions onto the query. `FieldsQueryBuilder` functions enable you to filter, sort, and control the results that `queryExtendedFields()` returns.
|
|
450
533
|
*
|
|
451
534
|
* `queryExtendedFields()` runs with these `FieldsQueryBuilder` defaults, which you can override:
|
|
452
|
-
* -
|
|
453
|
-
* -
|
|
454
|
-
* -
|
|
455
|
-
*
|
|
456
|
-
* > **Note:** Only visitors with **Manage Contacts** permissions can query extended fields.
|
|
535
|
+
* - `skip()`
|
|
536
|
+
* - `limit(50)`
|
|
537
|
+
* - `descending('_createdDate')`
|
|
457
538
|
*
|
|
458
|
-
* The following `FieldsQueryBuilder` functions are supported for `queryExtendedFields()`. For a full description of the `Extended Field` object, see the object returned for the
|
|
539
|
+
* The following `FieldsQueryBuilder` functions are supported for `queryExtendedFields()`. For a full description of the `Extended Field` object, see the object returned for the `items` property in `FieldsQueryResult`.
|
|
459
540
|
* @public
|
|
460
541
|
* @documentationMaturity preview
|
|
542
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
543
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
461
544
|
* @permissionScope Manage Contact Extended Fields
|
|
545
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-EX-FIELDS
|
|
546
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
547
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
462
548
|
* @applicableIdentity APP
|
|
463
549
|
*/
|
|
464
550
|
export declare function queryExtendedFields(): FieldsQueryBuilder;
|
|
465
551
|
interface QueryOffsetResult {
|
|
466
|
-
currentPage: number;
|
|
467
|
-
totalPages: number;
|
|
468
|
-
totalCount: number;
|
|
552
|
+
currentPage: number | undefined;
|
|
553
|
+
totalPages: number | undefined;
|
|
554
|
+
totalCount: number | undefined;
|
|
469
555
|
hasNext: () => boolean;
|
|
470
556
|
hasPrev: () => boolean;
|
|
471
557
|
length: number;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -28,24 +32,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
28
32
|
});
|
|
29
33
|
};
|
|
30
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.queryExtendedFields = exports.deleteExtendedField = exports.renameExtendedField = exports.getExtendedField = exports.findOrCreateExtendedField = exports.
|
|
35
|
+
exports.queryExtendedFields = exports.deleteExtendedField = exports.renameExtendedField = exports.getExtendedField = exports.findOrCreateExtendedField = exports.onExtendedFieldDeleted = exports.onExtendedFieldUpdated = exports.onExtendedFieldCreated = exports.SortOrder = exports.FieldType = exports.FieldDataType = void 0;
|
|
32
36
|
const velo_1 = require("@wix/metro-runtime/velo");
|
|
37
|
+
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
38
|
+
const sdk_types_1 = require("@wix/sdk-types");
|
|
33
39
|
const ambassadorWixContactsV4ExtendedField = __importStar(require("./contacts-v4-extended-field.http"));
|
|
34
40
|
// @ts-ignore
|
|
35
41
|
const motion_edm_autogen_query_wrapper_1 = require("@wix/motion-edm-autogen-query-wrapper");
|
|
36
|
-
let __verbose = false;
|
|
37
|
-
function __log(...args) {
|
|
38
|
-
__verbose && console.log(...args);
|
|
39
|
-
}
|
|
40
|
-
function __inspect(obj) {
|
|
41
|
-
return obj;
|
|
42
|
-
}
|
|
43
|
-
exports.__debug = {
|
|
44
|
-
verboseLogging: {
|
|
45
|
-
on: () => (__verbose = true),
|
|
46
|
-
off: () => (__verbose = false),
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
42
|
const _toVeloEntity = '$';
|
|
50
43
|
const _fromVeloEntity = '$';
|
|
51
44
|
var FieldDataType;
|
|
@@ -55,18 +48,18 @@ var FieldDataType;
|
|
|
55
48
|
FieldDataType["NUMBER"] = "NUMBER";
|
|
56
49
|
FieldDataType["DATE"] = "DATE";
|
|
57
50
|
FieldDataType["URL"] = "URL";
|
|
58
|
-
})(FieldDataType
|
|
51
|
+
})(FieldDataType || (exports.FieldDataType = FieldDataType = {}));
|
|
59
52
|
var FieldType;
|
|
60
53
|
(function (FieldType) {
|
|
61
54
|
FieldType["UNKNOWN"] = "UNKNOWN";
|
|
62
55
|
FieldType["SYSTEM"] = "SYSTEM";
|
|
63
56
|
FieldType["USER_DEFINED"] = "USER_DEFINED";
|
|
64
|
-
})(FieldType
|
|
57
|
+
})(FieldType || (exports.FieldType = FieldType = {}));
|
|
65
58
|
var SortOrder;
|
|
66
59
|
(function (SortOrder) {
|
|
67
60
|
SortOrder["ASC"] = "ASC";
|
|
68
61
|
SortOrder["DESC"] = "DESC";
|
|
69
|
-
})(SortOrder
|
|
62
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
70
63
|
const _deleteExtendedFieldRequest = {};
|
|
71
64
|
const _deleteExtendedFieldResponse = {};
|
|
72
65
|
const _findOrCreateExtendedFieldRequest = {};
|
|
@@ -77,6 +70,9 @@ const _queryExtendedFieldsRequest = {};
|
|
|
77
70
|
const _queryExtendedFieldsResponse = {};
|
|
78
71
|
const _updateExtendedFieldRequest = {};
|
|
79
72
|
const _updateExtendedFieldResponse = {};
|
|
73
|
+
exports.onExtendedFieldCreated = (0, sdk_types_1.EventDefinition)('wix.contacts.v4.extended_field_created')();
|
|
74
|
+
exports.onExtendedFieldUpdated = (0, sdk_types_1.EventDefinition)('wix.contacts.v4.extended_field_updated')();
|
|
75
|
+
exports.onExtendedFieldDeleted = (0, sdk_types_1.EventDefinition)('wix.contacts.v4.extended_field_deleted')();
|
|
80
76
|
/**
|
|
81
77
|
* Retrieves a custom field with a given name, or creates one if it doesn't exist.
|
|
82
78
|
*
|
|
@@ -84,9 +80,7 @@ const _updateExtendedFieldResponse = {};
|
|
|
84
80
|
*
|
|
85
81
|
* Successful calls to `findOrCreateExtendedField()` always return an extended field, which can be passed to subsequent function calls.
|
|
86
82
|
*
|
|
87
|
-
* To find an existing extended field without potentially creating a new one, use
|
|
88
|
-
*
|
|
89
|
-
* >**Note:** Only visitors with **Manage Contacts** permissions can find or create extended fields.
|
|
83
|
+
* To find an existing extended field without potentially creating a new one, use `getExtendedField()` or `queryExtendedFields()`.
|
|
90
84
|
*
|
|
91
85
|
* @param displayName - Display name to find or create.
|
|
92
86
|
*
|
|
@@ -103,9 +97,13 @@ const _updateExtendedFieldResponse = {};
|
|
|
103
97
|
* - `"DATE"`: Accepts dates formatted as `YYYY-MM-DD`.
|
|
104
98
|
* - `"URL"`: Accepts strings. Prepends `https://` if no protocol is included.
|
|
105
99
|
* @public
|
|
100
|
+
* @documentationMaturity preview
|
|
106
101
|
* @requiredField dataType
|
|
107
102
|
* @requiredField displayName
|
|
108
103
|
* @permissionScope Manage Contact Extended Fields
|
|
104
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-EX-FIELDS
|
|
105
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
106
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
109
107
|
* @applicableIdentity APP
|
|
110
108
|
* @returns Extended field that was found or created.
|
|
111
109
|
*/
|
|
@@ -136,7 +134,6 @@ function findOrCreateExtendedField(displayName, dataType) {
|
|
|
136
134
|
});
|
|
137
135
|
const payload = toAmbassadorRequest([displayName, dataType]);
|
|
138
136
|
const reqOpts = ambassadorWixContactsV4ExtendedField.findOrCreateExtendedField(payload);
|
|
139
|
-
__log(`"FindOrCreateExtendedField" sending request with: ${__inspect(reqOpts)}`);
|
|
140
137
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
141
138
|
try {
|
|
142
139
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -144,10 +141,11 @@ function findOrCreateExtendedField(displayName, dataType) {
|
|
|
144
141
|
return fromJSON(result.data);
|
|
145
142
|
}
|
|
146
143
|
catch (err) {
|
|
147
|
-
const transformedError = (0,
|
|
148
|
-
|
|
149
|
-
'dataType',
|
|
150
|
-
|
|
144
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
145
|
+
spreadPathsToArguments: {},
|
|
146
|
+
explicitPathsToArguments: { displayName: '$[0]', dataType: '$[1]' },
|
|
147
|
+
singleArgumentUnchanged: false,
|
|
148
|
+
}, ['displayName', 'dataType']);
|
|
151
149
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
152
150
|
throw transformedError;
|
|
153
151
|
}
|
|
@@ -159,7 +157,6 @@ exports.findOrCreateExtendedField = findOrCreateExtendedField;
|
|
|
159
157
|
*
|
|
160
158
|
* The `getExtendedField()` function returns a Promise that resolves when the extended field is retrieved.
|
|
161
159
|
*
|
|
162
|
-
* >**Note:** Only visitors with **Manage Contacts** permissions can retrieve extended fields.
|
|
163
160
|
* @public
|
|
164
161
|
* @documentationMaturity preview
|
|
165
162
|
* @requiredField key
|
|
@@ -171,7 +168,12 @@ exports.findOrCreateExtendedField = findOrCreateExtendedField;
|
|
|
171
168
|
* the value can be accessed at `fields["custom.notes"]`.
|
|
172
169
|
*
|
|
173
170
|
* Once set, `key` cannot be modified, even if `displayName` changes.
|
|
171
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
172
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
174
173
|
* @permissionScope Manage Contact Extended Fields
|
|
174
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-EX-FIELDS
|
|
175
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
176
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
175
177
|
* @applicableIdentity APP
|
|
176
178
|
* @returns The specified field.
|
|
177
179
|
*/
|
|
@@ -202,7 +204,6 @@ function getExtendedField(key) {
|
|
|
202
204
|
});
|
|
203
205
|
const payload = toAmbassadorRequest([key]);
|
|
204
206
|
const reqOpts = ambassadorWixContactsV4ExtendedField.getExtendedField(payload);
|
|
205
|
-
__log(`"GetExtendedField" sending request with: ${__inspect(reqOpts)}`);
|
|
206
207
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
207
208
|
try {
|
|
208
209
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -210,9 +211,11 @@ function getExtendedField(key) {
|
|
|
210
211
|
return fromJSON(result.data);
|
|
211
212
|
}
|
|
212
213
|
catch (err) {
|
|
213
|
-
const transformedError = (0,
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
215
|
+
spreadPathsToArguments: {},
|
|
216
|
+
explicitPathsToArguments: { key: '$[0]' },
|
|
217
|
+
singleArgumentUnchanged: false,
|
|
218
|
+
}, ['key']);
|
|
216
219
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
217
220
|
throw transformedError;
|
|
218
221
|
}
|
|
@@ -224,7 +227,6 @@ exports.getExtendedField = getExtendedField;
|
|
|
224
227
|
*
|
|
225
228
|
* The `renameExtendedField()` function returns a Promise that resolves when the specified extended field's display name is changed
|
|
226
229
|
*
|
|
227
|
-
* > **Note:** Only visitors with **Manage Contacts** permissions can rename extended fields.
|
|
228
230
|
* @public
|
|
229
231
|
* @documentationMaturity preview
|
|
230
232
|
* @requiredField field
|
|
@@ -238,8 +240,11 @@ exports.getExtendedField = getExtendedField;
|
|
|
238
240
|
* the value can be accessed at `fields["custom.notes"]`.
|
|
239
241
|
*
|
|
240
242
|
* Once set, `key` cannot be modified, even if `displayName` changes.
|
|
241
|
-
* @param field - Extended field
|
|
243
|
+
* @param field - Extended field to rename.
|
|
242
244
|
* @permissionScope Manage Contact Extended Fields
|
|
245
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-EX-FIELDS
|
|
246
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
247
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
243
248
|
* @applicableIdentity APP
|
|
244
249
|
* @returns Updated extended field.
|
|
245
250
|
*/
|
|
@@ -270,7 +275,6 @@ function renameExtendedField(key, field) {
|
|
|
270
275
|
});
|
|
271
276
|
const payload = toAmbassadorRequest([key, field]);
|
|
272
277
|
const reqOpts = ambassadorWixContactsV4ExtendedField.updateExtendedField(payload);
|
|
273
|
-
__log(`"UpdateExtendedField" sending request with: ${__inspect(reqOpts)}`);
|
|
274
278
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
275
279
|
try {
|
|
276
280
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -278,10 +282,11 @@ function renameExtendedField(key, field) {
|
|
|
278
282
|
return fromJSON(result.data);
|
|
279
283
|
}
|
|
280
284
|
catch (err) {
|
|
281
|
-
const transformedError = (0,
|
|
282
|
-
'
|
|
283
|
-
'field',
|
|
284
|
-
|
|
285
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
286
|
+
spreadPathsToArguments: { field: '$[1]' },
|
|
287
|
+
explicitPathsToArguments: { 'field.key': '$[0]' },
|
|
288
|
+
singleArgumentUnchanged: false,
|
|
289
|
+
}, ['key', 'field']);
|
|
285
290
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
286
291
|
throw transformedError;
|
|
287
292
|
}
|
|
@@ -295,12 +300,14 @@ exports.renameExtendedField = renameExtendedField;
|
|
|
295
300
|
*
|
|
296
301
|
* When an extended field is deleted, any contact data stored in the field is permanently deleted as well.
|
|
297
302
|
*
|
|
298
|
-
* >**Note:** Only visitors with **Manage Contacts** permissions can delete extended fields.
|
|
299
303
|
* @param key - Extended field key.
|
|
300
304
|
* @public
|
|
301
305
|
* @documentationMaturity preview
|
|
302
306
|
* @requiredField key
|
|
303
307
|
* @permissionScope Manage Contact Extended Fields
|
|
308
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-EX-FIELDS
|
|
309
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
310
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
304
311
|
* @applicableIdentity APP
|
|
305
312
|
*/
|
|
306
313
|
function deleteExtendedField(key) {
|
|
@@ -330,16 +337,17 @@ function deleteExtendedField(key) {
|
|
|
330
337
|
});
|
|
331
338
|
const payload = toAmbassadorRequest([key]);
|
|
332
339
|
const reqOpts = ambassadorWixContactsV4ExtendedField.deleteExtendedField(payload);
|
|
333
|
-
__log(`"DeleteExtendedField" sending request with: ${__inspect(reqOpts)}`);
|
|
334
340
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
335
341
|
try {
|
|
336
342
|
const result = yield httpClient.request(reqOpts);
|
|
337
343
|
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
338
344
|
}
|
|
339
345
|
catch (err) {
|
|
340
|
-
const transformedError = (0,
|
|
341
|
-
|
|
342
|
-
|
|
346
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
347
|
+
spreadPathsToArguments: {},
|
|
348
|
+
explicitPathsToArguments: { key: '$[0]' },
|
|
349
|
+
singleArgumentUnchanged: false,
|
|
350
|
+
}, ['key']);
|
|
343
351
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
344
352
|
throw transformedError;
|
|
345
353
|
}
|
|
@@ -349,23 +357,26 @@ exports.deleteExtendedField = deleteExtendedField;
|
|
|
349
357
|
/**
|
|
350
358
|
* Creates a query to retrieve a list of extended fields.
|
|
351
359
|
*
|
|
352
|
-
* The `queryExtendedFields()` function builds a query to retrieve a list of extended fields and returns an
|
|
360
|
+
* The `queryExtendedFields()` function builds a query to retrieve a list of extended fields and returns an `FieldsQueryBuilder` object.
|
|
353
361
|
*
|
|
354
|
-
* The returned object contains the query definition, which is used to run the query using the
|
|
362
|
+
* The returned object contains the query definition, which is used to run the query using the `find()` function.
|
|
355
363
|
*
|
|
356
364
|
* You can refine the query by chaining `FieldsQueryBuilder` functions onto the query. `FieldsQueryBuilder` functions enable you to filter, sort, and control the results that `queryExtendedFields()` returns.
|
|
357
365
|
*
|
|
358
366
|
* `queryExtendedFields()` runs with these `FieldsQueryBuilder` defaults, which you can override:
|
|
359
|
-
* -
|
|
360
|
-
* -
|
|
361
|
-
* -
|
|
362
|
-
*
|
|
363
|
-
* > **Note:** Only visitors with **Manage Contacts** permissions can query extended fields.
|
|
367
|
+
* - `skip()`
|
|
368
|
+
* - `limit(50)`
|
|
369
|
+
* - `descending('_createdDate')`
|
|
364
370
|
*
|
|
365
|
-
* The following `FieldsQueryBuilder` functions are supported for `queryExtendedFields()`. For a full description of the `Extended Field` object, see the object returned for the
|
|
371
|
+
* The following `FieldsQueryBuilder` functions are supported for `queryExtendedFields()`. For a full description of the `Extended Field` object, see the object returned for the `items` property in `FieldsQueryResult`.
|
|
366
372
|
* @public
|
|
367
373
|
* @documentationMaturity preview
|
|
374
|
+
* @permissionScope Manage Bookings Services and Settings
|
|
375
|
+
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
368
376
|
* @permissionScope Manage Contact Extended Fields
|
|
377
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-EX-FIELDS
|
|
378
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
379
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
369
380
|
* @applicableIdentity APP
|
|
370
381
|
*/
|
|
371
382
|
function queryExtendedFields() {
|