@wix/auto_sdk_crm_contacts 1.0.353 → 1.0.355

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.
Files changed (130) hide show
  1. package/build/{cjs/src/contacts-v4-contact-contacts.types.d.ts → contacts-v4-contact-contacts.universal-B8Y8hXy8.d.mts} +378 -218
  2. package/build/{internal/cjs/src/contacts-v4-contact-contacts.types.d.ts → contacts-v4-contact-contacts.universal-B8Y8hXy8.d.ts} +378 -218
  3. package/build/{cjs/src/contacts-v4-contact-contacts.public.d.ts → index.d.mts} +46 -18
  4. package/build/{es/src/contacts-v4-contact-contacts.public.d.ts → index.d.ts} +46 -18
  5. package/build/index.js +1338 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +1281 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{es/src/contacts-v4-contact-contacts.types.d.ts → contacts-v4-contact-contacts.universal-GFgRnaQp.d.mts} +385 -214
  10. package/build/{es/src/contacts-v4-contact-contacts.types.d.ts → internal/contacts-v4-contact-contacts.universal-GFgRnaQp.d.ts} +385 -214
  11. package/build/internal/{cjs/src/contacts-v4-contact-contacts.public.d.ts → index.d.mts} +46 -18
  12. package/build/internal/{es/src/contacts-v4-contact-contacts.public.d.ts → index.d.ts} +46 -18
  13. package/build/internal/index.js +1338 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +1281 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +934 -0
  18. package/build/internal/meta.d.ts +934 -0
  19. package/build/internal/meta.js +618 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +584 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +934 -0
  24. package/build/meta.d.ts +934 -0
  25. package/build/meta.js +618 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +584 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +12 -11
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/contacts-v4-contact-contacts.context.d.ts +0 -36
  40. package/build/cjs/src/contacts-v4-contact-contacts.context.js +0 -61
  41. package/build/cjs/src/contacts-v4-contact-contacts.context.js.map +0 -1
  42. package/build/cjs/src/contacts-v4-contact-contacts.http.d.ts +0 -126
  43. package/build/cjs/src/contacts-v4-contact-contacts.http.js +0 -555
  44. package/build/cjs/src/contacts-v4-contact-contacts.http.js.map +0 -1
  45. package/build/cjs/src/contacts-v4-contact-contacts.meta.d.ts +0 -32
  46. package/build/cjs/src/contacts-v4-contact-contacts.meta.js +0 -180
  47. package/build/cjs/src/contacts-v4-contact-contacts.meta.js.map +0 -1
  48. package/build/cjs/src/contacts-v4-contact-contacts.public.js +0 -193
  49. package/build/cjs/src/contacts-v4-contact-contacts.public.js.map +0 -1
  50. package/build/cjs/src/contacts-v4-contact-contacts.types.js +0 -278
  51. package/build/cjs/src/contacts-v4-contact-contacts.types.js.map +0 -1
  52. package/build/cjs/src/contacts-v4-contact-contacts.universal.d.ts +0 -2434
  53. package/build/cjs/src/contacts-v4-contact-contacts.universal.js +0 -923
  54. package/build/cjs/src/contacts-v4-contact-contacts.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/package.json +0 -3
  65. package/build/es/src/contacts-v4-contact-contacts.context.d.ts +0 -36
  66. package/build/es/src/contacts-v4-contact-contacts.context.js +0 -36
  67. package/build/es/src/contacts-v4-contact-contacts.context.js.map +0 -1
  68. package/build/es/src/contacts-v4-contact-contacts.http.d.ts +0 -126
  69. package/build/es/src/contacts-v4-contact-contacts.http.js +0 -544
  70. package/build/es/src/contacts-v4-contact-contacts.http.js.map +0 -1
  71. package/build/es/src/contacts-v4-contact-contacts.meta.d.ts +0 -32
  72. package/build/es/src/contacts-v4-contact-contacts.meta.js +0 -146
  73. package/build/es/src/contacts-v4-contact-contacts.meta.js.map +0 -1
  74. package/build/es/src/contacts-v4-contact-contacts.public.js +0 -160
  75. package/build/es/src/contacts-v4-contact-contacts.public.js.map +0 -1
  76. package/build/es/src/contacts-v4-contact-contacts.types.js +0 -275
  77. package/build/es/src/contacts-v4-contact-contacts.types.js.map +0 -1
  78. package/build/es/src/contacts-v4-contact-contacts.universal.d.ts +0 -2434
  79. package/build/es/src/contacts-v4-contact-contacts.universal.js +0 -889
  80. package/build/es/src/contacts-v4-contact-contacts.universal.js.map +0 -1
  81. package/build/internal/cjs/index.d.ts +0 -1
  82. package/build/internal/cjs/index.js +0 -18
  83. package/build/internal/cjs/index.js.map +0 -1
  84. package/build/internal/cjs/index.typings.d.ts +0 -1
  85. package/build/internal/cjs/index.typings.js +0 -18
  86. package/build/internal/cjs/index.typings.js.map +0 -1
  87. package/build/internal/cjs/meta.d.ts +0 -1
  88. package/build/internal/cjs/meta.js +0 -18
  89. package/build/internal/cjs/meta.js.map +0 -1
  90. package/build/internal/cjs/src/contacts-v4-contact-contacts.context.d.ts +0 -36
  91. package/build/internal/cjs/src/contacts-v4-contact-contacts.context.js +0 -61
  92. package/build/internal/cjs/src/contacts-v4-contact-contacts.context.js.map +0 -1
  93. package/build/internal/cjs/src/contacts-v4-contact-contacts.http.d.ts +0 -126
  94. package/build/internal/cjs/src/contacts-v4-contact-contacts.http.js +0 -555
  95. package/build/internal/cjs/src/contacts-v4-contact-contacts.http.js.map +0 -1
  96. package/build/internal/cjs/src/contacts-v4-contact-contacts.meta.d.ts +0 -32
  97. package/build/internal/cjs/src/contacts-v4-contact-contacts.meta.js +0 -180
  98. package/build/internal/cjs/src/contacts-v4-contact-contacts.meta.js.map +0 -1
  99. package/build/internal/cjs/src/contacts-v4-contact-contacts.public.js +0 -193
  100. package/build/internal/cjs/src/contacts-v4-contact-contacts.public.js.map +0 -1
  101. package/build/internal/cjs/src/contacts-v4-contact-contacts.types.js +0 -278
  102. package/build/internal/cjs/src/contacts-v4-contact-contacts.types.js.map +0 -1
  103. package/build/internal/cjs/src/contacts-v4-contact-contacts.universal.d.ts +0 -2445
  104. package/build/internal/cjs/src/contacts-v4-contact-contacts.universal.js +0 -923
  105. package/build/internal/cjs/src/contacts-v4-contact-contacts.universal.js.map +0 -1
  106. package/build/internal/es/index.d.ts +0 -1
  107. package/build/internal/es/index.js +0 -2
  108. package/build/internal/es/index.js.map +0 -1
  109. package/build/internal/es/index.typings.d.ts +0 -1
  110. package/build/internal/es/index.typings.js +0 -2
  111. package/build/internal/es/index.typings.js.map +0 -1
  112. package/build/internal/es/meta.d.ts +0 -1
  113. package/build/internal/es/meta.js +0 -2
  114. package/build/internal/es/meta.js.map +0 -1
  115. package/build/internal/es/src/contacts-v4-contact-contacts.context.d.ts +0 -36
  116. package/build/internal/es/src/contacts-v4-contact-contacts.context.js +0 -36
  117. package/build/internal/es/src/contacts-v4-contact-contacts.context.js.map +0 -1
  118. package/build/internal/es/src/contacts-v4-contact-contacts.http.d.ts +0 -126
  119. package/build/internal/es/src/contacts-v4-contact-contacts.http.js +0 -544
  120. package/build/internal/es/src/contacts-v4-contact-contacts.http.js.map +0 -1
  121. package/build/internal/es/src/contacts-v4-contact-contacts.meta.d.ts +0 -32
  122. package/build/internal/es/src/contacts-v4-contact-contacts.meta.js +0 -146
  123. package/build/internal/es/src/contacts-v4-contact-contacts.meta.js.map +0 -1
  124. package/build/internal/es/src/contacts-v4-contact-contacts.public.js +0 -160
  125. package/build/internal/es/src/contacts-v4-contact-contacts.public.js.map +0 -1
  126. package/build/internal/es/src/contacts-v4-contact-contacts.types.js +0 -275
  127. package/build/internal/es/src/contacts-v4-contact-contacts.types.js.map +0 -1
  128. package/build/internal/es/src/contacts-v4-contact-contacts.universal.d.ts +0 -2445
  129. package/build/internal/es/src/contacts-v4-contact-contacts.universal.js +0 -889
  130. package/build/internal/es/src/contacts-v4-contact-contacts.universal.js.map +0 -1
@@ -1,889 +0,0 @@
1
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
- import { queryBuilder } from '@wix/sdk-runtime/query-builder';
3
- import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
4
- import * as ambassadorWixContactsV4Contact from './contacts-v4-contact-contacts.http.js';
5
- // @ts-ignore
6
- import { transformSDKAddressToRESTAddress } from '@wix/sdk-runtime/transformations/address';
7
- import { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';
8
- import { transformSDKImageToRESTImage } from '@wix/sdk-runtime/transformations/image';
9
- import { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';
10
- import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
11
- export var ContactSourceType;
12
- (function (ContactSourceType) {
13
- ContactSourceType["OTHER"] = "OTHER";
14
- ContactSourceType["ADMIN"] = "ADMIN";
15
- ContactSourceType["WIX_APP"] = "WIX_APP";
16
- ContactSourceType["IMPORT"] = "IMPORT";
17
- ContactSourceType["THIRD_PARTY"] = "THIRD_PARTY";
18
- ContactSourceType["WIX_BOOKINGS"] = "WIX_BOOKINGS";
19
- ContactSourceType["WIX_CHAT"] = "WIX_CHAT";
20
- ContactSourceType["WIX_EMAIL_MARKETING"] = "WIX_EMAIL_MARKETING";
21
- ContactSourceType["WIX_EVENTS"] = "WIX_EVENTS";
22
- ContactSourceType["WIX_FORMS"] = "WIX_FORMS";
23
- ContactSourceType["WIX_GROUPS"] = "WIX_GROUPS";
24
- ContactSourceType["WIX_HOTELS"] = "WIX_HOTELS";
25
- ContactSourceType["WIX_MARKET_PLACE"] = "WIX_MARKET_PLACE";
26
- ContactSourceType["WIX_MUSIC"] = "WIX_MUSIC";
27
- ContactSourceType["WIX_RESTAURANTS"] = "WIX_RESTAURANTS";
28
- ContactSourceType["WIX_SITE_MEMBERS"] = "WIX_SITE_MEMBERS";
29
- ContactSourceType["WIX_STORES"] = "WIX_STORES";
30
- ContactSourceType["WIX_CODE"] = "WIX_CODE";
31
- ContactSourceType["HOPP"] = "HOPP";
32
- })(ContactSourceType || (ContactSourceType = {}));
33
- export var ContactActivityType;
34
- (function (ContactActivityType) {
35
- /** Visited the site. */
36
- ContactActivityType["GENERAL"] = "GENERAL";
37
- /** Became a new contact. */
38
- ContactActivityType["CONTACT_CREATED"] = "CONTACT_CREATED";
39
- /** Logged in. */
40
- ContactActivityType["MEMBER_LOGIN"] = "MEMBER_LOGIN";
41
- /** Requested a site membership. */
42
- ContactActivityType["MEMBER_REGISTER"] = "MEMBER_REGISTER";
43
- /** Was approved, blocked, or unblocked. */
44
- ContactActivityType["MEMBER_STATUS_CHANGED"] = "MEMBER_STATUS_CHANGED";
45
- /** Submitted a form. */
46
- ContactActivityType["FORM_SUBMITTED"] = "FORM_SUBMITTED";
47
- /** Started a chat. */
48
- ContactActivityType["INBOX_FORM_SUBMITTED"] = "INBOX_FORM_SUBMITTED";
49
- /** Paid a payment request. */
50
- ContactActivityType["INBOX_PAYMENT_REQUEST_PAID"] = "INBOX_PAYMENT_REQUEST_PAID";
51
- /** Received a message from the site. */
52
- ContactActivityType["INBOX_MESSAGE_TO_CUSTOMER"] = "INBOX_MESSAGE_TO_CUSTOMER";
53
- /** Sent a new message to the site. */
54
- ContactActivityType["INBOX_MESSAGE_FROM_CUSTOMER"] = "INBOX_MESSAGE_FROM_CUSTOMER";
55
- /** Subscribed to a site newsletter through a form. */
56
- ContactActivityType["NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED"] = "NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED";
57
- /** Unsubscribed from a site newsletter. */
58
- ContactActivityType["NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE"] = "NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE";
59
- /** Made a purchase. */
60
- ContactActivityType["ECOM_PURCHASE"] = "ECOM_PURCHASE";
61
- /** Abandoned a shopping cart. */
62
- ContactActivityType["ECOM_CART_ABANDON"] = "ECOM_CART_ABANDON";
63
- /** Checked out shopping cart and submitted buyer info (but didn’t complete the purchase yet). */
64
- ContactActivityType["ECOM_CHECKOUT_BUYER"] = "ECOM_CHECKOUT_BUYER";
65
- /** Booked an appointment. */
66
- ContactActivityType["BOOKINGS_APPOINTMENT"] = "BOOKINGS_APPOINTMENT";
67
- /** Made a Wix Hotels reservation. */
68
- ContactActivityType["HOTELS_RESERVATION"] = "HOTELS_RESERVATION";
69
- /** Paid for a Wix Hotels reservation. */
70
- ContactActivityType["HOTELS_PURCHASE"] = "HOTELS_PURCHASE";
71
- /** Confirmed a Wix Hotels reservation. */
72
- ContactActivityType["HOTELS_CONFIRMATION"] = "HOTELS_CONFIRMATION";
73
- /** Canceled a Wix Hotels reservation. */
74
- ContactActivityType["HOTELS_CANCEL"] = "HOTELS_CANCEL";
75
- /** Purchased a video. */
76
- ContactActivityType["VIDEO_PURCHASE"] = "VIDEO_PURCHASE";
77
- /** Rented a video. */
78
- ContactActivityType["VIDEO_RENT"] = "VIDEO_RENT";
79
- /** Made a purchase with a pay button. */
80
- ContactActivityType["CASHIER_BUTTON_PURCHASE"] = "CASHIER_BUTTON_PURCHASE";
81
- /** Became a new Wix Marketplace lead. */
82
- ContactActivityType["ARENA_NEW_LEAD"] = "ARENA_NEW_LEAD";
83
- /** RSVP'd to an event. */
84
- ContactActivityType["EVENTS_RSVP"] = "EVENTS_RSVP";
85
- /** Paid an invoice. */
86
- ContactActivityType["INVOICE_PAY"] = "INVOICE_PAY";
87
- /** An invoice is now overdue. */
88
- ContactActivityType["INVOICE_OVERDUE"] = "INVOICE_OVERDUE";
89
- /** Accepted a price quote. */
90
- ContactActivityType["PRICE_QUOTE_ACCEPT"] = "PRICE_QUOTE_ACCEPT";
91
- /** A price quote has expired. */
92
- ContactActivityType["PRICE_QUOTE_EXPIRE"] = "PRICE_QUOTE_EXPIRE";
93
- /** Ordered food with Wix Restaurants. */
94
- ContactActivityType["RESTAURANTS_ORDER"] = "RESTAURANTS_ORDER";
95
- /** Made a Wix Restaurants reservation. */
96
- ContactActivityType["RESTAURANTS_RESERVATION"] = "RESTAURANTS_RESERVATION";
97
- /** Opened an email from the site. */
98
- ContactActivityType["SHOUTOUT_OPEN"] = "SHOUTOUT_OPEN";
99
- /** Clicked a link in an email from the site. */
100
- ContactActivityType["SHOUTOUT_CLICK"] = "SHOUTOUT_CLICK";
101
- /** Merged with another contact. */
102
- ContactActivityType["CONTACT_MERGED"] = "CONTACT_MERGED";
103
- /** Subscribed to a site newsletter. */
104
- ContactActivityType["NEWSLETTER_SUBSCRIPTION_SUBSCRIBE"] = "NEWSLETTER_SUBSCRIPTION_SUBSCRIBE";
105
- /** Subscription status to site newsletters is pending confirmation. */
106
- ContactActivityType["NEWSLETTER_SUBSCRIPTION_PENDING"] = "NEWSLETTER_SUBSCRIPTION_PENDING";
107
- /** Subscription status to site newsletters is not set. */
108
- ContactActivityType["NEWSLETTER_SUBSCRIPTION_NOT_SET"] = "NEWSLETTER_SUBSCRIPTION_NOT_SET";
109
- /** Subscribed to phone notifications. */
110
- ContactActivityType["PHONE_SUBSCRIPTION_SUBSCRIBE"] = "PHONE_SUBSCRIPTION_SUBSCRIBE";
111
- /** Subscription to phone notificatons is pending confirmation. */
112
- ContactActivityType["PHONE_SUBSCRIPTION_PENDING"] = "PHONE_SUBSCRIPTION_PENDING";
113
- /** Subscription to phone notificatons is not set. */
114
- ContactActivityType["PHONE_SUBSCRIPTION_NOT_SET"] = "PHONE_SUBSCRIPTION_NOT_SET";
115
- /** Subscribed to phone notifications. */
116
- ContactActivityType["PHONE_SUBSCRIPTION_UNSUBSCRIBE"] = "PHONE_SUBSCRIPTION_UNSUBSCRIBE";
117
- })(ContactActivityType || (ContactActivityType = {}));
118
- export var EmailTag;
119
- (function (EmailTag) {
120
- EmailTag["UNTAGGED"] = "UNTAGGED";
121
- EmailTag["MAIN"] = "MAIN";
122
- EmailTag["HOME"] = "HOME";
123
- EmailTag["WORK"] = "WORK";
124
- })(EmailTag || (EmailTag = {}));
125
- export var PhoneTag;
126
- (function (PhoneTag) {
127
- PhoneTag["UNTAGGED"] = "UNTAGGED";
128
- PhoneTag["MAIN"] = "MAIN";
129
- PhoneTag["HOME"] = "HOME";
130
- PhoneTag["MOBILE"] = "MOBILE";
131
- PhoneTag["WORK"] = "WORK";
132
- PhoneTag["FAX"] = "FAX";
133
- })(PhoneTag || (PhoneTag = {}));
134
- export var AddressTag;
135
- (function (AddressTag) {
136
- AddressTag["UNTAGGED"] = "UNTAGGED";
137
- AddressTag["HOME"] = "HOME";
138
- AddressTag["WORK"] = "WORK";
139
- AddressTag["BILLING"] = "BILLING";
140
- AddressTag["SHIPPING"] = "SHIPPING";
141
- })(AddressTag || (AddressTag = {}));
142
- export var SubdivisionType;
143
- (function (SubdivisionType) {
144
- SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
145
- /** State */
146
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
147
- /** County */
148
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
149
- /** City/town */
150
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
151
- /** Neighborhood/quarter */
152
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
153
- /** Street/block */
154
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
155
- /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
156
- SubdivisionType["COUNTRY"] = "COUNTRY";
157
- })(SubdivisionType || (SubdivisionType = {}));
158
- export var ImageProvider;
159
- (function (ImageProvider) {
160
- ImageProvider["UNKNOWN"] = "UNKNOWN";
161
- /** Image stored outside Wix */
162
- ImageProvider["EXTERNAL"] = "EXTERNAL";
163
- /** Stored in wix media platform, Must be uploaded by using `GeneratePictureUploadUrl` */
164
- ImageProvider["WIX_MEDIA"] = "WIX_MEDIA";
165
- })(ImageProvider || (ImageProvider = {}));
166
- export var SubscriptionStatus;
167
- (function (SubscriptionStatus) {
168
- /** No status exists. */
169
- SubscriptionStatus["NO_SUBSCRIPTION_STATUS"] = "NO_SUBSCRIPTION_STATUS";
170
- /** No status specified. */
171
- SubscriptionStatus["NOT_SET"] = "NOT_SET";
172
- /** Subscription confirmation was requested, but recipient hasn't confirmed yet. */
173
- SubscriptionStatus["PENDING"] = "PENDING";
174
- /** Recipient has opted in to marketing emails or SMS messages. */
175
- SubscriptionStatus["SUBSCRIBED"] = "SUBSCRIBED";
176
- /** Recipient has opted out of marketing emails or SMS messages. */
177
- SubscriptionStatus["UNSUBSCRIBED"] = "UNSUBSCRIBED";
178
- })(SubscriptionStatus || (SubscriptionStatus = {}));
179
- export var EmailDeliverabilityStatus;
180
- (function (EmailDeliverabilityStatus) {
181
- /** No status reported. */
182
- EmailDeliverabilityStatus["NOT_SET"] = "NOT_SET";
183
- /** Emails are being successfully delivered. */
184
- EmailDeliverabilityStatus["VALID"] = "VALID";
185
- /** The last email to the recipient bounced or was rejected. */
186
- EmailDeliverabilityStatus["BOUNCED"] = "BOUNCED";
187
- /** Recipient registered a spam complaint with their email provider. */
188
- EmailDeliverabilityStatus["SPAM_COMPLAINT"] = "SPAM_COMPLAINT";
189
- /** Multiple emails have been delivered without any kind of engagement from the recipient. */
190
- EmailDeliverabilityStatus["INACTIVE"] = "INACTIVE";
191
- })(EmailDeliverabilityStatus || (EmailDeliverabilityStatus = {}));
192
- export var PhoneDeliverabilityStatus;
193
- (function (PhoneDeliverabilityStatus) {
194
- /** No status exists. */
195
- PhoneDeliverabilityStatus["NO_PHONE_DELIVERABILITY_STATUS"] = "NO_PHONE_DELIVERABILITY_STATUS";
196
- /** No status reported. */
197
- PhoneDeliverabilityStatus["NOT_SET"] = "NOT_SET";
198
- })(PhoneDeliverabilityStatus || (PhoneDeliverabilityStatus = {}));
199
- export var MemberStatus;
200
- (function (MemberStatus) {
201
- MemberStatus["PENDING"] = "PENDING";
202
- MemberStatus["ACTIVE"] = "ACTIVE";
203
- MemberStatus["DELETED"] = "DELETED";
204
- MemberStatus["BLOCKED"] = "BLOCKED";
205
- MemberStatus["OFFLINE"] = "OFFLINE";
206
- })(MemberStatus || (MemberStatus = {}));
207
- export var PrivacyStatus;
208
- (function (PrivacyStatus) {
209
- PrivacyStatus["PRIVATE"] = "PRIVATE";
210
- PrivacyStatus["PUBLIC"] = "PUBLIC";
211
- })(PrivacyStatus || (PrivacyStatus = {}));
212
- export var Role;
213
- (function (Role) {
214
- Role["UNSPECIFIED_ROLE"] = "UNSPECIFIED_ROLE";
215
- Role["OWNER"] = "OWNER";
216
- Role["CONTRIBUTOR"] = "CONTRIBUTOR";
217
- })(Role || (Role = {}));
218
- export var SortOrder;
219
- (function (SortOrder) {
220
- SortOrder["ASC"] = "ASC";
221
- SortOrder["DESC"] = "DESC";
222
- })(SortOrder || (SortOrder = {}));
223
- export var ContactFieldSet;
224
- (function (ContactFieldSet) {
225
- /** name, primaryEmail, primaryPhone */
226
- ContactFieldSet["BASIC"] = "BASIC";
227
- /** name, phones, emails, addresses */
228
- ContactFieldSet["COMMUNICATION_DETAILS"] = "COMMUNICATION_DETAILS";
229
- /** name, primaryInfo(email, phone), extendedFields */
230
- ContactFieldSet["EXTENDED"] = "EXTENDED";
231
- /** Full contact object */
232
- ContactFieldSet["FULL"] = "FULL";
233
- })(ContactFieldSet || (ContactFieldSet = {}));
234
- export var ContactsFacetType;
235
- (function (ContactsFacetType) {
236
- ContactsFacetType["UNKNOWN"] = "UNKNOWN";
237
- ContactsFacetType["ALL_CONTACTS"] = "ALL_CONTACTS";
238
- ContactsFacetType["NOT_LABELED"] = "NOT_LABELED";
239
- ContactsFacetType["LABEL"] = "LABEL";
240
- ContactsFacetType["SUBSCRIPTION_STATUS"] = "SUBSCRIPTION_STATUS";
241
- ContactsFacetType["MEMBERSHIP_STATUS"] = "MEMBERSHIP_STATUS";
242
- })(ContactsFacetType || (ContactsFacetType = {}));
243
- export var Action;
244
- (function (Action) {
245
- Action["UNKNOWN"] = "UNKNOWN";
246
- Action["UPDATED"] = "UPDATED";
247
- Action["CREATED"] = "CREATED";
248
- })(Action || (Action = {}));
249
- export var UpsertContactResponseAction;
250
- (function (UpsertContactResponseAction) {
251
- UpsertContactResponseAction["UNKNOWN"] = "UNKNOWN";
252
- UpsertContactResponseAction["UPDATED"] = "UPDATED";
253
- UpsertContactResponseAction["CREATED"] = "CREATED";
254
- })(UpsertContactResponseAction || (UpsertContactResponseAction = {}));
255
- export var GetContactResponseType;
256
- (function (GetContactResponseType) {
257
- /** The specified contact was returned. */
258
- GetContactResponseType["REGULAR"] = "REGULAR";
259
- /** Not used. */
260
- GetContactResponseType["IMPLICIT"] = "IMPLICIT";
261
- /** The specified contact was previously merged with another contact and the new contact was returned. */
262
- GetContactResponseType["MERGED"] = "MERGED";
263
- })(GetContactResponseType || (GetContactResponseType = {}));
264
- export var SubmitOperation;
265
- (function (SubmitOperation) {
266
- SubmitOperation["UNKNOWN"] = "UNKNOWN";
267
- SubmitOperation["CREATE"] = "CREATE";
268
- SubmitOperation["UPDATE"] = "UPDATE";
269
- })(SubmitOperation || (SubmitOperation = {}));
270
- export var Mode;
271
- (function (Mode) {
272
- /** any */
273
- Mode["OR"] = "OR";
274
- /** all */
275
- Mode["AND"] = "AND";
276
- })(Mode || (Mode = {}));
277
- export var WebhookIdentityType;
278
- (function (WebhookIdentityType) {
279
- WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
280
- WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
281
- WebhookIdentityType["MEMBER"] = "MEMBER";
282
- WebhookIdentityType["WIX_USER"] = "WIX_USER";
283
- WebhookIdentityType["APP"] = "APP";
284
- })(WebhookIdentityType || (WebhookIdentityType = {}));
285
- /**
286
- * Creates a new contact.
287
- *
288
- * The `info` object must include at least one of the following:
289
- * - Name
290
- * - Phone number
291
- * - Email address
292
- *
293
- * By default, if the call contains an email already in use by another contact,
294
- * the new contact won't be created. To override this behavior, set `allowDuplicates` to `true`.
295
- * @param info - Contact info.
296
- * @public
297
- * @requiredField info
298
- * @param options - Create contact options.
299
- * @permissionId CONTACTS.MODIFY
300
- * @permissionScope Manage Stores
301
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
302
- * @permissionScope Manage Contacts
303
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
304
- * @permissionScope Manage Members and Contacts - all permissions
305
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
306
- * @applicableIdentity APP
307
- * @returns Contact.
308
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.CreateContact
309
- */
310
- export async function createContact(info, options) {
311
- // @ts-ignore
312
- const { httpClient, sideEffects } = arguments[2];
313
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
314
- info: info,
315
- allowDuplicates: options?.allowDuplicates,
316
- }), [
317
- {
318
- transformFn: transformSDKAddressToRESTAddress,
319
- paths: [{ path: 'info.addresses.items.address' }],
320
- },
321
- {
322
- transformFn: transformSDKImageToRESTImage,
323
- paths: [{ path: 'info.picture.image' }],
324
- },
325
- ]);
326
- const reqOpts = ambassadorWixContactsV4Contact.createContact(payload);
327
- sideEffects?.onSiteCall?.();
328
- try {
329
- const result = await httpClient.request(reqOpts);
330
- sideEffects?.onSuccess?.(result);
331
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
332
- {
333
- transformFn: transformRESTImageToSDKImage,
334
- paths: [
335
- { path: 'contact.picture' },
336
- { path: 'contact.info.picture.image' },
337
- { path: 'contact.memberInfo.profileInfo.photo' },
338
- ],
339
- },
340
- {
341
- transformFn: transformRESTAddressToSDKAddress,
342
- paths: [{ path: 'contact.info.addresses.items.address' }],
343
- },
344
- ]));
345
- }
346
- catch (err) {
347
- const transformedError = sdkTransformError(err, {
348
- spreadPathsToArguments: {},
349
- explicitPathsToArguments: {
350
- info: '$[0]',
351
- allowDuplicates: '$[1].allowDuplicates',
352
- },
353
- singleArgumentUnchanged: false,
354
- }, ['info', 'options']);
355
- sideEffects?.onError?.(err);
356
- throw transformedError;
357
- }
358
- }
359
- /**
360
- * Updates a contact.
361
- *
362
- * Each time the contact is updated,
363
- * `revision` increments by 1.
364
- * The existing `revision` must be included when updating the contact.
365
- * This ensures you're working with the latest contact information,
366
- * and it prevents unintended overwrites.
367
- *
368
- * You can't call Update Contact to update the `primaryEmail` of a contact who is also a member.
369
- * Instead, use the Members API to update the member's login email, which will also update the contact's primary email.
370
- *
371
- * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers. Make sure to specify the contact ID when calling Update Contact.
372
- * @param contactId - ID of the contact to update.
373
- * @param info - Contact info.
374
- * @param revision - Revision number.
375
- * When updating, include the existing `revision`
376
- * to prevent conflicting updates.
377
- * @public
378
- * @requiredField contactId
379
- * @requiredField info
380
- * @requiredField revision
381
- * @param options - Contact update options.
382
- * @permissionId CONTACTS.MODIFY
383
- * @permissionId CONTACTS.MODIFY_MEMBERSHIP_STATUS
384
- * @permissionId CONTACTS.MODIFY_MEMBER_PRIMARY_EMAIL_PERMISSION
385
- * @permissionScope Manage Stores
386
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
387
- * @permissionScope Manage Contacts
388
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
389
- * @permissionScope Manage Members and Contacts - all permissions
390
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
391
- * @applicableIdentity APP
392
- * @returns Updated contact.
393
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UpdateContact
394
- */
395
- export async function updateContact(contactId, info, revision, options) {
396
- // @ts-ignore
397
- const { httpClient, sideEffects } = arguments[4];
398
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
399
- contactId: contactId,
400
- info: info,
401
- revision: revision,
402
- allowDuplicates: options?.allowDuplicates,
403
- }), [
404
- {
405
- transformFn: transformSDKAddressToRESTAddress,
406
- paths: [{ path: 'info.addresses.items.address' }],
407
- },
408
- {
409
- transformFn: transformSDKImageToRESTImage,
410
- paths: [{ path: 'info.picture.image' }],
411
- },
412
- ]);
413
- const reqOpts = ambassadorWixContactsV4Contact.updateContact(payload);
414
- sideEffects?.onSiteCall?.();
415
- try {
416
- const result = await httpClient.request(reqOpts);
417
- sideEffects?.onSuccess?.(result);
418
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
419
- {
420
- transformFn: transformRESTImageToSDKImage,
421
- paths: [
422
- { path: 'contact.picture' },
423
- { path: 'contact.info.picture.image' },
424
- { path: 'contact.memberInfo.profileInfo.photo' },
425
- ],
426
- },
427
- {
428
- transformFn: transformRESTAddressToSDKAddress,
429
- paths: [{ path: 'contact.info.addresses.items.address' }],
430
- },
431
- ]));
432
- }
433
- catch (err) {
434
- const transformedError = sdkTransformError(err, {
435
- spreadPathsToArguments: {},
436
- explicitPathsToArguments: {
437
- contactId: '$[0]',
438
- info: '$[1]',
439
- revision: '$[2]',
440
- allowDuplicates: '$[3].allowDuplicates',
441
- },
442
- singleArgumentUnchanged: false,
443
- }, ['contactId', 'info', 'revision', 'options']);
444
- sideEffects?.onError?.(err);
445
- throw transformedError;
446
- }
447
- }
448
- /**
449
- * Merges source contacts into a target contact.
450
- *
451
- * Merging contacts has the following effects on the target contact:
452
- *
453
- * - No target contact data is overwritten or deleted.
454
- * - Arrays (emails, phone numbers, addresses, and labels) from the source contacts are added to the target contact's arrays.
455
- * - If you merge more than one source contact, the 1st source contact specified is added first, then the 2nd, and so on.
456
- * - If there is duplicate information between the target contact and the source contact, the information isn't duplicated in the target contact's arrays.
457
- *
458
- * <blockquote class="important">
459
- *
460
- * __Important:__
461
- * Merges cannot be undone.
462
- * In REST, call Preview Merge Contacts to test before merging.
463
- *
464
- * </blockquote>
465
- *
466
- * When you merge contacts, source contacts are typically deleted.
467
- * However, if a source contact is a site member or a Wix user,
468
- * the merge will fail because site members and Wix users can't be deleted.
469
- * This means that site members and Wix users can only be specified as target contacts in a merge.
470
- *
471
- * After merging, calling Get Contact with a deleted source contact ID returns the target contact ID.
472
- * Specifying a deleted source contact ID is not supported on any other method.
473
- *
474
- * When contacts are merged:
475
- *
476
- * - The Contact Merged event is triggered.
477
- * - The Contact Updated event is triggered for the target contact. `originatedFrom` is set to `merge`.
478
- * - The Contact Deleted event is triggered for each source contact. `originatedFrom` is set to `merge`.
479
- * @param targetContactId - Target contact ID.
480
- * @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
481
- * To prevent conflicting changes,
482
- * the target contact's current `revision` must be specified.
483
- * @public
484
- * @requiredField targetContactId
485
- * @requiredField targetContactRevision
486
- * @param options - Merge contacts options.
487
- * @permissionId CONTACTS.MERGE
488
- * @permissionScope Manage Stores
489
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
490
- * @permissionScope Manage Contacts
491
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
492
- * @permissionScope Manage Members and Contacts - all permissions
493
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
494
- * @applicableIdentity APP
495
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.MergeContacts
496
- */
497
- export async function mergeContacts(targetContactId, targetContactRevision, options) {
498
- // @ts-ignore
499
- const { httpClient, sideEffects } = arguments[3];
500
- const payload = renameKeysFromSDKRequestToRESTRequest({
501
- targetContactId: targetContactId,
502
- targetContactRevision: targetContactRevision,
503
- sourceContactIds: options?.sourceContactIds,
504
- });
505
- const reqOpts = ambassadorWixContactsV4Contact.mergeContacts(payload);
506
- sideEffects?.onSiteCall?.();
507
- try {
508
- const result = await httpClient.request(reqOpts);
509
- sideEffects?.onSuccess?.(result);
510
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
511
- {
512
- transformFn: transformRESTImageToSDKImage,
513
- paths: [
514
- { path: 'contact.picture' },
515
- { path: 'contact.info.picture.image' },
516
- { path: 'contact.memberInfo.profileInfo.photo' },
517
- ],
518
- },
519
- {
520
- transformFn: transformRESTAddressToSDKAddress,
521
- paths: [{ path: 'contact.info.addresses.items.address' }],
522
- },
523
- ]));
524
- }
525
- catch (err) {
526
- const transformedError = sdkTransformError(err, {
527
- spreadPathsToArguments: {},
528
- explicitPathsToArguments: {
529
- targetContactId: '$[0]',
530
- targetContactRevision: '$[1]',
531
- sourceContactIds: '$[2].sourceContactIds',
532
- },
533
- singleArgumentUnchanged: false,
534
- }, ['targetContactId', 'targetContactRevision', 'options']);
535
- sideEffects?.onError?.(err);
536
- throw transformedError;
537
- }
538
- }
539
- /**
540
- * Deletes a contact.
541
- *
542
- * Deleting a contact permanently removes it from the contact list.
543
- * If a contact is also a site member or Wix user, or has a valid billing subscription,
544
- * the contact can't be deleted. The related site member or Wix user must first be deleted
545
- * and any valid billing subscriptions must be canceled, before the contact can be deleted.
546
- *
547
- * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
548
- * Make sure to specify the contact ID when calling Delete Contact.
549
- * @param contactId - ID of the contact to delete.
550
- * @public
551
- * @requiredField contactId
552
- * @permissionId CONTACTS.MODIFY
553
- * @permissionId MEMBERS.MEMBER_DELETE
554
- * @permissionScope Manage Stores
555
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
556
- * @permissionScope Manage Contacts
557
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
558
- * @permissionScope Manage Members and Contacts - all permissions
559
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
560
- * @permissionScope Manage Members
561
- * @permissionScopeId SCOPE.DC-MEMBERS.MANAGE-MEMBERS
562
- * @applicableIdentity APP
563
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.DeleteContact
564
- */
565
- export async function deleteContact(contactId) {
566
- // @ts-ignore
567
- const { httpClient, sideEffects } = arguments[1];
568
- const payload = renameKeysFromSDKRequestToRESTRequest({
569
- contactId: contactId,
570
- });
571
- const reqOpts = ambassadorWixContactsV4Contact.deleteContact(payload);
572
- sideEffects?.onSiteCall?.();
573
- try {
574
- const result = await httpClient.request(reqOpts);
575
- sideEffects?.onSuccess?.(result);
576
- }
577
- catch (err) {
578
- const transformedError = sdkTransformError(err, {
579
- spreadPathsToArguments: {},
580
- explicitPathsToArguments: { contactId: '$[0]' },
581
- singleArgumentUnchanged: false,
582
- }, ['contactId']);
583
- sideEffects?.onError?.(err);
584
- throw transformedError;
585
- }
586
- }
587
- /**
588
- * Adds labels to a contact.
589
- *
590
- * Use the Labels API to create or retrieve labels.
591
- *
592
- * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
593
- * Make sure to specify the contact ID when calling Label Contact.
594
- * @param contactId - ID of the contact to add labels to.
595
- * @param labelKeys - List of label keys to add to the contact.
596
- *
597
- * Label keys must exist to be added to the contact.
598
- * Use the Labels API to create or retrieve labels.
599
- * @public
600
- * @requiredField contactId
601
- * @requiredField labelKeys
602
- * @permissionId CONTACTS.MODIFY
603
- * @permissionScope Manage Stores
604
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
605
- * @permissionScope Manage Contacts
606
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
607
- * @permissionScope Manage Members and Contacts - all permissions
608
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
609
- * @applicableIdentity APP
610
- * @returns Updated contact.
611
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.LabelContact
612
- */
613
- export async function labelContact(contactId, labelKeys) {
614
- // @ts-ignore
615
- const { httpClient, sideEffects } = arguments[2];
616
- const payload = renameKeysFromSDKRequestToRESTRequest({
617
- contactId: contactId,
618
- labelKeys: labelKeys,
619
- });
620
- const reqOpts = ambassadorWixContactsV4Contact.labelContact(payload);
621
- sideEffects?.onSiteCall?.();
622
- try {
623
- const result = await httpClient.request(reqOpts);
624
- sideEffects?.onSuccess?.(result);
625
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
626
- {
627
- transformFn: transformRESTImageToSDKImage,
628
- paths: [
629
- { path: 'contact.picture' },
630
- { path: 'contact.info.picture.image' },
631
- { path: 'contact.memberInfo.profileInfo.photo' },
632
- ],
633
- },
634
- {
635
- transformFn: transformRESTAddressToSDKAddress,
636
- paths: [{ path: 'contact.info.addresses.items.address' }],
637
- },
638
- ]));
639
- }
640
- catch (err) {
641
- const transformedError = sdkTransformError(err, {
642
- spreadPathsToArguments: {},
643
- explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
644
- singleArgumentUnchanged: false,
645
- }, ['contactId', 'labelKeys']);
646
- sideEffects?.onError?.(err);
647
- throw transformedError;
648
- }
649
- }
650
- /**
651
- * Removes labels from a contact.
652
- *
653
- * If a label is no longer needed
654
- * and you want to remove it from all contacts,
655
- * you can delete by calling Delete Label from the Labels API.
656
- *
657
- * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
658
- * Make sure to specify the contact ID when calling Unlabel Contact.
659
- * @param contactId - ID of the contact to remove labels from.
660
- * @param labelKeys - List of label keys to remove from the contact.
661
- * @public
662
- * @requiredField contactId
663
- * @requiredField labelKeys
664
- * @permissionId CONTACTS.MODIFY
665
- * @permissionScope Manage Stores
666
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
667
- * @permissionScope Manage Contacts
668
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
669
- * @permissionScope Manage Members and Contacts - all permissions
670
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
671
- * @applicableIdentity APP
672
- * @returns Updated contact.
673
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UnlabelContact
674
- */
675
- export async function unlabelContact(contactId, labelKeys) {
676
- // @ts-ignore
677
- const { httpClient, sideEffects } = arguments[2];
678
- const payload = renameKeysFromSDKRequestToRESTRequest({
679
- contactId: contactId,
680
- labelKeys: labelKeys,
681
- });
682
- const reqOpts = ambassadorWixContactsV4Contact.unlabelContact(payload);
683
- sideEffects?.onSiteCall?.();
684
- try {
685
- const result = await httpClient.request(reqOpts);
686
- sideEffects?.onSuccess?.(result);
687
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
688
- {
689
- transformFn: transformRESTImageToSDKImage,
690
- paths: [
691
- { path: 'contact.picture' },
692
- { path: 'contact.info.picture.image' },
693
- { path: 'contact.memberInfo.profileInfo.photo' },
694
- ],
695
- },
696
- {
697
- transformFn: transformRESTAddressToSDKAddress,
698
- paths: [{ path: 'contact.info.addresses.items.address' }],
699
- },
700
- ]));
701
- }
702
- catch (err) {
703
- const transformedError = sdkTransformError(err, {
704
- spreadPathsToArguments: {},
705
- explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
706
- singleArgumentUnchanged: false,
707
- }, ['contactId', 'labelKeys']);
708
- sideEffects?.onError?.(err);
709
- throw transformedError;
710
- }
711
- }
712
- /**
713
- * Creates a query to retrieve a list of contacts.
714
- *
715
- * The `queryContacts()` function builds a query to retrieve a list of contacts and returns a `ContactsQueryBuilder` object.
716
- *
717
- * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
718
- *
719
- * You can refine the query by chaining `ContactsQueryBuilder` functions onto the query. `ContactsQueryBuilder` functions enable you to sort, filter, and control the results `queryContacts()` returns.
720
- *
721
- * `queryContacts()` runs with these `ContactsQueryBuilder` defaults, which you can override:
722
- *
723
- * - `skip(0)`
724
- * - `limit(50)`
725
- * - `descending("_createdDate")`
726
- *
727
- * 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.
728
- * @public
729
- * @param options - Query contact options.
730
- * @permissionScope Manage Stores
731
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
732
- * @permissionScope Manage Events
733
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
734
- * @permissionScope Manage Challenges
735
- * @permissionScopeId SCOPE.CHALLENGES.MANAGE
736
- * @permissionScope Read Contacts
737
- * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
738
- * @permissionScope Read Members and Contacts - all read permissions
739
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
740
- * @permissionScope Manage Contacts
741
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
742
- * @permissionScope Set Up Automations
743
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
744
- * @permissionScope Manage Members and Contacts - all permissions
745
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
746
- * @permissionId CONTACTS.VIEW
747
- * @applicableIdentity APP
748
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.QueryContacts
749
- */
750
- export function queryContacts(options) {
751
- // @ts-ignore
752
- const { httpClient, sideEffects } = arguments[1];
753
- return queryBuilder({
754
- func: async (payload) => {
755
- const reqOpts = ambassadorWixContactsV4Contact.queryContacts({
756
- ...payload,
757
- ...(options ?? {}),
758
- });
759
- sideEffects?.onSiteCall?.();
760
- try {
761
- const result = await httpClient.request(reqOpts);
762
- sideEffects?.onSuccess?.(result);
763
- return result;
764
- }
765
- catch (err) {
766
- sideEffects?.onError?.(err);
767
- throw err;
768
- }
769
- },
770
- requestTransformer: (query) => {
771
- const args = [query, options];
772
- return renameKeysFromSDKRequestToRESTRequest({
773
- ...args?.[1],
774
- query: args?.[0],
775
- });
776
- },
777
- responseTransformer: ({ data }) => {
778
- const transformedData = renameKeysFromRESTResponseToSDKResponse(transformPaths(data, [
779
- {
780
- transformFn: transformRESTImageToSDKImage,
781
- paths: [
782
- { path: 'contacts.picture' },
783
- { path: 'contacts.info.picture.image' },
784
- { path: 'contacts.memberInfo.profileInfo.photo' },
785
- ],
786
- },
787
- {
788
- transformFn: transformRESTAddressToSDKAddress,
789
- paths: [{ path: 'contacts.info.addresses.items.address' }],
790
- },
791
- ]));
792
- return {
793
- items: transformedData?.contacts,
794
- pagingMetadata: transformedData?.pagingMetadata,
795
- };
796
- },
797
- errorTransformer: (err) => {
798
- const transformedError = sdkTransformError(err, {
799
- spreadPathsToArguments: {},
800
- explicitPathsToArguments: { query: '$[0]' },
801
- singleArgumentUnchanged: false,
802
- });
803
- throw transformedError;
804
- },
805
- pagingMethod: 'OFFSET',
806
- transformationPaths: {},
807
- });
808
- }
809
- /**
810
- * Retrieves a contact.
811
- *
812
- * #### Getting Merged Contacts
813
- *
814
- * When a source contact is merged
815
- * with a target contact, the source contact is deleted.
816
- * When calling Get Contact for a merged contact,
817
- * you can use the source or target contact ID.
818
- * In both bases, the target contact is returned.
819
- *
820
- * This is supported only when calling Get Contact on merged contacts.
821
- * Previously deleted source contact IDs can't be used for any other method.
822
- * @param _id - ID of the contact to retrieve.
823
- * @public
824
- * @requiredField _id
825
- * @param options - Get contact options.
826
- * @permissionId CONTACTS.VIEW
827
- * @permissionScope Manage Stores
828
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
829
- * @permissionScope Manage Events
830
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
831
- * @permissionScope Manage Challenges
832
- * @permissionScopeId SCOPE.CHALLENGES.MANAGE
833
- * @permissionScope Read Contacts
834
- * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
835
- * @permissionScope Read Members and Contacts - all read permissions
836
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
837
- * @permissionScope Manage Contacts
838
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
839
- * @permissionScope Set Up Automations
840
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
841
- * @permissionScope Manage Members and Contacts - all permissions
842
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
843
- * @applicableIdentity APP
844
- * @returns The requested contact.
845
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.GetContact
846
- */
847
- export async function getContact(_id, options) {
848
- // @ts-ignore
849
- const { httpClient, sideEffects } = arguments[2];
850
- const payload = renameKeysFromSDKRequestToRESTRequest({
851
- id: _id,
852
- fields: options?.fields,
853
- fieldsets: options?.fieldsets,
854
- });
855
- const reqOpts = ambassadorWixContactsV4Contact.getContact(payload);
856
- sideEffects?.onSiteCall?.();
857
- try {
858
- const result = await httpClient.request(reqOpts);
859
- sideEffects?.onSuccess?.(result);
860
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
861
- {
862
- transformFn: transformRESTImageToSDKImage,
863
- paths: [
864
- { path: 'contact.picture' },
865
- { path: 'contact.info.picture.image' },
866
- { path: 'contact.memberInfo.profileInfo.photo' },
867
- ],
868
- },
869
- {
870
- transformFn: transformRESTAddressToSDKAddress,
871
- paths: [{ path: 'contact.info.addresses.items.address' }],
872
- },
873
- ]))?.contact;
874
- }
875
- catch (err) {
876
- const transformedError = sdkTransformError(err, {
877
- spreadPathsToArguments: {},
878
- explicitPathsToArguments: {
879
- id: '$[0]',
880
- fields: '$[1].fields',
881
- fieldsets: '$[1].fieldsets',
882
- },
883
- singleArgumentUnchanged: false,
884
- }, ['_id', 'options']);
885
- sideEffects?.onError?.(err);
886
- throw transformedError;
887
- }
888
- }
889
- //# sourceMappingURL=contacts-v4-contact-contacts.universal.js.map