@wix/events 1.0.13 → 1.0.14

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