@wix/auto_sdk_crm_contacts 1.0.0

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 (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/contacts-v4-contact-contacts.context.d.ts +36 -0
  11. package/build/cjs/src/contacts-v4-contact-contacts.context.js +61 -0
  12. package/build/cjs/src/contacts-v4-contact-contacts.context.js.map +1 -0
  13. package/build/cjs/src/contacts-v4-contact-contacts.http.d.ts +126 -0
  14. package/build/cjs/src/contacts-v4-contact-contacts.http.js +555 -0
  15. package/build/cjs/src/contacts-v4-contact-contacts.http.js.map +1 -0
  16. package/build/cjs/src/contacts-v4-contact-contacts.meta.d.ts +32 -0
  17. package/build/cjs/src/contacts-v4-contact-contacts.meta.js +180 -0
  18. package/build/cjs/src/contacts-v4-contact-contacts.meta.js.map +1 -0
  19. package/build/cjs/src/contacts-v4-contact-contacts.public.d.ts +188 -0
  20. package/build/cjs/src/contacts-v4-contact-contacts.public.js +193 -0
  21. package/build/cjs/src/contacts-v4-contact-contacts.public.js.map +1 -0
  22. package/build/cjs/src/contacts-v4-contact-contacts.types.d.ts +1701 -0
  23. package/build/cjs/src/contacts-v4-contact-contacts.types.js +266 -0
  24. package/build/cjs/src/contacts-v4-contact-contacts.types.js.map +1 -0
  25. package/build/cjs/src/contacts-v4-contact-contacts.universal.d.ts +2153 -0
  26. package/build/cjs/src/contacts-v4-contact-contacts.universal.js +883 -0
  27. package/build/cjs/src/contacts-v4-contact-contacts.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/contacts-v4-contact-contacts.context.d.ts +36 -0
  39. package/build/es/src/contacts-v4-contact-contacts.context.js +36 -0
  40. package/build/es/src/contacts-v4-contact-contacts.context.js.map +1 -0
  41. package/build/es/src/contacts-v4-contact-contacts.http.d.ts +126 -0
  42. package/build/es/src/contacts-v4-contact-contacts.http.js +544 -0
  43. package/build/es/src/contacts-v4-contact-contacts.http.js.map +1 -0
  44. package/build/es/src/contacts-v4-contact-contacts.meta.d.ts +32 -0
  45. package/build/es/src/contacts-v4-contact-contacts.meta.js +146 -0
  46. package/build/es/src/contacts-v4-contact-contacts.meta.js.map +1 -0
  47. package/build/es/src/contacts-v4-contact-contacts.public.d.ts +188 -0
  48. package/build/es/src/contacts-v4-contact-contacts.public.js +160 -0
  49. package/build/es/src/contacts-v4-contact-contacts.public.js.map +1 -0
  50. package/build/es/src/contacts-v4-contact-contacts.types.d.ts +1701 -0
  51. package/build/es/src/contacts-v4-contact-contacts.types.js +263 -0
  52. package/build/es/src/contacts-v4-contact-contacts.types.js.map +1 -0
  53. package/build/es/src/contacts-v4-contact-contacts.universal.d.ts +2153 -0
  54. package/build/es/src/contacts-v4-contact-contacts.universal.js +849 -0
  55. package/build/es/src/contacts-v4-contact-contacts.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/contacts-v4-contact-contacts.context.d.ts +36 -0
  66. package/build/internal/cjs/src/contacts-v4-contact-contacts.context.js +61 -0
  67. package/build/internal/cjs/src/contacts-v4-contact-contacts.context.js.map +1 -0
  68. package/build/internal/cjs/src/contacts-v4-contact-contacts.http.d.ts +126 -0
  69. package/build/internal/cjs/src/contacts-v4-contact-contacts.http.js +555 -0
  70. package/build/internal/cjs/src/contacts-v4-contact-contacts.http.js.map +1 -0
  71. package/build/internal/cjs/src/contacts-v4-contact-contacts.meta.d.ts +32 -0
  72. package/build/internal/cjs/src/contacts-v4-contact-contacts.meta.js +180 -0
  73. package/build/internal/cjs/src/contacts-v4-contact-contacts.meta.js.map +1 -0
  74. package/build/internal/cjs/src/contacts-v4-contact-contacts.public.d.ts +188 -0
  75. package/build/internal/cjs/src/contacts-v4-contact-contacts.public.js +193 -0
  76. package/build/internal/cjs/src/contacts-v4-contact-contacts.public.js.map +1 -0
  77. package/build/internal/cjs/src/contacts-v4-contact-contacts.types.d.ts +1729 -0
  78. package/build/internal/cjs/src/contacts-v4-contact-contacts.types.js +266 -0
  79. package/build/internal/cjs/src/contacts-v4-contact-contacts.types.js.map +1 -0
  80. package/build/internal/cjs/src/contacts-v4-contact-contacts.universal.d.ts +2187 -0
  81. package/build/internal/cjs/src/contacts-v4-contact-contacts.universal.js +883 -0
  82. package/build/internal/cjs/src/contacts-v4-contact-contacts.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/contacts-v4-contact-contacts.context.d.ts +36 -0
  93. package/build/internal/es/src/contacts-v4-contact-contacts.context.js +36 -0
  94. package/build/internal/es/src/contacts-v4-contact-contacts.context.js.map +1 -0
  95. package/build/internal/es/src/contacts-v4-contact-contacts.http.d.ts +126 -0
  96. package/build/internal/es/src/contacts-v4-contact-contacts.http.js +544 -0
  97. package/build/internal/es/src/contacts-v4-contact-contacts.http.js.map +1 -0
  98. package/build/internal/es/src/contacts-v4-contact-contacts.meta.d.ts +32 -0
  99. package/build/internal/es/src/contacts-v4-contact-contacts.meta.js +146 -0
  100. package/build/internal/es/src/contacts-v4-contact-contacts.meta.js.map +1 -0
  101. package/build/internal/es/src/contacts-v4-contact-contacts.public.d.ts +188 -0
  102. package/build/internal/es/src/contacts-v4-contact-contacts.public.js +160 -0
  103. package/build/internal/es/src/contacts-v4-contact-contacts.public.js.map +1 -0
  104. package/build/internal/es/src/contacts-v4-contact-contacts.types.d.ts +1729 -0
  105. package/build/internal/es/src/contacts-v4-contact-contacts.types.js +263 -0
  106. package/build/internal/es/src/contacts-v4-contact-contacts.types.js.map +1 -0
  107. package/build/internal/es/src/contacts-v4-contact-contacts.universal.d.ts +2187 -0
  108. package/build/internal/es/src/contacts-v4-contact-contacts.universal.js +849 -0
  109. package/build/internal/es/src/contacts-v4-contact-contacts.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,849 @@
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
+ SubscriptionStatus["NO_SUBSCRIPTION_STATUS"] = "NO_SUBSCRIPTION_STATUS";
169
+ SubscriptionStatus["NOT_SET"] = "NOT_SET";
170
+ SubscriptionStatus["PENDING"] = "PENDING";
171
+ SubscriptionStatus["SUBSCRIBED"] = "SUBSCRIBED";
172
+ SubscriptionStatus["UNSUBSCRIBED"] = "UNSUBSCRIBED";
173
+ })(SubscriptionStatus || (SubscriptionStatus = {}));
174
+ export var EmailDeliverabilityStatus;
175
+ (function (EmailDeliverabilityStatus) {
176
+ EmailDeliverabilityStatus["NOT_SET"] = "NOT_SET";
177
+ EmailDeliverabilityStatus["VALID"] = "VALID";
178
+ EmailDeliverabilityStatus["BOUNCED"] = "BOUNCED";
179
+ EmailDeliverabilityStatus["SPAM_COMPLAINT"] = "SPAM_COMPLAINT";
180
+ EmailDeliverabilityStatus["INACTIVE"] = "INACTIVE";
181
+ })(EmailDeliverabilityStatus || (EmailDeliverabilityStatus = {}));
182
+ export var PhoneDeliverabilityStatus;
183
+ (function (PhoneDeliverabilityStatus) {
184
+ PhoneDeliverabilityStatus["NO_PHONE_DELIVERABILITY_STATUS"] = "NO_PHONE_DELIVERABILITY_STATUS";
185
+ PhoneDeliverabilityStatus["NOT_SET"] = "NOT_SET";
186
+ })(PhoneDeliverabilityStatus || (PhoneDeliverabilityStatus = {}));
187
+ export var MemberStatus;
188
+ (function (MemberStatus) {
189
+ MemberStatus["PENDING"] = "PENDING";
190
+ MemberStatus["ACTIVE"] = "ACTIVE";
191
+ MemberStatus["DELETED"] = "DELETED";
192
+ MemberStatus["BLOCKED"] = "BLOCKED";
193
+ MemberStatus["OFFLINE"] = "OFFLINE";
194
+ })(MemberStatus || (MemberStatus = {}));
195
+ export var PrivacyStatus;
196
+ (function (PrivacyStatus) {
197
+ PrivacyStatus["PRIVATE"] = "PRIVATE";
198
+ PrivacyStatus["PUBLIC"] = "PUBLIC";
199
+ })(PrivacyStatus || (PrivacyStatus = {}));
200
+ export var Role;
201
+ (function (Role) {
202
+ Role["UNSPECIFIED_ROLE"] = "UNSPECIFIED_ROLE";
203
+ Role["OWNER"] = "OWNER";
204
+ Role["CONTRIBUTOR"] = "CONTRIBUTOR";
205
+ })(Role || (Role = {}));
206
+ export var SortOrder;
207
+ (function (SortOrder) {
208
+ SortOrder["ASC"] = "ASC";
209
+ SortOrder["DESC"] = "DESC";
210
+ })(SortOrder || (SortOrder = {}));
211
+ export var ContactFieldSet;
212
+ (function (ContactFieldSet) {
213
+ /** name, primaryEmail, primaryPhone */
214
+ ContactFieldSet["BASIC"] = "BASIC";
215
+ /** name, phones, emails, addresses */
216
+ ContactFieldSet["COMMUNICATION_DETAILS"] = "COMMUNICATION_DETAILS";
217
+ /** name, primaryInfo(email, phone), extendedFields */
218
+ ContactFieldSet["EXTENDED"] = "EXTENDED";
219
+ /** Full contact object */
220
+ ContactFieldSet["FULL"] = "FULL";
221
+ })(ContactFieldSet || (ContactFieldSet = {}));
222
+ export var ContactsFacetType;
223
+ (function (ContactsFacetType) {
224
+ ContactsFacetType["UNKNOWN"] = "UNKNOWN";
225
+ ContactsFacetType["ALL_CONTACTS"] = "ALL_CONTACTS";
226
+ ContactsFacetType["NOT_LABELED"] = "NOT_LABELED";
227
+ ContactsFacetType["LABEL"] = "LABEL";
228
+ ContactsFacetType["SUBSCRIPTION_STATUS"] = "SUBSCRIPTION_STATUS";
229
+ ContactsFacetType["MEMBERSHIP_STATUS"] = "MEMBERSHIP_STATUS";
230
+ })(ContactsFacetType || (ContactsFacetType = {}));
231
+ export var Action;
232
+ (function (Action) {
233
+ Action["UNKNOWN"] = "UNKNOWN";
234
+ Action["UPDATED"] = "UPDATED";
235
+ Action["CREATED"] = "CREATED";
236
+ })(Action || (Action = {}));
237
+ export var UpsertContactResponseAction;
238
+ (function (UpsertContactResponseAction) {
239
+ UpsertContactResponseAction["UNKNOWN"] = "UNKNOWN";
240
+ UpsertContactResponseAction["UPDATED"] = "UPDATED";
241
+ UpsertContactResponseAction["CREATED"] = "CREATED";
242
+ })(UpsertContactResponseAction || (UpsertContactResponseAction = {}));
243
+ export var GetContactResponseType;
244
+ (function (GetContactResponseType) {
245
+ /** The specified contact was returned. */
246
+ GetContactResponseType["REGULAR"] = "REGULAR";
247
+ /** Not used. */
248
+ GetContactResponseType["IMPLICIT"] = "IMPLICIT";
249
+ /** The specified contact was previously merged with another contact and the new contact was returned. */
250
+ GetContactResponseType["MERGED"] = "MERGED";
251
+ })(GetContactResponseType || (GetContactResponseType = {}));
252
+ export var SubmitOperation;
253
+ (function (SubmitOperation) {
254
+ SubmitOperation["UNKNOWN"] = "UNKNOWN";
255
+ SubmitOperation["CREATE"] = "CREATE";
256
+ SubmitOperation["UPDATE"] = "UPDATE";
257
+ })(SubmitOperation || (SubmitOperation = {}));
258
+ export var Mode;
259
+ (function (Mode) {
260
+ /** any */
261
+ Mode["OR"] = "OR";
262
+ /** all */
263
+ Mode["AND"] = "AND";
264
+ })(Mode || (Mode = {}));
265
+ export var WebhookIdentityType;
266
+ (function (WebhookIdentityType) {
267
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
268
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
269
+ WebhookIdentityType["MEMBER"] = "MEMBER";
270
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
271
+ WebhookIdentityType["APP"] = "APP";
272
+ })(WebhookIdentityType || (WebhookIdentityType = {}));
273
+ /**
274
+ * Creates a new contact.
275
+ *
276
+ * The `info` object must include at least one of the following:
277
+ * - Name
278
+ * - Phone number
279
+ * - Email address
280
+ *
281
+ * By default, if the call contains an email already in use by another contact,
282
+ * the new contact won't be created. To override this behavior, set `allowDuplicates` to `true`.
283
+ * @param info - Contact info.
284
+ * @public
285
+ * @requiredField info
286
+ * @param options - Create contact options.
287
+ * @permissionId CONTACTS.MODIFY
288
+ * @permissionScope Manage Contacts
289
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
290
+ * @permissionScope Manage Members and Contacts - all permissions
291
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
292
+ * @applicableIdentity APP
293
+ * @returns Contact.
294
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.CreateContact
295
+ */
296
+ export async function createContact(info, options) {
297
+ // @ts-ignore
298
+ const { httpClient, sideEffects } = arguments[2];
299
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
300
+ info: info,
301
+ allowDuplicates: options?.allowDuplicates,
302
+ }), [
303
+ {
304
+ transformFn: transformSDKAddressToRESTAddress,
305
+ paths: [{ path: 'info.addresses.items.address' }],
306
+ },
307
+ {
308
+ transformFn: transformSDKImageToRESTImage,
309
+ paths: [{ path: 'info.picture.image' }],
310
+ },
311
+ ]);
312
+ const reqOpts = ambassadorWixContactsV4Contact.createContact(payload);
313
+ sideEffects?.onSiteCall?.();
314
+ try {
315
+ const result = await httpClient.request(reqOpts);
316
+ sideEffects?.onSuccess?.(result);
317
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
318
+ {
319
+ transformFn: transformRESTImageToSDKImage,
320
+ paths: [
321
+ { path: 'contact.picture' },
322
+ { path: 'contact.info.picture.image' },
323
+ { path: 'contact.memberInfo.profileInfo.photo' },
324
+ ],
325
+ },
326
+ {
327
+ transformFn: transformRESTAddressToSDKAddress,
328
+ paths: [{ path: 'contact.info.addresses.items.address' }],
329
+ },
330
+ ]));
331
+ }
332
+ catch (err) {
333
+ const transformedError = sdkTransformError(err, {
334
+ spreadPathsToArguments: {},
335
+ explicitPathsToArguments: {
336
+ info: '$[0]',
337
+ allowDuplicates: '$[1].allowDuplicates',
338
+ },
339
+ singleArgumentUnchanged: false,
340
+ }, ['info', 'options']);
341
+ sideEffects?.onError?.(err);
342
+ throw transformedError;
343
+ }
344
+ }
345
+ /**
346
+ * Updates a contact.
347
+ *
348
+ * Each time the contact is updated,
349
+ * `revision` increments by 1.
350
+ * The existing `revision` must be included when updating the contact.
351
+ * This ensures you're working with the latest contact information,
352
+ * and it prevents unintended overwrites.
353
+ *
354
+ * You can't call Update Contact to update the `primaryEmail` of a contact who is also a member.
355
+ * Instead, use the Members API to update the member's login email, which will also update the contact's primary email.
356
+ *
357
+ * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers. Make sure to specifiy the contact ID when calling Update Contact.
358
+ * @param contactId - ID of the contact to update.
359
+ * @param info - Contact info.
360
+ * @param revision - Revision number.
361
+ * When updating, include the existing `revision`
362
+ * to prevent conflicting updates.
363
+ * @public
364
+ * @requiredField contactId
365
+ * @requiredField info
366
+ * @requiredField revision
367
+ * @param options - Contact update options.
368
+ * @permissionId CONTACTS.MODIFY
369
+ * @permissionId CONTACTS.MODIFY_MEMBERSHIP_STATUS
370
+ * @permissionId CONTACTS.MODIFY_MEMBER_PRIMARY_EMAIL_PERMISSION
371
+ * @permissionScope Manage Contacts
372
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
373
+ * @permissionScope Manage Members and Contacts - all permissions
374
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
375
+ * @applicableIdentity APP
376
+ * @returns Updated contact.
377
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UpdateContact
378
+ */
379
+ export async function updateContact(contactId, info, revision, options) {
380
+ // @ts-ignore
381
+ const { httpClient, sideEffects } = arguments[4];
382
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
383
+ contactId: contactId,
384
+ info: info,
385
+ revision: revision,
386
+ allowDuplicates: options?.allowDuplicates,
387
+ }), [
388
+ {
389
+ transformFn: transformSDKAddressToRESTAddress,
390
+ paths: [{ path: 'info.addresses.items.address' }],
391
+ },
392
+ {
393
+ transformFn: transformSDKImageToRESTImage,
394
+ paths: [{ path: 'info.picture.image' }],
395
+ },
396
+ ]);
397
+ const reqOpts = ambassadorWixContactsV4Contact.updateContact(payload);
398
+ sideEffects?.onSiteCall?.();
399
+ try {
400
+ const result = await httpClient.request(reqOpts);
401
+ sideEffects?.onSuccess?.(result);
402
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
403
+ {
404
+ transformFn: transformRESTImageToSDKImage,
405
+ paths: [
406
+ { path: 'contact.picture' },
407
+ { path: 'contact.info.picture.image' },
408
+ { path: 'contact.memberInfo.profileInfo.photo' },
409
+ ],
410
+ },
411
+ {
412
+ transformFn: transformRESTAddressToSDKAddress,
413
+ paths: [{ path: 'contact.info.addresses.items.address' }],
414
+ },
415
+ ]));
416
+ }
417
+ catch (err) {
418
+ const transformedError = sdkTransformError(err, {
419
+ spreadPathsToArguments: {},
420
+ explicitPathsToArguments: {
421
+ contactId: '$[0]',
422
+ info: '$[1]',
423
+ revision: '$[2]',
424
+ allowDuplicates: '$[3].allowDuplicates',
425
+ },
426
+ singleArgumentUnchanged: false,
427
+ }, ['contactId', 'info', 'revision', 'options']);
428
+ sideEffects?.onError?.(err);
429
+ throw transformedError;
430
+ }
431
+ }
432
+ /**
433
+ * Merges source contacts into a target contact.
434
+ *
435
+ * Merging contacts has the following effects on the target contact:
436
+ *
437
+ * - No target contact data is overwritten or deleted.
438
+ * - Arrays (emails, phone numbers, addresses, and labels) from the source contacts are added to the target contact's arrays.
439
+ * - If you merge more than one source contact, the 1st source contact specified is added first, then the 2nd, and so on.
440
+ * - If there is duplicate information between the target contact and the source contact, the information isn't duplicated in the target contact's arrays.
441
+ *
442
+ * <blockquote class="important">
443
+ *
444
+ * __Important:__
445
+ * Merges cannot be undone.
446
+ * In REST, call Preview Merge Contacts to test before merging.
447
+ *
448
+ * </blockquote>
449
+ *
450
+ * When you merge contacts, source contacts are typically deleted.
451
+ * However, if a source contact is a site member or a Wix user,
452
+ * the merge will fail because site members and Wix users can't be deleted.
453
+ * This means that site members and Wix users can only be specified as target contacts in a merge.
454
+ *
455
+ * After merging, calling Get Contact with a deleted source contact ID returns the target contact ID.
456
+ * Specifying a deleted source contact ID is not supported on any other method.
457
+ *
458
+ * When contacts are merged:
459
+ *
460
+ * - The Contact Merged event is triggered.
461
+ * - The Contact Updated event is triggered for the target contact. `originatedFrom` is set to `merge`.
462
+ * - The Contact Deleted event is triggered for each source contact. `originatedFrom` is set to `merge`.
463
+ * @param targetContactId - Target contact ID.
464
+ * @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
465
+ * To prevent conflicting changes,
466
+ * the target contact's current `revision` must be specified.
467
+ * @public
468
+ * @requiredField targetContactId
469
+ * @requiredField targetContactRevision
470
+ * @param options - Merge contacts options.
471
+ * @permissionId CONTACTS.MERGE
472
+ * @permissionScope Manage Contacts
473
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
474
+ * @permissionScope Manage Members and Contacts - all permissions
475
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
476
+ * @applicableIdentity APP
477
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.MergeContacts
478
+ */
479
+ export async function mergeContacts(targetContactId, targetContactRevision, options) {
480
+ // @ts-ignore
481
+ const { httpClient, sideEffects } = arguments[3];
482
+ const payload = renameKeysFromSDKRequestToRESTRequest({
483
+ targetContactId: targetContactId,
484
+ targetContactRevision: targetContactRevision,
485
+ sourceContactIds: options?.sourceContactIds,
486
+ });
487
+ const reqOpts = ambassadorWixContactsV4Contact.mergeContacts(payload);
488
+ sideEffects?.onSiteCall?.();
489
+ try {
490
+ const result = await httpClient.request(reqOpts);
491
+ sideEffects?.onSuccess?.(result);
492
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
493
+ {
494
+ transformFn: transformRESTImageToSDKImage,
495
+ paths: [
496
+ { path: 'contact.picture' },
497
+ { path: 'contact.info.picture.image' },
498
+ { path: 'contact.memberInfo.profileInfo.photo' },
499
+ ],
500
+ },
501
+ {
502
+ transformFn: transformRESTAddressToSDKAddress,
503
+ paths: [{ path: 'contact.info.addresses.items.address' }],
504
+ },
505
+ ]));
506
+ }
507
+ catch (err) {
508
+ const transformedError = sdkTransformError(err, {
509
+ spreadPathsToArguments: {},
510
+ explicitPathsToArguments: {
511
+ targetContactId: '$[0]',
512
+ targetContactRevision: '$[1]',
513
+ sourceContactIds: '$[2].sourceContactIds',
514
+ },
515
+ singleArgumentUnchanged: false,
516
+ }, ['targetContactId', 'targetContactRevision', 'options']);
517
+ sideEffects?.onError?.(err);
518
+ throw transformedError;
519
+ }
520
+ }
521
+ /**
522
+ * Deletes a contact.
523
+ *
524
+ * Deleting a contact permanently removes it from the contact list.
525
+ * If a contact is also a site member or Wix user, or has a valid billing subscription,
526
+ * the contact can't be deleted. The related site member or Wix user must first be deleted
527
+ * and any valid billing subscriptions must be canceled, before the contact can be deleted.
528
+ *
529
+ * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
530
+ * Make sure to specify the contact ID when calling Delete Contact.
531
+ * @param contactId - ID of the contact to delete.
532
+ * @public
533
+ * @requiredField contactId
534
+ * @permissionId CONTACTS.MODIFY
535
+ * @permissionId MEMBERS.MEMBER_DELETE
536
+ * @permissionScope Manage Contacts
537
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
538
+ * @permissionScope Manage Members and Contacts - all permissions
539
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
540
+ * @permissionScope Manage Members
541
+ * @permissionScopeId SCOPE.DC-MEMBERS.MANAGE-MEMBERS
542
+ * @applicableIdentity APP
543
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.DeleteContact
544
+ */
545
+ export async function deleteContact(contactId) {
546
+ // @ts-ignore
547
+ const { httpClient, sideEffects } = arguments[1];
548
+ const payload = renameKeysFromSDKRequestToRESTRequest({
549
+ contactId: contactId,
550
+ });
551
+ const reqOpts = ambassadorWixContactsV4Contact.deleteContact(payload);
552
+ sideEffects?.onSiteCall?.();
553
+ try {
554
+ const result = await httpClient.request(reqOpts);
555
+ sideEffects?.onSuccess?.(result);
556
+ }
557
+ catch (err) {
558
+ const transformedError = sdkTransformError(err, {
559
+ spreadPathsToArguments: {},
560
+ explicitPathsToArguments: { contactId: '$[0]' },
561
+ singleArgumentUnchanged: false,
562
+ }, ['contactId']);
563
+ sideEffects?.onError?.(err);
564
+ throw transformedError;
565
+ }
566
+ }
567
+ /**
568
+ * Adds labels to a contact.
569
+ *
570
+ * Use the Labels API to create or retrieve labels.
571
+ *
572
+ * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
573
+ * Make sure to specify the contact ID when calling Label Contact.
574
+ * @param contactId - ID of the contact to add labels to.
575
+ * @param labelKeys - List of label keys to add to the contact.
576
+ *
577
+ * Label keys must exist to be added to the contact.
578
+ * Use the Labels API to create or retrieve labels.
579
+ * @public
580
+ * @requiredField contactId
581
+ * @requiredField labelKeys
582
+ * @permissionId CONTACTS.MODIFY
583
+ * @permissionScope Manage Contacts
584
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
585
+ * @permissionScope Manage Members and Contacts - all permissions
586
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
587
+ * @applicableIdentity APP
588
+ * @returns Updated contact.
589
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.LabelContact
590
+ */
591
+ export async function labelContact(contactId, labelKeys) {
592
+ // @ts-ignore
593
+ const { httpClient, sideEffects } = arguments[2];
594
+ const payload = renameKeysFromSDKRequestToRESTRequest({
595
+ contactId: contactId,
596
+ labelKeys: labelKeys,
597
+ });
598
+ const reqOpts = ambassadorWixContactsV4Contact.labelContact(payload);
599
+ sideEffects?.onSiteCall?.();
600
+ try {
601
+ const result = await httpClient.request(reqOpts);
602
+ sideEffects?.onSuccess?.(result);
603
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
604
+ {
605
+ transformFn: transformRESTImageToSDKImage,
606
+ paths: [
607
+ { path: 'contact.picture' },
608
+ { path: 'contact.info.picture.image' },
609
+ { path: 'contact.memberInfo.profileInfo.photo' },
610
+ ],
611
+ },
612
+ {
613
+ transformFn: transformRESTAddressToSDKAddress,
614
+ paths: [{ path: 'contact.info.addresses.items.address' }],
615
+ },
616
+ ]));
617
+ }
618
+ catch (err) {
619
+ const transformedError = sdkTransformError(err, {
620
+ spreadPathsToArguments: {},
621
+ explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
622
+ singleArgumentUnchanged: false,
623
+ }, ['contactId', 'labelKeys']);
624
+ sideEffects?.onError?.(err);
625
+ throw transformedError;
626
+ }
627
+ }
628
+ /**
629
+ * Removes labels from a contact.
630
+ *
631
+ * If a label is no longer needed
632
+ * and you want to remove it from all contacts,
633
+ * you can delete by calling Delete Label from the Labels API.
634
+ *
635
+ * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
636
+ * Make sure to specify the contact ID when calling Unlabel Contact.
637
+ * @param contactId - ID of the contact to remove labels from.
638
+ * @param labelKeys - List of label keys to remove from the contact.
639
+ * @public
640
+ * @requiredField contactId
641
+ * @requiredField labelKeys
642
+ * @permissionId CONTACTS.MODIFY
643
+ * @permissionScope Manage Contacts
644
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
645
+ * @permissionScope Manage Members and Contacts - all permissions
646
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
647
+ * @applicableIdentity APP
648
+ * @returns Updated contact.
649
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UnlabelContact
650
+ */
651
+ export async function unlabelContact(contactId, labelKeys) {
652
+ // @ts-ignore
653
+ const { httpClient, sideEffects } = arguments[2];
654
+ const payload = renameKeysFromSDKRequestToRESTRequest({
655
+ contactId: contactId,
656
+ labelKeys: labelKeys,
657
+ });
658
+ const reqOpts = ambassadorWixContactsV4Contact.unlabelContact(payload);
659
+ sideEffects?.onSiteCall?.();
660
+ try {
661
+ const result = await httpClient.request(reqOpts);
662
+ sideEffects?.onSuccess?.(result);
663
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
664
+ {
665
+ transformFn: transformRESTImageToSDKImage,
666
+ paths: [
667
+ { path: 'contact.picture' },
668
+ { path: 'contact.info.picture.image' },
669
+ { path: 'contact.memberInfo.profileInfo.photo' },
670
+ ],
671
+ },
672
+ {
673
+ transformFn: transformRESTAddressToSDKAddress,
674
+ paths: [{ path: 'contact.info.addresses.items.address' }],
675
+ },
676
+ ]));
677
+ }
678
+ catch (err) {
679
+ const transformedError = sdkTransformError(err, {
680
+ spreadPathsToArguments: {},
681
+ explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
682
+ singleArgumentUnchanged: false,
683
+ }, ['contactId', 'labelKeys']);
684
+ sideEffects?.onError?.(err);
685
+ throw transformedError;
686
+ }
687
+ }
688
+ /**
689
+ * Creates a query to retrieve a list of contacts.
690
+ *
691
+ * The `queryContacts()` function builds a query to retrieve a list of contacts and returns a `ContactsQueryBuilder` object.
692
+ *
693
+ * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
694
+ *
695
+ * 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.
696
+ *
697
+ * `queryContacts()` runs with these `ContactsQueryBuilder` defaults, which you can override:
698
+ *
699
+ * - `skip(0)`
700
+ * - `limit(50)`
701
+ * - `descending(\"_createdDate\")`
702
+ *
703
+ * 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.
704
+ * @public
705
+ * @param options - Query contact options.
706
+ * @permissionScope Read Contacts
707
+ * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
708
+ * @permissionScope Read Members and Contacts - all read permissions
709
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
710
+ * @permissionScope Manage Contacts
711
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
712
+ * @permissionScope Manage Members and Contacts - all permissions
713
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
714
+ * @permissionId CONTACTS.VIEW
715
+ * @applicableIdentity APP
716
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.QueryContacts
717
+ */
718
+ export function queryContacts(options) {
719
+ // @ts-ignore
720
+ const { httpClient, sideEffects } = arguments[1];
721
+ return queryBuilder({
722
+ func: async (payload) => {
723
+ const reqOpts = ambassadorWixContactsV4Contact.queryContacts({
724
+ ...payload,
725
+ ...(options ?? {}),
726
+ });
727
+ sideEffects?.onSiteCall?.();
728
+ try {
729
+ const result = await httpClient.request(reqOpts);
730
+ sideEffects?.onSuccess?.(result);
731
+ return result;
732
+ }
733
+ catch (err) {
734
+ sideEffects?.onError?.(err);
735
+ throw err;
736
+ }
737
+ },
738
+ requestTransformer: (query) => {
739
+ const args = [query, options];
740
+ return renameKeysFromSDKRequestToRESTRequest({
741
+ ...args?.[1],
742
+ query: args?.[0],
743
+ });
744
+ },
745
+ responseTransformer: ({ data }) => {
746
+ const transformedData = renameKeysFromRESTResponseToSDKResponse(transformPaths(data, [
747
+ {
748
+ transformFn: transformRESTImageToSDKImage,
749
+ paths: [
750
+ { path: 'contacts.picture' },
751
+ { path: 'contacts.info.picture.image' },
752
+ { path: 'contacts.memberInfo.profileInfo.photo' },
753
+ ],
754
+ },
755
+ {
756
+ transformFn: transformRESTAddressToSDKAddress,
757
+ paths: [{ path: 'contacts.info.addresses.items.address' }],
758
+ },
759
+ ]));
760
+ return {
761
+ items: transformedData?.contacts,
762
+ pagingMetadata: transformedData?.pagingMetadata,
763
+ };
764
+ },
765
+ errorTransformer: (err) => {
766
+ const transformedError = sdkTransformError(err, {
767
+ spreadPathsToArguments: {},
768
+ explicitPathsToArguments: { query: '$[0]' },
769
+ singleArgumentUnchanged: false,
770
+ });
771
+ throw transformedError;
772
+ },
773
+ pagingMethod: 'OFFSET',
774
+ transformationPaths: {},
775
+ });
776
+ }
777
+ /**
778
+ * Retrieves a contact.
779
+ *
780
+ * #### Getting Merged Contacts
781
+ *
782
+ * When a source contact is merged
783
+ * with a target contact, the source contact is deleted.
784
+ * When calling Get Contact for a merged contact,
785
+ * you can use the source or target contact ID.
786
+ * In both bases, the target contact is returned.
787
+ *
788
+ * This is supported only when calling Get Contact on merged contacts.
789
+ * Previously deleted source contact IDs can't be used for any other method.
790
+ * @param _id - ID of the contact to retrieve.
791
+ * @public
792
+ * @requiredField _id
793
+ * @param options - Get contact options.
794
+ * @permissionId CONTACTS.VIEW
795
+ * @permissionScope Read Contacts
796
+ * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
797
+ * @permissionScope Read Members and Contacts - all read permissions
798
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
799
+ * @permissionScope Manage Contacts
800
+ * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
801
+ * @permissionScope Manage Members and Contacts - all permissions
802
+ * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
803
+ * @applicableIdentity APP
804
+ * @returns The requested contact.
805
+ * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.GetContact
806
+ */
807
+ export async function getContact(_id, options) {
808
+ // @ts-ignore
809
+ const { httpClient, sideEffects } = arguments[2];
810
+ const payload = renameKeysFromSDKRequestToRESTRequest({
811
+ id: _id,
812
+ fields: options?.fields,
813
+ fieldsets: options?.fieldsets,
814
+ });
815
+ const reqOpts = ambassadorWixContactsV4Contact.getContact(payload);
816
+ sideEffects?.onSiteCall?.();
817
+ try {
818
+ const result = await httpClient.request(reqOpts);
819
+ sideEffects?.onSuccess?.(result);
820
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
821
+ {
822
+ transformFn: transformRESTImageToSDKImage,
823
+ paths: [
824
+ { path: 'contact.picture' },
825
+ { path: 'contact.info.picture.image' },
826
+ { path: 'contact.memberInfo.profileInfo.photo' },
827
+ ],
828
+ },
829
+ {
830
+ transformFn: transformRESTAddressToSDKAddress,
831
+ paths: [{ path: 'contact.info.addresses.items.address' }],
832
+ },
833
+ ]))?.contact;
834
+ }
835
+ catch (err) {
836
+ const transformedError = sdkTransformError(err, {
837
+ spreadPathsToArguments: {},
838
+ explicitPathsToArguments: {
839
+ id: '$[0]',
840
+ fields: '$[1].fields',
841
+ fieldsets: '$[1].fieldsets',
842
+ },
843
+ singleArgumentUnchanged: false,
844
+ }, ['_id', 'options']);
845
+ sideEffects?.onError?.(err);
846
+ throw transformedError;
847
+ }
848
+ }
849
+ //# sourceMappingURL=contacts-v4-contact-contacts.universal.js.map