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