@wix/himalaya-cli 0.896.0 → 0.898.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.
|
@@ -73,7 +73,12 @@ export interface WixQueryEventsOptions {
|
|
|
73
73
|
limit?: number;
|
|
74
74
|
/** Page offset. */
|
|
75
75
|
offset?: number;
|
|
76
|
-
/** Status filter (e.g. `["
|
|
76
|
+
/** Status filter (e.g. `["SCHEDULED"]`). Every entry must be one of the stored event
|
|
77
|
+
* statuses — `SCHEDULED`, `STARTED`, `ENDED`, `CANCELED`, `DRAFT` — and anything else is
|
|
78
|
+
* rejected rather than quietly matching nothing. Omitted → all statuses returned.
|
|
79
|
+
* There is no stored "upcoming" status; select future events by their start date.
|
|
80
|
+
* For a value the server accepts that this list does not name, use `query.filter`, which is
|
|
81
|
+
* passed through to the server unchanged. */
|
|
77
82
|
statuses?: string[];
|
|
78
83
|
/** Sort property (the Owner list orders by "start"). */
|
|
79
84
|
order?: string;
|
|
@@ -242,6 +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
246
|
function decodeEvent(raw) {
|
|
246
247
|
if (raw == null) return raw;
|
|
247
248
|
const r = raw;
|
|
@@ -264,13 +265,21 @@ function eventStartMs(e) {
|
|
|
264
265
|
return Number.isNaN(ms) ? Number.POSITIVE_INFINITY : ms;
|
|
265
266
|
}
|
|
266
267
|
async function queryEvents(opts = {}) {
|
|
268
|
+
const unknown = (opts.statuses ?? []).filter((s) => !EVENT_STATUSES.includes(s));
|
|
269
|
+
if (unknown.length > 0) {
|
|
270
|
+
throw new Error(
|
|
271
|
+
// Quoted, so that a value whose defect is invisible unquoted — a stray space, an empty
|
|
272
|
+
// string — reads as the defect it is rather than as a name the reader has to doubt.
|
|
273
|
+
`queryEvents: unknown status ${unknown.map((s) => JSON.stringify(s)).join(", ")} \u2014 statuses must be one of ${EVENT_STATUSES.join(", ")}`
|
|
274
|
+
);
|
|
275
|
+
}
|
|
267
276
|
const limit = opts.limit ?? opts.query?.paging?.limit ?? 50;
|
|
268
277
|
const offset = opts.offset ?? opts.query?.paging?.offset ?? 0;
|
|
269
278
|
const res = await wixCall("POST", "/events/v3/events/query", { query: { ...opts.query, paging: { limit, offset } } });
|
|
270
279
|
let events = (res.events ?? []).map(decodeEvent);
|
|
271
280
|
if (opts.statuses) {
|
|
272
281
|
const wanted = new Set(opts.statuses);
|
|
273
|
-
events = events.filter((e) => e.eventStatus
|
|
282
|
+
events = events.filter((e) => e.eventStatus != null && wanted.has(e.eventStatus));
|
|
274
283
|
}
|
|
275
284
|
if (opts.includeDrafts === false) events = events.filter((e) => (e.eventStatus ?? "").toUpperCase() !== "DRAFT");
|
|
276
285
|
if (opts.title) {
|
package/dist/cli.mjs
CHANGED
|
@@ -5241,6 +5241,7 @@ function resolveTranslation(value, catalog, sourceCatalog) {
|
|
|
5241
5241
|
var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
|
|
5242
5242
|
var init_bindings = __esm({
|
|
5243
5243
|
"../../core/ts/src/bindings.ts"() {
|
|
5244
|
+
"use strict";
|
|
5244
5245
|
BINDING_SIGILS = ["service", "flag", "item", "t"];
|
|
5245
5246
|
BINDING_SIGIL_RE = new RegExp(
|
|
5246
5247
|
`^\\$(?:${BINDING_SIGILS.filter((s) => s !== "t").join("|")})\\b|^\\$t:`
|
|
@@ -14337,7 +14337,7 @@
|
|
|
14337
14337
|
"name": "WixQueryEventsOptions",
|
|
14338
14338
|
"kind": "interface",
|
|
14339
14339
|
"jsdoc": "",
|
|
14340
|
-
"decl": "export interface WixQueryEventsOptions {\n /** Server-side WQL filter/sort for Events v3. Unlike the legacy convenience\n * options below, these criteria are applied before paging. */\n query?: { filter?: Record<string, unknown>; sort?: Array<{ fieldName: string; order: \"ASC\" | \"DESC\" }>; paging?: { limit?: number; offset?: number } };\n /** Page size. */\n limit?: number;\n /** Page offset. */\n offset?: number;\n /** Status filter (e.g. `[\"
|
|
14340
|
+
"decl": "export interface WixQueryEventsOptions {\n /** Server-side WQL filter/sort for Events v3. Unlike the legacy convenience\n * options below, these criteria are applied before paging. */\n query?: { filter?: Record<string, unknown>; sort?: Array<{ fieldName: string; order: \"ASC\" | \"DESC\" }>; paging?: { limit?: number; offset?: number } };\n /** Page size. */\n limit?: number;\n /** Page offset. */\n offset?: number;\n /** Status filter (e.g. `[\"SCHEDULED\"]`). Every entry must be one of the stored event\n * statuses — `SCHEDULED`, `STARTED`, `ENDED`, `CANCELED`, `DRAFT` — and anything else is\n * rejected rather than quietly matching nothing. Omitted → all statuses returned.\n * There is no stored \"upcoming\" status; select future events by their start date.\n * For a value the server accepts that this list does not name, use `query.filter`, which is\n * passed through to the server unchanged. */\n statuses?: string[];\n /** Sort property (the Owner list orders by \"start\"). */\n order?: string;\n /** Free-text title search. */\n title?: string;\n /** Include draft events in the result. */\n includeDrafts?: boolean;\n}"
|
|
14341
14341
|
},
|
|
14342
14342
|
{
|
|
14343
14343
|
"name": "decodeEvent",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.898.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"artifactId": "himalaya-cli"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
"falconPackageHash": "
|
|
67
|
+
"falconPackageHash": "af2277ebab8a4f10fe3ff24410fdc599cef6057161c3a776abef0c4f"
|
|
68
68
|
}
|