@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.
Files changed (79) hide show
  1. package/build/cjs/index.d.ts +4 -1
  2. package/build/cjs/index.js +5 -2
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/src/contacts-v4-contact.http.d.ts +192 -0
  5. package/build/cjs/src/contacts-v4-contact.http.js +522 -0
  6. package/build/cjs/src/contacts-v4-contact.http.js.map +1 -0
  7. package/build/cjs/src/contacts-v4-contact.public.d.ts +14 -0
  8. package/build/cjs/src/contacts-v4-contact.public.js +64 -0
  9. package/build/cjs/src/contacts-v4-contact.public.js.map +1 -0
  10. package/build/cjs/src/contacts-v4-contact.types.d.ts +1310 -0
  11. package/build/cjs/src/contacts-v4-contact.types.js +202 -0
  12. package/build/cjs/src/contacts-v4-contact.types.js.map +1 -0
  13. package/build/cjs/src/contacts-v4-contact.universal.d.ts +1663 -0
  14. package/build/cjs/src/contacts-v4-contact.universal.js +903 -0
  15. package/build/cjs/src/contacts-v4-contact.universal.js.map +1 -0
  16. package/build/cjs/src/contacts-v4-extended-field.http.d.ts +31 -0
  17. package/build/cjs/src/contacts-v4-extended-field.http.js +215 -0
  18. package/build/cjs/src/contacts-v4-extended-field.http.js.map +1 -0
  19. package/build/cjs/src/contacts-v4-extended-field.public.d.ts +12 -0
  20. package/build/cjs/src/contacts-v4-extended-field.public.js +40 -0
  21. package/build/cjs/src/contacts-v4-extended-field.public.js.map +1 -0
  22. package/build/cjs/src/contacts-v4-extended-field.types.d.ts +257 -0
  23. package/build/cjs/src/contacts-v4-extended-field.types.js +23 -0
  24. package/build/cjs/src/contacts-v4-extended-field.types.js.map +1 -0
  25. package/build/cjs/src/contacts-v4-extended-field.universal.d.ts +476 -0
  26. package/build/cjs/src/contacts-v4-extended-field.universal.js +393 -0
  27. package/build/cjs/src/contacts-v4-extended-field.universal.js.map +1 -0
  28. package/build/cjs/src/contacts-v4-label.http.d.ts +31 -0
  29. package/build/cjs/src/contacts-v4-label.http.js +191 -0
  30. package/build/cjs/src/contacts-v4-label.http.js.map +1 -0
  31. package/build/cjs/src/contacts-v4-label.public.d.ts +11 -0
  32. package/build/cjs/src/contacts-v4-label.public.js +33 -0
  33. package/build/cjs/src/contacts-v4-label.public.js.map +1 -0
  34. package/build/cjs/src/contacts-v4-label.types.d.ts +253 -0
  35. package/build/cjs/src/contacts-v4-label.types.js +17 -0
  36. package/build/cjs/src/contacts-v4-label.types.js.map +1 -0
  37. package/build/cjs/src/contacts-v4-label.universal.d.ts +442 -0
  38. package/build/cjs/src/contacts-v4-label.universal.js +326 -0
  39. package/build/cjs/src/contacts-v4-label.universal.js.map +1 -0
  40. package/build/es/index.d.ts +4 -1
  41. package/build/es/index.js +4 -1
  42. package/build/es/index.js.map +1 -1
  43. package/build/es/src/contacts-v4-contact.http.d.ts +192 -0
  44. package/build/es/src/contacts-v4-contact.http.js +512 -0
  45. package/build/es/src/contacts-v4-contact.http.js.map +1 -0
  46. package/build/es/src/contacts-v4-contact.public.d.ts +14 -0
  47. package/build/es/src/contacts-v4-contact.public.js +39 -0
  48. package/build/es/src/contacts-v4-contact.public.js.map +1 -0
  49. package/build/es/src/contacts-v4-contact.types.d.ts +1310 -0
  50. package/build/es/src/contacts-v4-contact.types.js +199 -0
  51. package/build/es/src/contacts-v4-contact.types.js.map +1 -0
  52. package/build/es/src/contacts-v4-contact.universal.d.ts +1663 -0
  53. package/build/es/src/contacts-v4-contact.universal.js +874 -0
  54. package/build/es/src/contacts-v4-contact.universal.js.map +1 -0
  55. package/build/es/src/contacts-v4-extended-field.http.d.ts +31 -0
  56. package/build/es/src/contacts-v4-extended-field.http.js +207 -0
  57. package/build/es/src/contacts-v4-extended-field.http.js.map +1 -0
  58. package/build/es/src/contacts-v4-extended-field.public.d.ts +12 -0
  59. package/build/es/src/contacts-v4-extended-field.public.js +29 -0
  60. package/build/es/src/contacts-v4-extended-field.public.js.map +1 -0
  61. package/build/es/src/contacts-v4-extended-field.types.d.ts +257 -0
  62. package/build/es/src/contacts-v4-extended-field.types.js +20 -0
  63. package/build/es/src/contacts-v4-extended-field.types.js.map +1 -0
  64. package/build/es/src/contacts-v4-extended-field.universal.d.ts +476 -0
  65. package/build/es/src/contacts-v4-extended-field.universal.js +366 -0
  66. package/build/es/src/contacts-v4-extended-field.universal.js.map +1 -0
  67. package/build/es/src/contacts-v4-label.http.d.ts +31 -0
  68. package/build/es/src/contacts-v4-label.http.js +184 -0
  69. package/build/es/src/contacts-v4-label.http.js.map +1 -0
  70. package/build/es/src/contacts-v4-label.public.d.ts +11 -0
  71. package/build/es/src/contacts-v4-label.public.js +24 -0
  72. package/build/es/src/contacts-v4-label.public.js.map +1 -0
  73. package/build/es/src/contacts-v4-label.types.d.ts +253 -0
  74. package/build/es/src/contacts-v4-label.types.js +14 -0
  75. package/build/es/src/contacts-v4-label.types.js.map +1 -0
  76. package/build/es/src/contacts-v4-label.universal.d.ts +442 -0
  77. package/build/es/src/contacts-v4-label.universal.js +300 -0
  78. package/build/es/src/contacts-v4-label.universal.js.map +1 -0
  79. package/package.json +2 -2
@@ -0,0 +1,326 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
+ return new (P || (P = Promise))(function (resolve, reject) {
24
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ Object.defineProperty(exports, "__esModule", { value: true });
31
+ exports.queryLabels = exports.deleteLabel = exports.renameLabel = exports.findOrCreateLabel = exports.SortOrder = exports.LabelType = exports.__debug = void 0;
32
+ const velo_1 = require("@wix/metro-runtime/velo");
33
+ const ambassadorWixContactsV4Label = __importStar(require("./contacts-v4-label.http"));
34
+ // @ts-ignore
35
+ const motion_edm_autogen_query_wrapper_1 = require("@wix/motion-edm-autogen-query-wrapper");
36
+ let __verbose = false;
37
+ function __log(...args) {
38
+ __verbose && console.log(...args);
39
+ }
40
+ function __inspect(obj) {
41
+ return obj;
42
+ }
43
+ exports.__debug = {
44
+ verboseLogging: {
45
+ on: () => (__verbose = true),
46
+ off: () => (__verbose = false),
47
+ },
48
+ };
49
+ const _toVeloEntity = '$';
50
+ const _fromVeloEntity = '$';
51
+ var LabelType;
52
+ (function (LabelType) {
53
+ /** Need UNKNOWN to be able to fetch all labels */
54
+ LabelType["UNKNOWN"] = "UNKNOWN";
55
+ LabelType["SYSTEM"] = "SYSTEM";
56
+ LabelType["USER_DEFINED"] = "USER_DEFINED";
57
+ LabelType["WIX_APP_DEFINED"] = "WIX_APP_DEFINED";
58
+ })(LabelType = exports.LabelType || (exports.LabelType = {}));
59
+ var SortOrder;
60
+ (function (SortOrder) {
61
+ SortOrder["ASC"] = "ASC";
62
+ SortOrder["DESC"] = "DESC";
63
+ })(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
64
+ const _deleteLabelRequest = {};
65
+ const _deleteLabelResponse = {};
66
+ const _findOrCreateLabelRequest = {};
67
+ const _findOrCreateLabelResponse = {};
68
+ const _queryLabelsRequest = {};
69
+ const _queryLabelsResponse = {};
70
+ const _updateLabelRequest = {};
71
+ const _updateLabelResponse = {};
72
+ /**
73
+ * Retrieves a label with a given name, or creates one if it doesn't exist.
74
+ *
75
+ * Successful calls to this endpoint always return a label,
76
+ * which can be passed to subsequent requests.
77
+ *
78
+ * For example, in the Contacts API,
79
+ * [Label Contact](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/label-contact) and
80
+ * [Unlabel Contact](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/unlabel-contact)
81
+ * requests will fail if you include a nonexistant label.
82
+ * To ensure successful calls, you can call this endpoint first,
83
+ * and then use the response in the label and unlabel requests.
84
+ *
85
+ * To find an existing label without potentially creating a new one, use
86
+ * [Get Label](https://dev.wix.com/api/rest/contacts/labels/get-label) or
87
+ * [List Labels](https://dev.wix.com/api/rest/contacts/labels/list-labels).
88
+ *
89
+ * This function is not a universal function and runs only on the backend.
90
+ * @param displayName - Display name to retrieve or create.
91
+ *
92
+ * If an existing label is an exact match
93
+ * for the specified display name,
94
+ * the existing label is returned.
95
+ * If not, a new label is created and returned.
96
+ * @public
97
+ * @documentationMaturity preview
98
+ * @requiredField displayName
99
+ * @returns Label that was found or created.
100
+ */
101
+ function findOrCreateLabel(displayName, options) {
102
+ var _a, _b, _c;
103
+ return __awaiter(this, arguments, void 0, function* () {
104
+ const requestTransformation = {
105
+ displayName: '$[0]',
106
+ language: '$[1].language',
107
+ };
108
+ const responseTransformation = '$';
109
+ // @ts-ignore
110
+ const { httpClient, sideEffects } = arguments[2];
111
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
112
+ rootSchema: _findOrCreateLabelRequest,
113
+ depSchemas: {},
114
+ fqdnTransformation: {
115
+ paths: [],
116
+ transformation: _fromVeloEntity,
117
+ },
118
+ customTransformation: requestTransformation,
119
+ });
120
+ const { fromJSON } = (0, velo_1.serializer)({
121
+ rootSchema: _findOrCreateLabelResponse,
122
+ depSchemas: {},
123
+ fqdnTransformation: {
124
+ paths: [...['label']],
125
+ transformation: _toVeloEntity,
126
+ },
127
+ customTransformation: responseTransformation,
128
+ });
129
+ const payload = toAmbassadorRequest([displayName, options]);
130
+ const reqOpts = ambassadorWixContactsV4Label.findOrCreateLabel(payload);
131
+ __log(`"FindOrCreateLabel" sending request with: ${__inspect(reqOpts)}`);
132
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
133
+ try {
134
+ const result = yield httpClient.request(reqOpts);
135
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
136
+ return fromJSON(result.data);
137
+ }
138
+ catch (err) {
139
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
140
+ 'displayName',
141
+ 'options',
142
+ ]);
143
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
144
+ throw transformedError;
145
+ }
146
+ });
147
+ }
148
+ exports.findOrCreateLabel = findOrCreateLabel;
149
+ /**
150
+ * Updates a label's specified properties.
151
+ *
152
+ * This function is not a universal function and runs only on the backend.
153
+ * @param key - Label key.
154
+ *
155
+ * `key` is generated when the label is created
156
+ * and cannot be modified, even if `displayName` changes.
157
+ * @public
158
+ * @documentationMaturity preview
159
+ * @requiredField key
160
+ * @requiredField options.label.displayName
161
+ * @returns Updated label.
162
+ */
163
+ function renameLabel(key, options) {
164
+ var _a, _b, _c;
165
+ return __awaiter(this, arguments, void 0, function* () {
166
+ const requestTransformation = {
167
+ label: { '*': '$[1].label', key: '$[0]' },
168
+ language: '$[1].language',
169
+ };
170
+ const responseTransformation = '$.label';
171
+ // @ts-ignore
172
+ const { httpClient, sideEffects } = arguments[2];
173
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
174
+ rootSchema: _updateLabelRequest,
175
+ depSchemas: {},
176
+ fqdnTransformation: {
177
+ paths: [...['label']],
178
+ transformation: _fromVeloEntity,
179
+ },
180
+ customTransformation: requestTransformation,
181
+ });
182
+ const { fromJSON } = (0, velo_1.serializer)({
183
+ rootSchema: _updateLabelResponse,
184
+ depSchemas: {},
185
+ fqdnTransformation: {
186
+ paths: [...['label']],
187
+ transformation: _toVeloEntity,
188
+ },
189
+ customTransformation: responseTransformation,
190
+ });
191
+ const payload = toAmbassadorRequest([key, options]);
192
+ const reqOpts = ambassadorWixContactsV4Label.updateLabel(payload);
193
+ __log(`"UpdateLabel" sending request with: ${__inspect(reqOpts)}`);
194
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
195
+ try {
196
+ const result = yield httpClient.request(reqOpts);
197
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
198
+ return fromJSON(result.data);
199
+ }
200
+ catch (err) {
201
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
202
+ 'key',
203
+ 'options',
204
+ ]);
205
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
206
+ throw transformedError;
207
+ }
208
+ });
209
+ }
210
+ exports.renameLabel = renameLabel;
211
+ /**
212
+ * Deletes a label from the site and removes it from contacts it applies to.
213
+ *
214
+ * This function is not a universal function and runs only on the backend.
215
+ * @param key - Label key to delete.
216
+ * @public
217
+ * @documentationMaturity preview
218
+ * @requiredField key
219
+ */
220
+ function deleteLabel(key) {
221
+ var _a, _b, _c;
222
+ return __awaiter(this, arguments, void 0, function* () {
223
+ const requestTransformation = { key: '$[0]' };
224
+ const responseTransformation = '$';
225
+ // @ts-ignore
226
+ const { httpClient, sideEffects } = arguments[1];
227
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
228
+ rootSchema: _deleteLabelRequest,
229
+ depSchemas: {},
230
+ fqdnTransformation: {
231
+ paths: [],
232
+ transformation: _fromVeloEntity,
233
+ },
234
+ customTransformation: requestTransformation,
235
+ });
236
+ const { fromJSON } = (0, velo_1.serializer)({
237
+ rootSchema: _deleteLabelResponse,
238
+ depSchemas: {},
239
+ fqdnTransformation: {
240
+ paths: [],
241
+ transformation: _toVeloEntity,
242
+ },
243
+ customTransformation: responseTransformation,
244
+ });
245
+ const payload = toAmbassadorRequest([key]);
246
+ const reqOpts = ambassadorWixContactsV4Label.deleteLabel(payload);
247
+ __log(`"DeleteLabel" sending request with: ${__inspect(reqOpts)}`);
248
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
249
+ try {
250
+ const result = yield httpClient.request(reqOpts);
251
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
252
+ return fromJSON(result.data);
253
+ }
254
+ catch (err) {
255
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
256
+ 'key',
257
+ ]);
258
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
259
+ throw transformedError;
260
+ }
261
+ });
262
+ }
263
+ exports.deleteLabel = deleteLabel;
264
+ /**
265
+ * Retrieves a list of contact labels. Up to 1000 labels can be returned per request.
266
+ *
267
+ * For a detailed list of supported operations, see [sorting and filtering for labels](https://dev.wix.com/api/rest/contacts/labels/sort-and-filter). To learn how to query labels, see
268
+ * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
269
+ *
270
+ * This function is not a universal function and runs only on the backend.
271
+ * @public
272
+ * @documentationMaturity preview
273
+ */
274
+ function queryLabels(options) {
275
+ const requestTransformation = { '*': '$[1]', query: '$[0]' };
276
+ const responseTransformation = {
277
+ items: '$.labels',
278
+ pagingMetadata: '$.pagingMetadata',
279
+ };
280
+ // @ts-ignore
281
+ const { httpClient, sideEffects } = arguments[1];
282
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
283
+ rootSchema: _queryLabelsRequest,
284
+ depSchemas: {},
285
+ fqdnTransformation: {
286
+ paths: [],
287
+ transformation: _fromVeloEntity,
288
+ },
289
+ customTransformation: requestTransformation,
290
+ });
291
+ const { fromJSON } = (0, velo_1.serializer)({
292
+ rootSchema: _queryLabelsResponse,
293
+ depSchemas: {},
294
+ fqdnTransformation: {
295
+ paths: [...['Array#labels']],
296
+ transformation: _toVeloEntity,
297
+ },
298
+ customTransformation: responseTransformation,
299
+ });
300
+ return (0, motion_edm_autogen_query_wrapper_1.wrapWithQueryBuilder)({
301
+ func: (payload) => __awaiter(this, void 0, void 0, function* () {
302
+ var _a, _b, _c;
303
+ const reqOpts = ambassadorWixContactsV4Label.queryLabels(Object.assign(Object.assign({}, payload), (options !== null && options !== void 0 ? options : {})));
304
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
305
+ try {
306
+ const result = yield httpClient.request(reqOpts);
307
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
308
+ return result;
309
+ }
310
+ catch (err) {
311
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
312
+ throw err;
313
+ }
314
+ }),
315
+ requestTransformer: (...args) => toAmbassadorRequest(args),
316
+ responseTransformer: ({ data }) => fromJSON(data),
317
+ errorTransformer: (err) => {
318
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation);
319
+ throw transformedError;
320
+ },
321
+ pagingMethod: 'OFFSET',
322
+ transformationPaths: (0, velo_1.resolveQueryFieldsTransformationPaths)(_toVeloEntity),
323
+ })({ cursorWithEmptyFilterAndSort: true });
324
+ }
325
+ exports.queryLabels = queryLabels;
326
+ //# sourceMappingURL=contacts-v4-label.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contacts-v4-label.universal.js","sourceRoot":"","sources":["../../../src/contacts-v4-label.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAIiC;AAEjC,uFAAyE;AACzE,aAAa;AACb,4FAA6E;AAE7E,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAEY,QAAA,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AAiD5B,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,kDAAkD;IAClD,gCAAmB,CAAA;IACnB,8BAAiB,CAAA;IACjB,0CAA6B,CAAA;IAC7B,gDAAmC,CAAA;AACrC,CAAC,EANW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAMpB;AA6BD,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB;AAoMD,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,oBAAo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X,WAAW,CAAE,UAAU,+CAAvB,WAAW,CAAgB,CAAC;YAC5B,IAAI;gBACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,+CAAtB,WAAW,EAAc,MAAM,CAAC,CAAC;gBACjC,OAAO,MAAM,CAAC;aACf;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,CAAC;aACX;QACH,CAAC,CAAA;QACD,kBAAkB,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC;QACjE,mBAAmB,EAAE,CAAC,EAAE,IAAI,EAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;QACtD,gBAAgB,EAAE,CAAC,GAAQ,EAAE,EAAE;YAC7B,MAAM,gBAAgB,GAAG,IAAA,qBAAc,EAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC;YAEpE,MAAM,gBAAgB,CAAC;QACzB,CAAC;QACD,YAAY,EAAE,QAAQ;QACtB,mBAAmB,EAAE,IAAA,4CAAqC,EAAC,aAAa,CAAC;KAC1E,CAAC,CAAC,EAAE,4BAA4B,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7C,CAAC;AA5DD,kCA4DC"}
@@ -1 +1,4 @@
1
- export * as contacts from './src/contacts-v4-submit-contact.public';
1
+ export * as contacts from './src/contacts-v4-contact.public';
2
+ export * as extendedFields from './src/contacts-v4-extended-field.public';
3
+ export * as labels from './src/contacts-v4-label.public';
4
+ export * as submittedContact from './src/contacts-v4-submit-contact.public';
package/build/es/index.js CHANGED
@@ -1,2 +1,5 @@
1
- export * as contacts from './src/contacts-v4-submit-contact.public';
1
+ export * as contacts from './src/contacts-v4-contact.public';
2
+ export * as extendedFields from './src/contacts-v4-extended-field.public';
3
+ export * as labels from './src/contacts-v4-label.public';
4
+ export * as submittedContact from './src/contacts-v4-submit-contact.public';
2
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yCAAyC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAC7D,OAAO,KAAK,cAAc,MAAM,yCAAyC,CAAC;AAC1E,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,gBAAgB,MAAM,yCAAyC,CAAC"}
@@ -0,0 +1,192 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ import { CreateContactRequest, CreateContactResponse, DeleteContactRequest, DeleteContactResponse, GetContactRequest, GetContactResponse, LabelContactRequest, LabelContactResponse, MergeContactsRequest, MergeContactsResponse, UnlabelContactRequest, UnlabelContactResponse, UpdateContactRequest, UpdateContactResponse } from './contacts-v4-contact.types';
3
+ /**
4
+ * Creates a new contact.
5
+ *
6
+ *
7
+ * The `createContact()` function returns a Promise
8
+ * that resolves to the new contact when it is created.
9
+ * > **Note:**
10
+ * > This function replaces the deprecated
11
+ * > `wixCrmBackend.createContact()`.
12
+ * > The deprecated function will continue to work, but it will not receive updates.
13
+ * > To keep any existing code compatible with future changes, see the
14
+ * > [migration instructions](wix-crm-backend/createcontact#migration-instructions).
15
+ *
16
+ * The `contactInfo` parameter object must include a name, phone number, or email address.
17
+ * If all 3 of these parameters are missing,
18
+ * the contact won't be created.
19
+ *
20
+ * <!--
21
+ * > **Note:**
22
+ * > Only visitors with
23
+ * > **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)
24
+ * > can create contacts.
25
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
26
+ * -->
27
+ * By default,
28
+ * if the call contains an email already in use by another contact,
29
+ * the new contact won't be created.
30
+ * To override this behavior,
31
+ * set `allowDuplicates` in the `options` object to `true`.
32
+ */
33
+ export declare function createContact(payload: CreateContactRequest): RequestOptionsFactory<CreateContactResponse>;
34
+ /**
35
+ * Updates a contact's properties.
36
+ *
37
+ * The `updateContact()` function returns a Promise that resolves
38
+ * when the specified contact's information is updated.
39
+ *
40
+ * > **Note:**
41
+ * > This function replaces the deprecated
42
+ * > `wixCrmBackend.updateContact()`.
43
+ * > The deprecated function will continue to work, but it will not receive updates.
44
+ * > To keep any existing code compatible with future changes, see the
45
+ * > [migration instructions](wix-crm-backend/updatecontact#migration-instructions).
46
+ *
47
+ * Each time the contact is updated,
48
+ * `revision` increments by 1.
49
+ * The existing `revision` must be included when updating the contact.
50
+ * This ensures you're working with the latest contact information,
51
+ * and it prevents unintended overwrites.
52
+ *
53
+ * <!--
54
+ * > **Note:**
55
+ * > Only visitors with
56
+ * > **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)
57
+ * > can update contacts.
58
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
59
+ * -->
60
+ */
61
+ export declare function updateContact(payload: UpdateContactRequest): RequestOptionsFactory<UpdateContactResponse>;
62
+ /**
63
+ * Merges source contacts into a target contact.
64
+ *
65
+ * Merging contacts has these effects on the target contact:
66
+ *
67
+ * - No target contact data is overwritten or deleted.
68
+ * - Arrays (emails, phones, addresses, and labels) are merged from the source contacts.
69
+ * - If merging more than one source contact, the 1st source is given precedence, then the 2nd, and so on.
70
+ *
71
+ * <blockquote class="important">
72
+ *
73
+ * __Important:__
74
+ * Merges cannot be undone.
75
+ * Use [Preview Merge Contacts](#preview-merge-contacts)
76
+ * to test before merging.
77
+ *
78
+ * </blockquote>
79
+ *
80
+ * Source contacts are deleted when merging.
81
+ * However, if a source contact is a site member or contributor,
82
+ * the merge fails because site contributors and members can't be deleted.
83
+ * Site members and contributors can be target contacts only.
84
+ *
85
+ * After merging,
86
+ * if you call [Get Contact](#get-contact) with a deleted source contact ID,
87
+ * the target contact ID is returned.
88
+ * This is supported when calling Get Contact only.
89
+ * Deleted source contact IDs are not supported on any other endpoint.
90
+ *
91
+ * Merging contacts triggers these webhooks:
92
+ *
93
+ * - [Contact Merged](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-merged-webhook) is triggered.
94
+ * - [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`.
95
+ * - [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`.
96
+ */
97
+ export declare function mergeContacts(payload: MergeContactsRequest): RequestOptionsFactory<MergeContactsResponse>;
98
+ /**
99
+ * Deletes a contact who is not a site member or contributor.
100
+ *
101
+ * The `deleteContact()` function returns a Promise
102
+ * that resolves when the specified contact is deleted.
103
+ * > **Note:**
104
+ * > This function replaces the deprecated
105
+ * > `wixCrmBackend.deleteContact()`.
106
+ * > The deprecated function will continue to work, but it will not receive updates.
107
+ * > To keep any existing code compatible with future changes, see the
108
+ * > [migration instructions](wix-crm-backend/deletecontact#migration-instructions).
109
+ *
110
+ * Deleting a contact permanently removes them from your Contact List.
111
+ *
112
+ * If the contact is also a site member,
113
+ * the member must be deleted first,
114
+ * and then the contact can be deleted.
115
+ *
116
+ * <!--
117
+ * > **Note:**
118
+ * > Only visitors with
119
+ * > **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)
120
+ * > can delete contacts.
121
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
122
+ * -->
123
+ */
124
+ export declare function deleteContact(payload: DeleteContactRequest): RequestOptionsFactory<DeleteContactResponse>;
125
+ /**
126
+ * Adds labels to a contact.
127
+ *
128
+ *
129
+ * The `labelContact()` function returns a Promise
130
+ * that resolves when the specified labels are added to the contact.
131
+ * - **To create new labels:** Use [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel).
132
+ * - **To find labels:** Use [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel), [`getLabel()`](wix-crm-backend/contacts/getlabel), or [`queryLabels()`](wix-crm-backend/contacts/queryLabels).
133
+ *
134
+ * <!--
135
+ * > **Note:**
136
+ * > Only visitors with
137
+ * > **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)
138
+ * > can label contacts.
139
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
140
+ * -->
141
+ */
142
+ export declare function labelContact(payload: LabelContactRequest): RequestOptionsFactory<LabelContactResponse>;
143
+ /**
144
+ * Removes labels from a contact.
145
+ *
146
+ * The `unlabelContact()` function returns a Promise
147
+ * that resolves when the specified labels are removed from the contact.
148
+ *
149
+ * If a label is no longer needed
150
+ * and you want to remove it from all contacts,
151
+ * you can delete it with
152
+ * [`deleteLabel()`](wix-crm-backend/contacts/deletelabel).
153
+ *
154
+ * <!--
155
+ * > **Note:**
156
+ * > Only visitors with
157
+ * > **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)
158
+ * > can unlabel contacts.
159
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
160
+ * -->
161
+ */
162
+ export declare function unlabelContact(payload: UnlabelContactRequest): RequestOptionsFactory<UnlabelContactResponse>;
163
+ /**
164
+ * Retrieves a contact.
165
+ *
166
+ *
167
+ * The `getContact()` function returns a Promise
168
+ * that resolves when the contact is found.
169
+ * #### Getting Merged Contacts
170
+ * When a source contact is merged
171
+ * with a target contact, the source contact is deleted.
172
+ * When calling `getContact()` for a merged contact,
173
+ * you can use the source or target contact ID.
174
+ * In both cases, the target contact is returned.
175
+ *
176
+ * This is supported only when calling `getContact()`,
177
+ * and only for merged contacts.
178
+ * Deleted source contact IDs are not supported on any other function.
179
+ * > **Notes:**
180
+ * >
181
+ * > - This function replaces the deprecated
182
+ * > `wixCrmBackend.getContactById()`.
183
+ * > The deprecated function will continue to work, but it will not receive updates.
184
+ * > To keep any existing code compatible with future changes, see the
185
+ * > [migration instructions](wix-crm-backend/getcontactbyid#migration-instructions).
186
+ * <!-- > - Only visitors with
187
+ * > **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)
188
+ * > can retrieve contacts.
189
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
190
+ * -->
191
+ */
192
+ export declare function getContact(payload: GetContactRequest): RequestOptionsFactory<GetContactResponse>;