@wix/auto_sdk_crm_contacts 1.0.961 → 1.0.963

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.
@@ -2493,14 +2493,12 @@ interface ListContactsOptions {
2493
2493
  *
2494
2494
  * The functions that are chained to `queryContacts()` are applied in the order they are called. For example, if you apply `ascending('info.company')` and then `descending('info.name.last')`, the results are sorted first by the company name, and then, if there are multiple results with the same company, the items are sorted by last name.
2495
2495
  * @public
2496
- * @requiredField query
2497
2496
  * @param options - Query contact options.
2498
- * @param query - Query options.
2499
2497
  * @permissionId CONTACTS.VIEW
2500
2498
  * @applicableIdentity APP
2501
2499
  * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.QueryContacts
2502
2500
  */
2503
- declare function queryContacts(query: Query, options?: QueryContactsOptions): ContactsQueryBuilder;
2501
+ declare function queryContacts(options?: QueryContactsOptions): ContactsQueryBuilder;
2504
2502
  interface QueryContactsOptions {
2505
2503
  }
2506
2504
  interface QueryOffsetResult {
@@ -2567,6 +2565,15 @@ interface ContactsQueryBuilder {
2567
2565
  skip: (skip: number) => ContactsQueryBuilder;
2568
2566
  find: () => Promise<ContactsQueryResult>;
2569
2567
  }
2568
+ /**
2569
+ * @hidden
2570
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.QueryContacts
2571
+ * @requiredField query
2572
+ * @returns List of contacts.
2573
+ */
2574
+ declare function typedQueryContacts(query: Query, options?: QueryContactsOptions): Promise<NonNullablePaths<QueryContactsResponse, `contacts` | `contacts.${number}._id` | `contacts.${number}.revision` | `contacts.${number}.source.sourceType` | `contacts.${number}.lastActivity.activityType` | `contacts.${number}.primaryEmail.subscriptionStatus` | `contacts.${number}.primaryEmail.deliverabilityStatus` | `contacts.${number}.primaryPhone.subscriptionStatus`, 5> & {
2575
+ __applicationErrorsType?: QueryContactsApplicationErrors;
2576
+ }>;
2570
2577
  /**
2571
2578
  * Lists facets from the site’s contact list.
2572
2579
  * Facets include labels and subscription statuses.
@@ -2829,4 +2836,4 @@ interface GetContactOptions {
2829
2836
  fieldsets?: ContactFieldSetWithLiterals[];
2830
2837
  }
2831
2838
 
2832
- export { Action, type ActionEvent, type ActionWithLiterals, type ActivityIcon, type Address, type AddressLocation, type AddressStreetOneOf, AddressTag, type AddressTagWithLiterals, type ApplicationError, type AssigneesWrapper, type BaseEventMetadata, type BulkActionMetadata, type BulkAddSegmentToContactsRequest, type BulkAddSegmentToContactsResponse, type BulkDeleteContactsApplicationErrors, type BulkDeleteContactsOptions, type BulkDeleteContactsRequest, type BulkDeleteContactsResponse, type BulkLabelAndUnlabelContactsApplicationErrors, type BulkLabelAndUnlabelContactsOptions, type BulkLabelAndUnlabelContactsRequest, type BulkLabelAndUnlabelContactsResponse, type BulkRemoveSegmentFromContactsRequest, type BulkRemoveSegmentFromContactsResponse, type BulkUpdateContactsOptions, type BulkUpdateContactsRequest, type BulkUpdateContactsResponse, type BulkUpsertContactsRequest, type BulkUpsertContactsResponse, type BulkUpsertContactsResponseMetadata, type Contact, type ContactActivity, ContactActivityType, type ContactActivityTypeWithLiterals, type ContactAddedToSegment, type ContactAddress, type ContactAddressesWrapper, type ContactChanged, type ContactCreatedEnvelope, type ContactDeletedEnvelope, type ContactEmail, type ContactEmailSubscriptionUpdated, type ContactEmailsWrapper, ContactFieldSet, type ContactFieldSetWithLiterals, type ContactInfo, type ContactMerged, type ContactMergedEnvelope, type ContactName, type ContactPhone, type ContactPhoneSubscriptionUpdated, type ContactPhonesWrapper, type ContactPicture, type ContactPrimaryInfoUpdated, type ContactRemovedFromSegment, type ContactSource, ContactSourceType, type ContactSourceTypeWithLiterals, type ContactSubmitted, type ContactUpdatedEnvelope, type ContactsFacet, ContactsFacetType, type ContactsFacetTypeWithLiterals, type ContactsQueryBuilder, type ContactsQueryResult, type CountContactsRequest, type CountContactsResponse, type CreateContactApplicationErrors, type CreateContactOptions, type CreateContactRequest, type CreateContactResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type DeleteContactApplicationErrors, type DeleteContactRequest, type DeleteContactResponse, type DomainEvent, type DomainEventBodyOneOf, type DuplicateContactExists, EmailDeliverabilityStatus, type EmailDeliverabilityStatusWithLiterals, EmailTag, type EmailTagWithLiterals, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type Error, type EventMetadata, type ExtendedFieldsWrapper, type GeneratePictureUploadUrlRequest, type GeneratePictureUploadUrlResponse, type GetContactApplicationErrors, type GetContactOptions, type GetContactRequest, type GetContactResponse, GetContactResponseType, type GetContactResponseTypeWithLiterals, type GroupInfo, type IdentificationData, type IdentificationDataIdOneOf, ImageProvider, type ImageProviderWithLiterals, type Item, type ItemMetadata, type LabelAndUnlabelContactRequest, type LabelAndUnlabelContactResponse, type LabelContactApplicationErrors, type LabelContactRequest, type LabelContactResponse, type LabelsWrapper, type LastActivityUpdate, type ListContactIdsBySegmentRequest, type ListContactIdsBySegmentResponse, type ListContactsApplicationErrors, type ListContactsOptions, type ListContactsRequest, type ListContactsResponse, type ListFacetsOptions, type ListFacetsRequest, type ListFacetsResponse, type LocationsWrapper, type MemberInfo, MemberStatus, type MemberStatusWithLiterals, type MergeContactsApplicationErrors, type MergeContactsOptions, type MergeContactsRequest, type MergeContactsResponse, type MessageEnvelope, type Metadata, Mode, type ModeWithLiterals, type Paging, type PagingMetadata, PhoneDeliverabilityStatus, type PhoneDeliverabilityStatusWithLiterals, PhoneTag, type PhoneTagWithLiterals, type PreviewMergeContactsApplicationErrors, type PreviewMergeContactsOptions, type PreviewMergeContactsRequest, type PreviewMergeContactsResponse, type PrimaryContactInfo, type PrimaryEmail, type PrimaryPhone, type PrimarySubscriptionStatus, PrivacyStatus, type PrivacyStatusWithLiterals, type ProfileInfo, type Query, type QueryContactsApplicationErrors, type QueryContactsOptions, type QueryContactsRequest, type QueryContactsResponse, type QueryFacetsOptions, type QueryFacetsRequest, type QueryFacetsResponse, type RestoreInfo, Role, type RoleWithLiterals, type Search, type SearchContactsRequest, type SearchContactsResponse, type SearchDetails, type SearchPagingMethodOneOf, type SegmentsWrapper, type SessionInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type StreetAddress, type Subdivision, SubdivisionType, type SubdivisionTypeWithLiterals, SubmitOperation, type SubmitOperationWithLiterals, SubscriptionStatus, type SubscriptionStatusWithLiterals, type SyncSubmitContactRequest, type SyncSubmitContactResponse, type UnlabelContactApplicationErrors, type UnlabelContactRequest, type UnlabelContactResponse, type UpdateContactApplicationErrors, type UpdateContactOptions, type UpdateContactRequest, type UpdateContactResponse, type UpsertContactRequest, type UpsertContactResponse, UpsertContactResponseAction, type UpsertContactResponseActionWithLiterals, type UserInfo, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkDeleteContacts, bulkLabelAndUnlabelContacts, bulkUpdateContacts, createContact, deleteContact, getContact, labelContact, listContacts, listFacets, mergeContacts, onContactCreated, onContactDeleted, onContactMerged, onContactUpdated, previewMergeContacts, queryContacts, queryFacets, unlabelContact, updateContact };
2839
+ export { Action, type ActionEvent, type ActionWithLiterals, type ActivityIcon, type Address, type AddressLocation, type AddressStreetOneOf, AddressTag, type AddressTagWithLiterals, type ApplicationError, type AssigneesWrapper, type BaseEventMetadata, type BulkActionMetadata, type BulkAddSegmentToContactsRequest, type BulkAddSegmentToContactsResponse, type BulkDeleteContactsApplicationErrors, type BulkDeleteContactsOptions, type BulkDeleteContactsRequest, type BulkDeleteContactsResponse, type BulkLabelAndUnlabelContactsApplicationErrors, type BulkLabelAndUnlabelContactsOptions, type BulkLabelAndUnlabelContactsRequest, type BulkLabelAndUnlabelContactsResponse, type BulkRemoveSegmentFromContactsRequest, type BulkRemoveSegmentFromContactsResponse, type BulkUpdateContactsOptions, type BulkUpdateContactsRequest, type BulkUpdateContactsResponse, type BulkUpsertContactsRequest, type BulkUpsertContactsResponse, type BulkUpsertContactsResponseMetadata, type Contact, type ContactActivity, ContactActivityType, type ContactActivityTypeWithLiterals, type ContactAddedToSegment, type ContactAddress, type ContactAddressesWrapper, type ContactChanged, type ContactCreatedEnvelope, type ContactDeletedEnvelope, type ContactEmail, type ContactEmailSubscriptionUpdated, type ContactEmailsWrapper, ContactFieldSet, type ContactFieldSetWithLiterals, type ContactInfo, type ContactMerged, type ContactMergedEnvelope, type ContactName, type ContactPhone, type ContactPhoneSubscriptionUpdated, type ContactPhonesWrapper, type ContactPicture, type ContactPrimaryInfoUpdated, type ContactRemovedFromSegment, type ContactSource, ContactSourceType, type ContactSourceTypeWithLiterals, type ContactSubmitted, type ContactUpdatedEnvelope, type ContactsFacet, ContactsFacetType, type ContactsFacetTypeWithLiterals, type ContactsQueryBuilder, type ContactsQueryResult, type CountContactsRequest, type CountContactsResponse, type CreateContactApplicationErrors, type CreateContactOptions, type CreateContactRequest, type CreateContactResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type DeleteContactApplicationErrors, type DeleteContactRequest, type DeleteContactResponse, type DomainEvent, type DomainEventBodyOneOf, type DuplicateContactExists, EmailDeliverabilityStatus, type EmailDeliverabilityStatusWithLiterals, EmailTag, type EmailTagWithLiterals, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type Error, type EventMetadata, type ExtendedFieldsWrapper, type GeneratePictureUploadUrlRequest, type GeneratePictureUploadUrlResponse, type GetContactApplicationErrors, type GetContactOptions, type GetContactRequest, type GetContactResponse, GetContactResponseType, type GetContactResponseTypeWithLiterals, type GroupInfo, type IdentificationData, type IdentificationDataIdOneOf, ImageProvider, type ImageProviderWithLiterals, type Item, type ItemMetadata, type LabelAndUnlabelContactRequest, type LabelAndUnlabelContactResponse, type LabelContactApplicationErrors, type LabelContactRequest, type LabelContactResponse, type LabelsWrapper, type LastActivityUpdate, type ListContactIdsBySegmentRequest, type ListContactIdsBySegmentResponse, type ListContactsApplicationErrors, type ListContactsOptions, type ListContactsRequest, type ListContactsResponse, type ListFacetsOptions, type ListFacetsRequest, type ListFacetsResponse, type LocationsWrapper, type MemberInfo, MemberStatus, type MemberStatusWithLiterals, type MergeContactsApplicationErrors, type MergeContactsOptions, type MergeContactsRequest, type MergeContactsResponse, type MessageEnvelope, type Metadata, Mode, type ModeWithLiterals, type Paging, type PagingMetadata, PhoneDeliverabilityStatus, type PhoneDeliverabilityStatusWithLiterals, PhoneTag, type PhoneTagWithLiterals, type PreviewMergeContactsApplicationErrors, type PreviewMergeContactsOptions, type PreviewMergeContactsRequest, type PreviewMergeContactsResponse, type PrimaryContactInfo, type PrimaryEmail, type PrimaryPhone, type PrimarySubscriptionStatus, PrivacyStatus, type PrivacyStatusWithLiterals, type ProfileInfo, type Query, type QueryContactsApplicationErrors, type QueryContactsOptions, type QueryContactsRequest, type QueryContactsResponse, type QueryFacetsOptions, type QueryFacetsRequest, type QueryFacetsResponse, type RestoreInfo, Role, type RoleWithLiterals, type Search, type SearchContactsRequest, type SearchContactsResponse, type SearchDetails, type SearchPagingMethodOneOf, type SegmentsWrapper, type SessionInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type StreetAddress, type Subdivision, SubdivisionType, type SubdivisionTypeWithLiterals, SubmitOperation, type SubmitOperationWithLiterals, SubscriptionStatus, type SubscriptionStatusWithLiterals, type SyncSubmitContactRequest, type SyncSubmitContactResponse, type UnlabelContactApplicationErrors, type UnlabelContactRequest, type UnlabelContactResponse, type UpdateContactApplicationErrors, type UpdateContactOptions, type UpdateContactRequest, type UpdateContactResponse, type UpsertContactRequest, type UpsertContactResponse, UpsertContactResponseAction, type UpsertContactResponseActionWithLiterals, type UserInfo, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkDeleteContacts, bulkLabelAndUnlabelContacts, bulkUpdateContacts, createContact, deleteContact, getContact, labelContact, listContacts, listFacets, mergeContacts, onContactCreated, onContactDeleted, onContactMerged, onContactUpdated, previewMergeContacts, queryContacts, queryFacets, typedQueryContacts, unlabelContact, updateContact };
@@ -55,6 +55,7 @@ __export(index_typings_exports, {
55
55
  previewMergeContacts: () => previewMergeContacts2,
56
56
  queryContacts: () => queryContacts2,
57
57
  queryFacets: () => queryFacets2,
58
+ typedQueryContacts: () => typedQueryContacts,
58
59
  unlabelContact: () => unlabelContact2,
59
60
  updateContact: () => updateContact2
60
61
  });
@@ -1330,14 +1331,13 @@ async function listContacts2(options) {
1330
1331
  throw transformedError;
1331
1332
  }
1332
1333
  }
1333
- function queryContacts2(query, options) {
1334
- const { httpClient, sideEffects } = arguments[2];
1334
+ function queryContacts2(options) {
1335
+ const { httpClient, sideEffects } = arguments[1];
1335
1336
  return (0, import_query_builder.queryBuilder)({
1336
1337
  func: async (payload) => {
1337
1338
  const reqOpts = queryContacts({
1338
1339
  ...payload,
1339
- ...options ?? {},
1340
- query
1340
+ ...options ?? {}
1341
1341
  });
1342
1342
  sideEffects?.onSiteCall?.();
1343
1343
  try {
@@ -1349,11 +1349,11 @@ function queryContacts2(query, options) {
1349
1349
  throw err;
1350
1350
  }
1351
1351
  },
1352
- requestTransformer: (query2) => {
1353
- const args = [query2, query2, options];
1352
+ requestTransformer: (query) => {
1353
+ const args = [query, options];
1354
1354
  return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1355
- query: args?.[0],
1356
- ...args?.[2]
1355
+ ...args?.[1],
1356
+ query: args?.[0]
1357
1357
  });
1358
1358
  },
1359
1359
  responseTransformer: ({ data }) => {
@@ -1390,6 +1390,47 @@ function queryContacts2(query, options) {
1390
1390
  transformationPaths: {}
1391
1391
  });
1392
1392
  }
1393
+ async function typedQueryContacts(query, options) {
1394
+ const { httpClient, sideEffects } = arguments[2];
1395
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1396
+ query,
1397
+ ...options
1398
+ });
1399
+ const reqOpts = queryContacts(payload);
1400
+ sideEffects?.onSiteCall?.();
1401
+ try {
1402
+ const result = await httpClient.request(reqOpts);
1403
+ sideEffects?.onSuccess?.(result);
1404
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1405
+ (0, import_transform_paths2.transformPaths)(result.data, [
1406
+ {
1407
+ transformFn: import_image2.transformRESTImageToSDKImage,
1408
+ paths: [
1409
+ { path: "contacts.picture" },
1410
+ { path: "contacts.info.picture.image" },
1411
+ { path: "contacts.memberInfo.profileInfo.photo" }
1412
+ ]
1413
+ },
1414
+ {
1415
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
1416
+ paths: [{ path: "contacts.info.addresses.items.address" }]
1417
+ }
1418
+ ])
1419
+ );
1420
+ } catch (err) {
1421
+ const transformedError = (0, import_transform_error.transformError)(
1422
+ err,
1423
+ {
1424
+ spreadPathsToArguments: {},
1425
+ explicitPathsToArguments: { query: "$[0]" },
1426
+ singleArgumentUnchanged: false
1427
+ },
1428
+ ["query", "options"]
1429
+ );
1430
+ sideEffects?.onError?.(err);
1431
+ throw transformedError;
1432
+ }
1433
+ }
1393
1434
  async function listFacets2(options) {
1394
1435
  const { httpClient, sideEffects } = arguments[1];
1395
1436
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -1638,6 +1679,7 @@ async function getContact2(_id, options) {
1638
1679
  previewMergeContacts,
1639
1680
  queryContacts,
1640
1681
  queryFacets,
1682
+ typedQueryContacts,
1641
1683
  unlabelContact,
1642
1684
  updateContact
1643
1685
  });