@wix/events 1.0.11 → 1.0.13

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