@wix/crm 1.0.85 → 1.0.87

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 (229) hide show
  1. package/build/cjs/context.d.ts +5 -5
  2. package/build/cjs/context.js +5 -5
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +5 -5
  5. package/build/cjs/index.js +5 -5
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +5 -5
  8. package/build/cjs/meta.js +5 -5
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +5 -5
  11. package/build/es/context.js +5 -5
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +5 -5
  14. package/build/es/index.js +5 -5
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +5 -5
  17. package/build/es/meta.js +5 -5
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +15 -9
  20. package/build/cjs/index.typings.d.ts +0 -5
  21. package/build/cjs/index.typings.js +0 -32
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/contacts-v4-contact.context.d.ts +0 -9
  24. package/build/cjs/src/contacts-v4-contact.context.js +0 -124
  25. package/build/cjs/src/contacts-v4-contact.context.js.map +0 -1
  26. package/build/cjs/src/contacts-v4-contact.http.d.ts +0 -94
  27. package/build/cjs/src/contacts-v4-contact.http.js +0 -485
  28. package/build/cjs/src/contacts-v4-contact.http.js.map +0 -1
  29. package/build/cjs/src/contacts-v4-contact.meta.d.ts +0 -31
  30. package/build/cjs/src/contacts-v4-contact.meta.js +0 -161
  31. package/build/cjs/src/contacts-v4-contact.meta.js.map +0 -1
  32. package/build/cjs/src/contacts-v4-contact.public.d.ts +0 -49
  33. package/build/cjs/src/contacts-v4-contact.public.js +0 -76
  34. package/build/cjs/src/contacts-v4-contact.public.js.map +0 -1
  35. package/build/cjs/src/contacts-v4-contact.types.d.ts +0 -2199
  36. package/build/cjs/src/contacts-v4-contact.types.js +0 -270
  37. package/build/cjs/src/contacts-v4-contact.types.js.map +0 -1
  38. package/build/cjs/src/contacts-v4-contact.universal.d.ts +0 -2069
  39. package/build/cjs/src/contacts-v4-contact.universal.js +0 -930
  40. package/build/cjs/src/contacts-v4-contact.universal.js.map +0 -1
  41. package/build/cjs/src/contacts-v4-extended-field.context.d.ts +0 -7
  42. package/build/cjs/src/contacts-v4-extended-field.context.js +0 -90
  43. package/build/cjs/src/contacts-v4-extended-field.context.js.map +0 -1
  44. package/build/cjs/src/contacts-v4-extended-field.http.d.ts +0 -52
  45. package/build/cjs/src/contacts-v4-extended-field.http.js +0 -234
  46. package/build/cjs/src/contacts-v4-extended-field.http.js.map +0 -1
  47. package/build/cjs/src/contacts-v4-extended-field.meta.d.ts +0 -23
  48. package/build/cjs/src/contacts-v4-extended-field.meta.js +0 -123
  49. package/build/cjs/src/contacts-v4-extended-field.meta.js.map +0 -1
  50. package/build/cjs/src/contacts-v4-extended-field.public.d.ts +0 -23
  51. package/build/cjs/src/contacts-v4-extended-field.public.js +0 -44
  52. package/build/cjs/src/contacts-v4-extended-field.public.js.map +0 -1
  53. package/build/cjs/src/contacts-v4-extended-field.types.d.ts +0 -357
  54. package/build/cjs/src/contacts-v4-extended-field.types.js +0 -23
  55. package/build/cjs/src/contacts-v4-extended-field.types.js.map +0 -1
  56. package/build/cjs/src/contacts-v4-extended-field.universal.d.ts +0 -623
  57. package/build/cjs/src/contacts-v4-extended-field.universal.js +0 -434
  58. package/build/cjs/src/contacts-v4-extended-field.universal.js.map +0 -1
  59. package/build/cjs/src/contacts-v4-label.context.d.ts +0 -7
  60. package/build/cjs/src/contacts-v4-label.context.js +0 -90
  61. package/build/cjs/src/contacts-v4-label.context.js.map +0 -1
  62. package/build/cjs/src/contacts-v4-label.http.d.ts +0 -53
  63. package/build/cjs/src/contacts-v4-label.http.js +0 -235
  64. package/build/cjs/src/contacts-v4-label.http.js.map +0 -1
  65. package/build/cjs/src/contacts-v4-label.meta.d.ts +0 -23
  66. package/build/cjs/src/contacts-v4-label.meta.js +0 -123
  67. package/build/cjs/src/contacts-v4-label.meta.js.map +0 -1
  68. package/build/cjs/src/contacts-v4-label.public.d.ts +0 -21
  69. package/build/cjs/src/contacts-v4-label.public.js +0 -43
  70. package/build/cjs/src/contacts-v4-label.public.js.map +0 -1
  71. package/build/cjs/src/contacts-v4-label.types.d.ts +0 -349
  72. package/build/cjs/src/contacts-v4-label.types.js +0 -17
  73. package/build/cjs/src/contacts-v4-label.types.js.map +0 -1
  74. package/build/cjs/src/contacts-v4-label.universal.d.ts +0 -627
  75. package/build/cjs/src/contacts-v4-label.universal.js +0 -428
  76. package/build/cjs/src/contacts-v4-label.universal.js.map +0 -1
  77. package/build/cjs/src/contacts-v4-submit-contact.context.d.ts +0 -3
  78. package/build/cjs/src/contacts-v4-submit-contact.context.js +0 -22
  79. package/build/cjs/src/contacts-v4-submit-contact.context.js.map +0 -1
  80. package/build/cjs/src/contacts-v4-submit-contact.http.d.ts +0 -8
  81. package/build/cjs/src/contacts-v4-submit-contact.http.js +0 -90
  82. package/build/cjs/src/contacts-v4-submit-contact.http.js.map +0 -1
  83. package/build/cjs/src/contacts-v4-submit-contact.meta.d.ts +0 -13
  84. package/build/cjs/src/contacts-v4-submit-contact.meta.js +0 -47
  85. package/build/cjs/src/contacts-v4-submit-contact.meta.js.map +0 -1
  86. package/build/cjs/src/contacts-v4-submit-contact.public.d.ts +0 -8
  87. package/build/cjs/src/contacts-v4-submit-contact.public.js +0 -22
  88. package/build/cjs/src/contacts-v4-submit-contact.public.js.map +0 -1
  89. package/build/cjs/src/contacts-v4-submit-contact.types.d.ts +0 -541
  90. package/build/cjs/src/contacts-v4-submit-contact.types.js +0 -174
  91. package/build/cjs/src/contacts-v4-submit-contact.types.js.map +0 -1
  92. package/build/cjs/src/contacts-v4-submit-contact.universal.d.ts +0 -555
  93. package/build/cjs/src/contacts-v4-submit-contact.universal.js +0 -288
  94. package/build/cjs/src/contacts-v4-submit-contact.universal.js.map +0 -1
  95. package/build/cjs/src/crm-tasks-v2-task.context.d.ts +0 -9
  96. package/build/cjs/src/crm-tasks-v2-task.context.js +0 -124
  97. package/build/cjs/src/crm-tasks-v2-task.context.js.map +0 -1
  98. package/build/cjs/src/crm-tasks-v2-task.http.d.ts +0 -59
  99. package/build/cjs/src/crm-tasks-v2-task.http.js +0 -268
  100. package/build/cjs/src/crm-tasks-v2-task.http.js.map +0 -1
  101. package/build/cjs/src/crm-tasks-v2-task.meta.d.ts +0 -27
  102. package/build/cjs/src/crm-tasks-v2-task.meta.js +0 -161
  103. package/build/cjs/src/crm-tasks-v2-task.meta.js.map +0 -1
  104. package/build/cjs/src/crm-tasks-v2-task.public.d.ts +0 -30
  105. package/build/cjs/src/crm-tasks-v2-task.public.js +0 -58
  106. package/build/cjs/src/crm-tasks-v2-task.public.js.map +0 -1
  107. package/build/cjs/src/crm-tasks-v2-task.types.d.ts +0 -430
  108. package/build/cjs/src/crm-tasks-v2-task.types.js +0 -29
  109. package/build/cjs/src/crm-tasks-v2-task.types.js.map +0 -1
  110. package/build/cjs/src/crm-tasks-v2-task.universal.d.ts +0 -678
  111. package/build/cjs/src/crm-tasks-v2-task.universal.js +0 -520
  112. package/build/cjs/src/crm-tasks-v2-task.universal.js.map +0 -1
  113. package/build/cjs/src/ping-notifications-v3-notification.http.d.ts +0 -15
  114. package/build/cjs/src/ping-notifications-v3-notification.http.js +0 -87
  115. package/build/cjs/src/ping-notifications-v3-notification.http.js.map +0 -1
  116. package/build/cjs/src/ping-notifications-v3-notification.public.d.ts +0 -8
  117. package/build/cjs/src/ping-notifications-v3-notification.public.js +0 -14
  118. package/build/cjs/src/ping-notifications-v3-notification.public.js.map +0 -1
  119. package/build/cjs/src/ping-notifications-v3-notification.types.d.ts +0 -113
  120. package/build/cjs/src/ping-notifications-v3-notification.types.js +0 -15
  121. package/build/cjs/src/ping-notifications-v3-notification.types.js.map +0 -1
  122. package/build/cjs/src/ping-notifications-v3-notification.universal.d.ts +0 -146
  123. package/build/cjs/src/ping-notifications-v3-notification.universal.js +0 -136
  124. package/build/cjs/src/ping-notifications-v3-notification.universal.js.map +0 -1
  125. package/build/es/index.typings.d.ts +0 -5
  126. package/build/es/index.typings.js +0 -6
  127. package/build/es/index.typings.js.map +0 -1
  128. package/build/es/src/contacts-v4-contact.context.d.ts +0 -9
  129. package/build/es/src/contacts-v4-contact.context.js +0 -114
  130. package/build/es/src/contacts-v4-contact.context.js.map +0 -1
  131. package/build/es/src/contacts-v4-contact.http.d.ts +0 -94
  132. package/build/es/src/contacts-v4-contact.http.js +0 -475
  133. package/build/es/src/contacts-v4-contact.http.js.map +0 -1
  134. package/build/es/src/contacts-v4-contact.meta.d.ts +0 -31
  135. package/build/es/src/contacts-v4-contact.meta.js +0 -128
  136. package/build/es/src/contacts-v4-contact.meta.js.map +0 -1
  137. package/build/es/src/contacts-v4-contact.public.d.ts +0 -49
  138. package/build/es/src/contacts-v4-contact.public.js +0 -40
  139. package/build/es/src/contacts-v4-contact.public.js.map +0 -1
  140. package/build/es/src/contacts-v4-contact.types.d.ts +0 -2199
  141. package/build/es/src/contacts-v4-contact.types.js +0 -267
  142. package/build/es/src/contacts-v4-contact.types.js.map +0 -1
  143. package/build/es/src/contacts-v4-contact.universal.d.ts +0 -2069
  144. package/build/es/src/contacts-v4-contact.universal.js +0 -897
  145. package/build/es/src/contacts-v4-contact.universal.js.map +0 -1
  146. package/build/es/src/contacts-v4-extended-field.context.d.ts +0 -7
  147. package/build/es/src/contacts-v4-extended-field.context.js +0 -82
  148. package/build/es/src/contacts-v4-extended-field.context.js.map +0 -1
  149. package/build/es/src/contacts-v4-extended-field.http.d.ts +0 -52
  150. package/build/es/src/contacts-v4-extended-field.http.js +0 -226
  151. package/build/es/src/contacts-v4-extended-field.http.js.map +0 -1
  152. package/build/es/src/contacts-v4-extended-field.meta.d.ts +0 -23
  153. package/build/es/src/contacts-v4-extended-field.meta.js +0 -92
  154. package/build/es/src/contacts-v4-extended-field.meta.js.map +0 -1
  155. package/build/es/src/contacts-v4-extended-field.public.d.ts +0 -23
  156. package/build/es/src/contacts-v4-extended-field.public.js +0 -30
  157. package/build/es/src/contacts-v4-extended-field.public.js.map +0 -1
  158. package/build/es/src/contacts-v4-extended-field.types.d.ts +0 -357
  159. package/build/es/src/contacts-v4-extended-field.types.js +0 -20
  160. package/build/es/src/contacts-v4-extended-field.types.js.map +0 -1
  161. package/build/es/src/contacts-v4-extended-field.universal.d.ts +0 -623
  162. package/build/es/src/contacts-v4-extended-field.universal.js +0 -403
  163. package/build/es/src/contacts-v4-extended-field.universal.js.map +0 -1
  164. package/build/es/src/contacts-v4-label.context.d.ts +0 -7
  165. package/build/es/src/contacts-v4-label.context.js +0 -82
  166. package/build/es/src/contacts-v4-label.context.js.map +0 -1
  167. package/build/es/src/contacts-v4-label.http.d.ts +0 -53
  168. package/build/es/src/contacts-v4-label.http.js +0 -227
  169. package/build/es/src/contacts-v4-label.http.js.map +0 -1
  170. package/build/es/src/contacts-v4-label.meta.d.ts +0 -23
  171. package/build/es/src/contacts-v4-label.meta.js +0 -92
  172. package/build/es/src/contacts-v4-label.meta.js.map +0 -1
  173. package/build/es/src/contacts-v4-label.public.d.ts +0 -21
  174. package/build/es/src/contacts-v4-label.public.js +0 -30
  175. package/build/es/src/contacts-v4-label.public.js.map +0 -1
  176. package/build/es/src/contacts-v4-label.types.d.ts +0 -349
  177. package/build/es/src/contacts-v4-label.types.js +0 -14
  178. package/build/es/src/contacts-v4-label.types.js.map +0 -1
  179. package/build/es/src/contacts-v4-label.universal.d.ts +0 -627
  180. package/build/es/src/contacts-v4-label.universal.js +0 -397
  181. package/build/es/src/contacts-v4-label.universal.js.map +0 -1
  182. package/build/es/src/contacts-v4-submit-contact.context.d.ts +0 -3
  183. package/build/es/src/contacts-v4-submit-contact.context.js +0 -18
  184. package/build/es/src/contacts-v4-submit-contact.context.js.map +0 -1
  185. package/build/es/src/contacts-v4-submit-contact.http.d.ts +0 -8
  186. package/build/es/src/contacts-v4-submit-contact.http.js +0 -86
  187. package/build/es/src/contacts-v4-submit-contact.http.js.map +0 -1
  188. package/build/es/src/contacts-v4-submit-contact.meta.d.ts +0 -13
  189. package/build/es/src/contacts-v4-submit-contact.meta.js +0 -20
  190. package/build/es/src/contacts-v4-submit-contact.meta.js.map +0 -1
  191. package/build/es/src/contacts-v4-submit-contact.public.d.ts +0 -8
  192. package/build/es/src/contacts-v4-submit-contact.public.js +0 -9
  193. package/build/es/src/contacts-v4-submit-contact.public.js.map +0 -1
  194. package/build/es/src/contacts-v4-submit-contact.types.d.ts +0 -541
  195. package/build/es/src/contacts-v4-submit-contact.types.js +0 -171
  196. package/build/es/src/contacts-v4-submit-contact.types.js.map +0 -1
  197. package/build/es/src/contacts-v4-submit-contact.universal.d.ts +0 -555
  198. package/build/es/src/contacts-v4-submit-contact.universal.js +0 -261
  199. package/build/es/src/contacts-v4-submit-contact.universal.js.map +0 -1
  200. package/build/es/src/crm-tasks-v2-task.context.d.ts +0 -9
  201. package/build/es/src/crm-tasks-v2-task.context.js +0 -114
  202. package/build/es/src/crm-tasks-v2-task.context.js.map +0 -1
  203. package/build/es/src/crm-tasks-v2-task.http.d.ts +0 -59
  204. package/build/es/src/crm-tasks-v2-task.http.js +0 -258
  205. package/build/es/src/crm-tasks-v2-task.http.js.map +0 -1
  206. package/build/es/src/crm-tasks-v2-task.meta.d.ts +0 -27
  207. package/build/es/src/crm-tasks-v2-task.meta.js +0 -128
  208. package/build/es/src/crm-tasks-v2-task.meta.js.map +0 -1
  209. package/build/es/src/crm-tasks-v2-task.public.d.ts +0 -30
  210. package/build/es/src/crm-tasks-v2-task.public.js +0 -40
  211. package/build/es/src/crm-tasks-v2-task.public.js.map +0 -1
  212. package/build/es/src/crm-tasks-v2-task.types.d.ts +0 -430
  213. package/build/es/src/crm-tasks-v2-task.types.js +0 -26
  214. package/build/es/src/crm-tasks-v2-task.types.js.map +0 -1
  215. package/build/es/src/crm-tasks-v2-task.universal.d.ts +0 -678
  216. package/build/es/src/crm-tasks-v2-task.universal.js +0 -487
  217. package/build/es/src/crm-tasks-v2-task.universal.js.map +0 -1
  218. package/build/es/src/ping-notifications-v3-notification.http.d.ts +0 -15
  219. package/build/es/src/ping-notifications-v3-notification.http.js +0 -83
  220. package/build/es/src/ping-notifications-v3-notification.http.js.map +0 -1
  221. package/build/es/src/ping-notifications-v3-notification.public.d.ts +0 -8
  222. package/build/es/src/ping-notifications-v3-notification.public.js +0 -9
  223. package/build/es/src/ping-notifications-v3-notification.public.js.map +0 -1
  224. package/build/es/src/ping-notifications-v3-notification.types.d.ts +0 -113
  225. package/build/es/src/ping-notifications-v3-notification.types.js +0 -12
  226. package/build/es/src/ping-notifications-v3-notification.types.js.map +0 -1
  227. package/build/es/src/ping-notifications-v3-notification.universal.d.ts +0 -146
  228. package/build/es/src/ping-notifications-v3-notification.universal.js +0 -109
  229. package/build/es/src/ping-notifications-v3-notification.universal.js.map +0 -1
@@ -1,897 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { serializer } from '@wix/metro-runtime/velo';
11
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
12
- import { EventDefinition } from '@wix/sdk-types';
13
- import * as ambassadorWixContactsV4Contact from './contacts-v4-contact.http';
14
- // @ts-ignore
15
- const _toVeloEntity = '$';
16
- const _fromVeloEntity = '$';
17
- export var ContactSourceType;
18
- (function (ContactSourceType) {
19
- ContactSourceType["OTHER"] = "OTHER";
20
- ContactSourceType["ADMIN"] = "ADMIN";
21
- ContactSourceType["WIX_APP"] = "WIX_APP";
22
- ContactSourceType["IMPORT"] = "IMPORT";
23
- ContactSourceType["THIRD_PARTY"] = "THIRD_PARTY";
24
- ContactSourceType["WIX_BOOKINGS"] = "WIX_BOOKINGS";
25
- ContactSourceType["WIX_CHAT"] = "WIX_CHAT";
26
- ContactSourceType["WIX_EMAIL_MARKETING"] = "WIX_EMAIL_MARKETING";
27
- ContactSourceType["WIX_EVENTS"] = "WIX_EVENTS";
28
- ContactSourceType["WIX_FORMS"] = "WIX_FORMS";
29
- ContactSourceType["WIX_GROUPS"] = "WIX_GROUPS";
30
- ContactSourceType["WIX_HOTELS"] = "WIX_HOTELS";
31
- ContactSourceType["WIX_MARKET_PLACE"] = "WIX_MARKET_PLACE";
32
- ContactSourceType["WIX_MUSIC"] = "WIX_MUSIC";
33
- ContactSourceType["WIX_RESTAURANTS"] = "WIX_RESTAURANTS";
34
- ContactSourceType["WIX_SITE_MEMBERS"] = "WIX_SITE_MEMBERS";
35
- ContactSourceType["WIX_STORES"] = "WIX_STORES";
36
- ContactSourceType["WIX_CODE"] = "WIX_CODE";
37
- ContactSourceType["HOPP"] = "HOPP";
38
- })(ContactSourceType || (ContactSourceType = {}));
39
- export var ContactActivityType;
40
- (function (ContactActivityType) {
41
- /** Last visit to your site (any unknown activity) */
42
- ContactActivityType["GENERAL"] = "GENERAL";
43
- /** This cannot be reported, used when contact created, will throw exception */
44
- ContactActivityType["CONTACT_CREATED"] = "CONTACT_CREATED";
45
- /** "auth/login" */
46
- ContactActivityType["MEMBER_LOGIN"] = "MEMBER_LOGIN";
47
- /** "auth/register" */
48
- ContactActivityType["MEMBER_REGISTER"] = "MEMBER_REGISTER";
49
- /** "auth/status-change" */
50
- ContactActivityType["MEMBER_STATUS_CHANGED"] = "MEMBER_STATUS_CHANGED";
51
- /** "contact/contact-form", (but also "form/contact-form", "form/form") */
52
- ContactActivityType["FORM_SUBMITTED"] = "FORM_SUBMITTED";
53
- /** "form/lead-capture-form" */
54
- ContactActivityType["INBOX_FORM_SUBMITTED"] = "INBOX_FORM_SUBMITTED";
55
- /** "chat/payment-request-paid" */
56
- ContactActivityType["INBOX_PAYMENT_REQUEST_PAID"] = "INBOX_PAYMENT_REQUEST_PAID";
57
- /** "messaging/email" - Direction BUSINESS_TO_CUSTOMER */
58
- ContactActivityType["INBOX_MESSAGE_TO_CUSTOMER"] = "INBOX_MESSAGE_TO_CUSTOMER";
59
- /** "messaging/email" - Direction CUSTOMER_TO_BUSINESS */
60
- ContactActivityType["INBOX_MESSAGE_FROM_CUSTOMER"] = "INBOX_MESSAGE_FROM_CUSTOMER";
61
- /** "contact/subscription-form" (but also "form/subscription-form") */
62
- ContactActivityType["NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED"] = "NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED";
63
- /** "contact/unsubscribe" */
64
- ContactActivityType["NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE"] = "NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE";
65
- /** "e_commerce/purchase" */
66
- ContactActivityType["ECOM_PURCHASE"] = "ECOM_PURCHASE";
67
- /** "e_commerce/cart-abandon" */
68
- ContactActivityType["ECOM_CART_ABANDON"] = "ECOM_CART_ABANDON";
69
- /** "e_commerce/checkout-buyer" */
70
- ContactActivityType["ECOM_CHECKOUT_BUYER"] = "ECOM_CHECKOUT_BUYER";
71
- /** "scheduler/appointment" */
72
- ContactActivityType["BOOKINGS_APPOINTMENT"] = "BOOKINGS_APPOINTMENT";
73
- /** "hotels/reservation" */
74
- ContactActivityType["HOTELS_RESERVATION"] = "HOTELS_RESERVATION";
75
- /** "hotels/purchase" */
76
- ContactActivityType["HOTELS_PURCHASE"] = "HOTELS_PURCHASE";
77
- /** "hotels/confirmation" */
78
- ContactActivityType["HOTELS_CONFIRMATION"] = "HOTELS_CONFIRMATION";
79
- /** "hotels/cancel" */
80
- ContactActivityType["HOTELS_CANCEL"] = "HOTELS_CANCEL";
81
- /** "video/purchase" */
82
- ContactActivityType["VIDEO_PURCHASE"] = "VIDEO_PURCHASE";
83
- /** "video/rent" */
84
- ContactActivityType["VIDEO_RENT"] = "VIDEO_RENT";
85
- /** "cashier/button_purchase" */
86
- ContactActivityType["CASHIER_BUTTON_PURCHASE"] = "CASHIER_BUTTON_PURCHASE";
87
- /** "arena/new-lead" */
88
- ContactActivityType["ARENA_NEW_LEAD"] = "ARENA_NEW_LEAD";
89
- /** "events/rsvp" */
90
- ContactActivityType["EVENTS_RSVP"] = "EVENTS_RSVP";
91
- /** "invoice/pay" */
92
- ContactActivityType["INVOICE_PAY"] = "INVOICE_PAY";
93
- /** "invoice/overdue" */
94
- ContactActivityType["INVOICE_OVERDUE"] = "INVOICE_OVERDUE";
95
- /** "price-quote/accept" */
96
- ContactActivityType["PRICE_QUOTE_ACCEPT"] = "PRICE_QUOTE_ACCEPT";
97
- /** "price-quote/expire" */
98
- ContactActivityType["PRICE_QUOTE_EXPIRE"] = "PRICE_QUOTE_EXPIRE";
99
- /** "restaurants/order" */
100
- ContactActivityType["RESTAURANTS_ORDER"] = "RESTAURANTS_ORDER";
101
- /** "restaurants/reservation" */
102
- ContactActivityType["RESTAURANTS_RESERVATION"] = "RESTAURANTS_RESERVATION";
103
- /** "shoutout/open" */
104
- ContactActivityType["SHOUTOUT_OPEN"] = "SHOUTOUT_OPEN";
105
- /** "shoutout/click" */
106
- ContactActivityType["SHOUTOUT_CLICK"] = "SHOUTOUT_CLICK";
107
- ContactActivityType["CONTACT_MERGED"] = "CONTACT_MERGED";
108
- /** "contact/subscribe" */
109
- ContactActivityType["NEWSLETTER_SUBSCRIPTION_SUBSCRIBE"] = "NEWSLETTER_SUBSCRIPTION_SUBSCRIBE";
110
- /** "contact/subscription-pending" */
111
- ContactActivityType["NEWSLETTER_SUBSCRIPTION_PENDING"] = "NEWSLETTER_SUBSCRIPTION_PENDING";
112
- /** "contact/subscription-not-set" */
113
- ContactActivityType["NEWSLETTER_SUBSCRIPTION_NOT_SET"] = "NEWSLETTER_SUBSCRIPTION_NOT_SET";
114
- /** "contact/phone-subscription-subscribe" */
115
- ContactActivityType["PHONE_SUBSCRIPTION_SUBSCRIBE"] = "PHONE_SUBSCRIPTION_SUBSCRIBE";
116
- /** "contact/phone-subscription-pending" */
117
- ContactActivityType["PHONE_SUBSCRIPTION_PENDING"] = "PHONE_SUBSCRIPTION_PENDING";
118
- /** "contact/phone-subscription-not-set" */
119
- ContactActivityType["PHONE_SUBSCRIPTION_NOT_SET"] = "PHONE_SUBSCRIPTION_NOT_SET";
120
- /** "contact/phone-subscription-unsubscribe" */
121
- ContactActivityType["PHONE_SUBSCRIPTION_UNSUBSCRIBE"] = "PHONE_SUBSCRIPTION_UNSUBSCRIBE";
122
- })(ContactActivityType || (ContactActivityType = {}));
123
- export var EmailTag;
124
- (function (EmailTag) {
125
- EmailTag["UNTAGGED"] = "UNTAGGED";
126
- EmailTag["MAIN"] = "MAIN";
127
- EmailTag["HOME"] = "HOME";
128
- EmailTag["WORK"] = "WORK";
129
- })(EmailTag || (EmailTag = {}));
130
- export var PhoneTag;
131
- (function (PhoneTag) {
132
- PhoneTag["UNTAGGED"] = "UNTAGGED";
133
- PhoneTag["MAIN"] = "MAIN";
134
- PhoneTag["HOME"] = "HOME";
135
- PhoneTag["MOBILE"] = "MOBILE";
136
- PhoneTag["WORK"] = "WORK";
137
- PhoneTag["FAX"] = "FAX";
138
- })(PhoneTag || (PhoneTag = {}));
139
- export var AddressTag;
140
- (function (AddressTag) {
141
- AddressTag["UNTAGGED"] = "UNTAGGED";
142
- AddressTag["HOME"] = "HOME";
143
- AddressTag["WORK"] = "WORK";
144
- AddressTag["BILLING"] = "BILLING";
145
- AddressTag["SHIPPING"] = "SHIPPING";
146
- })(AddressTag || (AddressTag = {}));
147
- export var SubdivisionType;
148
- (function (SubdivisionType) {
149
- SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
150
- /** State */
151
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
152
- /** County */
153
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
154
- /** City/town */
155
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
156
- /** Neighborhood/quarter */
157
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
158
- /** Street/block */
159
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
160
- /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
161
- SubdivisionType["COUNTRY"] = "COUNTRY";
162
- })(SubdivisionType || (SubdivisionType = {}));
163
- export var ImageProvider;
164
- (function (ImageProvider) {
165
- ImageProvider["UNKNOWN"] = "UNKNOWN";
166
- /** Image stored outside Wix */
167
- ImageProvider["EXTERNAL"] = "EXTERNAL";
168
- /** Stored in wix media platform, Must be uploaded by using `GeneratePictureUploadUrl` */
169
- ImageProvider["WIX_MEDIA"] = "WIX_MEDIA";
170
- })(ImageProvider || (ImageProvider = {}));
171
- export var SubscriptionStatus;
172
- (function (SubscriptionStatus) {
173
- SubscriptionStatus["NO_SUBSCRIPTION_STATUS"] = "NO_SUBSCRIPTION_STATUS";
174
- SubscriptionStatus["NOT_SET"] = "NOT_SET";
175
- SubscriptionStatus["PENDING"] = "PENDING";
176
- SubscriptionStatus["SUBSCRIBED"] = "SUBSCRIBED";
177
- SubscriptionStatus["UNSUBSCRIBED"] = "UNSUBSCRIBED";
178
- })(SubscriptionStatus || (SubscriptionStatus = {}));
179
- export var EmailDeliverabilityStatus;
180
- (function (EmailDeliverabilityStatus) {
181
- EmailDeliverabilityStatus["UNKNOWN_EMAIL_DELIVERABILITY_STATUS"] = "UNKNOWN_EMAIL_DELIVERABILITY_STATUS";
182
- EmailDeliverabilityStatus["NOT_SET"] = "NOT_SET";
183
- EmailDeliverabilityStatus["VALID"] = "VALID";
184
- EmailDeliverabilityStatus["BOUNCED"] = "BOUNCED";
185
- EmailDeliverabilityStatus["SPAM_COMPLAINT"] = "SPAM_COMPLAINT";
186
- EmailDeliverabilityStatus["INACTIVE"] = "INACTIVE";
187
- })(EmailDeliverabilityStatus || (EmailDeliverabilityStatus = {}));
188
- export var PhoneDeliverabilityStatus;
189
- (function (PhoneDeliverabilityStatus) {
190
- PhoneDeliverabilityStatus["NO_PHONE_DELIVERABILITY_STATUS"] = "NO_PHONE_DELIVERABILITY_STATUS";
191
- PhoneDeliverabilityStatus["NOT_SET"] = "NOT_SET";
192
- })(PhoneDeliverabilityStatus || (PhoneDeliverabilityStatus = {}));
193
- export var MemberStatus;
194
- (function (MemberStatus) {
195
- MemberStatus["UNKNOWN_MEMBER_STATUS"] = "UNKNOWN_MEMBER_STATUS";
196
- /** Pending admin approval */
197
- MemberStatus["PENDING"] = "PENDING";
198
- MemberStatus["ACTIVE"] = "ACTIVE";
199
- MemberStatus["DELETED"] = "DELETED";
200
- MemberStatus["BLOCKED"] = "BLOCKED";
201
- MemberStatus["OFFLINE"] = "OFFLINE";
202
- })(MemberStatus || (MemberStatus = {}));
203
- export var IdentityStatus;
204
- (function (IdentityStatus) {
205
- IdentityStatus["UNKNOWN_IDENTITY_STATUS"] = "UNKNOWN_IDENTITY_STATUS";
206
- IdentityStatus["PENDING_ADMIN_APPROVAL"] = "PENDING_ADMIN_APPROVAL";
207
- IdentityStatus["ACTIVE"] = "ACTIVE";
208
- IdentityStatus["DELETED"] = "DELETED";
209
- IdentityStatus["BLOCKED"] = "BLOCKED";
210
- IdentityStatus["OFFLINE"] = "OFFLINE";
211
- })(IdentityStatus || (IdentityStatus = {}));
212
- export var PrivacyStatus;
213
- (function (PrivacyStatus) {
214
- PrivacyStatus["UNKNOWN_PRIVACY_STATUS"] = "UNKNOWN_PRIVACY_STATUS";
215
- PrivacyStatus["PRIVATE"] = "PRIVATE";
216
- PrivacyStatus["PUBLIC"] = "PUBLIC";
217
- })(PrivacyStatus || (PrivacyStatus = {}));
218
- export var Role;
219
- (function (Role) {
220
- Role["UNSPECIFIED_ROLE"] = "UNSPECIFIED_ROLE";
221
- Role["OWNER"] = "OWNER";
222
- Role["CONTRIBUTOR"] = "CONTRIBUTOR";
223
- })(Role || (Role = {}));
224
- export var SortOrder;
225
- (function (SortOrder) {
226
- SortOrder["ASC"] = "ASC";
227
- SortOrder["DESC"] = "DESC";
228
- })(SortOrder || (SortOrder = {}));
229
- export var ContactFieldSet;
230
- (function (ContactFieldSet) {
231
- /** name, primaryEmail, primaryPhone */
232
- ContactFieldSet["BASIC"] = "BASIC";
233
- /** name, phones, emails, addresses */
234
- ContactFieldSet["COMMUNICATION_DETAILS"] = "COMMUNICATION_DETAILS";
235
- /** name, primaryInfo(email, phone), extendedFields */
236
- ContactFieldSet["EXTENDED"] = "EXTENDED";
237
- /** Full contact object */
238
- ContactFieldSet["FULL"] = "FULL";
239
- })(ContactFieldSet || (ContactFieldSet = {}));
240
- export var ContactsFacetType;
241
- (function (ContactsFacetType) {
242
- ContactsFacetType["UNKNOWN"] = "UNKNOWN";
243
- ContactsFacetType["ALL_CONTACTS"] = "ALL_CONTACTS";
244
- ContactsFacetType["NOT_LABELED"] = "NOT_LABELED";
245
- ContactsFacetType["LABEL"] = "LABEL";
246
- ContactsFacetType["SUBSCRIPTION_STATUS"] = "SUBSCRIPTION_STATUS";
247
- ContactsFacetType["MEMBERSHIP_STATUS"] = "MEMBERSHIP_STATUS";
248
- })(ContactsFacetType || (ContactsFacetType = {}));
249
- export var Action;
250
- (function (Action) {
251
- Action["UNKNOWN"] = "UNKNOWN";
252
- Action["UPDATED"] = "UPDATED";
253
- Action["CREATED"] = "CREATED";
254
- })(Action || (Action = {}));
255
- export var UpsertContactResponseAction;
256
- (function (UpsertContactResponseAction) {
257
- UpsertContactResponseAction["UNKNOWN"] = "UNKNOWN";
258
- UpsertContactResponseAction["UPDATED"] = "UPDATED";
259
- UpsertContactResponseAction["CREATED"] = "CREATED";
260
- })(UpsertContactResponseAction || (UpsertContactResponseAction = {}));
261
- export var GetContactResponseType;
262
- (function (GetContactResponseType) {
263
- /** Normal contact */
264
- GetContactResponseType["REGULAR"] = "REGULAR";
265
- /** Contact that id was already allocated for it, but the contact not yet created. */
266
- GetContactResponseType["IMPLICIT"] = "IMPLICIT";
267
- /** Contact was merged into another contact */
268
- GetContactResponseType["MERGED"] = "MERGED";
269
- })(GetContactResponseType || (GetContactResponseType = {}));
270
- export var SubmitOperation;
271
- (function (SubmitOperation) {
272
- SubmitOperation["UNKNOWN"] = "UNKNOWN";
273
- SubmitOperation["CREATE"] = "CREATE";
274
- SubmitOperation["UPDATE"] = "UPDATE";
275
- })(SubmitOperation || (SubmitOperation = {}));
276
- export var Mode;
277
- (function (Mode) {
278
- /** any */
279
- Mode["OR"] = "OR";
280
- /** all */
281
- Mode["AND"] = "AND";
282
- })(Mode || (Mode = {}));
283
- const _contact = {
284
- picture: 'wix.common.Image',
285
- info: '_contactInfo',
286
- memberInfo: '_memberInfo',
287
- };
288
- const _contactAddress = { address: 'wix.common.Address' };
289
- const _contactAddressesWrapper = { items: '_contactAddress' };
290
- const _contactInfo = {
291
- addresses: '_contactAddressesWrapper',
292
- picture: '_contactPicture',
293
- };
294
- const _contactPicture = { image: 'wix.common.Image' };
295
- const _createContactRequest = { info: '_contactInfo' };
296
- const _createContactResponse = { contact: '_contact' };
297
- const _deleteContactRequest = {};
298
- const _deleteContactResponse = {};
299
- const _getContactRequest = {};
300
- const _getContactResponse = { contact: '_contact' };
301
- const _labelContactRequest = {};
302
- const _labelContactResponse = { contact: '_contact' };
303
- const _memberInfo = { profileInfo: '_profileInfo' };
304
- const _mergeContactsRequest = {};
305
- const _mergeContactsResponse = { contact: '_contact' };
306
- const _profileInfo = { photo: 'wix.common.Image' };
307
- const _unlabelContactRequest = {};
308
- const _unlabelContactResponse = { contact: '_contact' };
309
- const _updateContactRequest = { info: '_contactInfo' };
310
- const _updateContactResponse = { contact: '_contact' };
311
- export const onContactCreated = EventDefinition('wix.contacts.v4.contact_created')();
312
- export const onContactUpdated = EventDefinition('wix.contacts.v4.contact_updated')();
313
- export const onContactMerged = EventDefinition('wix.contacts.v4.contact_merged')();
314
- export const onContactDeleted = EventDefinition('wix.contacts.v4.contact_deleted')();
315
- /**
316
- * Creates a new contact.
317
- *
318
- *
319
- * The `createContact()` function returns a Promise
320
- * that resolves to the new contact when it is created.
321
- *
322
- * The `info` parameter object must include a name, phone number, or email address.
323
- * If all 3 of these parameters are missing,
324
- * the contact won't be created.
325
- *
326
- * By default, if the call contains an email already in use by another contact, the new contact won't be created. To override this behavior, set `allowDuplicates` in the `options` object to `true`.
327
- *
328
- * @param info - Contact info.
329
- * @public
330
- * @documentationMaturity preview
331
- * @requiredField info
332
- * @param options - Create contact options.
333
- * @permissionScope Manage Contacts
334
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
335
- * @permissionScope Manage Members and Contacts - all permissions
336
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
337
- * @applicableIdentity APP
338
- * @returns Contact.
339
- */
340
- export function createContact(info, options) {
341
- var _a, _b, _c;
342
- return __awaiter(this, arguments, void 0, function* () {
343
- const requestTransformation = {
344
- info: '$[0]',
345
- allowDuplicates: '$[1].allowDuplicates',
346
- };
347
- const responseTransformation = '$';
348
- // @ts-ignore
349
- const { httpClient, sideEffects } = arguments[2];
350
- const { toAmbassadorRequest } = serializer({
351
- rootSchema: _createContactRequest,
352
- depSchemas: {
353
- _contactAddress,
354
- _contactAddressesWrapper,
355
- _contactInfo,
356
- _contactPicture,
357
- },
358
- fqdnTransformation: {
359
- paths: [],
360
- transformation: _fromVeloEntity,
361
- },
362
- customTransformation: requestTransformation,
363
- });
364
- const { fromJSON } = serializer({
365
- rootSchema: _createContactResponse,
366
- depSchemas: {
367
- _contact,
368
- _contactAddress,
369
- _contactAddressesWrapper,
370
- _contactInfo,
371
- _contactPicture,
372
- _memberInfo,
373
- _profileInfo,
374
- },
375
- fqdnTransformation: {
376
- paths: [...['contact']],
377
- transformation: _toVeloEntity,
378
- },
379
- customTransformation: responseTransformation,
380
- });
381
- const payload = toAmbassadorRequest([info, options]);
382
- const reqOpts = ambassadorWixContactsV4Contact.createContact(payload);
383
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
384
- try {
385
- const result = yield httpClient.request(reqOpts);
386
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
387
- return fromJSON(result.data);
388
- }
389
- catch (err) {
390
- const transformedError = sdkTransformError(err, {
391
- spreadPathsToArguments: {},
392
- explicitPathsToArguments: {
393
- info: '$[0]',
394
- allowDuplicates: '$[1].allowDuplicates',
395
- },
396
- singleArgumentUnchanged: false,
397
- }, ['info', 'options']);
398
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
399
- throw transformedError;
400
- }
401
- });
402
- }
403
- /**
404
- * Updates a contact's properties.
405
- *
406
- * The `updateContact()` function returns a Promise that resolves
407
- * when the specified contact's information is updated.
408
- *
409
- * Each time the contact is updated, `revision` increments by 1. The existing `revision` must be included when updating the contact. This ensures you're working with the latest contact information, and prevents unintended overwrites.
410
- *
411
- * @param contactId - ID of the contact to update.
412
- * @param info - Contact info.
413
- * @param revision - Revision number.
414
- * When updating, include the existing `revision`
415
- * to prevent conflicting updates.
416
- * @public
417
- * @documentationMaturity preview
418
- * @requiredField contactId
419
- * @requiredField info
420
- * @requiredField revision
421
- * @param options - Contact update options.
422
- * @permissionScope Manage Contacts
423
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
424
- * @permissionScope Manage Members and Contacts - all permissions
425
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
426
- * @applicableIdentity APP
427
- * @returns Updated contact.
428
- */
429
- export function updateContact(contactId, info, revision, options) {
430
- var _a, _b, _c;
431
- return __awaiter(this, arguments, void 0, function* () {
432
- const requestTransformation = {
433
- contactId: '$[0]',
434
- info: '$[1]',
435
- revision: '$[2]',
436
- allowDuplicates: '$[3].allowDuplicates',
437
- };
438
- const responseTransformation = '$';
439
- // @ts-ignore
440
- const { httpClient, sideEffects } = arguments[4];
441
- const { toAmbassadorRequest } = serializer({
442
- rootSchema: _updateContactRequest,
443
- depSchemas: {
444
- _contactAddress,
445
- _contactAddressesWrapper,
446
- _contactInfo,
447
- _contactPicture,
448
- },
449
- fqdnTransformation: {
450
- paths: [],
451
- transformation: _fromVeloEntity,
452
- },
453
- customTransformation: requestTransformation,
454
- });
455
- const { fromJSON } = serializer({
456
- rootSchema: _updateContactResponse,
457
- depSchemas: {
458
- _contact,
459
- _contactAddress,
460
- _contactAddressesWrapper,
461
- _contactInfo,
462
- _contactPicture,
463
- _memberInfo,
464
- _profileInfo,
465
- },
466
- fqdnTransformation: {
467
- paths: [...['contact']],
468
- transformation: _toVeloEntity,
469
- },
470
- customTransformation: responseTransformation,
471
- });
472
- const payload = toAmbassadorRequest([contactId, info, revision, options]);
473
- const reqOpts = ambassadorWixContactsV4Contact.updateContact(payload);
474
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
475
- try {
476
- const result = yield httpClient.request(reqOpts);
477
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
478
- return fromJSON(result.data);
479
- }
480
- catch (err) {
481
- const transformedError = sdkTransformError(err, {
482
- spreadPathsToArguments: {},
483
- explicitPathsToArguments: {
484
- contactId: '$[0]',
485
- info: '$[1]',
486
- revision: '$[2]',
487
- allowDuplicates: '$[3].allowDuplicates',
488
- },
489
- singleArgumentUnchanged: false,
490
- }, ['contactId', 'info', 'revision', 'options']);
491
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
492
- throw transformedError;
493
- }
494
- });
495
- }
496
- /**
497
- * Merges source contacts into a target contact.
498
- *
499
- * Merging contacts has these effects on the target contact:
500
- *
501
- * - No target contact data is overwritten or deleted.
502
- * - Arrays (emails, phones, addresses, and labels) are merged from the source contacts into the target contact.
503
- * - If merging more than one source contact, the 1st source is given precedence, then the 2nd, and so on.
504
- *
505
- * Source contacts are deleted when merging.
506
- * However, if a source contact is a site member or collaborator,
507
- * the `mergeContacts()` function fails because site collaborators and members can't be deleted.
508
- * Site members and collaborators can only be target contacts.
509
- *
510
- * After merging, if you call the `getContact()` function with a deleted source contact ID, the target contact ID is returned. This is only supported when calling `getContact()`. Previously deleted source contact IDs can't be passed in any other function.
511
- *
512
- * @param targetContactId - Target contact ID.
513
- * @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
514
- * To prevent conflicting changes,
515
- * the target contact's current revision must be passed.
516
- * @public
517
- * @documentationMaturity preview
518
- * @requiredField targetContactId
519
- * @requiredField targetContactRevision
520
- * @param options - Merge contacts options.
521
- * @permissionScope Manage Contacts
522
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
523
- * @permissionScope Manage Members and Contacts - all permissions
524
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
525
- * @applicableIdentity APP
526
- */
527
- export function mergeContacts(targetContactId, targetContactRevision, options) {
528
- var _a, _b, _c;
529
- return __awaiter(this, arguments, void 0, function* () {
530
- const requestTransformation = {
531
- targetContactId: '$[0]',
532
- targetContactRevision: '$[1]',
533
- sourceContactIds: '$[2].sourceContactIds',
534
- };
535
- const responseTransformation = '$';
536
- // @ts-ignore
537
- const { httpClient, sideEffects } = arguments[3];
538
- const { toAmbassadorRequest } = serializer({
539
- rootSchema: _mergeContactsRequest,
540
- depSchemas: {},
541
- fqdnTransformation: {
542
- paths: [],
543
- transformation: _fromVeloEntity,
544
- },
545
- customTransformation: requestTransformation,
546
- });
547
- const { fromJSON } = serializer({
548
- rootSchema: _mergeContactsResponse,
549
- depSchemas: {
550
- _contact,
551
- _contactAddress,
552
- _contactAddressesWrapper,
553
- _contactInfo,
554
- _contactPicture,
555
- _memberInfo,
556
- _profileInfo,
557
- },
558
- fqdnTransformation: {
559
- paths: [...['contact']],
560
- transformation: _toVeloEntity,
561
- },
562
- customTransformation: responseTransformation,
563
- });
564
- const payload = toAmbassadorRequest([
565
- targetContactId,
566
- targetContactRevision,
567
- options,
568
- ]);
569
- const reqOpts = ambassadorWixContactsV4Contact.mergeContacts(payload);
570
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
571
- try {
572
- const result = yield httpClient.request(reqOpts);
573
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
574
- return fromJSON(result.data);
575
- }
576
- catch (err) {
577
- const transformedError = sdkTransformError(err, {
578
- spreadPathsToArguments: {},
579
- explicitPathsToArguments: {
580
- targetContactId: '$[0]',
581
- targetContactRevision: '$[1]',
582
- sourceContactIds: '$[2].sourceContactIds',
583
- },
584
- singleArgumentUnchanged: false,
585
- }, ['targetContactId', 'targetContactRevision', 'options']);
586
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
587
- throw transformedError;
588
- }
589
- });
590
- }
591
- /**
592
- * Deletes a contact who is not a site member or contributor.
593
- *
594
- * The `deleteContact()` function returns a Promise
595
- * that resolves when the specified contact is deleted.
596
- *
597
- * Deleting a contact permanently removes them from your Contact List.
598
- *
599
- * If the contact is also a site member,
600
- * the member must be deleted first,
601
- * and then the contact can be deleted.
602
- *
603
- * @param contactId - ID of the contact to delete.
604
- * @public
605
- * @documentationMaturity preview
606
- * @requiredField contactId
607
- * @permissionScope Manage Contacts
608
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
609
- * @permissionScope Manage Members and Contacts - all permissions
610
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
611
- * @applicableIdentity APP
612
- */
613
- export function deleteContact(contactId) {
614
- var _a, _b, _c;
615
- return __awaiter(this, arguments, void 0, function* () {
616
- const requestTransformation = { contactId: '$[0]' };
617
- const responseTransformation = '$';
618
- // @ts-ignore
619
- const { httpClient, sideEffects } = arguments[1];
620
- const { toAmbassadorRequest } = serializer({
621
- rootSchema: _deleteContactRequest,
622
- depSchemas: {},
623
- fqdnTransformation: {
624
- paths: [],
625
- transformation: _fromVeloEntity,
626
- },
627
- customTransformation: requestTransformation,
628
- });
629
- const { fromJSON } = serializer({
630
- rootSchema: _deleteContactResponse,
631
- depSchemas: {},
632
- fqdnTransformation: {
633
- paths: [],
634
- transformation: _toVeloEntity,
635
- },
636
- customTransformation: responseTransformation,
637
- });
638
- const payload = toAmbassadorRequest([contactId]);
639
- const reqOpts = ambassadorWixContactsV4Contact.deleteContact(payload);
640
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
641
- try {
642
- const result = yield httpClient.request(reqOpts);
643
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
644
- }
645
- catch (err) {
646
- const transformedError = sdkTransformError(err, {
647
- spreadPathsToArguments: {},
648
- explicitPathsToArguments: { contactId: '$[0]' },
649
- singleArgumentUnchanged: false,
650
- }, ['contactId']);
651
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
652
- throw transformedError;
653
- }
654
- });
655
- }
656
- /**
657
- * Adds labels to a contact.
658
- *
659
- *
660
- * The `labelContact()` function returns a Promise
661
- * that resolves when the specified labels are added to the contact.
662
- * - **To create new labels:** Use `findOrCreateLabel()`.
663
- * - **To find labels:** Use `findOrCreateLabel()`, `getLabel()`, or `queryLabels()`.
664
- *
665
- * @param contactId - ID of the contact to add labels to.
666
- * @param labelKeys - List of label keys to add to the contact.
667
- *
668
- * Label keys must exist to be added to the contact.
669
- * Contact labels can be created with the
670
- * `findOrCreateLabel()` function. You can use the
671
- * `queryLabels()` function to view the currently existing labels.
672
- * @public
673
- * @documentationMaturity preview
674
- * @requiredField contactId
675
- * @requiredField labelKeys
676
- * @permissionScope Manage Contacts
677
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
678
- * @permissionScope Manage Members and Contacts - all permissions
679
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
680
- * @applicableIdentity APP
681
- * @returns Updated contact.
682
- */
683
- export function labelContact(contactId, labelKeys) {
684
- var _a, _b, _c;
685
- return __awaiter(this, arguments, void 0, function* () {
686
- const requestTransformation = { contactId: '$[0]', labelKeys: '$[1]' };
687
- const responseTransformation = '$';
688
- // @ts-ignore
689
- const { httpClient, sideEffects } = arguments[2];
690
- const { toAmbassadorRequest } = serializer({
691
- rootSchema: _labelContactRequest,
692
- depSchemas: {},
693
- fqdnTransformation: {
694
- paths: [],
695
- transformation: _fromVeloEntity,
696
- },
697
- customTransformation: requestTransformation,
698
- });
699
- const { fromJSON } = serializer({
700
- rootSchema: _labelContactResponse,
701
- depSchemas: {
702
- _contact,
703
- _contactAddress,
704
- _contactAddressesWrapper,
705
- _contactInfo,
706
- _contactPicture,
707
- _memberInfo,
708
- _profileInfo,
709
- },
710
- fqdnTransformation: {
711
- paths: [...['contact']],
712
- transformation: _toVeloEntity,
713
- },
714
- customTransformation: responseTransformation,
715
- });
716
- const payload = toAmbassadorRequest([contactId, labelKeys]);
717
- const reqOpts = ambassadorWixContactsV4Contact.labelContact(payload);
718
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
719
- try {
720
- const result = yield httpClient.request(reqOpts);
721
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
722
- return fromJSON(result.data);
723
- }
724
- catch (err) {
725
- const transformedError = sdkTransformError(err, {
726
- spreadPathsToArguments: {},
727
- explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
728
- singleArgumentUnchanged: false,
729
- }, ['contactId', 'labelKeys']);
730
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
731
- throw transformedError;
732
- }
733
- });
734
- }
735
- /**
736
- * Removes labels from a contact.
737
- *
738
- * The `unlabelContact()` function returns a Promise
739
- * that resolves when the specified labels are removed from the contact.
740
- *
741
- * If a label is no longer needed and you want to remove it from all contacts, you can remove it with the Labels `deleteLabel()` function.
742
- *
743
- * @param contactId - ID of the contact to remove labels from.
744
- * @param labelKeys - List of label keys to remove from the contact.
745
- * @public
746
- * @documentationMaturity preview
747
- * @requiredField contactId
748
- * @requiredField labelKeys
749
- * @permissionScope Manage Contacts
750
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
751
- * @permissionScope Manage Members and Contacts - all permissions
752
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
753
- * @applicableIdentity APP
754
- * @returns Updated contact.
755
- */
756
- export function unlabelContact(contactId, labelKeys) {
757
- var _a, _b, _c;
758
- return __awaiter(this, arguments, void 0, function* () {
759
- const requestTransformation = { contactId: '$[0]', labelKeys: '$[1]' };
760
- const responseTransformation = '$';
761
- // @ts-ignore
762
- const { httpClient, sideEffects } = arguments[2];
763
- const { toAmbassadorRequest } = serializer({
764
- rootSchema: _unlabelContactRequest,
765
- depSchemas: {},
766
- fqdnTransformation: {
767
- paths: [],
768
- transformation: _fromVeloEntity,
769
- },
770
- customTransformation: requestTransformation,
771
- });
772
- const { fromJSON } = serializer({
773
- rootSchema: _unlabelContactResponse,
774
- depSchemas: {
775
- _contact,
776
- _contactAddress,
777
- _contactAddressesWrapper,
778
- _contactInfo,
779
- _contactPicture,
780
- _memberInfo,
781
- _profileInfo,
782
- },
783
- fqdnTransformation: {
784
- paths: [...['contact']],
785
- transformation: _toVeloEntity,
786
- },
787
- customTransformation: responseTransformation,
788
- });
789
- const payload = toAmbassadorRequest([contactId, labelKeys]);
790
- const reqOpts = ambassadorWixContactsV4Contact.unlabelContact(payload);
791
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
792
- try {
793
- const result = yield httpClient.request(reqOpts);
794
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
795
- return fromJSON(result.data);
796
- }
797
- catch (err) {
798
- const transformedError = sdkTransformError(err, {
799
- spreadPathsToArguments: {},
800
- explicitPathsToArguments: { contactId: '$[0]', labelKeys: '$[1]' },
801
- singleArgumentUnchanged: false,
802
- }, ['contactId', 'labelKeys']);
803
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
804
- throw transformedError;
805
- }
806
- });
807
- }
808
- /**
809
- * Retrieves a contact.
810
- *
811
- *
812
- * The `getContact()` function returns a Promise
813
- * that resolves when the contact is found.
814
- *
815
- * #### Getting Merged Contacts
816
- * When a source contact is merged into a target contact, the source contact is deleted. When calling `getContact()` for a merged contact,
817
- * you can use the source or target contact ID. In both cases, the target contact is returned.
818
- *
819
- * This is supported only when calling `getContact()`on merged contacts. Previously deleted source contact IDs can't be passed to any other function.
820
- *
821
- * @param _id - ID of the contact to retrieve.
822
- * @public
823
- * @documentationMaturity preview
824
- * @requiredField _id
825
- * @param options - Get contact options.
826
- * @permissionScope Read Contacts
827
- * @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
828
- * @permissionScope Read Members and Contacts - all read permissions
829
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
830
- * @permissionScope Manage Contacts
831
- * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
832
- * @permissionScope Manage Members and Contacts - all permissions
833
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
834
- * @applicableIdentity APP
835
- * @returns The requested contact.
836
- */
837
- export function getContact(_id, options) {
838
- var _a, _b, _c;
839
- return __awaiter(this, arguments, void 0, function* () {
840
- const requestTransformation = {
841
- id: '$[0]',
842
- fields: '$[1].fields',
843
- fieldsets: '$[1].fieldsets',
844
- };
845
- const responseTransformation = '$.contact';
846
- // @ts-ignore
847
- const { httpClient, sideEffects } = arguments[2];
848
- const { toAmbassadorRequest } = serializer({
849
- rootSchema: _getContactRequest,
850
- depSchemas: {},
851
- fqdnTransformation: {
852
- paths: [],
853
- transformation: _fromVeloEntity,
854
- },
855
- customTransformation: requestTransformation,
856
- });
857
- const { fromJSON } = serializer({
858
- rootSchema: _getContactResponse,
859
- depSchemas: {
860
- _contact,
861
- _contactAddress,
862
- _contactAddressesWrapper,
863
- _contactInfo,
864
- _contactPicture,
865
- _memberInfo,
866
- _profileInfo,
867
- },
868
- fqdnTransformation: {
869
- paths: [...['contact']],
870
- transformation: _toVeloEntity,
871
- },
872
- customTransformation: responseTransformation,
873
- });
874
- const payload = toAmbassadorRequest([_id, options]);
875
- const reqOpts = ambassadorWixContactsV4Contact.getContact(payload);
876
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
877
- try {
878
- const result = yield httpClient.request(reqOpts);
879
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
880
- return fromJSON(result.data);
881
- }
882
- catch (err) {
883
- const transformedError = sdkTransformError(err, {
884
- spreadPathsToArguments: {},
885
- explicitPathsToArguments: {
886
- id: '$[0]',
887
- fields: '$[1].fields',
888
- fieldsets: '$[1].fieldsets',
889
- },
890
- singleArgumentUnchanged: false,
891
- }, ['_id', 'options']);
892
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
893
- throw transformedError;
894
- }
895
- });
896
- }
897
- //# sourceMappingURL=contacts-v4-contact.universal.js.map