@wix/events 1.0.0

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 +24 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/src/events-v2-policy.http.d.ts +17 -0
  5. package/build/cjs/src/events-v2-policy.http.js +198 -0
  6. package/build/cjs/src/events-v2-policy.http.js.map +1 -0
  7. package/build/cjs/src/events-v2-policy.public.d.ts +10 -0
  8. package/build/cjs/src/events-v2-policy.public.js +47 -0
  9. package/build/cjs/src/events-v2-policy.public.js.map +1 -0
  10. package/build/cjs/src/events-v2-policy.types.d.ts +380 -0
  11. package/build/cjs/src/events-v2-policy.types.js +56 -0
  12. package/build/cjs/src/events-v2-policy.types.js.map +1 -0
  13. package/build/cjs/src/events-v2-policy.universal.d.ts +465 -0
  14. package/build/cjs/src/events-v2-policy.universal.js +401 -0
  15. package/build/cjs/src/events-v2-policy.universal.js.map +1 -0
  16. package/build/es/index.d.ts +1 -0
  17. package/build/es/index.js +2 -0
  18. package/build/es/index.js.map +1 -0
  19. package/build/es/src/events-v2-policy.http.d.ts +17 -0
  20. package/build/es/src/events-v2-policy.http.js +189 -0
  21. package/build/es/src/events-v2-policy.http.js.map +1 -0
  22. package/build/es/src/events-v2-policy.public.d.ts +10 -0
  23. package/build/es/src/events-v2-policy.public.js +33 -0
  24. package/build/es/src/events-v2-policy.public.js.map +1 -0
  25. package/build/es/src/events-v2-policy.types.d.ts +380 -0
  26. package/build/es/src/events-v2-policy.types.js +53 -0
  27. package/build/es/src/events-v2-policy.types.js.map +1 -0
  28. package/build/es/src/events-v2-policy.universal.d.ts +465 -0
  29. package/build/es/src/events-v2-policy.universal.js +373 -0
  30. package/build/es/src/events-v2-policy.universal.js.map +1 -0
  31. package/package.json +37 -0
@@ -0,0 +1,465 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ /** Each event can have up to 3 policies - free-text that define terms & conditions, refunds & exchanges and/or other policies, as relevant. */
8
+ export interface Policy {
9
+ /**
10
+ * Policy ID (generated automatically)
11
+ * @readonly
12
+ */
13
+ _id?: string | null;
14
+ /**
15
+ * Represents the current state of Policy. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision
16
+ * @readonly
17
+ */
18
+ revision?: string | null;
19
+ /**
20
+ * Date policy was created
21
+ * @readonly
22
+ */
23
+ _createdDate?: Date;
24
+ /**
25
+ * Date policy was updated.
26
+ * @readonly
27
+ */
28
+ _updatedDate?: Date;
29
+ /** Policy name. */
30
+ name?: string;
31
+ /** Policy body. */
32
+ body?: string;
33
+ /** Event ID. */
34
+ eventId?: string;
35
+ }
36
+ export interface CreatePolicyRequest {
37
+ /** An Event Policy to be created */
38
+ policy: Policy;
39
+ }
40
+ export interface CreatePolicyResponse {
41
+ /** The Event Policy that was created */
42
+ policy?: Policy;
43
+ }
44
+ export interface UpdatePolicyRequest {
45
+ /** Event Policy to update */
46
+ policy: Policy;
47
+ }
48
+ export interface UpdatePolicyResponse {
49
+ /** The updated Event Policy */
50
+ policy?: Policy;
51
+ }
52
+ export interface UpdatePolicySortIndexRequest {
53
+ /** Policy's ID */
54
+ policyId?: string;
55
+ /** The revision of the Event Policy */
56
+ revision?: string;
57
+ /** the sort index of a policy to set */
58
+ sortIndex?: number;
59
+ }
60
+ export interface UpdatePolicySortIndexResponse {
61
+ /** the updated Event Policy */
62
+ policy?: Policy;
63
+ }
64
+ export interface DeletePolicyRequest {
65
+ /** Event Policy to delete */
66
+ policyId: string;
67
+ /** The revision of the Event Policy */
68
+ revision?: string;
69
+ }
70
+ export interface DeletePolicyResponse {
71
+ }
72
+ export interface QueryPoliciesRequest {
73
+ /** WQL expression */
74
+ query: QueryV2;
75
+ }
76
+ export interface QueryV2 extends QueryV2PagingMethodOneOf {
77
+ /**
78
+ * Filter object in the following format:
79
+ * `"filter" : {
80
+ * "fieldName1": "value1",
81
+ * "fieldName2":{"$operator":"value2"}
82
+ * }`
83
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
84
+ */
85
+ filter?: Record<string, any> | null;
86
+ /**
87
+ * Sort object in the following format:
88
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
89
+ */
90
+ sort?: Sorting[];
91
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
92
+ fields?: string[];
93
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
94
+ fieldsets?: string[];
95
+ /** Paging options to limit and skip the number of items. */
96
+ paging?: Paging;
97
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
98
+ cursorPaging?: CursorPaging;
99
+ }
100
+ /** @oneof */
101
+ export interface QueryV2PagingMethodOneOf {
102
+ /** Paging options to limit and skip the number of items. */
103
+ paging?: Paging;
104
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
105
+ cursorPaging?: CursorPaging;
106
+ }
107
+ export interface Sorting {
108
+ /** Name of the field to sort by. */
109
+ fieldName?: string;
110
+ /** Sort order. */
111
+ order?: SortOrder;
112
+ }
113
+ export declare enum SortOrder {
114
+ ASC = "ASC",
115
+ DESC = "DESC"
116
+ }
117
+ export interface Paging {
118
+ /** Number of items to load. */
119
+ limit?: number | null;
120
+ /** Number of items to skip in the current sort order. */
121
+ offset?: number | null;
122
+ }
123
+ export interface CursorPaging {
124
+ /** Number of items to load. */
125
+ limit?: number | null;
126
+ /**
127
+ * Pointer to the next or previous page in the list of results.
128
+ *
129
+ * You can get the relevant cursor token
130
+ * from the `pagingMetadata` object in the previous call's response.
131
+ * Not relevant for the first request.
132
+ */
133
+ cursor?: string | null;
134
+ }
135
+ export interface QueryPoliciesResponse {
136
+ /** Event Policies */
137
+ policies?: Policy[];
138
+ /** Query result's metadata */
139
+ metadata?: PagingMetadataV2;
140
+ }
141
+ export interface PagingMetadataV2 {
142
+ /** Number of items returned in the response. */
143
+ count?: number | null;
144
+ /** Offset that was requested. */
145
+ offset?: number | null;
146
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
147
+ total?: number | null;
148
+ /** Flag that indicates the server failed to calculate the `total` field. */
149
+ tooManyToCount?: boolean | null;
150
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
151
+ cursors?: Cursors;
152
+ }
153
+ export interface Cursors {
154
+ /** Cursor pointing to next page in the list of results. */
155
+ next?: string | null;
156
+ /** Cursor pointing to previous page in the list of results. */
157
+ prev?: string | null;
158
+ }
159
+ export interface ReorderEventPoliciesRequest extends ReorderEventPoliciesRequestReferencePolicyOneOf {
160
+ /** Event ID */
161
+ eventId?: string;
162
+ /** Event Policy ID */
163
+ policyId?: string;
164
+ /** Move the Event Policy Id before this Event Policy ID */
165
+ beforePolicyId?: string;
166
+ /** Move the Event Policy Id after this Event Policy ID */
167
+ afterPolicyId?: string;
168
+ }
169
+ /** @oneof */
170
+ export interface ReorderEventPoliciesRequestReferencePolicyOneOf {
171
+ /** Move the Event Policy Id before this Event Policy ID */
172
+ beforePolicyId?: string;
173
+ /** Move the Event Policy Id after this Event Policy ID */
174
+ afterPolicyId?: string;
175
+ }
176
+ export interface ReorderEventPoliciesResponse {
177
+ /** Ordered Event Policies */
178
+ policies?: Policy[];
179
+ }
180
+ export interface GetEventPoliciesRequest {
181
+ /** Event Id */
182
+ eventId: string;
183
+ }
184
+ export interface GetEventPoliciesResponse {
185
+ /** All policies of a particular event */
186
+ policies?: Policy[];
187
+ }
188
+ export interface EventCopied {
189
+ /** Event created timestamp in ISO UTC format. */
190
+ timestamp?: Date;
191
+ /** Event ID. */
192
+ eventId?: string;
193
+ /** Event location. */
194
+ location?: Location;
195
+ /** Event schedule configuration. */
196
+ scheduleConfig?: ScheduleConfig;
197
+ /** Event title. */
198
+ title?: string;
199
+ /** Event creator user ID. */
200
+ userId?: string | null;
201
+ /** Event status. */
202
+ status?: EventStatus;
203
+ /** Instance ID. Indicates the original app instance which current event was derived from. */
204
+ derivedFromInstanceId?: string | null;
205
+ /** Event ID. Indicates the original event which current event was derived from. */
206
+ derivedFromEventId?: string | null;
207
+ /**
208
+ * Map of copied ticket definitions from original event.
209
+ * Key represents ticket def id in the original event.
210
+ * Value represents ticket def id in the newly created event.
211
+ */
212
+ ticketDefinitions?: Record<string, string>;
213
+ }
214
+ export interface Location {
215
+ /** Location name. */
216
+ name?: string | null;
217
+ /** Location map coordinates. */
218
+ coordinates?: MapCoordinates;
219
+ /** Single line address representation. */
220
+ address?: string | null;
221
+ /** Location type. */
222
+ type?: LocationType;
223
+ /**
224
+ * Full address derived from formatted single line `address`.
225
+ * When `full_address` is used to create or update the event, deprecated `address` and `coordinates` are ignored.
226
+ * If provided `full_address` has empty `formatted_address` or `coordinates`, it will be auto-completed using Atlas service.
227
+ *
228
+ * Migration notes:
229
+ * - `full_address.formatted_address` is equivalent to `address`.
230
+ * - `full_address.geocode` is equivalent to `coordinates`.
231
+ */
232
+ fullAddress?: Address;
233
+ /**
234
+ * Defines event location as TBD (To Be Determined).
235
+ * When event location is not yet defined, `name` is displayed instead of location address.
236
+ * `coordinates`, `address`, `type` and `full_address` are not required when location is TBD.
237
+ */
238
+ tbd?: boolean | null;
239
+ }
240
+ export interface MapCoordinates {
241
+ /** Latitude. */
242
+ lat?: number;
243
+ /** Longitude. */
244
+ lng?: number;
245
+ }
246
+ export declare enum LocationType {
247
+ VENUE = "VENUE",
248
+ ONLINE = "ONLINE"
249
+ }
250
+ /** Physical address */
251
+ export interface Address extends AddressStreetOneOf {
252
+ /** country code */
253
+ country?: string | null;
254
+ /** subdivision (usually state or region) code according to ISO 3166-2 */
255
+ subdivision?: string | null;
256
+ /** city name */
257
+ city?: string | null;
258
+ /** zip/postal code */
259
+ postalCode?: string | null;
260
+ /** Free text providing more detailed address info. Usually contains Apt, Suite, Floor */
261
+ addressLine2?: string | null;
262
+ /** a break down of the street to number and street name */
263
+ streetAddress?: StreetAddress;
264
+ /** Main address line (usually street and number) as free text */
265
+ addressLine1?: string | null;
266
+ }
267
+ /** @oneof */
268
+ export interface AddressStreetOneOf {
269
+ /** a break down of the street to number and street name */
270
+ streetAddress?: StreetAddress;
271
+ /** Main address line (usually street and number) as free text */
272
+ addressLine?: string | null;
273
+ }
274
+ export interface StreetAddress {
275
+ /** street number */
276
+ number?: string;
277
+ /** street name */
278
+ name?: string;
279
+ }
280
+ export interface AddressLocation {
281
+ latitude?: number | null;
282
+ longitude?: number | null;
283
+ }
284
+ export interface Subdivision {
285
+ /** subdivision short code */
286
+ code?: string;
287
+ /** subdivision full-name */
288
+ name?: string;
289
+ }
290
+ export declare enum SubdivisionType {
291
+ UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
292
+ /** State */
293
+ ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
294
+ /** County */
295
+ ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
296
+ /** City/town */
297
+ ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
298
+ /** Neighborhood/quarter */
299
+ ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
300
+ /** Street/block */
301
+ ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
302
+ /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
303
+ COUNTRY = "COUNTRY"
304
+ }
305
+ export interface ScheduleConfig {
306
+ /**
307
+ * Defines event as TBD (To Be Determined) schedule.
308
+ * When event time is not yet defined, TBD message is displayed instead of event start and end times.
309
+ * `startDate`, `endDate` and `timeZoneId` are not required when schedule is TBD.
310
+ */
311
+ scheduleTbd?: boolean;
312
+ /** TBD message. */
313
+ scheduleTbdMessage?: string | null;
314
+ /** Event start timestamp. */
315
+ startDate?: Date;
316
+ /** Event end timestamp. */
317
+ endDate?: Date;
318
+ /** Event time zone ID in TZ database format, e.g., `EST`, `America/Los_Angeles`. */
319
+ timeZoneId?: string | null;
320
+ /** Whether end date is hidden in the formatted schedule. */
321
+ endDateHidden?: boolean;
322
+ /** Whether time zone is displayed in formatted schedule. */
323
+ showTimeZone?: boolean;
324
+ /** Event recurrences. */
325
+ recurrences?: Recurrences;
326
+ }
327
+ export interface Recurrences {
328
+ /** Event occurrences. */
329
+ occurrences?: Occurrence[];
330
+ /**
331
+ * Recurring event category ID.
332
+ * @readonly
333
+ */
334
+ categoryId?: string | null;
335
+ /**
336
+ * Recurrence status.
337
+ * @readonly
338
+ */
339
+ status?: Status;
340
+ }
341
+ export interface Occurrence {
342
+ /** Event start timestamp. */
343
+ startDate?: Date;
344
+ /** Event end timestamp. */
345
+ endDate?: Date;
346
+ /** Event time zone ID in TZ database format, e.g., `EST`, `America/Los_Angeles`. */
347
+ timeZoneId?: string | null;
348
+ /** Whether time zone is displayed in formatted schedule. */
349
+ showTimeZone?: boolean;
350
+ }
351
+ export declare enum Status {
352
+ /** Event occurs only once. */
353
+ ONE_TIME = "ONE_TIME",
354
+ /** Event is recurring. */
355
+ RECURRING = "RECURRING",
356
+ /** Marks the next upcoming occurrence of the recurring event. */
357
+ RECURRING_NEXT = "RECURRING_NEXT",
358
+ /** Marks the most recent ended occurrence of the recurring event. */
359
+ RECURRING_LAST_ENDED = "RECURRING_LAST_ENDED",
360
+ /** Marks the most recent canceled occurrence of the recurring event. */
361
+ RECURRING_LAST_CANCELED = "RECURRING_LAST_CANCELED"
362
+ }
363
+ export declare enum EventStatus {
364
+ /** Event is public and scheduled to start */
365
+ SCHEDULED = "SCHEDULED",
366
+ /** Event has started */
367
+ STARTED = "STARTED",
368
+ /** Event has ended */
369
+ ENDED = "ENDED",
370
+ /** Event was canceled */
371
+ CANCELED = "CANCELED",
372
+ /** Event is not public and needs to be published */
373
+ DRAFT = "DRAFT"
374
+ }
375
+ export interface Empty {
376
+ }
377
+ /**
378
+ * Creates a policy for an event.
379
+ * Each event can have up to 3 policies.
380
+ * @param policy - An Event Policy to be created
381
+ * @public
382
+ * @requiredField policy
383
+ * @requiredField policy.body
384
+ * @requiredField policy.eventId
385
+ * @requiredField policy.name
386
+ */
387
+ export declare function createPolicy(policy: Policy): Promise<CreatePolicyResponse>;
388
+ /**
389
+ * Updates a policy.
390
+ * @param _id - Policy ID (generated automatically)
391
+ * @public
392
+ * @requiredField _id
393
+ * @requiredField policy
394
+ * @requiredField policy.body
395
+ * @requiredField policy.eventId
396
+ * @requiredField policy.name
397
+ */
398
+ export declare function updatePolicy(_id: string | null, policy: UpdatePolicy): Promise<UpdatePolicyResponse>;
399
+ export interface UpdatePolicy {
400
+ /**
401
+ * Policy ID (generated automatically)
402
+ * @readonly
403
+ */
404
+ _id?: string | null;
405
+ /**
406
+ * Represents the current state of Policy. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision
407
+ * @readonly
408
+ */
409
+ revision?: string | null;
410
+ /**
411
+ * Date policy was created
412
+ * @readonly
413
+ */
414
+ _createdDate?: Date;
415
+ /**
416
+ * Date policy was updated.
417
+ * @readonly
418
+ */
419
+ _updatedDate?: Date;
420
+ /** Policy name. */
421
+ name?: string;
422
+ /** Policy body. */
423
+ body?: string;
424
+ /** Event ID. */
425
+ eventId?: string;
426
+ }
427
+ /**
428
+ * Deletes a policy.
429
+ * @param policyId - Event Policy to delete
430
+ * @public
431
+ * @requiredField policyId
432
+ */
433
+ export declare function deletePolicy(policyId: string, options?: DeletePolicyOptions): Promise<void>;
434
+ export interface DeletePolicyOptions {
435
+ /** The revision of the Event Policy */
436
+ revision?: string;
437
+ }
438
+ /**
439
+ * Retrieves a list of policies, given the provided paging and filter.
440
+ * @param query - WQL expression
441
+ * @public
442
+ * @requiredField query
443
+ */
444
+ export declare function queryPolicies(query: QueryV2): Promise<QueryPoliciesResponse>;
445
+ /**
446
+ * Change the order of Event Policies
447
+ * @public */
448
+ export declare function reorderEventPolicies(options?: ReorderEventPoliciesOptions): Promise<ReorderEventPoliciesResponse>;
449
+ export interface ReorderEventPoliciesOptions {
450
+ /** Event ID */
451
+ eventId?: string;
452
+ /** Event Policy ID */
453
+ policyId?: string;
454
+ /** Move the Event Policy Id before this Event Policy ID */
455
+ beforePolicyId?: string;
456
+ /** Move the Event Policy Id after this Event Policy ID */
457
+ afterPolicyId?: string;
458
+ }
459
+ /**
460
+ * Get all Event Policies of an Event
461
+ * @param eventId - Event Id
462
+ * @public
463
+ * @requiredField eventId
464
+ */
465
+ export declare function getEventPolicies(eventId: string): Promise<GetEventPoliciesResponse>;