@wix/crm 1.0.84 → 1.0.86
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 -5
- package/build/cjs/context.js +5 -5
- package/build/cjs/context.js.map +1 -1
- package/build/cjs/index.d.ts +5 -5
- package/build/cjs/index.js +5 -5
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +5 -5
- package/build/cjs/meta.js +5 -5
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +5 -5
- package/build/es/context.js +5 -5
- package/build/es/context.js.map +1 -1
- package/build/es/index.d.ts +5 -5
- package/build/es/index.js +5 -5
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +5 -5
- package/build/es/meta.js +5 -5
- package/build/es/meta.js.map +1 -1
- package/package.json +15 -9
- package/build/cjs/index.typings.d.ts +0 -5
- package/build/cjs/index.typings.js +0 -32
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/contacts-v4-contact.context.d.ts +0 -9
- package/build/cjs/src/contacts-v4-contact.context.js +0 -82
- package/build/cjs/src/contacts-v4-contact.context.js.map +0 -1
- package/build/cjs/src/contacts-v4-contact.http.d.ts +0 -95
- package/build/cjs/src/contacts-v4-contact.http.js +0 -485
- package/build/cjs/src/contacts-v4-contact.http.js.map +0 -1
- package/build/cjs/src/contacts-v4-contact.meta.d.ts +0 -31
- package/build/cjs/src/contacts-v4-contact.meta.js +0 -161
- package/build/cjs/src/contacts-v4-contact.meta.js.map +0 -1
- package/build/cjs/src/contacts-v4-contact.public.d.ts +0 -49
- package/build/cjs/src/contacts-v4-contact.public.js +0 -76
- package/build/cjs/src/contacts-v4-contact.public.js.map +0 -1
- package/build/cjs/src/contacts-v4-contact.types.d.ts +0 -2185
- package/build/cjs/src/contacts-v4-contact.types.js +0 -270
- package/build/cjs/src/contacts-v4-contact.types.js.map +0 -1
- package/build/cjs/src/contacts-v4-contact.universal.d.ts +0 -2055
- package/build/cjs/src/contacts-v4-contact.universal.js +0 -930
- package/build/cjs/src/contacts-v4-contact.universal.js.map +0 -1
- package/build/cjs/src/contacts-v4-extended-field.context.d.ts +0 -7
- package/build/cjs/src/contacts-v4-extended-field.context.js +0 -60
- package/build/cjs/src/contacts-v4-extended-field.context.js.map +0 -1
- package/build/cjs/src/contacts-v4-extended-field.http.d.ts +0 -53
- package/build/cjs/src/contacts-v4-extended-field.http.js +0 -234
- package/build/cjs/src/contacts-v4-extended-field.http.js.map +0 -1
- package/build/cjs/src/contacts-v4-extended-field.meta.d.ts +0 -23
- package/build/cjs/src/contacts-v4-extended-field.meta.js +0 -123
- package/build/cjs/src/contacts-v4-extended-field.meta.js.map +0 -1
- package/build/cjs/src/contacts-v4-extended-field.public.d.ts +0 -23
- package/build/cjs/src/contacts-v4-extended-field.public.js +0 -44
- package/build/cjs/src/contacts-v4-extended-field.public.js.map +0 -1
- package/build/cjs/src/contacts-v4-extended-field.types.d.ts +0 -357
- package/build/cjs/src/contacts-v4-extended-field.types.js +0 -23
- package/build/cjs/src/contacts-v4-extended-field.types.js.map +0 -1
- package/build/cjs/src/contacts-v4-extended-field.universal.d.ts +0 -623
- package/build/cjs/src/contacts-v4-extended-field.universal.js +0 -434
- package/build/cjs/src/contacts-v4-extended-field.universal.js.map +0 -1
- package/build/cjs/src/contacts-v4-label.context.d.ts +0 -7
- package/build/cjs/src/contacts-v4-label.context.js +0 -60
- package/build/cjs/src/contacts-v4-label.context.js.map +0 -1
- package/build/cjs/src/contacts-v4-label.http.d.ts +0 -54
- package/build/cjs/src/contacts-v4-label.http.js +0 -235
- package/build/cjs/src/contacts-v4-label.http.js.map +0 -1
- package/build/cjs/src/contacts-v4-label.meta.d.ts +0 -23
- package/build/cjs/src/contacts-v4-label.meta.js +0 -123
- package/build/cjs/src/contacts-v4-label.meta.js.map +0 -1
- package/build/cjs/src/contacts-v4-label.public.d.ts +0 -21
- package/build/cjs/src/contacts-v4-label.public.js +0 -43
- package/build/cjs/src/contacts-v4-label.public.js.map +0 -1
- package/build/cjs/src/contacts-v4-label.types.d.ts +0 -349
- package/build/cjs/src/contacts-v4-label.types.js +0 -17
- package/build/cjs/src/contacts-v4-label.types.js.map +0 -1
- package/build/cjs/src/contacts-v4-label.universal.d.ts +0 -627
- package/build/cjs/src/contacts-v4-label.universal.js +0 -428
- package/build/cjs/src/contacts-v4-label.universal.js.map +0 -1
- package/build/cjs/src/contacts-v4-submit-contact.context.d.ts +0 -3
- package/build/cjs/src/contacts-v4-submit-contact.context.js +0 -16
- package/build/cjs/src/contacts-v4-submit-contact.context.js.map +0 -1
- package/build/cjs/src/contacts-v4-submit-contact.http.d.ts +0 -9
- package/build/cjs/src/contacts-v4-submit-contact.http.js +0 -90
- package/build/cjs/src/contacts-v4-submit-contact.http.js.map +0 -1
- package/build/cjs/src/contacts-v4-submit-contact.meta.d.ts +0 -13
- package/build/cjs/src/contacts-v4-submit-contact.meta.js +0 -47
- package/build/cjs/src/contacts-v4-submit-contact.meta.js.map +0 -1
- package/build/cjs/src/contacts-v4-submit-contact.public.d.ts +0 -8
- package/build/cjs/src/contacts-v4-submit-contact.public.js +0 -22
- package/build/cjs/src/contacts-v4-submit-contact.public.js.map +0 -1
- package/build/cjs/src/contacts-v4-submit-contact.types.d.ts +0 -541
- package/build/cjs/src/contacts-v4-submit-contact.types.js +0 -174
- package/build/cjs/src/contacts-v4-submit-contact.types.js.map +0 -1
- package/build/cjs/src/contacts-v4-submit-contact.universal.d.ts +0 -555
- package/build/cjs/src/contacts-v4-submit-contact.universal.js +0 -288
- package/build/cjs/src/contacts-v4-submit-contact.universal.js.map +0 -1
- package/build/cjs/src/crm-tasks-v2-task.context.d.ts +0 -9
- package/build/cjs/src/crm-tasks-v2-task.context.js +0 -82
- package/build/cjs/src/crm-tasks-v2-task.context.js.map +0 -1
- package/build/cjs/src/crm-tasks-v2-task.http.d.ts +0 -60
- package/build/cjs/src/crm-tasks-v2-task.http.js +0 -268
- package/build/cjs/src/crm-tasks-v2-task.http.js.map +0 -1
- package/build/cjs/src/crm-tasks-v2-task.meta.d.ts +0 -27
- package/build/cjs/src/crm-tasks-v2-task.meta.js +0 -161
- package/build/cjs/src/crm-tasks-v2-task.meta.js.map +0 -1
- package/build/cjs/src/crm-tasks-v2-task.public.d.ts +0 -30
- package/build/cjs/src/crm-tasks-v2-task.public.js +0 -58
- package/build/cjs/src/crm-tasks-v2-task.public.js.map +0 -1
- package/build/cjs/src/crm-tasks-v2-task.types.d.ts +0 -430
- package/build/cjs/src/crm-tasks-v2-task.types.js +0 -29
- package/build/cjs/src/crm-tasks-v2-task.types.js.map +0 -1
- package/build/cjs/src/crm-tasks-v2-task.universal.d.ts +0 -678
- package/build/cjs/src/crm-tasks-v2-task.universal.js +0 -520
- package/build/cjs/src/crm-tasks-v2-task.universal.js.map +0 -1
- package/build/cjs/src/ping-notifications-v3-notification.http.d.ts +0 -15
- package/build/cjs/src/ping-notifications-v3-notification.http.js +0 -87
- package/build/cjs/src/ping-notifications-v3-notification.http.js.map +0 -1
- package/build/cjs/src/ping-notifications-v3-notification.public.d.ts +0 -8
- package/build/cjs/src/ping-notifications-v3-notification.public.js +0 -14
- package/build/cjs/src/ping-notifications-v3-notification.public.js.map +0 -1
- package/build/cjs/src/ping-notifications-v3-notification.types.d.ts +0 -113
- package/build/cjs/src/ping-notifications-v3-notification.types.js +0 -15
- package/build/cjs/src/ping-notifications-v3-notification.types.js.map +0 -1
- package/build/cjs/src/ping-notifications-v3-notification.universal.d.ts +0 -146
- package/build/cjs/src/ping-notifications-v3-notification.universal.js +0 -136
- package/build/cjs/src/ping-notifications-v3-notification.universal.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -5
- package/build/es/index.typings.js +0 -6
- package/build/es/index.typings.js.map +0 -1
- package/build/es/src/contacts-v4-contact.context.d.ts +0 -9
- package/build/es/src/contacts-v4-contact.context.js +0 -72
- package/build/es/src/contacts-v4-contact.context.js.map +0 -1
- package/build/es/src/contacts-v4-contact.http.d.ts +0 -95
- package/build/es/src/contacts-v4-contact.http.js +0 -475
- package/build/es/src/contacts-v4-contact.http.js.map +0 -1
- package/build/es/src/contacts-v4-contact.meta.d.ts +0 -31
- package/build/es/src/contacts-v4-contact.meta.js +0 -128
- package/build/es/src/contacts-v4-contact.meta.js.map +0 -1
- package/build/es/src/contacts-v4-contact.public.d.ts +0 -49
- package/build/es/src/contacts-v4-contact.public.js +0 -40
- package/build/es/src/contacts-v4-contact.public.js.map +0 -1
- package/build/es/src/contacts-v4-contact.types.d.ts +0 -2185
- package/build/es/src/contacts-v4-contact.types.js +0 -267
- package/build/es/src/contacts-v4-contact.types.js.map +0 -1
- package/build/es/src/contacts-v4-contact.universal.d.ts +0 -2055
- package/build/es/src/contacts-v4-contact.universal.js +0 -897
- package/build/es/src/contacts-v4-contact.universal.js.map +0 -1
- package/build/es/src/contacts-v4-extended-field.context.d.ts +0 -7
- package/build/es/src/contacts-v4-extended-field.context.js +0 -52
- package/build/es/src/contacts-v4-extended-field.context.js.map +0 -1
- package/build/es/src/contacts-v4-extended-field.http.d.ts +0 -53
- package/build/es/src/contacts-v4-extended-field.http.js +0 -226
- package/build/es/src/contacts-v4-extended-field.http.js.map +0 -1
- package/build/es/src/contacts-v4-extended-field.meta.d.ts +0 -23
- package/build/es/src/contacts-v4-extended-field.meta.js +0 -92
- package/build/es/src/contacts-v4-extended-field.meta.js.map +0 -1
- package/build/es/src/contacts-v4-extended-field.public.d.ts +0 -23
- package/build/es/src/contacts-v4-extended-field.public.js +0 -30
- package/build/es/src/contacts-v4-extended-field.public.js.map +0 -1
- package/build/es/src/contacts-v4-extended-field.types.d.ts +0 -357
- package/build/es/src/contacts-v4-extended-field.types.js +0 -20
- package/build/es/src/contacts-v4-extended-field.types.js.map +0 -1
- package/build/es/src/contacts-v4-extended-field.universal.d.ts +0 -623
- package/build/es/src/contacts-v4-extended-field.universal.js +0 -403
- package/build/es/src/contacts-v4-extended-field.universal.js.map +0 -1
- package/build/es/src/contacts-v4-label.context.d.ts +0 -7
- package/build/es/src/contacts-v4-label.context.js +0 -52
- package/build/es/src/contacts-v4-label.context.js.map +0 -1
- package/build/es/src/contacts-v4-label.http.d.ts +0 -54
- package/build/es/src/contacts-v4-label.http.js +0 -227
- package/build/es/src/contacts-v4-label.http.js.map +0 -1
- package/build/es/src/contacts-v4-label.meta.d.ts +0 -23
- package/build/es/src/contacts-v4-label.meta.js +0 -92
- package/build/es/src/contacts-v4-label.meta.js.map +0 -1
- package/build/es/src/contacts-v4-label.public.d.ts +0 -21
- package/build/es/src/contacts-v4-label.public.js +0 -30
- package/build/es/src/contacts-v4-label.public.js.map +0 -1
- package/build/es/src/contacts-v4-label.types.d.ts +0 -349
- package/build/es/src/contacts-v4-label.types.js +0 -14
- package/build/es/src/contacts-v4-label.types.js.map +0 -1
- package/build/es/src/contacts-v4-label.universal.d.ts +0 -627
- package/build/es/src/contacts-v4-label.universal.js +0 -397
- package/build/es/src/contacts-v4-label.universal.js.map +0 -1
- package/build/es/src/contacts-v4-submit-contact.context.d.ts +0 -3
- package/build/es/src/contacts-v4-submit-contact.context.js +0 -12
- package/build/es/src/contacts-v4-submit-contact.context.js.map +0 -1
- package/build/es/src/contacts-v4-submit-contact.http.d.ts +0 -9
- package/build/es/src/contacts-v4-submit-contact.http.js +0 -86
- package/build/es/src/contacts-v4-submit-contact.http.js.map +0 -1
- package/build/es/src/contacts-v4-submit-contact.meta.d.ts +0 -13
- package/build/es/src/contacts-v4-submit-contact.meta.js +0 -20
- package/build/es/src/contacts-v4-submit-contact.meta.js.map +0 -1
- package/build/es/src/contacts-v4-submit-contact.public.d.ts +0 -8
- package/build/es/src/contacts-v4-submit-contact.public.js +0 -9
- package/build/es/src/contacts-v4-submit-contact.public.js.map +0 -1
- package/build/es/src/contacts-v4-submit-contact.types.d.ts +0 -541
- package/build/es/src/contacts-v4-submit-contact.types.js +0 -171
- package/build/es/src/contacts-v4-submit-contact.types.js.map +0 -1
- package/build/es/src/contacts-v4-submit-contact.universal.d.ts +0 -555
- package/build/es/src/contacts-v4-submit-contact.universal.js +0 -261
- package/build/es/src/contacts-v4-submit-contact.universal.js.map +0 -1
- package/build/es/src/crm-tasks-v2-task.context.d.ts +0 -9
- package/build/es/src/crm-tasks-v2-task.context.js +0 -72
- package/build/es/src/crm-tasks-v2-task.context.js.map +0 -1
- package/build/es/src/crm-tasks-v2-task.http.d.ts +0 -60
- package/build/es/src/crm-tasks-v2-task.http.js +0 -258
- package/build/es/src/crm-tasks-v2-task.http.js.map +0 -1
- package/build/es/src/crm-tasks-v2-task.meta.d.ts +0 -27
- package/build/es/src/crm-tasks-v2-task.meta.js +0 -128
- package/build/es/src/crm-tasks-v2-task.meta.js.map +0 -1
- package/build/es/src/crm-tasks-v2-task.public.d.ts +0 -30
- package/build/es/src/crm-tasks-v2-task.public.js +0 -40
- package/build/es/src/crm-tasks-v2-task.public.js.map +0 -1
- package/build/es/src/crm-tasks-v2-task.types.d.ts +0 -430
- package/build/es/src/crm-tasks-v2-task.types.js +0 -26
- package/build/es/src/crm-tasks-v2-task.types.js.map +0 -1
- package/build/es/src/crm-tasks-v2-task.universal.d.ts +0 -678
- package/build/es/src/crm-tasks-v2-task.universal.js +0 -487
- package/build/es/src/crm-tasks-v2-task.universal.js.map +0 -1
- package/build/es/src/ping-notifications-v3-notification.http.d.ts +0 -15
- package/build/es/src/ping-notifications-v3-notification.http.js +0 -83
- package/build/es/src/ping-notifications-v3-notification.http.js.map +0 -1
- package/build/es/src/ping-notifications-v3-notification.public.d.ts +0 -8
- package/build/es/src/ping-notifications-v3-notification.public.js +0 -9
- package/build/es/src/ping-notifications-v3-notification.public.js.map +0 -1
- package/build/es/src/ping-notifications-v3-notification.types.d.ts +0 -113
- package/build/es/src/ping-notifications-v3-notification.types.js +0 -12
- package/build/es/src/ping-notifications-v3-notification.types.js.map +0 -1
- package/build/es/src/ping-notifications-v3-notification.universal.d.ts +0 -146
- package/build/es/src/ping-notifications-v3-notification.universal.js +0 -109
- package/build/es/src/ping-notifications-v3-notification.universal.js.map +0 -1
|
@@ -1,930 +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
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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.MemberStatus = exports.PhoneDeliverabilityStatus = exports.EmailDeliverabilityStatus = exports.SubscriptionStatus = exports.ImageProvider = exports.SubdivisionType = exports.AddressTag = exports.PhoneTag = exports.EmailTag = exports.ContactActivityType = exports.ContactSourceType = void 0;
|
|
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");
|
|
39
|
-
const ambassadorWixContactsV4Contact = __importStar(require("./contacts-v4-contact.http"));
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
const _toVeloEntity = '$';
|
|
42
|
-
const _fromVeloEntity = '$';
|
|
43
|
-
var ContactSourceType;
|
|
44
|
-
(function (ContactSourceType) {
|
|
45
|
-
ContactSourceType["OTHER"] = "OTHER";
|
|
46
|
-
ContactSourceType["ADMIN"] = "ADMIN";
|
|
47
|
-
ContactSourceType["WIX_APP"] = "WIX_APP";
|
|
48
|
-
ContactSourceType["IMPORT"] = "IMPORT";
|
|
49
|
-
ContactSourceType["THIRD_PARTY"] = "THIRD_PARTY";
|
|
50
|
-
ContactSourceType["WIX_BOOKINGS"] = "WIX_BOOKINGS";
|
|
51
|
-
ContactSourceType["WIX_CHAT"] = "WIX_CHAT";
|
|
52
|
-
ContactSourceType["WIX_EMAIL_MARKETING"] = "WIX_EMAIL_MARKETING";
|
|
53
|
-
ContactSourceType["WIX_EVENTS"] = "WIX_EVENTS";
|
|
54
|
-
ContactSourceType["WIX_FORMS"] = "WIX_FORMS";
|
|
55
|
-
ContactSourceType["WIX_GROUPS"] = "WIX_GROUPS";
|
|
56
|
-
ContactSourceType["WIX_HOTELS"] = "WIX_HOTELS";
|
|
57
|
-
ContactSourceType["WIX_MARKET_PLACE"] = "WIX_MARKET_PLACE";
|
|
58
|
-
ContactSourceType["WIX_MUSIC"] = "WIX_MUSIC";
|
|
59
|
-
ContactSourceType["WIX_RESTAURANTS"] = "WIX_RESTAURANTS";
|
|
60
|
-
ContactSourceType["WIX_SITE_MEMBERS"] = "WIX_SITE_MEMBERS";
|
|
61
|
-
ContactSourceType["WIX_STORES"] = "WIX_STORES";
|
|
62
|
-
ContactSourceType["WIX_CODE"] = "WIX_CODE";
|
|
63
|
-
ContactSourceType["HOPP"] = "HOPP";
|
|
64
|
-
})(ContactSourceType || (exports.ContactSourceType = ContactSourceType = {}));
|
|
65
|
-
var ContactActivityType;
|
|
66
|
-
(function (ContactActivityType) {
|
|
67
|
-
/** Last visit to your site (any unknown activity) */
|
|
68
|
-
ContactActivityType["GENERAL"] = "GENERAL";
|
|
69
|
-
/** This cannot be reported, used when contact created, will throw exception */
|
|
70
|
-
ContactActivityType["CONTACT_CREATED"] = "CONTACT_CREATED";
|
|
71
|
-
/** "auth/login" */
|
|
72
|
-
ContactActivityType["MEMBER_LOGIN"] = "MEMBER_LOGIN";
|
|
73
|
-
/** "auth/register" */
|
|
74
|
-
ContactActivityType["MEMBER_REGISTER"] = "MEMBER_REGISTER";
|
|
75
|
-
/** "auth/status-change" */
|
|
76
|
-
ContactActivityType["MEMBER_STATUS_CHANGED"] = "MEMBER_STATUS_CHANGED";
|
|
77
|
-
/** "contact/contact-form", (but also "form/contact-form", "form/form") */
|
|
78
|
-
ContactActivityType["FORM_SUBMITTED"] = "FORM_SUBMITTED";
|
|
79
|
-
/** "form/lead-capture-form" */
|
|
80
|
-
ContactActivityType["INBOX_FORM_SUBMITTED"] = "INBOX_FORM_SUBMITTED";
|
|
81
|
-
/** "chat/payment-request-paid" */
|
|
82
|
-
ContactActivityType["INBOX_PAYMENT_REQUEST_PAID"] = "INBOX_PAYMENT_REQUEST_PAID";
|
|
83
|
-
/** "messaging/email" - Direction BUSINESS_TO_CUSTOMER */
|
|
84
|
-
ContactActivityType["INBOX_MESSAGE_TO_CUSTOMER"] = "INBOX_MESSAGE_TO_CUSTOMER";
|
|
85
|
-
/** "messaging/email" - Direction CUSTOMER_TO_BUSINESS */
|
|
86
|
-
ContactActivityType["INBOX_MESSAGE_FROM_CUSTOMER"] = "INBOX_MESSAGE_FROM_CUSTOMER";
|
|
87
|
-
/** "contact/subscription-form" (but also "form/subscription-form") */
|
|
88
|
-
ContactActivityType["NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED"] = "NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED";
|
|
89
|
-
/** "contact/unsubscribe" */
|
|
90
|
-
ContactActivityType["NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE"] = "NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE";
|
|
91
|
-
/** "e_commerce/purchase" */
|
|
92
|
-
ContactActivityType["ECOM_PURCHASE"] = "ECOM_PURCHASE";
|
|
93
|
-
/** "e_commerce/cart-abandon" */
|
|
94
|
-
ContactActivityType["ECOM_CART_ABANDON"] = "ECOM_CART_ABANDON";
|
|
95
|
-
/** "e_commerce/checkout-buyer" */
|
|
96
|
-
ContactActivityType["ECOM_CHECKOUT_BUYER"] = "ECOM_CHECKOUT_BUYER";
|
|
97
|
-
/** "scheduler/appointment" */
|
|
98
|
-
ContactActivityType["BOOKINGS_APPOINTMENT"] = "BOOKINGS_APPOINTMENT";
|
|
99
|
-
/** "hotels/reservation" */
|
|
100
|
-
ContactActivityType["HOTELS_RESERVATION"] = "HOTELS_RESERVATION";
|
|
101
|
-
/** "hotels/purchase" */
|
|
102
|
-
ContactActivityType["HOTELS_PURCHASE"] = "HOTELS_PURCHASE";
|
|
103
|
-
/** "hotels/confirmation" */
|
|
104
|
-
ContactActivityType["HOTELS_CONFIRMATION"] = "HOTELS_CONFIRMATION";
|
|
105
|
-
/** "hotels/cancel" */
|
|
106
|
-
ContactActivityType["HOTELS_CANCEL"] = "HOTELS_CANCEL";
|
|
107
|
-
/** "video/purchase" */
|
|
108
|
-
ContactActivityType["VIDEO_PURCHASE"] = "VIDEO_PURCHASE";
|
|
109
|
-
/** "video/rent" */
|
|
110
|
-
ContactActivityType["VIDEO_RENT"] = "VIDEO_RENT";
|
|
111
|
-
/** "cashier/button_purchase" */
|
|
112
|
-
ContactActivityType["CASHIER_BUTTON_PURCHASE"] = "CASHIER_BUTTON_PURCHASE";
|
|
113
|
-
/** "arena/new-lead" */
|
|
114
|
-
ContactActivityType["ARENA_NEW_LEAD"] = "ARENA_NEW_LEAD";
|
|
115
|
-
/** "events/rsvp" */
|
|
116
|
-
ContactActivityType["EVENTS_RSVP"] = "EVENTS_RSVP";
|
|
117
|
-
/** "invoice/pay" */
|
|
118
|
-
ContactActivityType["INVOICE_PAY"] = "INVOICE_PAY";
|
|
119
|
-
/** "invoice/overdue" */
|
|
120
|
-
ContactActivityType["INVOICE_OVERDUE"] = "INVOICE_OVERDUE";
|
|
121
|
-
/** "price-quote/accept" */
|
|
122
|
-
ContactActivityType["PRICE_QUOTE_ACCEPT"] = "PRICE_QUOTE_ACCEPT";
|
|
123
|
-
/** "price-quote/expire" */
|
|
124
|
-
ContactActivityType["PRICE_QUOTE_EXPIRE"] = "PRICE_QUOTE_EXPIRE";
|
|
125
|
-
/** "restaurants/order" */
|
|
126
|
-
ContactActivityType["RESTAURANTS_ORDER"] = "RESTAURANTS_ORDER";
|
|
127
|
-
/** "restaurants/reservation" */
|
|
128
|
-
ContactActivityType["RESTAURANTS_RESERVATION"] = "RESTAURANTS_RESERVATION";
|
|
129
|
-
/** "shoutout/open" */
|
|
130
|
-
ContactActivityType["SHOUTOUT_OPEN"] = "SHOUTOUT_OPEN";
|
|
131
|
-
/** "shoutout/click" */
|
|
132
|
-
ContactActivityType["SHOUTOUT_CLICK"] = "SHOUTOUT_CLICK";
|
|
133
|
-
ContactActivityType["CONTACT_MERGED"] = "CONTACT_MERGED";
|
|
134
|
-
/** "contact/subscribe" */
|
|
135
|
-
ContactActivityType["NEWSLETTER_SUBSCRIPTION_SUBSCRIBE"] = "NEWSLETTER_SUBSCRIPTION_SUBSCRIBE";
|
|
136
|
-
/** "contact/subscription-pending" */
|
|
137
|
-
ContactActivityType["NEWSLETTER_SUBSCRIPTION_PENDING"] = "NEWSLETTER_SUBSCRIPTION_PENDING";
|
|
138
|
-
/** "contact/subscription-not-set" */
|
|
139
|
-
ContactActivityType["NEWSLETTER_SUBSCRIPTION_NOT_SET"] = "NEWSLETTER_SUBSCRIPTION_NOT_SET";
|
|
140
|
-
/** "contact/phone-subscription-subscribe" */
|
|
141
|
-
ContactActivityType["PHONE_SUBSCRIPTION_SUBSCRIBE"] = "PHONE_SUBSCRIPTION_SUBSCRIBE";
|
|
142
|
-
/** "contact/phone-subscription-pending" */
|
|
143
|
-
ContactActivityType["PHONE_SUBSCRIPTION_PENDING"] = "PHONE_SUBSCRIPTION_PENDING";
|
|
144
|
-
/** "contact/phone-subscription-not-set" */
|
|
145
|
-
ContactActivityType["PHONE_SUBSCRIPTION_NOT_SET"] = "PHONE_SUBSCRIPTION_NOT_SET";
|
|
146
|
-
/** "contact/phone-subscription-unsubscribe" */
|
|
147
|
-
ContactActivityType["PHONE_SUBSCRIPTION_UNSUBSCRIBE"] = "PHONE_SUBSCRIPTION_UNSUBSCRIBE";
|
|
148
|
-
})(ContactActivityType || (exports.ContactActivityType = ContactActivityType = {}));
|
|
149
|
-
var EmailTag;
|
|
150
|
-
(function (EmailTag) {
|
|
151
|
-
EmailTag["UNTAGGED"] = "UNTAGGED";
|
|
152
|
-
EmailTag["MAIN"] = "MAIN";
|
|
153
|
-
EmailTag["HOME"] = "HOME";
|
|
154
|
-
EmailTag["WORK"] = "WORK";
|
|
155
|
-
})(EmailTag || (exports.EmailTag = EmailTag = {}));
|
|
156
|
-
var PhoneTag;
|
|
157
|
-
(function (PhoneTag) {
|
|
158
|
-
PhoneTag["UNTAGGED"] = "UNTAGGED";
|
|
159
|
-
PhoneTag["MAIN"] = "MAIN";
|
|
160
|
-
PhoneTag["HOME"] = "HOME";
|
|
161
|
-
PhoneTag["MOBILE"] = "MOBILE";
|
|
162
|
-
PhoneTag["WORK"] = "WORK";
|
|
163
|
-
PhoneTag["FAX"] = "FAX";
|
|
164
|
-
})(PhoneTag || (exports.PhoneTag = PhoneTag = {}));
|
|
165
|
-
var AddressTag;
|
|
166
|
-
(function (AddressTag) {
|
|
167
|
-
AddressTag["UNTAGGED"] = "UNTAGGED";
|
|
168
|
-
AddressTag["HOME"] = "HOME";
|
|
169
|
-
AddressTag["WORK"] = "WORK";
|
|
170
|
-
AddressTag["BILLING"] = "BILLING";
|
|
171
|
-
AddressTag["SHIPPING"] = "SHIPPING";
|
|
172
|
-
})(AddressTag || (exports.AddressTag = AddressTag = {}));
|
|
173
|
-
var SubdivisionType;
|
|
174
|
-
(function (SubdivisionType) {
|
|
175
|
-
SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
176
|
-
/** State */
|
|
177
|
-
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
178
|
-
/** County */
|
|
179
|
-
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
|
|
180
|
-
/** City/town */
|
|
181
|
-
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
|
|
182
|
-
/** Neighborhood/quarter */
|
|
183
|
-
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
|
|
184
|
-
/** Street/block */
|
|
185
|
-
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
|
|
186
|
-
/** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
187
|
-
SubdivisionType["COUNTRY"] = "COUNTRY";
|
|
188
|
-
})(SubdivisionType || (exports.SubdivisionType = SubdivisionType = {}));
|
|
189
|
-
var ImageProvider;
|
|
190
|
-
(function (ImageProvider) {
|
|
191
|
-
ImageProvider["UNKNOWN"] = "UNKNOWN";
|
|
192
|
-
/** Image stored outside Wix */
|
|
193
|
-
ImageProvider["EXTERNAL"] = "EXTERNAL";
|
|
194
|
-
/** Stored in wix media platform, Must be uploaded by using `GeneratePictureUploadUrl` */
|
|
195
|
-
ImageProvider["WIX_MEDIA"] = "WIX_MEDIA";
|
|
196
|
-
})(ImageProvider || (exports.ImageProvider = ImageProvider = {}));
|
|
197
|
-
var SubscriptionStatus;
|
|
198
|
-
(function (SubscriptionStatus) {
|
|
199
|
-
SubscriptionStatus["NO_SUBSCRIPTION_STATUS"] = "NO_SUBSCRIPTION_STATUS";
|
|
200
|
-
SubscriptionStatus["NOT_SET"] = "NOT_SET";
|
|
201
|
-
SubscriptionStatus["PENDING"] = "PENDING";
|
|
202
|
-
SubscriptionStatus["SUBSCRIBED"] = "SUBSCRIBED";
|
|
203
|
-
SubscriptionStatus["UNSUBSCRIBED"] = "UNSUBSCRIBED";
|
|
204
|
-
})(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
|
|
205
|
-
var EmailDeliverabilityStatus;
|
|
206
|
-
(function (EmailDeliverabilityStatus) {
|
|
207
|
-
EmailDeliverabilityStatus["UNKNOWN_EMAIL_DELIVERABILITY_STATUS"] = "UNKNOWN_EMAIL_DELIVERABILITY_STATUS";
|
|
208
|
-
EmailDeliverabilityStatus["NOT_SET"] = "NOT_SET";
|
|
209
|
-
EmailDeliverabilityStatus["VALID"] = "VALID";
|
|
210
|
-
EmailDeliverabilityStatus["BOUNCED"] = "BOUNCED";
|
|
211
|
-
EmailDeliverabilityStatus["SPAM_COMPLAINT"] = "SPAM_COMPLAINT";
|
|
212
|
-
EmailDeliverabilityStatus["INACTIVE"] = "INACTIVE";
|
|
213
|
-
})(EmailDeliverabilityStatus || (exports.EmailDeliverabilityStatus = EmailDeliverabilityStatus = {}));
|
|
214
|
-
var PhoneDeliverabilityStatus;
|
|
215
|
-
(function (PhoneDeliverabilityStatus) {
|
|
216
|
-
PhoneDeliverabilityStatus["NO_PHONE_DELIVERABILITY_STATUS"] = "NO_PHONE_DELIVERABILITY_STATUS";
|
|
217
|
-
PhoneDeliverabilityStatus["NOT_SET"] = "NOT_SET";
|
|
218
|
-
})(PhoneDeliverabilityStatus || (exports.PhoneDeliverabilityStatus = PhoneDeliverabilityStatus = {}));
|
|
219
|
-
var MemberStatus;
|
|
220
|
-
(function (MemberStatus) {
|
|
221
|
-
MemberStatus["UNKNOWN_MEMBER_STATUS"] = "UNKNOWN_MEMBER_STATUS";
|
|
222
|
-
/** Pending admin approval */
|
|
223
|
-
MemberStatus["PENDING"] = "PENDING";
|
|
224
|
-
MemberStatus["ACTIVE"] = "ACTIVE";
|
|
225
|
-
MemberStatus["DELETED"] = "DELETED";
|
|
226
|
-
MemberStatus["BLOCKED"] = "BLOCKED";
|
|
227
|
-
MemberStatus["OFFLINE"] = "OFFLINE";
|
|
228
|
-
})(MemberStatus || (exports.MemberStatus = MemberStatus = {}));
|
|
229
|
-
var IdentityStatus;
|
|
230
|
-
(function (IdentityStatus) {
|
|
231
|
-
IdentityStatus["UNKNOWN_IDENTITY_STATUS"] = "UNKNOWN_IDENTITY_STATUS";
|
|
232
|
-
IdentityStatus["PENDING_ADMIN_APPROVAL"] = "PENDING_ADMIN_APPROVAL";
|
|
233
|
-
IdentityStatus["ACTIVE"] = "ACTIVE";
|
|
234
|
-
IdentityStatus["DELETED"] = "DELETED";
|
|
235
|
-
IdentityStatus["BLOCKED"] = "BLOCKED";
|
|
236
|
-
IdentityStatus["OFFLINE"] = "OFFLINE";
|
|
237
|
-
})(IdentityStatus || (exports.IdentityStatus = IdentityStatus = {}));
|
|
238
|
-
var PrivacyStatus;
|
|
239
|
-
(function (PrivacyStatus) {
|
|
240
|
-
PrivacyStatus["UNKNOWN_PRIVACY_STATUS"] = "UNKNOWN_PRIVACY_STATUS";
|
|
241
|
-
PrivacyStatus["PRIVATE"] = "PRIVATE";
|
|
242
|
-
PrivacyStatus["PUBLIC"] = "PUBLIC";
|
|
243
|
-
})(PrivacyStatus || (exports.PrivacyStatus = PrivacyStatus = {}));
|
|
244
|
-
var Role;
|
|
245
|
-
(function (Role) {
|
|
246
|
-
Role["UNSPECIFIED_ROLE"] = "UNSPECIFIED_ROLE";
|
|
247
|
-
Role["OWNER"] = "OWNER";
|
|
248
|
-
Role["CONTRIBUTOR"] = "CONTRIBUTOR";
|
|
249
|
-
})(Role || (exports.Role = Role = {}));
|
|
250
|
-
var SortOrder;
|
|
251
|
-
(function (SortOrder) {
|
|
252
|
-
SortOrder["ASC"] = "ASC";
|
|
253
|
-
SortOrder["DESC"] = "DESC";
|
|
254
|
-
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
255
|
-
var ContactFieldSet;
|
|
256
|
-
(function (ContactFieldSet) {
|
|
257
|
-
/** name, primaryEmail, primaryPhone */
|
|
258
|
-
ContactFieldSet["BASIC"] = "BASIC";
|
|
259
|
-
/** name, phones, emails, addresses */
|
|
260
|
-
ContactFieldSet["COMMUNICATION_DETAILS"] = "COMMUNICATION_DETAILS";
|
|
261
|
-
/** name, primaryInfo(email, phone), extendedFields */
|
|
262
|
-
ContactFieldSet["EXTENDED"] = "EXTENDED";
|
|
263
|
-
/** Full contact object */
|
|
264
|
-
ContactFieldSet["FULL"] = "FULL";
|
|
265
|
-
})(ContactFieldSet || (exports.ContactFieldSet = ContactFieldSet = {}));
|
|
266
|
-
var ContactsFacetType;
|
|
267
|
-
(function (ContactsFacetType) {
|
|
268
|
-
ContactsFacetType["UNKNOWN"] = "UNKNOWN";
|
|
269
|
-
ContactsFacetType["ALL_CONTACTS"] = "ALL_CONTACTS";
|
|
270
|
-
ContactsFacetType["NOT_LABELED"] = "NOT_LABELED";
|
|
271
|
-
ContactsFacetType["LABEL"] = "LABEL";
|
|
272
|
-
ContactsFacetType["SUBSCRIPTION_STATUS"] = "SUBSCRIPTION_STATUS";
|
|
273
|
-
ContactsFacetType["MEMBERSHIP_STATUS"] = "MEMBERSHIP_STATUS";
|
|
274
|
-
})(ContactsFacetType || (exports.ContactsFacetType = ContactsFacetType = {}));
|
|
275
|
-
var Action;
|
|
276
|
-
(function (Action) {
|
|
277
|
-
Action["UNKNOWN"] = "UNKNOWN";
|
|
278
|
-
Action["UPDATED"] = "UPDATED";
|
|
279
|
-
Action["CREATED"] = "CREATED";
|
|
280
|
-
})(Action || (exports.Action = Action = {}));
|
|
281
|
-
var UpsertContactResponseAction;
|
|
282
|
-
(function (UpsertContactResponseAction) {
|
|
283
|
-
UpsertContactResponseAction["UNKNOWN"] = "UNKNOWN";
|
|
284
|
-
UpsertContactResponseAction["UPDATED"] = "UPDATED";
|
|
285
|
-
UpsertContactResponseAction["CREATED"] = "CREATED";
|
|
286
|
-
})(UpsertContactResponseAction || (exports.UpsertContactResponseAction = UpsertContactResponseAction = {}));
|
|
287
|
-
var GetContactResponseType;
|
|
288
|
-
(function (GetContactResponseType) {
|
|
289
|
-
/** Normal contact */
|
|
290
|
-
GetContactResponseType["REGULAR"] = "REGULAR";
|
|
291
|
-
/** Contact that id was already allocated for it, but the contact not yet created. */
|
|
292
|
-
GetContactResponseType["IMPLICIT"] = "IMPLICIT";
|
|
293
|
-
/** Contact was merged into another contact */
|
|
294
|
-
GetContactResponseType["MERGED"] = "MERGED";
|
|
295
|
-
})(GetContactResponseType || (exports.GetContactResponseType = GetContactResponseType = {}));
|
|
296
|
-
var SubmitOperation;
|
|
297
|
-
(function (SubmitOperation) {
|
|
298
|
-
SubmitOperation["UNKNOWN"] = "UNKNOWN";
|
|
299
|
-
SubmitOperation["CREATE"] = "CREATE";
|
|
300
|
-
SubmitOperation["UPDATE"] = "UPDATE";
|
|
301
|
-
})(SubmitOperation || (exports.SubmitOperation = SubmitOperation = {}));
|
|
302
|
-
var Mode;
|
|
303
|
-
(function (Mode) {
|
|
304
|
-
/** any */
|
|
305
|
-
Mode["OR"] = "OR";
|
|
306
|
-
/** all */
|
|
307
|
-
Mode["AND"] = "AND";
|
|
308
|
-
})(Mode || (exports.Mode = Mode = {}));
|
|
309
|
-
const _contact = {
|
|
310
|
-
picture: 'wix.common.Image',
|
|
311
|
-
info: '_contactInfo',
|
|
312
|
-
memberInfo: '_memberInfo',
|
|
313
|
-
};
|
|
314
|
-
const _contactAddress = { address: 'wix.common.Address' };
|
|
315
|
-
const _contactAddressesWrapper = { items: '_contactAddress' };
|
|
316
|
-
const _contactInfo = {
|
|
317
|
-
addresses: '_contactAddressesWrapper',
|
|
318
|
-
picture: '_contactPicture',
|
|
319
|
-
};
|
|
320
|
-
const _contactPicture = { image: 'wix.common.Image' };
|
|
321
|
-
const _createContactRequest = { info: '_contactInfo' };
|
|
322
|
-
const _createContactResponse = { contact: '_contact' };
|
|
323
|
-
const _deleteContactRequest = {};
|
|
324
|
-
const _deleteContactResponse = {};
|
|
325
|
-
const _getContactRequest = {};
|
|
326
|
-
const _getContactResponse = { contact: '_contact' };
|
|
327
|
-
const _labelContactRequest = {};
|
|
328
|
-
const _labelContactResponse = { contact: '_contact' };
|
|
329
|
-
const _memberInfo = { profileInfo: '_profileInfo' };
|
|
330
|
-
const _mergeContactsRequest = {};
|
|
331
|
-
const _mergeContactsResponse = { contact: '_contact' };
|
|
332
|
-
const _profileInfo = { photo: 'wix.common.Image' };
|
|
333
|
-
const _unlabelContactRequest = {};
|
|
334
|
-
const _unlabelContactResponse = { contact: '_contact' };
|
|
335
|
-
const _updateContactRequest = { info: '_contactInfo' };
|
|
336
|
-
const _updateContactResponse = { contact: '_contact' };
|
|
337
|
-
exports.onContactCreated = (0, sdk_types_1.EventDefinition)('wix.contacts.v4.contact_created')();
|
|
338
|
-
exports.onContactUpdated = (0, sdk_types_1.EventDefinition)('wix.contacts.v4.contact_updated')();
|
|
339
|
-
exports.onContactMerged = (0, sdk_types_1.EventDefinition)('wix.contacts.v4.contact_merged')();
|
|
340
|
-
exports.onContactDeleted = (0, sdk_types_1.EventDefinition)('wix.contacts.v4.contact_deleted')();
|
|
341
|
-
/**
|
|
342
|
-
* Creates a new contact.
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* The `createContact()` function returns a Promise
|
|
346
|
-
* that resolves to the new contact when it is created.
|
|
347
|
-
*
|
|
348
|
-
* The `info` parameter object must include a name, phone number, or email address.
|
|
349
|
-
* If all 3 of these parameters are missing,
|
|
350
|
-
* the contact won't be created.
|
|
351
|
-
*
|
|
352
|
-
* 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`.
|
|
353
|
-
*
|
|
354
|
-
* @param info - Contact info.
|
|
355
|
-
* @public
|
|
356
|
-
* @documentationMaturity preview
|
|
357
|
-
* @requiredField info
|
|
358
|
-
* @param options - Create contact options.
|
|
359
|
-
* @permissionScope Manage Contacts
|
|
360
|
-
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
361
|
-
* @permissionScope Manage Members and Contacts - all permissions
|
|
362
|
-
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
363
|
-
* @applicableIdentity APP
|
|
364
|
-
* @returns Contact.
|
|
365
|
-
*/
|
|
366
|
-
function createContact(info, options) {
|
|
367
|
-
var _a, _b, _c;
|
|
368
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
369
|
-
const requestTransformation = {
|
|
370
|
-
info: '$[0]',
|
|
371
|
-
allowDuplicates: '$[1].allowDuplicates',
|
|
372
|
-
};
|
|
373
|
-
const responseTransformation = '$';
|
|
374
|
-
// @ts-ignore
|
|
375
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
376
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
377
|
-
rootSchema: _createContactRequest,
|
|
378
|
-
depSchemas: {
|
|
379
|
-
_contactAddress,
|
|
380
|
-
_contactAddressesWrapper,
|
|
381
|
-
_contactInfo,
|
|
382
|
-
_contactPicture,
|
|
383
|
-
},
|
|
384
|
-
fqdnTransformation: {
|
|
385
|
-
paths: [],
|
|
386
|
-
transformation: _fromVeloEntity,
|
|
387
|
-
},
|
|
388
|
-
customTransformation: requestTransformation,
|
|
389
|
-
});
|
|
390
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
391
|
-
rootSchema: _createContactResponse,
|
|
392
|
-
depSchemas: {
|
|
393
|
-
_contact,
|
|
394
|
-
_contactAddress,
|
|
395
|
-
_contactAddressesWrapper,
|
|
396
|
-
_contactInfo,
|
|
397
|
-
_contactPicture,
|
|
398
|
-
_memberInfo,
|
|
399
|
-
_profileInfo,
|
|
400
|
-
},
|
|
401
|
-
fqdnTransformation: {
|
|
402
|
-
paths: [...['contact']],
|
|
403
|
-
transformation: _toVeloEntity,
|
|
404
|
-
},
|
|
405
|
-
customTransformation: responseTransformation,
|
|
406
|
-
});
|
|
407
|
-
const payload = toAmbassadorRequest([info, options]);
|
|
408
|
-
const reqOpts = ambassadorWixContactsV4Contact.createContact(payload);
|
|
409
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
410
|
-
try {
|
|
411
|
-
const result = yield httpClient.request(reqOpts);
|
|
412
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
413
|
-
return fromJSON(result.data);
|
|
414
|
-
}
|
|
415
|
-
catch (err) {
|
|
416
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
417
|
-
spreadPathsToArguments: {},
|
|
418
|
-
explicitPathsToArguments: {
|
|
419
|
-
info: '$[0]',
|
|
420
|
-
allowDuplicates: '$[1].allowDuplicates',
|
|
421
|
-
},
|
|
422
|
-
singleArgumentUnchanged: false,
|
|
423
|
-
}, ['info', 'options']);
|
|
424
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
425
|
-
throw transformedError;
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
exports.createContact = createContact;
|
|
430
|
-
/**
|
|
431
|
-
* Updates a contact's properties.
|
|
432
|
-
*
|
|
433
|
-
* The `updateContact()` function returns a Promise that resolves
|
|
434
|
-
* when the specified contact's information is updated.
|
|
435
|
-
*
|
|
436
|
-
* 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.
|
|
437
|
-
*
|
|
438
|
-
* @param contactId - ID of the contact to update.
|
|
439
|
-
* @param info - Contact info.
|
|
440
|
-
* @param revision - Revision number.
|
|
441
|
-
* When updating, include the existing `revision`
|
|
442
|
-
* to prevent conflicting updates.
|
|
443
|
-
* @public
|
|
444
|
-
* @documentationMaturity preview
|
|
445
|
-
* @requiredField contactId
|
|
446
|
-
* @requiredField info
|
|
447
|
-
* @requiredField revision
|
|
448
|
-
* @param options - Contact update options.
|
|
449
|
-
* @permissionScope Manage Contacts
|
|
450
|
-
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
451
|
-
* @permissionScope Manage Members and Contacts - all permissions
|
|
452
|
-
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
453
|
-
* @applicableIdentity APP
|
|
454
|
-
* @returns Updated contact.
|
|
455
|
-
*/
|
|
456
|
-
function updateContact(contactId, info, revision, options) {
|
|
457
|
-
var _a, _b, _c;
|
|
458
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
459
|
-
const requestTransformation = {
|
|
460
|
-
contactId: '$[0]',
|
|
461
|
-
info: '$[1]',
|
|
462
|
-
revision: '$[2]',
|
|
463
|
-
allowDuplicates: '$[3].allowDuplicates',
|
|
464
|
-
};
|
|
465
|
-
const responseTransformation = '$';
|
|
466
|
-
// @ts-ignore
|
|
467
|
-
const { httpClient, sideEffects } = arguments[4];
|
|
468
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
469
|
-
rootSchema: _updateContactRequest,
|
|
470
|
-
depSchemas: {
|
|
471
|
-
_contactAddress,
|
|
472
|
-
_contactAddressesWrapper,
|
|
473
|
-
_contactInfo,
|
|
474
|
-
_contactPicture,
|
|
475
|
-
},
|
|
476
|
-
fqdnTransformation: {
|
|
477
|
-
paths: [],
|
|
478
|
-
transformation: _fromVeloEntity,
|
|
479
|
-
},
|
|
480
|
-
customTransformation: requestTransformation,
|
|
481
|
-
});
|
|
482
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
483
|
-
rootSchema: _updateContactResponse,
|
|
484
|
-
depSchemas: {
|
|
485
|
-
_contact,
|
|
486
|
-
_contactAddress,
|
|
487
|
-
_contactAddressesWrapper,
|
|
488
|
-
_contactInfo,
|
|
489
|
-
_contactPicture,
|
|
490
|
-
_memberInfo,
|
|
491
|
-
_profileInfo,
|
|
492
|
-
},
|
|
493
|
-
fqdnTransformation: {
|
|
494
|
-
paths: [...['contact']],
|
|
495
|
-
transformation: _toVeloEntity,
|
|
496
|
-
},
|
|
497
|
-
customTransformation: responseTransformation,
|
|
498
|
-
});
|
|
499
|
-
const payload = toAmbassadorRequest([contactId, info, revision, options]);
|
|
500
|
-
const reqOpts = ambassadorWixContactsV4Contact.updateContact(payload);
|
|
501
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
502
|
-
try {
|
|
503
|
-
const result = yield httpClient.request(reqOpts);
|
|
504
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
505
|
-
return fromJSON(result.data);
|
|
506
|
-
}
|
|
507
|
-
catch (err) {
|
|
508
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
509
|
-
spreadPathsToArguments: {},
|
|
510
|
-
explicitPathsToArguments: {
|
|
511
|
-
contactId: '$[0]',
|
|
512
|
-
info: '$[1]',
|
|
513
|
-
revision: '$[2]',
|
|
514
|
-
allowDuplicates: '$[3].allowDuplicates',
|
|
515
|
-
},
|
|
516
|
-
singleArgumentUnchanged: false,
|
|
517
|
-
}, ['contactId', 'info', 'revision', 'options']);
|
|
518
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
519
|
-
throw transformedError;
|
|
520
|
-
}
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
exports.updateContact = updateContact;
|
|
524
|
-
/**
|
|
525
|
-
* Merges source contacts into a target contact.
|
|
526
|
-
*
|
|
527
|
-
* Merging contacts has these effects on the target contact:
|
|
528
|
-
*
|
|
529
|
-
* - No target contact data is overwritten or deleted.
|
|
530
|
-
* - Arrays (emails, phones, addresses, and labels) are merged from the source contacts into the target contact.
|
|
531
|
-
* - If merging more than one source contact, the 1st source is given precedence, then the 2nd, and so on.
|
|
532
|
-
*
|
|
533
|
-
* Source contacts are deleted when merging.
|
|
534
|
-
* However, if a source contact is a site member or collaborator,
|
|
535
|
-
* the `mergeContacts()` function fails because site collaborators and members can't be deleted.
|
|
536
|
-
* Site members and collaborators can only be target contacts.
|
|
537
|
-
*
|
|
538
|
-
* 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.
|
|
539
|
-
*
|
|
540
|
-
* @param targetContactId - Target contact ID.
|
|
541
|
-
* @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
|
|
542
|
-
* To prevent conflicting changes,
|
|
543
|
-
* the target contact's current revision must be passed.
|
|
544
|
-
* @public
|
|
545
|
-
* @documentationMaturity preview
|
|
546
|
-
* @requiredField targetContactId
|
|
547
|
-
* @requiredField targetContactRevision
|
|
548
|
-
* @param options - Merge contacts options.
|
|
549
|
-
* @permissionScope Manage Contacts
|
|
550
|
-
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
551
|
-
* @permissionScope Manage Members and Contacts - all permissions
|
|
552
|
-
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
553
|
-
* @applicableIdentity APP
|
|
554
|
-
*/
|
|
555
|
-
function mergeContacts(targetContactId, targetContactRevision, options) {
|
|
556
|
-
var _a, _b, _c;
|
|
557
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
558
|
-
const requestTransformation = {
|
|
559
|
-
targetContactId: '$[0]',
|
|
560
|
-
targetContactRevision: '$[1]',
|
|
561
|
-
sourceContactIds: '$[2].sourceContactIds',
|
|
562
|
-
};
|
|
563
|
-
const responseTransformation = '$';
|
|
564
|
-
// @ts-ignore
|
|
565
|
-
const { httpClient, sideEffects } = arguments[3];
|
|
566
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
567
|
-
rootSchema: _mergeContactsRequest,
|
|
568
|
-
depSchemas: {},
|
|
569
|
-
fqdnTransformation: {
|
|
570
|
-
paths: [],
|
|
571
|
-
transformation: _fromVeloEntity,
|
|
572
|
-
},
|
|
573
|
-
customTransformation: requestTransformation,
|
|
574
|
-
});
|
|
575
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
576
|
-
rootSchema: _mergeContactsResponse,
|
|
577
|
-
depSchemas: {
|
|
578
|
-
_contact,
|
|
579
|
-
_contactAddress,
|
|
580
|
-
_contactAddressesWrapper,
|
|
581
|
-
_contactInfo,
|
|
582
|
-
_contactPicture,
|
|
583
|
-
_memberInfo,
|
|
584
|
-
_profileInfo,
|
|
585
|
-
},
|
|
586
|
-
fqdnTransformation: {
|
|
587
|
-
paths: [...['contact']],
|
|
588
|
-
transformation: _toVeloEntity,
|
|
589
|
-
},
|
|
590
|
-
customTransformation: responseTransformation,
|
|
591
|
-
});
|
|
592
|
-
const payload = toAmbassadorRequest([
|
|
593
|
-
targetContactId,
|
|
594
|
-
targetContactRevision,
|
|
595
|
-
options,
|
|
596
|
-
]);
|
|
597
|
-
const reqOpts = ambassadorWixContactsV4Contact.mergeContacts(payload);
|
|
598
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
599
|
-
try {
|
|
600
|
-
const result = yield httpClient.request(reqOpts);
|
|
601
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
602
|
-
return fromJSON(result.data);
|
|
603
|
-
}
|
|
604
|
-
catch (err) {
|
|
605
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
606
|
-
spreadPathsToArguments: {},
|
|
607
|
-
explicitPathsToArguments: {
|
|
608
|
-
targetContactId: '$[0]',
|
|
609
|
-
targetContactRevision: '$[1]',
|
|
610
|
-
sourceContactIds: '$[2].sourceContactIds',
|
|
611
|
-
},
|
|
612
|
-
singleArgumentUnchanged: false,
|
|
613
|
-
}, ['targetContactId', 'targetContactRevision', 'options']);
|
|
614
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
615
|
-
throw transformedError;
|
|
616
|
-
}
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
exports.mergeContacts = mergeContacts;
|
|
620
|
-
/**
|
|
621
|
-
* Deletes a contact who is not a site member or contributor.
|
|
622
|
-
*
|
|
623
|
-
* The `deleteContact()` function returns a Promise
|
|
624
|
-
* that resolves when the specified contact is deleted.
|
|
625
|
-
*
|
|
626
|
-
* Deleting a contact permanently removes them from your Contact List.
|
|
627
|
-
*
|
|
628
|
-
* If the contact is also a site member,
|
|
629
|
-
* the member must be deleted first,
|
|
630
|
-
* and then the contact can be deleted.
|
|
631
|
-
*
|
|
632
|
-
* @param contactId - ID of the contact to delete.
|
|
633
|
-
* @public
|
|
634
|
-
* @documentationMaturity preview
|
|
635
|
-
* @requiredField contactId
|
|
636
|
-
* @permissionScope Manage Contacts
|
|
637
|
-
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
638
|
-
* @permissionScope Manage Members and Contacts - all permissions
|
|
639
|
-
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
640
|
-
* @applicableIdentity APP
|
|
641
|
-
*/
|
|
642
|
-
function deleteContact(contactId) {
|
|
643
|
-
var _a, _b, _c;
|
|
644
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
645
|
-
const requestTransformation = { contactId: '$[0]' };
|
|
646
|
-
const responseTransformation = '$';
|
|
647
|
-
// @ts-ignore
|
|
648
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
649
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
650
|
-
rootSchema: _deleteContactRequest,
|
|
651
|
-
depSchemas: {},
|
|
652
|
-
fqdnTransformation: {
|
|
653
|
-
paths: [],
|
|
654
|
-
transformation: _fromVeloEntity,
|
|
655
|
-
},
|
|
656
|
-
customTransformation: requestTransformation,
|
|
657
|
-
});
|
|
658
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
659
|
-
rootSchema: _deleteContactResponse,
|
|
660
|
-
depSchemas: {},
|
|
661
|
-
fqdnTransformation: {
|
|
662
|
-
paths: [],
|
|
663
|
-
transformation: _toVeloEntity,
|
|
664
|
-
},
|
|
665
|
-
customTransformation: responseTransformation,
|
|
666
|
-
});
|
|
667
|
-
const payload = toAmbassadorRequest([contactId]);
|
|
668
|
-
const reqOpts = ambassadorWixContactsV4Contact.deleteContact(payload);
|
|
669
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
670
|
-
try {
|
|
671
|
-
const result = yield httpClient.request(reqOpts);
|
|
672
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
673
|
-
}
|
|
674
|
-
catch (err) {
|
|
675
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
676
|
-
spreadPathsToArguments: {},
|
|
677
|
-
explicitPathsToArguments: { contactId: '$[0]' },
|
|
678
|
-
singleArgumentUnchanged: false,
|
|
679
|
-
}, ['contactId']);
|
|
680
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
681
|
-
throw transformedError;
|
|
682
|
-
}
|
|
683
|
-
});
|
|
684
|
-
}
|
|
685
|
-
exports.deleteContact = deleteContact;
|
|
686
|
-
/**
|
|
687
|
-
* Adds labels to a contact.
|
|
688
|
-
*
|
|
689
|
-
*
|
|
690
|
-
* The `labelContact()` function returns a Promise
|
|
691
|
-
* that resolves when the specified labels are added to the contact.
|
|
692
|
-
* - **To create new labels:** Use `findOrCreateLabel()`.
|
|
693
|
-
* - **To find labels:** Use `findOrCreateLabel()`, `getLabel()`, or `queryLabels()`.
|
|
694
|
-
*
|
|
695
|
-
* @param contactId - ID of the contact to add labels to.
|
|
696
|
-
* @param labelKeys - List of label keys to add to the contact.
|
|
697
|
-
*
|
|
698
|
-
* Label keys must exist to be added to the contact.
|
|
699
|
-
* Contact labels can be created with the
|
|
700
|
-
* `findOrCreateLabel()` function. You can use the
|
|
701
|
-
* `queryLabels()` function to view the currently existing labels.
|
|
702
|
-
* @public
|
|
703
|
-
* @documentationMaturity preview
|
|
704
|
-
* @requiredField contactId
|
|
705
|
-
* @requiredField labelKeys
|
|
706
|
-
* @permissionScope Manage Contacts
|
|
707
|
-
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
708
|
-
* @permissionScope Manage Members and Contacts - all permissions
|
|
709
|
-
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
710
|
-
* @applicableIdentity APP
|
|
711
|
-
* @returns Updated contact.
|
|
712
|
-
*/
|
|
713
|
-
function labelContact(contactId, labelKeys) {
|
|
714
|
-
var _a, _b, _c;
|
|
715
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
716
|
-
const requestTransformation = { contactId: '$[0]', labelKeys: '$[1]' };
|
|
717
|
-
const responseTransformation = '$';
|
|
718
|
-
// @ts-ignore
|
|
719
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
720
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
721
|
-
rootSchema: _labelContactRequest,
|
|
722
|
-
depSchemas: {},
|
|
723
|
-
fqdnTransformation: {
|
|
724
|
-
paths: [],
|
|
725
|
-
transformation: _fromVeloEntity,
|
|
726
|
-
},
|
|
727
|
-
customTransformation: requestTransformation,
|
|
728
|
-
});
|
|
729
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
730
|
-
rootSchema: _labelContactResponse,
|
|
731
|
-
depSchemas: {
|
|
732
|
-
_contact,
|
|
733
|
-
_contactAddress,
|
|
734
|
-
_contactAddressesWrapper,
|
|
735
|
-
_contactInfo,
|
|
736
|
-
_contactPicture,
|
|
737
|
-
_memberInfo,
|
|
738
|
-
_profileInfo,
|
|
739
|
-
},
|
|
740
|
-
fqdnTransformation: {
|
|
741
|
-
paths: [...['contact']],
|
|
742
|
-
transformation: _toVeloEntity,
|
|
743
|
-
},
|
|
744
|
-
customTransformation: responseTransformation,
|
|
745
|
-
});
|
|
746
|
-
const payload = toAmbassadorRequest([contactId, labelKeys]);
|
|
747
|
-
const reqOpts = ambassadorWixContactsV4Contact.labelContact(payload);
|
|
748
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
749
|
-
try {
|
|
750
|
-
const result = yield httpClient.request(reqOpts);
|
|
751
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
752
|
-
return fromJSON(result.data);
|
|
753
|
-
}
|
|
754
|
-
catch (err) {
|
|
755
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
756
|
-
spreadPathsToArguments: {},
|
|
757
|
-
explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
|
|
758
|
-
singleArgumentUnchanged: false,
|
|
759
|
-
}, ['contactId', 'labelKeys']);
|
|
760
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
761
|
-
throw transformedError;
|
|
762
|
-
}
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
exports.labelContact = labelContact;
|
|
766
|
-
/**
|
|
767
|
-
* Removes labels from a contact.
|
|
768
|
-
*
|
|
769
|
-
* The `unlabelContact()` function returns a Promise
|
|
770
|
-
* that resolves when the specified labels are removed from the contact.
|
|
771
|
-
*
|
|
772
|
-
* 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.
|
|
773
|
-
*
|
|
774
|
-
* @param contactId - ID of the contact to remove labels from.
|
|
775
|
-
* @param labelKeys - List of label keys to remove from the contact.
|
|
776
|
-
* @public
|
|
777
|
-
* @documentationMaturity preview
|
|
778
|
-
* @requiredField contactId
|
|
779
|
-
* @requiredField labelKeys
|
|
780
|
-
* @permissionScope Manage Contacts
|
|
781
|
-
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
782
|
-
* @permissionScope Manage Members and Contacts - all permissions
|
|
783
|
-
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
784
|
-
* @applicableIdentity APP
|
|
785
|
-
* @returns Updated contact.
|
|
786
|
-
*/
|
|
787
|
-
function unlabelContact(contactId, labelKeys) {
|
|
788
|
-
var _a, _b, _c;
|
|
789
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
790
|
-
const requestTransformation = { contactId: '$[0]', labelKeys: '$[1]' };
|
|
791
|
-
const responseTransformation = '$';
|
|
792
|
-
// @ts-ignore
|
|
793
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
794
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
795
|
-
rootSchema: _unlabelContactRequest,
|
|
796
|
-
depSchemas: {},
|
|
797
|
-
fqdnTransformation: {
|
|
798
|
-
paths: [],
|
|
799
|
-
transformation: _fromVeloEntity,
|
|
800
|
-
},
|
|
801
|
-
customTransformation: requestTransformation,
|
|
802
|
-
});
|
|
803
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
804
|
-
rootSchema: _unlabelContactResponse,
|
|
805
|
-
depSchemas: {
|
|
806
|
-
_contact,
|
|
807
|
-
_contactAddress,
|
|
808
|
-
_contactAddressesWrapper,
|
|
809
|
-
_contactInfo,
|
|
810
|
-
_contactPicture,
|
|
811
|
-
_memberInfo,
|
|
812
|
-
_profileInfo,
|
|
813
|
-
},
|
|
814
|
-
fqdnTransformation: {
|
|
815
|
-
paths: [...['contact']],
|
|
816
|
-
transformation: _toVeloEntity,
|
|
817
|
-
},
|
|
818
|
-
customTransformation: responseTransformation,
|
|
819
|
-
});
|
|
820
|
-
const payload = toAmbassadorRequest([contactId, labelKeys]);
|
|
821
|
-
const reqOpts = ambassadorWixContactsV4Contact.unlabelContact(payload);
|
|
822
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
823
|
-
try {
|
|
824
|
-
const result = yield httpClient.request(reqOpts);
|
|
825
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
826
|
-
return fromJSON(result.data);
|
|
827
|
-
}
|
|
828
|
-
catch (err) {
|
|
829
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
830
|
-
spreadPathsToArguments: {},
|
|
831
|
-
explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
|
|
832
|
-
singleArgumentUnchanged: false,
|
|
833
|
-
}, ['contactId', 'labelKeys']);
|
|
834
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
835
|
-
throw transformedError;
|
|
836
|
-
}
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
|
-
exports.unlabelContact = unlabelContact;
|
|
840
|
-
/**
|
|
841
|
-
* Retrieves a contact.
|
|
842
|
-
*
|
|
843
|
-
*
|
|
844
|
-
* The `getContact()` function returns a Promise
|
|
845
|
-
* that resolves when the contact is found.
|
|
846
|
-
*
|
|
847
|
-
* #### Getting Merged Contacts
|
|
848
|
-
* When a source contact is merged into a target contact, the source contact is deleted. When calling `getContact()` for a merged contact,
|
|
849
|
-
* you can use the source or target contact ID. In both cases, the target contact is returned.
|
|
850
|
-
*
|
|
851
|
-
* This is supported only when calling `getContact()`on merged contacts. Previously deleted source contact IDs can't be passed to any other function.
|
|
852
|
-
*
|
|
853
|
-
* @param _id - ID of the contact to retrieve.
|
|
854
|
-
* @public
|
|
855
|
-
* @documentationMaturity preview
|
|
856
|
-
* @requiredField _id
|
|
857
|
-
* @param options - Get contact options.
|
|
858
|
-
* @permissionScope Read Contacts
|
|
859
|
-
* @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
|
|
860
|
-
* @permissionScope Read Members and Contacts - all read permissions
|
|
861
|
-
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
862
|
-
* @permissionScope Manage Contacts
|
|
863
|
-
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
864
|
-
* @permissionScope Manage Members and Contacts - all permissions
|
|
865
|
-
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
866
|
-
* @applicableIdentity APP
|
|
867
|
-
* @returns The requested contact.
|
|
868
|
-
*/
|
|
869
|
-
function getContact(_id, options) {
|
|
870
|
-
var _a, _b, _c;
|
|
871
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
872
|
-
const requestTransformation = {
|
|
873
|
-
id: '$[0]',
|
|
874
|
-
fields: '$[1].fields',
|
|
875
|
-
fieldsets: '$[1].fieldsets',
|
|
876
|
-
};
|
|
877
|
-
const responseTransformation = '$.contact';
|
|
878
|
-
// @ts-ignore
|
|
879
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
880
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
881
|
-
rootSchema: _getContactRequest,
|
|
882
|
-
depSchemas: {},
|
|
883
|
-
fqdnTransformation: {
|
|
884
|
-
paths: [],
|
|
885
|
-
transformation: _fromVeloEntity,
|
|
886
|
-
},
|
|
887
|
-
customTransformation: requestTransformation,
|
|
888
|
-
});
|
|
889
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
890
|
-
rootSchema: _getContactResponse,
|
|
891
|
-
depSchemas: {
|
|
892
|
-
_contact,
|
|
893
|
-
_contactAddress,
|
|
894
|
-
_contactAddressesWrapper,
|
|
895
|
-
_contactInfo,
|
|
896
|
-
_contactPicture,
|
|
897
|
-
_memberInfo,
|
|
898
|
-
_profileInfo,
|
|
899
|
-
},
|
|
900
|
-
fqdnTransformation: {
|
|
901
|
-
paths: [...['contact']],
|
|
902
|
-
transformation: _toVeloEntity,
|
|
903
|
-
},
|
|
904
|
-
customTransformation: responseTransformation,
|
|
905
|
-
});
|
|
906
|
-
const payload = toAmbassadorRequest([_id, options]);
|
|
907
|
-
const reqOpts = ambassadorWixContactsV4Contact.getContact(payload);
|
|
908
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
909
|
-
try {
|
|
910
|
-
const result = yield httpClient.request(reqOpts);
|
|
911
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
912
|
-
return fromJSON(result.data);
|
|
913
|
-
}
|
|
914
|
-
catch (err) {
|
|
915
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
916
|
-
spreadPathsToArguments: {},
|
|
917
|
-
explicitPathsToArguments: {
|
|
918
|
-
id: '$[0]',
|
|
919
|
-
fields: '$[1].fields',
|
|
920
|
-
fieldsets: '$[1].fieldsets',
|
|
921
|
-
},
|
|
922
|
-
singleArgumentUnchanged: false,
|
|
923
|
-
}, ['_id', 'options']);
|
|
924
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
925
|
-
throw transformedError;
|
|
926
|
-
}
|
|
927
|
-
});
|
|
928
|
-
}
|
|
929
|
-
exports.getContact = getContact;
|
|
930
|
-
//# sourceMappingURL=contacts-v4-contact.universal.js.map
|