@wix/crm 1.0.33 → 1.0.35
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/src/contacts-v4-contact.http.d.ts +1 -44
- package/build/cjs/src/contacts-v4-contact.http.js +1 -78
- package/build/cjs/src/contacts-v4-contact.http.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.public.d.ts +2 -3
- package/build/cjs/src/contacts-v4-contact.public.js +1 -7
- package/build/cjs/src/contacts-v4-contact.public.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.universal.d.ts +0 -145
- package/build/cjs/src/contacts-v4-contact.universal.js +1 -126
- package/build/cjs/src/contacts-v4-contact.universal.js.map +1 -1
- package/build/cjs/src/crm-tasks-v1-task.universal.d.ts +2 -2
- package/build/es/src/contacts-v4-contact.http.d.ts +1 -44
- package/build/es/src/contacts-v4-contact.http.js +0 -76
- package/build/es/src/contacts-v4-contact.http.js.map +1 -1
- package/build/es/src/contacts-v4-contact.public.d.ts +2 -3
- package/build/es/src/contacts-v4-contact.public.js +1 -6
- package/build/es/src/contacts-v4-contact.public.js.map +1 -1
- package/build/es/src/contacts-v4-contact.universal.d.ts +0 -145
- package/build/es/src/contacts-v4-contact.universal.js +1 -125
- package/build/es/src/contacts-v4-contact.universal.js.map +1 -1
- package/build/es/src/crm-tasks-v1-task.universal.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
-
import { CreateContactRequest, CreateContactResponse, DeleteContactRequest, DeleteContactResponse, GetContactRequest, GetContactResponse, LabelContactRequest, LabelContactResponse, MergeContactsRequest, MergeContactsResponse,
|
|
2
|
+
import { CreateContactRequest, CreateContactResponse, DeleteContactRequest, DeleteContactResponse, GetContactRequest, GetContactResponse, LabelContactRequest, LabelContactResponse, MergeContactsRequest, MergeContactsResponse, UnlabelContactRequest, UnlabelContactResponse, UpdateContactRequest, UpdateContactResponse } from './contacts-v4-contact.types';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a new contact.
|
|
5
5
|
*
|
|
@@ -143,49 +143,6 @@ export declare function labelContact(payload: LabelContactRequest): RequestOptio
|
|
|
143
143
|
* -->
|
|
144
144
|
*/
|
|
145
145
|
export declare function unlabelContact(payload: UnlabelContactRequest): RequestOptionsFactory<UnlabelContactResponse>;
|
|
146
|
-
/**
|
|
147
|
-
* Creates a query to retrieve a list of contacts.
|
|
148
|
-
*
|
|
149
|
-
* The `queryContacts()` function builds a query to retrieve a list of contacts
|
|
150
|
-
* and returns a
|
|
151
|
-
* [`ContactsQueryBuilder`](#contactsquerybuilder)
|
|
152
|
-
* object.
|
|
153
|
-
*
|
|
154
|
-
* The returned object contains the query definition,
|
|
155
|
-
* which is typically used to run the query using the
|
|
156
|
-
* [`find()`](#contactsquerybuilder/find)
|
|
157
|
-
* function.
|
|
158
|
-
*
|
|
159
|
-
* You can refine the query
|
|
160
|
-
* by chaining `ContactsQueryBuilder` functions onto the query.
|
|
161
|
-
* `ContactsQueryBuilder` functions enable you to sort, filter,
|
|
162
|
-
* and control the results `queryContacts()` returns.
|
|
163
|
-
*
|
|
164
|
-
* `queryContacts()` runs with these `ContactsQueryBuilder` defaults,
|
|
165
|
-
* which you can override:
|
|
166
|
-
*
|
|
167
|
-
* - [`skip(0)`](#contactsquerybuilder/skip)
|
|
168
|
-
* - [`limit(50)`](#contactsquerybuilder/limit)
|
|
169
|
-
* - [`descending("_createdDate")`](#contactsquerybuilder/descending)
|
|
170
|
-
*
|
|
171
|
-
* The functions that are chained to `queryContacts()`
|
|
172
|
-
* are applied in the order they are called.
|
|
173
|
-
* For example, if you apply `ascending('info.company')`
|
|
174
|
-
* and then `descending('info.name.last')`,
|
|
175
|
-
* the results are sorted first by the company name, and then,
|
|
176
|
-
* if there are multiple results with the same company,
|
|
177
|
-
* the items are sorted by last name.
|
|
178
|
-
*
|
|
179
|
-
* <!--
|
|
180
|
-
* > **Note:**
|
|
181
|
-
* > Only visitors with
|
|
182
|
-
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
183
|
-
* > can query contacts.
|
|
184
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`
|
|
185
|
-
* > in the [`find()`](wix-crm-backend/contacts/contactsquerybuilder/find) function.
|
|
186
|
-
* -->
|
|
187
|
-
*/
|
|
188
|
-
export declare function queryContacts(payload: QueryContactsRequest): RequestOptionsFactory<QueryContactsResponse>;
|
|
189
146
|
/**
|
|
190
147
|
* Retrieves a contact.
|
|
191
148
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getContact = exports.
|
|
3
|
+
exports.getContact = exports.unlabelContact = exports.labelContact = exports.deleteContact = exports.mergeContacts = exports.updateContact = exports.createContact = void 0;
|
|
4
4
|
const metro_runtime_1 = require("@wix/metro-runtime");
|
|
5
5
|
const ambassador_1 = require("@wix/metro-runtime/ambassador");
|
|
6
6
|
const metro_runtime_2 = require("@wix/metro-runtime");
|
|
@@ -35,8 +35,6 @@ const _labelContactRequest = {};
|
|
|
35
35
|
const _labelContactResponse = { contact: '_contact' };
|
|
36
36
|
const _mergeContactsRequest = {};
|
|
37
37
|
const _mergeContactsResponse = { contact: '_contact' };
|
|
38
|
-
const _queryContactsRequest = {};
|
|
39
|
-
const _queryContactsResponse = { contacts: '_contact' };
|
|
40
38
|
const _unlabelContactRequest = {};
|
|
41
39
|
const _unlabelContactResponse = { contact: '_contact' };
|
|
42
40
|
const _updateContactRequest = {
|
|
@@ -442,81 +440,6 @@ function unlabelContact(payload) {
|
|
|
442
440
|
return __unlabelContact;
|
|
443
441
|
}
|
|
444
442
|
exports.unlabelContact = unlabelContact;
|
|
445
|
-
/**
|
|
446
|
-
* Creates a query to retrieve a list of contacts.
|
|
447
|
-
*
|
|
448
|
-
* The `queryContacts()` function builds a query to retrieve a list of contacts
|
|
449
|
-
* and returns a
|
|
450
|
-
* [`ContactsQueryBuilder`](#contactsquerybuilder)
|
|
451
|
-
* object.
|
|
452
|
-
*
|
|
453
|
-
* The returned object contains the query definition,
|
|
454
|
-
* which is typically used to run the query using the
|
|
455
|
-
* [`find()`](#contactsquerybuilder/find)
|
|
456
|
-
* function.
|
|
457
|
-
*
|
|
458
|
-
* You can refine the query
|
|
459
|
-
* by chaining `ContactsQueryBuilder` functions onto the query.
|
|
460
|
-
* `ContactsQueryBuilder` functions enable you to sort, filter,
|
|
461
|
-
* and control the results `queryContacts()` returns.
|
|
462
|
-
*
|
|
463
|
-
* `queryContacts()` runs with these `ContactsQueryBuilder` defaults,
|
|
464
|
-
* which you can override:
|
|
465
|
-
*
|
|
466
|
-
* - [`skip(0)`](#contactsquerybuilder/skip)
|
|
467
|
-
* - [`limit(50)`](#contactsquerybuilder/limit)
|
|
468
|
-
* - [`descending("_createdDate")`](#contactsquerybuilder/descending)
|
|
469
|
-
*
|
|
470
|
-
* The functions that are chained to `queryContacts()`
|
|
471
|
-
* are applied in the order they are called.
|
|
472
|
-
* For example, if you apply `ascending('info.company')`
|
|
473
|
-
* and then `descending('info.name.last')`,
|
|
474
|
-
* the results are sorted first by the company name, and then,
|
|
475
|
-
* if there are multiple results with the same company,
|
|
476
|
-
* the items are sorted by last name.
|
|
477
|
-
*
|
|
478
|
-
* <!--
|
|
479
|
-
* > **Note:**
|
|
480
|
-
* > Only visitors with
|
|
481
|
-
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
482
|
-
* > can query contacts.
|
|
483
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`
|
|
484
|
-
* > in the [`find()`](wix-crm-backend/contacts/contactsquerybuilder/find) function.
|
|
485
|
-
* -->
|
|
486
|
-
*/
|
|
487
|
-
function queryContacts(payload) {
|
|
488
|
-
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_queryContactsRequest, {});
|
|
489
|
-
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_queryContactsResponse, {
|
|
490
|
-
_address,
|
|
491
|
-
_addressLocation,
|
|
492
|
-
_contact,
|
|
493
|
-
_contactActivity,
|
|
494
|
-
_contactAddress,
|
|
495
|
-
_contactAddressesWrapper,
|
|
496
|
-
_contactInfo,
|
|
497
|
-
_contactPicture,
|
|
498
|
-
_image,
|
|
499
|
-
});
|
|
500
|
-
function __queryContacts({ host }) {
|
|
501
|
-
const serializedData = toReq(payload);
|
|
502
|
-
const metadata = {
|
|
503
|
-
entityFqdn: 'wix.contacts.v4.contact',
|
|
504
|
-
method: 'POST',
|
|
505
|
-
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.QueryContacts',
|
|
506
|
-
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
507
|
-
protoPath: '/v4/contacts/query',
|
|
508
|
-
data: serializedData,
|
|
509
|
-
host,
|
|
510
|
-
}),
|
|
511
|
-
data: serializedData,
|
|
512
|
-
transformResponse: fromRes,
|
|
513
|
-
};
|
|
514
|
-
return metadata;
|
|
515
|
-
}
|
|
516
|
-
__queryContacts.fromReq = fromReq;
|
|
517
|
-
return __queryContacts;
|
|
518
|
-
}
|
|
519
|
-
exports.queryContacts = queryContacts;
|
|
520
443
|
/**
|
|
521
444
|
* Retrieves a contact.
|
|
522
445
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts-v4-contact.http.js","sourceRoot":"","sources":["../../../src/contacts-v4-contact.http.ts"],"names":[],"mappings":";;;AAAA,sDAAuD;AACvD,8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AAS,YAAY,CAAC,EAAE,IAAI,EAAO;QACjC,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,yBAAyB;YACrC,MAAM,EAAE,KAAY;YACpB,SAAS,EACP,gEAAgE;YAClE,GAAG,EAAE,uDAAuD,CAAC;gBAC3D,SAAS,EAAE,mBAAmB;gBAC9B,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,MAAM,EAAE,IAAA,iCAAiB,EAAC,cAAc,CAAC;YACzC,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;IAE/B,OAAO,YAAY,CAAC;AACtB,CAAC;AAzCD,gCAyCC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from '@wix/sdk-types';
|
|
2
|
-
import { ContactInfo, UpdateContactOptions, CreateContactOptions, GetContactOptions, MergeContactsOptions
|
|
2
|
+
import { ContactInfo, UpdateContactOptions, CreateContactOptions, GetContactOptions, MergeContactsOptions } from './contacts-v4-contact.universal';
|
|
3
3
|
export declare const __metadata: {
|
|
4
4
|
PACKAGE_NAME: string;
|
|
5
5
|
};
|
|
@@ -9,7 +9,6 @@ export declare function mergeContacts(httpClient: HttpClient): (targetContactId:
|
|
|
9
9
|
export declare function deleteContact(httpClient: HttpClient): (contactId: string) => Promise<void>;
|
|
10
10
|
export declare function labelContact(httpClient: HttpClient): (contactId: string, labelKeys: string[]) => Promise<import("./contacts-v4-contact.universal").LabelContactResponse>;
|
|
11
11
|
export declare function unlabelContact(httpClient: HttpClient): (contactId: string, labelKeys: string[]) => Promise<import("./contacts-v4-contact.universal").UnlabelContactResponse>;
|
|
12
|
-
export declare function queryContacts(httpClient: HttpClient): (options?: QueryContactsOptions | undefined) => import("./contacts-v4-contact.universal").ContactsQueryBuilder;
|
|
13
12
|
export declare function getContact(httpClient: HttpClient): (_id: string, options?: GetContactOptions | undefined) => Promise<import("./contacts-v4-contact.universal").Contact>;
|
|
14
13
|
export { ContactSourceType, ContactActivityType, EmailTag, PhoneTag, AddressTag, SubdivisionType, ImageProvider, SortOrder, ContactFieldSet, ContactsFacetType, Action, UpsertContactResponseAction, GetContactResponseType, SubmitOperation, Mode, } from './contacts-v4-contact.universal';
|
|
15
|
-
export { Contact, ContactSource, ContactActivity, PrimaryContactInfo, ContactInfo, ContactName, ContactEmailsWrapper, ContactEmail, ContactPhonesWrapper, ContactPhone, ContactAddressesWrapper, ContactAddress, Address, AddressStreetOneOf, StreetAddress, AddressLocation, Subdivision, AssigneesWrapper, LabelsWrapper, ExtendedFieldsWrapper, LocationsWrapper, ContactPicture, SegmentsWrapper, EstimateFilterSizeRequest, EstimateFilterSizeResponse, EstimateAudienceSizeRequest, EstimateAudienceSizeResponse, ContactSubmitted, ContactChanged, CreateContactRequest, CreateContactResponse, DuplicateContactExists, UpdateContactRequest, UpdateContactResponse, MergeContactsRequest, MergeContactsResponse, ContactMerged, PreviewMergeContactsRequest, PreviewMergeContactsResponse, DeleteContactRequest, DeleteContactResponse, LabelContactRequest, LabelContactResponse, UnlabelContactRequest, UnlabelContactResponse, LabelAndUnlabelContactRequest, LabelAndUnlabelContactResponse, ListContactsRequest, Sorting, Paging, ListContactsResponse, PagingMetadata, QueryContactsRequest, Query, QueryContactsResponse, ListFacetsRequest, ListFacetsResponse, ContactsFacet, QueryFacetsRequest, QueryFacetsResponse, BulkDeleteContactsRequest, BulkDeleteContactsResponse, BulkUpdateContactsRequest, BulkUpdateContactsResponse, BulkLabelAndUnlabelContactsRequest, BulkLabelAndUnlabelContactsResponse, BulkUpsertContactsRequest, BulkUpsertContactsResponse, Error, Metadata, Item, BulkUpsertContactsResponseMetadata, UpsertContactRequest, UpsertContactResponse, GeneratePictureUploadUrlRequest, GeneratePictureUploadUrlResponse, GetContactRequest, GetContactResponse, SyncSubmitContactRequest, SyncSubmitContactResponse, CountContactsRequest, CountContactsResponse, SearchContactsRequest, Search, SearchPagingMethodOneOf, SearchDetails, CursorPaging, SearchContactsResponse, PagingMetadataV2, Cursors, BulkAddSegmentToContactsRequest, BulkAddSegmentToContactsResponse, ItemMetadata, ApplicationError, BulkActionMetadata, ContactAddedToSegment, BulkRemoveSegmentFromContactsRequest, BulkRemoveSegmentFromContactsResponse, ContactRemovedFromSegment, CreateContactOptions, UpdateContactOptions, MergeContactsOptions,
|
|
14
|
+
export { Contact, ContactSource, ContactActivity, PrimaryContactInfo, ContactInfo, ContactName, ContactEmailsWrapper, ContactEmail, ContactPhonesWrapper, ContactPhone, ContactAddressesWrapper, ContactAddress, Address, AddressStreetOneOf, StreetAddress, AddressLocation, Subdivision, AssigneesWrapper, LabelsWrapper, ExtendedFieldsWrapper, LocationsWrapper, ContactPicture, SegmentsWrapper, EstimateFilterSizeRequest, EstimateFilterSizeResponse, EstimateAudienceSizeRequest, EstimateAudienceSizeResponse, ContactSubmitted, ContactChanged, CreateContactRequest, CreateContactResponse, DuplicateContactExists, UpdateContactRequest, UpdateContactResponse, MergeContactsRequest, MergeContactsResponse, ContactMerged, PreviewMergeContactsRequest, PreviewMergeContactsResponse, DeleteContactRequest, DeleteContactResponse, LabelContactRequest, LabelContactResponse, UnlabelContactRequest, UnlabelContactResponse, LabelAndUnlabelContactRequest, LabelAndUnlabelContactResponse, ListContactsRequest, Sorting, Paging, ListContactsResponse, PagingMetadata, QueryContactsRequest, Query, QueryContactsResponse, ListFacetsRequest, ListFacetsResponse, ContactsFacet, QueryFacetsRequest, QueryFacetsResponse, BulkDeleteContactsRequest, BulkDeleteContactsResponse, BulkUpdateContactsRequest, BulkUpdateContactsResponse, BulkLabelAndUnlabelContactsRequest, BulkLabelAndUnlabelContactsResponse, BulkUpsertContactsRequest, BulkUpsertContactsResponse, Error, Metadata, Item, BulkUpsertContactsResponseMetadata, UpsertContactRequest, UpsertContactResponse, GeneratePictureUploadUrlRequest, GeneratePictureUploadUrlResponse, GetContactRequest, GetContactResponse, SyncSubmitContactRequest, SyncSubmitContactResponse, CountContactsRequest, CountContactsResponse, SearchContactsRequest, Search, SearchPagingMethodOneOf, SearchDetails, CursorPaging, SearchContactsResponse, PagingMetadataV2, Cursors, BulkAddSegmentToContactsRequest, BulkAddSegmentToContactsResponse, ItemMetadata, ApplicationError, BulkActionMetadata, ContactAddedToSegment, BulkRemoveSegmentFromContactsRequest, BulkRemoveSegmentFromContactsResponse, ContactRemovedFromSegment, CreateContactOptions, UpdateContactOptions, MergeContactsOptions, GetContactOptions, } from './contacts-v4-contact.universal';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Mode = exports.SubmitOperation = exports.GetContactResponseType = exports.UpsertContactResponseAction = exports.Action = exports.ContactsFacetType = exports.ContactFieldSet = exports.SortOrder = exports.ImageProvider = exports.SubdivisionType = exports.AddressTag = exports.PhoneTag = exports.EmailTag = exports.ContactActivityType = exports.ContactSourceType = exports.getContact = exports.
|
|
3
|
+
exports.Mode = exports.SubmitOperation = exports.GetContactResponseType = exports.UpsertContactResponseAction = exports.Action = exports.ContactsFacetType = exports.ContactFieldSet = exports.SortOrder = exports.ImageProvider = exports.SubdivisionType = exports.AddressTag = exports.PhoneTag = exports.EmailTag = exports.ContactActivityType = exports.ContactSourceType = exports.getContact = exports.unlabelContact = exports.labelContact = exports.deleteContact = exports.mergeContacts = exports.updateContact = exports.createContact = exports.__metadata = void 0;
|
|
4
4
|
const contacts_v4_contact_universal_1 = require("./contacts-v4-contact.universal");
|
|
5
5
|
exports.__metadata = { PACKAGE_NAME: '@wix/crm' };
|
|
6
6
|
function createContact(httpClient) {
|
|
@@ -39,12 +39,6 @@ function unlabelContact(httpClient) {
|
|
|
39
39
|
{ httpClient });
|
|
40
40
|
}
|
|
41
41
|
exports.unlabelContact = unlabelContact;
|
|
42
|
-
function queryContacts(httpClient) {
|
|
43
|
-
return (options) => (0, contacts_v4_contact_universal_1.queryContacts)(options,
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
{ httpClient });
|
|
46
|
-
}
|
|
47
|
-
exports.queryContacts = queryContacts;
|
|
48
42
|
function getContact(httpClient) {
|
|
49
43
|
return (_id, options) => (0, contacts_v4_contact_universal_1.getContact)(_id, options,
|
|
50
44
|
// @ts-ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts-v4-contact.public.js","sourceRoot":"","sources":["../../../src/contacts-v4-contact.public.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"contacts-v4-contact.public.js","sourceRoot":"","sources":["../../../src/contacts-v4-contact.public.ts"],"names":[],"mappings":";;;AACA,mFAayC;AAE5B,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AAEvD,SAAgB,aAAa,CAAC,UAAsB;IAClD,OAAO,CAAC,IAAiB,EAAE,OAA8B,EAAE,EAAE,CAC3D,IAAA,6CAAsB,EACpB,IAAI,EACJ,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,sCAQC;AAED,SAAgB,aAAa,CAAC,UAAsB;IAClD,OAAO,CACL,SAAiB,EACjB,IAAiB,EACjB,OAA6B,EAC7B,EAAE,CACF,IAAA,6CAAsB,EACpB,SAAS,EACT,IAAI,EACJ,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAbD,sCAaC;AAED,SAAgB,aAAa,CAAC,UAAsB;IAClD,OAAO,CACL,eAAuB,EACvB,qBAAoC,EACpC,OAA8B,EAC9B,EAAE,CACF,IAAA,6CAAsB,EACpB,eAAe,EACf,qBAAqB,EACrB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAbD,sCAaC;AAED,SAAgB,aAAa,CAAC,UAAsB;IAClD,OAAO,CAAC,SAAiB,EAAE,EAAE,CAC3B,IAAA,6CAAsB,EACpB,SAAS;IACT,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,sCAOC;AAED,SAAgB,YAAY,CAAC,UAAsB;IACjD,OAAO,CAAC,SAAiB,EAAE,SAAmB,EAAE,EAAE,CAChD,IAAA,4CAAqB,EACnB,SAAS,EACT,SAAS;IACT,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,oCAQC;AAED,SAAgB,cAAc,CAAC,UAAsB;IACnD,OAAO,CAAC,SAAiB,EAAE,SAAmB,EAAE,EAAE,CAChD,IAAA,8CAAuB,EACrB,SAAS,EACT,SAAS;IACT,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,wCAQC;AAED,SAAgB,UAAU,CAAC,UAAsB;IAC/C,OAAO,CAAC,GAAW,EAAE,OAA2B,EAAE,EAAE,CAClD,IAAA,0CAAmB,EACjB,GAAG,EACH,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,gCAQC;AAED,iFAgByC;AAfvC,kIAAA,iBAAiB,OAAA;AACjB,oIAAA,mBAAmB,OAAA;AACnB,yHAAA,QAAQ,OAAA;AACR,yHAAA,QAAQ,OAAA;AACR,2HAAA,UAAU,OAAA;AACV,gIAAA,eAAe,OAAA;AACf,8HAAA,aAAa,OAAA;AACb,0HAAA,SAAS,OAAA;AACT,gIAAA,eAAe,OAAA;AACf,kIAAA,iBAAiB,OAAA;AACjB,uHAAA,MAAM,OAAA;AACN,4IAAA,2BAA2B,OAAA;AAC3B,uIAAA,sBAAsB,OAAA;AACtB,gIAAA,eAAe,OAAA;AACf,qHAAA,IAAI,OAAA"}
|
|
@@ -1358,8 +1358,6 @@ export interface ContactRemovedFromSegment {
|
|
|
1358
1358
|
* the new contact won't be created.
|
|
1359
1359
|
* To override this behavior,
|
|
1360
1360
|
* set `allowDuplicates` in the `options` object to `true`.
|
|
1361
|
-
*
|
|
1362
|
-
* This function is not a universal function and runs only on the backend.
|
|
1363
1361
|
* @param info - Contact info.
|
|
1364
1362
|
* @public
|
|
1365
1363
|
* @documentationMaturity preview
|
|
@@ -1402,8 +1400,6 @@ export interface CreateContactOptions {
|
|
|
1402
1400
|
* > can update contacts.
|
|
1403
1401
|
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
1404
1402
|
* -->
|
|
1405
|
-
*
|
|
1406
|
-
* This function is not a universal function and runs only on the backend.
|
|
1407
1403
|
* @param contactId - ID of the contact to update.
|
|
1408
1404
|
* @param info - Contact info.
|
|
1409
1405
|
* @public
|
|
@@ -1468,8 +1464,6 @@ export interface UpdateContactOptions {
|
|
|
1468
1464
|
* - Contact Deleted is triggered for each source contact. `originatedFrom` is set to `merge`.
|
|
1469
1465
|
*
|
|
1470
1466
|
* This function is not a universal function and runs only on the backend.
|
|
1471
|
-
*
|
|
1472
|
-
* This function is not a universal function and runs only on the backend.
|
|
1473
1467
|
* @param targetContactId - Target contact ID.
|
|
1474
1468
|
* @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
|
|
1475
1469
|
* To prevent conflicting changes,
|
|
@@ -1510,8 +1504,6 @@ export interface MergeContactsOptions {
|
|
|
1510
1504
|
* > can delete contacts.
|
|
1511
1505
|
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
1512
1506
|
* -->
|
|
1513
|
-
*
|
|
1514
|
-
* This function is not a universal function and runs only on the backend.
|
|
1515
1507
|
* @param contactId - ID of the contact to delete.
|
|
1516
1508
|
* @public
|
|
1517
1509
|
* @documentationMaturity preview
|
|
@@ -1534,8 +1526,6 @@ export declare function deleteContact(contactId: string): Promise<void>;
|
|
|
1534
1526
|
* > can label contacts.
|
|
1535
1527
|
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
1536
1528
|
* -->
|
|
1537
|
-
*
|
|
1538
|
-
* This function is not a universal function and runs only on the backend.
|
|
1539
1529
|
* @param contactId - ID of the contact to add labels to.
|
|
1540
1530
|
* @param labelKeys - List of label keys to add to the contact.
|
|
1541
1531
|
*
|
|
@@ -1569,8 +1559,6 @@ export declare function labelContact(contactId: string, labelKeys: string[]): Pr
|
|
|
1569
1559
|
* > can unlabel contacts.
|
|
1570
1560
|
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
1571
1561
|
* -->
|
|
1572
|
-
*
|
|
1573
|
-
* This function is not a universal function and runs only on the backend.
|
|
1574
1562
|
* @param contactId - ID of the contact to remove labels from.
|
|
1575
1563
|
* @param labelKeys - List of label keys to remove from the contact.
|
|
1576
1564
|
* @public
|
|
@@ -1580,136 +1568,6 @@ export declare function labelContact(contactId: string, labelKeys: string[]): Pr
|
|
|
1580
1568
|
* @returns Updated contact.
|
|
1581
1569
|
*/
|
|
1582
1570
|
export declare function unlabelContact(contactId: string, labelKeys: string[]): Promise<UnlabelContactResponse>;
|
|
1583
|
-
/**
|
|
1584
|
-
* Creates a query to retrieve a list of contacts.
|
|
1585
|
-
*
|
|
1586
|
-
* The `queryContacts()` function builds a query to retrieve a list of contacts
|
|
1587
|
-
* and returns a
|
|
1588
|
-
* [`ContactsQueryBuilder`](#contactsquerybuilder)
|
|
1589
|
-
* object.
|
|
1590
|
-
*
|
|
1591
|
-
* The returned object contains the query definition,
|
|
1592
|
-
* which is typically used to run the query using the
|
|
1593
|
-
* [`find()`](#contactsquerybuilder/find)
|
|
1594
|
-
* function.
|
|
1595
|
-
*
|
|
1596
|
-
* You can refine the query
|
|
1597
|
-
* by chaining `ContactsQueryBuilder` functions onto the query.
|
|
1598
|
-
* `ContactsQueryBuilder` functions enable you to sort, filter,
|
|
1599
|
-
* and control the results `queryContacts()` returns.
|
|
1600
|
-
*
|
|
1601
|
-
* `queryContacts()` runs with these `ContactsQueryBuilder` defaults,
|
|
1602
|
-
* which you can override:
|
|
1603
|
-
*
|
|
1604
|
-
* - [`skip(0)`](#contactsquerybuilder/skip)
|
|
1605
|
-
* - [`limit(50)`](#contactsquerybuilder/limit)
|
|
1606
|
-
* - [`descending("_createdDate")`](#contactsquerybuilder/descending)
|
|
1607
|
-
*
|
|
1608
|
-
* The functions that are chained to `queryContacts()`
|
|
1609
|
-
* are applied in the order they are called.
|
|
1610
|
-
* For example, if you apply `ascending('info.company')`
|
|
1611
|
-
* and then `descending('info.name.last')`,
|
|
1612
|
-
* the results are sorted first by the company name, and then,
|
|
1613
|
-
* if there are multiple results with the same company,
|
|
1614
|
-
* the items are sorted by last name.
|
|
1615
|
-
*
|
|
1616
|
-
* <!--
|
|
1617
|
-
* > **Note:**
|
|
1618
|
-
* > Only visitors with
|
|
1619
|
-
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
1620
|
-
* > can query contacts.
|
|
1621
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`
|
|
1622
|
-
* > in the [`find()`](wix-crm-backend/contacts/contactsquerybuilder/find) function.
|
|
1623
|
-
* -->
|
|
1624
|
-
*
|
|
1625
|
-
* This function is not a universal function and runs only on the backend.
|
|
1626
|
-
* @public
|
|
1627
|
-
* @documentationMaturity preview
|
|
1628
|
-
* @param options - Query contact options.
|
|
1629
|
-
* @permissionScope Read Contacts
|
|
1630
|
-
* @applicableIdentity APP
|
|
1631
|
-
*/
|
|
1632
|
-
export declare function queryContacts(options?: QueryContactsOptions): ContactsQueryBuilder;
|
|
1633
|
-
export interface QueryContactsOptions {
|
|
1634
|
-
/**
|
|
1635
|
-
* Plain text search for an exact match.
|
|
1636
|
-
*
|
|
1637
|
-
* Supported properties:
|
|
1638
|
-
* `info.name.first`, `info.name.last`, `info.emails.email`, `info.phones.phone`
|
|
1639
|
-
*
|
|
1640
|
-
* Max: 100 characters
|
|
1641
|
-
*/
|
|
1642
|
-
search?: string | null | undefined;
|
|
1643
|
-
}
|
|
1644
|
-
interface QueryOffsetResult {
|
|
1645
|
-
currentPage: number;
|
|
1646
|
-
totalPages: number;
|
|
1647
|
-
totalCount: number;
|
|
1648
|
-
hasNext: () => boolean;
|
|
1649
|
-
hasPrev: () => boolean;
|
|
1650
|
-
length: number;
|
|
1651
|
-
pageSize: number;
|
|
1652
|
-
}
|
|
1653
|
-
export interface ContactsQueryResult extends QueryOffsetResult {
|
|
1654
|
-
items: Contact[];
|
|
1655
|
-
query: ContactsQueryBuilder;
|
|
1656
|
-
next: () => Promise<ContactsQueryResult>;
|
|
1657
|
-
prev: () => Promise<ContactsQueryResult>;
|
|
1658
|
-
}
|
|
1659
|
-
export interface ContactsQueryBuilder {
|
|
1660
|
-
/** @param propertyName - Property whose value is compared with `value`.
|
|
1661
|
-
* @param value - Value to compare against.
|
|
1662
|
-
* @documentationMaturity preview
|
|
1663
|
-
*/
|
|
1664
|
-
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;
|
|
1665
|
-
/** @param propertyName - Property whose value is compared with `value`.
|
|
1666
|
-
* @param value - Value to compare against.
|
|
1667
|
-
* @documentationMaturity preview
|
|
1668
|
-
*/
|
|
1669
|
-
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;
|
|
1670
|
-
/** @param propertyName - Property whose value is compared with `value`.
|
|
1671
|
-
* @param value - Value to compare against.
|
|
1672
|
-
* @documentationMaturity preview
|
|
1673
|
-
*/
|
|
1674
|
-
gt: (propertyName: '_createdDate' | '_updatedDate' | 'lastActivity.activityDate', value: any) => ContactsQueryBuilder;
|
|
1675
|
-
/** @param propertyName - Property whose value is compared with `value`.
|
|
1676
|
-
* @param value - Value to compare against.
|
|
1677
|
-
* @documentationMaturity preview
|
|
1678
|
-
*/
|
|
1679
|
-
lt: (propertyName: '_createdDate' | '_updatedDate' | 'lastActivity.activityDate', value: any) => ContactsQueryBuilder;
|
|
1680
|
-
/** @param propertyName - Property whose value is compared with `string`.
|
|
1681
|
-
* @param string - String to compare against. Case-insensitive.
|
|
1682
|
-
* @documentationMaturity preview
|
|
1683
|
-
*/
|
|
1684
|
-
startsWith: (propertyName: 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle', value: string) => ContactsQueryBuilder;
|
|
1685
|
-
/** @param propertyName - Property whose value is compared with `values`.
|
|
1686
|
-
* @param values - List of values to compare against.
|
|
1687
|
-
* @documentationMaturity preview
|
|
1688
|
-
*/
|
|
1689
|
-
hasSome: (propertyName: '_createdDate' | '_updatedDate' | 'lastActivity.activityDate' | 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.labelKeys', value: any[]) => ContactsQueryBuilder;
|
|
1690
|
-
/** @documentationMaturity preview */
|
|
1691
|
-
in: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'lastActivity.activityDate' | 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.locale', value: any) => ContactsQueryBuilder;
|
|
1692
|
-
/** @documentationMaturity preview */
|
|
1693
|
-
exists: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'lastActivity.activityDate' | 'primaryInfo.email' | 'primaryInfo.phone' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.locale', value: boolean) => ContactsQueryBuilder;
|
|
1694
|
-
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
1695
|
-
* @documentationMaturity preview
|
|
1696
|
-
*/
|
|
1697
|
-
ascending: (...propertyNames: Array<'_createdDate' | 'lastActivity.activityDate' | 'primaryInfo.email' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.birthdate'>) => ContactsQueryBuilder;
|
|
1698
|
-
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
1699
|
-
* @documentationMaturity preview
|
|
1700
|
-
*/
|
|
1701
|
-
descending: (...propertyNames: Array<'_createdDate' | 'lastActivity.activityDate' | 'primaryInfo.email' | 'info.name.first' | 'info.name.last' | 'info.company' | 'info.jobTitle' | 'info.birthdate'>) => ContactsQueryBuilder;
|
|
1702
|
-
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
1703
|
-
* @documentationMaturity preview
|
|
1704
|
-
*/
|
|
1705
|
-
limit: (limit: number) => ContactsQueryBuilder;
|
|
1706
|
-
/** @param skip - Number of items to skip in the query results before returning the results.
|
|
1707
|
-
* @documentationMaturity preview
|
|
1708
|
-
*/
|
|
1709
|
-
skip: (skip: number) => ContactsQueryBuilder;
|
|
1710
|
-
/** @documentationMaturity preview */
|
|
1711
|
-
find: () => Promise<ContactsQueryResult>;
|
|
1712
|
-
}
|
|
1713
1571
|
/**
|
|
1714
1572
|
* Retrieves a contact.
|
|
1715
1573
|
*
|
|
@@ -1732,8 +1590,6 @@ export interface ContactsQueryBuilder {
|
|
|
1732
1590
|
* > can retrieve contacts.
|
|
1733
1591
|
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
1734
1592
|
* -->
|
|
1735
|
-
*
|
|
1736
|
-
* This function is not a universal function and runs only on the backend.
|
|
1737
1593
|
* @param _id - ID of the contact to retrieve.
|
|
1738
1594
|
* @public
|
|
1739
1595
|
* @documentationMaturity preview
|
|
@@ -1772,4 +1628,3 @@ export interface GetContactOptions {
|
|
|
1772
1628
|
*/
|
|
1773
1629
|
fieldsets?: ContactFieldSet[];
|
|
1774
1630
|
}
|
|
1775
|
-
export {};
|
|
@@ -28,11 +28,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.getContact = exports.
|
|
31
|
+
exports.getContact = exports.unlabelContact = exports.labelContact = exports.deleteContact = exports.mergeContacts = exports.updateContact = exports.createContact = exports.Mode = exports.SubmitOperation = exports.GetContactResponseType = exports.UpsertContactResponseAction = exports.Action = exports.ContactsFacetType = exports.ContactFieldSet = exports.SortOrder = exports.ImageProvider = exports.SubdivisionType = exports.AddressTag = exports.PhoneTag = exports.EmailTag = exports.ContactActivityType = exports.ContactSourceType = exports.__debug = void 0;
|
|
32
32
|
const velo_1 = require("@wix/metro-runtime/velo");
|
|
33
33
|
const ambassadorWixContactsV4Contact = __importStar(require("./contacts-v4-contact.http"));
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
const motion_edm_autogen_query_wrapper_1 = require("@wix/motion-edm-autogen-query-wrapper");
|
|
36
34
|
let __verbose = false;
|
|
37
35
|
function __log(...args) {
|
|
38
36
|
__verbose && console.log(...args);
|
|
@@ -264,8 +262,6 @@ const _labelContactRequest = {};
|
|
|
264
262
|
const _labelContactResponse = { contact: '_contact' };
|
|
265
263
|
const _mergeContactsRequest = {};
|
|
266
264
|
const _mergeContactsResponse = { contact: '_contact' };
|
|
267
|
-
const _queryContactsRequest = {};
|
|
268
|
-
const _queryContactsResponse = { contacts: '_contact' };
|
|
269
265
|
const _unlabelContactRequest = {};
|
|
270
266
|
const _unlabelContactResponse = { contact: '_contact' };
|
|
271
267
|
const _updateContactRequest = { info: '_contactInfo' };
|
|
@@ -293,8 +289,6 @@ const _updateContactResponse = { contact: '_contact' };
|
|
|
293
289
|
* the new contact won't be created.
|
|
294
290
|
* To override this behavior,
|
|
295
291
|
* set `allowDuplicates` in the `options` object to `true`.
|
|
296
|
-
*
|
|
297
|
-
* This function is not a universal function and runs only on the backend.
|
|
298
292
|
* @param info - Contact info.
|
|
299
293
|
* @public
|
|
300
294
|
* @documentationMaturity preview
|
|
@@ -380,8 +374,6 @@ exports.createContact = createContact;
|
|
|
380
374
|
* > can update contacts.
|
|
381
375
|
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
382
376
|
* -->
|
|
383
|
-
*
|
|
384
|
-
* This function is not a universal function and runs only on the backend.
|
|
385
377
|
* @param contactId - ID of the contact to update.
|
|
386
378
|
* @param info - Contact info.
|
|
387
379
|
* @public
|
|
@@ -491,8 +483,6 @@ exports.updateContact = updateContact;
|
|
|
491
483
|
* - Contact Deleted is triggered for each source contact. `originatedFrom` is set to `merge`.
|
|
492
484
|
*
|
|
493
485
|
* This function is not a universal function and runs only on the backend.
|
|
494
|
-
*
|
|
495
|
-
* This function is not a universal function and runs only on the backend.
|
|
496
486
|
* @param targetContactId - Target contact ID.
|
|
497
487
|
* @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
|
|
498
488
|
* To prevent conflicting changes,
|
|
@@ -584,8 +574,6 @@ exports.mergeContacts = mergeContacts;
|
|
|
584
574
|
* > can delete contacts.
|
|
585
575
|
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
586
576
|
* -->
|
|
587
|
-
*
|
|
588
|
-
* This function is not a universal function and runs only on the backend.
|
|
589
577
|
* @param contactId - ID of the contact to delete.
|
|
590
578
|
* @public
|
|
591
579
|
* @documentationMaturity preview
|
|
@@ -651,8 +639,6 @@ exports.deleteContact = deleteContact;
|
|
|
651
639
|
* > can label contacts.
|
|
652
640
|
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
653
641
|
* -->
|
|
654
|
-
*
|
|
655
|
-
* This function is not a universal function and runs only on the backend.
|
|
656
642
|
* @param contactId - ID of the contact to add labels to.
|
|
657
643
|
* @param labelKeys - List of label keys to add to the contact.
|
|
658
644
|
*
|
|
@@ -736,8 +722,6 @@ exports.labelContact = labelContact;
|
|
|
736
722
|
* > can unlabel contacts.
|
|
737
723
|
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
738
724
|
* -->
|
|
739
|
-
*
|
|
740
|
-
* This function is not a universal function and runs only on the backend.
|
|
741
725
|
* @param contactId - ID of the contact to remove labels from.
|
|
742
726
|
* @param labelKeys - List of label keys to remove from the contact.
|
|
743
727
|
* @public
|
|
@@ -797,113 +781,6 @@ function unlabelContact(contactId, labelKeys) {
|
|
|
797
781
|
});
|
|
798
782
|
}
|
|
799
783
|
exports.unlabelContact = unlabelContact;
|
|
800
|
-
/**
|
|
801
|
-
* Creates a query to retrieve a list of contacts.
|
|
802
|
-
*
|
|
803
|
-
* The `queryContacts()` function builds a query to retrieve a list of contacts
|
|
804
|
-
* and returns a
|
|
805
|
-
* [`ContactsQueryBuilder`](#contactsquerybuilder)
|
|
806
|
-
* object.
|
|
807
|
-
*
|
|
808
|
-
* The returned object contains the query definition,
|
|
809
|
-
* which is typically used to run the query using the
|
|
810
|
-
* [`find()`](#contactsquerybuilder/find)
|
|
811
|
-
* function.
|
|
812
|
-
*
|
|
813
|
-
* You can refine the query
|
|
814
|
-
* by chaining `ContactsQueryBuilder` functions onto the query.
|
|
815
|
-
* `ContactsQueryBuilder` functions enable you to sort, filter,
|
|
816
|
-
* and control the results `queryContacts()` returns.
|
|
817
|
-
*
|
|
818
|
-
* `queryContacts()` runs with these `ContactsQueryBuilder` defaults,
|
|
819
|
-
* which you can override:
|
|
820
|
-
*
|
|
821
|
-
* - [`skip(0)`](#contactsquerybuilder/skip)
|
|
822
|
-
* - [`limit(50)`](#contactsquerybuilder/limit)
|
|
823
|
-
* - [`descending("_createdDate")`](#contactsquerybuilder/descending)
|
|
824
|
-
*
|
|
825
|
-
* The functions that are chained to `queryContacts()`
|
|
826
|
-
* are applied in the order they are called.
|
|
827
|
-
* For example, if you apply `ascending('info.company')`
|
|
828
|
-
* and then `descending('info.name.last')`,
|
|
829
|
-
* the results are sorted first by the company name, and then,
|
|
830
|
-
* if there are multiple results with the same company,
|
|
831
|
-
* the items are sorted by last name.
|
|
832
|
-
*
|
|
833
|
-
* <!--
|
|
834
|
-
* > **Note:**
|
|
835
|
-
* > Only visitors with
|
|
836
|
-
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
837
|
-
* > can query contacts.
|
|
838
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`
|
|
839
|
-
* > in the [`find()`](wix-crm-backend/contacts/contactsquerybuilder/find) function.
|
|
840
|
-
* -->
|
|
841
|
-
*
|
|
842
|
-
* This function is not a universal function and runs only on the backend.
|
|
843
|
-
* @public
|
|
844
|
-
* @documentationMaturity preview
|
|
845
|
-
* @param options - Query contact options.
|
|
846
|
-
* @permissionScope Read Contacts
|
|
847
|
-
* @applicableIdentity APP
|
|
848
|
-
*/
|
|
849
|
-
function queryContacts(options) {
|
|
850
|
-
const requestTransformation = { '*': '$[1]', query: '$[0]' };
|
|
851
|
-
const responseTransformation = {
|
|
852
|
-
items: '$.contacts',
|
|
853
|
-
pagingMetadata: '$.pagingMetadata',
|
|
854
|
-
};
|
|
855
|
-
// @ts-ignore
|
|
856
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
857
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
858
|
-
rootSchema: _queryContactsRequest,
|
|
859
|
-
depSchemas: {},
|
|
860
|
-
fqdnTransformation: {
|
|
861
|
-
paths: [],
|
|
862
|
-
transformation: _fromVeloEntity,
|
|
863
|
-
},
|
|
864
|
-
customTransformation: requestTransformation,
|
|
865
|
-
});
|
|
866
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
867
|
-
rootSchema: _queryContactsResponse,
|
|
868
|
-
depSchemas: {
|
|
869
|
-
_contact,
|
|
870
|
-
_contactAddress,
|
|
871
|
-
_contactAddressesWrapper,
|
|
872
|
-
_contactInfo,
|
|
873
|
-
_contactPicture,
|
|
874
|
-
},
|
|
875
|
-
fqdnTransformation: {
|
|
876
|
-
paths: [...['Array#contacts']],
|
|
877
|
-
transformation: _toVeloEntity,
|
|
878
|
-
},
|
|
879
|
-
customTransformation: responseTransformation,
|
|
880
|
-
});
|
|
881
|
-
return (0, motion_edm_autogen_query_wrapper_1.wrapWithQueryBuilder)({
|
|
882
|
-
func: (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
883
|
-
var _a, _b, _c;
|
|
884
|
-
const reqOpts = ambassadorWixContactsV4Contact.queryContacts(Object.assign(Object.assign({}, payload), (options !== null && options !== void 0 ? options : {})));
|
|
885
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
886
|
-
try {
|
|
887
|
-
const result = yield httpClient.request(reqOpts);
|
|
888
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
889
|
-
return result;
|
|
890
|
-
}
|
|
891
|
-
catch (err) {
|
|
892
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
893
|
-
throw err;
|
|
894
|
-
}
|
|
895
|
-
}),
|
|
896
|
-
requestTransformer: (...args) => toAmbassadorRequest(args),
|
|
897
|
-
responseTransformer: ({ data }) => fromJSON(data),
|
|
898
|
-
errorTransformer: (err) => {
|
|
899
|
-
const transformedError = (0, velo_1.transformError)(err, requestTransformation);
|
|
900
|
-
throw transformedError;
|
|
901
|
-
},
|
|
902
|
-
pagingMethod: 'OFFSET',
|
|
903
|
-
transformationPaths: (0, velo_1.resolveQueryFieldsTransformationPaths)(_toVeloEntity),
|
|
904
|
-
})({ cursorWithEmptyFilterAndSort: true });
|
|
905
|
-
}
|
|
906
|
-
exports.queryContacts = queryContacts;
|
|
907
784
|
/**
|
|
908
785
|
* Retrieves a contact.
|
|
909
786
|
*
|
|
@@ -926,8 +803,6 @@ exports.queryContacts = queryContacts;
|
|
|
926
803
|
* > can retrieve contacts.
|
|
927
804
|
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
928
805
|
* -->
|
|
929
|
-
*
|
|
930
|
-
* This function is not a universal function and runs only on the backend.
|
|
931
806
|
* @param _id - ID of the contact to retrieve.
|
|
932
807
|
* @public
|
|
933
808
|
* @documentationMaturity preview
|