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