@wix/auto_sdk_crm_contacts 1.0.388 → 1.0.389

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 (29) hide show
  1. package/build/cjs/index.d.ts +23 -9
  2. package/build/cjs/index.js +1 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/{contacts-v4-contact-contacts.universal-B8Y8hXy8.d.ts → index.typings.d.ts} +470 -1
  5. package/build/cjs/index.typings.js +1126 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +2 -1
  8. package/build/es/index.d.mts +23 -9
  9. package/build/es/index.mjs +1 -0
  10. package/build/es/index.mjs.map +1 -1
  11. package/build/es/{contacts-v4-contact-contacts.universal-B8Y8hXy8.d.mts → index.typings.d.mts} +470 -1
  12. package/build/es/index.typings.mjs +1073 -0
  13. package/build/es/index.typings.mjs.map +1 -0
  14. package/build/es/meta.d.mts +2 -1
  15. package/build/internal/cjs/index.d.ts +23 -9
  16. package/build/internal/cjs/index.js +1 -0
  17. package/build/internal/cjs/index.js.map +1 -1
  18. package/build/internal/cjs/{contacts-v4-contact-contacts.universal-GFgRnaQp.d.ts → index.typings.d.ts} +470 -1
  19. package/build/internal/cjs/index.typings.js +1126 -0
  20. package/build/internal/cjs/index.typings.js.map +1 -0
  21. package/build/internal/cjs/meta.d.ts +2 -1
  22. package/build/internal/es/index.d.mts +23 -9
  23. package/build/internal/es/index.mjs +1 -0
  24. package/build/internal/es/index.mjs.map +1 -1
  25. package/build/internal/es/{contacts-v4-contact-contacts.universal-GFgRnaQp.d.mts → index.typings.d.mts} +470 -1
  26. package/build/internal/es/index.typings.mjs +1073 -0
  27. package/build/internal/es/index.typings.mjs.map +1 -0
  28. package/build/internal/es/meta.d.mts +2 -1
  29. package/package.json +2 -2
@@ -0,0 +1,1126 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.typings.ts
21
+ var index_typings_exports = {};
22
+ __export(index_typings_exports, {
23
+ Action: () => Action,
24
+ AddressTag: () => AddressTag,
25
+ ContactActivityType: () => ContactActivityType,
26
+ ContactFieldSet: () => ContactFieldSet,
27
+ ContactSourceType: () => ContactSourceType,
28
+ ContactsFacetType: () => ContactsFacetType,
29
+ EmailDeliverabilityStatus: () => EmailDeliverabilityStatus,
30
+ EmailTag: () => EmailTag,
31
+ GetContactResponseType: () => GetContactResponseType,
32
+ ImageProvider: () => ImageProvider,
33
+ MemberStatus: () => MemberStatus,
34
+ Mode: () => Mode,
35
+ PhoneDeliverabilityStatus: () => PhoneDeliverabilityStatus,
36
+ PhoneTag: () => PhoneTag,
37
+ PrivacyStatus: () => PrivacyStatus,
38
+ Role: () => Role,
39
+ SortOrder: () => SortOrder,
40
+ SubdivisionType: () => SubdivisionType,
41
+ SubmitOperation: () => SubmitOperation,
42
+ SubscriptionStatus: () => SubscriptionStatus,
43
+ UpsertContactResponseAction: () => UpsertContactResponseAction,
44
+ WebhookIdentityType: () => WebhookIdentityType,
45
+ createContact: () => createContact2,
46
+ deleteContact: () => deleteContact2,
47
+ getContact: () => getContact2,
48
+ labelContact: () => labelContact2,
49
+ mergeContacts: () => mergeContacts2,
50
+ queryContacts: () => queryContacts2,
51
+ unlabelContact: () => unlabelContact2,
52
+ updateContact: () => updateContact2
53
+ });
54
+ module.exports = __toCommonJS(index_typings_exports);
55
+
56
+ // src/contacts-v4-contact-contacts.universal.ts
57
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
58
+ var import_query_builder = require("@wix/sdk-runtime/query-builder");
59
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
60
+
61
+ // src/contacts-v4-contact-contacts.http.ts
62
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
63
+ var import_float = require("@wix/sdk-runtime/transformations/float");
64
+ var import_float2 = require("@wix/sdk-runtime/transformations/float");
65
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
66
+ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
67
+ var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
68
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
69
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
70
+ function resolveComWixpressContactsCoreApiV4ContactsServiceV4Url(opts) {
71
+ const domainToMappings = {
72
+ "www._base_domain_": [
73
+ {
74
+ srcPath: "/_api/contacts/v4/contacts",
75
+ destPath: "/v4/contacts"
76
+ },
77
+ {
78
+ srcPath: "/_api/contacts/v4/bulk",
79
+ destPath: "/v4/bulk"
80
+ }
81
+ ],
82
+ "www.wixapis.com": [
83
+ {
84
+ srcPath: "/contacts/v4/contacts",
85
+ destPath: "/v4/contacts"
86
+ },
87
+ {
88
+ srcPath: "/contacts/v4/bulk",
89
+ destPath: "/v4/bulk"
90
+ }
91
+ ],
92
+ "manage._base_domain_": [
93
+ {
94
+ srcPath: "/_api/contacts/v4/contacts",
95
+ destPath: "/v4/contacts"
96
+ },
97
+ {
98
+ srcPath: "/_api/contacts/v4/bulk",
99
+ destPath: "/v4/bulk"
100
+ }
101
+ ],
102
+ "manage.nownia.com": [
103
+ {
104
+ srcPath: "/_api/contacts/v4/contacts",
105
+ destPath: "/v4/contacts"
106
+ },
107
+ {
108
+ srcPath: "/_api/contacts/v4/bulk",
109
+ destPath: "/v4/bulk"
110
+ }
111
+ ],
112
+ _: [
113
+ {
114
+ srcPath: "/_api/contacts/v4/bulk",
115
+ destPath: "/v4/bulk"
116
+ },
117
+ {
118
+ srcPath: "/_api/contacts/v4/contacts",
119
+ destPath: "/v4/contacts"
120
+ }
121
+ ],
122
+ "*.dev.wix-code.com": [
123
+ {
124
+ srcPath: "/_api/contacts/v4/bulk",
125
+ destPath: "/v4/bulk"
126
+ },
127
+ {
128
+ srcPath: "/_api/contacts/v4/contacts",
129
+ destPath: "/v4/contacts"
130
+ }
131
+ ]
132
+ };
133
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
134
+ }
135
+ var PACKAGE_NAME = "@wix/auto_sdk_crm_contacts";
136
+ function createContact(payload) {
137
+ function __createContact({ host }) {
138
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
139
+ {
140
+ transformFn: import_float.transformSDKFloatToRESTFloat,
141
+ paths: [
142
+ { path: "info.addresses.items.address.geocode.latitude" },
143
+ { path: "info.addresses.items.address.geocode.longitude" }
144
+ ]
145
+ },
146
+ {
147
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
148
+ paths: [{ path: "info.picture.image.urlExpirationDate" }]
149
+ }
150
+ ]);
151
+ const metadata = {
152
+ entityFqdn: "wix.contacts.v4.contact",
153
+ method: "POST",
154
+ methodFqn: "com.wixpress.contacts.core.api.v4.ContactsServiceV4.CreateContact",
155
+ packageName: PACKAGE_NAME,
156
+ url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
157
+ protoPath: "/v4/contacts",
158
+ data: serializedData,
159
+ host
160
+ }),
161
+ data: serializedData,
162
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
163
+ {
164
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
165
+ paths: [
166
+ { path: "contact.createdDate" },
167
+ { path: "contact.updatedDate" },
168
+ { path: "contact.lastActivity.activityDate" },
169
+ { path: "contact.lastActivity.date" },
170
+ { path: "contact.picture.urlExpirationDate" },
171
+ { path: "contact.info.picture.image.urlExpirationDate" },
172
+ { path: "contact.memberInfo.signupDate" },
173
+ {
174
+ path: "contact.memberInfo.profileInfo.photo.urlExpirationDate"
175
+ },
176
+ { path: "contact.memberInfo.sessionInfo.lastWebLogin" },
177
+ { path: "contact.memberInfo.sessionInfo.lastMobileLogin" }
178
+ ]
179
+ },
180
+ {
181
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
182
+ paths: [
183
+ { path: "contact.info.addresses.items.address.geocode.latitude" },
184
+ {
185
+ path: "contact.info.addresses.items.address.geocode.longitude"
186
+ }
187
+ ]
188
+ }
189
+ ])
190
+ };
191
+ return metadata;
192
+ }
193
+ return __createContact;
194
+ }
195
+ function updateContact(payload) {
196
+ function __updateContact({ host }) {
197
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
198
+ {
199
+ transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
200
+ paths: [{ path: "fieldMask" }]
201
+ },
202
+ {
203
+ transformFn: import_float.transformSDKFloatToRESTFloat,
204
+ paths: [
205
+ { path: "info.addresses.items.address.geocode.latitude" },
206
+ { path: "info.addresses.items.address.geocode.longitude" }
207
+ ]
208
+ },
209
+ {
210
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
211
+ paths: [{ path: "info.picture.image.urlExpirationDate" }]
212
+ }
213
+ ]);
214
+ const metadata = {
215
+ entityFqdn: "wix.contacts.v4.contact",
216
+ method: "PATCH",
217
+ methodFqn: "com.wixpress.contacts.core.api.v4.ContactsServiceV4.UpdateContact",
218
+ packageName: PACKAGE_NAME,
219
+ url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
220
+ protoPath: "/v4/contacts/{contactId}",
221
+ data: serializedData,
222
+ host
223
+ }),
224
+ data: serializedData,
225
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
226
+ {
227
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
228
+ paths: [
229
+ { path: "contact.createdDate" },
230
+ { path: "contact.updatedDate" },
231
+ { path: "contact.lastActivity.activityDate" },
232
+ { path: "contact.lastActivity.date" },
233
+ { path: "contact.picture.urlExpirationDate" },
234
+ { path: "contact.info.picture.image.urlExpirationDate" },
235
+ { path: "contact.memberInfo.signupDate" },
236
+ {
237
+ path: "contact.memberInfo.profileInfo.photo.urlExpirationDate"
238
+ },
239
+ { path: "contact.memberInfo.sessionInfo.lastWebLogin" },
240
+ { path: "contact.memberInfo.sessionInfo.lastMobileLogin" }
241
+ ]
242
+ },
243
+ {
244
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
245
+ paths: [
246
+ { path: "contact.info.addresses.items.address.geocode.latitude" },
247
+ {
248
+ path: "contact.info.addresses.items.address.geocode.longitude"
249
+ }
250
+ ]
251
+ }
252
+ ])
253
+ };
254
+ return metadata;
255
+ }
256
+ return __updateContact;
257
+ }
258
+ function mergeContacts(payload) {
259
+ function __mergeContacts({ host }) {
260
+ const metadata = {
261
+ entityFqdn: "wix.contacts.v4.contact",
262
+ method: "POST",
263
+ methodFqn: "com.wixpress.contacts.core.api.v4.ContactsServiceV4.MergeContacts",
264
+ packageName: PACKAGE_NAME,
265
+ url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
266
+ protoPath: "/v4/contacts/{targetContactId}/merge",
267
+ data: payload,
268
+ host
269
+ }),
270
+ data: payload,
271
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
272
+ {
273
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
274
+ paths: [
275
+ { path: "contact.createdDate" },
276
+ { path: "contact.updatedDate" },
277
+ { path: "contact.lastActivity.activityDate" },
278
+ { path: "contact.lastActivity.date" },
279
+ { path: "contact.picture.urlExpirationDate" },
280
+ { path: "contact.info.picture.image.urlExpirationDate" },
281
+ { path: "contact.memberInfo.signupDate" },
282
+ {
283
+ path: "contact.memberInfo.profileInfo.photo.urlExpirationDate"
284
+ },
285
+ { path: "contact.memberInfo.sessionInfo.lastWebLogin" },
286
+ { path: "contact.memberInfo.sessionInfo.lastMobileLogin" }
287
+ ]
288
+ },
289
+ {
290
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
291
+ paths: [
292
+ { path: "contact.info.addresses.items.address.geocode.latitude" },
293
+ {
294
+ path: "contact.info.addresses.items.address.geocode.longitude"
295
+ }
296
+ ]
297
+ }
298
+ ])
299
+ };
300
+ return metadata;
301
+ }
302
+ return __mergeContacts;
303
+ }
304
+ function deleteContact(payload) {
305
+ function __deleteContact({ host }) {
306
+ const metadata = {
307
+ entityFqdn: "wix.contacts.v4.contact",
308
+ method: "DELETE",
309
+ methodFqn: "com.wixpress.contacts.core.api.v4.ContactsServiceV4.DeleteContact",
310
+ packageName: PACKAGE_NAME,
311
+ url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
312
+ protoPath: "/v4/contacts/{contactId}",
313
+ data: payload,
314
+ host
315
+ }),
316
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
317
+ };
318
+ return metadata;
319
+ }
320
+ return __deleteContact;
321
+ }
322
+ function labelContact(payload) {
323
+ function __labelContact({ host }) {
324
+ const metadata = {
325
+ entityFqdn: "wix.contacts.v4.contact",
326
+ method: "POST",
327
+ methodFqn: "com.wixpress.contacts.core.api.v4.ContactsServiceV4.LabelContact",
328
+ packageName: PACKAGE_NAME,
329
+ url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
330
+ protoPath: "/v4/contacts/{contactId}/labels",
331
+ data: payload,
332
+ host
333
+ }),
334
+ data: payload,
335
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
336
+ {
337
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
338
+ paths: [
339
+ { path: "contact.createdDate" },
340
+ { path: "contact.updatedDate" },
341
+ { path: "contact.lastActivity.activityDate" },
342
+ { path: "contact.lastActivity.date" },
343
+ { path: "contact.picture.urlExpirationDate" },
344
+ { path: "contact.info.picture.image.urlExpirationDate" },
345
+ { path: "contact.memberInfo.signupDate" },
346
+ {
347
+ path: "contact.memberInfo.profileInfo.photo.urlExpirationDate"
348
+ },
349
+ { path: "contact.memberInfo.sessionInfo.lastWebLogin" },
350
+ { path: "contact.memberInfo.sessionInfo.lastMobileLogin" }
351
+ ]
352
+ },
353
+ {
354
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
355
+ paths: [
356
+ { path: "contact.info.addresses.items.address.geocode.latitude" },
357
+ {
358
+ path: "contact.info.addresses.items.address.geocode.longitude"
359
+ }
360
+ ]
361
+ }
362
+ ])
363
+ };
364
+ return metadata;
365
+ }
366
+ return __labelContact;
367
+ }
368
+ function unlabelContact(payload) {
369
+ function __unlabelContact({ host }) {
370
+ const metadata = {
371
+ entityFqdn: "wix.contacts.v4.contact",
372
+ method: "DELETE",
373
+ methodFqn: "com.wixpress.contacts.core.api.v4.ContactsServiceV4.UnlabelContact",
374
+ packageName: PACKAGE_NAME,
375
+ url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
376
+ protoPath: "/v4/contacts/{contactId}/labels",
377
+ data: payload,
378
+ host
379
+ }),
380
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
381
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
382
+ {
383
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
384
+ paths: [
385
+ { path: "contact.createdDate" },
386
+ { path: "contact.updatedDate" },
387
+ { path: "contact.lastActivity.activityDate" },
388
+ { path: "contact.lastActivity.date" },
389
+ { path: "contact.picture.urlExpirationDate" },
390
+ { path: "contact.info.picture.image.urlExpirationDate" },
391
+ { path: "contact.memberInfo.signupDate" },
392
+ {
393
+ path: "contact.memberInfo.profileInfo.photo.urlExpirationDate"
394
+ },
395
+ { path: "contact.memberInfo.sessionInfo.lastWebLogin" },
396
+ { path: "contact.memberInfo.sessionInfo.lastMobileLogin" }
397
+ ]
398
+ },
399
+ {
400
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
401
+ paths: [
402
+ { path: "contact.info.addresses.items.address.geocode.latitude" },
403
+ {
404
+ path: "contact.info.addresses.items.address.geocode.longitude"
405
+ }
406
+ ]
407
+ }
408
+ ])
409
+ };
410
+ return metadata;
411
+ }
412
+ return __unlabelContact;
413
+ }
414
+ function queryContacts(payload) {
415
+ function __queryContacts({ host }) {
416
+ const metadata = {
417
+ entityFqdn: "wix.contacts.v4.contact",
418
+ method: "POST",
419
+ methodFqn: "com.wixpress.contacts.core.api.v4.ContactsServiceV4.QueryContacts",
420
+ packageName: PACKAGE_NAME,
421
+ url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
422
+ protoPath: "/v4/contacts/query",
423
+ data: payload,
424
+ host
425
+ }),
426
+ data: payload,
427
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
428
+ {
429
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
430
+ paths: [
431
+ { path: "contacts.createdDate" },
432
+ { path: "contacts.updatedDate" },
433
+ { path: "contacts.lastActivity.activityDate" },
434
+ { path: "contacts.lastActivity.date" },
435
+ { path: "contacts.picture.urlExpirationDate" },
436
+ { path: "contacts.info.picture.image.urlExpirationDate" },
437
+ { path: "contacts.memberInfo.signupDate" },
438
+ {
439
+ path: "contacts.memberInfo.profileInfo.photo.urlExpirationDate"
440
+ },
441
+ { path: "contacts.memberInfo.sessionInfo.lastWebLogin" },
442
+ { path: "contacts.memberInfo.sessionInfo.lastMobileLogin" }
443
+ ]
444
+ },
445
+ {
446
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
447
+ paths: [
448
+ {
449
+ path: "contacts.info.addresses.items.address.geocode.latitude"
450
+ },
451
+ {
452
+ path: "contacts.info.addresses.items.address.geocode.longitude"
453
+ }
454
+ ]
455
+ }
456
+ ])
457
+ };
458
+ return metadata;
459
+ }
460
+ return __queryContacts;
461
+ }
462
+ function getContact(payload) {
463
+ function __getContact({ host }) {
464
+ const metadata = {
465
+ entityFqdn: "wix.contacts.v4.contact",
466
+ method: "GET",
467
+ methodFqn: "com.wixpress.contacts.core.api.v4.ContactsServiceV4.GetContact",
468
+ packageName: PACKAGE_NAME,
469
+ url: resolveComWixpressContactsCoreApiV4ContactsServiceV4Url({
470
+ protoPath: "/v4/contacts/{id}",
471
+ data: payload,
472
+ host
473
+ }),
474
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
475
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
476
+ {
477
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
478
+ paths: [
479
+ { path: "contact.createdDate" },
480
+ { path: "contact.updatedDate" },
481
+ { path: "contact.lastActivity.activityDate" },
482
+ { path: "contact.lastActivity.date" },
483
+ { path: "contact.picture.urlExpirationDate" },
484
+ { path: "contact.info.picture.image.urlExpirationDate" },
485
+ { path: "contact.memberInfo.signupDate" },
486
+ {
487
+ path: "contact.memberInfo.profileInfo.photo.urlExpirationDate"
488
+ },
489
+ { path: "contact.memberInfo.sessionInfo.lastWebLogin" },
490
+ { path: "contact.memberInfo.sessionInfo.lastMobileLogin" }
491
+ ]
492
+ },
493
+ {
494
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
495
+ paths: [
496
+ { path: "contact.info.addresses.items.address.geocode.latitude" },
497
+ {
498
+ path: "contact.info.addresses.items.address.geocode.longitude"
499
+ }
500
+ ]
501
+ }
502
+ ])
503
+ };
504
+ return metadata;
505
+ }
506
+ return __getContact;
507
+ }
508
+
509
+ // src/contacts-v4-contact-contacts.universal.ts
510
+ var import_address = require("@wix/sdk-runtime/transformations/address");
511
+ var import_address2 = require("@wix/sdk-runtime/transformations/address");
512
+ var import_image = require("@wix/sdk-runtime/transformations/image");
513
+ var import_image2 = require("@wix/sdk-runtime/transformations/image");
514
+ var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
515
+ var ContactSourceType = /* @__PURE__ */ ((ContactSourceType2) => {
516
+ ContactSourceType2["OTHER"] = "OTHER";
517
+ ContactSourceType2["ADMIN"] = "ADMIN";
518
+ ContactSourceType2["WIX_APP"] = "WIX_APP";
519
+ ContactSourceType2["IMPORT"] = "IMPORT";
520
+ ContactSourceType2["THIRD_PARTY"] = "THIRD_PARTY";
521
+ ContactSourceType2["WIX_BOOKINGS"] = "WIX_BOOKINGS";
522
+ ContactSourceType2["WIX_CHAT"] = "WIX_CHAT";
523
+ ContactSourceType2["WIX_EMAIL_MARKETING"] = "WIX_EMAIL_MARKETING";
524
+ ContactSourceType2["WIX_EVENTS"] = "WIX_EVENTS";
525
+ ContactSourceType2["WIX_FORMS"] = "WIX_FORMS";
526
+ ContactSourceType2["WIX_GROUPS"] = "WIX_GROUPS";
527
+ ContactSourceType2["WIX_HOTELS"] = "WIX_HOTELS";
528
+ ContactSourceType2["WIX_MARKET_PLACE"] = "WIX_MARKET_PLACE";
529
+ ContactSourceType2["WIX_MUSIC"] = "WIX_MUSIC";
530
+ ContactSourceType2["WIX_RESTAURANTS"] = "WIX_RESTAURANTS";
531
+ ContactSourceType2["WIX_SITE_MEMBERS"] = "WIX_SITE_MEMBERS";
532
+ ContactSourceType2["WIX_STORES"] = "WIX_STORES";
533
+ ContactSourceType2["WIX_CODE"] = "WIX_CODE";
534
+ ContactSourceType2["HOPP"] = "HOPP";
535
+ return ContactSourceType2;
536
+ })(ContactSourceType || {});
537
+ var ContactActivityType = /* @__PURE__ */ ((ContactActivityType2) => {
538
+ ContactActivityType2["GENERAL"] = "GENERAL";
539
+ ContactActivityType2["CONTACT_CREATED"] = "CONTACT_CREATED";
540
+ ContactActivityType2["MEMBER_LOGIN"] = "MEMBER_LOGIN";
541
+ ContactActivityType2["MEMBER_REGISTER"] = "MEMBER_REGISTER";
542
+ ContactActivityType2["MEMBER_STATUS_CHANGED"] = "MEMBER_STATUS_CHANGED";
543
+ ContactActivityType2["FORM_SUBMITTED"] = "FORM_SUBMITTED";
544
+ ContactActivityType2["INBOX_FORM_SUBMITTED"] = "INBOX_FORM_SUBMITTED";
545
+ ContactActivityType2["INBOX_PAYMENT_REQUEST_PAID"] = "INBOX_PAYMENT_REQUEST_PAID";
546
+ ContactActivityType2["INBOX_MESSAGE_TO_CUSTOMER"] = "INBOX_MESSAGE_TO_CUSTOMER";
547
+ ContactActivityType2["INBOX_MESSAGE_FROM_CUSTOMER"] = "INBOX_MESSAGE_FROM_CUSTOMER";
548
+ ContactActivityType2["NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED"] = "NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED";
549
+ ContactActivityType2["NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE"] = "NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE";
550
+ ContactActivityType2["ECOM_PURCHASE"] = "ECOM_PURCHASE";
551
+ ContactActivityType2["ECOM_CART_ABANDON"] = "ECOM_CART_ABANDON";
552
+ ContactActivityType2["ECOM_CHECKOUT_BUYER"] = "ECOM_CHECKOUT_BUYER";
553
+ ContactActivityType2["BOOKINGS_APPOINTMENT"] = "BOOKINGS_APPOINTMENT";
554
+ ContactActivityType2["HOTELS_RESERVATION"] = "HOTELS_RESERVATION";
555
+ ContactActivityType2["HOTELS_PURCHASE"] = "HOTELS_PURCHASE";
556
+ ContactActivityType2["HOTELS_CONFIRMATION"] = "HOTELS_CONFIRMATION";
557
+ ContactActivityType2["HOTELS_CANCEL"] = "HOTELS_CANCEL";
558
+ ContactActivityType2["VIDEO_PURCHASE"] = "VIDEO_PURCHASE";
559
+ ContactActivityType2["VIDEO_RENT"] = "VIDEO_RENT";
560
+ ContactActivityType2["CASHIER_BUTTON_PURCHASE"] = "CASHIER_BUTTON_PURCHASE";
561
+ ContactActivityType2["ARENA_NEW_LEAD"] = "ARENA_NEW_LEAD";
562
+ ContactActivityType2["EVENTS_RSVP"] = "EVENTS_RSVP";
563
+ ContactActivityType2["INVOICE_PAY"] = "INVOICE_PAY";
564
+ ContactActivityType2["INVOICE_OVERDUE"] = "INVOICE_OVERDUE";
565
+ ContactActivityType2["PRICE_QUOTE_ACCEPT"] = "PRICE_QUOTE_ACCEPT";
566
+ ContactActivityType2["PRICE_QUOTE_EXPIRE"] = "PRICE_QUOTE_EXPIRE";
567
+ ContactActivityType2["RESTAURANTS_ORDER"] = "RESTAURANTS_ORDER";
568
+ ContactActivityType2["RESTAURANTS_RESERVATION"] = "RESTAURANTS_RESERVATION";
569
+ ContactActivityType2["SHOUTOUT_OPEN"] = "SHOUTOUT_OPEN";
570
+ ContactActivityType2["SHOUTOUT_CLICK"] = "SHOUTOUT_CLICK";
571
+ ContactActivityType2["CONTACT_MERGED"] = "CONTACT_MERGED";
572
+ ContactActivityType2["NEWSLETTER_SUBSCRIPTION_SUBSCRIBE"] = "NEWSLETTER_SUBSCRIPTION_SUBSCRIBE";
573
+ ContactActivityType2["NEWSLETTER_SUBSCRIPTION_PENDING"] = "NEWSLETTER_SUBSCRIPTION_PENDING";
574
+ ContactActivityType2["NEWSLETTER_SUBSCRIPTION_NOT_SET"] = "NEWSLETTER_SUBSCRIPTION_NOT_SET";
575
+ ContactActivityType2["PHONE_SUBSCRIPTION_SUBSCRIBE"] = "PHONE_SUBSCRIPTION_SUBSCRIBE";
576
+ ContactActivityType2["PHONE_SUBSCRIPTION_PENDING"] = "PHONE_SUBSCRIPTION_PENDING";
577
+ ContactActivityType2["PHONE_SUBSCRIPTION_NOT_SET"] = "PHONE_SUBSCRIPTION_NOT_SET";
578
+ ContactActivityType2["PHONE_SUBSCRIPTION_UNSUBSCRIBE"] = "PHONE_SUBSCRIPTION_UNSUBSCRIBE";
579
+ return ContactActivityType2;
580
+ })(ContactActivityType || {});
581
+ var EmailTag = /* @__PURE__ */ ((EmailTag2) => {
582
+ EmailTag2["UNTAGGED"] = "UNTAGGED";
583
+ EmailTag2["MAIN"] = "MAIN";
584
+ EmailTag2["HOME"] = "HOME";
585
+ EmailTag2["WORK"] = "WORK";
586
+ return EmailTag2;
587
+ })(EmailTag || {});
588
+ var PhoneTag = /* @__PURE__ */ ((PhoneTag2) => {
589
+ PhoneTag2["UNTAGGED"] = "UNTAGGED";
590
+ PhoneTag2["MAIN"] = "MAIN";
591
+ PhoneTag2["HOME"] = "HOME";
592
+ PhoneTag2["MOBILE"] = "MOBILE";
593
+ PhoneTag2["WORK"] = "WORK";
594
+ PhoneTag2["FAX"] = "FAX";
595
+ return PhoneTag2;
596
+ })(PhoneTag || {});
597
+ var AddressTag = /* @__PURE__ */ ((AddressTag2) => {
598
+ AddressTag2["UNTAGGED"] = "UNTAGGED";
599
+ AddressTag2["HOME"] = "HOME";
600
+ AddressTag2["WORK"] = "WORK";
601
+ AddressTag2["BILLING"] = "BILLING";
602
+ AddressTag2["SHIPPING"] = "SHIPPING";
603
+ return AddressTag2;
604
+ })(AddressTag || {});
605
+ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
606
+ SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
607
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
608
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
609
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
610
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
611
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
612
+ SubdivisionType2["COUNTRY"] = "COUNTRY";
613
+ return SubdivisionType2;
614
+ })(SubdivisionType || {});
615
+ var ImageProvider = /* @__PURE__ */ ((ImageProvider2) => {
616
+ ImageProvider2["UNKNOWN"] = "UNKNOWN";
617
+ ImageProvider2["EXTERNAL"] = "EXTERNAL";
618
+ ImageProvider2["WIX_MEDIA"] = "WIX_MEDIA";
619
+ return ImageProvider2;
620
+ })(ImageProvider || {});
621
+ var SubscriptionStatus = /* @__PURE__ */ ((SubscriptionStatus2) => {
622
+ SubscriptionStatus2["NO_SUBSCRIPTION_STATUS"] = "NO_SUBSCRIPTION_STATUS";
623
+ SubscriptionStatus2["NOT_SET"] = "NOT_SET";
624
+ SubscriptionStatus2["PENDING"] = "PENDING";
625
+ SubscriptionStatus2["SUBSCRIBED"] = "SUBSCRIBED";
626
+ SubscriptionStatus2["UNSUBSCRIBED"] = "UNSUBSCRIBED";
627
+ return SubscriptionStatus2;
628
+ })(SubscriptionStatus || {});
629
+ var EmailDeliverabilityStatus = /* @__PURE__ */ ((EmailDeliverabilityStatus2) => {
630
+ EmailDeliverabilityStatus2["NOT_SET"] = "NOT_SET";
631
+ EmailDeliverabilityStatus2["VALID"] = "VALID";
632
+ EmailDeliverabilityStatus2["BOUNCED"] = "BOUNCED";
633
+ EmailDeliverabilityStatus2["SPAM_COMPLAINT"] = "SPAM_COMPLAINT";
634
+ EmailDeliverabilityStatus2["INACTIVE"] = "INACTIVE";
635
+ return EmailDeliverabilityStatus2;
636
+ })(EmailDeliverabilityStatus || {});
637
+ var PhoneDeliverabilityStatus = /* @__PURE__ */ ((PhoneDeliverabilityStatus2) => {
638
+ PhoneDeliverabilityStatus2["NO_PHONE_DELIVERABILITY_STATUS"] = "NO_PHONE_DELIVERABILITY_STATUS";
639
+ PhoneDeliverabilityStatus2["NOT_SET"] = "NOT_SET";
640
+ return PhoneDeliverabilityStatus2;
641
+ })(PhoneDeliverabilityStatus || {});
642
+ var MemberStatus = /* @__PURE__ */ ((MemberStatus2) => {
643
+ MemberStatus2["PENDING"] = "PENDING";
644
+ MemberStatus2["ACTIVE"] = "ACTIVE";
645
+ MemberStatus2["DELETED"] = "DELETED";
646
+ MemberStatus2["BLOCKED"] = "BLOCKED";
647
+ MemberStatus2["OFFLINE"] = "OFFLINE";
648
+ return MemberStatus2;
649
+ })(MemberStatus || {});
650
+ var PrivacyStatus = /* @__PURE__ */ ((PrivacyStatus2) => {
651
+ PrivacyStatus2["PRIVATE"] = "PRIVATE";
652
+ PrivacyStatus2["PUBLIC"] = "PUBLIC";
653
+ return PrivacyStatus2;
654
+ })(PrivacyStatus || {});
655
+ var Role = /* @__PURE__ */ ((Role2) => {
656
+ Role2["UNSPECIFIED_ROLE"] = "UNSPECIFIED_ROLE";
657
+ Role2["OWNER"] = "OWNER";
658
+ Role2["CONTRIBUTOR"] = "CONTRIBUTOR";
659
+ return Role2;
660
+ })(Role || {});
661
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
662
+ SortOrder2["ASC"] = "ASC";
663
+ SortOrder2["DESC"] = "DESC";
664
+ return SortOrder2;
665
+ })(SortOrder || {});
666
+ var ContactFieldSet = /* @__PURE__ */ ((ContactFieldSet2) => {
667
+ ContactFieldSet2["BASIC"] = "BASIC";
668
+ ContactFieldSet2["COMMUNICATION_DETAILS"] = "COMMUNICATION_DETAILS";
669
+ ContactFieldSet2["EXTENDED"] = "EXTENDED";
670
+ ContactFieldSet2["FULL"] = "FULL";
671
+ return ContactFieldSet2;
672
+ })(ContactFieldSet || {});
673
+ var ContactsFacetType = /* @__PURE__ */ ((ContactsFacetType2) => {
674
+ ContactsFacetType2["UNKNOWN"] = "UNKNOWN";
675
+ ContactsFacetType2["ALL_CONTACTS"] = "ALL_CONTACTS";
676
+ ContactsFacetType2["NOT_LABELED"] = "NOT_LABELED";
677
+ ContactsFacetType2["LABEL"] = "LABEL";
678
+ ContactsFacetType2["SUBSCRIPTION_STATUS"] = "SUBSCRIPTION_STATUS";
679
+ ContactsFacetType2["MEMBERSHIP_STATUS"] = "MEMBERSHIP_STATUS";
680
+ return ContactsFacetType2;
681
+ })(ContactsFacetType || {});
682
+ var Action = /* @__PURE__ */ ((Action2) => {
683
+ Action2["UNKNOWN"] = "UNKNOWN";
684
+ Action2["UPDATED"] = "UPDATED";
685
+ Action2["CREATED"] = "CREATED";
686
+ return Action2;
687
+ })(Action || {});
688
+ var UpsertContactResponseAction = /* @__PURE__ */ ((UpsertContactResponseAction2) => {
689
+ UpsertContactResponseAction2["UNKNOWN"] = "UNKNOWN";
690
+ UpsertContactResponseAction2["UPDATED"] = "UPDATED";
691
+ UpsertContactResponseAction2["CREATED"] = "CREATED";
692
+ return UpsertContactResponseAction2;
693
+ })(UpsertContactResponseAction || {});
694
+ var GetContactResponseType = /* @__PURE__ */ ((GetContactResponseType2) => {
695
+ GetContactResponseType2["REGULAR"] = "REGULAR";
696
+ GetContactResponseType2["IMPLICIT"] = "IMPLICIT";
697
+ GetContactResponseType2["MERGED"] = "MERGED";
698
+ return GetContactResponseType2;
699
+ })(GetContactResponseType || {});
700
+ var SubmitOperation = /* @__PURE__ */ ((SubmitOperation2) => {
701
+ SubmitOperation2["UNKNOWN"] = "UNKNOWN";
702
+ SubmitOperation2["CREATE"] = "CREATE";
703
+ SubmitOperation2["UPDATE"] = "UPDATE";
704
+ return SubmitOperation2;
705
+ })(SubmitOperation || {});
706
+ var Mode = /* @__PURE__ */ ((Mode2) => {
707
+ Mode2["OR"] = "OR";
708
+ Mode2["AND"] = "AND";
709
+ return Mode2;
710
+ })(Mode || {});
711
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
712
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
713
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
714
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
715
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
716
+ WebhookIdentityType2["APP"] = "APP";
717
+ return WebhookIdentityType2;
718
+ })(WebhookIdentityType || {});
719
+ async function createContact2(info, options) {
720
+ const { httpClient, sideEffects } = arguments[2];
721
+ const payload = (0, import_transform_paths2.transformPaths)(
722
+ (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
723
+ info,
724
+ allowDuplicates: options?.allowDuplicates
725
+ }),
726
+ [
727
+ {
728
+ transformFn: import_address.transformSDKAddressToRESTAddress,
729
+ paths: [{ path: "info.addresses.items.address" }]
730
+ },
731
+ {
732
+ transformFn: import_image.transformSDKImageToRESTImage,
733
+ paths: [{ path: "info.picture.image" }]
734
+ }
735
+ ]
736
+ );
737
+ const reqOpts = createContact(payload);
738
+ sideEffects?.onSiteCall?.();
739
+ try {
740
+ const result = await httpClient.request(reqOpts);
741
+ sideEffects?.onSuccess?.(result);
742
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
743
+ (0, import_transform_paths2.transformPaths)(result.data, [
744
+ {
745
+ transformFn: import_image2.transformRESTImageToSDKImage,
746
+ paths: [
747
+ { path: "contact.picture" },
748
+ { path: "contact.info.picture.image" },
749
+ { path: "contact.memberInfo.profileInfo.photo" }
750
+ ]
751
+ },
752
+ {
753
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
754
+ paths: [{ path: "contact.info.addresses.items.address" }]
755
+ }
756
+ ])
757
+ );
758
+ } catch (err) {
759
+ const transformedError = (0, import_transform_error.transformError)(
760
+ err,
761
+ {
762
+ spreadPathsToArguments: {},
763
+ explicitPathsToArguments: {
764
+ info: "$[0]",
765
+ allowDuplicates: "$[1].allowDuplicates"
766
+ },
767
+ singleArgumentUnchanged: false
768
+ },
769
+ ["info", "options"]
770
+ );
771
+ sideEffects?.onError?.(err);
772
+ throw transformedError;
773
+ }
774
+ }
775
+ async function updateContact2(contactId, info, revision, options) {
776
+ const { httpClient, sideEffects } = arguments[4];
777
+ const payload = (0, import_transform_paths2.transformPaths)(
778
+ (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
779
+ contactId,
780
+ info,
781
+ revision,
782
+ allowDuplicates: options?.allowDuplicates
783
+ }),
784
+ [
785
+ {
786
+ transformFn: import_address.transformSDKAddressToRESTAddress,
787
+ paths: [{ path: "info.addresses.items.address" }]
788
+ },
789
+ {
790
+ transformFn: import_image.transformSDKImageToRESTImage,
791
+ paths: [{ path: "info.picture.image" }]
792
+ }
793
+ ]
794
+ );
795
+ const reqOpts = updateContact(payload);
796
+ sideEffects?.onSiteCall?.();
797
+ try {
798
+ const result = await httpClient.request(reqOpts);
799
+ sideEffects?.onSuccess?.(result);
800
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
801
+ (0, import_transform_paths2.transformPaths)(result.data, [
802
+ {
803
+ transformFn: import_image2.transformRESTImageToSDKImage,
804
+ paths: [
805
+ { path: "contact.picture" },
806
+ { path: "contact.info.picture.image" },
807
+ { path: "contact.memberInfo.profileInfo.photo" }
808
+ ]
809
+ },
810
+ {
811
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
812
+ paths: [{ path: "contact.info.addresses.items.address" }]
813
+ }
814
+ ])
815
+ );
816
+ } catch (err) {
817
+ const transformedError = (0, import_transform_error.transformError)(
818
+ err,
819
+ {
820
+ spreadPathsToArguments: {},
821
+ explicitPathsToArguments: {
822
+ contactId: "$[0]",
823
+ info: "$[1]",
824
+ revision: "$[2]",
825
+ allowDuplicates: "$[3].allowDuplicates"
826
+ },
827
+ singleArgumentUnchanged: false
828
+ },
829
+ ["contactId", "info", "revision", "options"]
830
+ );
831
+ sideEffects?.onError?.(err);
832
+ throw transformedError;
833
+ }
834
+ }
835
+ async function mergeContacts2(targetContactId, targetContactRevision, options) {
836
+ const { httpClient, sideEffects } = arguments[3];
837
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
838
+ targetContactId,
839
+ targetContactRevision,
840
+ sourceContactIds: options?.sourceContactIds
841
+ });
842
+ const reqOpts = mergeContacts(payload);
843
+ sideEffects?.onSiteCall?.();
844
+ try {
845
+ const result = await httpClient.request(reqOpts);
846
+ sideEffects?.onSuccess?.(result);
847
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
848
+ (0, import_transform_paths2.transformPaths)(result.data, [
849
+ {
850
+ transformFn: import_image2.transformRESTImageToSDKImage,
851
+ paths: [
852
+ { path: "contact.picture" },
853
+ { path: "contact.info.picture.image" },
854
+ { path: "contact.memberInfo.profileInfo.photo" }
855
+ ]
856
+ },
857
+ {
858
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
859
+ paths: [{ path: "contact.info.addresses.items.address" }]
860
+ }
861
+ ])
862
+ );
863
+ } catch (err) {
864
+ const transformedError = (0, import_transform_error.transformError)(
865
+ err,
866
+ {
867
+ spreadPathsToArguments: {},
868
+ explicitPathsToArguments: {
869
+ targetContactId: "$[0]",
870
+ targetContactRevision: "$[1]",
871
+ sourceContactIds: "$[2].sourceContactIds"
872
+ },
873
+ singleArgumentUnchanged: false
874
+ },
875
+ ["targetContactId", "targetContactRevision", "options"]
876
+ );
877
+ sideEffects?.onError?.(err);
878
+ throw transformedError;
879
+ }
880
+ }
881
+ async function deleteContact2(contactId) {
882
+ const { httpClient, sideEffects } = arguments[1];
883
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
884
+ contactId
885
+ });
886
+ const reqOpts = deleteContact(payload);
887
+ sideEffects?.onSiteCall?.();
888
+ try {
889
+ const result = await httpClient.request(reqOpts);
890
+ sideEffects?.onSuccess?.(result);
891
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
892
+ } catch (err) {
893
+ const transformedError = (0, import_transform_error.transformError)(
894
+ err,
895
+ {
896
+ spreadPathsToArguments: {},
897
+ explicitPathsToArguments: { contactId: "$[0]" },
898
+ singleArgumentUnchanged: false
899
+ },
900
+ ["contactId"]
901
+ );
902
+ sideEffects?.onError?.(err);
903
+ throw transformedError;
904
+ }
905
+ }
906
+ async function labelContact2(contactId, labelKeys) {
907
+ const { httpClient, sideEffects } = arguments[2];
908
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
909
+ contactId,
910
+ labelKeys
911
+ });
912
+ const reqOpts = labelContact(payload);
913
+ sideEffects?.onSiteCall?.();
914
+ try {
915
+ const result = await httpClient.request(reqOpts);
916
+ sideEffects?.onSuccess?.(result);
917
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
918
+ (0, import_transform_paths2.transformPaths)(result.data, [
919
+ {
920
+ transformFn: import_image2.transformRESTImageToSDKImage,
921
+ paths: [
922
+ { path: "contact.picture" },
923
+ { path: "contact.info.picture.image" },
924
+ { path: "contact.memberInfo.profileInfo.photo" }
925
+ ]
926
+ },
927
+ {
928
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
929
+ paths: [{ path: "contact.info.addresses.items.address" }]
930
+ }
931
+ ])
932
+ );
933
+ } catch (err) {
934
+ const transformedError = (0, import_transform_error.transformError)(
935
+ err,
936
+ {
937
+ spreadPathsToArguments: {},
938
+ explicitPathsToArguments: { contactId: "$[0]", labelKeys: "$[1]" },
939
+ singleArgumentUnchanged: false
940
+ },
941
+ ["contactId", "labelKeys"]
942
+ );
943
+ sideEffects?.onError?.(err);
944
+ throw transformedError;
945
+ }
946
+ }
947
+ async function unlabelContact2(contactId, labelKeys) {
948
+ const { httpClient, sideEffects } = arguments[2];
949
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
950
+ contactId,
951
+ labelKeys
952
+ });
953
+ const reqOpts = unlabelContact(payload);
954
+ sideEffects?.onSiteCall?.();
955
+ try {
956
+ const result = await httpClient.request(reqOpts);
957
+ sideEffects?.onSuccess?.(result);
958
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
959
+ (0, import_transform_paths2.transformPaths)(result.data, [
960
+ {
961
+ transformFn: import_image2.transformRESTImageToSDKImage,
962
+ paths: [
963
+ { path: "contact.picture" },
964
+ { path: "contact.info.picture.image" },
965
+ { path: "contact.memberInfo.profileInfo.photo" }
966
+ ]
967
+ },
968
+ {
969
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
970
+ paths: [{ path: "contact.info.addresses.items.address" }]
971
+ }
972
+ ])
973
+ );
974
+ } catch (err) {
975
+ const transformedError = (0, import_transform_error.transformError)(
976
+ err,
977
+ {
978
+ spreadPathsToArguments: {},
979
+ explicitPathsToArguments: { contactId: "$[0]", labelKeys: "$[1]" },
980
+ singleArgumentUnchanged: false
981
+ },
982
+ ["contactId", "labelKeys"]
983
+ );
984
+ sideEffects?.onError?.(err);
985
+ throw transformedError;
986
+ }
987
+ }
988
+ function queryContacts2(options) {
989
+ const { httpClient, sideEffects } = arguments[1];
990
+ return (0, import_query_builder.queryBuilder)({
991
+ func: async (payload) => {
992
+ const reqOpts = queryContacts({
993
+ ...payload,
994
+ ...options ?? {}
995
+ });
996
+ sideEffects?.onSiteCall?.();
997
+ try {
998
+ const result = await httpClient.request(reqOpts);
999
+ sideEffects?.onSuccess?.(result);
1000
+ return result;
1001
+ } catch (err) {
1002
+ sideEffects?.onError?.(err);
1003
+ throw err;
1004
+ }
1005
+ },
1006
+ requestTransformer: (query) => {
1007
+ const args = [query, options];
1008
+ return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1009
+ ...args?.[1],
1010
+ query: args?.[0]
1011
+ });
1012
+ },
1013
+ responseTransformer: ({ data }) => {
1014
+ const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1015
+ (0, import_transform_paths2.transformPaths)(data, [
1016
+ {
1017
+ transformFn: import_image2.transformRESTImageToSDKImage,
1018
+ paths: [
1019
+ { path: "contacts.picture" },
1020
+ { path: "contacts.info.picture.image" },
1021
+ { path: "contacts.memberInfo.profileInfo.photo" }
1022
+ ]
1023
+ },
1024
+ {
1025
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
1026
+ paths: [{ path: "contacts.info.addresses.items.address" }]
1027
+ }
1028
+ ])
1029
+ );
1030
+ return {
1031
+ items: transformedData?.contacts,
1032
+ pagingMetadata: transformedData?.pagingMetadata
1033
+ };
1034
+ },
1035
+ errorTransformer: (err) => {
1036
+ const transformedError = (0, import_transform_error.transformError)(err, {
1037
+ spreadPathsToArguments: {},
1038
+ explicitPathsToArguments: { query: "$[0]" },
1039
+ singleArgumentUnchanged: false
1040
+ });
1041
+ throw transformedError;
1042
+ },
1043
+ pagingMethod: "OFFSET",
1044
+ transformationPaths: {}
1045
+ });
1046
+ }
1047
+ async function getContact2(_id, options) {
1048
+ const { httpClient, sideEffects } = arguments[2];
1049
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1050
+ id: _id,
1051
+ fields: options?.fields,
1052
+ fieldsets: options?.fieldsets
1053
+ });
1054
+ const reqOpts = getContact(payload);
1055
+ sideEffects?.onSiteCall?.();
1056
+ try {
1057
+ const result = await httpClient.request(reqOpts);
1058
+ sideEffects?.onSuccess?.(result);
1059
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1060
+ (0, import_transform_paths2.transformPaths)(result.data, [
1061
+ {
1062
+ transformFn: import_image2.transformRESTImageToSDKImage,
1063
+ paths: [
1064
+ { path: "contact.picture" },
1065
+ { path: "contact.info.picture.image" },
1066
+ { path: "contact.memberInfo.profileInfo.photo" }
1067
+ ]
1068
+ },
1069
+ {
1070
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
1071
+ paths: [{ path: "contact.info.addresses.items.address" }]
1072
+ }
1073
+ ])
1074
+ )?.contact;
1075
+ } catch (err) {
1076
+ const transformedError = (0, import_transform_error.transformError)(
1077
+ err,
1078
+ {
1079
+ spreadPathsToArguments: {},
1080
+ explicitPathsToArguments: {
1081
+ id: "$[0]",
1082
+ fields: "$[1].fields",
1083
+ fieldsets: "$[1].fieldsets"
1084
+ },
1085
+ singleArgumentUnchanged: false
1086
+ },
1087
+ ["_id", "options"]
1088
+ );
1089
+ sideEffects?.onError?.(err);
1090
+ throw transformedError;
1091
+ }
1092
+ }
1093
+ // Annotate the CommonJS export names for ESM import in node:
1094
+ 0 && (module.exports = {
1095
+ Action,
1096
+ AddressTag,
1097
+ ContactActivityType,
1098
+ ContactFieldSet,
1099
+ ContactSourceType,
1100
+ ContactsFacetType,
1101
+ EmailDeliverabilityStatus,
1102
+ EmailTag,
1103
+ GetContactResponseType,
1104
+ ImageProvider,
1105
+ MemberStatus,
1106
+ Mode,
1107
+ PhoneDeliverabilityStatus,
1108
+ PhoneTag,
1109
+ PrivacyStatus,
1110
+ Role,
1111
+ SortOrder,
1112
+ SubdivisionType,
1113
+ SubmitOperation,
1114
+ SubscriptionStatus,
1115
+ UpsertContactResponseAction,
1116
+ WebhookIdentityType,
1117
+ createContact,
1118
+ deleteContact,
1119
+ getContact,
1120
+ labelContact,
1121
+ mergeContacts,
1122
+ queryContacts,
1123
+ unlabelContact,
1124
+ updateContact
1125
+ });
1126
+ //# sourceMappingURL=index.typings.js.map