@wix/crm 1.0.0 → 1.0.2
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/index.d.ts +4 -1
- package/build/cjs/index.js +5 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.http.d.ts +192 -0
- package/build/cjs/src/contacts-v4-contact.http.js +522 -0
- package/build/cjs/src/contacts-v4-contact.http.js.map +1 -0
- package/build/cjs/src/contacts-v4-contact.public.d.ts +14 -0
- package/build/cjs/src/contacts-v4-contact.public.js +64 -0
- package/build/cjs/src/contacts-v4-contact.public.js.map +1 -0
- package/build/cjs/src/contacts-v4-contact.types.d.ts +1310 -0
- package/build/cjs/src/contacts-v4-contact.types.js +202 -0
- package/build/cjs/src/contacts-v4-contact.types.js.map +1 -0
- package/build/cjs/src/contacts-v4-contact.universal.d.ts +1663 -0
- package/build/cjs/src/contacts-v4-contact.universal.js +903 -0
- package/build/cjs/src/contacts-v4-contact.universal.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.http.d.ts +31 -0
- package/build/cjs/src/contacts-v4-extended-field.http.js +215 -0
- package/build/cjs/src/contacts-v4-extended-field.http.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.public.d.ts +12 -0
- package/build/cjs/src/contacts-v4-extended-field.public.js +40 -0
- package/build/cjs/src/contacts-v4-extended-field.public.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.types.d.ts +257 -0
- package/build/cjs/src/contacts-v4-extended-field.types.js +23 -0
- package/build/cjs/src/contacts-v4-extended-field.types.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.universal.d.ts +476 -0
- package/build/cjs/src/contacts-v4-extended-field.universal.js +393 -0
- package/build/cjs/src/contacts-v4-extended-field.universal.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.http.d.ts +31 -0
- package/build/cjs/src/contacts-v4-label.http.js +191 -0
- package/build/cjs/src/contacts-v4-label.http.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.public.d.ts +11 -0
- package/build/cjs/src/contacts-v4-label.public.js +33 -0
- package/build/cjs/src/contacts-v4-label.public.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.types.d.ts +253 -0
- package/build/cjs/src/contacts-v4-label.types.js +17 -0
- package/build/cjs/src/contacts-v4-label.types.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.universal.d.ts +442 -0
- package/build/cjs/src/contacts-v4-label.universal.js +326 -0
- package/build/cjs/src/contacts-v4-label.universal.js.map +1 -0
- package/build/es/index.d.ts +4 -1
- package/build/es/index.js +4 -1
- package/build/es/index.js.map +1 -1
- package/build/es/src/contacts-v4-contact.http.d.ts +192 -0
- package/build/es/src/contacts-v4-contact.http.js +512 -0
- package/build/es/src/contacts-v4-contact.http.js.map +1 -0
- package/build/es/src/contacts-v4-contact.public.d.ts +14 -0
- package/build/es/src/contacts-v4-contact.public.js +39 -0
- package/build/es/src/contacts-v4-contact.public.js.map +1 -0
- package/build/es/src/contacts-v4-contact.types.d.ts +1310 -0
- package/build/es/src/contacts-v4-contact.types.js +199 -0
- package/build/es/src/contacts-v4-contact.types.js.map +1 -0
- package/build/es/src/contacts-v4-contact.universal.d.ts +1663 -0
- package/build/es/src/contacts-v4-contact.universal.js +874 -0
- package/build/es/src/contacts-v4-contact.universal.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.http.d.ts +31 -0
- package/build/es/src/contacts-v4-extended-field.http.js +207 -0
- package/build/es/src/contacts-v4-extended-field.http.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.public.d.ts +12 -0
- package/build/es/src/contacts-v4-extended-field.public.js +29 -0
- package/build/es/src/contacts-v4-extended-field.public.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.types.d.ts +257 -0
- package/build/es/src/contacts-v4-extended-field.types.js +20 -0
- package/build/es/src/contacts-v4-extended-field.types.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.universal.d.ts +476 -0
- package/build/es/src/contacts-v4-extended-field.universal.js +366 -0
- package/build/es/src/contacts-v4-extended-field.universal.js.map +1 -0
- package/build/es/src/contacts-v4-label.http.d.ts +31 -0
- package/build/es/src/contacts-v4-label.http.js +184 -0
- package/build/es/src/contacts-v4-label.http.js.map +1 -0
- package/build/es/src/contacts-v4-label.public.d.ts +11 -0
- package/build/es/src/contacts-v4-label.public.js +24 -0
- package/build/es/src/contacts-v4-label.public.js.map +1 -0
- package/build/es/src/contacts-v4-label.types.d.ts +253 -0
- package/build/es/src/contacts-v4-label.types.js +14 -0
- package/build/es/src/contacts-v4-label.types.js.map +1 -0
- package/build/es/src/contacts-v4-label.universal.d.ts +442 -0
- package/build/es/src/contacts-v4-label.universal.js +300 -0
- package/build/es/src/contacts-v4-label.universal.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getContact = exports.unlabelContact = exports.labelContact = exports.deleteContact = exports.mergeContacts = exports.updateContact = exports.createContact = void 0;
|
|
4
|
+
const metro_runtime_1 = require("@wix/metro-runtime");
|
|
5
|
+
const ambassador_1 = require("@wix/metro-runtime/ambassador");
|
|
6
|
+
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
|
+
function resolveComWixpressContactsCoreApiV4ContactsServiceV4Url(opts) {
|
|
46
|
+
const domainToMappings = {
|
|
47
|
+
'api._api_base_domain_': [
|
|
48
|
+
{
|
|
49
|
+
srcPath: '/contacts-app',
|
|
50
|
+
destPath: '',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
'www._base_domain_': [
|
|
54
|
+
{
|
|
55
|
+
srcPath: '/_api/crm/v1/contacts',
|
|
56
|
+
destPath: '/v1/contacts',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
srcPath: '/_api/contacts/v4/contacts',
|
|
60
|
+
destPath: '/v4/contacts',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
srcPath: '/_api/contacts/v4/bulk',
|
|
64
|
+
destPath: '/v4/bulk',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
'www.wixapis.com': [
|
|
68
|
+
{
|
|
69
|
+
srcPath: '/crm/v1/contacts',
|
|
70
|
+
destPath: '/v1/contacts',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
srcPath: '/contacts/v4/contacts',
|
|
74
|
+
destPath: '/v4/contacts',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
srcPath: '/contacts/v1/contacts',
|
|
78
|
+
destPath: '/v1/contacts',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
srcPath: '/contacts/v4/bulk',
|
|
82
|
+
destPath: '/v4/bulk',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
'manage._base_domain_': [
|
|
86
|
+
{
|
|
87
|
+
srcPath: '/_api/crm/v1/contacts',
|
|
88
|
+
destPath: '/v1/contacts',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
srcPath: '/_api/contacts/v4/contacts',
|
|
92
|
+
destPath: '/v4/contacts',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
srcPath: '/_api/contacts/v4/bulk',
|
|
96
|
+
destPath: '/v4/bulk',
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
};
|
|
100
|
+
return (0, metro_runtime_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Creates a new contact.
|
|
104
|
+
*
|
|
105
|
+
*
|
|
106
|
+
* The `createContact()` function returns a Promise
|
|
107
|
+
* that resolves to the new contact when it is created.
|
|
108
|
+
* > **Note:**
|
|
109
|
+
* > This function replaces the deprecated
|
|
110
|
+
* > `wixCrmBackend.createContact()`.
|
|
111
|
+
* > The deprecated function will continue to work, but it will not receive updates.
|
|
112
|
+
* > To keep any existing code compatible with future changes, see the
|
|
113
|
+
* > [migration instructions](wix-crm-backend/createcontact#migration-instructions).
|
|
114
|
+
*
|
|
115
|
+
* The `contactInfo` parameter object must include a name, phone number, or email address.
|
|
116
|
+
* If all 3 of these parameters are missing,
|
|
117
|
+
* the contact won't be created.
|
|
118
|
+
*
|
|
119
|
+
* <!--
|
|
120
|
+
* > **Note:**
|
|
121
|
+
* > Only visitors with
|
|
122
|
+
* > **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)
|
|
123
|
+
* > can create contacts.
|
|
124
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
125
|
+
* -->
|
|
126
|
+
* By default,
|
|
127
|
+
* if the call contains an email already in use by another contact,
|
|
128
|
+
* the new contact won't be created.
|
|
129
|
+
* To override this behavior,
|
|
130
|
+
* set `allowDuplicates` in the `options` object to `true`.
|
|
131
|
+
*/
|
|
132
|
+
function createContact(payload) {
|
|
133
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_createContactRequest, {
|
|
134
|
+
_address,
|
|
135
|
+
_addressLocation,
|
|
136
|
+
_contactAddress,
|
|
137
|
+
_contactAddressesWrapper,
|
|
138
|
+
_contactInfo,
|
|
139
|
+
_contactPicture,
|
|
140
|
+
_image,
|
|
141
|
+
});
|
|
142
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_createContactResponse, {
|
|
143
|
+
_address,
|
|
144
|
+
_addressLocation,
|
|
145
|
+
_contact,
|
|
146
|
+
_contactActivity,
|
|
147
|
+
_contactAddress,
|
|
148
|
+
_contactAddressesWrapper,
|
|
149
|
+
_contactInfo,
|
|
150
|
+
_contactPicture,
|
|
151
|
+
_image,
|
|
152
|
+
});
|
|
153
|
+
function __createContact({ host }) {
|
|
154
|
+
const serializedData = toReq(payload);
|
|
155
|
+
const metadata = {
|
|
156
|
+
entityFqdn: 'wix.contacts.v4.contact',
|
|
157
|
+
method: 'POST',
|
|
158
|
+
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.CreateContact',
|
|
159
|
+
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
160
|
+
protoPath: '/v4/contacts',
|
|
161
|
+
data: serializedData,
|
|
162
|
+
host,
|
|
163
|
+
}),
|
|
164
|
+
data: serializedData,
|
|
165
|
+
transformResponse: fromRes,
|
|
166
|
+
};
|
|
167
|
+
return metadata;
|
|
168
|
+
}
|
|
169
|
+
__createContact.fromReq = fromReq;
|
|
170
|
+
return __createContact;
|
|
171
|
+
}
|
|
172
|
+
exports.createContact = createContact;
|
|
173
|
+
/**
|
|
174
|
+
* Updates a contact's properties.
|
|
175
|
+
*
|
|
176
|
+
* The `updateContact()` function returns a Promise that resolves
|
|
177
|
+
* when the specified contact's information is updated.
|
|
178
|
+
*
|
|
179
|
+
* > **Note:**
|
|
180
|
+
* > This function replaces the deprecated
|
|
181
|
+
* > `wixCrmBackend.updateContact()`.
|
|
182
|
+
* > The deprecated function will continue to work, but it will not receive updates.
|
|
183
|
+
* > To keep any existing code compatible with future changes, see the
|
|
184
|
+
* > [migration instructions](wix-crm-backend/updatecontact#migration-instructions).
|
|
185
|
+
*
|
|
186
|
+
* Each time the contact is updated,
|
|
187
|
+
* `revision` increments by 1.
|
|
188
|
+
* The existing `revision` must be included when updating the contact.
|
|
189
|
+
* This ensures you're working with the latest contact information,
|
|
190
|
+
* and it prevents unintended overwrites.
|
|
191
|
+
*
|
|
192
|
+
* <!--
|
|
193
|
+
* > **Note:**
|
|
194
|
+
* > Only visitors with
|
|
195
|
+
* > **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)
|
|
196
|
+
* > can update contacts.
|
|
197
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
198
|
+
* -->
|
|
199
|
+
*/
|
|
200
|
+
function updateContact(payload) {
|
|
201
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_updateContactRequest, {
|
|
202
|
+
_address,
|
|
203
|
+
_addressLocation,
|
|
204
|
+
_contactAddress,
|
|
205
|
+
_contactAddressesWrapper,
|
|
206
|
+
_contactInfo,
|
|
207
|
+
_contactPicture,
|
|
208
|
+
_image,
|
|
209
|
+
});
|
|
210
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_updateContactResponse, {
|
|
211
|
+
_address,
|
|
212
|
+
_addressLocation,
|
|
213
|
+
_contact,
|
|
214
|
+
_contactActivity,
|
|
215
|
+
_contactAddress,
|
|
216
|
+
_contactAddressesWrapper,
|
|
217
|
+
_contactInfo,
|
|
218
|
+
_contactPicture,
|
|
219
|
+
_image,
|
|
220
|
+
});
|
|
221
|
+
function __updateContact({ host }) {
|
|
222
|
+
const serializedData = toReq(payload);
|
|
223
|
+
const metadata = {
|
|
224
|
+
entityFqdn: 'wix.contacts.v4.contact',
|
|
225
|
+
method: 'PATCH',
|
|
226
|
+
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.UpdateContact',
|
|
227
|
+
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
228
|
+
protoPath: '/v4/contacts/{contactId}',
|
|
229
|
+
data: serializedData,
|
|
230
|
+
host,
|
|
231
|
+
}),
|
|
232
|
+
data: serializedData,
|
|
233
|
+
transformResponse: fromRes,
|
|
234
|
+
};
|
|
235
|
+
return metadata;
|
|
236
|
+
}
|
|
237
|
+
__updateContact.fromReq = fromReq;
|
|
238
|
+
return __updateContact;
|
|
239
|
+
}
|
|
240
|
+
exports.updateContact = updateContact;
|
|
241
|
+
/**
|
|
242
|
+
* Merges source contacts into a target contact.
|
|
243
|
+
*
|
|
244
|
+
* Merging contacts has these effects on the target contact:
|
|
245
|
+
*
|
|
246
|
+
* - No target contact data is overwritten or deleted.
|
|
247
|
+
* - Arrays (emails, phones, addresses, and labels) are merged from the source contacts.
|
|
248
|
+
* - If merging more than one source contact, the 1st source is given precedence, then the 2nd, and so on.
|
|
249
|
+
*
|
|
250
|
+
* <blockquote class="important">
|
|
251
|
+
*
|
|
252
|
+
* __Important:__
|
|
253
|
+
* Merges cannot be undone.
|
|
254
|
+
* Use [Preview Merge Contacts](#preview-merge-contacts)
|
|
255
|
+
* to test before merging.
|
|
256
|
+
*
|
|
257
|
+
* </blockquote>
|
|
258
|
+
*
|
|
259
|
+
* Source contacts are deleted when merging.
|
|
260
|
+
* However, if a source contact is a site member or contributor,
|
|
261
|
+
* the merge fails because site contributors and members can't be deleted.
|
|
262
|
+
* Site members and contributors can be target contacts only.
|
|
263
|
+
*
|
|
264
|
+
* After merging,
|
|
265
|
+
* if you call [Get Contact](#get-contact) with a deleted source contact ID,
|
|
266
|
+
* the target contact ID is returned.
|
|
267
|
+
* This is supported when calling Get Contact only.
|
|
268
|
+
* Deleted source contact IDs are not supported on any other endpoint.
|
|
269
|
+
*
|
|
270
|
+
* Merging contacts triggers these webhooks:
|
|
271
|
+
*
|
|
272
|
+
* - [Contact Merged](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-merged-webhook) is triggered.
|
|
273
|
+
* - [Contact Updated](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-updated-webhook) is triggered for the target contact. `originatedFrom` is set to `merge`.
|
|
274
|
+
* - [Contact Deleted](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-deleted-webhook) is triggered for each source contact. `originatedFrom` is set to `merge`.
|
|
275
|
+
*/
|
|
276
|
+
function mergeContacts(payload) {
|
|
277
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_mergeContactsRequest, {});
|
|
278
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_mergeContactsResponse, {
|
|
279
|
+
_address,
|
|
280
|
+
_addressLocation,
|
|
281
|
+
_contact,
|
|
282
|
+
_contactActivity,
|
|
283
|
+
_contactAddress,
|
|
284
|
+
_contactAddressesWrapper,
|
|
285
|
+
_contactInfo,
|
|
286
|
+
_contactPicture,
|
|
287
|
+
_image,
|
|
288
|
+
});
|
|
289
|
+
function __mergeContacts({ host }) {
|
|
290
|
+
const serializedData = toReq(payload);
|
|
291
|
+
const metadata = {
|
|
292
|
+
entityFqdn: 'wix.contacts.v4.contact',
|
|
293
|
+
method: 'POST',
|
|
294
|
+
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.MergeContacts',
|
|
295
|
+
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
296
|
+
protoPath: '/v4/contacts/{targetContactId}/merge',
|
|
297
|
+
data: serializedData,
|
|
298
|
+
host,
|
|
299
|
+
}),
|
|
300
|
+
data: serializedData,
|
|
301
|
+
transformResponse: fromRes,
|
|
302
|
+
};
|
|
303
|
+
return metadata;
|
|
304
|
+
}
|
|
305
|
+
__mergeContacts.fromReq = fromReq;
|
|
306
|
+
return __mergeContacts;
|
|
307
|
+
}
|
|
308
|
+
exports.mergeContacts = mergeContacts;
|
|
309
|
+
/**
|
|
310
|
+
* Deletes a contact who is not a site member or contributor.
|
|
311
|
+
*
|
|
312
|
+
* The `deleteContact()` function returns a Promise
|
|
313
|
+
* that resolves when the specified contact is deleted.
|
|
314
|
+
* > **Note:**
|
|
315
|
+
* > This function replaces the deprecated
|
|
316
|
+
* > `wixCrmBackend.deleteContact()`.
|
|
317
|
+
* > The deprecated function will continue to work, but it will not receive updates.
|
|
318
|
+
* > To keep any existing code compatible with future changes, see the
|
|
319
|
+
* > [migration instructions](wix-crm-backend/deletecontact#migration-instructions).
|
|
320
|
+
*
|
|
321
|
+
* Deleting a contact permanently removes them from your Contact List.
|
|
322
|
+
*
|
|
323
|
+
* If the contact is also a site member,
|
|
324
|
+
* the member must be deleted first,
|
|
325
|
+
* and then the contact can be deleted.
|
|
326
|
+
*
|
|
327
|
+
* <!--
|
|
328
|
+
* > **Note:**
|
|
329
|
+
* > Only visitors with
|
|
330
|
+
* > **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)
|
|
331
|
+
* > can delete contacts.
|
|
332
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
333
|
+
* -->
|
|
334
|
+
*/
|
|
335
|
+
function deleteContact(payload) {
|
|
336
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_deleteContactRequest, {});
|
|
337
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_deleteContactResponse, {});
|
|
338
|
+
function __deleteContact({ host }) {
|
|
339
|
+
const serializedData = toReq(payload);
|
|
340
|
+
const metadata = {
|
|
341
|
+
entityFqdn: 'wix.contacts.v4.contact',
|
|
342
|
+
method: 'DELETE',
|
|
343
|
+
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.DeleteContact',
|
|
344
|
+
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
345
|
+
protoPath: '/v4/contacts/{contactId}',
|
|
346
|
+
data: serializedData,
|
|
347
|
+
host,
|
|
348
|
+
}),
|
|
349
|
+
params: (0, metro_runtime_1.toURLSearchParams)(serializedData),
|
|
350
|
+
transformResponse: fromRes,
|
|
351
|
+
};
|
|
352
|
+
return metadata;
|
|
353
|
+
}
|
|
354
|
+
__deleteContact.fromReq = fromReq;
|
|
355
|
+
return __deleteContact;
|
|
356
|
+
}
|
|
357
|
+
exports.deleteContact = deleteContact;
|
|
358
|
+
/**
|
|
359
|
+
* Adds labels to a contact.
|
|
360
|
+
*
|
|
361
|
+
*
|
|
362
|
+
* The `labelContact()` function returns a Promise
|
|
363
|
+
* that resolves when the specified labels are added to the contact.
|
|
364
|
+
* - **To create new labels:** Use [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel).
|
|
365
|
+
* - **To find labels:** Use [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel), [`getLabel()`](wix-crm-backend/contacts/getlabel), or [`queryLabels()`](wix-crm-backend/contacts/queryLabels).
|
|
366
|
+
*
|
|
367
|
+
* <!--
|
|
368
|
+
* > **Note:**
|
|
369
|
+
* > Only visitors with
|
|
370
|
+
* > **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)
|
|
371
|
+
* > can label contacts.
|
|
372
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
373
|
+
* -->
|
|
374
|
+
*/
|
|
375
|
+
function labelContact(payload) {
|
|
376
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_labelContactRequest, {});
|
|
377
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_labelContactResponse, {
|
|
378
|
+
_address,
|
|
379
|
+
_addressLocation,
|
|
380
|
+
_contact,
|
|
381
|
+
_contactActivity,
|
|
382
|
+
_contactAddress,
|
|
383
|
+
_contactAddressesWrapper,
|
|
384
|
+
_contactInfo,
|
|
385
|
+
_contactPicture,
|
|
386
|
+
_image,
|
|
387
|
+
});
|
|
388
|
+
function __labelContact({ host }) {
|
|
389
|
+
const serializedData = toReq(payload);
|
|
390
|
+
const metadata = {
|
|
391
|
+
entityFqdn: 'wix.contacts.v4.contact',
|
|
392
|
+
method: 'POST',
|
|
393
|
+
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.LabelContact',
|
|
394
|
+
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
395
|
+
protoPath: '/v4/contacts/{contactId}/labels',
|
|
396
|
+
data: serializedData,
|
|
397
|
+
host,
|
|
398
|
+
}),
|
|
399
|
+
data: serializedData,
|
|
400
|
+
transformResponse: fromRes,
|
|
401
|
+
};
|
|
402
|
+
return metadata;
|
|
403
|
+
}
|
|
404
|
+
__labelContact.fromReq = fromReq;
|
|
405
|
+
return __labelContact;
|
|
406
|
+
}
|
|
407
|
+
exports.labelContact = labelContact;
|
|
408
|
+
/**
|
|
409
|
+
* Removes labels from a contact.
|
|
410
|
+
*
|
|
411
|
+
* The `unlabelContact()` function returns a Promise
|
|
412
|
+
* that resolves when the specified labels are removed from the contact.
|
|
413
|
+
*
|
|
414
|
+
* If a label is no longer needed
|
|
415
|
+
* and you want to remove it from all contacts,
|
|
416
|
+
* you can delete it with
|
|
417
|
+
* [`deleteLabel()`](wix-crm-backend/contacts/deletelabel).
|
|
418
|
+
*
|
|
419
|
+
* <!--
|
|
420
|
+
* > **Note:**
|
|
421
|
+
* > Only visitors with
|
|
422
|
+
* > **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)
|
|
423
|
+
* > can unlabel contacts.
|
|
424
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
425
|
+
* -->
|
|
426
|
+
*/
|
|
427
|
+
function unlabelContact(payload) {
|
|
428
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_unlabelContactRequest, {});
|
|
429
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_unlabelContactResponse, {
|
|
430
|
+
_address,
|
|
431
|
+
_addressLocation,
|
|
432
|
+
_contact,
|
|
433
|
+
_contactActivity,
|
|
434
|
+
_contactAddress,
|
|
435
|
+
_contactAddressesWrapper,
|
|
436
|
+
_contactInfo,
|
|
437
|
+
_contactPicture,
|
|
438
|
+
_image,
|
|
439
|
+
});
|
|
440
|
+
function __unlabelContact({ host }) {
|
|
441
|
+
const serializedData = toReq(payload);
|
|
442
|
+
const metadata = {
|
|
443
|
+
entityFqdn: 'wix.contacts.v4.contact',
|
|
444
|
+
method: 'DELETE',
|
|
445
|
+
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.UnlabelContact',
|
|
446
|
+
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
447
|
+
protoPath: '/v4/contacts/{contactId}/labels',
|
|
448
|
+
data: serializedData,
|
|
449
|
+
host,
|
|
450
|
+
}),
|
|
451
|
+
params: (0, metro_runtime_1.toURLSearchParams)(serializedData),
|
|
452
|
+
transformResponse: fromRes,
|
|
453
|
+
};
|
|
454
|
+
return metadata;
|
|
455
|
+
}
|
|
456
|
+
__unlabelContact.fromReq = fromReq;
|
|
457
|
+
return __unlabelContact;
|
|
458
|
+
}
|
|
459
|
+
exports.unlabelContact = unlabelContact;
|
|
460
|
+
/**
|
|
461
|
+
* Retrieves a contact.
|
|
462
|
+
*
|
|
463
|
+
*
|
|
464
|
+
* The `getContact()` function returns a Promise
|
|
465
|
+
* that resolves when the contact is found.
|
|
466
|
+
* #### Getting Merged Contacts
|
|
467
|
+
* When a source contact is merged
|
|
468
|
+
* with a target contact, the source contact is deleted.
|
|
469
|
+
* When calling `getContact()` for a merged contact,
|
|
470
|
+
* you can use the source or target contact ID.
|
|
471
|
+
* In both cases, the target contact is returned.
|
|
472
|
+
*
|
|
473
|
+
* This is supported only when calling `getContact()`,
|
|
474
|
+
* and only for merged contacts.
|
|
475
|
+
* Deleted source contact IDs are not supported on any other function.
|
|
476
|
+
* > **Notes:**
|
|
477
|
+
* >
|
|
478
|
+
* > - This function replaces the deprecated
|
|
479
|
+
* > `wixCrmBackend.getContactById()`.
|
|
480
|
+
* > The deprecated function will continue to work, but it will not receive updates.
|
|
481
|
+
* > To keep any existing code compatible with future changes, see the
|
|
482
|
+
* > [migration instructions](wix-crm-backend/getcontactbyid#migration-instructions).
|
|
483
|
+
* <!-- > - Only visitors with
|
|
484
|
+
* > **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)
|
|
485
|
+
* > can retrieve contacts.
|
|
486
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
487
|
+
* -->
|
|
488
|
+
*/
|
|
489
|
+
function getContact(payload) {
|
|
490
|
+
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_getContactRequest, {});
|
|
491
|
+
const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_getContactResponse, {
|
|
492
|
+
_address,
|
|
493
|
+
_addressLocation,
|
|
494
|
+
_contact,
|
|
495
|
+
_contactActivity,
|
|
496
|
+
_contactAddress,
|
|
497
|
+
_contactAddressesWrapper,
|
|
498
|
+
_contactInfo,
|
|
499
|
+
_contactPicture,
|
|
500
|
+
_image,
|
|
501
|
+
});
|
|
502
|
+
function __getContact({ host }) {
|
|
503
|
+
const serializedData = toReq(payload);
|
|
504
|
+
const metadata = {
|
|
505
|
+
entityFqdn: 'wix.contacts.v4.contact',
|
|
506
|
+
method: 'GET',
|
|
507
|
+
methodFqn: 'com.wixpress.contacts.core.api.v4.ContactsServiceV4.GetContact',
|
|
508
|
+
url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
|
|
509
|
+
protoPath: '/v4/contacts/{id}',
|
|
510
|
+
data: serializedData,
|
|
511
|
+
host,
|
|
512
|
+
}),
|
|
513
|
+
params: (0, metro_runtime_1.toURLSearchParams)(serializedData),
|
|
514
|
+
transformResponse: fromRes,
|
|
515
|
+
};
|
|
516
|
+
return metadata;
|
|
517
|
+
}
|
|
518
|
+
__getContact.fromReq = fromReq;
|
|
519
|
+
return __getContact;
|
|
520
|
+
}
|
|
521
|
+
exports.getContact = getContact;
|
|
522
|
+
//# sourceMappingURL=contacts-v4-contact.http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts-v4-contact.http.js","sourceRoot":"","sources":["../../../src/contacts-v4-contact.http.ts"],"names":[],"mappings":";;;AAAA,sDAAuD;AACvD,8DAA2D;AAC3D,sDAAgD;AAoBhD,MAAM,QAAQ,GAAG,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AACjD,MAAM,gBAAgB,GAAG;IACvB,QAAQ,EAAE,6BAA6B;IACvC,SAAS,EAAE,6BAA6B;CACzC,CAAC;AACF,MAAM,QAAQ,GAAG;IACf,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,2BAA2B;IACxC,YAAY,EAAE,kBAAkB;IAChC,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,cAAc;CACrB,CAAC;AACF,MAAM,gBAAgB,GAAG,EAAE,YAAY,EAAE,2BAA2B,EAAE,CAAC;AACvE,MAAM,eAAe,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAChD,MAAM,wBAAwB,GAAG,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;AAC9D,MAAM,YAAY,GAAG;IACnB,SAAS,EAAE,0BAA0B;IACrC,OAAO,EAAE,iBAAiB;CAC3B,CAAC;AACF,MAAM,eAAe,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC5C,MAAM,qBAAqB,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;AACvD,MAAM,sBAAsB,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACvD,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,mBAAmB,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACpD,MAAM,MAAM,GAAG,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,CAAC;AAClE,MAAM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Y;QACZ,eAAe;QACf,MAAM;KACP,CAAC,CAAC;IAEH,SAAS,YAAY,CAAC,EAAE,IAAI,EAAO;QACjC,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,yBAAyB;YACrC,MAAM,EAAE,KAAY;YACpB,SAAS,EACP,gEAAgE;YAClE,GAAG,EAAE,uDAAuD,CAAC;gBAC3D,SAAS,EAAE,mBAAmB;gBAC9B,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,MAAM,EAAE,IAAA,iCAAiB,EAAC,cAAc,CAAC;YACzC,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;IAE/B,OAAO,YAAY,CAAC;AACtB,CAAC;AAzCD,gCAyCC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HttpClient } from '@wix/sdk-types';
|
|
2
|
+
import { ContactInfo, UpdateContactOptions, CreateContactOptions, GetContactOptions, MergeContactsOptions } from './contacts-v4-contact.universal';
|
|
3
|
+
export declare const __metadata: {
|
|
4
|
+
PACKAGE_NAME: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function createContact(httpClient: HttpClient): (info: ContactInfo, options?: CreateContactOptions | undefined) => Promise<import("./contacts-v4-contact.universal").CreateContactResponse>;
|
|
7
|
+
export declare function updateContact(httpClient: HttpClient): (contactId: string, info: ContactInfo, options: UpdateContactOptions) => Promise<import("./contacts-v4-contact.universal").UpdateContactResponse>;
|
|
8
|
+
export declare function mergeContacts(httpClient: HttpClient): (targetContactId: string, targetContactRevision: number | null, options?: MergeContactsOptions | undefined) => Promise<import("./contacts-v4-contact.universal").MergeContactsResponse>;
|
|
9
|
+
export declare function deleteContact(httpClient: HttpClient): (contactId: string) => Promise<void>;
|
|
10
|
+
export declare function labelContact(httpClient: HttpClient): (contactId: string, labelKeys: string[]) => Promise<import("./contacts-v4-contact.universal").LabelContactResponse>;
|
|
11
|
+
export declare function unlabelContact(httpClient: HttpClient): (contactId: string, labelKeys: string[]) => Promise<import("./contacts-v4-contact.universal").UnlabelContactResponse>;
|
|
12
|
+
export declare function getContact(httpClient: HttpClient): (_id: string, options?: GetContactOptions | undefined) => Promise<import("./contacts-v4-contact.universal").Contact>;
|
|
13
|
+
export { ContactSourceType, ContactActivityType, EmailTag, PhoneTag, AddressTag, SubdivisionType, ImageProvider, SortOrder, ContactFieldSet, ContactsFacetType, Action, UpsertContactResponseAction, GetContactResponseType, SubmitOperation, Mode, } from './contacts-v4-contact.universal';
|
|
14
|
+
export { Contact, ContactSource, ContactActivity, PrimaryContactInfo, ContactInfo, ContactName, ContactEmailsWrapper, ContactEmail, ContactPhonesWrapper, ContactPhone, ContactAddressesWrapper, ContactAddress, Address, AddressStreetOneOf, StreetAddress, AddressLocation, Subdivision, AssigneesWrapper, LabelsWrapper, ExtendedFieldsWrapper, LocationsWrapper, ContactPicture, SegmentsWrapper, EstimateFilterSizeRequest, EstimateFilterSizeResponse, EstimateAudienceSizeRequest, EstimateAudienceSizeResponse, ContactSubmitted, ContactChanged, CreateContactRequest, CreateContactResponse, DuplicateContactExists, UpdateContactRequest, UpdateContactResponse, MergeContactsRequest, MergeContactsResponse, ContactMerged, PreviewMergeContactsRequest, PreviewMergeContactsResponse, DeleteContactRequest, DeleteContactResponse, LabelContactRequest, LabelContactResponse, UnlabelContactRequest, UnlabelContactResponse, LabelAndUnlabelContactRequest, LabelAndUnlabelContactResponse, ListContactsRequest, Sorting, Paging, ListContactsResponse, PagingMetadata, QueryContactsRequest, Query, QueryContactsResponse, ListFacetsRequest, ListFacetsResponse, ContactsFacet, QueryFacetsRequest, QueryFacetsResponse, BulkDeleteContactsRequest, BulkDeleteContactsResponse, BulkUpdateContactsRequest, BulkUpdateContactsResponse, BulkLabelAndUnlabelContactsRequest, BulkLabelAndUnlabelContactsResponse, BulkUpsertContactsRequest, BulkUpsertContactsResponse, Error, Metadata, Item, BulkUpsertContactsResponseMetadata, UpsertContactRequest, UpsertContactResponse, GeneratePictureUploadUrlRequest, GeneratePictureUploadUrlResponse, GetContactRequest, GetContactResponse, SyncSubmitContactRequest, SyncSubmitContactResponse, CountContactsRequest, CountContactsResponse, SearchContactsRequest, Search, SearchPagingMethodOneOf, SearchDetails, CursorPaging, SearchContactsResponse, PagingMetadataV2, Cursors, BulkAddSegmentToContactsRequest, BulkAddSegmentToContactsResponse, ItemMetadata, ApplicationError, BulkActionMetadata, ContactAddedToSegment, BulkRemoveSegmentFromContactsRequest, BulkRemoveSegmentFromContactsResponse, ContactRemovedFromSegment, CreateContactOptions, UpdateContactOptions, MergeContactsOptions, GetContactOptions, } from './contacts-v4-contact.universal';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Mode = exports.SubmitOperation = exports.GetContactResponseType = exports.UpsertContactResponseAction = exports.Action = exports.ContactsFacetType = exports.ContactFieldSet = exports.SortOrder = exports.ImageProvider = exports.SubdivisionType = exports.AddressTag = exports.PhoneTag = exports.EmailTag = exports.ContactActivityType = exports.ContactSourceType = exports.getContact = exports.unlabelContact = exports.labelContact = exports.deleteContact = exports.mergeContacts = exports.updateContact = exports.createContact = exports.__metadata = void 0;
|
|
4
|
+
const contacts_v4_contact_universal_1 = require("./contacts-v4-contact.universal");
|
|
5
|
+
exports.__metadata = { PACKAGE_NAME: '@wix/crm' };
|
|
6
|
+
function createContact(httpClient) {
|
|
7
|
+
return (info, options) => (0, contacts_v4_contact_universal_1.createContact)(info, options,
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
{ httpClient });
|
|
10
|
+
}
|
|
11
|
+
exports.createContact = createContact;
|
|
12
|
+
function updateContact(httpClient) {
|
|
13
|
+
return (contactId, info, options) => (0, contacts_v4_contact_universal_1.updateContact)(contactId, info, options,
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
{ httpClient });
|
|
16
|
+
}
|
|
17
|
+
exports.updateContact = updateContact;
|
|
18
|
+
function mergeContacts(httpClient) {
|
|
19
|
+
return (targetContactId, targetContactRevision, options) => (0, contacts_v4_contact_universal_1.mergeContacts)(targetContactId, targetContactRevision, options,
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
{ httpClient });
|
|
22
|
+
}
|
|
23
|
+
exports.mergeContacts = mergeContacts;
|
|
24
|
+
function deleteContact(httpClient) {
|
|
25
|
+
return (contactId) => (0, contacts_v4_contact_universal_1.deleteContact)(contactId,
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
{ httpClient });
|
|
28
|
+
}
|
|
29
|
+
exports.deleteContact = deleteContact;
|
|
30
|
+
function labelContact(httpClient) {
|
|
31
|
+
return (contactId, labelKeys) => (0, contacts_v4_contact_universal_1.labelContact)(contactId, labelKeys,
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
{ httpClient });
|
|
34
|
+
}
|
|
35
|
+
exports.labelContact = labelContact;
|
|
36
|
+
function unlabelContact(httpClient) {
|
|
37
|
+
return (contactId, labelKeys) => (0, contacts_v4_contact_universal_1.unlabelContact)(contactId, labelKeys,
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
{ httpClient });
|
|
40
|
+
}
|
|
41
|
+
exports.unlabelContact = unlabelContact;
|
|
42
|
+
function getContact(httpClient) {
|
|
43
|
+
return (_id, options) => (0, contacts_v4_contact_universal_1.getContact)(_id, options,
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
{ httpClient });
|
|
46
|
+
}
|
|
47
|
+
exports.getContact = getContact;
|
|
48
|
+
var contacts_v4_contact_universal_2 = require("./contacts-v4-contact.universal");
|
|
49
|
+
Object.defineProperty(exports, "ContactSourceType", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.ContactSourceType; } });
|
|
50
|
+
Object.defineProperty(exports, "ContactActivityType", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.ContactActivityType; } });
|
|
51
|
+
Object.defineProperty(exports, "EmailTag", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.EmailTag; } });
|
|
52
|
+
Object.defineProperty(exports, "PhoneTag", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.PhoneTag; } });
|
|
53
|
+
Object.defineProperty(exports, "AddressTag", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.AddressTag; } });
|
|
54
|
+
Object.defineProperty(exports, "SubdivisionType", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.SubdivisionType; } });
|
|
55
|
+
Object.defineProperty(exports, "ImageProvider", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.ImageProvider; } });
|
|
56
|
+
Object.defineProperty(exports, "SortOrder", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.SortOrder; } });
|
|
57
|
+
Object.defineProperty(exports, "ContactFieldSet", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.ContactFieldSet; } });
|
|
58
|
+
Object.defineProperty(exports, "ContactsFacetType", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.ContactsFacetType; } });
|
|
59
|
+
Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.Action; } });
|
|
60
|
+
Object.defineProperty(exports, "UpsertContactResponseAction", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.UpsertContactResponseAction; } });
|
|
61
|
+
Object.defineProperty(exports, "GetContactResponseType", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.GetContactResponseType; } });
|
|
62
|
+
Object.defineProperty(exports, "SubmitOperation", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.SubmitOperation; } });
|
|
63
|
+
Object.defineProperty(exports, "Mode", { enumerable: true, get: function () { return contacts_v4_contact_universal_2.Mode; } });
|
|
64
|
+
//# sourceMappingURL=contacts-v4-contact.public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts-v4-contact.public.js","sourceRoot":"","sources":["../../../src/contacts-v4-contact.public.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