@wix/auto_sdk_crm_contacts 1.0.255 → 1.0.256

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-B3uIE5qF.d.mts} +363 -193
  2. package/build/{internal/cjs/src/contacts-v4-contact-contacts.types.d.ts → contacts-v4-contact-contacts.universal-B3uIE5qF.d.ts} +363 -193
  3. package/build/{cjs/src/contacts-v4-contact-contacts.public.d.ts → index.d.mts} +43 -18
  4. package/build/{es/src/contacts-v4-contact-contacts.public.d.ts → index.d.ts} +43 -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-CdMlf2ui.d.mts} +370 -189
  10. package/build/{es/src/contacts-v4-contact-contacts.types.d.ts → internal/contacts-v4-contact-contacts.universal-CdMlf2ui.d.ts} +370 -189
  11. package/build/internal/{cjs/src/contacts-v4-contact-contacts.public.d.ts → index.d.mts} +43 -18
  12. package/build/internal/{es/src/contacts-v4-contact-contacts.public.d.ts → index.d.ts} +43 -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 +914 -0
  18. package/build/internal/meta.d.ts +914 -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 +914 -0
  24. package/build/meta.d.ts +914 -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 +13 -12
  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 -2398
  53. package/build/cjs/src/contacts-v4-contact-contacts.universal.js +0 -911
  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 -2398
  79. package/build/es/src/contacts-v4-contact-contacts.universal.js +0 -877
  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 -2409
  104. package/build/internal/cjs/src/contacts-v4-contact-contacts.universal.js +0 -911
  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 -2409
  129. package/build/internal/es/src/contacts-v4-contact-contacts.universal.js +0 -877
  130. package/build/internal/es/src/contacts-v4-contact-contacts.universal.js.map +0 -1
@@ -1,877 +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 Contacts
301
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
302
- * @permissionScope Manage Members and Contacts - all permissions
303
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
304
- * @applicableIdentity APP
305
- * @returns Contact.
306
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.CreateContact
307
- */
308
- export async function createContact(info, options) {
309
- // @ts-ignore
310
- const { httpClient, sideEffects } = arguments[2];
311
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
312
- info: info,
313
- allowDuplicates: options?.allowDuplicates,
314
- }), [
315
- {
316
- transformFn: transformSDKAddressToRESTAddress,
317
- paths: [{ path: 'info.addresses.items.address' }],
318
- },
319
- {
320
- transformFn: transformSDKImageToRESTImage,
321
- paths: [{ path: 'info.picture.image' }],
322
- },
323
- ]);
324
- const reqOpts = ambassadorWixContactsV4Contact.createContact(payload);
325
- sideEffects?.onSiteCall?.();
326
- try {
327
- const result = await httpClient.request(reqOpts);
328
- sideEffects?.onSuccess?.(result);
329
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
330
- {
331
- transformFn: transformRESTImageToSDKImage,
332
- paths: [
333
- { path: 'contact.picture' },
334
- { path: 'contact.info.picture.image' },
335
- { path: 'contact.memberInfo.profileInfo.photo' },
336
- ],
337
- },
338
- {
339
- transformFn: transformRESTAddressToSDKAddress,
340
- paths: [{ path: 'contact.info.addresses.items.address' }],
341
- },
342
- ]));
343
- }
344
- catch (err) {
345
- const transformedError = sdkTransformError(err, {
346
- spreadPathsToArguments: {},
347
- explicitPathsToArguments: {
348
- info: '$[0]',
349
- allowDuplicates: '$[1].allowDuplicates',
350
- },
351
- singleArgumentUnchanged: false,
352
- }, ['info', 'options']);
353
- sideEffects?.onError?.(err);
354
- throw transformedError;
355
- }
356
- }
357
- /**
358
- * Updates a contact.
359
- *
360
- * Each time the contact is updated,
361
- * `revision` increments by 1.
362
- * The existing `revision` must be included when updating the contact.
363
- * This ensures you're working with the latest contact information,
364
- * and it prevents unintended overwrites.
365
- *
366
- * You can't call Update Contact to update the `primaryEmail` of a contact who is also a member.
367
- * Instead, use the Members API to update the member's login email, which will also update the contact's primary email.
368
- *
369
- * 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.
370
- * @param contactId - ID of the contact to update.
371
- * @param info - Contact info.
372
- * @param revision - Revision number.
373
- * When updating, include the existing `revision`
374
- * to prevent conflicting updates.
375
- * @public
376
- * @requiredField contactId
377
- * @requiredField info
378
- * @requiredField revision
379
- * @param options - Contact update options.
380
- * @permissionId CONTACTS.MODIFY
381
- * @permissionId CONTACTS.MODIFY_MEMBERSHIP_STATUS
382
- * @permissionId CONTACTS.MODIFY_MEMBER_PRIMARY_EMAIL_PERMISSION
383
- * @permissionScope Manage Contacts
384
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
385
- * @permissionScope Manage Members and Contacts - all permissions
386
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
387
- * @applicableIdentity APP
388
- * @returns Updated contact.
389
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UpdateContact
390
- */
391
- export async function updateContact(contactId, info, revision, options) {
392
- // @ts-ignore
393
- const { httpClient, sideEffects } = arguments[4];
394
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
395
- contactId: contactId,
396
- info: info,
397
- revision: revision,
398
- allowDuplicates: options?.allowDuplicates,
399
- }), [
400
- {
401
- transformFn: transformSDKAddressToRESTAddress,
402
- paths: [{ path: 'info.addresses.items.address' }],
403
- },
404
- {
405
- transformFn: transformSDKImageToRESTImage,
406
- paths: [{ path: 'info.picture.image' }],
407
- },
408
- ]);
409
- const reqOpts = ambassadorWixContactsV4Contact.updateContact(payload);
410
- sideEffects?.onSiteCall?.();
411
- try {
412
- const result = await httpClient.request(reqOpts);
413
- sideEffects?.onSuccess?.(result);
414
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
415
- {
416
- transformFn: transformRESTImageToSDKImage,
417
- paths: [
418
- { path: 'contact.picture' },
419
- { path: 'contact.info.picture.image' },
420
- { path: 'contact.memberInfo.profileInfo.photo' },
421
- ],
422
- },
423
- {
424
- transformFn: transformRESTAddressToSDKAddress,
425
- paths: [{ path: 'contact.info.addresses.items.address' }],
426
- },
427
- ]));
428
- }
429
- catch (err) {
430
- const transformedError = sdkTransformError(err, {
431
- spreadPathsToArguments: {},
432
- explicitPathsToArguments: {
433
- contactId: '$[0]',
434
- info: '$[1]',
435
- revision: '$[2]',
436
- allowDuplicates: '$[3].allowDuplicates',
437
- },
438
- singleArgumentUnchanged: false,
439
- }, ['contactId', 'info', 'revision', 'options']);
440
- sideEffects?.onError?.(err);
441
- throw transformedError;
442
- }
443
- }
444
- /**
445
- * Merges source contacts into a target contact.
446
- *
447
- * Merging contacts has the following effects on the target contact:
448
- *
449
- * - No target contact data is overwritten or deleted.
450
- * - Arrays (emails, phone numbers, addresses, and labels) from the source contacts are added to the target contact's arrays.
451
- * - If you merge more than one source contact, the 1st source contact specified is added first, then the 2nd, and so on.
452
- * - If there is duplicate information between the target contact and the source contact, the information isn't duplicated in the target contact's arrays.
453
- *
454
- * <blockquote class="important">
455
- *
456
- * __Important:__
457
- * Merges cannot be undone.
458
- * In REST, call Preview Merge Contacts to test before merging.
459
- *
460
- * </blockquote>
461
- *
462
- * When you merge contacts, source contacts are typically deleted.
463
- * However, if a source contact is a site member or a Wix user,
464
- * the merge will fail because site members and Wix users can't be deleted.
465
- * This means that site members and Wix users can only be specified as target contacts in a merge.
466
- *
467
- * After merging, calling Get Contact with a deleted source contact ID returns the target contact ID.
468
- * Specifying a deleted source contact ID is not supported on any other method.
469
- *
470
- * When contacts are merged:
471
- *
472
- * - The Contact Merged event is triggered.
473
- * - The Contact Updated event is triggered for the target contact. `originatedFrom` is set to `merge`.
474
- * - The Contact Deleted event is triggered for each source contact. `originatedFrom` is set to `merge`.
475
- * @param targetContactId - Target contact ID.
476
- * @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
477
- * To prevent conflicting changes,
478
- * the target contact's current `revision` must be specified.
479
- * @public
480
- * @requiredField targetContactId
481
- * @requiredField targetContactRevision
482
- * @param options - Merge contacts options.
483
- * @permissionId CONTACTS.MERGE
484
- * @permissionScope Manage Contacts
485
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
486
- * @permissionScope Manage Members and Contacts - all permissions
487
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
488
- * @applicableIdentity APP
489
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.MergeContacts
490
- */
491
- export async function mergeContacts(targetContactId, targetContactRevision, options) {
492
- // @ts-ignore
493
- const { httpClient, sideEffects } = arguments[3];
494
- const payload = renameKeysFromSDKRequestToRESTRequest({
495
- targetContactId: targetContactId,
496
- targetContactRevision: targetContactRevision,
497
- sourceContactIds: options?.sourceContactIds,
498
- });
499
- const reqOpts = ambassadorWixContactsV4Contact.mergeContacts(payload);
500
- sideEffects?.onSiteCall?.();
501
- try {
502
- const result = await httpClient.request(reqOpts);
503
- sideEffects?.onSuccess?.(result);
504
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
505
- {
506
- transformFn: transformRESTImageToSDKImage,
507
- paths: [
508
- { path: 'contact.picture' },
509
- { path: 'contact.info.picture.image' },
510
- { path: 'contact.memberInfo.profileInfo.photo' },
511
- ],
512
- },
513
- {
514
- transformFn: transformRESTAddressToSDKAddress,
515
- paths: [{ path: 'contact.info.addresses.items.address' }],
516
- },
517
- ]));
518
- }
519
- catch (err) {
520
- const transformedError = sdkTransformError(err, {
521
- spreadPathsToArguments: {},
522
- explicitPathsToArguments: {
523
- targetContactId: '$[0]',
524
- targetContactRevision: '$[1]',
525
- sourceContactIds: '$[2].sourceContactIds',
526
- },
527
- singleArgumentUnchanged: false,
528
- }, ['targetContactId', 'targetContactRevision', 'options']);
529
- sideEffects?.onError?.(err);
530
- throw transformedError;
531
- }
532
- }
533
- /**
534
- * Deletes a contact.
535
- *
536
- * Deleting a contact permanently removes it from the contact list.
537
- * If a contact is also a site member or Wix user, or has a valid billing subscription,
538
- * the contact can't be deleted. The related site member or Wix user must first be deleted
539
- * and any valid billing subscriptions must be canceled, before the contact can be deleted.
540
- *
541
- * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
542
- * Make sure to specify the contact ID when calling Delete Contact.
543
- * @param contactId - ID of the contact to delete.
544
- * @public
545
- * @requiredField contactId
546
- * @permissionId CONTACTS.MODIFY
547
- * @permissionId MEMBERS.MEMBER_DELETE
548
- * @permissionScope Manage Contacts
549
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
550
- * @permissionScope Manage Members and Contacts - all permissions
551
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
552
- * @permissionScope Manage Members
553
- * @permissionScopeId SCOPE.DC-MEMBERS.MANAGE-MEMBERS
554
- * @applicableIdentity APP
555
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.DeleteContact
556
- */
557
- export async function deleteContact(contactId) {
558
- // @ts-ignore
559
- const { httpClient, sideEffects } = arguments[1];
560
- const payload = renameKeysFromSDKRequestToRESTRequest({
561
- contactId: contactId,
562
- });
563
- const reqOpts = ambassadorWixContactsV4Contact.deleteContact(payload);
564
- sideEffects?.onSiteCall?.();
565
- try {
566
- const result = await httpClient.request(reqOpts);
567
- sideEffects?.onSuccess?.(result);
568
- }
569
- catch (err) {
570
- const transformedError = sdkTransformError(err, {
571
- spreadPathsToArguments: {},
572
- explicitPathsToArguments: { contactId: '$[0]' },
573
- singleArgumentUnchanged: false,
574
- }, ['contactId']);
575
- sideEffects?.onError?.(err);
576
- throw transformedError;
577
- }
578
- }
579
- /**
580
- * Adds labels to a contact.
581
- *
582
- * Use the Labels API to create or retrieve labels.
583
- *
584
- * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
585
- * Make sure to specify the contact ID when calling Label Contact.
586
- * @param contactId - ID of the contact to add labels to.
587
- * @param labelKeys - List of label keys to add to the contact.
588
- *
589
- * Label keys must exist to be added to the contact.
590
- * Use the Labels API to create or retrieve labels.
591
- * @public
592
- * @requiredField contactId
593
- * @requiredField labelKeys
594
- * @permissionId CONTACTS.MODIFY
595
- * @permissionScope Manage Contacts
596
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
597
- * @permissionScope Manage Members and Contacts - all permissions
598
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
599
- * @applicableIdentity APP
600
- * @returns Updated contact.
601
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.LabelContact
602
- */
603
- export async function labelContact(contactId, labelKeys) {
604
- // @ts-ignore
605
- const { httpClient, sideEffects } = arguments[2];
606
- const payload = renameKeysFromSDKRequestToRESTRequest({
607
- contactId: contactId,
608
- labelKeys: labelKeys,
609
- });
610
- const reqOpts = ambassadorWixContactsV4Contact.labelContact(payload);
611
- sideEffects?.onSiteCall?.();
612
- try {
613
- const result = await httpClient.request(reqOpts);
614
- sideEffects?.onSuccess?.(result);
615
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
616
- {
617
- transformFn: transformRESTImageToSDKImage,
618
- paths: [
619
- { path: 'contact.picture' },
620
- { path: 'contact.info.picture.image' },
621
- { path: 'contact.memberInfo.profileInfo.photo' },
622
- ],
623
- },
624
- {
625
- transformFn: transformRESTAddressToSDKAddress,
626
- paths: [{ path: 'contact.info.addresses.items.address' }],
627
- },
628
- ]));
629
- }
630
- catch (err) {
631
- const transformedError = sdkTransformError(err, {
632
- spreadPathsToArguments: {},
633
- explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
634
- singleArgumentUnchanged: false,
635
- }, ['contactId', 'labelKeys']);
636
- sideEffects?.onError?.(err);
637
- throw transformedError;
638
- }
639
- }
640
- /**
641
- * Removes labels from a contact.
642
- *
643
- * If a label is no longer needed
644
- * and you want to remove it from all contacts,
645
- * you can delete by calling Delete Label from the Labels API.
646
- *
647
- * Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
648
- * Make sure to specify the contact ID when calling Unlabel Contact.
649
- * @param contactId - ID of the contact to remove labels from.
650
- * @param labelKeys - List of label keys to remove from the contact.
651
- * @public
652
- * @requiredField contactId
653
- * @requiredField labelKeys
654
- * @permissionId CONTACTS.MODIFY
655
- * @permissionScope Manage Contacts
656
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
657
- * @permissionScope Manage Members and Contacts - all permissions
658
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
659
- * @applicableIdentity APP
660
- * @returns Updated contact.
661
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UnlabelContact
662
- */
663
- export async function unlabelContact(contactId, labelKeys) {
664
- // @ts-ignore
665
- const { httpClient, sideEffects } = arguments[2];
666
- const payload = renameKeysFromSDKRequestToRESTRequest({
667
- contactId: contactId,
668
- labelKeys: labelKeys,
669
- });
670
- const reqOpts = ambassadorWixContactsV4Contact.unlabelContact(payload);
671
- sideEffects?.onSiteCall?.();
672
- try {
673
- const result = await httpClient.request(reqOpts);
674
- sideEffects?.onSuccess?.(result);
675
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
676
- {
677
- transformFn: transformRESTImageToSDKImage,
678
- paths: [
679
- { path: 'contact.picture' },
680
- { path: 'contact.info.picture.image' },
681
- { path: 'contact.memberInfo.profileInfo.photo' },
682
- ],
683
- },
684
- {
685
- transformFn: transformRESTAddressToSDKAddress,
686
- paths: [{ path: 'contact.info.addresses.items.address' }],
687
- },
688
- ]));
689
- }
690
- catch (err) {
691
- const transformedError = sdkTransformError(err, {
692
- spreadPathsToArguments: {},
693
- explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
694
- singleArgumentUnchanged: false,
695
- }, ['contactId', 'labelKeys']);
696
- sideEffects?.onError?.(err);
697
- throw transformedError;
698
- }
699
- }
700
- /**
701
- * Creates a query to retrieve a list of contacts.
702
- *
703
- * The `queryContacts()` function builds a query to retrieve a list of contacts and returns a `ContactsQueryBuilder` object.
704
- *
705
- * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
706
- *
707
- * 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.
708
- *
709
- * `queryContacts()` runs with these `ContactsQueryBuilder` defaults, which you can override:
710
- *
711
- * - `skip(0)`
712
- * - `limit(50)`
713
- * - `descending("_createdDate")`
714
- *
715
- * 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.
716
- * @public
717
- * @param options - Query contact options.
718
- * @permissionScope Manage Events
719
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
720
- * @permissionScope Manage Challenges
721
- * @permissionScopeId SCOPE.CHALLENGES.MANAGE
722
- * @permissionScope Read Contacts
723
- * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
724
- * @permissionScope Read Members and Contacts - all read permissions
725
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
726
- * @permissionScope Manage Restaurants - all permissions
727
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
728
- * @permissionScope Manage Contacts
729
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
730
- * @permissionScope Set Up Automations
731
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
732
- * @permissionScope Manage Members and Contacts - all permissions
733
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
734
- * @permissionId CONTACTS.VIEW
735
- * @applicableIdentity APP
736
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.QueryContacts
737
- */
738
- export function queryContacts(options) {
739
- // @ts-ignore
740
- const { httpClient, sideEffects } = arguments[1];
741
- return queryBuilder({
742
- func: async (payload) => {
743
- const reqOpts = ambassadorWixContactsV4Contact.queryContacts({
744
- ...payload,
745
- ...(options ?? {}),
746
- });
747
- sideEffects?.onSiteCall?.();
748
- try {
749
- const result = await httpClient.request(reqOpts);
750
- sideEffects?.onSuccess?.(result);
751
- return result;
752
- }
753
- catch (err) {
754
- sideEffects?.onError?.(err);
755
- throw err;
756
- }
757
- },
758
- requestTransformer: (query) => {
759
- const args = [query, options];
760
- return renameKeysFromSDKRequestToRESTRequest({
761
- ...args?.[1],
762
- query: args?.[0],
763
- });
764
- },
765
- responseTransformer: ({ data }) => {
766
- const transformedData = renameKeysFromRESTResponseToSDKResponse(transformPaths(data, [
767
- {
768
- transformFn: transformRESTImageToSDKImage,
769
- paths: [
770
- { path: 'contacts.picture' },
771
- { path: 'contacts.info.picture.image' },
772
- { path: 'contacts.memberInfo.profileInfo.photo' },
773
- ],
774
- },
775
- {
776
- transformFn: transformRESTAddressToSDKAddress,
777
- paths: [{ path: 'contacts.info.addresses.items.address' }],
778
- },
779
- ]));
780
- return {
781
- items: transformedData?.contacts,
782
- pagingMetadata: transformedData?.pagingMetadata,
783
- };
784
- },
785
- errorTransformer: (err) => {
786
- const transformedError = sdkTransformError(err, {
787
- spreadPathsToArguments: {},
788
- explicitPathsToArguments: { query: '$[0]' },
789
- singleArgumentUnchanged: false,
790
- });
791
- throw transformedError;
792
- },
793
- pagingMethod: 'OFFSET',
794
- transformationPaths: {},
795
- });
796
- }
797
- /**
798
- * Retrieves a contact.
799
- *
800
- * #### Getting Merged Contacts
801
- *
802
- * When a source contact is merged
803
- * with a target contact, the source contact is deleted.
804
- * When calling Get Contact for a merged contact,
805
- * you can use the source or target contact ID.
806
- * In both bases, the target contact is returned.
807
- *
808
- * This is supported only when calling Get Contact on merged contacts.
809
- * Previously deleted source contact IDs can't be used for any other method.
810
- * @param _id - ID of the contact to retrieve.
811
- * @public
812
- * @requiredField _id
813
- * @param options - Get contact options.
814
- * @permissionId CONTACTS.VIEW
815
- * @permissionScope Manage Events
816
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
817
- * @permissionScope Manage Challenges
818
- * @permissionScopeId SCOPE.CHALLENGES.MANAGE
819
- * @permissionScope Read Contacts
820
- * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
821
- * @permissionScope Read Members and Contacts - all read permissions
822
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
823
- * @permissionScope Manage Restaurants - all permissions
824
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
825
- * @permissionScope Manage Contacts
826
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
827
- * @permissionScope Set Up Automations
828
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
829
- * @permissionScope Manage Members and Contacts - all permissions
830
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
831
- * @applicableIdentity APP
832
- * @returns The requested contact.
833
- * @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.GetContact
834
- */
835
- export async function getContact(_id, options) {
836
- // @ts-ignore
837
- const { httpClient, sideEffects } = arguments[2];
838
- const payload = renameKeysFromSDKRequestToRESTRequest({
839
- id: _id,
840
- fields: options?.fields,
841
- fieldsets: options?.fieldsets,
842
- });
843
- const reqOpts = ambassadorWixContactsV4Contact.getContact(payload);
844
- sideEffects?.onSiteCall?.();
845
- try {
846
- const result = await httpClient.request(reqOpts);
847
- sideEffects?.onSuccess?.(result);
848
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
849
- {
850
- transformFn: transformRESTImageToSDKImage,
851
- paths: [
852
- { path: 'contact.picture' },
853
- { path: 'contact.info.picture.image' },
854
- { path: 'contact.memberInfo.profileInfo.photo' },
855
- ],
856
- },
857
- {
858
- transformFn: transformRESTAddressToSDKAddress,
859
- paths: [{ path: 'contact.info.addresses.items.address' }],
860
- },
861
- ]))?.contact;
862
- }
863
- catch (err) {
864
- const transformedError = sdkTransformError(err, {
865
- spreadPathsToArguments: {},
866
- explicitPathsToArguments: {
867
- id: '$[0]',
868
- fields: '$[1].fields',
869
- fieldsets: '$[1].fieldsets',
870
- },
871
- singleArgumentUnchanged: false,
872
- }, ['_id', 'options']);
873
- sideEffects?.onError?.(err);
874
- throw transformedError;
875
- }
876
- }
877
- //# sourceMappingURL=contacts-v4-contact-contacts.universal.js.map