@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
|
@@ -2,46 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getContact = exports.unlabelContact = exports.labelContact = exports.deleteContact = exports.mergeContacts = exports.updateContact = exports.createContact = void 0;
|
|
4
4
|
const metro_runtime_1 = require("@wix/metro-runtime");
|
|
5
|
-
const
|
|
5
|
+
const float_1 = require("@wix/sdk-runtime/transformations/float");
|
|
6
|
+
const float_2 = require("@wix/sdk-runtime/transformations/float");
|
|
7
|
+
const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
8
|
+
const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
9
|
+
const field_mask_1 = require("@wix/sdk-runtime/transformations/field-mask");
|
|
10
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
6
11
|
const metro_runtime_2 = require("@wix/metro-runtime");
|
|
7
|
-
const _address = { geocode: '_addressLocation' };
|
|
8
|
-
const _addressLocation = {
|
|
9
|
-
latitude: 'google.protobuf.DoubleValue',
|
|
10
|
-
longitude: 'google.protobuf.DoubleValue',
|
|
11
|
-
};
|
|
12
|
-
const _contact = {
|
|
13
|
-
createdDate: 'google.protobuf.Timestamp',
|
|
14
|
-
updatedDate: 'google.protobuf.Timestamp',
|
|
15
|
-
lastActivity: '_contactActivity',
|
|
16
|
-
picture: '_image',
|
|
17
|
-
info: '_contactInfo',
|
|
18
|
-
};
|
|
19
|
-
const _contactActivity = { activityDate: 'google.protobuf.Timestamp' };
|
|
20
|
-
const _contactAddress = { address: '_address' };
|
|
21
|
-
const _contactAddressesWrapper = { items: '_contactAddress' };
|
|
22
|
-
const _contactInfo = {
|
|
23
|
-
addresses: '_contactAddressesWrapper',
|
|
24
|
-
picture: '_contactPicture',
|
|
25
|
-
};
|
|
26
|
-
const _contactPicture = { image: '_image' };
|
|
27
|
-
const _createContactRequest = { info: '_contactInfo' };
|
|
28
|
-
const _createContactResponse = { contact: '_contact' };
|
|
29
|
-
const _deleteContactRequest = {};
|
|
30
|
-
const _deleteContactResponse = {};
|
|
31
|
-
const _getContactRequest = {};
|
|
32
|
-
const _getContactResponse = { contact: '_contact' };
|
|
33
|
-
const _image = { urlExpirationDate: 'google.protobuf.Timestamp' };
|
|
34
|
-
const _labelContactRequest = {};
|
|
35
|
-
const _labelContactResponse = { contact: '_contact' };
|
|
36
|
-
const _mergeContactsRequest = {};
|
|
37
|
-
const _mergeContactsResponse = { contact: '_contact' };
|
|
38
|
-
const _unlabelContactRequest = {};
|
|
39
|
-
const _unlabelContactResponse = { contact: '_contact' };
|
|
40
|
-
const _updateContactRequest = {
|
|
41
|
-
fieldMask: 'google.protobuf.FieldMask',
|
|
42
|
-
info: '_contactInfo',
|
|
43
|
-
};
|
|
44
|
-
const _updateContactResponse = { contact: '_contact' };
|
|
45
12
|
function resolveComWixpressContactsCoreApiV4ContactsServiceV4Url(opts) {
|
|
46
13
|
const domainToMappings = {
|
|
47
14
|
'api._api_base_domain_': [
|
|
@@ -110,42 +77,24 @@ function resolveComWixpressContactsCoreApiV4ContactsServiceV4Url(opts) {
|
|
|
110
77
|
* If all 3 of these parameters are missing,
|
|
111
78
|
* the contact won't be created.
|
|
112
79
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* > Only visitors with
|
|
116
|
-
* > **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)
|
|
117
|
-
* > can create contacts.
|
|
118
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
119
|
-
* -->
|
|
120
|
-
* By default,
|
|
121
|
-
* if the call contains an email already in use by another contact,
|
|
122
|
-
* the new contact won't be created.
|
|
123
|
-
* To override this behavior,
|
|
124
|
-
* set `allowDuplicates` in the `options` object to `true`.
|
|
80
|
+
* 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`.
|
|
81
|
+
*
|
|
125
82
|
*/
|
|
126
83
|
function createContact(payload) {
|
|
127
|
-
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_createContactRequest, {
|
|
128
|
-
_address,
|
|
129
|
-
_addressLocation,
|
|
130
|
-
_contactAddress,
|
|
131
|
-
_contactAddressesWrapper,
|
|
132
|
-
_contactInfo,
|
|
133
|
-
_contactPicture,
|
|
134
|
-
_image,
|
|
135
|
-
});
|
|
136
|
-
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_createContactResponse, {
|
|
137
|
-
_address,
|
|
138
|
-
_addressLocation,
|
|
139
|
-
_contact,
|
|
140
|
-
_contactActivity,
|
|
141
|
-
_contactAddress,
|
|
142
|
-
_contactAddressesWrapper,
|
|
143
|
-
_contactInfo,
|
|
144
|
-
_contactPicture,
|
|
145
|
-
_image,
|
|
146
|
-
});
|
|
147
84
|
function __createContact({ host }) {
|
|
148
|
-
const serializedData =
|
|
85
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
86
|
+
{
|
|
87
|
+
transformFn: float_1.transformSDKFloatToRESTFloat,
|
|
88
|
+
paths: [
|
|
89
|
+
{ path: 'info.addresses.items.address.geocode.latitude' },
|
|
90
|
+
{ path: 'info.addresses.items.address.geocode.longitude' },
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
95
|
+
paths: [{ path: 'info.picture.image.urlExpirationDate' }],
|
|
96
|
+
},
|
|
97
|
+
]);
|
|
149
98
|
const metadata = {
|
|
150
99
|
entityFqdn: 'wix.contacts.v4.contact',
|
|
151
100
|
method: 'POST',
|
|
@@ -156,11 +105,34 @@ function createContact(payload) {
|
|
|
156
105
|
host,
|
|
157
106
|
}),
|
|
158
107
|
data: serializedData,
|
|
159
|
-
transformResponse:
|
|
108
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
109
|
+
{
|
|
110
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
111
|
+
paths: [
|
|
112
|
+
{ path: 'contact.createdDate' },
|
|
113
|
+
{ path: 'contact.updatedDate' },
|
|
114
|
+
{ path: 'contact.lastActivity.activityDate' },
|
|
115
|
+
{ path: 'contact.lastActivity.date' },
|
|
116
|
+
{ path: 'contact.picture.urlExpirationDate' },
|
|
117
|
+
{ path: 'contact.info.picture.image.urlExpirationDate' },
|
|
118
|
+
{ path: 'contact.memberInfo.identityInfo.signupDate' },
|
|
119
|
+
{ path: 'contact.memberInfo.sessionInfo.lastWebLogin' },
|
|
120
|
+
{ path: 'contact.memberInfo.sessionInfo.lastMobileLogin' },
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
125
|
+
paths: [
|
|
126
|
+
{ path: 'contact.info.addresses.items.address.geocode.latitude' },
|
|
127
|
+
{
|
|
128
|
+
path: 'contact.info.addresses.items.address.geocode.longitude',
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
]),
|
|
160
133
|
};
|
|
161
134
|
return metadata;
|
|
162
135
|
}
|
|
163
|
-
__createContact.fromReq = fromReq;
|
|
164
136
|
return __createContact;
|
|
165
137
|
}
|
|
166
138
|
exports.createContact = createContact;
|
|
@@ -170,43 +142,28 @@ exports.createContact = createContact;
|
|
|
170
142
|
* The `updateContact()` function returns a Promise that resolves
|
|
171
143
|
* when the specified contact's information is updated.
|
|
172
144
|
*
|
|
173
|
-
*
|
|
174
|
-
* `revision` increments by 1.
|
|
175
|
-
* The existing `revision` must be included when updating the contact.
|
|
176
|
-
* This ensures you're working with the latest contact information,
|
|
177
|
-
* and it prevents unintended overwrites.
|
|
145
|
+
* 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.
|
|
178
146
|
*
|
|
179
|
-
* <!--
|
|
180
|
-
* > **Note:**
|
|
181
|
-
* > Only visitors with
|
|
182
|
-
* > **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)
|
|
183
|
-
* > can update contacts.
|
|
184
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
185
|
-
* -->
|
|
186
147
|
*/
|
|
187
148
|
function updateContact(payload) {
|
|
188
|
-
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_updateContactRequest, {
|
|
189
|
-
_address,
|
|
190
|
-
_addressLocation,
|
|
191
|
-
_contactAddress,
|
|
192
|
-
_contactAddressesWrapper,
|
|
193
|
-
_contactInfo,
|
|
194
|
-
_contactPicture,
|
|
195
|
-
_image,
|
|
196
|
-
});
|
|
197
|
-
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_updateContactResponse, {
|
|
198
|
-
_address,
|
|
199
|
-
_addressLocation,
|
|
200
|
-
_contact,
|
|
201
|
-
_contactActivity,
|
|
202
|
-
_contactAddress,
|
|
203
|
-
_contactAddressesWrapper,
|
|
204
|
-
_contactInfo,
|
|
205
|
-
_contactPicture,
|
|
206
|
-
_image,
|
|
207
|
-
});
|
|
208
149
|
function __updateContact({ host }) {
|
|
209
|
-
const serializedData =
|
|
150
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
151
|
+
{
|
|
152
|
+
transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
|
|
153
|
+
paths: [{ path: 'fieldMask' }],
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
transformFn: float_1.transformSDKFloatToRESTFloat,
|
|
157
|
+
paths: [
|
|
158
|
+
{ path: 'info.addresses.items.address.geocode.latitude' },
|
|
159
|
+
{ path: 'info.addresses.items.address.geocode.longitude' },
|
|
160
|
+
],
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
164
|
+
paths: [{ path: 'info.picture.image.urlExpirationDate' }],
|
|
165
|
+
},
|
|
166
|
+
]);
|
|
210
167
|
const metadata = {
|
|
211
168
|
entityFqdn: 'wix.contacts.v4.contact',
|
|
212
169
|
method: 'PATCH',
|
|
@@ -217,11 +174,34 @@ function updateContact(payload) {
|
|
|
217
174
|
host,
|
|
218
175
|
}),
|
|
219
176
|
data: serializedData,
|
|
220
|
-
transformResponse:
|
|
177
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
178
|
+
{
|
|
179
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
180
|
+
paths: [
|
|
181
|
+
{ path: 'contact.createdDate' },
|
|
182
|
+
{ path: 'contact.updatedDate' },
|
|
183
|
+
{ path: 'contact.lastActivity.activityDate' },
|
|
184
|
+
{ path: 'contact.lastActivity.date' },
|
|
185
|
+
{ path: 'contact.picture.urlExpirationDate' },
|
|
186
|
+
{ path: 'contact.info.picture.image.urlExpirationDate' },
|
|
187
|
+
{ path: 'contact.memberInfo.identityInfo.signupDate' },
|
|
188
|
+
{ path: 'contact.memberInfo.sessionInfo.lastWebLogin' },
|
|
189
|
+
{ path: 'contact.memberInfo.sessionInfo.lastMobileLogin' },
|
|
190
|
+
],
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
194
|
+
paths: [
|
|
195
|
+
{ path: 'contact.info.addresses.items.address.geocode.latitude' },
|
|
196
|
+
{
|
|
197
|
+
path: 'contact.info.addresses.items.address.geocode.longitude',
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
]),
|
|
221
202
|
};
|
|
222
203
|
return metadata;
|
|
223
204
|
}
|
|
224
|
-
__updateContact.fromReq = fromReq;
|
|
225
205
|
return __updateContact;
|
|
226
206
|
}
|
|
227
207
|
exports.updateContact = updateContact;
|
|
@@ -231,67 +211,57 @@ exports.updateContact = updateContact;
|
|
|
231
211
|
* Merging contacts has these effects on the target contact:
|
|
232
212
|
*
|
|
233
213
|
* - No target contact data is overwritten or deleted.
|
|
234
|
-
* - Arrays (emails, phones, addresses, and labels) are merged from the source contacts.
|
|
214
|
+
* - Arrays (emails, phones, addresses, and labels) are merged from the source contacts into the target contact.
|
|
235
215
|
* - If merging more than one source contact, the 1st source is given precedence, then the 2nd, and so on.
|
|
236
216
|
*
|
|
237
|
-
* <blockquote class="important">
|
|
238
|
-
*
|
|
239
|
-
* __Important:__
|
|
240
|
-
* Merges cannot be undone.
|
|
241
|
-
* Use [Preview Merge Contacts](#preview-merge-contacts)
|
|
242
|
-
* to test before merging.
|
|
243
|
-
*
|
|
244
|
-
* </blockquote>
|
|
245
|
-
*
|
|
246
217
|
* Source contacts are deleted when merging.
|
|
247
|
-
* However, if a source contact is a site member or
|
|
248
|
-
* the
|
|
249
|
-
* Site members and
|
|
250
|
-
*
|
|
251
|
-
* After merging,
|
|
252
|
-
* if you call [Get Contact](#get-contact) with a deleted source contact ID,
|
|
253
|
-
* the target contact ID is returned.
|
|
254
|
-
* This is supported when calling Get Contact only.
|
|
255
|
-
* Deleted source contact IDs are not supported on any other endpoint.
|
|
218
|
+
* However, if a source contact is a site member or collaborator,
|
|
219
|
+
* the `mergeContacts()` function fails because site collaborators and members can't be deleted.
|
|
220
|
+
* Site members and collaborators can only be target contacts.
|
|
256
221
|
*
|
|
257
|
-
*
|
|
222
|
+
* 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.
|
|
258
223
|
*
|
|
259
|
-
* - Contact Merged is triggered.
|
|
260
|
-
* - Contact Updated is triggered for the target contact. `originatedFrom` is set to `merge`.
|
|
261
|
-
* - Contact Deleted is triggered for each source contact. `originatedFrom` is set to `merge`.
|
|
262
|
-
*
|
|
263
|
-
* This function is not a universal function and runs only on the backend.
|
|
264
224
|
*/
|
|
265
225
|
function mergeContacts(payload) {
|
|
266
|
-
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_mergeContactsRequest, {});
|
|
267
|
-
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_mergeContactsResponse, {
|
|
268
|
-
_address,
|
|
269
|
-
_addressLocation,
|
|
270
|
-
_contact,
|
|
271
|
-
_contactActivity,
|
|
272
|
-
_contactAddress,
|
|
273
|
-
_contactAddressesWrapper,
|
|
274
|
-
_contactInfo,
|
|
275
|
-
_contactPicture,
|
|
276
|
-
_image,
|
|
277
|
-
});
|
|
278
226
|
function __mergeContacts({ host }) {
|
|
279
|
-
const serializedData = toReq(payload);
|
|
280
227
|
const metadata = {
|
|
281
228
|
entityFqdn: 'wix.contacts.v4.contact',
|
|
282
229
|
method: 'POST',
|
|
283
230
|
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.MergeContacts',
|
|
284
231
|
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
285
232
|
protoPath: '/v4/contacts/{targetContactId}/merge',
|
|
286
|
-
data:
|
|
233
|
+
data: payload,
|
|
287
234
|
host,
|
|
288
235
|
}),
|
|
289
|
-
data:
|
|
290
|
-
transformResponse:
|
|
236
|
+
data: payload,
|
|
237
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
238
|
+
{
|
|
239
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
240
|
+
paths: [
|
|
241
|
+
{ path: 'contact.createdDate' },
|
|
242
|
+
{ path: 'contact.updatedDate' },
|
|
243
|
+
{ path: 'contact.lastActivity.activityDate' },
|
|
244
|
+
{ path: 'contact.lastActivity.date' },
|
|
245
|
+
{ path: 'contact.picture.urlExpirationDate' },
|
|
246
|
+
{ path: 'contact.info.picture.image.urlExpirationDate' },
|
|
247
|
+
{ path: 'contact.memberInfo.identityInfo.signupDate' },
|
|
248
|
+
{ path: 'contact.memberInfo.sessionInfo.lastWebLogin' },
|
|
249
|
+
{ path: 'contact.memberInfo.sessionInfo.lastMobileLogin' },
|
|
250
|
+
],
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
254
|
+
paths: [
|
|
255
|
+
{ path: 'contact.info.addresses.items.address.geocode.latitude' },
|
|
256
|
+
{
|
|
257
|
+
path: 'contact.info.addresses.items.address.geocode.longitude',
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
]),
|
|
291
262
|
};
|
|
292
263
|
return metadata;
|
|
293
264
|
}
|
|
294
|
-
__mergeContacts.fromReq = fromReq;
|
|
295
265
|
return __mergeContacts;
|
|
296
266
|
}
|
|
297
267
|
exports.mergeContacts = mergeContacts;
|
|
@@ -307,34 +277,22 @@ exports.mergeContacts = mergeContacts;
|
|
|
307
277
|
* the member must be deleted first,
|
|
308
278
|
* and then the contact can be deleted.
|
|
309
279
|
*
|
|
310
|
-
* <!--
|
|
311
|
-
* > **Note:**
|
|
312
|
-
* > Only visitors with
|
|
313
|
-
* > **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)
|
|
314
|
-
* > can delete contacts.
|
|
315
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
316
|
-
* -->
|
|
317
280
|
*/
|
|
318
281
|
function deleteContact(payload) {
|
|
319
|
-
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_deleteContactRequest, {});
|
|
320
|
-
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_deleteContactResponse, {});
|
|
321
282
|
function __deleteContact({ host }) {
|
|
322
|
-
const serializedData = toReq(payload);
|
|
323
283
|
const metadata = {
|
|
324
284
|
entityFqdn: 'wix.contacts.v4.contact',
|
|
325
285
|
method: 'DELETE',
|
|
326
286
|
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.DeleteContact',
|
|
327
287
|
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
328
288
|
protoPath: '/v4/contacts/{contactId}',
|
|
329
|
-
data:
|
|
289
|
+
data: payload,
|
|
330
290
|
host,
|
|
331
291
|
}),
|
|
332
|
-
params: (0, metro_runtime_1.toURLSearchParams)(
|
|
333
|
-
transformResponse: fromRes,
|
|
292
|
+
params: (0, metro_runtime_1.toURLSearchParams)(payload),
|
|
334
293
|
};
|
|
335
294
|
return metadata;
|
|
336
295
|
}
|
|
337
|
-
__deleteContact.fromReq = fromReq;
|
|
338
296
|
return __deleteContact;
|
|
339
297
|
}
|
|
340
298
|
exports.deleteContact = deleteContact;
|
|
@@ -344,47 +302,50 @@ exports.deleteContact = deleteContact;
|
|
|
344
302
|
*
|
|
345
303
|
* The `labelContact()` function returns a Promise
|
|
346
304
|
* that resolves when the specified labels are added to the contact.
|
|
347
|
-
* - **To create new labels:** Use
|
|
348
|
-
* - **To find labels:** Use
|
|
305
|
+
* - **To create new labels:** Use `findOrCreateLabel()`.
|
|
306
|
+
* - **To find labels:** Use `findOrCreateLabel()`, `getLabel()`, or `queryLabels()`.
|
|
349
307
|
*
|
|
350
|
-
* <!--
|
|
351
|
-
* > **Note:**
|
|
352
|
-
* > Only visitors with
|
|
353
|
-
* > **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)
|
|
354
|
-
* > can label contacts.
|
|
355
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
356
|
-
* -->
|
|
357
308
|
*/
|
|
358
309
|
function labelContact(payload) {
|
|
359
|
-
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_labelContactRequest, {});
|
|
360
|
-
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_labelContactResponse, {
|
|
361
|
-
_address,
|
|
362
|
-
_addressLocation,
|
|
363
|
-
_contact,
|
|
364
|
-
_contactActivity,
|
|
365
|
-
_contactAddress,
|
|
366
|
-
_contactAddressesWrapper,
|
|
367
|
-
_contactInfo,
|
|
368
|
-
_contactPicture,
|
|
369
|
-
_image,
|
|
370
|
-
});
|
|
371
310
|
function __labelContact({ host }) {
|
|
372
|
-
const serializedData = toReq(payload);
|
|
373
311
|
const metadata = {
|
|
374
312
|
entityFqdn: 'wix.contacts.v4.contact',
|
|
375
313
|
method: 'POST',
|
|
376
314
|
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.LabelContact',
|
|
377
315
|
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
378
316
|
protoPath: '/v4/contacts/{contactId}/labels',
|
|
379
|
-
data:
|
|
317
|
+
data: payload,
|
|
380
318
|
host,
|
|
381
319
|
}),
|
|
382
|
-
data:
|
|
383
|
-
transformResponse:
|
|
320
|
+
data: payload,
|
|
321
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
322
|
+
{
|
|
323
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
324
|
+
paths: [
|
|
325
|
+
{ path: 'contact.createdDate' },
|
|
326
|
+
{ path: 'contact.updatedDate' },
|
|
327
|
+
{ path: 'contact.lastActivity.activityDate' },
|
|
328
|
+
{ path: 'contact.lastActivity.date' },
|
|
329
|
+
{ path: 'contact.picture.urlExpirationDate' },
|
|
330
|
+
{ path: 'contact.info.picture.image.urlExpirationDate' },
|
|
331
|
+
{ path: 'contact.memberInfo.identityInfo.signupDate' },
|
|
332
|
+
{ path: 'contact.memberInfo.sessionInfo.lastWebLogin' },
|
|
333
|
+
{ path: 'contact.memberInfo.sessionInfo.lastMobileLogin' },
|
|
334
|
+
],
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
338
|
+
paths: [
|
|
339
|
+
{ path: 'contact.info.addresses.items.address.geocode.latitude' },
|
|
340
|
+
{
|
|
341
|
+
path: 'contact.info.addresses.items.address.geocode.longitude',
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
},
|
|
345
|
+
]),
|
|
384
346
|
};
|
|
385
347
|
return metadata;
|
|
386
348
|
}
|
|
387
|
-
__labelContact.fromReq = fromReq;
|
|
388
349
|
return __labelContact;
|
|
389
350
|
}
|
|
390
351
|
exports.labelContact = labelContact;
|
|
@@ -394,49 +355,49 @@ exports.labelContact = labelContact;
|
|
|
394
355
|
* The `unlabelContact()` function returns a Promise
|
|
395
356
|
* that resolves when the specified labels are removed from the contact.
|
|
396
357
|
*
|
|
397
|
-
*
|
|
398
|
-
* and you want to remove it from all contacts,
|
|
399
|
-
* you can delete it with Labels
|
|
400
|
-
* `deleteLabel()`.
|
|
358
|
+
* 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.
|
|
401
359
|
*
|
|
402
|
-
* <!--
|
|
403
|
-
* > **Note:**
|
|
404
|
-
* > Only visitors with
|
|
405
|
-
* > **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)
|
|
406
|
-
* > can unlabel contacts.
|
|
407
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
408
|
-
* -->
|
|
409
360
|
*/
|
|
410
361
|
function unlabelContact(payload) {
|
|
411
|
-
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_unlabelContactRequest, {});
|
|
412
|
-
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_unlabelContactResponse, {
|
|
413
|
-
_address,
|
|
414
|
-
_addressLocation,
|
|
415
|
-
_contact,
|
|
416
|
-
_contactActivity,
|
|
417
|
-
_contactAddress,
|
|
418
|
-
_contactAddressesWrapper,
|
|
419
|
-
_contactInfo,
|
|
420
|
-
_contactPicture,
|
|
421
|
-
_image,
|
|
422
|
-
});
|
|
423
362
|
function __unlabelContact({ host }) {
|
|
424
|
-
const serializedData = toReq(payload);
|
|
425
363
|
const metadata = {
|
|
426
364
|
entityFqdn: 'wix.contacts.v4.contact',
|
|
427
365
|
method: 'DELETE',
|
|
428
366
|
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.UnlabelContact',
|
|
429
367
|
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
430
368
|
protoPath: '/v4/contacts/{contactId}/labels',
|
|
431
|
-
data:
|
|
369
|
+
data: payload,
|
|
432
370
|
host,
|
|
433
371
|
}),
|
|
434
|
-
params: (0, metro_runtime_1.toURLSearchParams)(
|
|
435
|
-
transformResponse:
|
|
372
|
+
params: (0, metro_runtime_1.toURLSearchParams)(payload),
|
|
373
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
374
|
+
{
|
|
375
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
376
|
+
paths: [
|
|
377
|
+
{ path: 'contact.createdDate' },
|
|
378
|
+
{ path: 'contact.updatedDate' },
|
|
379
|
+
{ path: 'contact.lastActivity.activityDate' },
|
|
380
|
+
{ path: 'contact.lastActivity.date' },
|
|
381
|
+
{ path: 'contact.picture.urlExpirationDate' },
|
|
382
|
+
{ path: 'contact.info.picture.image.urlExpirationDate' },
|
|
383
|
+
{ path: 'contact.memberInfo.identityInfo.signupDate' },
|
|
384
|
+
{ path: 'contact.memberInfo.sessionInfo.lastWebLogin' },
|
|
385
|
+
{ path: 'contact.memberInfo.sessionInfo.lastMobileLogin' },
|
|
386
|
+
],
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
390
|
+
paths: [
|
|
391
|
+
{ path: 'contact.info.addresses.items.address.geocode.latitude' },
|
|
392
|
+
{
|
|
393
|
+
path: 'contact.info.addresses.items.address.geocode.longitude',
|
|
394
|
+
},
|
|
395
|
+
],
|
|
396
|
+
},
|
|
397
|
+
]),
|
|
436
398
|
};
|
|
437
399
|
return metadata;
|
|
438
400
|
}
|
|
439
|
-
__unlabelContact.fromReq = fromReq;
|
|
440
401
|
return __unlabelContact;
|
|
441
402
|
}
|
|
442
403
|
exports.unlabelContact = unlabelContact;
|
|
@@ -446,53 +407,54 @@ exports.unlabelContact = unlabelContact;
|
|
|
446
407
|
*
|
|
447
408
|
* The `getContact()` function returns a Promise
|
|
448
409
|
* that resolves when the contact is found.
|
|
410
|
+
*
|
|
449
411
|
* #### Getting Merged Contacts
|
|
450
|
-
* When a source contact is merged
|
|
451
|
-
*
|
|
452
|
-
* When calling `getContact()` for a merged contact,
|
|
453
|
-
* you can use the source or target contact ID.
|
|
454
|
-
* In both cases, the target contact is returned.
|
|
412
|
+
* When a source contact is merged into a target contact, the source contact is deleted. When calling `getContact()` for a merged contact,
|
|
413
|
+
* you can use the source or target contact ID. In both cases, the target contact is returned.
|
|
455
414
|
*
|
|
456
|
-
* This is supported only when calling `getContact()
|
|
457
|
-
* and only for merged contacts.
|
|
458
|
-
* Deleted source contact IDs are not supported on any other function.
|
|
415
|
+
* This is supported only when calling `getContact()`on merged contacts. Previously deleted source contact IDs can't be passed to any other function.
|
|
459
416
|
*
|
|
460
|
-
* <!-- > - Only visitors with
|
|
461
|
-
* > **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)
|
|
462
|
-
* > can retrieve contacts.
|
|
463
|
-
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
464
|
-
* -->
|
|
465
417
|
*/
|
|
466
418
|
function getContact(payload) {
|
|
467
|
-
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_getContactRequest, {});
|
|
468
|
-
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_getContactResponse, {
|
|
469
|
-
_address,
|
|
470
|
-
_addressLocation,
|
|
471
|
-
_contact,
|
|
472
|
-
_contactActivity,
|
|
473
|
-
_contactAddress,
|
|
474
|
-
_contactAddressesWrapper,
|
|
475
|
-
_contactInfo,
|
|
476
|
-
_contactPicture,
|
|
477
|
-
_image,
|
|
478
|
-
});
|
|
479
419
|
function __getContact({ host }) {
|
|
480
|
-
const serializedData = toReq(payload);
|
|
481
420
|
const metadata = {
|
|
482
421
|
entityFqdn: 'wix.contacts.v4.contact',
|
|
483
422
|
method: 'GET',
|
|
484
423
|
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.GetContact',
|
|
485
424
|
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
486
425
|
protoPath: '/v4/contacts/{id}',
|
|
487
|
-
data:
|
|
426
|
+
data: payload,
|
|
488
427
|
host,
|
|
489
428
|
}),
|
|
490
|
-
params: (0, metro_runtime_1.toURLSearchParams)(
|
|
491
|
-
transformResponse:
|
|
429
|
+
params: (0, metro_runtime_1.toURLSearchParams)(payload),
|
|
430
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
431
|
+
{
|
|
432
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
433
|
+
paths: [
|
|
434
|
+
{ path: 'contact.createdDate' },
|
|
435
|
+
{ path: 'contact.updatedDate' },
|
|
436
|
+
{ path: 'contact.lastActivity.activityDate' },
|
|
437
|
+
{ path: 'contact.lastActivity.date' },
|
|
438
|
+
{ path: 'contact.picture.urlExpirationDate' },
|
|
439
|
+
{ path: 'contact.info.picture.image.urlExpirationDate' },
|
|
440
|
+
{ path: 'contact.memberInfo.identityInfo.signupDate' },
|
|
441
|
+
{ path: 'contact.memberInfo.sessionInfo.lastWebLogin' },
|
|
442
|
+
{ path: 'contact.memberInfo.sessionInfo.lastMobileLogin' },
|
|
443
|
+
],
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
447
|
+
paths: [
|
|
448
|
+
{ path: 'contact.info.addresses.items.address.geocode.latitude' },
|
|
449
|
+
{
|
|
450
|
+
path: 'contact.info.addresses.items.address.geocode.longitude',
|
|
451
|
+
},
|
|
452
|
+
],
|
|
453
|
+
},
|
|
454
|
+
]),
|
|
492
455
|
};
|
|
493
456
|
return metadata;
|
|
494
457
|
}
|
|
495
|
-
__getContact.fromReq = fromReq;
|
|
496
458
|
return __getContact;
|
|
497
459
|
}
|
|
498
460
|
exports.getContact = getContact;
|