@wix/crm 1.0.80 → 1.0.82
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.
- package/build/cjs/context.d.ts +5 -0
- package/build/cjs/context.js +32 -0
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +7 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +7 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +7 -2
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.context.d.ts +9 -0
- package/build/cjs/src/contacts-v4-contact.context.js +82 -0
- package/build/cjs/src/contacts-v4-contact.context.js.map +1 -0
- package/build/cjs/src/contacts-v4-contact.http.d.ts +20 -94
- package/build/cjs/src/contacts-v4-contact.http.js +211 -249
- package/build/cjs/src/contacts-v4-contact.http.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.meta.d.ts +1 -1
- package/build/cjs/src/contacts-v4-contact.meta.js +5 -1
- package/build/cjs/src/contacts-v4-contact.meta.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.public.d.ts +7 -6
- package/build/cjs/src/contacts-v4-contact.public.js +10 -2
- package/build/cjs/src/contacts-v4-contact.public.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.types.d.ts +265 -5
- package/build/cjs/src/contacts-v4-contact.types.js +40 -19
- package/build/cjs/src/contacts-v4-contact.types.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.universal.d.ts +234 -155
- package/build/cjs/src/contacts-v4-contact.universal.js +145 -168
- package/build/cjs/src/contacts-v4-contact.universal.js.map +1 -1
- package/build/cjs/src/contacts-v4-extended-field.context.d.ts +7 -0
- package/build/cjs/src/contacts-v4-extended-field.context.js +60 -0
- package/build/cjs/src/contacts-v4-extended-field.context.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.http.d.ts +7 -14
- package/build/cjs/src/contacts-v4-extended-field.http.js +60 -70
- package/build/cjs/src/contacts-v4-extended-field.http.js.map +1 -1
- package/build/cjs/src/contacts-v4-extended-field.meta.d.ts +1 -1
- package/build/cjs/src/contacts-v4-extended-field.meta.js +5 -1
- package/build/cjs/src/contacts-v4-extended-field.meta.js.map +1 -1
- package/build/cjs/src/contacts-v4-extended-field.public.d.ts +2 -1
- package/build/cjs/src/contacts-v4-extended-field.public.js +5 -1
- package/build/cjs/src/contacts-v4-extended-field.public.js.map +1 -1
- package/build/cjs/src/contacts-v4-extended-field.types.d.ts +68 -1
- package/build/cjs/src/contacts-v4-extended-field.types.js +3 -3
- package/build/cjs/src/contacts-v4-extended-field.types.js.map +1 -1
- package/build/cjs/src/contacts-v4-extended-field.universal.d.ts +116 -30
- package/build/cjs/src/contacts-v4-extended-field.universal.js +62 -51
- package/build/cjs/src/contacts-v4-extended-field.universal.js.map +1 -1
- package/build/cjs/src/contacts-v4-label.context.d.ts +7 -0
- package/build/cjs/src/contacts-v4-label.context.js +60 -0
- package/build/cjs/src/contacts-v4-label.context.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.http.d.ts +13 -14
- package/build/cjs/src/contacts-v4-label.http.js +66 -72
- package/build/cjs/src/contacts-v4-label.http.js.map +1 -1
- package/build/cjs/src/contacts-v4-label.meta.d.ts +1 -1
- package/build/cjs/src/contacts-v4-label.meta.js +5 -1
- package/build/cjs/src/contacts-v4-label.meta.js.map +1 -1
- package/build/cjs/src/contacts-v4-label.public.d.ts +6 -5
- package/build/cjs/src/contacts-v4-label.public.js +5 -1
- package/build/cjs/src/contacts-v4-label.public.js.map +1 -1
- package/build/cjs/src/contacts-v4-label.types.d.ts +76 -9
- package/build/cjs/src/contacts-v4-label.types.js +2 -2
- package/build/cjs/src/contacts-v4-label.types.js.map +1 -1
- package/build/cjs/src/contacts-v4-label.universal.d.ts +125 -40
- package/build/cjs/src/contacts-v4-label.universal.js +76 -62
- package/build/cjs/src/contacts-v4-label.universal.js.map +1 -1
- package/build/cjs/src/contacts-v4-submit-contact.context.d.ts +3 -0
- package/build/cjs/src/contacts-v4-submit-contact.context.js +16 -0
- package/build/cjs/src/contacts-v4-submit-contact.context.js.map +1 -0
- package/build/cjs/src/contacts-v4-submit-contact.http.js +20 -34
- package/build/cjs/src/contacts-v4-submit-contact.http.js.map +1 -1
- package/build/cjs/src/contacts-v4-submit-contact.meta.d.ts +1 -1
- package/build/cjs/src/contacts-v4-submit-contact.meta.js +5 -1
- package/build/cjs/src/contacts-v4-submit-contact.meta.js.map +1 -1
- package/build/cjs/src/contacts-v4-submit-contact.public.d.ts +2 -2
- package/build/cjs/src/contacts-v4-submit-contact.types.d.ts +8 -3
- package/build/cjs/src/contacts-v4-submit-contact.types.js +9 -9
- package/build/cjs/src/contacts-v4-submit-contact.types.js.map +1 -1
- package/build/cjs/src/contacts-v4-submit-contact.universal.d.ts +8 -9
- package/build/cjs/src/contacts-v4-submit-contact.universal.js +25 -28
- package/build/cjs/src/contacts-v4-submit-contact.universal.js.map +1 -1
- package/build/cjs/src/crm-tasks-v2-task.context.d.ts +9 -0
- package/build/cjs/src/crm-tasks-v2-task.context.js +82 -0
- package/build/cjs/src/crm-tasks-v2-task.context.js.map +1 -0
- package/build/cjs/src/crm-tasks-v2-task.http.d.ts +60 -0
- package/build/cjs/src/crm-tasks-v2-task.http.js +268 -0
- package/build/cjs/src/crm-tasks-v2-task.http.js.map +1 -0
- package/build/cjs/src/crm-tasks-v2-task.meta.d.ts +27 -0
- package/build/cjs/src/crm-tasks-v2-task.meta.js +161 -0
- package/build/cjs/src/crm-tasks-v2-task.meta.js.map +1 -0
- package/build/cjs/src/crm-tasks-v2-task.public.d.ts +30 -0
- package/build/cjs/src/crm-tasks-v2-task.public.js +58 -0
- package/build/cjs/src/crm-tasks-v2-task.public.js.map +1 -0
- package/build/cjs/src/crm-tasks-v2-task.types.d.ts +430 -0
- package/build/cjs/src/crm-tasks-v2-task.types.js +29 -0
- package/build/cjs/src/crm-tasks-v2-task.types.js.map +1 -0
- package/build/cjs/src/crm-tasks-v2-task.universal.d.ts +678 -0
- package/build/cjs/src/crm-tasks-v2-task.universal.js +520 -0
- package/build/cjs/src/crm-tasks-v2-task.universal.js.map +1 -0
- package/build/cjs/src/ping-notifications-v3-notification.public.d.ts +1 -1
- package/build/cjs/src/ping-notifications-v3-notification.types.js +1 -1
- package/build/cjs/src/ping-notifications-v3-notification.types.js.map +1 -1
- package/build/cjs/src/ping-notifications-v3-notification.universal.js +6 -2
- package/build/cjs/src/ping-notifications-v3-notification.universal.js.map +1 -1
- package/build/es/context.d.ts +5 -0
- package/build/es/context.js +6 -0
- package/build/es/context.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +1 -0
- package/build/es/index.js.map +1 -1
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +1 -0
- package/build/es/index.typings.js.map +1 -1
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +1 -0
- package/build/es/meta.js.map +1 -1
- package/build/es/src/contacts-v4-contact.context.d.ts +9 -0
- package/build/es/src/contacts-v4-contact.context.js +72 -0
- package/build/es/src/contacts-v4-contact.context.js.map +1 -0
- package/build/es/src/contacts-v4-contact.http.d.ts +20 -94
- package/build/es/src/contacts-v4-contact.http.js +211 -249
- package/build/es/src/contacts-v4-contact.http.js.map +1 -1
- package/build/es/src/contacts-v4-contact.meta.d.ts +1 -1
- package/build/es/src/contacts-v4-contact.public.d.ts +7 -6
- package/build/es/src/contacts-v4-contact.public.js +3 -2
- package/build/es/src/contacts-v4-contact.public.js.map +1 -1
- package/build/es/src/contacts-v4-contact.types.d.ts +265 -5
- package/build/es/src/contacts-v4-contact.types.js +21 -0
- package/build/es/src/contacts-v4-contact.types.js.map +1 -1
- package/build/es/src/contacts-v4-contact.universal.d.ts +234 -155
- package/build/es/src/contacts-v4-contact.universal.js +122 -149
- package/build/es/src/contacts-v4-contact.universal.js.map +1 -1
- package/build/es/src/contacts-v4-extended-field.context.d.ts +7 -0
- package/build/es/src/contacts-v4-extended-field.context.js +52 -0
- package/build/es/src/contacts-v4-extended-field.context.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.http.d.ts +7 -14
- package/build/es/src/contacts-v4-extended-field.http.js +60 -70
- package/build/es/src/contacts-v4-extended-field.http.js.map +1 -1
- package/build/es/src/contacts-v4-extended-field.meta.d.ts +1 -1
- package/build/es/src/contacts-v4-extended-field.public.d.ts +2 -1
- package/build/es/src/contacts-v4-extended-field.public.js +1 -0
- package/build/es/src/contacts-v4-extended-field.public.js.map +1 -1
- package/build/es/src/contacts-v4-extended-field.types.d.ts +68 -1
- package/build/es/src/contacts-v4-extended-field.universal.d.ts +116 -30
- package/build/es/src/contacts-v4-extended-field.universal.js +53 -46
- package/build/es/src/contacts-v4-extended-field.universal.js.map +1 -1
- package/build/es/src/contacts-v4-label.context.d.ts +7 -0
- package/build/es/src/contacts-v4-label.context.js +52 -0
- package/build/es/src/contacts-v4-label.context.js.map +1 -0
- package/build/es/src/contacts-v4-label.http.d.ts +13 -14
- package/build/es/src/contacts-v4-label.http.js +66 -72
- package/build/es/src/contacts-v4-label.http.js.map +1 -1
- package/build/es/src/contacts-v4-label.meta.d.ts +1 -1
- package/build/es/src/contacts-v4-label.public.d.ts +6 -5
- package/build/es/src/contacts-v4-label.public.js +1 -0
- package/build/es/src/contacts-v4-label.public.js.map +1 -1
- package/build/es/src/contacts-v4-label.types.d.ts +76 -9
- package/build/es/src/contacts-v4-label.universal.d.ts +125 -40
- package/build/es/src/contacts-v4-label.universal.js +68 -58
- package/build/es/src/contacts-v4-label.universal.js.map +1 -1
- package/build/es/src/contacts-v4-submit-contact.context.d.ts +3 -0
- package/build/es/src/contacts-v4-submit-contact.context.js +12 -0
- package/build/es/src/contacts-v4-submit-contact.context.js.map +1 -0
- package/build/es/src/contacts-v4-submit-contact.http.js +20 -34
- package/build/es/src/contacts-v4-submit-contact.http.js.map +1 -1
- package/build/es/src/contacts-v4-submit-contact.meta.d.ts +1 -1
- package/build/es/src/contacts-v4-submit-contact.public.d.ts +2 -2
- package/build/es/src/contacts-v4-submit-contact.types.d.ts +8 -3
- package/build/es/src/contacts-v4-submit-contact.types.js.map +1 -1
- package/build/es/src/contacts-v4-submit-contact.universal.d.ts +8 -9
- package/build/es/src/contacts-v4-submit-contact.universal.js +11 -18
- package/build/es/src/contacts-v4-submit-contact.universal.js.map +1 -1
- package/build/es/src/crm-tasks-v2-task.context.d.ts +9 -0
- package/build/es/src/crm-tasks-v2-task.context.js +72 -0
- package/build/es/src/crm-tasks-v2-task.context.js.map +1 -0
- package/build/es/src/crm-tasks-v2-task.http.d.ts +60 -0
- package/build/es/src/crm-tasks-v2-task.http.js +258 -0
- package/build/es/src/crm-tasks-v2-task.http.js.map +1 -0
- package/build/es/src/crm-tasks-v2-task.meta.d.ts +27 -0
- package/build/es/src/crm-tasks-v2-task.meta.js +128 -0
- package/build/es/src/crm-tasks-v2-task.meta.js.map +1 -0
- package/build/es/src/crm-tasks-v2-task.public.d.ts +30 -0
- package/build/es/src/crm-tasks-v2-task.public.js +40 -0
- package/build/es/src/crm-tasks-v2-task.public.js.map +1 -0
- package/build/es/src/crm-tasks-v2-task.types.d.ts +430 -0
- package/build/es/src/crm-tasks-v2-task.types.js +26 -0
- package/build/es/src/crm-tasks-v2-task.types.js.map +1 -0
- package/build/es/src/crm-tasks-v2-task.universal.d.ts +678 -0
- package/build/es/src/crm-tasks-v2-task.universal.js +487 -0
- package/build/es/src/crm-tasks-v2-task.universal.js.map +1 -0
- package/build/es/src/ping-notifications-v3-notification.public.d.ts +1 -1
- package/build/es/src/ping-notifications-v3-notification.universal.js.map +1 -1
- package/context/package.json +6 -0
- package/package.json +12 -6
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -28,23 +32,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
28
32
|
});
|
|
29
33
|
};
|
|
30
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.getContact = exports.unlabelContact = exports.labelContact = exports.deleteContact = exports.mergeContacts = exports.updateContact = exports.createContact = exports.Mode = exports.SubmitOperation = exports.GetContactResponseType = exports.UpsertContactResponseAction = exports.Action = exports.ContactsFacetType = exports.ContactFieldSet = exports.SortOrder = exports.PhoneDeliverabilityStatus = exports.EmailDeliverabilityStatus = exports.SubscriptionStatus = exports.ImageProvider = exports.SubdivisionType = exports.AddressTag = exports.PhoneTag = exports.EmailTag = exports.ContactActivityType = exports.ContactSourceType =
|
|
35
|
+
exports.getContact = exports.unlabelContact = exports.labelContact = exports.deleteContact = exports.mergeContacts = exports.updateContact = exports.createContact = exports.onContactDeleted = exports.onContactMerged = exports.onContactUpdated = exports.onContactCreated = exports.Mode = exports.SubmitOperation = exports.GetContactResponseType = exports.UpsertContactResponseAction = exports.Action = exports.ContactsFacetType = exports.ContactFieldSet = exports.SortOrder = exports.Role = exports.PrivacyStatus = exports.IdentityStatus = exports.PhoneDeliverabilityStatus = exports.EmailDeliverabilityStatus = exports.SubscriptionStatus = exports.ImageProvider = exports.SubdivisionType = exports.AddressTag = exports.PhoneTag = exports.EmailTag = exports.ContactActivityType = exports.ContactSourceType = void 0;
|
|
32
36
|
const velo_1 = require("@wix/metro-runtime/velo");
|
|
37
|
+
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
38
|
+
const sdk_types_1 = require("@wix/sdk-types");
|
|
33
39
|
const ambassadorWixContactsV4Contact = __importStar(require("./contacts-v4-contact.http"));
|
|
34
40
|
// @ts-ignore
|
|
35
|
-
let __verbose = false;
|
|
36
|
-
function __log(...args) {
|
|
37
|
-
__verbose && console.log(...args);
|
|
38
|
-
}
|
|
39
|
-
function __inspect(obj) {
|
|
40
|
-
return obj;
|
|
41
|
-
}
|
|
42
|
-
exports.__debug = {
|
|
43
|
-
verboseLogging: {
|
|
44
|
-
on: () => (__verbose = true),
|
|
45
|
-
off: () => (__verbose = false),
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
41
|
const _toVeloEntity = '$';
|
|
49
42
|
const _fromVeloEntity = '$';
|
|
50
43
|
var ContactSourceType;
|
|
@@ -68,7 +61,7 @@ var ContactSourceType;
|
|
|
68
61
|
ContactSourceType["WIX_STORES"] = "WIX_STORES";
|
|
69
62
|
ContactSourceType["WIX_CODE"] = "WIX_CODE";
|
|
70
63
|
ContactSourceType["HOPP"] = "HOPP";
|
|
71
|
-
})(ContactSourceType
|
|
64
|
+
})(ContactSourceType || (exports.ContactSourceType = ContactSourceType = {}));
|
|
72
65
|
var ContactActivityType;
|
|
73
66
|
(function (ContactActivityType) {
|
|
74
67
|
/** Last visit to your site (any unknown activity) */
|
|
@@ -152,14 +145,14 @@ var ContactActivityType;
|
|
|
152
145
|
ContactActivityType["PHONE_SUBSCRIPTION_NOT_SET"] = "PHONE_SUBSCRIPTION_NOT_SET";
|
|
153
146
|
/** "contact/phone-subscription-unsubscribe" */
|
|
154
147
|
ContactActivityType["PHONE_SUBSCRIPTION_UNSUBSCRIBE"] = "PHONE_SUBSCRIPTION_UNSUBSCRIBE";
|
|
155
|
-
})(ContactActivityType
|
|
148
|
+
})(ContactActivityType || (exports.ContactActivityType = ContactActivityType = {}));
|
|
156
149
|
var EmailTag;
|
|
157
150
|
(function (EmailTag) {
|
|
158
151
|
EmailTag["UNTAGGED"] = "UNTAGGED";
|
|
159
152
|
EmailTag["MAIN"] = "MAIN";
|
|
160
153
|
EmailTag["HOME"] = "HOME";
|
|
161
154
|
EmailTag["WORK"] = "WORK";
|
|
162
|
-
})(EmailTag
|
|
155
|
+
})(EmailTag || (exports.EmailTag = EmailTag = {}));
|
|
163
156
|
var PhoneTag;
|
|
164
157
|
(function (PhoneTag) {
|
|
165
158
|
PhoneTag["UNTAGGED"] = "UNTAGGED";
|
|
@@ -168,7 +161,7 @@ var PhoneTag;
|
|
|
168
161
|
PhoneTag["MOBILE"] = "MOBILE";
|
|
169
162
|
PhoneTag["WORK"] = "WORK";
|
|
170
163
|
PhoneTag["FAX"] = "FAX";
|
|
171
|
-
})(PhoneTag
|
|
164
|
+
})(PhoneTag || (exports.PhoneTag = PhoneTag = {}));
|
|
172
165
|
var AddressTag;
|
|
173
166
|
(function (AddressTag) {
|
|
174
167
|
AddressTag["UNTAGGED"] = "UNTAGGED";
|
|
@@ -176,7 +169,7 @@ var AddressTag;
|
|
|
176
169
|
AddressTag["WORK"] = "WORK";
|
|
177
170
|
AddressTag["BILLING"] = "BILLING";
|
|
178
171
|
AddressTag["SHIPPING"] = "SHIPPING";
|
|
179
|
-
})(AddressTag
|
|
172
|
+
})(AddressTag || (exports.AddressTag = AddressTag = {}));
|
|
180
173
|
var SubdivisionType;
|
|
181
174
|
(function (SubdivisionType) {
|
|
182
175
|
SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
@@ -192,7 +185,7 @@ var SubdivisionType;
|
|
|
192
185
|
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
|
|
193
186
|
/** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
194
187
|
SubdivisionType["COUNTRY"] = "COUNTRY";
|
|
195
|
-
})(SubdivisionType
|
|
188
|
+
})(SubdivisionType || (exports.SubdivisionType = SubdivisionType = {}));
|
|
196
189
|
var ImageProvider;
|
|
197
190
|
(function (ImageProvider) {
|
|
198
191
|
ImageProvider["UNKNOWN"] = "UNKNOWN";
|
|
@@ -200,7 +193,7 @@ var ImageProvider;
|
|
|
200
193
|
ImageProvider["EXTERNAL"] = "EXTERNAL";
|
|
201
194
|
/** Stored in wix media platform, Must be uploaded by using `GeneratePictureUploadUrl` */
|
|
202
195
|
ImageProvider["WIX_MEDIA"] = "WIX_MEDIA";
|
|
203
|
-
})(ImageProvider
|
|
196
|
+
})(ImageProvider || (exports.ImageProvider = ImageProvider = {}));
|
|
204
197
|
var SubscriptionStatus;
|
|
205
198
|
(function (SubscriptionStatus) {
|
|
206
199
|
SubscriptionStatus["NO_SUBSCRIPTION_STATUS"] = "NO_SUBSCRIPTION_STATUS";
|
|
@@ -208,7 +201,7 @@ var SubscriptionStatus;
|
|
|
208
201
|
SubscriptionStatus["PENDING"] = "PENDING";
|
|
209
202
|
SubscriptionStatus["SUBSCRIBED"] = "SUBSCRIBED";
|
|
210
203
|
SubscriptionStatus["UNSUBSCRIBED"] = "UNSUBSCRIBED";
|
|
211
|
-
})(SubscriptionStatus
|
|
204
|
+
})(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
|
|
212
205
|
var EmailDeliverabilityStatus;
|
|
213
206
|
(function (EmailDeliverabilityStatus) {
|
|
214
207
|
EmailDeliverabilityStatus["UNKNOWN_EMAIL_DELIVERABILITY_STATUS"] = "UNKNOWN_EMAIL_DELIVERABILITY_STATUS";
|
|
@@ -217,17 +210,38 @@ var EmailDeliverabilityStatus;
|
|
|
217
210
|
EmailDeliverabilityStatus["BOUNCED"] = "BOUNCED";
|
|
218
211
|
EmailDeliverabilityStatus["SPAM_COMPLAINT"] = "SPAM_COMPLAINT";
|
|
219
212
|
EmailDeliverabilityStatus["INACTIVE"] = "INACTIVE";
|
|
220
|
-
})(EmailDeliverabilityStatus
|
|
213
|
+
})(EmailDeliverabilityStatus || (exports.EmailDeliverabilityStatus = EmailDeliverabilityStatus = {}));
|
|
221
214
|
var PhoneDeliverabilityStatus;
|
|
222
215
|
(function (PhoneDeliverabilityStatus) {
|
|
223
216
|
PhoneDeliverabilityStatus["NO_PHONE_DELIVERABILITY_STATUS"] = "NO_PHONE_DELIVERABILITY_STATUS";
|
|
224
217
|
PhoneDeliverabilityStatus["NOT_SET"] = "NOT_SET";
|
|
225
|
-
})(PhoneDeliverabilityStatus
|
|
218
|
+
})(PhoneDeliverabilityStatus || (exports.PhoneDeliverabilityStatus = PhoneDeliverabilityStatus = {}));
|
|
219
|
+
var IdentityStatus;
|
|
220
|
+
(function (IdentityStatus) {
|
|
221
|
+
IdentityStatus["UNKNOWN_IDENTITY_STATUS"] = "UNKNOWN_IDENTITY_STATUS";
|
|
222
|
+
IdentityStatus["PENDING_ADMIN_APPROVAL"] = "PENDING_ADMIN_APPROVAL";
|
|
223
|
+
IdentityStatus["ACTIVE"] = "ACTIVE";
|
|
224
|
+
IdentityStatus["DELETED"] = "DELETED";
|
|
225
|
+
IdentityStatus["BLOCKED"] = "BLOCKED";
|
|
226
|
+
IdentityStatus["OFFLINE"] = "OFFLINE";
|
|
227
|
+
})(IdentityStatus || (exports.IdentityStatus = IdentityStatus = {}));
|
|
228
|
+
var PrivacyStatus;
|
|
229
|
+
(function (PrivacyStatus) {
|
|
230
|
+
PrivacyStatus["UNKNOWN_PRIVACY_STATUS"] = "UNKNOWN_PRIVACY_STATUS";
|
|
231
|
+
PrivacyStatus["PRIVATE"] = "PRIVATE";
|
|
232
|
+
PrivacyStatus["PUBLIC"] = "PUBLIC";
|
|
233
|
+
})(PrivacyStatus || (exports.PrivacyStatus = PrivacyStatus = {}));
|
|
234
|
+
var Role;
|
|
235
|
+
(function (Role) {
|
|
236
|
+
Role["UNSPECIFIED_ROLE"] = "UNSPECIFIED_ROLE";
|
|
237
|
+
Role["OWNER"] = "OWNER";
|
|
238
|
+
Role["CONTRIBUTOR"] = "CONTRIBUTOR";
|
|
239
|
+
})(Role || (exports.Role = Role = {}));
|
|
226
240
|
var SortOrder;
|
|
227
241
|
(function (SortOrder) {
|
|
228
242
|
SortOrder["ASC"] = "ASC";
|
|
229
243
|
SortOrder["DESC"] = "DESC";
|
|
230
|
-
})(SortOrder
|
|
244
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
231
245
|
var ContactFieldSet;
|
|
232
246
|
(function (ContactFieldSet) {
|
|
233
247
|
/** name, primaryEmail, primaryPhone */
|
|
@@ -238,7 +252,7 @@ var ContactFieldSet;
|
|
|
238
252
|
ContactFieldSet["EXTENDED"] = "EXTENDED";
|
|
239
253
|
/** Full contact object */
|
|
240
254
|
ContactFieldSet["FULL"] = "FULL";
|
|
241
|
-
})(ContactFieldSet
|
|
255
|
+
})(ContactFieldSet || (exports.ContactFieldSet = ContactFieldSet = {}));
|
|
242
256
|
var ContactsFacetType;
|
|
243
257
|
(function (ContactsFacetType) {
|
|
244
258
|
ContactsFacetType["UNKNOWN"] = "UNKNOWN";
|
|
@@ -247,19 +261,19 @@ var ContactsFacetType;
|
|
|
247
261
|
ContactsFacetType["LABEL"] = "LABEL";
|
|
248
262
|
ContactsFacetType["SUBSCRIPTION_STATUS"] = "SUBSCRIPTION_STATUS";
|
|
249
263
|
ContactsFacetType["MEMBERSHIP_STATUS"] = "MEMBERSHIP_STATUS";
|
|
250
|
-
})(ContactsFacetType
|
|
264
|
+
})(ContactsFacetType || (exports.ContactsFacetType = ContactsFacetType = {}));
|
|
251
265
|
var Action;
|
|
252
266
|
(function (Action) {
|
|
253
267
|
Action["UNKNOWN"] = "UNKNOWN";
|
|
254
268
|
Action["UPDATED"] = "UPDATED";
|
|
255
269
|
Action["CREATED"] = "CREATED";
|
|
256
|
-
})(Action
|
|
270
|
+
})(Action || (exports.Action = Action = {}));
|
|
257
271
|
var UpsertContactResponseAction;
|
|
258
272
|
(function (UpsertContactResponseAction) {
|
|
259
273
|
UpsertContactResponseAction["UNKNOWN"] = "UNKNOWN";
|
|
260
274
|
UpsertContactResponseAction["UPDATED"] = "UPDATED";
|
|
261
275
|
UpsertContactResponseAction["CREATED"] = "CREATED";
|
|
262
|
-
})(UpsertContactResponseAction
|
|
276
|
+
})(UpsertContactResponseAction || (exports.UpsertContactResponseAction = UpsertContactResponseAction = {}));
|
|
263
277
|
var GetContactResponseType;
|
|
264
278
|
(function (GetContactResponseType) {
|
|
265
279
|
/** Normal contact */
|
|
@@ -268,20 +282,20 @@ var GetContactResponseType;
|
|
|
268
282
|
GetContactResponseType["IMPLICIT"] = "IMPLICIT";
|
|
269
283
|
/** Contact was merged into another contact */
|
|
270
284
|
GetContactResponseType["MERGED"] = "MERGED";
|
|
271
|
-
})(GetContactResponseType
|
|
285
|
+
})(GetContactResponseType || (exports.GetContactResponseType = GetContactResponseType = {}));
|
|
272
286
|
var SubmitOperation;
|
|
273
287
|
(function (SubmitOperation) {
|
|
274
288
|
SubmitOperation["UNKNOWN"] = "UNKNOWN";
|
|
275
289
|
SubmitOperation["CREATE"] = "CREATE";
|
|
276
290
|
SubmitOperation["UPDATE"] = "UPDATE";
|
|
277
|
-
})(SubmitOperation
|
|
291
|
+
})(SubmitOperation || (exports.SubmitOperation = SubmitOperation = {}));
|
|
278
292
|
var Mode;
|
|
279
293
|
(function (Mode) {
|
|
280
294
|
/** any */
|
|
281
295
|
Mode["OR"] = "OR";
|
|
282
296
|
/** all */
|
|
283
297
|
Mode["AND"] = "AND";
|
|
284
|
-
})(Mode
|
|
298
|
+
})(Mode || (exports.Mode = Mode = {}));
|
|
285
299
|
const _contact = { picture: 'wix.common.Image', info: '_contactInfo' };
|
|
286
300
|
const _contactAddress = { address: 'wix.common.Address' };
|
|
287
301
|
const _contactAddressesWrapper = { items: '_contactAddress' };
|
|
@@ -304,6 +318,10 @@ const _unlabelContactRequest = {};
|
|
|
304
318
|
const _unlabelContactResponse = { contact: '_contact' };
|
|
305
319
|
const _updateContactRequest = { info: '_contactInfo' };
|
|
306
320
|
const _updateContactResponse = { contact: '_contact' };
|
|
321
|
+
exports.onContactCreated = (0, sdk_types_1.EventDefinition)('wix.contacts.v4.contact_created')();
|
|
322
|
+
exports.onContactUpdated = (0, sdk_types_1.EventDefinition)('wix.contacts.v4.contact_updated')();
|
|
323
|
+
exports.onContactMerged = (0, sdk_types_1.EventDefinition)('wix.contacts.v4.contact_merged')();
|
|
324
|
+
exports.onContactDeleted = (0, sdk_types_1.EventDefinition)('wix.contacts.v4.contact_deleted')();
|
|
307
325
|
/**
|
|
308
326
|
* Creates a new contact.
|
|
309
327
|
*
|
|
@@ -315,25 +333,17 @@ const _updateContactResponse = { contact: '_contact' };
|
|
|
315
333
|
* If all 3 of these parameters are missing,
|
|
316
334
|
* the contact won't be created.
|
|
317
335
|
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
* > Only visitors with
|
|
321
|
-
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
322
|
-
* > can create contacts.
|
|
323
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
324
|
-
* -->
|
|
325
|
-
* By default,
|
|
326
|
-
* if the call contains an email already in use by another contact,
|
|
327
|
-
* the new contact won't be created.
|
|
328
|
-
* To override this behavior,
|
|
329
|
-
* set `allowDuplicates` in the `options` object to `true`.
|
|
336
|
+
* By default, if the call contains an email already in use by another contact, the new contact won't be created. To override this behavior, set `allowDuplicates` in the `options` object to `true`.
|
|
337
|
+
*
|
|
330
338
|
* @param info - Contact info.
|
|
331
339
|
* @public
|
|
332
340
|
* @documentationMaturity preview
|
|
333
341
|
* @requiredField info
|
|
334
342
|
* @param options - Create contact options.
|
|
335
343
|
* @permissionScope Manage Contacts
|
|
344
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
336
345
|
* @permissionScope Manage Members and Contacts - all permissions
|
|
346
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
337
347
|
* @applicableIdentity APP
|
|
338
348
|
* @returns Contact.
|
|
339
349
|
*/
|
|
@@ -378,7 +388,6 @@ function createContact(info, options) {
|
|
|
378
388
|
});
|
|
379
389
|
const payload = toAmbassadorRequest([info, options]);
|
|
380
390
|
const reqOpts = ambassadorWixContactsV4Contact.createContact(payload);
|
|
381
|
-
__log(`"CreateContact" sending request with: ${__inspect(reqOpts)}`);
|
|
382
391
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
383
392
|
try {
|
|
384
393
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -386,10 +395,14 @@ function createContact(info, options) {
|
|
|
386
395
|
return fromJSON(result.data);
|
|
387
396
|
}
|
|
388
397
|
catch (err) {
|
|
389
|
-
const transformedError = (0,
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
398
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
399
|
+
spreadPathsToArguments: {},
|
|
400
|
+
explicitPathsToArguments: {
|
|
401
|
+
info: '$[0]',
|
|
402
|
+
allowDuplicates: '$[1].allowDuplicates',
|
|
403
|
+
},
|
|
404
|
+
singleArgumentUnchanged: false,
|
|
405
|
+
}, ['info', 'options']);
|
|
393
406
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
394
407
|
throw transformedError;
|
|
395
408
|
}
|
|
@@ -402,44 +415,38 @@ exports.createContact = createContact;
|
|
|
402
415
|
* The `updateContact()` function returns a Promise that resolves
|
|
403
416
|
* when the specified contact's information is updated.
|
|
404
417
|
*
|
|
405
|
-
*
|
|
406
|
-
* `revision` increments by 1.
|
|
407
|
-
* The existing `revision` must be included when updating the contact.
|
|
408
|
-
* This ensures you're working with the latest contact information,
|
|
409
|
-
* and it prevents unintended overwrites.
|
|
418
|
+
* Each time the contact is updated, `revision` increments by 1. The existing `revision` must be included when updating the contact. This ensures you're working with the latest contact information, and prevents unintended overwrites.
|
|
410
419
|
*
|
|
411
|
-
* <!--
|
|
412
|
-
* > **Note:**
|
|
413
|
-
* > Only visitors with
|
|
414
|
-
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
415
|
-
* > can update contacts.
|
|
416
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
417
|
-
* -->
|
|
418
420
|
* @param contactId - ID of the contact to update.
|
|
419
421
|
* @param info - Contact info.
|
|
422
|
+
* @param revision - Revision number.
|
|
423
|
+
* When updating, include the existing `revision`
|
|
424
|
+
* to prevent conflicting updates.
|
|
420
425
|
* @public
|
|
421
426
|
* @documentationMaturity preview
|
|
422
427
|
* @requiredField contactId
|
|
423
428
|
* @requiredField info
|
|
424
|
-
* @requiredField
|
|
429
|
+
* @requiredField revision
|
|
425
430
|
* @param options - Contact update options.
|
|
426
431
|
* @permissionScope Manage Contacts
|
|
432
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
427
433
|
* @permissionScope Manage Members and Contacts - all permissions
|
|
434
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
428
435
|
* @applicableIdentity APP
|
|
429
436
|
* @returns Updated contact.
|
|
430
437
|
*/
|
|
431
|
-
function updateContact(contactId, info, options) {
|
|
438
|
+
function updateContact(contactId, info, revision, options) {
|
|
432
439
|
var _a, _b, _c;
|
|
433
440
|
return __awaiter(this, arguments, void 0, function* () {
|
|
434
441
|
const requestTransformation = {
|
|
435
442
|
contactId: '$[0]',
|
|
436
443
|
info: '$[1]',
|
|
437
|
-
revision: '$[2]
|
|
438
|
-
allowDuplicates: '$[
|
|
444
|
+
revision: '$[2]',
|
|
445
|
+
allowDuplicates: '$[3].allowDuplicates',
|
|
439
446
|
};
|
|
440
447
|
const responseTransformation = '$';
|
|
441
448
|
// @ts-ignore
|
|
442
|
-
const { httpClient, sideEffects } = arguments[
|
|
449
|
+
const { httpClient, sideEffects } = arguments[4];
|
|
443
450
|
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
444
451
|
rootSchema: _updateContactRequest,
|
|
445
452
|
depSchemas: {
|
|
@@ -469,9 +476,8 @@ function updateContact(contactId, info, options) {
|
|
|
469
476
|
},
|
|
470
477
|
customTransformation: responseTransformation,
|
|
471
478
|
});
|
|
472
|
-
const payload = toAmbassadorRequest([contactId, info, options]);
|
|
479
|
+
const payload = toAmbassadorRequest([contactId, info, revision, options]);
|
|
473
480
|
const reqOpts = ambassadorWixContactsV4Contact.updateContact(payload);
|
|
474
|
-
__log(`"UpdateContact" sending request with: ${__inspect(reqOpts)}`);
|
|
475
481
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
476
482
|
try {
|
|
477
483
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -479,11 +485,16 @@ function updateContact(contactId, info, options) {
|
|
|
479
485
|
return fromJSON(result.data);
|
|
480
486
|
}
|
|
481
487
|
catch (err) {
|
|
482
|
-
const transformedError = (0,
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
488
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
489
|
+
spreadPathsToArguments: {},
|
|
490
|
+
explicitPathsToArguments: {
|
|
491
|
+
contactId: '$[0]',
|
|
492
|
+
info: '$[1]',
|
|
493
|
+
revision: '$[2]',
|
|
494
|
+
allowDuplicates: '$[3].allowDuplicates',
|
|
495
|
+
},
|
|
496
|
+
singleArgumentUnchanged: false,
|
|
497
|
+
}, ['contactId', 'info', 'revision', 'options']);
|
|
487
498
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
488
499
|
throw transformedError;
|
|
489
500
|
}
|
|
@@ -496,36 +507,16 @@ exports.updateContact = updateContact;
|
|
|
496
507
|
* Merging contacts has these effects on the target contact:
|
|
497
508
|
*
|
|
498
509
|
* - No target contact data is overwritten or deleted.
|
|
499
|
-
* - Arrays (emails, phones, addresses, and labels) are merged from the source contacts.
|
|
510
|
+
* - Arrays (emails, phones, addresses, and labels) are merged from the source contacts into the target contact.
|
|
500
511
|
* - If merging more than one source contact, the 1st source is given precedence, then the 2nd, and so on.
|
|
501
512
|
*
|
|
502
|
-
* <blockquote class="important">
|
|
503
|
-
*
|
|
504
|
-
* __Important:__
|
|
505
|
-
* Merges cannot be undone.
|
|
506
|
-
* Use [Preview Merge Contacts](#preview-merge-contacts)
|
|
507
|
-
* to test before merging.
|
|
508
|
-
*
|
|
509
|
-
* </blockquote>
|
|
510
|
-
*
|
|
511
513
|
* Source contacts are deleted when merging.
|
|
512
|
-
* However, if a source contact is a site member or
|
|
513
|
-
* the
|
|
514
|
-
* Site members and
|
|
515
|
-
*
|
|
516
|
-
* After merging,
|
|
517
|
-
* if you call [Get Contact](#get-contact) with a deleted source contact ID,
|
|
518
|
-
* the target contact ID is returned.
|
|
519
|
-
* This is supported when calling Get Contact only.
|
|
520
|
-
* Deleted source contact IDs are not supported on any other endpoint.
|
|
514
|
+
* However, if a source contact is a site member or collaborator,
|
|
515
|
+
* the `mergeContacts()` function fails because site collaborators and members can't be deleted.
|
|
516
|
+
* Site members and collaborators can only be target contacts.
|
|
521
517
|
*
|
|
522
|
-
*
|
|
518
|
+
* After merging, if you call the `getContact()` function with a deleted source contact ID, the target contact ID is returned. This is only supported when calling `getContact()`. Previously deleted source contact IDs can't be passed in any other function.
|
|
523
519
|
*
|
|
524
|
-
* - Contact Merged is triggered.
|
|
525
|
-
* - Contact Updated is triggered for the target contact. `originatedFrom` is set to `merge`.
|
|
526
|
-
* - Contact Deleted is triggered for each source contact. `originatedFrom` is set to `merge`.
|
|
527
|
-
*
|
|
528
|
-
* This function is not a universal function and runs only on the backend.
|
|
529
520
|
* @param targetContactId - Target contact ID.
|
|
530
521
|
* @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
|
|
531
522
|
* To prevent conflicting changes,
|
|
@@ -536,7 +527,9 @@ exports.updateContact = updateContact;
|
|
|
536
527
|
* @requiredField targetContactRevision
|
|
537
528
|
* @param options - Merge contacts options.
|
|
538
529
|
* @permissionScope Manage Contacts
|
|
530
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
539
531
|
* @permissionScope Manage Members and Contacts - all permissions
|
|
532
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
540
533
|
* @applicableIdentity APP
|
|
541
534
|
*/
|
|
542
535
|
function mergeContacts(targetContactId, targetContactRevision, options) {
|
|
@@ -580,7 +573,6 @@ function mergeContacts(targetContactId, targetContactRevision, options) {
|
|
|
580
573
|
options,
|
|
581
574
|
]);
|
|
582
575
|
const reqOpts = ambassadorWixContactsV4Contact.mergeContacts(payload);
|
|
583
|
-
__log(`"MergeContacts" sending request with: ${__inspect(reqOpts)}`);
|
|
584
576
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
585
577
|
try {
|
|
586
578
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -588,11 +580,15 @@ function mergeContacts(targetContactId, targetContactRevision, options) {
|
|
|
588
580
|
return fromJSON(result.data);
|
|
589
581
|
}
|
|
590
582
|
catch (err) {
|
|
591
|
-
const transformedError = (0,
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
583
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
584
|
+
spreadPathsToArguments: {},
|
|
585
|
+
explicitPathsToArguments: {
|
|
586
|
+
targetContactId: '$[0]',
|
|
587
|
+
targetContactRevision: '$[1]',
|
|
588
|
+
sourceContactIds: '$[2].sourceContactIds',
|
|
589
|
+
},
|
|
590
|
+
singleArgumentUnchanged: false,
|
|
591
|
+
}, ['targetContactId', 'targetContactRevision', 'options']);
|
|
596
592
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
597
593
|
throw transformedError;
|
|
598
594
|
}
|
|
@@ -611,19 +607,14 @@ exports.mergeContacts = mergeContacts;
|
|
|
611
607
|
* the member must be deleted first,
|
|
612
608
|
* and then the contact can be deleted.
|
|
613
609
|
*
|
|
614
|
-
* <!--
|
|
615
|
-
* > **Note:**
|
|
616
|
-
* > Only visitors with
|
|
617
|
-
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
618
|
-
* > can delete contacts.
|
|
619
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
620
|
-
* -->
|
|
621
610
|
* @param contactId - ID of the contact to delete.
|
|
622
611
|
* @public
|
|
623
612
|
* @documentationMaturity preview
|
|
624
613
|
* @requiredField contactId
|
|
625
614
|
* @permissionScope Manage Contacts
|
|
615
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
626
616
|
* @permissionScope Manage Members and Contacts - all permissions
|
|
617
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
627
618
|
* @applicableIdentity APP
|
|
628
619
|
*/
|
|
629
620
|
function deleteContact(contactId) {
|
|
@@ -653,16 +644,17 @@ function deleteContact(contactId) {
|
|
|
653
644
|
});
|
|
654
645
|
const payload = toAmbassadorRequest([contactId]);
|
|
655
646
|
const reqOpts = ambassadorWixContactsV4Contact.deleteContact(payload);
|
|
656
|
-
__log(`"DeleteContact" sending request with: ${__inspect(reqOpts)}`);
|
|
657
647
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
658
648
|
try {
|
|
659
649
|
const result = yield httpClient.request(reqOpts);
|
|
660
650
|
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
661
651
|
}
|
|
662
652
|
catch (err) {
|
|
663
|
-
const transformedError = (0,
|
|
664
|
-
|
|
665
|
-
|
|
653
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
654
|
+
spreadPathsToArguments: {},
|
|
655
|
+
explicitPathsToArguments: { contactId: '$[0]' },
|
|
656
|
+
singleArgumentUnchanged: false,
|
|
657
|
+
}, ['contactId']);
|
|
666
658
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
667
659
|
throw transformedError;
|
|
668
660
|
}
|
|
@@ -675,30 +667,24 @@ exports.deleteContact = deleteContact;
|
|
|
675
667
|
*
|
|
676
668
|
* The `labelContact()` function returns a Promise
|
|
677
669
|
* that resolves when the specified labels are added to the contact.
|
|
678
|
-
* - **To create new labels:** Use
|
|
679
|
-
* - **To find labels:** Use
|
|
670
|
+
* - **To create new labels:** Use `findOrCreateLabel()`.
|
|
671
|
+
* - **To find labels:** Use `findOrCreateLabel()`, `getLabel()`, or `queryLabels()`.
|
|
680
672
|
*
|
|
681
|
-
* <!--
|
|
682
|
-
* > **Note:**
|
|
683
|
-
* > Only visitors with
|
|
684
|
-
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
685
|
-
* > can label contacts.
|
|
686
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
687
|
-
* -->
|
|
688
673
|
* @param contactId - ID of the contact to add labels to.
|
|
689
674
|
* @param labelKeys - List of label keys to add to the contact.
|
|
690
675
|
*
|
|
691
676
|
* Label keys must exist to be added to the contact.
|
|
692
|
-
*
|
|
693
|
-
*
|
|
694
|
-
*
|
|
695
|
-
* [`queryLabels()`](wix-crm-v2/labels/queryLabels).
|
|
677
|
+
* Contact labels can be created with the
|
|
678
|
+
* `findOrCreateLabel()` function. You can use the
|
|
679
|
+
* `queryLabels()` function to view the currently existing labels.
|
|
696
680
|
* @public
|
|
697
681
|
* @documentationMaturity preview
|
|
698
682
|
* @requiredField contactId
|
|
699
683
|
* @requiredField labelKeys
|
|
700
684
|
* @permissionScope Manage Contacts
|
|
685
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
701
686
|
* @permissionScope Manage Members and Contacts - all permissions
|
|
687
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
702
688
|
* @applicableIdentity APP
|
|
703
689
|
* @returns Updated contact.
|
|
704
690
|
*/
|
|
@@ -735,7 +721,6 @@ function labelContact(contactId, labelKeys) {
|
|
|
735
721
|
});
|
|
736
722
|
const payload = toAmbassadorRequest([contactId, labelKeys]);
|
|
737
723
|
const reqOpts = ambassadorWixContactsV4Contact.labelContact(payload);
|
|
738
|
-
__log(`"LabelContact" sending request with: ${__inspect(reqOpts)}`);
|
|
739
724
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
740
725
|
try {
|
|
741
726
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -743,10 +728,11 @@ function labelContact(contactId, labelKeys) {
|
|
|
743
728
|
return fromJSON(result.data);
|
|
744
729
|
}
|
|
745
730
|
catch (err) {
|
|
746
|
-
const transformedError = (0,
|
|
747
|
-
|
|
748
|
-
'labelKeys',
|
|
749
|
-
|
|
731
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
732
|
+
spreadPathsToArguments: {},
|
|
733
|
+
explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
|
|
734
|
+
singleArgumentUnchanged: false,
|
|
735
|
+
}, ['contactId', 'labelKeys']);
|
|
750
736
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
751
737
|
throw transformedError;
|
|
752
738
|
}
|
|
@@ -759,18 +745,8 @@ exports.labelContact = labelContact;
|
|
|
759
745
|
* The `unlabelContact()` function returns a Promise
|
|
760
746
|
* that resolves when the specified labels are removed from the contact.
|
|
761
747
|
*
|
|
762
|
-
*
|
|
763
|
-
* and you want to remove it from all contacts,
|
|
764
|
-
* you can delete it with Labels
|
|
765
|
-
* `deleteLabel()`.
|
|
748
|
+
* If a label is no longer needed and you want to remove it from all contacts, you can remove it with the Labels `deleteLabel()` function.
|
|
766
749
|
*
|
|
767
|
-
* <!--
|
|
768
|
-
* > **Note:**
|
|
769
|
-
* > Only visitors with
|
|
770
|
-
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
771
|
-
* > can unlabel contacts.
|
|
772
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
773
|
-
* -->
|
|
774
750
|
* @param contactId - ID of the contact to remove labels from.
|
|
775
751
|
* @param labelKeys - List of label keys to remove from the contact.
|
|
776
752
|
* @public
|
|
@@ -778,7 +754,9 @@ exports.labelContact = labelContact;
|
|
|
778
754
|
* @requiredField contactId
|
|
779
755
|
* @requiredField labelKeys
|
|
780
756
|
* @permissionScope Manage Contacts
|
|
757
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
781
758
|
* @permissionScope Manage Members and Contacts - all permissions
|
|
759
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
782
760
|
* @applicableIdentity APP
|
|
783
761
|
* @returns Updated contact.
|
|
784
762
|
*/
|
|
@@ -815,7 +793,6 @@ function unlabelContact(contactId, labelKeys) {
|
|
|
815
793
|
});
|
|
816
794
|
const payload = toAmbassadorRequest([contactId, labelKeys]);
|
|
817
795
|
const reqOpts = ambassadorWixContactsV4Contact.unlabelContact(payload);
|
|
818
|
-
__log(`"UnlabelContact" sending request with: ${__inspect(reqOpts)}`);
|
|
819
796
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
820
797
|
try {
|
|
821
798
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -823,10 +800,11 @@ function unlabelContact(contactId, labelKeys) {
|
|
|
823
800
|
return fromJSON(result.data);
|
|
824
801
|
}
|
|
825
802
|
catch (err) {
|
|
826
|
-
const transformedError = (0,
|
|
827
|
-
|
|
828
|
-
'labelKeys',
|
|
829
|
-
|
|
803
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
804
|
+
spreadPathsToArguments: {},
|
|
805
|
+
explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
|
|
806
|
+
singleArgumentUnchanged: false,
|
|
807
|
+
}, ['contactId', 'labelKeys']);
|
|
830
808
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
831
809
|
throw transformedError;
|
|
832
810
|
}
|
|
@@ -839,31 +817,26 @@ exports.unlabelContact = unlabelContact;
|
|
|
839
817
|
*
|
|
840
818
|
* The `getContact()` function returns a Promise
|
|
841
819
|
* that resolves when the contact is found.
|
|
820
|
+
*
|
|
842
821
|
* #### Getting Merged Contacts
|
|
843
|
-
* When a source contact is merged
|
|
844
|
-
*
|
|
845
|
-
* When calling `getContact()` for a merged contact,
|
|
846
|
-
* you can use the source or target contact ID.
|
|
847
|
-
* In both cases, the target contact is returned.
|
|
822
|
+
* When a source contact is merged into a target contact, the source contact is deleted. When calling `getContact()` for a merged contact,
|
|
823
|
+
* you can use the source or target contact ID. In both cases, the target contact is returned.
|
|
848
824
|
*
|
|
849
|
-
* This is supported only when calling `getContact()
|
|
850
|
-
* and only for merged contacts.
|
|
851
|
-
* Deleted source contact IDs are not supported on any other function.
|
|
825
|
+
* This is supported only when calling `getContact()`on merged contacts. Previously deleted source contact IDs can't be passed to any other function.
|
|
852
826
|
*
|
|
853
|
-
* <!-- > - Only visitors with
|
|
854
|
-
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
855
|
-
* > can retrieve contacts.
|
|
856
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
857
|
-
* -->
|
|
858
827
|
* @param _id - ID of the contact to retrieve.
|
|
859
828
|
* @public
|
|
860
829
|
* @documentationMaturity preview
|
|
861
830
|
* @requiredField _id
|
|
862
831
|
* @param options - Get contact options.
|
|
863
832
|
* @permissionScope Read Contacts
|
|
833
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
|
|
864
834
|
* @permissionScope Read Members and Contacts - all read permissions
|
|
835
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
865
836
|
* @permissionScope Manage Contacts
|
|
837
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
866
838
|
* @permissionScope Manage Members and Contacts - all permissions
|
|
839
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
867
840
|
* @applicableIdentity APP
|
|
868
841
|
* @returns The requested contact.
|
|
869
842
|
*/
|
|
@@ -904,7 +877,6 @@ function getContact(_id, options) {
|
|
|
904
877
|
});
|
|
905
878
|
const payload = toAmbassadorRequest([_id, options]);
|
|
906
879
|
const reqOpts = ambassadorWixContactsV4Contact.getContact(payload);
|
|
907
|
-
__log(`"GetContact" sending request with: ${__inspect(reqOpts)}`);
|
|
908
880
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
909
881
|
try {
|
|
910
882
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -912,10 +884,15 @@ function getContact(_id, options) {
|
|
|
912
884
|
return fromJSON(result.data);
|
|
913
885
|
}
|
|
914
886
|
catch (err) {
|
|
915
|
-
const transformedError = (0,
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
887
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
888
|
+
spreadPathsToArguments: {},
|
|
889
|
+
explicitPathsToArguments: {
|
|
890
|
+
id: '$[0]',
|
|
891
|
+
fields: '$[1].fields',
|
|
892
|
+
fieldsets: '$[1].fieldsets',
|
|
893
|
+
},
|
|
894
|
+
singleArgumentUnchanged: false,
|
|
895
|
+
}, ['_id', 'options']);
|
|
919
896
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
920
897
|
throw transformedError;
|
|
921
898
|
}
|