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