@wix/auto_sdk_crm_contacts 1.0.254 → 1.0.256

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