@wix/contacts
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -508,8 +508,9 @@ export interface Contact { | ||
* Controls whether the call will succeed | ||
* if the new contact information contains an email already used by another contact. | ||
* if the new contact information contains an email or a phone number already used by another contact. | ||
* | ||
* If set to `true`, | ||
* the call will succeed even if an email address is used by another contact. | ||
* the call will succeed even if an email address or phone number is used by another contact. | ||
* If set to `false`, | ||
* the call will fail if an email address is used by another contact. | ||
* the call will fail if the given email address is used by another contact or, | ||
* if the email address is not given and the given phone number is used by another contact. | ||
* | ||
@@ -528,2 +529,3 @@ * Defaults to `false`. | ||
duplicateEmail?: string | null; | ||
duplicatePhone?: string | null; | ||
} | ||
@@ -541,8 +543,9 @@ export interface UpdateContactRequest { | ||
* Controls whether the call will succeed | ||
* if the new contact information contains an email already used by another contact. | ||
* if the new contact information contains an email or a phone number already used by another contact. | ||
* | ||
* If set to `true`, | ||
* the call will succeed even if an email address is used by another contact. | ||
* the call will succeed even if an email address or phone number is used by another contact. | ||
* If set to `false`, | ||
* the call will fail if an email address is used by another contact. | ||
* the call will fail if the given email address is used by another contact or, | ||
* if the email address is not given and the given phone number is used by another contact. | ||
* | ||
@@ -549,0 +552,0 @@ * Defaults to `false`. |
@@ -302,2 +302,3 @@ "use strict"; | ||
function createContact(info, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -310,3 +311,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[2].httpClient; | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -344,5 +345,7 @@ rootSchema: _createContactRequest, | ||
__log(`"CreateContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -354,2 +357,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -379,2 +383,3 @@ } | ||
function updateContact(contactId, revision, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -390,3 +395,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[3].httpClient; | ||
const { httpClient, sideEffects } = arguments[3]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -424,5 +429,7 @@ rootSchema: _updateContactRequest, | ||
__log(`"UpdateContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -435,2 +442,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -484,2 +492,3 @@ } | ||
function mergeContacts(targetContactId, targetContactRevision, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -493,3 +502,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[3].httpClient; | ||
const { httpClient, sideEffects } = arguments[3]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -526,5 +535,7 @@ rootSchema: _mergeContactsRequest, | ||
__log(`"MergeContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -537,2 +548,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -556,2 +568,3 @@ } | ||
function previewMergeContacts(targetContactId, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -564,3 +577,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[2].httpClient; | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -593,5 +606,7 @@ rootSchema: _previewMergeContactsRequest, | ||
__log(`"PreviewMergeContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -603,2 +618,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -623,2 +639,3 @@ } | ||
function deleteContact(contactId) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -628,3 +645,3 @@ const requestTransformation = { contactId: '$[0]' }; | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -651,5 +668,7 @@ rootSchema: _deleteContactRequest, | ||
__log(`"DeleteContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -660,2 +679,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -685,2 +705,3 @@ } | ||
function labelContact(contactId, labelKeys) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -690,3 +711,3 @@ const requestTransformation = { contactId: '$[0]', labelKeys: '$[1]' }; | ||
// @ts-ignore | ||
const httpClient = arguments[2].httpClient; | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -719,5 +740,7 @@ rootSchema: _labelContactRequest, | ||
__log(`"LabelContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -729,2 +752,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -751,2 +775,3 @@ } | ||
function unlabelContact(contactId, labelKeys) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -756,3 +781,3 @@ const requestTransformation = { contactId: '$[0]', labelKeys: '$[1]' }; | ||
// @ts-ignore | ||
const httpClient = arguments[2].httpClient; | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -785,5 +810,7 @@ rootSchema: _unlabelContactRequest, | ||
__log(`"UnlabelContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -795,2 +822,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -807,2 +835,3 @@ } | ||
function listContacts(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -817,3 +846,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -846,5 +875,7 @@ rootSchema: _listContactsRequest, | ||
__log(`"ListContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -855,2 +886,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -876,2 +908,3 @@ } | ||
function queryContacts(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -881,3 +914,3 @@ const requestTransformation = { search: '$[0].search', query: '$[0].query' }; | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -910,5 +943,7 @@ rootSchema: _queryContactsRequest, | ||
__log(`"QueryContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -919,2 +954,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -933,2 +969,3 @@ } | ||
function listFacets(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -941,3 +978,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -964,5 +1001,7 @@ rootSchema: _listFacetsRequest, | ||
__log(`"ListFacets" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -973,2 +1012,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -987,2 +1027,3 @@ } | ||
function queryFacets(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -996,3 +1037,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -1019,5 +1060,7 @@ rootSchema: _queryFacetsRequest, | ||
__log(`"QueryFacets" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -1028,2 +1071,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -1048,2 +1092,3 @@ } | ||
function bulkDeleteContacts(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -1056,3 +1101,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -1079,5 +1124,7 @@ rootSchema: _bulkDeleteContactsRequest, | ||
__log(`"BulkDeleteContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -1088,2 +1135,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -1110,2 +1158,3 @@ } | ||
function bulkUpdateContacts(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -1119,3 +1168,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -1147,5 +1196,7 @@ rootSchema: _bulkUpdateContactsRequest, | ||
__log(`"BulkUpdateContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -1156,2 +1207,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -1177,2 +1229,3 @@ } | ||
function bulkLabelAndUnlabelContacts(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -1187,3 +1240,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -1210,5 +1263,7 @@ rootSchema: _bulkLabelAndUnlabelContactsRequest, | ||
__log(`"BulkLabelAndUnlabelContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -1219,2 +1274,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -1245,2 +1301,3 @@ } | ||
function getContact(_id, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -1254,3 +1311,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[2].httpClient; | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const { toAmbassadorRequest } = velo_1.serializer({ | ||
@@ -1283,5 +1340,7 @@ rootSchema: _getContactRequest, | ||
__log(`"GetContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -1293,2 +1352,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -1295,0 +1355,0 @@ } |
@@ -508,8 +508,9 @@ export interface Contact { | ||
* Controls whether the call will succeed | ||
* if the new contact information contains an email already used by another contact. | ||
* if the new contact information contains an email or a phone number already used by another contact. | ||
* | ||
* If set to `true`, | ||
* the call will succeed even if an email address is used by another contact. | ||
* the call will succeed even if an email address or phone number is used by another contact. | ||
* If set to `false`, | ||
* the call will fail if an email address is used by another contact. | ||
* the call will fail if the given email address is used by another contact or, | ||
* if the email address is not given and the given phone number is used by another contact. | ||
* | ||
@@ -528,2 +529,3 @@ * Defaults to `false`. | ||
duplicateEmail?: string | null; | ||
duplicatePhone?: string | null; | ||
} | ||
@@ -541,8 +543,9 @@ export interface UpdateContactRequest { | ||
* Controls whether the call will succeed | ||
* if the new contact information contains an email already used by another contact. | ||
* if the new contact information contains an email or a phone number already used by another contact. | ||
* | ||
* If set to `true`, | ||
* the call will succeed even if an email address is used by another contact. | ||
* the call will succeed even if an email address or phone number is used by another contact. | ||
* If set to `false`, | ||
* the call will fail if an email address is used by another contact. | ||
* the call will fail if the given email address is used by another contact or, | ||
* if the email address is not given and the given phone number is used by another contact. | ||
* | ||
@@ -549,0 +552,0 @@ * Defaults to `false`. |
@@ -280,2 +280,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
export function createContact(info, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -288,3 +289,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[2].httpClient; | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -322,5 +323,7 @@ rootSchema: _createContactRequest, | ||
__log(`"CreateContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -332,2 +335,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -356,2 +360,3 @@ } | ||
export function updateContact(contactId, revision, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -367,3 +372,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[3].httpClient; | ||
const { httpClient, sideEffects } = arguments[3]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -401,5 +406,7 @@ rootSchema: _updateContactRequest, | ||
__log(`"UpdateContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -412,2 +419,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -460,2 +468,3 @@ } | ||
export function mergeContacts(targetContactId, targetContactRevision, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -469,3 +478,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[3].httpClient; | ||
const { httpClient, sideEffects } = arguments[3]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -502,5 +511,7 @@ rootSchema: _mergeContactsRequest, | ||
__log(`"MergeContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -513,2 +524,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -531,2 +543,3 @@ } | ||
export function previewMergeContacts(targetContactId, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -539,3 +552,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[2].httpClient; | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -568,5 +581,7 @@ rootSchema: _previewMergeContactsRequest, | ||
__log(`"PreviewMergeContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -578,2 +593,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -597,2 +613,3 @@ } | ||
export function deleteContact(contactId) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -602,3 +619,3 @@ const requestTransformation = { contactId: '$[0]' }; | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -625,5 +642,7 @@ rootSchema: _deleteContactRequest, | ||
__log(`"DeleteContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -634,2 +653,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -658,2 +678,3 @@ } | ||
export function labelContact(contactId, labelKeys) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -663,3 +684,3 @@ const requestTransformation = { contactId: '$[0]', labelKeys: '$[1]' }; | ||
// @ts-ignore | ||
const httpClient = arguments[2].httpClient; | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -692,5 +713,7 @@ rootSchema: _labelContactRequest, | ||
__log(`"LabelContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -702,2 +725,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -723,2 +747,3 @@ } | ||
export function unlabelContact(contactId, labelKeys) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -728,3 +753,3 @@ const requestTransformation = { contactId: '$[0]', labelKeys: '$[1]' }; | ||
// @ts-ignore | ||
const httpClient = arguments[2].httpClient; | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -757,5 +782,7 @@ rootSchema: _unlabelContactRequest, | ||
__log(`"UnlabelContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -767,2 +794,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -778,2 +806,3 @@ } | ||
export function listContacts(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -788,3 +817,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -817,5 +846,7 @@ rootSchema: _listContactsRequest, | ||
__log(`"ListContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -826,2 +857,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -846,2 +878,3 @@ } | ||
export function queryContacts(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -851,3 +884,3 @@ const requestTransformation = { search: '$[0].search', query: '$[0].query' }; | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -880,5 +913,7 @@ rootSchema: _queryContactsRequest, | ||
__log(`"QueryContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -889,2 +924,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -902,2 +938,3 @@ } | ||
export function listFacets(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -910,3 +947,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -933,5 +970,7 @@ rootSchema: _listFacetsRequest, | ||
__log(`"ListFacets" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -942,2 +981,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -955,2 +995,3 @@ } | ||
export function queryFacets(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -964,3 +1005,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -987,5 +1028,7 @@ rootSchema: _queryFacetsRequest, | ||
__log(`"QueryFacets" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -996,2 +1039,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -1015,2 +1059,3 @@ } | ||
export function bulkDeleteContacts(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -1023,3 +1068,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -1046,5 +1091,7 @@ rootSchema: _bulkDeleteContactsRequest, | ||
__log(`"BulkDeleteContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -1055,2 +1102,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -1076,2 +1124,3 @@ } | ||
export function bulkUpdateContacts(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -1085,3 +1134,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -1113,5 +1162,7 @@ rootSchema: _bulkUpdateContactsRequest, | ||
__log(`"BulkUpdateContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -1122,2 +1173,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -1142,2 +1194,3 @@ } | ||
export function bulkLabelAndUnlabelContacts(options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -1152,3 +1205,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[1].httpClient; | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -1175,5 +1228,7 @@ rootSchema: _bulkLabelAndUnlabelContactsRequest, | ||
__log(`"BulkLabelAndUnlabelContacts" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -1184,2 +1239,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -1209,2 +1265,3 @@ } | ||
export function getContact(_id, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, arguments, void 0, function* () { | ||
@@ -1218,3 +1275,3 @@ const requestTransformation = { | ||
// @ts-ignore | ||
const httpClient = arguments[2].httpClient; | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const { toAmbassadorRequest } = serializer({ | ||
@@ -1247,5 +1304,7 @@ rootSchema: _getContactRequest, | ||
__log(`"GetContact" sending request with: ${__inspect(reqOpts)}`); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const { data } = yield httpClient.request(reqOpts); | ||
return fromJSON(data); | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return fromJSON(result.data); | ||
} | ||
@@ -1257,2 +1316,3 @@ catch (err) { | ||
]); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
@@ -1259,0 +1319,0 @@ } |
{ | ||
"name": "@wix/contacts", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"publishConfig": { | ||
@@ -36,3 +36,3 @@ "registry": "https://registry.npmjs.org/", | ||
}, | ||
"falconPackageHash": "53cac30a239bb1c6e0df3873a9fc8a15ccf242f8298a521f786a7906" | ||
"falconPackageHash": "adb1050d4fbecd4e6f369f0e9d0b175d7ae34cb4d39bfd460d329589" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
541272
11122