@wix/himalaya-cli 0.898.0 → 0.900.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.
|
@@ -35,7 +35,11 @@ export interface WixEventLocation {
|
|
|
35
35
|
export interface WixEvent {
|
|
36
36
|
id: string;
|
|
37
37
|
title?: string;
|
|
38
|
-
/**
|
|
38
|
+
/** Normally one of `WixEventStatus`, but deliberately NOT narrowed to it: `decodeEvent`
|
|
39
|
+
* fills this from the server's `status` and passes a value it does not recognise straight
|
|
40
|
+
* through, because dropping or rewriting one would lose a real event. A union here would
|
|
41
|
+
* be a claim this SDK cannot enforce. Compare against `WixEventStatus` when you need the
|
|
42
|
+
* stored set; the narrowing that IS enforced is on the `statuses` filter below. */
|
|
39
43
|
eventStatus?: string;
|
|
40
44
|
/** EventType: RSVP | TICKETS | EXTERNAL | NO_REGISTRATION */
|
|
41
45
|
eventType?: string;
|
|
@@ -55,6 +59,23 @@ export interface WixGetEventResponse {
|
|
|
55
59
|
}
|
|
56
60
|
export interface WixDeleteEventResponse {
|
|
57
61
|
}
|
|
62
|
+
/** The stored event statuses — what this SDK knows the server stores, and so the only values
|
|
63
|
+
* the `statuses` filter can match. The one source for both the runtime guard and the type
|
|
64
|
+
* below, so a status added here cannot be missed by either.
|
|
65
|
+
*
|
|
66
|
+
* Exported because `WixEventStatus` is declared in terms of it: the generated SDK reference
|
|
67
|
+
* ships each exported declaration verbatim, and a reader copying a type that names a symbol
|
|
68
|
+
* they cannot see gets TS2304.
|
|
69
|
+
*
|
|
70
|
+
* Frozen because `as const` is erased: it makes the TYPE readonly and leaves an ordinary
|
|
71
|
+
* mutable array behind. Unexported that was academic; exported it is not — module bindings
|
|
72
|
+
* share one array object, so a `push` from any untyped caller would edit the very set
|
|
73
|
+
* `queryEvents` validates against, for every caller in that realm. The freeze makes the
|
|
74
|
+
* runtime keep the promise the type already makes. */
|
|
75
|
+
export declare const EVENT_STATUSES: readonly ["SCHEDULED", "STARTED", "ENDED", "CANCELED", "DRAFT"];
|
|
76
|
+
/** One of the stored event statuses. `WixQueryEventsOptions.statuses` takes these, so a value
|
|
77
|
+
* outside the set is refused while the call is being written rather than when it is made. */
|
|
78
|
+
export type WixEventStatus = (typeof EVENT_STATUSES)[number];
|
|
58
79
|
export interface WixQueryEventsOptions {
|
|
59
80
|
/** Server-side WQL filter/sort for Events v3. Unlike the legacy convenience
|
|
60
81
|
* options below, these criteria are applied before paging. */
|
|
@@ -73,13 +94,13 @@ export interface WixQueryEventsOptions {
|
|
|
73
94
|
limit?: number;
|
|
74
95
|
/** Page offset. */
|
|
75
96
|
offset?: number;
|
|
76
|
-
/** Status filter (e.g. `["SCHEDULED"]`). Every entry must be
|
|
77
|
-
*
|
|
78
|
-
*
|
|
97
|
+
/** Status filter (e.g. `["SCHEDULED"]`). Every entry must be a `WixEventStatus`; anything
|
|
98
|
+
* else is refused rather than quietly matching nothing — by the compiler for a typed caller,
|
|
99
|
+
* and at runtime for one that is not. Omitted → all statuses returned.
|
|
79
100
|
* There is no stored "upcoming" status; select future events by their start date.
|
|
80
|
-
* For a value the server accepts that
|
|
81
|
-
* passed through to the server unchanged. */
|
|
82
|
-
statuses?:
|
|
101
|
+
* For a value the server accepts that `WixEventStatus` does not name, use `query.filter`,
|
|
102
|
+
* which is passed through to the server unchanged. */
|
|
103
|
+
statuses?: WixEventStatus[];
|
|
83
104
|
/** Sort property (the Owner list orders by "start"). */
|
|
84
105
|
order?: string;
|
|
85
106
|
/** Free-text title search. */
|
|
@@ -242,7 +242,7 @@ function wixCall(method, path, body) {
|
|
|
242
242
|
return globalThis.himalaya.wixApi.call(method, path, body);
|
|
243
243
|
}
|
|
244
244
|
var BASE = "https://manage.wix.com/_api/wix-one-events-server/events-in-clubs";
|
|
245
|
-
var EVENT_STATUSES = ["SCHEDULED", "STARTED", "ENDED", "CANCELED", "DRAFT"];
|
|
245
|
+
var EVENT_STATUSES = Object.freeze(["SCHEDULED", "STARTED", "ENDED", "CANCELED", "DRAFT"]);
|
|
246
246
|
function decodeEvent(raw) {
|
|
247
247
|
if (raw == null) return raw;
|
|
248
248
|
const r = raw;
|
|
@@ -365,6 +365,7 @@ function getEventsOrder(eventId, orderNumber) {
|
|
|
365
365
|
);
|
|
366
366
|
}
|
|
367
367
|
export {
|
|
368
|
+
EVENT_STATUSES,
|
|
368
369
|
cancelTicketReservation,
|
|
369
370
|
checkoutReservation,
|
|
370
371
|
createEvent,
|