@wix/events 1.0.95 → 1.0.97

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 (43) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +2 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/src/events-events-v3-event.http.d.ts +56 -0
  5. package/build/cjs/src/events-events-v3-event.http.js +548 -0
  6. package/build/cjs/src/events-events-v3-event.http.js.map +1 -0
  7. package/build/cjs/src/events-events-v3-event.public.d.ts +19 -0
  8. package/build/cjs/src/events-events-v3-event.public.js +99 -0
  9. package/build/cjs/src/events-events-v3-event.public.js.map +1 -0
  10. package/build/cjs/src/events-events-v3-event.types.d.ts +1512 -0
  11. package/build/cjs/src/events-events-v3-event.types.js +246 -0
  12. package/build/cjs/src/events-events-v3-event.types.js.map +1 -0
  13. package/build/cjs/src/events-events-v3-event.universal.d.ts +1808 -0
  14. package/build/cjs/src/events-events-v3-event.universal.js +987 -0
  15. package/build/cjs/src/events-events-v3-event.universal.js.map +1 -0
  16. package/build/cjs/src/events-guests-v1-guest.public.d.ts +1 -1
  17. package/build/cjs/src/events-guests-v1-guest.types.d.ts +20 -12
  18. package/build/cjs/src/events-guests-v1-guest.types.js.map +1 -1
  19. package/build/cjs/src/events-guests-v1-guest.universal.d.ts +21 -12
  20. package/build/cjs/src/events-guests-v1-guest.universal.js +1 -0
  21. package/build/cjs/src/events-guests-v1-guest.universal.js.map +1 -1
  22. package/build/es/index.d.ts +1 -0
  23. package/build/es/index.js +1 -0
  24. package/build/es/index.js.map +1 -1
  25. package/build/es/src/events-events-v3-event.http.d.ts +56 -0
  26. package/build/es/src/events-events-v3-event.http.js +533 -0
  27. package/build/es/src/events-events-v3-event.http.js.map +1 -0
  28. package/build/es/src/events-events-v3-event.public.d.ts +19 -0
  29. package/build/es/src/events-events-v3-event.public.js +64 -0
  30. package/build/es/src/events-events-v3-event.public.js.map +1 -0
  31. package/build/es/src/events-events-v3-event.types.d.ts +1512 -0
  32. package/build/es/src/events-events-v3-event.types.js +243 -0
  33. package/build/es/src/events-events-v3-event.types.js.map +1 -0
  34. package/build/es/src/events-events-v3-event.universal.d.ts +1808 -0
  35. package/build/es/src/events-events-v3-event.universal.js +953 -0
  36. package/build/es/src/events-events-v3-event.universal.js.map +1 -0
  37. package/build/es/src/events-guests-v1-guest.public.d.ts +1 -1
  38. package/build/es/src/events-guests-v1-guest.types.d.ts +20 -12
  39. package/build/es/src/events-guests-v1-guest.types.js.map +1 -1
  40. package/build/es/src/events-guests-v1-guest.universal.d.ts +21 -12
  41. package/build/es/src/events-guests-v1-guest.universal.js +1 -0
  42. package/build/es/src/events-guests-v1-guest.universal.js.map +1 -1
  43. package/package.json +2 -2
@@ -0,0 +1,987 @@
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.getEventBySlug = exports.getEvent = exports.listEventsByCategory = exports.queryEvents = exports.bulkDeleteEventsByFilter = exports.deleteEvent = exports.bulkCancelEventsByFilter = exports.cancelEvent = exports.publishDraftEvent = exports.updateEvent = exports.cloneEvent = exports.createEvent = exports.EventsEventStatus = exports.RecurrenceStatusStatus = exports.SubdivisionType = exports.LocationLocationType = exports.Relation = exports.EventFieldset = exports.SortOrder = exports.State = exports.ConferenceType = exports.ValueType = exports.InputControlType = exports.GuestType = exports.TaxType = exports.ResponseType = exports.RegistrationStatus = exports.RegistrationType = exports.EventStatus = exports.Status = exports.SubdivisionSubdivisionType = exports.LocationType = exports.__debug = void 0;
32
+ const velo_1 = require("@wix/metro-runtime/velo");
33
+ const ambassadorWixEventsEventsV3Event = __importStar(require("./events-events-v3-event.http"));
34
+ // @ts-ignore
35
+ const motion_edm_autogen_query_wrapper_1 = require("@wix/motion-edm-autogen-query-wrapper");
36
+ let __verbose = false;
37
+ function __log(...args) {
38
+ __verbose && console.log(...args);
39
+ }
40
+ function __inspect(obj) {
41
+ return obj;
42
+ }
43
+ exports.__debug = {
44
+ verboseLogging: {
45
+ on: () => (__verbose = true),
46
+ off: () => (__verbose = false),
47
+ },
48
+ };
49
+ const _toVeloEntity = '$';
50
+ const _fromVeloEntity = '$';
51
+ var LocationType;
52
+ (function (LocationType) {
53
+ LocationType["VENUE"] = "VENUE";
54
+ LocationType["ONLINE"] = "ONLINE";
55
+ })(LocationType = exports.LocationType || (exports.LocationType = {}));
56
+ var SubdivisionSubdivisionType;
57
+ (function (SubdivisionSubdivisionType) {
58
+ SubdivisionSubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
59
+ /** State */
60
+ SubdivisionSubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
61
+ /** County */
62
+ SubdivisionSubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
63
+ /** City/town */
64
+ SubdivisionSubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
65
+ /** Neighborhood/quarter */
66
+ SubdivisionSubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
67
+ /** Street/block */
68
+ SubdivisionSubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
69
+ /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
70
+ SubdivisionSubdivisionType["COUNTRY"] = "COUNTRY";
71
+ })(SubdivisionSubdivisionType = exports.SubdivisionSubdivisionType || (exports.SubdivisionSubdivisionType = {}));
72
+ var Status;
73
+ (function (Status) {
74
+ /** Default value. This value is unused. */
75
+ Status["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
76
+ /** Event occurs only once. */
77
+ Status["ONE_TIME"] = "ONE_TIME";
78
+ /** Event is repeating and has a list of scheduled repetitions. */
79
+ Status["RECURRING"] = "RECURRING";
80
+ /** An upcoming event from the list of repetitions. */
81
+ Status["RECURRING_UPCOMING"] = "RECURRING_UPCOMING";
82
+ /** Latest ended event from the list of repetitions. */
83
+ Status["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
84
+ /** Latest cancelled event from the list of repetitions. */
85
+ Status["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
86
+ })(Status = exports.Status || (exports.Status = {}));
87
+ var EventStatus;
88
+ (function (EventStatus) {
89
+ /** Default value. This value is unused */
90
+ EventStatus["UNKNOWN_EVENT_STATUS"] = "UNKNOWN_EVENT_STATUS";
91
+ /** Event is public and scheduled to start */
92
+ EventStatus["SCHEDULED"] = "SCHEDULED";
93
+ /** Event has started */
94
+ EventStatus["STARTED"] = "STARTED";
95
+ /** Event has ended */
96
+ EventStatus["ENDED"] = "ENDED";
97
+ /** Event is canceled */
98
+ EventStatus["CANCELED"] = "CANCELED";
99
+ /** Event is not public */
100
+ EventStatus["DRAFT"] = "DRAFT";
101
+ })(EventStatus = exports.EventStatus || (exports.EventStatus = {}));
102
+ var RegistrationType;
103
+ (function (RegistrationType) {
104
+ /** Type not available for this request fieldset */
105
+ RegistrationType["UNKNOWN_REGISTRATION_TYPE"] = "UNKNOWN_REGISTRATION_TYPE";
106
+ /** Registration via RSVP */
107
+ RegistrationType["RSVP"] = "RSVP";
108
+ /** Registration via ticket purchase */
109
+ RegistrationType["TICKETING"] = "TICKETING";
110
+ /** External registration */
111
+ RegistrationType["EXTERNAL"] = "EXTERNAL";
112
+ /** Registration not available */
113
+ RegistrationType["NONE"] = "NONE";
114
+ })(RegistrationType = exports.RegistrationType || (exports.RegistrationType = {}));
115
+ var RegistrationStatus;
116
+ (function (RegistrationStatus) {
117
+ /** Registration status is not applicable */
118
+ RegistrationStatus["NA_REGISTRATION_STATUS"] = "NA_REGISTRATION_STATUS";
119
+ /** Registration to event is closed */
120
+ RegistrationStatus["CLOSED"] = "CLOSED";
121
+ /** Registration to event is closed manually */
122
+ RegistrationStatus["CLOSED_MANUALLY"] = "CLOSED_MANUALLY";
123
+ /** Registration is open via RSVP */
124
+ RegistrationStatus["OPEN_RSVP"] = "OPEN_RSVP";
125
+ /** Registration to event waitlist is open via RSVP */
126
+ RegistrationStatus["OPEN_RSVP_WAITLIST"] = "OPEN_RSVP_WAITLIST";
127
+ /** Registration is open via ticket purchase */
128
+ RegistrationStatus["OPEN_TICKETS"] = "OPEN_TICKETS";
129
+ /** Registration is open via external URL */
130
+ RegistrationStatus["OPEN_EXTERNAL"] = "OPEN_EXTERNAL";
131
+ /** Registration will be open via RSVP */
132
+ RegistrationStatus["SCHEDULED_RSVP"] = "SCHEDULED_RSVP";
133
+ })(RegistrationStatus = exports.RegistrationStatus || (exports.RegistrationStatus = {}));
134
+ var ResponseType;
135
+ (function (ResponseType) {
136
+ /** Only **Yes** answer is available for the registration. */
137
+ ResponseType["YES_ONLY"] = "YES_ONLY";
138
+ /** *Yes** and **No** answers are available for the registration. */
139
+ ResponseType["YES_AND_NO"] = "YES_AND_NO";
140
+ })(ResponseType = exports.ResponseType || (exports.ResponseType = {}));
141
+ var TaxType;
142
+ (function (TaxType) {
143
+ /** Tax is included in the ticket price */
144
+ TaxType["INCLUDED"] = "INCLUDED";
145
+ /** Tax is added to the order at the checkout */
146
+ TaxType["ADDED"] = "ADDED";
147
+ /** Tax is added to the final total at the checkout */
148
+ TaxType["ADDED_AT_CHECKOUT"] = "ADDED_AT_CHECKOUT";
149
+ })(TaxType = exports.TaxType || (exports.TaxType = {}));
150
+ var GuestType;
151
+ (function (GuestType) {
152
+ /** Site visitor or member */
153
+ GuestType["VISITOR_OR_MEMBER"] = "VISITOR_OR_MEMBER";
154
+ /** Site member */
155
+ GuestType["MEMBER"] = "MEMBER";
156
+ })(GuestType = exports.GuestType || (exports.GuestType = {}));
157
+ var InputControlType;
158
+ (function (InputControlType) {
159
+ /** Single text value field. */
160
+ InputControlType["INPUT"] = "INPUT";
161
+ /** Single text value field. */
162
+ InputControlType["TEXTAREA"] = "TEXTAREA";
163
+ /** Single-choice field of predefined values. */
164
+ InputControlType["DROPDOWN"] = "DROPDOWN";
165
+ /** Single-choice field of predefined values. */
166
+ InputControlType["RADIO"] = "RADIO";
167
+ /** Multiple-choice field of predefined values. */
168
+ InputControlType["CHECKBOX"] = "CHECKBOX";
169
+ /** First and last name fields. */
170
+ InputControlType["NAME"] = "NAME";
171
+ /** Additional guests and respective guest names fields. */
172
+ InputControlType["GUEST_CONTROL"] = "GUEST_CONTROL";
173
+ /** Single-line address field. */
174
+ InputControlType["ADDRESS_SHORT"] = "ADDRESS_SHORT";
175
+ /** Full address field. */
176
+ InputControlType["ADDRESS_FULL"] = "ADDRESS_FULL";
177
+ /** Year, month and day fields. */
178
+ InputControlType["DATE"] = "DATE";
179
+ })(InputControlType = exports.InputControlType || (exports.InputControlType = {}));
180
+ var ValueType;
181
+ (function (ValueType) {
182
+ ValueType["TEXT"] = "TEXT";
183
+ ValueType["NUMBER"] = "NUMBER";
184
+ ValueType["TEXT_ARRAY"] = "TEXT_ARRAY";
185
+ ValueType["DATE_TIME"] = "DATE_TIME";
186
+ ValueType["ADDRESS"] = "ADDRESS";
187
+ })(ValueType = exports.ValueType || (exports.ValueType = {}));
188
+ var ConferenceType;
189
+ (function (ConferenceType) {
190
+ /** Guests can publish and subscribe to video and audio. */
191
+ ConferenceType["MEETING"] = "MEETING";
192
+ /** Guests can only subscribe to video and audio. */
193
+ ConferenceType["WEBINAR"] = "WEBINAR";
194
+ })(ConferenceType = exports.ConferenceType || (exports.ConferenceType = {}));
195
+ var State;
196
+ (function (State) {
197
+ /** Created manually by the user. */
198
+ State["MANUAL"] = "MANUAL";
199
+ /** Created automatically. */
200
+ State["AUTO"] = "AUTO";
201
+ /** Created when publishing recurring events. */
202
+ State["RECURRING_EVENT"] = "RECURRING_EVENT";
203
+ /** Category is hidden. */
204
+ State["HIDDEN"] = "HIDDEN";
205
+ /** Category is used to store component events. */
206
+ State["COMPONENT"] = "COMPONENT";
207
+ })(State = exports.State || (exports.State = {}));
208
+ var SortOrder;
209
+ (function (SortOrder) {
210
+ SortOrder["ASC"] = "ASC";
211
+ SortOrder["DESC"] = "DESC";
212
+ })(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
213
+ var EventFieldset;
214
+ (function (EventFieldset) {
215
+ /** Include `description`, `mainImage` and `calendarLinks` in the response. */
216
+ EventFieldset["DETAILS"] = "DETAILS";
217
+ /** Include `about` event rich text in the response. */
218
+ EventFieldset["TEXTS"] = "TEXTS";
219
+ /** Include `registration` in the response. */
220
+ EventFieldset["REGISTRATION"] = "REGISTRATION";
221
+ /** Include `eventPageUrl` in the response. */
222
+ EventFieldset["URLS"] = "URLS";
223
+ /** Include `form` in the response. */
224
+ EventFieldset["FORM"] = "FORM";
225
+ /** Include `dashboard` in the response. */
226
+ EventFieldset["DASHBOARD"] = "DASHBOARD";
227
+ /** Include `feed` in the response. */
228
+ EventFieldset["FEED"] = "FEED";
229
+ /** Include `onlineConferencing` in the response. */
230
+ EventFieldset["ONLINE_CONFERENCING_SESSION"] = "ONLINE_CONFERENCING_SESSION";
231
+ /** Include `seoSettings` in the response. */
232
+ EventFieldset["SEO_SETTINGS"] = "SEO_SETTINGS";
233
+ /** Include `agendaSettings` in the response. */
234
+ EventFieldset["AGENDA"] = "AGENDA";
235
+ /** Include `categories` in the response. */
236
+ EventFieldset["CATEGORIES"] = "CATEGORIES";
237
+ })(EventFieldset = exports.EventFieldset || (exports.EventFieldset = {}));
238
+ var Relation;
239
+ (function (Relation) {
240
+ /**
241
+ * User is attending the event.
242
+ * User has RSVP with status YES or has ordered tickets.
243
+ */
244
+ Relation["ATTENDING"] = "ATTENDING";
245
+ })(Relation = exports.Relation || (exports.Relation = {}));
246
+ var LocationLocationType;
247
+ (function (LocationLocationType) {
248
+ LocationLocationType["VENUE"] = "VENUE";
249
+ LocationLocationType["ONLINE"] = "ONLINE";
250
+ })(LocationLocationType = exports.LocationLocationType || (exports.LocationLocationType = {}));
251
+ var SubdivisionType;
252
+ (function (SubdivisionType) {
253
+ SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
254
+ /** State */
255
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
256
+ /** County */
257
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
258
+ /** City/town */
259
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
260
+ /** Neighborhood/quarter */
261
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
262
+ /** Street/block */
263
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
264
+ /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
265
+ SubdivisionType["COUNTRY"] = "COUNTRY";
266
+ })(SubdivisionType = exports.SubdivisionType || (exports.SubdivisionType = {}));
267
+ var RecurrenceStatusStatus;
268
+ (function (RecurrenceStatusStatus) {
269
+ /** Event occurs only once. */
270
+ RecurrenceStatusStatus["ONE_TIME"] = "ONE_TIME";
271
+ /** Event is recurring. */
272
+ RecurrenceStatusStatus["RECURRING"] = "RECURRING";
273
+ /** Marks the next upcoming occurrence of the recurring event. */
274
+ RecurrenceStatusStatus["RECURRING_NEXT"] = "RECURRING_NEXT";
275
+ /** Marks the most recent ended occurrence of the recurring event. */
276
+ RecurrenceStatusStatus["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
277
+ /** Marks the most recent canceled occurrence of the recurring event. */
278
+ RecurrenceStatusStatus["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
279
+ })(RecurrenceStatusStatus = exports.RecurrenceStatusStatus || (exports.RecurrenceStatusStatus = {}));
280
+ var EventsEventStatus;
281
+ (function (EventsEventStatus) {
282
+ /** Event is public and scheduled to start */
283
+ EventsEventStatus["SCHEDULED"] = "SCHEDULED";
284
+ /** Event has started */
285
+ EventsEventStatus["STARTED"] = "STARTED";
286
+ /** Event has ended */
287
+ EventsEventStatus["ENDED"] = "ENDED";
288
+ /** Event was canceled */
289
+ EventsEventStatus["CANCELED"] = "CANCELED";
290
+ /** Event is not public and needs to be published */
291
+ EventsEventStatus["DRAFT"] = "DRAFT";
292
+ })(EventsEventStatus = exports.EventsEventStatus || (exports.EventsEventStatus = {}));
293
+ const _agenda = { pageUrl: 'wix.common.PageUrl' };
294
+ const _bulkCancelEventsByFilterRequest = {};
295
+ const _bulkCancelEventsByFilterResponse = {};
296
+ const _bulkDeleteEventsByFilterRequest = {};
297
+ const _bulkDeleteEventsByFilterResponse = {};
298
+ const _cancelEventRequest = {};
299
+ const _cancelEventResponse = { event: '_event' };
300
+ const _cloneEventRequest = { event: '_event' };
301
+ const _cloneEventResponse = { event: '_event' };
302
+ const _createEventRequest = { event: '_event' };
303
+ const _createEventResponse = { event: '_event' };
304
+ const _deleteEventRequest = {};
305
+ const _deleteEventResponse = {};
306
+ const _event = {
307
+ mainImage: 'wix.common.Image',
308
+ eventPageUrl: 'wix.common.PageUrl',
309
+ location: '_location',
310
+ agenda: '_agenda',
311
+ };
312
+ const _getEventBySlugRequest = {};
313
+ const _getEventBySlugResponse = { event: '_event' };
314
+ const _getEventRequest = {};
315
+ const _getEventResponse = { event: '_event' };
316
+ const _listEventsByCategoryRequest = {};
317
+ const _listEventsByCategoryResponse = { events: '_event' };
318
+ const _location = { address: 'wix.common.Address' };
319
+ const _publishDraftEventRequest = {};
320
+ const _publishDraftEventResponse = { event: '_event' };
321
+ const _queryEventsRequest = {};
322
+ const _queryEventsResponse = { events: '_event' };
323
+ const _updateEventRequest = { event: '_event' };
324
+ const _updateEventResponse = { event: '_event' };
325
+ /**
326
+ * Creates a draft version of the event. The draft includes a default registration form in the selected language, which consists of input fields for first name, last name, and email. See [Registration Form](https://dev.wix.com/api/rest/wix-events/wix-events/registration-form/about-the-registration-form-api) for more information.
327
+ * The event is automatically set up to send daily summary reports of new guests to your business email.
328
+ * @param event - Event data.
329
+ * @public
330
+ * @documentationMaturity preview
331
+ * @requiredField event
332
+ * @requiredField event.location
333
+ * @requiredField event.scheduling.config
334
+ * @requiredField event.title
335
+ * @permissionScope Manage Events
336
+ * @returns Created event.
337
+ */
338
+ function createEvent(event, options) {
339
+ var _a, _b, _c;
340
+ return __awaiter(this, arguments, void 0, function* () {
341
+ const requestTransformation = { event: '$[0]', draft: '$[1].draft' };
342
+ const responseTransformation = '$.event';
343
+ // @ts-ignore
344
+ const { httpClient, sideEffects } = arguments[2];
345
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
346
+ rootSchema: _createEventRequest,
347
+ depSchemas: { _agenda, _event, _location },
348
+ fqdnTransformation: {
349
+ paths: [...['event']],
350
+ transformation: _fromVeloEntity,
351
+ },
352
+ customTransformation: requestTransformation,
353
+ });
354
+ const { fromJSON } = (0, velo_1.serializer)({
355
+ rootSchema: _createEventResponse,
356
+ depSchemas: { _agenda, _event, _location },
357
+ fqdnTransformation: {
358
+ paths: [...['event']],
359
+ transformation: _toVeloEntity,
360
+ },
361
+ customTransformation: responseTransformation,
362
+ });
363
+ const payload = toAmbassadorRequest([event, options]);
364
+ const reqOpts = ambassadorWixEventsEventsV3Event.createEvent(payload);
365
+ __log(`"CreateEvent" sending request with: ${__inspect(reqOpts)}`);
366
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
367
+ try {
368
+ const result = yield httpClient.request(reqOpts);
369
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
370
+ return fromJSON(result.data);
371
+ }
372
+ catch (err) {
373
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
374
+ 'event',
375
+ 'options',
376
+ ]);
377
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
378
+ throw transformedError;
379
+ }
380
+ });
381
+ }
382
+ exports.createEvent = createEvent;
383
+ /**
384
+ * Copies an event, including the registration form, notifications, multilingual translations and tickets configuration from the original event. The new event's date is automatically set to 14 days from the original event date.
385
+ * If an event with the same title already exists, the title gets a sequence number. For example, if you copy an event named "Leather Crafting 101", the API renames it as "Leather Crafting 101 (1)".
386
+ * You can change the required entity field values while duplicating an event. See [Partial Updates](https://dev.wix.com/api/rest/wix-events/wix-events/partial-updates) for more information.
387
+ * @param eventId - Event ID.
388
+ * @public
389
+ * @documentationMaturity preview
390
+ * @requiredField eventId
391
+ * @permissionScope Manage Events
392
+ */
393
+ function cloneEvent(eventId, options) {
394
+ var _a, _b, _c;
395
+ return __awaiter(this, arguments, void 0, function* () {
396
+ const requestTransformation = {
397
+ eventId: '$[0]',
398
+ event: '$[1].event',
399
+ draft: '$[1].draft',
400
+ };
401
+ const responseTransformation = '$';
402
+ // @ts-ignore
403
+ const { httpClient, sideEffects } = arguments[2];
404
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
405
+ rootSchema: _cloneEventRequest,
406
+ depSchemas: { _agenda, _event, _location },
407
+ fqdnTransformation: {
408
+ paths: [...['event']],
409
+ transformation: _fromVeloEntity,
410
+ },
411
+ customTransformation: requestTransformation,
412
+ });
413
+ const { fromJSON } = (0, velo_1.serializer)({
414
+ rootSchema: _cloneEventResponse,
415
+ depSchemas: { _agenda, _event, _location },
416
+ fqdnTransformation: {
417
+ paths: [...['event']],
418
+ transformation: _toVeloEntity,
419
+ },
420
+ customTransformation: responseTransformation,
421
+ });
422
+ const payload = toAmbassadorRequest([eventId, options]);
423
+ const reqOpts = ambassadorWixEventsEventsV3Event.cloneEvent(payload);
424
+ __log(`"CloneEvent" 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 = (0, velo_1.transformError)(err, requestTransformation, [
433
+ 'eventId',
434
+ 'options',
435
+ ]);
436
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
437
+ throw transformedError;
438
+ }
439
+ });
440
+ }
441
+ exports.cloneEvent = cloneEvent;
442
+ /**
443
+ * Updates an event.
444
+ * Each time the event is updated, `revision` increments by 1. The existing `revision` must be included when updating the event. This ensures you're working with the latest event and prevents unintended overwrites.
445
+ * @param _id - Event ID.
446
+ * @public
447
+ * @documentationMaturity preview
448
+ * @requiredField _id
449
+ * @permissionScope Manage Events
450
+ * @returns Updated event.
451
+ */
452
+ function updateEvent(_id, options) {
453
+ var _a, _b, _c;
454
+ return __awaiter(this, arguments, void 0, function* () {
455
+ const requestTransformation = { event: { '*': '$[1].event', id: '$[0]' } };
456
+ const responseTransformation = '$.event';
457
+ // @ts-ignore
458
+ const { httpClient, sideEffects } = arguments[2];
459
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
460
+ rootSchema: _updateEventRequest,
461
+ depSchemas: { _agenda, _event, _location },
462
+ fqdnTransformation: {
463
+ paths: [...['event']],
464
+ transformation: _fromVeloEntity,
465
+ },
466
+ customTransformation: requestTransformation,
467
+ });
468
+ const { fromJSON } = (0, velo_1.serializer)({
469
+ rootSchema: _updateEventResponse,
470
+ depSchemas: { _agenda, _event, _location },
471
+ fqdnTransformation: {
472
+ paths: [...['event']],
473
+ transformation: _toVeloEntity,
474
+ },
475
+ customTransformation: responseTransformation,
476
+ });
477
+ const payload = toAmbassadorRequest([_id, options]);
478
+ const reqOpts = ambassadorWixEventsEventsV3Event.updateEvent(payload);
479
+ __log(`"UpdateEvent" 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 = (0, velo_1.transformError)(err, requestTransformation, [
488
+ '_id',
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
+ exports.updateEvent = updateEvent;
497
+ /**
498
+ * Publishes a draft event to your live site.
499
+ * @param eventId - Event ID.
500
+ * @public
501
+ * @documentationMaturity preview
502
+ * @requiredField eventId
503
+ * @permissionScope Manage Events
504
+ */
505
+ function publishDraftEvent(eventId) {
506
+ var _a, _b, _c;
507
+ return __awaiter(this, arguments, void 0, function* () {
508
+ const requestTransformation = { eventId: '$[0]' };
509
+ const responseTransformation = '$';
510
+ // @ts-ignore
511
+ const { httpClient, sideEffects } = arguments[1];
512
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
513
+ rootSchema: _publishDraftEventRequest,
514
+ depSchemas: {},
515
+ fqdnTransformation: {
516
+ paths: [],
517
+ transformation: _fromVeloEntity,
518
+ },
519
+ customTransformation: requestTransformation,
520
+ });
521
+ const { fromJSON } = (0, velo_1.serializer)({
522
+ rootSchema: _publishDraftEventResponse,
523
+ depSchemas: { _agenda, _event, _location },
524
+ fqdnTransformation: {
525
+ paths: [...['event']],
526
+ transformation: _toVeloEntity,
527
+ },
528
+ customTransformation: responseTransformation,
529
+ });
530
+ const payload = toAmbassadorRequest([eventId]);
531
+ const reqOpts = ambassadorWixEventsEventsV3Event.publishDraftEvent(payload);
532
+ __log(`"PublishDraftEvent" sending request with: ${__inspect(reqOpts)}`);
533
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
534
+ try {
535
+ const result = yield httpClient.request(reqOpts);
536
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
537
+ return fromJSON(result.data);
538
+ }
539
+ catch (err) {
540
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
541
+ 'eventId',
542
+ ]);
543
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
544
+ throw transformedError;
545
+ }
546
+ });
547
+ }
548
+ exports.publishDraftEvent = publishDraftEvent;
549
+ /**
550
+ * Cancels an event. After cancellation, registration for an event is closed. To reuse the event, you need to [Copy]() it and [Publish]() it again.
551
+ * If event cancellation notifications are enabled, canceling an event automatically triggers the sending of cancellation emails and/or push notifications to registered guests.
552
+ * @param eventId - Event ID.
553
+ * @public
554
+ * @documentationMaturity preview
555
+ * @requiredField eventId
556
+ * @permissionScope Manage Events
557
+ */
558
+ function cancelEvent(eventId) {
559
+ var _a, _b, _c;
560
+ return __awaiter(this, arguments, void 0, function* () {
561
+ const requestTransformation = { eventId: '$[0]' };
562
+ const responseTransformation = '$';
563
+ // @ts-ignore
564
+ const { httpClient, sideEffects } = arguments[1];
565
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
566
+ rootSchema: _cancelEventRequest,
567
+ depSchemas: {},
568
+ fqdnTransformation: {
569
+ paths: [],
570
+ transformation: _fromVeloEntity,
571
+ },
572
+ customTransformation: requestTransformation,
573
+ });
574
+ const { fromJSON } = (0, velo_1.serializer)({
575
+ rootSchema: _cancelEventResponse,
576
+ depSchemas: { _agenda, _event, _location },
577
+ fqdnTransformation: {
578
+ paths: [...['event']],
579
+ transformation: _toVeloEntity,
580
+ },
581
+ customTransformation: responseTransformation,
582
+ });
583
+ const payload = toAmbassadorRequest([eventId]);
584
+ const reqOpts = ambassadorWixEventsEventsV3Event.cancelEvent(payload);
585
+ __log(`"CancelEvent" sending request with: ${__inspect(reqOpts)}`);
586
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
587
+ try {
588
+ const result = yield httpClient.request(reqOpts);
589
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
590
+ return fromJSON(result.data);
591
+ }
592
+ catch (err) {
593
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
594
+ 'eventId',
595
+ ]);
596
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
597
+ throw transformedError;
598
+ }
599
+ });
600
+ }
601
+ exports.cancelEvent = cancelEvent;
602
+ /**
603
+ * Cancels multiple events that meet the specified `filter` parameter. After cancellation, registration for an event is closed. To reuse the event, you need to [Copy]() it and [Publish]() it again.
604
+ * If event cancellation notifications are enabled, canceling an event automatically triggers the sending of cancellation emails and/or push notifications to registered guests.
605
+ * @public
606
+ * @documentationMaturity preview
607
+ * @requiredField options.filter.filter
608
+ * @permissionScope Manage Events
609
+ */
610
+ function bulkCancelEventsByFilter(options) {
611
+ var _a, _b, _c;
612
+ return __awaiter(this, arguments, void 0, function* () {
613
+ const requestTransformation = { filter: '$[0].filter' };
614
+ const responseTransformation = '$';
615
+ // @ts-ignore
616
+ const { httpClient, sideEffects } = arguments[1];
617
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
618
+ rootSchema: _bulkCancelEventsByFilterRequest,
619
+ depSchemas: {},
620
+ fqdnTransformation: {
621
+ paths: [],
622
+ transformation: _fromVeloEntity,
623
+ },
624
+ customTransformation: requestTransformation,
625
+ });
626
+ const { fromJSON } = (0, velo_1.serializer)({
627
+ rootSchema: _bulkCancelEventsByFilterResponse,
628
+ depSchemas: {},
629
+ fqdnTransformation: {
630
+ paths: [],
631
+ transformation: _toVeloEntity,
632
+ },
633
+ customTransformation: responseTransformation,
634
+ });
635
+ const payload = toAmbassadorRequest([options]);
636
+ const reqOpts = ambassadorWixEventsEventsV3Event.bulkCancelEventsByFilter(payload);
637
+ __log(`"BulkCancelEventsByFilter" sending request with: ${__inspect(reqOpts)}`);
638
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
639
+ try {
640
+ const result = yield httpClient.request(reqOpts);
641
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
642
+ return fromJSON(result.data);
643
+ }
644
+ catch (err) {
645
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
646
+ 'options',
647
+ ]);
648
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
649
+ throw transformedError;
650
+ }
651
+ });
652
+ }
653
+ exports.bulkCancelEventsByFilter = bulkCancelEventsByFilter;
654
+ /**
655
+ * Permanently deletes an event.
656
+ * You can retrieve the deleted event through a GDPR access request.
657
+ * @param eventId - Event ID.
658
+ * @public
659
+ * @documentationMaturity preview
660
+ * @requiredField eventId
661
+ * @permissionScope Manage Events
662
+ */
663
+ function deleteEvent(eventId) {
664
+ var _a, _b, _c;
665
+ return __awaiter(this, arguments, void 0, function* () {
666
+ const requestTransformation = { eventId: '$[0]' };
667
+ const responseTransformation = '$';
668
+ // @ts-ignore
669
+ const { httpClient, sideEffects } = arguments[1];
670
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
671
+ rootSchema: _deleteEventRequest,
672
+ depSchemas: {},
673
+ fqdnTransformation: {
674
+ paths: [],
675
+ transformation: _fromVeloEntity,
676
+ },
677
+ customTransformation: requestTransformation,
678
+ });
679
+ const { fromJSON } = (0, velo_1.serializer)({
680
+ rootSchema: _deleteEventResponse,
681
+ depSchemas: {},
682
+ fqdnTransformation: {
683
+ paths: [],
684
+ transformation: _toVeloEntity,
685
+ },
686
+ customTransformation: responseTransformation,
687
+ });
688
+ const payload = toAmbassadorRequest([eventId]);
689
+ const reqOpts = ambassadorWixEventsEventsV3Event.deleteEvent(payload);
690
+ __log(`"DeleteEvent" sending request with: ${__inspect(reqOpts)}`);
691
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
692
+ try {
693
+ const result = yield httpClient.request(reqOpts);
694
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
695
+ return fromJSON(result.data);
696
+ }
697
+ catch (err) {
698
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
699
+ 'eventId',
700
+ ]);
701
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
702
+ throw transformedError;
703
+ }
704
+ });
705
+ }
706
+ exports.deleteEvent = deleteEvent;
707
+ /**
708
+ * Permanently deletes multiple events that meet the specified `filter` parameter.
709
+ * You can retrieve the deleted events through a GDPR access request.
710
+ * @public
711
+ * @documentationMaturity preview
712
+ * @requiredField options.filter.filter
713
+ * @permissionScope Manage Events
714
+ */
715
+ function bulkDeleteEventsByFilter(options) {
716
+ var _a, _b, _c;
717
+ return __awaiter(this, arguments, void 0, function* () {
718
+ const requestTransformation = { filter: '$[0].filter' };
719
+ const responseTransformation = '$';
720
+ // @ts-ignore
721
+ const { httpClient, sideEffects } = arguments[1];
722
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
723
+ rootSchema: _bulkDeleteEventsByFilterRequest,
724
+ depSchemas: {},
725
+ fqdnTransformation: {
726
+ paths: [],
727
+ transformation: _fromVeloEntity,
728
+ },
729
+ customTransformation: requestTransformation,
730
+ });
731
+ const { fromJSON } = (0, velo_1.serializer)({
732
+ rootSchema: _bulkDeleteEventsByFilterResponse,
733
+ depSchemas: {},
734
+ fqdnTransformation: {
735
+ paths: [],
736
+ transformation: _toVeloEntity,
737
+ },
738
+ customTransformation: responseTransformation,
739
+ });
740
+ const payload = toAmbassadorRequest([options]);
741
+ const reqOpts = ambassadorWixEventsEventsV3Event.bulkDeleteEventsByFilter(payload);
742
+ __log(`"BulkDeleteEventsByFilter" sending request with: ${__inspect(reqOpts)}`);
743
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
744
+ try {
745
+ const result = yield httpClient.request(reqOpts);
746
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
747
+ return fromJSON(result.data);
748
+ }
749
+ catch (err) {
750
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
751
+ 'options',
752
+ ]);
753
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
754
+ throw transformedError;
755
+ }
756
+ });
757
+ }
758
+ exports.bulkDeleteEventsByFilter = bulkDeleteEventsByFilter;
759
+ /**
760
+ * Retrieves a list of ticket definitions, given the provided paging, filtering, and sorting.
761
+ * Query Events runs with these defaults, which you can override:
762
+ * - `createdDate` is sorted in `ASC` order
763
+ * - `paging.limit` is `100`
764
+ * - `paging.offset` is `0`
765
+ * For field support for filters and sorting, see [Events v3: Supported Filters and Sorting](https://dev.wix.com/api/rest/wix-events/ticket-definitions-v3/filter-and-sort).
766
+ * To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
767
+ * @public
768
+ * @documentationMaturity preview
769
+ * @permissionScope Read Events
770
+ */
771
+ function queryEvents(options) {
772
+ const requestTransformation = { '*': '$[1]', query: '$[0]' };
773
+ const responseTransformation = {
774
+ items: '$.events',
775
+ pagingMetadata: '$.metadata',
776
+ };
777
+ // @ts-ignore
778
+ const { httpClient, sideEffects } = arguments[1];
779
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
780
+ rootSchema: _queryEventsRequest,
781
+ depSchemas: {},
782
+ fqdnTransformation: {
783
+ paths: [],
784
+ transformation: _fromVeloEntity,
785
+ },
786
+ customTransformation: requestTransformation,
787
+ });
788
+ const { fromJSON } = (0, velo_1.serializer)({
789
+ rootSchema: _queryEventsResponse,
790
+ depSchemas: { _agenda, _event, _location },
791
+ fqdnTransformation: {
792
+ paths: [...['Array#events']],
793
+ transformation: _toVeloEntity,
794
+ },
795
+ customTransformation: responseTransformation,
796
+ });
797
+ return (0, motion_edm_autogen_query_wrapper_1.wrapWithQueryBuilder)({
798
+ func: (payload) => __awaiter(this, void 0, void 0, function* () {
799
+ var _a, _b, _c;
800
+ const reqOpts = ambassadorWixEventsEventsV3Event.queryEvents(Object.assign(Object.assign({}, payload), (options !== null && options !== void 0 ? options : {})));
801
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
802
+ try {
803
+ const result = yield httpClient.request(reqOpts);
804
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
805
+ return result;
806
+ }
807
+ catch (err) {
808
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
809
+ throw err;
810
+ }
811
+ }),
812
+ requestTransformer: (...args) => toAmbassadorRequest(args),
813
+ responseTransformer: ({ data }) => fromJSON(data),
814
+ errorTransformer: (err) => {
815
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation);
816
+ throw transformedError;
817
+ },
818
+ pagingMethod: 'OFFSET',
819
+ transformationPaths: (0, velo_1.resolveQueryFieldsTransformationPaths)(_toVeloEntity),
820
+ })({ cursorWithEmptyFilterAndSort: true });
821
+ }
822
+ exports.queryEvents = queryEvents;
823
+ /**
824
+ * Retrieves a list of up to 100 events that belong to the same event category.
825
+ * @param categoryId - Category ID
826
+ * @public
827
+ * @documentationMaturity preview
828
+ * @requiredField categoryId
829
+ * @permissionScope Read Events
830
+ */
831
+ function listEventsByCategory(categoryId, options) {
832
+ var _a, _b, _c;
833
+ return __awaiter(this, arguments, void 0, function* () {
834
+ const requestTransformation = {
835
+ categoryId: '$[0]',
836
+ paging: '$[1].paging',
837
+ fieldset: '$[1].fieldset',
838
+ };
839
+ const responseTransformation = '$';
840
+ // @ts-ignore
841
+ const { httpClient, sideEffects } = arguments[2];
842
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
843
+ rootSchema: _listEventsByCategoryRequest,
844
+ depSchemas: {},
845
+ fqdnTransformation: {
846
+ paths: [],
847
+ transformation: _fromVeloEntity,
848
+ },
849
+ customTransformation: requestTransformation,
850
+ });
851
+ const { fromJSON } = (0, velo_1.serializer)({
852
+ rootSchema: _listEventsByCategoryResponse,
853
+ depSchemas: { _agenda, _event, _location },
854
+ fqdnTransformation: {
855
+ paths: [...['Array#events']],
856
+ transformation: _toVeloEntity,
857
+ },
858
+ customTransformation: responseTransformation,
859
+ });
860
+ const payload = toAmbassadorRequest([categoryId, options]);
861
+ const reqOpts = ambassadorWixEventsEventsV3Event.listEventsByCategory(payload);
862
+ __log(`"ListEventsByCategory" sending request with: ${__inspect(reqOpts)}`);
863
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
864
+ try {
865
+ const result = yield httpClient.request(reqOpts);
866
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
867
+ return fromJSON(result.data);
868
+ }
869
+ catch (err) {
870
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
871
+ 'categoryId',
872
+ 'options',
873
+ ]);
874
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
875
+ throw transformedError;
876
+ }
877
+ });
878
+ }
879
+ exports.listEventsByCategory = listEventsByCategory;
880
+ /**
881
+ * Retrieves an event by the ID.
882
+ * @param eventId - Event ID.
883
+ * @public
884
+ * @documentationMaturity preview
885
+ * @requiredField eventId
886
+ * @permissionScope Read Events
887
+ * @returns Event.
888
+ */
889
+ function getEvent(eventId, options) {
890
+ var _a, _b, _c;
891
+ return __awaiter(this, arguments, void 0, function* () {
892
+ const requestTransformation = { eventId: '$[0]', fieldset: '$[1].fieldset' };
893
+ const responseTransformation = '$.event';
894
+ // @ts-ignore
895
+ const { httpClient, sideEffects } = arguments[2];
896
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
897
+ rootSchema: _getEventRequest,
898
+ depSchemas: {},
899
+ fqdnTransformation: {
900
+ paths: [],
901
+ transformation: _fromVeloEntity,
902
+ },
903
+ customTransformation: requestTransformation,
904
+ });
905
+ const { fromJSON } = (0, velo_1.serializer)({
906
+ rootSchema: _getEventResponse,
907
+ depSchemas: { _agenda, _event, _location },
908
+ fqdnTransformation: {
909
+ paths: [...['event']],
910
+ transformation: _toVeloEntity,
911
+ },
912
+ customTransformation: responseTransformation,
913
+ });
914
+ const payload = toAmbassadorRequest([eventId, options]);
915
+ const reqOpts = ambassadorWixEventsEventsV3Event.getEvent(payload);
916
+ __log(`"GetEvent" sending request with: ${__inspect(reqOpts)}`);
917
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
918
+ try {
919
+ const result = yield httpClient.request(reqOpts);
920
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
921
+ return fromJSON(result.data);
922
+ }
923
+ catch (err) {
924
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
925
+ 'eventId',
926
+ 'options',
927
+ ]);
928
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
929
+ throw transformedError;
930
+ }
931
+ });
932
+ }
933
+ exports.getEvent = getEvent;
934
+ /**
935
+ * Retrieves an event by the slug URL.
936
+ * @param slug - URL slug.
937
+ * @public
938
+ * @documentationMaturity preview
939
+ * @requiredField slug
940
+ * @permissionScope Read Events
941
+ */
942
+ function getEventBySlug(slug, options) {
943
+ var _a, _b, _c;
944
+ return __awaiter(this, arguments, void 0, function* () {
945
+ const requestTransformation = { slug: '$[0]', fieldset: '$[1].fieldset' };
946
+ const responseTransformation = '$';
947
+ // @ts-ignore
948
+ const { httpClient, sideEffects } = arguments[2];
949
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
950
+ rootSchema: _getEventBySlugRequest,
951
+ depSchemas: {},
952
+ fqdnTransformation: {
953
+ paths: [],
954
+ transformation: _fromVeloEntity,
955
+ },
956
+ customTransformation: requestTransformation,
957
+ });
958
+ const { fromJSON } = (0, velo_1.serializer)({
959
+ rootSchema: _getEventBySlugResponse,
960
+ depSchemas: { _agenda, _event, _location },
961
+ fqdnTransformation: {
962
+ paths: [...['event']],
963
+ transformation: _toVeloEntity,
964
+ },
965
+ customTransformation: responseTransformation,
966
+ });
967
+ const payload = toAmbassadorRequest([slug, options]);
968
+ const reqOpts = ambassadorWixEventsEventsV3Event.getEventBySlug(payload);
969
+ __log(`"GetEventBySlug" sending request with: ${__inspect(reqOpts)}`);
970
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
971
+ try {
972
+ const result = yield httpClient.request(reqOpts);
973
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
974
+ return fromJSON(result.data);
975
+ }
976
+ catch (err) {
977
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
978
+ 'slug',
979
+ 'options',
980
+ ]);
981
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
982
+ throw transformedError;
983
+ }
984
+ });
985
+ }
986
+ exports.getEventBySlug = getEventBySlug;
987
+ //# sourceMappingURL=events-events-v3-event.universal.js.map