@wix/events 1.0.146 → 1.0.147

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 (257) hide show
  1. package/build/cjs/index.d.ts +7 -1
  2. package/build/cjs/index.js +8 -2
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +7 -1
  5. package/build/cjs/index.typings.js +8 -2
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +7 -1
  8. package/build/cjs/meta.js +8 -2
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/src/events-guests-v1-guest.http.d.ts +23 -0
  11. package/build/cjs/src/events-guests-v1-guest.http.js +116 -0
  12. package/build/cjs/src/events-guests-v1-guest.http.js.map +1 -0
  13. package/build/cjs/src/events-guests-v1-guest.meta.d.ts +13 -0
  14. package/build/cjs/src/events-guests-v1-guest.meta.js +47 -0
  15. package/build/cjs/src/events-guests-v1-guest.meta.js.map +1 -0
  16. package/build/cjs/src/events-guests-v1-guest.public.d.ts +7 -0
  17. package/build/cjs/src/events-guests-v1-guest.public.js +24 -0
  18. package/build/cjs/src/events-guests-v1-guest.public.js.map +1 -0
  19. package/build/cjs/src/events-guests-v1-guest.types.d.ts +800 -0
  20. package/build/cjs/src/events-guests-v1-guest.types.js +105 -0
  21. package/build/cjs/src/events-guests-v1-guest.types.js.map +1 -0
  22. package/build/cjs/src/events-guests-v1-guest.universal.d.ts +864 -0
  23. package/build/cjs/src/events-guests-v1-guest.universal.js +241 -0
  24. package/build/cjs/src/events-guests-v1-guest.universal.js.map +1 -0
  25. package/build/cjs/src/events-v1-order-checkout.http.d.ts +89 -0
  26. package/build/cjs/src/events-v1-order-checkout.http.js +1073 -0
  27. package/build/cjs/src/events-v1-order-checkout.http.js.map +1 -0
  28. package/build/cjs/src/events-v1-order-checkout.meta.d.ts +26 -0
  29. package/build/cjs/src/events-v1-order-checkout.meta.js +180 -0
  30. package/build/cjs/src/events-v1-order-checkout.meta.js.map +1 -0
  31. package/build/cjs/src/events-v1-order-checkout.public.d.ts +15 -0
  32. package/build/cjs/src/events-v1-order-checkout.public.js +69 -0
  33. package/build/cjs/src/events-v1-order-checkout.public.js.map +1 -0
  34. package/build/cjs/src/events-v1-order-checkout.types.d.ts +3626 -0
  35. package/build/cjs/src/events-v1-order-checkout.types.js +145 -0
  36. package/build/cjs/src/events-v1-order-checkout.types.js.map +1 -0
  37. package/build/cjs/src/events-v1-order-checkout.universal.d.ts +3645 -0
  38. package/build/cjs/src/events-v1-order-checkout.universal.js +824 -0
  39. package/build/cjs/src/events-v1-order-checkout.universal.js.map +1 -0
  40. package/build/cjs/src/events-v1-order-orders.http.d.ts +121 -0
  41. package/build/cjs/src/events-v1-order-orders.http.js +1105 -0
  42. package/build/cjs/src/events-v1-order-orders.http.js.map +1 -0
  43. package/build/cjs/src/events-v1-order-orders.meta.d.ts +28 -0
  44. package/build/cjs/src/events-v1-order-orders.meta.js +142 -0
  45. package/build/cjs/src/events-v1-order-orders.meta.js.map +1 -0
  46. package/build/cjs/src/events-v1-order-orders.public.d.ts +220 -0
  47. package/build/cjs/src/events-v1-order-orders.public.js +57 -0
  48. package/build/cjs/src/events-v1-order-orders.public.js.map +1 -0
  49. package/build/cjs/src/events-v1-order-orders.types.d.ts +3626 -0
  50. package/build/cjs/src/events-v1-order-orders.types.js +145 -0
  51. package/build/cjs/src/events-v1-order-orders.types.js.map +1 -0
  52. package/build/cjs/src/events-v1-order-orders.universal.d.ts +3615 -0
  53. package/build/cjs/src/events-v1-order-orders.universal.js +679 -0
  54. package/build/cjs/src/events-v1-order-orders.universal.js.map +1 -0
  55. package/build/cjs/src/events-v1-ticket-definition.http.d.ts +50 -0
  56. package/build/cjs/src/events-v1-ticket-definition.http.js +413 -0
  57. package/build/cjs/src/events-v1-ticket-definition.http.js.map +1 -0
  58. package/build/cjs/src/events-v1-ticket-definition.meta.d.ts +23 -0
  59. package/build/cjs/src/{events-v3-ticket-definition.meta.js → events-v1-ticket-definition.meta.js} +42 -42
  60. package/build/cjs/src/events-v1-ticket-definition.meta.js.map +1 -0
  61. package/build/cjs/src/events-v1-ticket-definition.public.d.ts +61 -0
  62. package/build/cjs/src/events-v1-ticket-definition.public.js +57 -0
  63. package/build/cjs/src/events-v1-ticket-definition.public.js.map +1 -0
  64. package/build/cjs/src/events-v1-ticket-definition.types.d.ts +725 -0
  65. package/build/cjs/src/events-v1-ticket-definition.types.js +63 -0
  66. package/build/cjs/src/events-v1-ticket-definition.types.js.map +1 -0
  67. package/build/cjs/src/events-v1-ticket-definition.universal.d.ts +960 -0
  68. package/build/cjs/src/events-v1-ticket-definition.universal.js +618 -0
  69. package/build/cjs/src/events-v1-ticket-definition.universal.js.map +1 -0
  70. package/build/cjs/src/events-v1-ticket.http.d.ts +44 -0
  71. package/build/cjs/src/events-v1-ticket.http.js +570 -0
  72. package/build/cjs/src/events-v1-ticket.http.js.map +1 -0
  73. package/build/cjs/src/events-v1-ticket.meta.d.ts +28 -0
  74. package/build/cjs/src/events-v1-ticket.meta.js +142 -0
  75. package/build/cjs/src/events-v1-ticket.meta.js.map +1 -0
  76. package/build/cjs/src/events-v1-ticket.public.d.ts +45 -0
  77. package/build/cjs/src/events-v1-ticket.public.js +48 -0
  78. package/build/cjs/src/events-v1-ticket.public.js.map +1 -0
  79. package/build/cjs/src/events-v1-ticket.types.d.ts +791 -0
  80. package/build/cjs/src/events-v1-ticket.types.js +76 -0
  81. package/build/cjs/src/events-v1-ticket.types.js.map +1 -0
  82. package/build/cjs/src/events-v1-ticket.universal.d.ts +892 -0
  83. package/build/cjs/src/events-v1-ticket.universal.js +621 -0
  84. package/build/cjs/src/events-v1-ticket.universal.js.map +1 -0
  85. package/build/cjs/src/events-v2-policy.http.d.ts +80 -0
  86. package/build/cjs/src/events-v2-policy.http.js +308 -0
  87. package/build/cjs/src/events-v2-policy.http.js.map +1 -0
  88. package/build/cjs/src/events-v2-policy.meta.d.ts +24 -0
  89. package/build/cjs/src/events-v2-policy.meta.js +142 -0
  90. package/build/cjs/src/events-v2-policy.meta.js.map +1 -0
  91. package/build/cjs/src/events-v2-policy.public.d.ts +25 -0
  92. package/build/cjs/src/events-v2-policy.public.js +48 -0
  93. package/build/cjs/src/events-v2-policy.public.js.map +1 -0
  94. package/build/cjs/src/events-v2-policy.types.d.ts +405 -0
  95. package/build/cjs/src/events-v2-policy.types.js +56 -0
  96. package/build/cjs/src/events-v2-policy.types.js.map +1 -0
  97. package/build/cjs/src/events-v2-policy.universal.d.ts +654 -0
  98. package/build/cjs/src/events-v2-policy.universal.js +539 -0
  99. package/build/cjs/src/events-v2-policy.universal.js.map +1 -0
  100. package/build/cjs/src/events-v3-event.http.d.ts +69 -0
  101. package/build/cjs/src/events-v3-event.http.js +661 -0
  102. package/build/cjs/src/events-v3-event.http.js.map +1 -0
  103. package/build/cjs/src/events-v3-event.meta.d.ts +39 -0
  104. package/build/cjs/src/events-v3-event.meta.js +275 -0
  105. package/build/cjs/src/events-v3-event.meta.js.map +1 -0
  106. package/build/cjs/src/events-v3-event.public.d.ts +566 -0
  107. package/build/cjs/src/events-v3-event.public.js +106 -0
  108. package/build/cjs/src/events-v3-event.public.js.map +1 -0
  109. package/build/cjs/src/events-v3-event.types.d.ts +3611 -0
  110. package/build/cjs/src/events-v3-event.types.js +261 -0
  111. package/build/cjs/src/events-v3-event.types.js.map +1 -0
  112. package/build/cjs/src/events-v3-event.universal.d.ts +3779 -0
  113. package/build/cjs/src/events-v3-event.universal.js +1165 -0
  114. package/build/cjs/src/events-v3-event.universal.js.map +1 -0
  115. package/build/es/index.d.ts +7 -1
  116. package/build/es/index.js +7 -1
  117. package/build/es/index.js.map +1 -1
  118. package/build/es/index.typings.d.ts +7 -1
  119. package/build/es/index.typings.js +7 -1
  120. package/build/es/index.typings.js.map +1 -1
  121. package/build/es/meta.d.ts +7 -1
  122. package/build/es/meta.js +7 -1
  123. package/build/es/meta.js.map +1 -1
  124. package/build/es/src/events-guests-v1-guest.http.d.ts +23 -0
  125. package/build/es/src/events-guests-v1-guest.http.js +112 -0
  126. package/build/es/src/events-guests-v1-guest.http.js.map +1 -0
  127. package/build/es/src/events-guests-v1-guest.meta.d.ts +13 -0
  128. package/build/es/src/events-guests-v1-guest.meta.js +20 -0
  129. package/build/es/src/events-guests-v1-guest.meta.js.map +1 -0
  130. package/build/es/src/events-guests-v1-guest.public.d.ts +7 -0
  131. package/build/es/src/events-guests-v1-guest.public.js +9 -0
  132. package/build/es/src/events-guests-v1-guest.public.js.map +1 -0
  133. package/build/es/src/events-guests-v1-guest.types.d.ts +800 -0
  134. package/build/es/src/events-guests-v1-guest.types.js +102 -0
  135. package/build/es/src/events-guests-v1-guest.types.js.map +1 -0
  136. package/build/es/src/events-guests-v1-guest.universal.d.ts +864 -0
  137. package/build/es/src/events-guests-v1-guest.universal.js +214 -0
  138. package/build/es/src/events-guests-v1-guest.universal.js.map +1 -0
  139. package/build/es/src/events-v1-order-checkout.http.d.ts +89 -0
  140. package/build/es/src/events-v1-order-checkout.http.js +1056 -0
  141. package/build/es/src/events-v1-order-checkout.http.js.map +1 -0
  142. package/build/es/src/events-v1-order-checkout.meta.d.ts +26 -0
  143. package/build/es/src/events-v1-order-checkout.meta.js +146 -0
  144. package/build/es/src/events-v1-order-checkout.meta.js.map +1 -0
  145. package/build/es/src/events-v1-order-checkout.public.d.ts +15 -0
  146. package/build/es/src/events-v1-order-checkout.public.js +44 -0
  147. package/build/es/src/events-v1-order-checkout.public.js.map +1 -0
  148. package/build/es/src/events-v1-order-checkout.types.d.ts +3626 -0
  149. package/build/es/src/events-v1-order-checkout.types.js +142 -0
  150. package/build/es/src/events-v1-order-checkout.types.js.map +1 -0
  151. package/build/es/src/events-v1-order-checkout.universal.d.ts +3645 -0
  152. package/build/es/src/events-v1-order-checkout.universal.js +790 -0
  153. package/build/es/src/events-v1-order-checkout.universal.js.map +1 -0
  154. package/build/es/src/events-v1-order-orders.http.d.ts +121 -0
  155. package/build/es/src/events-v1-order-orders.http.js +1088 -0
  156. package/build/es/src/events-v1-order-orders.http.js.map +1 -0
  157. package/build/es/src/events-v1-order-orders.meta.d.ts +28 -0
  158. package/build/es/src/events-v1-order-orders.meta.js +110 -0
  159. package/build/es/src/events-v1-order-orders.meta.js.map +1 -0
  160. package/build/es/src/events-v1-order-orders.public.d.ts +220 -0
  161. package/build/es/src/events-v1-order-orders.public.js +34 -0
  162. package/build/es/src/events-v1-order-orders.public.js.map +1 -0
  163. package/build/es/src/events-v1-order-orders.types.d.ts +3626 -0
  164. package/build/es/src/events-v1-order-orders.types.js +142 -0
  165. package/build/es/src/events-v1-order-orders.types.js.map +1 -0
  166. package/build/es/src/events-v1-order-orders.universal.d.ts +3615 -0
  167. package/build/es/src/events-v1-order-orders.universal.js +647 -0
  168. package/build/es/src/events-v1-order-orders.universal.js.map +1 -0
  169. package/build/es/src/events-v1-ticket-definition.http.d.ts +50 -0
  170. package/build/es/src/events-v1-ticket-definition.http.js +403 -0
  171. package/build/es/src/events-v1-ticket-definition.http.js.map +1 -0
  172. package/build/es/src/events-v1-ticket-definition.meta.d.ts +23 -0
  173. package/build/es/src/{events-v3-ticket-definition.meta.js → events-v1-ticket-definition.meta.js} +35 -35
  174. package/build/es/src/events-v1-ticket-definition.meta.js.map +1 -0
  175. package/build/es/src/events-v1-ticket-definition.public.d.ts +61 -0
  176. package/build/es/src/events-v1-ticket-definition.public.js +39 -0
  177. package/build/es/src/events-v1-ticket-definition.public.js.map +1 -0
  178. package/build/es/src/events-v1-ticket-definition.types.d.ts +725 -0
  179. package/build/es/src/events-v1-ticket-definition.types.js +60 -0
  180. package/build/es/src/events-v1-ticket-definition.types.js.map +1 -0
  181. package/build/es/src/events-v1-ticket-definition.universal.d.ts +960 -0
  182. package/build/es/src/events-v1-ticket-definition.universal.js +585 -0
  183. package/build/es/src/events-v1-ticket-definition.universal.js.map +1 -0
  184. package/build/es/src/events-v1-ticket.http.d.ts +44 -0
  185. package/build/es/src/events-v1-ticket.http.js +561 -0
  186. package/build/es/src/events-v1-ticket.http.js.map +1 -0
  187. package/build/es/src/events-v1-ticket.meta.d.ts +28 -0
  188. package/build/es/src/events-v1-ticket.meta.js +110 -0
  189. package/build/es/src/events-v1-ticket.meta.js.map +1 -0
  190. package/build/es/src/events-v1-ticket.public.d.ts +45 -0
  191. package/build/es/src/events-v1-ticket.public.js +34 -0
  192. package/build/es/src/events-v1-ticket.public.js.map +1 -0
  193. package/build/es/src/events-v1-ticket.types.d.ts +791 -0
  194. package/build/es/src/events-v1-ticket.types.js +73 -0
  195. package/build/es/src/events-v1-ticket.types.js.map +1 -0
  196. package/build/es/src/events-v1-ticket.universal.d.ts +892 -0
  197. package/build/es/src/events-v1-ticket.universal.js +589 -0
  198. package/build/es/src/events-v1-ticket.universal.js.map +1 -0
  199. package/build/es/src/events-v2-policy.http.d.ts +80 -0
  200. package/build/es/src/events-v2-policy.http.js +299 -0
  201. package/build/es/src/events-v2-policy.http.js.map +1 -0
  202. package/build/es/src/events-v2-policy.meta.d.ts +24 -0
  203. package/build/es/src/events-v2-policy.meta.js +110 -0
  204. package/build/es/src/events-v2-policy.meta.js.map +1 -0
  205. package/build/es/src/events-v2-policy.public.d.ts +25 -0
  206. package/build/es/src/events-v2-policy.public.js +34 -0
  207. package/build/es/src/events-v2-policy.public.js.map +1 -0
  208. package/build/es/src/events-v2-policy.types.d.ts +405 -0
  209. package/build/es/src/events-v2-policy.types.js +53 -0
  210. package/build/es/src/events-v2-policy.types.js.map +1 -0
  211. package/build/es/src/events-v2-policy.universal.d.ts +654 -0
  212. package/build/es/src/events-v2-policy.universal.js +507 -0
  213. package/build/es/src/events-v2-policy.universal.js.map +1 -0
  214. package/build/es/src/events-v3-event.http.d.ts +69 -0
  215. package/build/es/src/events-v3-event.http.js +645 -0
  216. package/build/es/src/events-v3-event.http.js.map +1 -0
  217. package/build/es/src/events-v3-event.meta.d.ts +39 -0
  218. package/build/es/src/events-v3-event.meta.js +236 -0
  219. package/build/es/src/events-v3-event.meta.js.map +1 -0
  220. package/build/es/src/events-v3-event.public.d.ts +566 -0
  221. package/build/es/src/events-v3-event.public.js +69 -0
  222. package/build/es/src/events-v3-event.public.js.map +1 -0
  223. package/build/es/src/events-v3-event.types.d.ts +3611 -0
  224. package/build/es/src/events-v3-event.types.js +258 -0
  225. package/build/es/src/events-v3-event.types.js.map +1 -0
  226. package/build/es/src/events-v3-event.universal.d.ts +3779 -0
  227. package/build/es/src/events-v3-event.universal.js +1126 -0
  228. package/build/es/src/events-v3-event.universal.js.map +1 -0
  229. package/package.json +2 -2
  230. package/build/cjs/src/events-v3-ticket-definition.http.d.ts +0 -33
  231. package/build/cjs/src/events-v3-ticket-definition.http.js +0 -271
  232. package/build/cjs/src/events-v3-ticket-definition.http.js.map +0 -1
  233. package/build/cjs/src/events-v3-ticket-definition.meta.d.ts +0 -25
  234. package/build/cjs/src/events-v3-ticket-definition.meta.js.map +0 -1
  235. package/build/cjs/src/events-v3-ticket-definition.public.d.ts +0 -98
  236. package/build/cjs/src/events-v3-ticket-definition.public.js +0 -63
  237. package/build/cjs/src/events-v3-ticket-definition.public.js.map +0 -1
  238. package/build/cjs/src/events-v3-ticket-definition.types.d.ts +0 -1265
  239. package/build/cjs/src/events-v3-ticket-definition.types.js +0 -195
  240. package/build/cjs/src/events-v3-ticket-definition.types.js.map +0 -1
  241. package/build/cjs/src/events-v3-ticket-definition.universal.d.ts +0 -1449
  242. package/build/cjs/src/events-v3-ticket-definition.universal.js +0 -698
  243. package/build/cjs/src/events-v3-ticket-definition.universal.js.map +0 -1
  244. package/build/es/src/events-v3-ticket-definition.http.d.ts +0 -33
  245. package/build/es/src/events-v3-ticket-definition.http.js +0 -261
  246. package/build/es/src/events-v3-ticket-definition.http.js.map +0 -1
  247. package/build/es/src/events-v3-ticket-definition.meta.d.ts +0 -25
  248. package/build/es/src/events-v3-ticket-definition.meta.js.map +0 -1
  249. package/build/es/src/events-v3-ticket-definition.public.d.ts +0 -98
  250. package/build/es/src/events-v3-ticket-definition.public.js +0 -39
  251. package/build/es/src/events-v3-ticket-definition.public.js.map +0 -1
  252. package/build/es/src/events-v3-ticket-definition.types.d.ts +0 -1265
  253. package/build/es/src/events-v3-ticket-definition.types.js +0 -192
  254. package/build/es/src/events-v3-ticket-definition.types.js.map +0 -1
  255. package/build/es/src/events-v3-ticket-definition.universal.d.ts +0 -1449
  256. package/build/es/src/events-v3-ticket-definition.universal.js +0 -665
  257. package/build/es/src/events-v3-ticket-definition.universal.js.map +0 -1
@@ -0,0 +1,790 @@
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 * as ambassadorWixEventsV1Order from './events-v1-order-checkout.http';
13
+ let __verbose = false;
14
+ function __log(...args) {
15
+ __verbose && console.log(...args);
16
+ }
17
+ function __inspect(obj) {
18
+ return obj;
19
+ }
20
+ export const __debug = {
21
+ verboseLogging: {
22
+ on: () => (__verbose = true),
23
+ off: () => (__verbose = false),
24
+ },
25
+ };
26
+ const _toVeloEntity = '$';
27
+ const _fromVeloEntity = '$';
28
+ export var SubdivisionType;
29
+ (function (SubdivisionType) {
30
+ SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
31
+ /** State */
32
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
33
+ /** County */
34
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
35
+ /** City/town */
36
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
37
+ /** Neighborhood/quarter */
38
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
39
+ /** Street/block */
40
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
41
+ /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
42
+ SubdivisionType["COUNTRY"] = "COUNTRY";
43
+ })(SubdivisionType || (SubdivisionType = {}));
44
+ export var OrderStatus;
45
+ (function (OrderStatus) {
46
+ /** Order status not available for this request fieldset */
47
+ OrderStatus["NA_ORDER_STATUS"] = "NA_ORDER_STATUS";
48
+ /** Order is confirmed, no payment required */
49
+ OrderStatus["FREE"] = "FREE";
50
+ /** Order was paid but payment gateway suspended the payment. Eventually changes to PAID */
51
+ OrderStatus["PENDING"] = "PENDING";
52
+ /** Order paid via payment gateway */
53
+ OrderStatus["PAID"] = "PAID";
54
+ /** Order confirmed but has to be paid via offline payment and status manually updated to PAID */
55
+ OrderStatus["OFFLINE_PENDING"] = "OFFLINE_PENDING";
56
+ /** Order is awaiting for payment in Cashier */
57
+ OrderStatus["INITIATED"] = "INITIATED";
58
+ /** Order was canceled */
59
+ OrderStatus["CANCELED"] = "CANCELED";
60
+ /** Order payment was declined */
61
+ OrderStatus["DECLINED"] = "DECLINED";
62
+ })(OrderStatus || (OrderStatus = {}));
63
+ export var ChannelType;
64
+ (function (ChannelType) {
65
+ /** Buyer created order via one of the online channels (website, mobile app, etc.) */
66
+ ChannelType["ONLINE"] = "ONLINE";
67
+ /** Order created and money collected by the sales person */
68
+ ChannelType["OFFLINE_POS"] = "OFFLINE_POS";
69
+ })(ChannelType || (ChannelType = {}));
70
+ export var TaxType;
71
+ (function (TaxType) {
72
+ /** Tax is included in the ticket price */
73
+ TaxType["INCLUDED"] = "INCLUDED";
74
+ /** Tax is added to the order at the checkout */
75
+ TaxType["ADDED"] = "ADDED";
76
+ /** Tax is added to the final total at the checkout */
77
+ TaxType["ADDED_AT_CHECKOUT"] = "ADDED_AT_CHECKOUT";
78
+ })(TaxType || (TaxType = {}));
79
+ export var FeeName;
80
+ (function (FeeName) {
81
+ /** Wix service fee charges applied to the line item. */
82
+ FeeName["WIX_FEE"] = "WIX_FEE";
83
+ })(FeeName || (FeeName = {}));
84
+ export var FeeType;
85
+ (function (FeeType) {
86
+ /** Fee is added to the ticket price at checkout */
87
+ FeeType["FEE_ADDED"] = "FEE_ADDED";
88
+ /** Seller absorbs the fee. It is deducted from the ticket price */
89
+ FeeType["FEE_INCLUDED"] = "FEE_INCLUDED";
90
+ /** Fee is added to the ticket price at checkout */
91
+ FeeType["FEE_ADDED_AT_CHECKOUT"] = "FEE_ADDED_AT_CHECKOUT";
92
+ })(FeeType || (FeeType = {}));
93
+ export var OrderType;
94
+ (function (OrderType) {
95
+ /** Buyer form is used for all tickets */
96
+ OrderType["UNASSIGNED_TICKETS"] = "UNASSIGNED_TICKETS";
97
+ /** Each order ticket has its own form */
98
+ OrderType["ASSIGNED_TICKETS"] = "ASSIGNED_TICKETS";
99
+ })(OrderType || (OrderType = {}));
100
+ export var OrderFieldset;
101
+ (function (OrderFieldset) {
102
+ /** Include tickets in response */
103
+ OrderFieldset["TICKETS"] = "TICKETS";
104
+ /** Include order details: status, first_name, last_name, email, created, etc. */
105
+ OrderFieldset["DETAILS"] = "DETAILS";
106
+ /** Include checkout_form */
107
+ OrderFieldset["FORM"] = "FORM";
108
+ /** Include invoice */
109
+ OrderFieldset["INVOICE"] = "INVOICE";
110
+ })(OrderFieldset || (OrderFieldset = {}));
111
+ export var OrderTag;
112
+ (function (OrderTag) {
113
+ /** Return only confirmed orders */
114
+ OrderTag["CONFIRMED"] = "CONFIRMED";
115
+ /** Return only unconfirmed orders */
116
+ OrderTag["UNCONFIRMED"] = "UNCONFIRMED";
117
+ /** Return only member orders */
118
+ OrderTag["MEMBER"] = "MEMBER";
119
+ /** Return only archived orders */
120
+ OrderTag["ARCHIVED"] = "ARCHIVED";
121
+ /** Return only non archived orders */
122
+ OrderTag["NON_ARCHIVED"] = "NON_ARCHIVED";
123
+ /** Return only orders with all guests checked-in */
124
+ OrderTag["FULLY_CHECKED_IN"] = "FULLY_CHECKED_IN";
125
+ /** Return only orders with no guests checked-in */
126
+ OrderTag["NOT_FULLY_CHECKED_IN"] = "NOT_FULLY_CHECKED_IN";
127
+ })(OrderTag || (OrderTag = {}));
128
+ export var ReservationStatus;
129
+ (function (ReservationStatus) {
130
+ /**
131
+ * Reservation is pending confirmation.
132
+ * The reservation will expire after the expiration due time.
133
+ */
134
+ ReservationStatus["RESERVATION_PENDING"] = "RESERVATION_PENDING";
135
+ /** The reservation was confirmed and will not expire. */
136
+ ReservationStatus["RESERVATION_CONFIRMED"] = "RESERVATION_CONFIRMED";
137
+ /** The reservation was canceled because of non payment. */
138
+ ReservationStatus["RESERVATION_CANCELED"] = "RESERVATION_CANCELED";
139
+ /** The reservation was canceled manually by the buyer. */
140
+ ReservationStatus["RESERVATION_CANCELED_MANUALLY"] = "RESERVATION_CANCELED_MANUALLY";
141
+ /** The reservation has expired. */
142
+ ReservationStatus["RESERVATION_EXPIRED"] = "RESERVATION_EXPIRED";
143
+ })(ReservationStatus || (ReservationStatus = {}));
144
+ export var State;
145
+ (function (State) {
146
+ State["INCLUDE_HIDDEN_NOT_ON_SALE"] = "INCLUDE_HIDDEN_NOT_ON_SALE";
147
+ })(State || (State = {}));
148
+ export var TicketSaleStatus;
149
+ (function (TicketSaleStatus) {
150
+ /** Ticket sale is scheduled to start */
151
+ TicketSaleStatus["SALE_SCHEDULED"] = "SALE_SCHEDULED";
152
+ /** Ticket sale has started */
153
+ TicketSaleStatus["SALE_STARTED"] = "SALE_STARTED";
154
+ /** Ticket sale has ended */
155
+ TicketSaleStatus["SALE_ENDED"] = "SALE_ENDED";
156
+ })(TicketSaleStatus || (TicketSaleStatus = {}));
157
+ export var Type;
158
+ (function (Type) {
159
+ Type["STANDARD"] = "STANDARD";
160
+ Type["DONATION"] = "DONATION";
161
+ })(Type || (Type = {}));
162
+ export var TicketDefinitionFieldset;
163
+ (function (TicketDefinitionFieldset) {
164
+ /** Include policy in the response. */
165
+ TicketDefinitionFieldset["POLICY"] = "POLICY";
166
+ /** Include dashboard in the response. */
167
+ TicketDefinitionFieldset["DASHBOARD"] = "DASHBOARD";
168
+ })(TicketDefinitionFieldset || (TicketDefinitionFieldset = {}));
169
+ const _cancelReservationRequest = {};
170
+ const _cancelReservationResponse = {};
171
+ const _checkoutRequest = { guests: '_guest' };
172
+ const _checkoutResponse = { order: '_order' };
173
+ const _createReservationRequest = {};
174
+ const _createReservationResponse = {};
175
+ const _formattedAddress = { address: 'wix.common.Address' };
176
+ const _formResponse = { inputValues: '_inputValue' };
177
+ const _getCheckoutOptionsRequest = {};
178
+ const _getCheckoutOptionsResponse = {};
179
+ const _getInvoiceRequest = {};
180
+ const _getInvoiceResponse = {};
181
+ const _guest = { form: '_formResponse' };
182
+ const _guestDetails = { form: '_formResponse' };
183
+ const _inputValue = { address: '_formattedAddress' };
184
+ const _listAvailableTicketsRequest = {};
185
+ const _listAvailableTicketsResponse = {};
186
+ const _order = { checkoutForm: '_formResponse', tickets: '_ticketingTicket' };
187
+ const _queryAvailableTicketsRequest = {};
188
+ const _queryAvailableTicketsResponse = {};
189
+ const _ticketingTicket = { guestDetails: '_guestDetails' };
190
+ const _updateCheckoutRequest = { guests: '_guest' };
191
+ const _updateCheckoutResponse = { order: '_order' };
192
+ /**
193
+ * Returns checkout meta data used in checkout UX.
194
+ * <!--
195
+ * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.
196
+ * -->
197
+ * @public
198
+ * @documentationMaturity preview
199
+ * @permissionScope Manage Events - all permissions
200
+ * @permissionScope Manage Orders
201
+ * @applicableIdentity APP
202
+ * @applicableIdentity MEMBER
203
+ * @applicableIdentity VISITOR
204
+ */
205
+ export function getCheckoutOptions() {
206
+ var _a, _b, _c;
207
+ return __awaiter(this, arguments, void 0, function* () {
208
+ const requestTransformation = {};
209
+ const responseTransformation = '$';
210
+ // @ts-ignore
211
+ const { httpClient, sideEffects } = arguments[0];
212
+ const { toAmbassadorRequest } = serializer({
213
+ rootSchema: _getCheckoutOptionsRequest,
214
+ depSchemas: {},
215
+ fqdnTransformation: {
216
+ paths: [],
217
+ transformation: _fromVeloEntity,
218
+ },
219
+ customTransformation: requestTransformation,
220
+ });
221
+ const { fromJSON } = serializer({
222
+ rootSchema: _getCheckoutOptionsResponse,
223
+ depSchemas: {},
224
+ fqdnTransformation: {
225
+ paths: [],
226
+ transformation: _toVeloEntity,
227
+ },
228
+ customTransformation: responseTransformation,
229
+ });
230
+ const payload = toAmbassadorRequest([]);
231
+ const reqOpts = ambassadorWixEventsV1Order.getCheckoutOptions(payload);
232
+ __log(`"GetCheckoutOptions" sending request with: ${__inspect(reqOpts)}`);
233
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
234
+ try {
235
+ const result = yield httpClient.request(reqOpts);
236
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
237
+ return fromJSON(result.data);
238
+ }
239
+ catch (err) {
240
+ const transformedError = sdkTransformError(err, {
241
+ spreadPathsToArguments: {},
242
+ explicitPathsToArguments: {},
243
+ singleArgumentUnchanged: false,
244
+ }, []);
245
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
246
+ throw transformedError;
247
+ }
248
+ });
249
+ }
250
+ /**
251
+ * Returns tickets available to reserve.
252
+ * <!--
253
+ * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.
254
+ * -->
255
+ * @public
256
+ * @documentationMaturity preview
257
+ * @param options - An object representing the available options for retrieving a list of tickets available for reservation.
258
+ * @permissionScope Manage Events - all permissions
259
+ * @permissionScope Manage Orders
260
+ * @applicableIdentity APP
261
+ * @applicableIdentity MEMBER
262
+ * @applicableIdentity VISITOR
263
+ */
264
+ export function listAvailableTickets(options) {
265
+ var _a, _b, _c;
266
+ return __awaiter(this, arguments, void 0, function* () {
267
+ const requestTransformation = {
268
+ eventId: '$[0].eventId',
269
+ offset: '$[0].offset',
270
+ limit: '$[0].limit',
271
+ sort: '$[0].sort',
272
+ state: '$[0].state',
273
+ };
274
+ const responseTransformation = '$';
275
+ // @ts-ignore
276
+ const { httpClient, sideEffects } = arguments[1];
277
+ const { toAmbassadorRequest } = serializer({
278
+ rootSchema: _listAvailableTicketsRequest,
279
+ depSchemas: {},
280
+ fqdnTransformation: {
281
+ paths: [],
282
+ transformation: _fromVeloEntity,
283
+ },
284
+ customTransformation: requestTransformation,
285
+ });
286
+ const { fromJSON } = serializer({
287
+ rootSchema: _listAvailableTicketsResponse,
288
+ depSchemas: {},
289
+ fqdnTransformation: {
290
+ paths: [],
291
+ transformation: _toVeloEntity,
292
+ },
293
+ customTransformation: responseTransformation,
294
+ });
295
+ const payload = toAmbassadorRequest([options]);
296
+ const reqOpts = ambassadorWixEventsV1Order.listAvailableTickets(payload);
297
+ __log(`"ListAvailableTickets" sending request with: ${__inspect(reqOpts)}`);
298
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
299
+ try {
300
+ const result = yield httpClient.request(reqOpts);
301
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
302
+ return fromJSON(result.data);
303
+ }
304
+ catch (err) {
305
+ const transformedError = sdkTransformError(err, {
306
+ spreadPathsToArguments: {},
307
+ explicitPathsToArguments: {
308
+ eventId: '$[0].eventId',
309
+ offset: '$[0].offset',
310
+ limit: '$[0].limit',
311
+ sort: '$[0].sort',
312
+ state: '$[0].state',
313
+ },
314
+ singleArgumentUnchanged: false,
315
+ }, ['options']);
316
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
317
+ throw transformedError;
318
+ }
319
+ });
320
+ }
321
+ /**
322
+ * Returns tickets available to reserve.
323
+ * <!--
324
+ * > Note: The fieldsets in this function are restricted and only run if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.
325
+ * -->
326
+ * @public
327
+ * @documentationMaturity preview
328
+ * @param options - An object representing the available options for retrieving a list of tickets available for reservation.
329
+ * @permissionScope Manage Events - all permissions
330
+ * @permissionScope Manage Orders
331
+ * @applicableIdentity APP
332
+ * @applicableIdentity MEMBER
333
+ * @applicableIdentity VISITOR
334
+ */
335
+ export function queryAvailableTickets(options) {
336
+ var _a, _b, _c;
337
+ return __awaiter(this, arguments, void 0, function* () {
338
+ const requestTransformation = {
339
+ offset: '$[0].offset',
340
+ limit: '$[0].limit',
341
+ filter: '$[0].filter',
342
+ fieldset: '$[0].fieldset',
343
+ sort: '$[0].sort',
344
+ };
345
+ const responseTransformation = '$';
346
+ // @ts-ignore
347
+ const { httpClient, sideEffects } = arguments[1];
348
+ const { toAmbassadorRequest } = serializer({
349
+ rootSchema: _queryAvailableTicketsRequest,
350
+ depSchemas: {},
351
+ fqdnTransformation: {
352
+ paths: [],
353
+ transformation: _fromVeloEntity,
354
+ },
355
+ customTransformation: requestTransformation,
356
+ });
357
+ const { fromJSON } = serializer({
358
+ rootSchema: _queryAvailableTicketsResponse,
359
+ depSchemas: {},
360
+ fqdnTransformation: {
361
+ paths: [],
362
+ transformation: _toVeloEntity,
363
+ },
364
+ customTransformation: responseTransformation,
365
+ });
366
+ const payload = toAmbassadorRequest([options]);
367
+ const reqOpts = ambassadorWixEventsV1Order.queryAvailableTickets(payload);
368
+ __log(`"QueryAvailableTickets" sending request with: ${__inspect(reqOpts)}`);
369
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
370
+ try {
371
+ const result = yield httpClient.request(reqOpts);
372
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
373
+ return fromJSON(result.data);
374
+ }
375
+ catch (err) {
376
+ const transformedError = sdkTransformError(err, {
377
+ spreadPathsToArguments: {},
378
+ explicitPathsToArguments: {
379
+ offset: '$[0].offset',
380
+ limit: '$[0].limit',
381
+ filter: '$[0].filter',
382
+ fieldset: '$[0].fieldset',
383
+ sort: '$[0].sort',
384
+ },
385
+ singleArgumentUnchanged: false,
386
+ }, ['options']);
387
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
388
+ throw transformedError;
389
+ }
390
+ });
391
+ }
392
+ /**
393
+ * Reserves tickets for 20 minutes.
394
+ * Reserved tickets are deducted from tickets stock and cannot be bought by another party.
395
+ * When the reservation expires, the tickets are added back in the stock.
396
+ * <!--
397
+ * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.
398
+ * -->
399
+ * @param eventId - Event ID.
400
+ * @public
401
+ * @documentationMaturity preview
402
+ * @requiredField eventId
403
+ * @param options - An object representing the available options for creating a reservation.
404
+ * @permissionScope Manage Events - all permissions
405
+ * @permissionScope Manage Orders
406
+ * @applicableIdentity APP
407
+ * @applicableIdentity MEMBER
408
+ * @applicableIdentity VISITOR
409
+ */
410
+ export function createReservation(eventId, options) {
411
+ var _a, _b, _c;
412
+ return __awaiter(this, arguments, void 0, function* () {
413
+ const requestTransformation = {
414
+ eventId: '$[0]',
415
+ ticketQuantities: '$[1].ticketQuantities',
416
+ ignoreLimits: '$[1].ignoreLimits',
417
+ allowHiddenTickets: '$[1].allowHiddenTickets',
418
+ };
419
+ const responseTransformation = '$';
420
+ // @ts-ignore
421
+ const { httpClient, sideEffects } = arguments[2];
422
+ const { toAmbassadorRequest } = serializer({
423
+ rootSchema: _createReservationRequest,
424
+ depSchemas: {},
425
+ fqdnTransformation: {
426
+ paths: [],
427
+ transformation: _fromVeloEntity,
428
+ },
429
+ customTransformation: requestTransformation,
430
+ });
431
+ const { fromJSON } = serializer({
432
+ rootSchema: _createReservationResponse,
433
+ depSchemas: {},
434
+ fqdnTransformation: {
435
+ paths: [],
436
+ transformation: _toVeloEntity,
437
+ },
438
+ customTransformation: responseTransformation,
439
+ });
440
+ const payload = toAmbassadorRequest([eventId, options]);
441
+ const reqOpts = ambassadorWixEventsV1Order.createReservation(payload);
442
+ __log(`"CreateReservation" sending request with: ${__inspect(reqOpts)}`);
443
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
444
+ try {
445
+ const result = yield httpClient.request(reqOpts);
446
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
447
+ return fromJSON(result.data);
448
+ }
449
+ catch (err) {
450
+ const transformedError = sdkTransformError(err, {
451
+ spreadPathsToArguments: {},
452
+ explicitPathsToArguments: {
453
+ eventId: '$[0]',
454
+ ticketQuantities: '$[1].ticketQuantities',
455
+ ignoreLimits: '$[1].ignoreLimits',
456
+ allowHiddenTickets: '$[1].allowHiddenTickets',
457
+ },
458
+ singleArgumentUnchanged: false,
459
+ }, ['eventId', 'options']);
460
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
461
+ throw transformedError;
462
+ }
463
+ });
464
+ }
465
+ /**
466
+ * Cancels ticket reservation and returns tickets to stock.
467
+ * <!--
468
+ * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.
469
+ * -->
470
+ * @param _id - Reservation ID.
471
+ * @param eventId - Event ID.
472
+ * @public
473
+ * @documentationMaturity preview
474
+ * @requiredField _id
475
+ * @requiredField eventId
476
+ * @param identifiers - An object containing identifiers for the reservation to be cancelled.
477
+ * @permissionScope Manage Events - all permissions
478
+ * @permissionScope Manage Orders
479
+ * @applicableIdentity APP
480
+ * @applicableIdentity MEMBER
481
+ * @applicableIdentity VISITOR
482
+ */
483
+ export function cancelReservation(_id, eventId) {
484
+ var _a, _b, _c;
485
+ return __awaiter(this, arguments, void 0, function* () {
486
+ const requestTransformation = { id: '$[0]', eventId: '$[1]' };
487
+ const responseTransformation = '$';
488
+ // @ts-ignore
489
+ const { httpClient, sideEffects } = arguments[2];
490
+ const { toAmbassadorRequest } = serializer({
491
+ rootSchema: _cancelReservationRequest,
492
+ depSchemas: {},
493
+ fqdnTransformation: {
494
+ paths: [],
495
+ transformation: _fromVeloEntity,
496
+ },
497
+ customTransformation: requestTransformation,
498
+ });
499
+ const { fromJSON } = serializer({
500
+ rootSchema: _cancelReservationResponse,
501
+ depSchemas: {},
502
+ fqdnTransformation: {
503
+ paths: [],
504
+ transformation: _toVeloEntity,
505
+ },
506
+ customTransformation: responseTransformation,
507
+ });
508
+ const payload = toAmbassadorRequest([_id, eventId]);
509
+ const reqOpts = ambassadorWixEventsV1Order.cancelReservation(payload);
510
+ __log(`"CancelReservation" sending request with: ${__inspect(reqOpts)}`);
511
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
512
+ try {
513
+ const result = yield httpClient.request(reqOpts);
514
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
515
+ }
516
+ catch (err) {
517
+ const transformedError = sdkTransformError(err, {
518
+ spreadPathsToArguments: {},
519
+ explicitPathsToArguments: { id: '$[0]', eventId: '$[1]' },
520
+ singleArgumentUnchanged: false,
521
+ }, ['_id', 'eventId']);
522
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
523
+ throw transformedError;
524
+ }
525
+ });
526
+ }
527
+ /**
528
+ * Generates a preview of a reservation invoice, including the given coupon or pricing plan.
529
+ * <!--
530
+ * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.
531
+ * -->
532
+ * @param reservationId - Reservation ID.
533
+ * @param eventId - Event ID.
534
+ * @public
535
+ * @documentationMaturity preview
536
+ * @requiredField eventId
537
+ * @requiredField reservationId
538
+ * @param options - An object representing the available options for generating a preview of a reservation invoice.
539
+ * @param identifiers - An object containing identifiers for the reservation invoice preview to be generated.
540
+ * @permissionScope Read Events - all read permissions
541
+ * @permissionScope Manage Events - all permissions
542
+ * @permissionScope Read Basic Events Order Info
543
+ * @permissionScope Manage Orders
544
+ * @applicableIdentity APP
545
+ * @applicableIdentity MEMBER
546
+ * @applicableIdentity VISITOR
547
+ */
548
+ export function getInvoice(reservationId, eventId, options) {
549
+ var _a, _b, _c;
550
+ return __awaiter(this, arguments, void 0, function* () {
551
+ const requestTransformation = {
552
+ reservationId: '$[0]',
553
+ eventId: '$[1]',
554
+ withDiscount: '$[2].withDiscount',
555
+ paidPlanBenefit: '$[2].paidPlanBenefit',
556
+ };
557
+ const responseTransformation = '$';
558
+ // @ts-ignore
559
+ const { httpClient, sideEffects } = arguments[3];
560
+ const { toAmbassadorRequest } = serializer({
561
+ rootSchema: _getInvoiceRequest,
562
+ depSchemas: {},
563
+ fqdnTransformation: {
564
+ paths: [],
565
+ transformation: _fromVeloEntity,
566
+ },
567
+ customTransformation: requestTransformation,
568
+ });
569
+ const { fromJSON } = serializer({
570
+ rootSchema: _getInvoiceResponse,
571
+ depSchemas: {},
572
+ fqdnTransformation: {
573
+ paths: [],
574
+ transformation: _toVeloEntity,
575
+ },
576
+ customTransformation: responseTransformation,
577
+ });
578
+ const payload = toAmbassadorRequest([reservationId, eventId, options]);
579
+ const reqOpts = ambassadorWixEventsV1Order.getInvoice(payload);
580
+ __log(`"GetInvoice" sending request with: ${__inspect(reqOpts)}`);
581
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
582
+ try {
583
+ const result = yield httpClient.request(reqOpts);
584
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
585
+ return fromJSON(result.data);
586
+ }
587
+ catch (err) {
588
+ const transformedError = sdkTransformError(err, {
589
+ spreadPathsToArguments: {},
590
+ explicitPathsToArguments: {
591
+ reservationId: '$[0]',
592
+ eventId: '$[1]',
593
+ withDiscount: '$[2].withDiscount',
594
+ paidPlanBenefit: '$[2].paidPlanBenefit',
595
+ },
596
+ singleArgumentUnchanged: false,
597
+ }, ['reservationId', 'eventId', 'options']);
598
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
599
+ throw transformedError;
600
+ }
601
+ });
602
+ }
603
+ /**
604
+ * Checkout of reserved tickets.
605
+ *
606
+ *
607
+ * Creates order and associates it with a site contact.
608
+ * Guest details must be sent according to the Registration Form input fields.
609
+ * (To change an existing "INITIATED, "PENDING", or "OFFLINE_PENDING" order, call the [Update Checkout](https://dev.wix.com/api/rest/wix-events/wix-events/checkout/update-checkout) endpoint).
610
+ *
611
+ * There is a possibility to use a separate ready-made Wix checkout form where the user will be redirected from your non-Wix site or a custom ticket picker created with Velo.
612
+ * To construct the checkout form path, get your event base URL by using the [`getEvent()`](https://www.wix.com/velo/reference/wix-events-backend/wixevents/getevent) function and add the following path:
613
+ * `/{{EVENT_PAGE_SLUG}}/{{SLUG}}/ticket-form?reservationId={{YOUR_RESERVATION_ID}}`
614
+ *
615
+ * Example: `https://johndoe.wixsite.com/weddings/event-details/doe-wedding/ticket-form?reservationId=2be6d34a-2a1e-459f-897b-b4a66e73f69a`
616
+ *
617
+ * <!--
618
+ * > Note: This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function.
619
+ * -->
620
+ * @param eventId - Event ID.
621
+ * @public
622
+ * @documentationMaturity preview
623
+ * @requiredField eventId
624
+ * @requiredField options.guests.form
625
+ * @param options - An object representing the available options for checking out a reserved ticket.
626
+ * @permissionScope Manage Events - all permissions
627
+ * @permissionScope Manage Orders
628
+ * @applicableIdentity APP
629
+ * @applicableIdentity MEMBER
630
+ * @applicableIdentity VISITOR
631
+ */
632
+ export function checkout(eventId, options) {
633
+ var _a, _b, _c;
634
+ return __awaiter(this, arguments, void 0, function* () {
635
+ const requestTransformation = {
636
+ eventId: '$[0]',
637
+ reservationId: '$[1].reservationId',
638
+ memberId: '$[1].memberId',
639
+ discount: '$[1].discount',
640
+ buyer: '$[1].buyer',
641
+ guests: '$[1].guests',
642
+ paidPlanBenefit: '$[1].paidPlanBenefit',
643
+ options: '$[1].options',
644
+ };
645
+ const responseTransformation = '$';
646
+ // @ts-ignore
647
+ const { httpClient, sideEffects } = arguments[2];
648
+ const { toAmbassadorRequest } = serializer({
649
+ rootSchema: _checkoutRequest,
650
+ depSchemas: { _formResponse, _formattedAddress, _guest, _inputValue },
651
+ fqdnTransformation: {
652
+ paths: [],
653
+ transformation: _fromVeloEntity,
654
+ },
655
+ customTransformation: requestTransformation,
656
+ });
657
+ const { fromJSON } = serializer({
658
+ rootSchema: _checkoutResponse,
659
+ depSchemas: {
660
+ _formResponse,
661
+ _formattedAddress,
662
+ _guestDetails,
663
+ _inputValue,
664
+ _order,
665
+ _ticketingTicket,
666
+ },
667
+ fqdnTransformation: {
668
+ paths: [...['order']],
669
+ transformation: _toVeloEntity,
670
+ },
671
+ customTransformation: responseTransformation,
672
+ });
673
+ const payload = toAmbassadorRequest([eventId, options]);
674
+ const reqOpts = ambassadorWixEventsV1Order.checkout(payload);
675
+ __log(`"Checkout" sending request with: ${__inspect(reqOpts)}`);
676
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
677
+ try {
678
+ const result = yield httpClient.request(reqOpts);
679
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
680
+ return fromJSON(result.data);
681
+ }
682
+ catch (err) {
683
+ const transformedError = sdkTransformError(err, {
684
+ spreadPathsToArguments: {},
685
+ explicitPathsToArguments: {
686
+ eventId: '$[0]',
687
+ reservationId: '$[1].reservationId',
688
+ memberId: '$[1].memberId',
689
+ discount: '$[1].discount',
690
+ buyer: '$[1].buyer',
691
+ guests: '$[1].guests',
692
+ paidPlanBenefit: '$[1].paidPlanBenefit',
693
+ options: '$[1].options',
694
+ },
695
+ singleArgumentUnchanged: false,
696
+ }, ['eventId', 'options']);
697
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
698
+ throw transformedError;
699
+ }
700
+ });
701
+ }
702
+ /**
703
+ * Updates order and tickets (supported only for unconfirmed orders).
704
+ * Guest details must be sent according to Registration Form input fields.
705
+ * <!--
706
+ * > Note: This function is restricted and only runs if you elevate permissions using the [wix-auth.elevate()](https://www.wix.com/velo/reference/wix-auth/elevate) function.
707
+ * -->
708
+ * @param orderNumber - Unique order number.
709
+ * @param eventId - Event ID.
710
+ * @public
711
+ * @documentationMaturity preview
712
+ * @requiredField eventId
713
+ * @requiredField orderNumber
714
+ * @param options - An object representing the available options for updating an order and tickets.
715
+ * @param identifiers - An object containing identifiers for the order and tickets to be updated.
716
+ * @permissionScope Manage Events - all permissions
717
+ * @permissionScope Manage Orders
718
+ * @applicableIdentity APP
719
+ * @applicableIdentity MEMBER
720
+ * @applicableIdentity VISITOR
721
+ */
722
+ export function updateCheckout(orderNumber, eventId, options) {
723
+ var _a, _b, _c;
724
+ return __awaiter(this, arguments, void 0, function* () {
725
+ const requestTransformation = {
726
+ orderNumber: '$[0]',
727
+ eventId: '$[1]',
728
+ buyer: '$[2].buyer',
729
+ guests: '$[2].guests',
730
+ memberId: '$[2].memberId',
731
+ discount: '$[2].discount',
732
+ paidPlanBenefit: '$[2].paidPlanBenefit',
733
+ };
734
+ const responseTransformation = '$';
735
+ // @ts-ignore
736
+ const { httpClient, sideEffects } = arguments[3];
737
+ const { toAmbassadorRequest } = serializer({
738
+ rootSchema: _updateCheckoutRequest,
739
+ depSchemas: { _formResponse, _formattedAddress, _guest, _inputValue },
740
+ fqdnTransformation: {
741
+ paths: [],
742
+ transformation: _fromVeloEntity,
743
+ },
744
+ customTransformation: requestTransformation,
745
+ });
746
+ const { fromJSON } = serializer({
747
+ rootSchema: _updateCheckoutResponse,
748
+ depSchemas: {
749
+ _formResponse,
750
+ _formattedAddress,
751
+ _guestDetails,
752
+ _inputValue,
753
+ _order,
754
+ _ticketingTicket,
755
+ },
756
+ fqdnTransformation: {
757
+ paths: [...['order']],
758
+ transformation: _toVeloEntity,
759
+ },
760
+ customTransformation: responseTransformation,
761
+ });
762
+ const payload = toAmbassadorRequest([orderNumber, eventId, options]);
763
+ const reqOpts = ambassadorWixEventsV1Order.updateCheckout(payload);
764
+ __log(`"UpdateCheckout" sending request with: ${__inspect(reqOpts)}`);
765
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
766
+ try {
767
+ const result = yield httpClient.request(reqOpts);
768
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
769
+ return fromJSON(result.data);
770
+ }
771
+ catch (err) {
772
+ const transformedError = sdkTransformError(err, {
773
+ spreadPathsToArguments: {},
774
+ explicitPathsToArguments: {
775
+ orderNumber: '$[0]',
776
+ eventId: '$[1]',
777
+ buyer: '$[2].buyer',
778
+ guests: '$[2].guests',
779
+ memberId: '$[2].memberId',
780
+ discount: '$[2].discount',
781
+ paidPlanBenefit: '$[2].paidPlanBenefit',
782
+ },
783
+ singleArgumentUnchanged: false,
784
+ }, ['orderNumber', 'eventId', 'options']);
785
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
786
+ throw transformedError;
787
+ }
788
+ });
789
+ }
790
+ //# sourceMappingURL=events-v1-order-checkout.universal.js.map