@wix/events 1.0.11 → 1.0.13

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 (121) hide show
  1. package/build/cjs/index.d.ts +5 -0
  2. package/build/cjs/index.js +6 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.d.ts +6 -0
  5. package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.js +27 -0
  6. package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.js.map +1 -0
  7. package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.d.ts +353 -0
  8. package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.js +237 -0
  9. package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.js.map +1 -0
  10. package/build/cjs/src/events-schedule-v1-schedule-item-schedule.public.d.ts +13 -0
  11. package/build/cjs/src/events-schedule-v1-schedule-item-schedule.public.js +63 -0
  12. package/build/cjs/src/events-schedule-v1-schedule-item-schedule.public.js.map +1 -0
  13. package/build/cjs/src/events-schedule-v1-schedule-item-schedule.universal.d.ts +490 -0
  14. package/build/cjs/src/events-schedule-v1-schedule-item-schedule.universal.js +600 -0
  15. package/build/cjs/src/events-schedule-v1-schedule-item-schedule.universal.js.map +1 -0
  16. package/build/cjs/src/events-schedule-v1-schedule-item.http.d.ts +49 -0
  17. package/build/cjs/src/events-schedule-v1-schedule-item.http.js +485 -0
  18. package/build/cjs/src/events-schedule-v1-schedule-item.http.js.map +1 -0
  19. package/build/cjs/src/events-schedule-v1-schedule-item.types.d.ts +318 -0
  20. package/build/cjs/src/events-schedule-v1-schedule-item.types.js +27 -0
  21. package/build/cjs/src/events-schedule-v1-schedule-item.types.js.map +1 -0
  22. package/build/cjs/src/events-v1-category.http.d.ts +35 -0
  23. package/build/cjs/src/events-v1-category.http.js +592 -0
  24. package/build/cjs/src/events-v1-category.http.js.map +1 -0
  25. package/build/cjs/src/events-v1-category.public.d.ts +17 -0
  26. package/build/cjs/src/events-v1-category.public.js +87 -0
  27. package/build/cjs/src/events-v1-category.public.js.map +1 -0
  28. package/build/cjs/src/events-v1-category.types.d.ts +234 -0
  29. package/build/cjs/src/events-v1-category.types.js +27 -0
  30. package/build/cjs/src/events-v1-category.types.js.map +1 -0
  31. package/build/cjs/src/events-v1-category.universal.d.ts +399 -0
  32. package/build/cjs/src/events-v1-category.universal.js +778 -0
  33. package/build/cjs/src/events-v1-category.universal.js.map +1 -0
  34. package/build/cjs/src/events-v1-event.http.d.ts +90 -0
  35. package/build/cjs/src/events-v1-event.http.js +932 -0
  36. package/build/cjs/src/events-v1-event.http.js.map +1 -0
  37. package/build/cjs/src/events-v1-event.public.d.ts +19 -0
  38. package/build/cjs/src/events-v1-event.public.js +112 -0
  39. package/build/cjs/src/events-v1-event.public.js.map +1 -0
  40. package/build/cjs/src/events-v1-event.types.d.ts +1473 -0
  41. package/build/cjs/src/events-v1-event.types.js +198 -0
  42. package/build/cjs/src/events-v1-event.types.js.map +1 -0
  43. package/build/cjs/src/events-v1-event.universal.d.ts +1784 -0
  44. package/build/cjs/src/events-v1-event.universal.js +1130 -0
  45. package/build/cjs/src/events-v1-event.universal.js.map +1 -0
  46. package/build/cjs/src/events-v1-form.http.d.ts +25 -0
  47. package/build/cjs/src/events-v1-form.http.js +431 -0
  48. package/build/cjs/src/events-v1-form.http.js.map +1 -0
  49. package/build/cjs/src/events-v1-form.public.d.ts +11 -0
  50. package/build/cjs/src/events-v1-form.public.js +53 -0
  51. package/build/cjs/src/events-v1-form.public.js.map +1 -0
  52. package/build/cjs/src/events-v1-form.types.d.ts +657 -0
  53. package/build/cjs/src/events-v1-form.types.js +69 -0
  54. package/build/cjs/src/events-v1-form.types.js.map +1 -0
  55. package/build/cjs/src/events-v1-form.universal.d.ts +778 -0
  56. package/build/cjs/src/events-v1-form.universal.js +528 -0
  57. package/build/cjs/src/events-v1-form.universal.js.map +1 -0
  58. package/build/cjs/src/events-v2-policy.universal.d.ts +8 -1
  59. package/build/cjs/src/events-v2-policy.universal.js +8 -1
  60. package/build/cjs/src/events-v2-policy.universal.js.map +1 -1
  61. package/build/es/index.d.ts +5 -0
  62. package/build/es/index.js +5 -0
  63. package/build/es/index.js.map +1 -1
  64. package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.d.ts +6 -0
  65. package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.js +18 -0
  66. package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.js.map +1 -0
  67. package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.d.ts +353 -0
  68. package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.js +212 -0
  69. package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.js.map +1 -0
  70. package/build/es/src/events-schedule-v1-schedule-item-schedule.public.d.ts +13 -0
  71. package/build/es/src/events-schedule-v1-schedule-item-schedule.public.js +48 -0
  72. package/build/es/src/events-schedule-v1-schedule-item-schedule.public.js.map +1 -0
  73. package/build/es/src/events-schedule-v1-schedule-item-schedule.universal.d.ts +490 -0
  74. package/build/es/src/events-schedule-v1-schedule-item-schedule.universal.js +569 -0
  75. package/build/es/src/events-schedule-v1-schedule-item-schedule.universal.js.map +1 -0
  76. package/build/es/src/events-schedule-v1-schedule-item.http.d.ts +49 -0
  77. package/build/es/src/events-schedule-v1-schedule-item.http.js +470 -0
  78. package/build/es/src/events-schedule-v1-schedule-item.http.js.map +1 -0
  79. package/build/es/src/events-schedule-v1-schedule-item.types.d.ts +318 -0
  80. package/build/es/src/events-schedule-v1-schedule-item.types.js +24 -0
  81. package/build/es/src/events-schedule-v1-schedule-item.types.js.map +1 -0
  82. package/build/es/src/events-v1-category.http.d.ts +35 -0
  83. package/build/es/src/events-v1-category.http.js +576 -0
  84. package/build/es/src/events-v1-category.http.js.map +1 -0
  85. package/build/es/src/events-v1-category.public.d.ts +17 -0
  86. package/build/es/src/events-v1-category.public.js +68 -0
  87. package/build/es/src/events-v1-category.public.js.map +1 -0
  88. package/build/es/src/events-v1-category.types.d.ts +234 -0
  89. package/build/es/src/events-v1-category.types.js +24 -0
  90. package/build/es/src/events-v1-category.types.js.map +1 -0
  91. package/build/es/src/events-v1-category.universal.d.ts +399 -0
  92. package/build/es/src/events-v1-category.universal.js +743 -0
  93. package/build/es/src/events-v1-category.universal.js.map +1 -0
  94. package/build/es/src/events-v1-event.http.d.ts +90 -0
  95. package/build/es/src/events-v1-event.http.js +914 -0
  96. package/build/es/src/events-v1-event.http.js.map +1 -0
  97. package/build/es/src/events-v1-event.public.d.ts +19 -0
  98. package/build/es/src/events-v1-event.public.js +78 -0
  99. package/build/es/src/events-v1-event.public.js.map +1 -0
  100. package/build/es/src/events-v1-event.types.d.ts +1473 -0
  101. package/build/es/src/events-v1-event.types.js +195 -0
  102. package/build/es/src/events-v1-event.types.js.map +1 -0
  103. package/build/es/src/events-v1-event.universal.d.ts +1784 -0
  104. package/build/es/src/events-v1-event.universal.js +1093 -0
  105. package/build/es/src/events-v1-event.universal.js.map +1 -0
  106. package/build/es/src/events-v1-form.http.d.ts +25 -0
  107. package/build/es/src/events-v1-form.http.js +421 -0
  108. package/build/es/src/events-v1-form.http.js.map +1 -0
  109. package/build/es/src/events-v1-form.public.d.ts +11 -0
  110. package/build/es/src/events-v1-form.public.js +38 -0
  111. package/build/es/src/events-v1-form.public.js.map +1 -0
  112. package/build/es/src/events-v1-form.types.d.ts +657 -0
  113. package/build/es/src/events-v1-form.types.js +66 -0
  114. package/build/es/src/events-v1-form.types.js.map +1 -0
  115. package/build/es/src/events-v1-form.universal.d.ts +778 -0
  116. package/build/es/src/events-v1-form.universal.js +499 -0
  117. package/build/es/src/events-v1-form.universal.js.map +1 -0
  118. package/build/es/src/events-v2-policy.universal.d.ts +8 -1
  119. package/build/es/src/events-v2-policy.universal.js +8 -1
  120. package/build/es/src/events-v2-policy.universal.js.map +1 -1
  121. package/package.json +2 -2
@@ -0,0 +1,1093 @@
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, transformError } from '@wix/metro-runtime/velo';
11
+ import * as ambassadorWixEventsV1Event from './events-v1-event.http';
12
+ let __verbose = false;
13
+ function __log(...args) {
14
+ __verbose && console.log(...args);
15
+ }
16
+ function __inspect(obj) {
17
+ return obj;
18
+ }
19
+ export const __debug = {
20
+ verboseLogging: {
21
+ on: () => (__verbose = true),
22
+ off: () => (__verbose = false),
23
+ },
24
+ };
25
+ const _toVeloEntity = '$';
26
+ const _fromVeloEntity = '$';
27
+ export var LocationType;
28
+ (function (LocationType) {
29
+ LocationType["VENUE"] = "VENUE";
30
+ LocationType["ONLINE"] = "ONLINE";
31
+ })(LocationType || (LocationType = {}));
32
+ export var SubdivisionType;
33
+ (function (SubdivisionType) {
34
+ SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
35
+ /** State */
36
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
37
+ /** County */
38
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
39
+ /** City/town */
40
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
41
+ /** Neighborhood/quarter */
42
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
43
+ /** Street/block */
44
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
45
+ /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
46
+ SubdivisionType["COUNTRY"] = "COUNTRY";
47
+ })(SubdivisionType || (SubdivisionType = {}));
48
+ export var Status;
49
+ (function (Status) {
50
+ /** Event occurs only once. */
51
+ Status["ONE_TIME"] = "ONE_TIME";
52
+ /** Event is recurring. */
53
+ Status["RECURRING"] = "RECURRING";
54
+ /** Marks the next upcoming occurrence of the recurring event. */
55
+ Status["RECURRING_NEXT"] = "RECURRING_NEXT";
56
+ /** Marks the most recent ended occurrence of the recurring event. */
57
+ Status["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
58
+ /** Marks the most recent canceled occurrence of the recurring event. */
59
+ Status["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
60
+ })(Status || (Status = {}));
61
+ export var EventStatus;
62
+ (function (EventStatus) {
63
+ /** Event is public and scheduled to start */
64
+ EventStatus["SCHEDULED"] = "SCHEDULED";
65
+ /** Event has started */
66
+ EventStatus["STARTED"] = "STARTED";
67
+ /** Event has ended */
68
+ EventStatus["ENDED"] = "ENDED";
69
+ /** Event was canceled */
70
+ EventStatus["CANCELED"] = "CANCELED";
71
+ /** Event is not public and needs to be published */
72
+ EventStatus["DRAFT"] = "DRAFT";
73
+ })(EventStatus || (EventStatus = {}));
74
+ export var EventType;
75
+ (function (EventType) {
76
+ /** Type not available for this request fieldset */
77
+ EventType["NA_EVENT_TYPE"] = "NA_EVENT_TYPE";
78
+ /** Registration via RSVP */
79
+ EventType["RSVP"] = "RSVP";
80
+ /** Registration via ticket purchase */
81
+ EventType["TICKETS"] = "TICKETS";
82
+ /** External registration */
83
+ EventType["EXTERNAL"] = "EXTERNAL";
84
+ /** Registration not available */
85
+ EventType["NO_REGISTRATION"] = "NO_REGISTRATION";
86
+ })(EventType || (EventType = {}));
87
+ export var RegistrationStatus;
88
+ (function (RegistrationStatus) {
89
+ /** Registration status is not applicable */
90
+ RegistrationStatus["NA_REGISTRATION_STATUS"] = "NA_REGISTRATION_STATUS";
91
+ /** Registration to event is closed */
92
+ RegistrationStatus["CLOSED"] = "CLOSED";
93
+ /** Registration to event is closed manually */
94
+ RegistrationStatus["CLOSED_MANUALLY"] = "CLOSED_MANUALLY";
95
+ /** Registration is open via RSVP */
96
+ RegistrationStatus["OPEN_RSVP"] = "OPEN_RSVP";
97
+ /** Registration to event waitlist is open via RSVP */
98
+ RegistrationStatus["OPEN_RSVP_WAITLIST"] = "OPEN_RSVP_WAITLIST";
99
+ /** Registration is open via ticket purchase */
100
+ RegistrationStatus["OPEN_TICKETS"] = "OPEN_TICKETS";
101
+ /** Registration is open via external URL */
102
+ RegistrationStatus["OPEN_EXTERNAL"] = "OPEN_EXTERNAL";
103
+ /** Registration will be open via RSVP */
104
+ RegistrationStatus["SCHEDULED_RSVP"] = "SCHEDULED_RSVP";
105
+ })(RegistrationStatus || (RegistrationStatus = {}));
106
+ export var RsvpStatusOptions;
107
+ (function (RsvpStatusOptions) {
108
+ /** Only YES RSVP status is available for RSVP registration */
109
+ RsvpStatusOptions["YES_ONLY"] = "YES_ONLY";
110
+ /** YES and NO RSVP status options are available for the registration */
111
+ RsvpStatusOptions["YES_AND_NO"] = "YES_AND_NO";
112
+ })(RsvpStatusOptions || (RsvpStatusOptions = {}));
113
+ export var TaxType;
114
+ (function (TaxType) {
115
+ /** Tax is included in the ticket price */
116
+ TaxType["INCLUDED"] = "INCLUDED";
117
+ /** Tax is added to the order at the checkout */
118
+ TaxType["ADDED"] = "ADDED";
119
+ /** Tax is added to the final total at the checkout */
120
+ TaxType["ADDED_AT_CHECKOUT"] = "ADDED_AT_CHECKOUT";
121
+ })(TaxType || (TaxType = {}));
122
+ export var VisitorType;
123
+ (function (VisitorType) {
124
+ /** Site visitor (including member) */
125
+ VisitorType["VISITOR"] = "VISITOR";
126
+ /** Site member */
127
+ VisitorType["MEMBER"] = "MEMBER";
128
+ /** Site visitor or member */
129
+ VisitorType["VISITOR_OR_MEMBER"] = "VISITOR_OR_MEMBER";
130
+ })(VisitorType || (VisitorType = {}));
131
+ export var InputControlType;
132
+ (function (InputControlType) {
133
+ /** Single text value field. */
134
+ InputControlType["INPUT"] = "INPUT";
135
+ /** Single text value field. */
136
+ InputControlType["TEXTAREA"] = "TEXTAREA";
137
+ /** Single-choice field of predefined values. */
138
+ InputControlType["DROPDOWN"] = "DROPDOWN";
139
+ /** Single-choice field of predefined values. */
140
+ InputControlType["RADIO"] = "RADIO";
141
+ /** Multiple-choice field of predefined values. */
142
+ InputControlType["CHECKBOX"] = "CHECKBOX";
143
+ /** First and last name fields. */
144
+ InputControlType["NAME"] = "NAME";
145
+ /** Additional guests and respective guest names fields. */
146
+ InputControlType["GUEST_CONTROL"] = "GUEST_CONTROL";
147
+ /** Single-line address field. */
148
+ InputControlType["ADDRESS_SHORT"] = "ADDRESS_SHORT";
149
+ /** Full address field. */
150
+ InputControlType["ADDRESS_FULL"] = "ADDRESS_FULL";
151
+ /** Year, month and day fields. */
152
+ InputControlType["DATE"] = "DATE";
153
+ })(InputControlType || (InputControlType = {}));
154
+ export var ValueType;
155
+ (function (ValueType) {
156
+ ValueType["TEXT"] = "TEXT";
157
+ ValueType["NUMBER"] = "NUMBER";
158
+ ValueType["TEXT_ARRAY"] = "TEXT_ARRAY";
159
+ ValueType["DATE_TIME"] = "DATE_TIME";
160
+ ValueType["ADDRESS"] = "ADDRESS";
161
+ })(ValueType || (ValueType = {}));
162
+ export var ConferenceType;
163
+ (function (ConferenceType) {
164
+ /** Everyone in the meeting can publish and subscribe video and audio. */
165
+ ConferenceType["MEETING"] = "MEETING";
166
+ /** Guests can only subscribe to video and audio. */
167
+ ConferenceType["WEBINAR"] = "WEBINAR";
168
+ })(ConferenceType || (ConferenceType = {}));
169
+ export var State;
170
+ (function (State) {
171
+ /** Created manually by the user. */
172
+ State["MANUAL"] = "MANUAL";
173
+ /** Created automatically. */
174
+ State["AUTO"] = "AUTO";
175
+ /** Created when publishing recurring events. */
176
+ State["RECURRING_EVENT"] = "RECURRING_EVENT";
177
+ /** Category is hidden. */
178
+ State["HIDDEN"] = "HIDDEN";
179
+ /** Category is used to store component events. */
180
+ State["COMPONENT"] = "COMPONENT";
181
+ })(State || (State = {}));
182
+ export var EventFieldset;
183
+ (function (EventFieldset) {
184
+ EventFieldset["FULL"] = "FULL";
185
+ /** Include `description`, `mainImage` and `calendarLinks` in the response. */
186
+ EventFieldset["DETAILS"] = "DETAILS";
187
+ /** Include `about` event rich text in the response. */
188
+ EventFieldset["TEXTS"] = "TEXTS";
189
+ /** Include `registration` in the response. */
190
+ EventFieldset["REGISTRATION"] = "REGISTRATION";
191
+ /** Include `eventPageUrl` in the response. */
192
+ EventFieldset["URLS"] = "URLS";
193
+ /** Include `form` in the response. */
194
+ EventFieldset["FORM"] = "FORM";
195
+ /** Include `dashboard` in the response. */
196
+ EventFieldset["DASHBOARD"] = "DASHBOARD";
197
+ /** Include `feed` in the response. */
198
+ EventFieldset["FEED"] = "FEED";
199
+ /** Include `onlineConferencing` in the response. */
200
+ EventFieldset["ONLINE_CONFERENCING_SESSION"] = "ONLINE_CONFERENCING_SESSION";
201
+ /** Include `seoSettings` in the response. */
202
+ EventFieldset["SEO_SETTINGS"] = "SEO_SETTINGS";
203
+ /** Include `agendaSettings` in the response. */
204
+ EventFieldset["AGENDA"] = "AGENDA";
205
+ /** Include `categories` in the response. */
206
+ EventFieldset["CATEGORIES"] = "CATEGORIES";
207
+ })(EventFieldset || (EventFieldset = {}));
208
+ export var SortOrder;
209
+ (function (SortOrder) {
210
+ SortOrder["ASC"] = "ASC";
211
+ SortOrder["DESC"] = "DESC";
212
+ })(SortOrder || (SortOrder = {}));
213
+ export var Relation;
214
+ (function (Relation) {
215
+ /**
216
+ * User is attending the event.
217
+ * User has RSVP with status YES or has ordered tickets.
218
+ */
219
+ Relation["ATTENDING"] = "ATTENDING";
220
+ })(Relation || (Relation = {}));
221
+ const _bulkCancelEventsRequest = {};
222
+ const _bulkCancelEventsResponse = {};
223
+ const _bulkDeleteEventsRequest = {};
224
+ const _bulkDeleteEventsResponse = {};
225
+ const _cancelEventRequest = {};
226
+ const _cancelEventResponse = { event: '_event' };
227
+ const _copyEventRequest = {};
228
+ const _copyEventResponse = { event: '_event' };
229
+ const _copyEventV2Request = { event: '_eventData' };
230
+ const _copyEventV2Response = { event: '_event' };
231
+ const _createEventV2Request = { event: '_eventData' };
232
+ const _createEventV2Response = { event: '_event' };
233
+ const _deleteEventRequest = {};
234
+ const _deleteEventResponse = {};
235
+ const _event = { mainImage: 'wix.common.Image', location: '_location' };
236
+ const _eventData = { mainImage: 'wix.common.Image', location: '_location' };
237
+ const _findEventRequest = {};
238
+ const _findEventResponse = { event: '_event' };
239
+ const _getEventRequest = {};
240
+ const _getEventResponse = { event: '_event' };
241
+ const _listCategoryEventsRequest = {};
242
+ const _listCategoryEventsResponse = { events: '_event' };
243
+ const _listEventsRequest = {};
244
+ const _listEventsResponse = { events: '_event' };
245
+ const _location = { fullAddress: 'wix.common.Address' };
246
+ const _publishDraftEventRequest = {};
247
+ const _publishDraftEventResponse = { event: '_event' };
248
+ const _queryEventsRequest = {};
249
+ const _queryEventsResponse = { events: '_event' };
250
+ const _queryEventsV2Request = {};
251
+ const _queryEventsV2Response = { events: '_event' };
252
+ const _updateEventRequest = { event: '_eventData' };
253
+ const _updateEventResponse = { event: '_event' };
254
+ /**
255
+ * Retrieves a list of up to 1,000 events, given the provided [paging](https://dev.wix.com/api/rest/getting-started/pagination), [filtering and sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-query-events).
256
+ * @public
257
+ * @documentationMaturity preview
258
+ */
259
+ export function query(options) {
260
+ var _a, _b, _c;
261
+ return __awaiter(this, arguments, void 0, function* () {
262
+ const requestTransformation = {
263
+ offset: '$[0].offset',
264
+ limit: '$[0].limit',
265
+ fieldset: '$[0].fieldset',
266
+ filter: '$[0].filter',
267
+ facet: '$[0].facet',
268
+ userId: '$[0].userId',
269
+ sort: '$[0].sort',
270
+ includeDrafts: '$[0].includeDrafts',
271
+ };
272
+ const responseTransformation = '$';
273
+ // @ts-ignore
274
+ const { httpClient, sideEffects } = arguments[1];
275
+ const { toAmbassadorRequest } = serializer({
276
+ rootSchema: _queryEventsRequest,
277
+ depSchemas: {},
278
+ fqdnTransformation: {
279
+ paths: [],
280
+ transformation: _fromVeloEntity,
281
+ },
282
+ customTransformation: requestTransformation,
283
+ });
284
+ const { fromJSON } = serializer({
285
+ rootSchema: _queryEventsResponse,
286
+ depSchemas: { _event, _location },
287
+ fqdnTransformation: {
288
+ paths: [...['Array#events']],
289
+ transformation: _toVeloEntity,
290
+ },
291
+ customTransformation: responseTransformation,
292
+ });
293
+ const payload = toAmbassadorRequest([options]);
294
+ const reqOpts = ambassadorWixEventsV1Event.query(payload);
295
+ __log(`"Query" sending request with: ${__inspect(reqOpts)}`);
296
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
297
+ try {
298
+ const result = yield httpClient.request(reqOpts);
299
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
300
+ return fromJSON(result.data);
301
+ }
302
+ catch (err) {
303
+ const transformedError = transformError(err, requestTransformation, [
304
+ 'options',
305
+ ]);
306
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
307
+ throw transformedError;
308
+ }
309
+ });
310
+ }
311
+ /**
312
+ * Retrieves a list of up to 1,000 events, given the provided paging, filtering and sorting.
313
+ *
314
+ * ** Important **:
315
+ * - All results are for one specific business, resolved from the request context.
316
+ *
317
+ * Query object support:
318
+ * - `filter` - supported, see [filtering and sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-query-events).
319
+ * - `sort` - supported, see [filtering and sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-query-events).
320
+ * - `paging` - supported, see [paging](https://dev.wix.com/api/rest/getting-started/pagination).
321
+ * - `fields` - not supported.
322
+ * - `fieldsets` - not supported, use request-level `fieldset` instead.
323
+ * - `cursorPaging` - not supported, use offset pagination instead.
324
+ *
325
+ * Defaults:
326
+ * - When filter is not specified, returns all events that caller is authorized to read.
327
+ * - When sorting is not specified, defaults to `created` in `DESC` order.
328
+ * @public
329
+ * @documentationMaturity preview
330
+ */
331
+ export function queryEventsV2(options) {
332
+ var _a, _b, _c;
333
+ return __awaiter(this, arguments, void 0, function* () {
334
+ const requestTransformation = {
335
+ query: '$[0].query',
336
+ fieldset: '$[0].fieldset',
337
+ facet: '$[0].facet',
338
+ includeDrafts: '$[0].includeDrafts',
339
+ };
340
+ const responseTransformation = '$';
341
+ // @ts-ignore
342
+ const { httpClient, sideEffects } = arguments[1];
343
+ const { toAmbassadorRequest } = serializer({
344
+ rootSchema: _queryEventsV2Request,
345
+ depSchemas: {},
346
+ fqdnTransformation: {
347
+ paths: [],
348
+ transformation: _fromVeloEntity,
349
+ },
350
+ customTransformation: requestTransformation,
351
+ });
352
+ const { fromJSON } = serializer({
353
+ rootSchema: _queryEventsV2Response,
354
+ depSchemas: { _event, _location },
355
+ fqdnTransformation: {
356
+ paths: [...['Array#events']],
357
+ transformation: _toVeloEntity,
358
+ },
359
+ customTransformation: responseTransformation,
360
+ });
361
+ const payload = toAmbassadorRequest([options]);
362
+ const reqOpts = ambassadorWixEventsV1Event.queryEventsV2(payload);
363
+ __log(`"QueryEventsV2" sending request with: ${__inspect(reqOpts)}`);
364
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
365
+ try {
366
+ const result = yield httpClient.request(reqOpts);
367
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
368
+ return fromJSON(result.data);
369
+ }
370
+ catch (err) {
371
+ const transformedError = transformError(err, requestTransformation, [
372
+ 'options',
373
+ ]);
374
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
375
+ throw transformedError;
376
+ }
377
+ });
378
+ }
379
+ /**
380
+ * Retrieves a list of up to 100 events, given the provided [paging](https://dev.wix.com/api/rest/getting-started/pagination), [filtering & sorting](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-query-events).
381
+ * @public
382
+ * @documentationMaturity preview
383
+ */
384
+ export function listEvents(options) {
385
+ var _a, _b, _c;
386
+ return __awaiter(this, arguments, void 0, function* () {
387
+ const requestTransformation = {
388
+ offset: '$[0].offset',
389
+ limit: '$[0].limit',
390
+ fieldset: '$[0].fieldset',
391
+ status: '$[0].status',
392
+ slug: '$[0].slug',
393
+ facet: '$[0].facet',
394
+ userId: '$[0].userId',
395
+ sort: '$[0].sort',
396
+ categoryFilter: '$[0].categoryFilter',
397
+ includeDrafts: '$[0].includeDrafts',
398
+ recurrenceStatus: '$[0].recurrenceStatus',
399
+ recurringGroupId: '$[0].recurringGroupId',
400
+ };
401
+ const responseTransformation = '$';
402
+ // @ts-ignore
403
+ const { httpClient, sideEffects } = arguments[1];
404
+ const { toAmbassadorRequest } = serializer({
405
+ rootSchema: _listEventsRequest,
406
+ depSchemas: {},
407
+ fqdnTransformation: {
408
+ paths: [],
409
+ transformation: _fromVeloEntity,
410
+ },
411
+ customTransformation: requestTransformation,
412
+ });
413
+ const { fromJSON } = serializer({
414
+ rootSchema: _listEventsResponse,
415
+ depSchemas: { _event, _location },
416
+ fqdnTransformation: {
417
+ paths: [...['Array#events']],
418
+ transformation: _toVeloEntity,
419
+ },
420
+ customTransformation: responseTransformation,
421
+ });
422
+ const payload = toAmbassadorRequest([options]);
423
+ const reqOpts = ambassadorWixEventsV1Event.listEvents(payload);
424
+ __log(`"ListEvents" sending request with: ${__inspect(reqOpts)}`);
425
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
426
+ try {
427
+ const result = yield httpClient.request(reqOpts);
428
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
429
+ return fromJSON(result.data);
430
+ }
431
+ catch (err) {
432
+ const transformedError = transformError(err, requestTransformation, [
433
+ 'options',
434
+ ]);
435
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
436
+ throw transformedError;
437
+ }
438
+ });
439
+ }
440
+ /**
441
+ * Retrieves a list of up to 100 events, given the provided [paging](https://dev.wix.com/api/rest/getting-started/pagination) and category_id.
442
+ * Events are sorted by the sort index defined by CategoryManagement.
443
+ * @param categoryId - Category ID
444
+ * @public
445
+ * @documentationMaturity preview
446
+ * @requiredField categoryId
447
+ */
448
+ export function listCategoryEvents(categoryId, options) {
449
+ var _a, _b, _c;
450
+ return __awaiter(this, arguments, void 0, function* () {
451
+ const requestTransformation = {
452
+ categoryId: '$[0]',
453
+ paging: '$[1].paging',
454
+ fieldset: '$[1].fieldset',
455
+ };
456
+ const responseTransformation = '$';
457
+ // @ts-ignore
458
+ const { httpClient, sideEffects } = arguments[2];
459
+ const { toAmbassadorRequest } = serializer({
460
+ rootSchema: _listCategoryEventsRequest,
461
+ depSchemas: {},
462
+ fqdnTransformation: {
463
+ paths: [],
464
+ transformation: _fromVeloEntity,
465
+ },
466
+ customTransformation: requestTransformation,
467
+ });
468
+ const { fromJSON } = serializer({
469
+ rootSchema: _listCategoryEventsResponse,
470
+ depSchemas: { _event, _location },
471
+ fqdnTransformation: {
472
+ paths: [...['Array#events']],
473
+ transformation: _toVeloEntity,
474
+ },
475
+ customTransformation: responseTransformation,
476
+ });
477
+ const payload = toAmbassadorRequest([categoryId, options]);
478
+ const reqOpts = ambassadorWixEventsV1Event.listCategoryEvents(payload);
479
+ __log(`"ListCategoryEvents" sending request with: ${__inspect(reqOpts)}`);
480
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
481
+ try {
482
+ const result = yield httpClient.request(reqOpts);
483
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
484
+ return fromJSON(result.data);
485
+ }
486
+ catch (err) {
487
+ const transformedError = transformError(err, requestTransformation, [
488
+ 'categoryId',
489
+ 'options',
490
+ ]);
491
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
492
+ throw transformedError;
493
+ }
494
+ });
495
+ }
496
+ /**
497
+ * Retrieves an event by ID or URL slug.
498
+ * @public
499
+ * @documentationMaturity preview
500
+ * @requiredField GetEventRequest
501
+ */
502
+ export function getEvent(options) {
503
+ var _a, _b, _c;
504
+ return __awaiter(this, arguments, void 0, function* () {
505
+ const requestTransformation = {
506
+ id: '$[0]._id',
507
+ slug: '$[0].slug',
508
+ fieldset: '$[0].fieldset',
509
+ };
510
+ const responseTransformation = '$';
511
+ // @ts-ignore
512
+ const { httpClient, sideEffects } = arguments[1];
513
+ const { toAmbassadorRequest } = serializer({
514
+ rootSchema: _getEventRequest,
515
+ depSchemas: {},
516
+ fqdnTransformation: {
517
+ paths: [],
518
+ transformation: _fromVeloEntity,
519
+ },
520
+ customTransformation: requestTransformation,
521
+ });
522
+ const { fromJSON } = serializer({
523
+ rootSchema: _getEventResponse,
524
+ depSchemas: { _event, _location },
525
+ fqdnTransformation: {
526
+ paths: [...['event']],
527
+ transformation: _toVeloEntity,
528
+ },
529
+ customTransformation: responseTransformation,
530
+ });
531
+ const payload = toAmbassadorRequest([options]);
532
+ const reqOpts = ambassadorWixEventsV1Event.getEvent(payload);
533
+ __log(`"GetEvent" sending request with: ${__inspect(reqOpts)}`);
534
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
535
+ try {
536
+ const result = yield httpClient.request(reqOpts);
537
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
538
+ return fromJSON(result.data);
539
+ }
540
+ catch (err) {
541
+ const transformedError = transformError(err, requestTransformation, [
542
+ 'options',
543
+ ]);
544
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
545
+ throw transformedError;
546
+ }
547
+ });
548
+ }
549
+ /**
550
+ * Finds an event by ID or URL slug. In contrast to Get Event endpoint which returns not found error,
551
+ * Find Event returns empty response when an event is not found.
552
+ * @public
553
+ * @documentationMaturity preview
554
+ * @requiredField FindEventRequest
555
+ */
556
+ export function findEvent(options) {
557
+ var _a, _b, _c;
558
+ return __awaiter(this, arguments, void 0, function* () {
559
+ const requestTransformation = {
560
+ id: '$[0]._id',
561
+ slug: '$[0].slug',
562
+ fieldset: '$[0].fieldset',
563
+ };
564
+ const responseTransformation = '$';
565
+ // @ts-ignore
566
+ const { httpClient, sideEffects } = arguments[1];
567
+ const { toAmbassadorRequest } = serializer({
568
+ rootSchema: _findEventRequest,
569
+ depSchemas: {},
570
+ fqdnTransformation: {
571
+ paths: [],
572
+ transformation: _fromVeloEntity,
573
+ },
574
+ customTransformation: requestTransformation,
575
+ });
576
+ const { fromJSON } = serializer({
577
+ rootSchema: _findEventResponse,
578
+ depSchemas: { _event, _location },
579
+ fqdnTransformation: {
580
+ paths: [...['event']],
581
+ transformation: _toVeloEntity,
582
+ },
583
+ customTransformation: responseTransformation,
584
+ });
585
+ const payload = toAmbassadorRequest([options]);
586
+ const reqOpts = ambassadorWixEventsV1Event.findEvent(payload);
587
+ __log(`"FindEvent" sending request with: ${__inspect(reqOpts)}`);
588
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
589
+ try {
590
+ const result = yield httpClient.request(reqOpts);
591
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
592
+ return fromJSON(result.data);
593
+ }
594
+ catch (err) {
595
+ const transformedError = transformError(err, requestTransformation, [
596
+ 'options',
597
+ ]);
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
+ * Creates a new event, with a default registration form in the given language.
605
+ * Default registration form includes first name, last name, and email inputs.
606
+ * To learn more about registration form and customize it, see [Registration Form](https://dev.wix.com/api/rest/wix-events/wix-events/registration-form/about-the-registration-form-api).
607
+ * The event is automatically configured to send daily summary reports of new registrations to site business email.
608
+ * RegistrationConfig.initialType is required - allowed value when creating is RSVP or TICKETS.
609
+ * @param event - Event data.
610
+ * @public
611
+ * @documentationMaturity preview
612
+ * @requiredField event
613
+ * @requiredField event.location
614
+ * @requiredField event.scheduleConfig
615
+ * @requiredField event.title
616
+ */
617
+ export function createEventV2(event, options) {
618
+ var _a, _b, _c;
619
+ return __awaiter(this, arguments, void 0, function* () {
620
+ const requestTransformation = {
621
+ event: '$[0]',
622
+ language: '$[1].language',
623
+ draft: '$[1].draft',
624
+ };
625
+ const responseTransformation = '$';
626
+ // @ts-ignore
627
+ const { httpClient, sideEffects } = arguments[2];
628
+ const { toAmbassadorRequest } = serializer({
629
+ rootSchema: _createEventV2Request,
630
+ depSchemas: { _eventData, _location },
631
+ fqdnTransformation: {
632
+ paths: [],
633
+ transformation: _fromVeloEntity,
634
+ },
635
+ customTransformation: requestTransformation,
636
+ });
637
+ const { fromJSON } = serializer({
638
+ rootSchema: _createEventV2Response,
639
+ depSchemas: { _event, _location },
640
+ fqdnTransformation: {
641
+ paths: [...['event']],
642
+ transformation: _toVeloEntity,
643
+ },
644
+ customTransformation: responseTransformation,
645
+ });
646
+ const payload = toAmbassadorRequest([event, options]);
647
+ const reqOpts = ambassadorWixEventsV1Event.createEventV2(payload);
648
+ __log(`"CreateEventV2" sending request with: ${__inspect(reqOpts)}`);
649
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
650
+ try {
651
+ const result = yield httpClient.request(reqOpts);
652
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
653
+ return fromJSON(result.data);
654
+ }
655
+ catch (err) {
656
+ const transformedError = transformError(err, requestTransformation, [
657
+ 'event',
658
+ 'options',
659
+ ]);
660
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
661
+ throw transformedError;
662
+ }
663
+ });
664
+ }
665
+ /**
666
+ * Copies an event, including its registration form, notifications and tickets configuration - scheduled two weeks from the original event.
667
+ * Multilingual translations are also copied to the new event.
668
+ *
669
+ * When an event with same title already exists, appends (1), (2), ... to it. For example, copying an event titled "My Event" creates "My Event (1)".
670
+ * Very long event titles are cropped: "Daily stand-up ev... (2)".
671
+ * @param eventId - Event ID.
672
+ * @public
673
+ * @documentationMaturity preview
674
+ * @requiredField eventId
675
+ */
676
+ export function copy(eventId, options) {
677
+ var _a, _b, _c;
678
+ return __awaiter(this, arguments, void 0, function* () {
679
+ const requestTransformation = { eventId: '$[0]', draft: '$[1].draft' };
680
+ const responseTransformation = '$';
681
+ // @ts-ignore
682
+ const { httpClient, sideEffects } = arguments[2];
683
+ const { toAmbassadorRequest } = serializer({
684
+ rootSchema: _copyEventRequest,
685
+ depSchemas: {},
686
+ fqdnTransformation: {
687
+ paths: [],
688
+ transformation: _fromVeloEntity,
689
+ },
690
+ customTransformation: requestTransformation,
691
+ });
692
+ const { fromJSON } = serializer({
693
+ rootSchema: _copyEventResponse,
694
+ depSchemas: { _event, _location },
695
+ fqdnTransformation: {
696
+ paths: [...['event']],
697
+ transformation: _toVeloEntity,
698
+ },
699
+ customTransformation: responseTransformation,
700
+ });
701
+ const payload = toAmbassadorRequest([eventId, options]);
702
+ const reqOpts = ambassadorWixEventsV1Event.copy(payload);
703
+ __log(`"Copy" sending request with: ${__inspect(reqOpts)}`);
704
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
705
+ try {
706
+ const result = yield httpClient.request(reqOpts);
707
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
708
+ return fromJSON(result.data);
709
+ }
710
+ catch (err) {
711
+ const transformedError = transformError(err, requestTransformation, [
712
+ 'eventId',
713
+ 'options',
714
+ ]);
715
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
716
+ throw transformedError;
717
+ }
718
+ });
719
+ }
720
+ /**
721
+ * Copies an event, including its registration form, notifications and tickets configuration - scheduled two weeks from the original event.
722
+ * Multilingual translations are also copied to the new event.
723
+ * Supports partial update of the original event fields. See [Partial Updates](https://dev.wix.com/api/rest/wix-events/wix-events/partial-updates) for more information.
724
+ *
725
+ * When an event with same title already exists, appends (1), (2), ... to it. For example, copying an event titled "My Event" creates "My Event (1)".
726
+ * Very long event titles are cropped: "Daily stand-up ev... (2)".
727
+ * @param _id - Event ID.
728
+ * @public
729
+ * @documentationMaturity preview
730
+ * @requiredField _id
731
+ */
732
+ export function copyEventV2(_id, options) {
733
+ var _a, _b, _c;
734
+ return __awaiter(this, arguments, void 0, function* () {
735
+ const requestTransformation = {
736
+ id: '$[0]',
737
+ event: '$[1].event',
738
+ fields: '$[1].fields',
739
+ draft: '$[1].draft',
740
+ };
741
+ const responseTransformation = '$';
742
+ // @ts-ignore
743
+ const { httpClient, sideEffects } = arguments[2];
744
+ const { toAmbassadorRequest } = serializer({
745
+ rootSchema: _copyEventV2Request,
746
+ depSchemas: { _eventData, _location },
747
+ fqdnTransformation: {
748
+ paths: [],
749
+ transformation: _fromVeloEntity,
750
+ },
751
+ customTransformation: requestTransformation,
752
+ });
753
+ const { fromJSON } = serializer({
754
+ rootSchema: _copyEventV2Response,
755
+ depSchemas: { _event, _location },
756
+ fqdnTransformation: {
757
+ paths: [...['event']],
758
+ transformation: _toVeloEntity,
759
+ },
760
+ customTransformation: responseTransformation,
761
+ });
762
+ const payload = toAmbassadorRequest([_id, options]);
763
+ const reqOpts = ambassadorWixEventsV1Event.copyEventV2(payload);
764
+ __log(`"CopyEventV2" 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 = transformError(err, requestTransformation, [
773
+ '_id',
774
+ 'options',
775
+ ]);
776
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
777
+ throw transformedError;
778
+ }
779
+ });
780
+ }
781
+ /**
782
+ * Updates an event's parameters. See [Partial Updates](https://dev.wix.com/api/rest/wix-events/wix-events/partial-updates) for more information.
783
+ * @param _id - Event ID.
784
+ * @public
785
+ * @documentationMaturity preview
786
+ * @requiredField _id
787
+ */
788
+ export function updateEvent(_id, options) {
789
+ var _a, _b, _c;
790
+ return __awaiter(this, arguments, void 0, function* () {
791
+ const requestTransformation = {
792
+ id: '$[0]',
793
+ event: '$[1].event',
794
+ fields: '$[1].fields',
795
+ language: '$[1].language',
796
+ };
797
+ const responseTransformation = '$';
798
+ // @ts-ignore
799
+ const { httpClient, sideEffects } = arguments[2];
800
+ const { toAmbassadorRequest } = serializer({
801
+ rootSchema: _updateEventRequest,
802
+ depSchemas: { _eventData, _location },
803
+ fqdnTransformation: {
804
+ paths: [],
805
+ transformation: _fromVeloEntity,
806
+ },
807
+ customTransformation: requestTransformation,
808
+ });
809
+ const { fromJSON } = serializer({
810
+ rootSchema: _updateEventResponse,
811
+ depSchemas: { _event, _location },
812
+ fqdnTransformation: {
813
+ paths: [...['event']],
814
+ transformation: _toVeloEntity,
815
+ },
816
+ customTransformation: responseTransformation,
817
+ });
818
+ const payload = toAmbassadorRequest([_id, options]);
819
+ const reqOpts = ambassadorWixEventsV1Event.updateEvent(payload);
820
+ __log(`"UpdateEvent" sending request with: ${__inspect(reqOpts)}`);
821
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
822
+ try {
823
+ const result = yield httpClient.request(reqOpts);
824
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
825
+ return fromJSON(result.data);
826
+ }
827
+ catch (err) {
828
+ const transformedError = transformError(err, requestTransformation, [
829
+ '_id',
830
+ 'options',
831
+ ]);
832
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
833
+ throw transformedError;
834
+ }
835
+ });
836
+ }
837
+ /**
838
+ * Publishes draft event so that it becomes available to site visitors.
839
+ * If recurring events are set, category with state RECURRING_EVENT will be created.
840
+ * All recurring events will be assigned to this category.
841
+ * @param _id - Event ID.
842
+ * @public
843
+ * @documentationMaturity preview
844
+ * @requiredField _id
845
+ */
846
+ export function publishDraftEvent(_id) {
847
+ var _a, _b, _c;
848
+ return __awaiter(this, arguments, void 0, function* () {
849
+ const requestTransformation = { id: '$[0]' };
850
+ const responseTransformation = '$';
851
+ // @ts-ignore
852
+ const { httpClient, sideEffects } = arguments[1];
853
+ const { toAmbassadorRequest } = serializer({
854
+ rootSchema: _publishDraftEventRequest,
855
+ depSchemas: {},
856
+ fqdnTransformation: {
857
+ paths: [],
858
+ transformation: _fromVeloEntity,
859
+ },
860
+ customTransformation: requestTransformation,
861
+ });
862
+ const { fromJSON } = serializer({
863
+ rootSchema: _publishDraftEventResponse,
864
+ depSchemas: { _event, _location },
865
+ fqdnTransformation: {
866
+ paths: [...['event']],
867
+ transformation: _toVeloEntity,
868
+ },
869
+ customTransformation: responseTransformation,
870
+ });
871
+ const payload = toAmbassadorRequest([_id]);
872
+ const reqOpts = ambassadorWixEventsV1Event.publishDraftEvent(payload);
873
+ __log(`"PublishDraftEvent" sending request with: ${__inspect(reqOpts)}`);
874
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
875
+ try {
876
+ const result = yield httpClient.request(reqOpts);
877
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
878
+ return fromJSON(result.data);
879
+ }
880
+ catch (err) {
881
+ const transformedError = transformError(err, requestTransformation, [
882
+ '_id',
883
+ ]);
884
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
885
+ throw transformedError;
886
+ }
887
+ });
888
+ }
889
+ /**
890
+ * Cancels an event and closes registration.
891
+ * If event cancellation notifications are enabled, canceling an event automatically sends cancellation emails and/or push notifications to registered guests.
892
+ * @param _id - Event ID.
893
+ * @public
894
+ * @documentationMaturity preview
895
+ * @requiredField _id
896
+ */
897
+ export function cancelEvent(_id) {
898
+ var _a, _b, _c;
899
+ return __awaiter(this, arguments, void 0, function* () {
900
+ const requestTransformation = { id: '$[0]' };
901
+ const responseTransformation = '$';
902
+ // @ts-ignore
903
+ const { httpClient, sideEffects } = arguments[1];
904
+ const { toAmbassadorRequest } = serializer({
905
+ rootSchema: _cancelEventRequest,
906
+ depSchemas: {},
907
+ fqdnTransformation: {
908
+ paths: [],
909
+ transformation: _fromVeloEntity,
910
+ },
911
+ customTransformation: requestTransformation,
912
+ });
913
+ const { fromJSON } = serializer({
914
+ rootSchema: _cancelEventResponse,
915
+ depSchemas: { _event, _location },
916
+ fqdnTransformation: {
917
+ paths: [...['event']],
918
+ transformation: _toVeloEntity,
919
+ },
920
+ customTransformation: responseTransformation,
921
+ });
922
+ const payload = toAmbassadorRequest([_id]);
923
+ const reqOpts = ambassadorWixEventsV1Event.cancelEvent(payload);
924
+ __log(`"CancelEvent" sending request with: ${__inspect(reqOpts)}`);
925
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
926
+ try {
927
+ const result = yield httpClient.request(reqOpts);
928
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
929
+ return fromJSON(result.data);
930
+ }
931
+ catch (err) {
932
+ const transformedError = transformError(err, requestTransformation, [
933
+ '_id',
934
+ ]);
935
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
936
+ throw transformedError;
937
+ }
938
+ });
939
+ }
940
+ /**
941
+ * Cancels events by filter.
942
+ * If event cancellation notifications are enabled, canceling an event automatically sends cancellation emails and/or push notifications to registered guests.
943
+ * @param filter - Filter. See [supported fields and operators](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-query-events).
944
+ * @public
945
+ * @documentationMaturity preview
946
+ * @requiredField filter
947
+ */
948
+ export function bulkCancelEvents(filter) {
949
+ var _a, _b, _c;
950
+ return __awaiter(this, arguments, void 0, function* () {
951
+ const requestTransformation = { filter: '$[0]' };
952
+ const responseTransformation = '$';
953
+ // @ts-ignore
954
+ const { httpClient, sideEffects } = arguments[1];
955
+ const { toAmbassadorRequest } = serializer({
956
+ rootSchema: _bulkCancelEventsRequest,
957
+ depSchemas: {},
958
+ fqdnTransformation: {
959
+ paths: [],
960
+ transformation: _fromVeloEntity,
961
+ },
962
+ customTransformation: requestTransformation,
963
+ });
964
+ const { fromJSON } = serializer({
965
+ rootSchema: _bulkCancelEventsResponse,
966
+ depSchemas: {},
967
+ fqdnTransformation: {
968
+ paths: [],
969
+ transformation: _toVeloEntity,
970
+ },
971
+ customTransformation: responseTransformation,
972
+ });
973
+ const payload = toAmbassadorRequest([filter]);
974
+ const reqOpts = ambassadorWixEventsV1Event.bulkCancelEvents(payload);
975
+ __log(`"BulkCancelEvents" sending request with: ${__inspect(reqOpts)}`);
976
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
977
+ try {
978
+ const result = yield httpClient.request(reqOpts);
979
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
980
+ return fromJSON(result.data);
981
+ }
982
+ catch (err) {
983
+ const transformedError = transformError(err, requestTransformation, [
984
+ 'filter',
985
+ ]);
986
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
987
+ throw transformedError;
988
+ }
989
+ });
990
+ }
991
+ /**
992
+ * Deletes an event.
993
+ * Deleted events are not returned via API. The only way to retrieve them is via GDPR access request.
994
+ * @param _id - Event ID.
995
+ * @public
996
+ * @documentationMaturity preview
997
+ * @requiredField _id
998
+ */
999
+ export function deleteEvent(_id) {
1000
+ var _a, _b, _c;
1001
+ return __awaiter(this, arguments, void 0, function* () {
1002
+ const requestTransformation = { id: '$[0]' };
1003
+ const responseTransformation = '$';
1004
+ // @ts-ignore
1005
+ const { httpClient, sideEffects } = arguments[1];
1006
+ const { toAmbassadorRequest } = serializer({
1007
+ rootSchema: _deleteEventRequest,
1008
+ depSchemas: {},
1009
+ fqdnTransformation: {
1010
+ paths: [],
1011
+ transformation: _fromVeloEntity,
1012
+ },
1013
+ customTransformation: requestTransformation,
1014
+ });
1015
+ const { fromJSON } = serializer({
1016
+ rootSchema: _deleteEventResponse,
1017
+ depSchemas: {},
1018
+ fqdnTransformation: {
1019
+ paths: [],
1020
+ transformation: _toVeloEntity,
1021
+ },
1022
+ customTransformation: responseTransformation,
1023
+ });
1024
+ const payload = toAmbassadorRequest([_id]);
1025
+ const reqOpts = ambassadorWixEventsV1Event.deleteEvent(payload);
1026
+ __log(`"DeleteEvent" sending request with: ${__inspect(reqOpts)}`);
1027
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1028
+ try {
1029
+ const result = yield httpClient.request(reqOpts);
1030
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1031
+ return fromJSON(result.data);
1032
+ }
1033
+ catch (err) {
1034
+ const transformedError = transformError(err, requestTransformation, [
1035
+ '_id',
1036
+ ]);
1037
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1038
+ throw transformedError;
1039
+ }
1040
+ });
1041
+ }
1042
+ /**
1043
+ * Deletes events by filter.
1044
+ * Deleted events are not returned via API. The only way to retrieve them is via GDPR access request.
1045
+ * @param filter - Filter. See [supported fields and operators](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort#wix-events_wix-events_filter-and-sort_list-query-events).
1046
+ * @public
1047
+ * @documentationMaturity preview
1048
+ * @requiredField filter
1049
+ */
1050
+ export function bulkDeleteEvents(filter) {
1051
+ var _a, _b, _c;
1052
+ return __awaiter(this, arguments, void 0, function* () {
1053
+ const requestTransformation = { filter: '$[0]' };
1054
+ const responseTransformation = '$';
1055
+ // @ts-ignore
1056
+ const { httpClient, sideEffects } = arguments[1];
1057
+ const { toAmbassadorRequest } = serializer({
1058
+ rootSchema: _bulkDeleteEventsRequest,
1059
+ depSchemas: {},
1060
+ fqdnTransformation: {
1061
+ paths: [],
1062
+ transformation: _fromVeloEntity,
1063
+ },
1064
+ customTransformation: requestTransformation,
1065
+ });
1066
+ const { fromJSON } = serializer({
1067
+ rootSchema: _bulkDeleteEventsResponse,
1068
+ depSchemas: {},
1069
+ fqdnTransformation: {
1070
+ paths: [],
1071
+ transformation: _toVeloEntity,
1072
+ },
1073
+ customTransformation: responseTransformation,
1074
+ });
1075
+ const payload = toAmbassadorRequest([filter]);
1076
+ const reqOpts = ambassadorWixEventsV1Event.bulkDeleteEvents(payload);
1077
+ __log(`"BulkDeleteEvents" sending request with: ${__inspect(reqOpts)}`);
1078
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1079
+ try {
1080
+ const result = yield httpClient.request(reqOpts);
1081
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1082
+ return fromJSON(result.data);
1083
+ }
1084
+ catch (err) {
1085
+ const transformedError = transformError(err, requestTransformation, [
1086
+ 'filter',
1087
+ ]);
1088
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1089
+ throw transformedError;
1090
+ }
1091
+ });
1092
+ }
1093
+ //# sourceMappingURL=events-v1-event.universal.js.map