@go-labs-sg/event-tech 1.29.0 → 1.31.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.
package/dist/index.js CHANGED
@@ -9334,12 +9334,12 @@ StatusStaleMinutes (1-240,\n or null to reset to 10) is how long a set wait sta
9334
9334
  he activity log. Turning queueStatus off hides waits from guests but keeps them.\n Staff roster: event Helpdesk can list/count and add new entries with roster upsert (omit id).\n Helpdesk cannot edit an existing entry, import, remove, purge, export, or use other event tools.\n Managers retain full roster access. Assign/invite HELPDESK with expiresAt for event-day access;\n normal verified-email login and event assignment/revocation apply, not the station password.\n Host-only import replaces the roster and returns imported, replaced and\n rejected rows (blank, too long, or a Staff ID repeated in the file). Columns are matched from\n header names; override with the column flags. Without a last-name column, the last name is\n taken from the full name (--surname-position last|first, default last). Files over 20,000 data\n rows or 200 columns, or with no importable rows, are refused and the roster is unchanged. A blank\n last name is rejected only when the event requires one; counts report\
9335
9335
  s missingLastNameCount.\n Staff ID sign-in matches case-insensitively, ignoring spaces and punctuation, and needs the browser.\n Printed QR issue/revoke requires the last observed print version; stale versions conflict.\n claim scans a station QR; collect scans a participant profile QR as an event operator.\n Repeat scans never add a second stamp or change its original points.\n Destructive corrections, archive, reverse and print revoke require explicit target confirmation.\n Points are scores only; existing stamp-based Lucky Draw and prize thresholds still apply.\n Guest enrollment and account-linking require the browser; CLI uses existing device-approved auth.\n\nStaff redemption (STAFF_REDEMPTION events; most commands are registry commands, see below):\n Crew look up an Employee ID at a site counter, record the food items handed over and reveal a prize\n outcome the server decides in the same transaction. Setup is: settings, sites, crew passwords,\n sessions (one per shift), slots (se\
9336
9336
  ts per session and site), item groups and items, prizes, prize\n stock, roster. Run \'et staff-redemption setup get\' for the IDs and what is still missing.\n roster import reads a CSV, or an XLSX sheet (the first unless --sheet <name> names another; an unknown\n name lists the workbook\'s sheets; a CSV has no sheets and refuses --sheet), matches columns from header names (override\n with the column flags; "none" clears an optional column), adds new Employee IDs and updates existing\n ones, and reports created, updated, unchanged, archived, rejectedCount, rejected rows and\n unmatchedSites. Existing rows are never deleted, so redemptions survive a re-import; --archive-missing archives active entries that are not in the file.\n Use --sheet "Master list" to import that tab of a workbook (exact name, else ignoring case and spaces).\n export prints the redemption rows as JSON, or with --csv-file writes a CSV (UTF-8 with BOM, CRLF,\n one row per claim, oldest first, text that would run as a sp\
9337
- readsheet formula gets a leading\n apostrophe) and prints { file, rows }. It never overwrites a file unless --force. It needs event.export\n and fails above 20,000 rows; narrow the filters.\n Crew sign-in with a site password and the counter access check are browser-only; the CLI operates\n counters as event staff (event.operate) and names the site with siteId.\n Archive and unarchive use \'staff-redemption archive set\' with archived true or false.\n Every write repeats the event ID as --target. Lookup needs no confirmation (it writes nothing\n and is not rate-limited). Redeem takes a clientRequestId UUID you generate;\n retrying with the same UUID returns the stored receipt and never redeems twice.\n\nOrganization and event setup:\n organization create is global-admin only. It provisions the org and emails an owner invitation\n to --owner-email after it is saved; deliveryStatus (sent/failed) and\n ownerInvitation.emailDeliveryStatus report the outcome. Names must be unique.\n event creat\
9338
- e needs org owner/admin (or global admin). --type is an active event type such as\n LUCKY_DRAW; a LUCKY_DRAW event gets its board with default config automatically.\n --start/--end are ISO 8601 date-times with an offset, for example 2026-11-20T18:00:00+08:00.\n\nLucky draw:\n config, background and prize writes need event.setup, the same as the web board settings.\n config update is a merge patch: only the given keys change. Unknown keys and wrong value types\n are rejected before any request. Arrays (includeDomains etc.) are replaced, not appended.\n --dry-run prints the merged config without saving it.\n Keys: title, titleColor, isTitleVisible, titleFontSize, titleFont, prizeColor, prizeFontSize,\n isPrizeVisible, prizeFont, luckyDrawType (WHEEL|SLOT), slotBackgroundColor, slotBorderColor,\n slotTextColor, slotFontSize, slotTextFont, backgroundPreset, customBackgroundImage,\n numberOfSegments, segmentPreset, segmentText (NAME|LUCKY_DRAW_ID|BOTH), wheelSegmentFont,\n wheelSegmentFontSiz\
9339
- e, wheelSegmentColorsPreset, includeDomains, excludeDomains, includeEmails,\n excludeEmails, titlePositionX/Y, slotPositionX/Y, prizePositionX/Y, prizeDivWidth, prizeDivHeight.\n Positions are pixels on the 1920x1080 board.\n background upload stores the image (jpeg/png/webp/gif) and sets customBackgroundImage;\n the readback contains a signed /api/attachments URL. background clear unsets it.\n prizes create appends after the last prize; --prizes takes [{"name","description"?}].\n prizes delete permanently removes unassigned prizes and renumbers the rest.\n prizes reorder takes every active prize ID once, in the new order.\n pre-draw immediately saves winners for the next unassigned prizes in order.\n Uses the live draw random selection and participant filters in the backend.\n participants replace replaces the imported source roster; it is not an append.\n It requires --allow-state-change and --target exactly equal to --event-id.\n participants list defaults to page 1 with 100 results\
9340
- per page; inspect every page.\n\nRegistry commands (staff and admin operations, one per API procedure):\n et commands List every registry command as JSON.\n et <command> --help Show its input JSON Schema and confirmations.\n et <command> [--input <json> | --input-file <path>]\n et <write command> --input <json> --allow-state-change [--allow-delete] [--allow-email] --target <value>\n Groups: organization member/owner/invitation/update/image/archive/access/dashboard/analytics,\n admin organization/event/member/user/activity/dashboard, event access/details/update/\n status-update/archive/restore/duplicate/export/recent/background/story, activity list,\n lucky-draw winners/boards/participants eligible|delete/wheel/passport-sync,\n passport lucky-draws/operator-metadata, photo-wall, post-it, signature-wall, rating, human-bingo,\n staff-redemption setup/settings/site/crew-password/session/slot/item-group/item/prize/prize-stock/\n arc\
9341
- hive/roster list|counts|upsert/claims/draw/stock/counter/lookup/redeem.\n --input is passed unchanged to the procedure, so field names match the web app.\n Date fields take ISO 8601 strings and are sent as dates.\n Writes require --allow-state-change and --target equal to the input key shown by --help\n (arrays joined with commas). Hard deletes add --allow-delete; emails add --allow-email.\n Run every write once with --help first and read back the result afterwards.\n\nGlobal options:\n Bare flags (--dry-run, --allow-state-change, --allow-delete, --allow-email, --public,\n --no-browser) take no value;\n --flag=value spellings are rejected before any request.\n --api-url <url> Override EVENT_TECH_API_URL.\n --help Print this help as JSON.\n --version Print the CLI version as JSON.\n\nAuthentication:\n Run et auth login, then approve the matching device in Event Tech.\n Credentials are stored exclusively through Bun.secrets.\n EVENT_TECH_API_URL d\
9342
- efaults to '.concat(DEFAULT_EVENT_TECH_API_BASE_URL, ".");
9337
+ readsheet formula gets a leading\n apostrophe) and prints { file, rows }. It never overwrites a file unless --force. It needs event.export\n and fails above 20,000 rows; narrow the filters.\n Crew sign-in with a site password and the counter access check are browser-only; the CLI operates\n counters as event staff (event.operate) and names the site with siteId.\n Archive and unarchive use \'staff-redemption archive set\' with archived true or false.\n \'staff-redemption device-issues list\' reads the problems the employee QR page reported (kind, device\n problems, person, device snapshot) one cursor page at a time ({ items, pageInfo }); \'device-issues counts\'\n gives the totals and the count per kind. The page\'s own report is participant-only and has no command.\n Every write repeats the event ID as --target. Lookup needs no confirmation (it writes nothing\n and is not rate-limited). Redeem takes a clientRequestId UUID you generate;\n retrying with the same UUID returns the stored receipt \
9338
+ and never redeems twice.\n\nOrganization and event setup:\n organization create is global-admin only. It provisions the org and emails an owner invitation\n to --owner-email after it is saved; deliveryStatus (sent/failed) and\n ownerInvitation.emailDeliveryStatus report the outcome. Names must be unique.\n event create needs org owner/admin (or global admin). --type is an active event type such as\n LUCKY_DRAW; a LUCKY_DRAW event gets its board with default config automatically.\n --start/--end are ISO 8601 date-times with an offset, for example 2026-11-20T18:00:00+08:00.\n\nLucky draw:\n config, background and prize writes need event.setup, the same as the web board settings.\n config update is a merge patch: only the given keys change. Unknown keys and wrong value types\n are rejected before any request. Arrays (includeDomains etc.) are replaced, not appended.\n --dry-run prints the merged config without saving it.\n Keys: title, titleColor, isTitleVisible, titleFontSize, titleFont, priz\
9339
+ eColor, prizeFontSize,\n isPrizeVisible, prizeFont, luckyDrawType (WHEEL|SLOT), slotBackgroundColor, slotBorderColor,\n slotTextColor, slotFontSize, slotTextFont, backgroundPreset, customBackgroundImage,\n numberOfSegments, segmentPreset, segmentText (NAME|LUCKY_DRAW_ID|BOTH), wheelSegmentFont,\n wheelSegmentFontSize, wheelSegmentColorsPreset, includeDomains, excludeDomains, includeEmails,\n excludeEmails, titlePositionX/Y, slotPositionX/Y, prizePositionX/Y, prizeDivWidth, prizeDivHeight.\n Positions are pixels on the 1920x1080 board.\n background upload stores the image (jpeg/png/webp/gif) and sets customBackgroundImage;\n the readback contains a signed /api/attachments URL. background clear unsets it.\n prizes create appends after the last prize; --prizes takes [{"name","description"?}].\n prizes delete permanently removes unassigned prizes and renumbers the rest.\n prizes reorder takes every active prize ID once, in the new order.\n pre-draw immediately saves winners for the next un\
9340
+ assigned prizes in order.\n Uses the live draw random selection and participant filters in the backend.\n participants replace replaces the imported source roster; it is not an append.\n It requires --allow-state-change and --target exactly equal to --event-id.\n participants list defaults to page 1 with 100 results per page; inspect every page.\n\nRegistry commands (staff and admin operations, one per API procedure):\n et commands List every registry command as JSON.\n et <command> --help Show its input JSON Schema and confirmations.\n et <command> [--input <json> | --input-file <path>]\n et <write command> --input <json> --allow-state-change [--allow-delete] [--allow-email] --target <value>\n Groups: organization member/owner/invitation/update/image/archive/access/dashboard/analytics,\n admin organization/event/member/user/activity/dashboard, event access/details/update/\n status-update/archive/restore/duplicate/export/recent/\
9341
+ background/story, activity list,\n lucky-draw winners/boards/participants eligible|delete/wheel/passport-sync,\n passport lucky-draws/operator-metadata, photo-wall, post-it, signature-wall, rating, human-bingo,\n staff-redemption setup/settings/site/crew-password/session/slot/item-group/item/prize/prize-stock/\n archive/roster list|counts|upsert/claims/draw/stock/counter/lookup/redeem/device-issues list|counts.\n --input is passed unchanged to the procedure, so field names match the web app.\n Date fields take ISO 8601 strings and are sent as dates.\n Writes require --allow-state-change and --target equal to the input key shown by --help\n (arrays joined with commas). Hard deletes add --allow-delete; emails add --allow-email.\n Run every write once with --help first and read back the result afterwards.\n\nGlobal options:\n Bare flags (--dry-run, --allow-state-change, --allow-delete, --allow-email, --public,\n --no-browser) take no value;\n --flag=value spellings are rejected before any r\
9342
+ equest.\n --api-url <url> Override EVENT_TECH_API_URL.\n --help Print this help as JSON.\n --version Print the CLI version as JSON.\n\nAuthentication:\n Run et auth login, then approve the matching device in Event Tech.\n Credentials are stored exclusively through Bun.secrets.\n EVENT_TECH_API_URL defaults to '.concat(DEFAULT_EVENT_TECH_API_BASE_URL, ".");
9343
9343
  import { readFile as readFile3 } from "fs/promises";
9344
9344
  import { basename } from "path";
9345
9345
  var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH: "BOTH" }, LuckyDrawType = { WHEEL: "WHEEL", SLOT: "SLOT" }, luckyDrawConfigSchema = object({
@@ -9378,12 +9378,8 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
9378
9378
  prizePositionY: number2(),
9379
9379
  prizeDivWidth: number2(),
9380
9380
  prizeDivHeight: number2()
9381
- }), luckyDrawConfigInputProcedureSchema = object({ eventId: string2(), config: luckyDrawConfigSchema }), luckyDrawConfigInputSchema = object({ ...luckyDrawConfigSchema.omit({ customBackgroundImage: !0 }).shape, customBackgroundImage: union(
9382
- [_instanceof(File), string2()]
9383
- ).optional().nullable() }), DEFAULT_LUCKY_DRAW_CONFIG_INPUT_VALUES = { title: "Lucky Draw Title", titleColor: "#111111", isTitleVisible: !0, titleFontSize: 40, prizeColor: "#111111", prizeFontSize: 30, isPrizeVisible: !0, slotBackgroundColor: "#ffffff", slotBorderColor: "#ffffff", slotTextColor: "#111111", slotFontSize: 5, backgroundPreset: "#ede9fe", numberOfSegments: 12, includeDomains: [], excludeDomains: [], includeEmails: [], excludeEmails: [], segmentPreset: "Vibrant", segmentText: LuckyDrawSegmentText.NAME, luckyDrawType: LuckyDrawType.WHEEL, titleFont: "font-sans", prizeFont: "font-sans", wheelSegmentFont: "font-sans", wheelSegmentFontSize: 12, slotTextFont: "font-sans", customBackgroundImage: null, titlePositionX: 750, titlePositionY: 100, slotPositionX: 600, slotPositionY: 300, prizePositionX: 800, prizePositionY: 200, prizeDivWidth: 500, prizeDivHeight: 100, wheelSegmentColorsPreset: "Vibrant" }, luckyDrawPrizeInputSchema = object({ name: string2().min(1), description: string2().
9384
- optional() }), multipleLuckyDrawPrizeInputSchema = object(
9385
- { eventId: string2().min(1, "EventID is required"), prizes: array(luckyDrawPrizeInputSchema) }
9386
- ), LUCKY_DRAW_BACKGROUND_FOLDER = "lucky-draw/backgrounds", luckyDrawConfigPatchSchema = luckyDrawConfigSchema.partial().strict(), formatIssues = __name2((label, issues) => "".concat(label, " is invalid: ").concat(issues.map((issue2) => {
9381
+ }), luckyDrawConfigInputProcedureSchema = object({ eventId: string2(), config: luckyDrawConfigSchema }), luckyDrawConfigInputSchema = object({ ...luckyDrawConfigSchema.omit({ customBackgroundImage: !0 }).shape, customBackgroundImage: union([_instanceof(File), string2()]).optional().nullable() }), DEFAULT_LUCKY_DRAW_CONFIG_INPUT_VALUES = { title: "Lucky Draw Title", titleColor: "#111111", isTitleVisible: !0, titleFontSize: 40, prizeColor: "#111111", prizeFontSize: 30, isPrizeVisible: !0, slotBackgroundColor: "#ffffff", slotBorderColor: "#ffffff", slotTextColor: "#111111", slotFontSize: 5, backgroundPreset: "#ede9fe", numberOfSegments: 12, includeDomains: [], excludeDomains: [], includeEmails: [], excludeEmails: [], segmentPreset: "Vibrant", segmentText: LuckyDrawSegmentText.NAME, luckyDrawType: LuckyDrawType.WHEEL, titleFont: "font-sans", prizeFont: "font-sans", wheelSegmentFont: "font-sans", wheelSegmentFontSize: 12, slotTextFont: "font-sans", customBackgroundImage: null, titlePositionX: 750,
9382
+ titlePositionY: 100, slotPositionX: 600, slotPositionY: 300, prizePositionX: 800, prizePositionY: 200, prizeDivWidth: 500, prizeDivHeight: 100, wheelSegmentColorsPreset: "Vibrant" }, luckyDrawPrizeInputSchema = object({ name: string2().min(1), description: string2().optional() }), multipleLuckyDrawPrizeInputSchema = object({ eventId: string2().min(1, "EventID is required"), prizes: array(luckyDrawPrizeInputSchema) }), LUCKY_DRAW_BACKGROUND_FOLDER = "lucky-draw/backgrounds", luckyDrawConfigPatchSchema = luckyDrawConfigSchema.partial().strict(), formatIssues = __name2((label, issues) => "".concat(label, " is invalid: ").concat(issues.map((issue2) => {
9387
9383
  const path2 = issue2.path.map(String).join(".");
9388
9384
  return path2 ? "".concat(path2, ": ").concat(issue2.message) : issue2.message;
9389
9385
  }).join("; "), "."), "formatIssues"), parseLuckyDrawConfigPatch = __name2((raw) => {
@@ -9411,13 +9407,14 @@ optional() }), multipleLuckyDrawPrizeInputSchema = object(
9411
9407
  if (missing.length > 0) throw new CliUsageError("Prize ID(s) not found on event ".concat(eventId, ": ").concat(missing.join(", "), "."));
9412
9408
  }, "assertPrizesBelongToEvent"), saveConfig = __name2((eventId, config) => api2.event.luckyDraw.updateLuckyDrawConfigJson.mutate({ eventId, config }), "saveConfig"), runConfigGet = __name2(async ({ parsed, runtime, authenticate }) => {
9413
9409
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id"]);
9414
- const eventId = getRequiredFlag(parsed, "event-id");
9410
+ const eventId = getRequiredFlag(
9411
+ parsed,
9412
+ "event-id"
9413
+ );
9415
9414
  await authenticate(), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawByEventId.query({ eventId }));
9416
9415
  }, "runConfigGet"), runConfigUpdate = __name2(async ({ parsed, runtime, authenticate }) => {
9417
9416
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "config", "config-file", "dry-run"]);
9418
- const eventId = getRequiredFlag(parsed, "event-id"), patch = parseLuckyDrawConfigPatch(
9419
- await readInlineOrFile(parsed, "config", "config-file")
9420
- );
9417
+ const eventId = getRequiredFlag(parsed, "event-id"), patch = parseLuckyDrawConfigPatch(await readInlineOrFile(parsed, "config", "config-file"));
9421
9418
  await authenticate();
9422
9419
  const config = mergeLuckyDrawConfig(await loadCurrentConfig(eventId), patch);
9423
9420
  if (parsed.flags.get("dry-run") === !0) {
@@ -9427,7 +9424,10 @@ optional() }), multipleLuckyDrawPrizeInputSchema = object(
9427
9424
  writeSuccess(runtime, await saveConfig(eventId, config));
9428
9425
  }, "runConfigUpdate"), runBackgroundUpload = __name2(async ({ parsed, runtime, authenticate }) => {
9429
9426
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "file", "content-type"]);
9430
- const eventId = getRequiredFlag(parsed, "event-id"), filePath = getRequiredFlag(parsed, "file"), contentType = getRequiredFlag(parsed, "content-type");
9427
+ const eventId = getRequiredFlag(parsed, "event-id"), filePath = getRequiredFlag(parsed, "file"), contentType = getRequiredFlag(
9428
+ parsed,
9429
+ "content-type"
9430
+ );
9431
9431
  if (!contentType.startsWith("image/")) throw new CliUsageError("--content-type must be an image MIME type.");
9432
9432
  let file;
9433
9433
  try {
@@ -9436,13 +9436,7 @@ optional() }), multipleLuckyDrawPrizeInputSchema = object(
9436
9436
  throw new CliUsageError("--file could not be read.");
9437
9437
  }
9438
9438
  await authenticate();
9439
- const signed = await api2.attachment.getPresignedUrlToUpload.mutate({
9440
- folder: LUCKY_DRAW_BACKGROUND_FOLDER,
9441
- fileName: basename(filePath),
9442
- contentType,
9443
- size: file.byteLength,
9444
- eventId
9445
- }), uploadResponse = await fetch(signed.uploadUrl, { method: "PUT", headers: { "content-type": contentType }, body: file });
9439
+ const signed = await api2.attachment.getPresignedUrlToUpload.mutate({ folder: LUCKY_DRAW_BACKGROUND_FOLDER, fileName: basename(filePath), contentType, size: file.byteLength, eventId }), uploadResponse = await fetch(signed.uploadUrl, { method: "PUT", headers: { "content-type": contentType }, body: file });
9446
9440
  if (!uploadResponse.ok) throw new Error("Lucky draw background upload failed with HTTP ".concat(uploadResponse.status, "."));
9447
9441
  const config = mergeLuckyDrawConfig(await loadCurrentConfig(eventId), { customBackgroundImage: signed.key });
9448
9442
  await saveConfig(eventId, config), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawByEventId.query({ eventId }));
@@ -9452,11 +9446,7 @@ optional() }), multipleLuckyDrawPrizeInputSchema = object(
9452
9446
  assertStateChangeTarget(parsed, eventId), await authenticate();
9453
9447
  const config = mergeLuckyDrawConfig(await loadCurrentConfig(eventId), { customBackgroundImage: null });
9454
9448
  writeSuccess(runtime, await saveConfig(eventId, config));
9455
- }, "runBackgroundClear"), runPrizesList = __name2(async ({
9456
- parsed,
9457
- runtime,
9458
- authenticate
9459
- }) => {
9449
+ }, "runBackgroundClear"), runPrizesList = __name2(async ({ parsed, runtime, authenticate }) => {
9460
9450
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id"]);
9461
9451
  const eventId = getRequiredFlag(parsed, "event-id");
9462
9452
  await authenticate(), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawPrizesByEventId.query({ eventId }));
@@ -9470,13 +9460,12 @@ optional() }), multipleLuckyDrawPrizeInputSchema = object(
9470
9460
  }, "runPrizesCreate"), runPrizesUpdate = __name2(async ({ parsed, runtime, authenticate }) => {
9471
9461
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "prize-id", "name", "description"]);
9472
9462
  const eventId = getRequiredFlag(parsed, "event-id"), prizeId = getRequiredFlag(parsed, "prize-id"), name = getRequiredFlag(parsed, "name"), description = getOptionalFlag(parsed, "description");
9473
- await authenticate(), assertPrizesBelongToEvent(await loadPrizes(eventId), [prizeId], eventId), writeSuccess(runtime, await api2.event.luckyDraw.updateLuckyDrawPrize.mutate({ id: prizeId, name, ...description === void 0 ? {} : { description } }));
9463
+ await authenticate(), assertPrizesBelongToEvent(await loadPrizes(
9464
+ eventId
9465
+ ), [prizeId], eventId), writeSuccess(runtime, await api2.event.luckyDraw.updateLuckyDrawPrize.mutate({ id: prizeId, name, ...description === void 0 ? {} : { description } }));
9474
9466
  }, "runPrizesUpdate"), runPrizesDelete = __name2(async ({ parsed, runtime, authenticate }) => {
9475
9467
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "prize-ids", "allow-state-change", "target"]);
9476
- const eventId = getRequiredFlag(
9477
- parsed,
9478
- "event-id"
9479
- ), prizeIds = parseIdList(getRequiredFlag(parsed, "prize-ids"), "prize-ids");
9468
+ const eventId = getRequiredFlag(parsed, "event-id"), prizeIds = parseIdList(getRequiredFlag(parsed, "prize-ids"), "prize-ids");
9480
9469
  assertStateChangeTarget(parsed, eventId), await authenticate(), assertPrizesBelongToEvent(await loadPrizes(eventId), prizeIds, eventId), writeSuccess(runtime, await api2.event.luckyDraw.deleteLuckyDrawPrize.mutate({ prizeIds }));
9481
9470
  }, "runPrizesDelete"), runPrizesReorder = __name2(async ({ parsed, runtime, authenticate }) => {
9482
9471
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "prize-ids"]);
@@ -9485,12 +9474,11 @@ optional() }), multipleLuckyDrawPrizeInputSchema = object(
9485
9474
  const prizes = await loadPrizes(eventId);
9486
9475
  if (assertPrizesBelongToEvent(prizes, prizeIds, eventId), prizeIds.length !== prizes.length) throw new CliUsageError("--prize-ids must list all ".concat(prizes.length, " active prizes in the new order."));
9487
9476
  const namesById = new Map(prizes.map((prize) => [prize.id, prize.name]));
9488
- writeSuccess(runtime, await api2.event.luckyDraw.updateLuckyDrawPrizesOrder.mutate({
9489
- eventId,
9490
- prizes: prizeIds.map((id, order) => ({ id, order, name: namesById.get(id) ?? "" }))
9491
- }));
9477
+ writeSuccess(runtime, await api2.event.luckyDraw.updateLuckyDrawPrizesOrder.mutate({ eventId, prizes: prizeIds.map((id, order) => ({ id, order, name: namesById.get(id) ?? "" })) }));
9492
9478
  }, "runPrizesReorder"), LUCKY_DRAW_SETUP_HANDLERS = /* @__PURE__ */ new Map([["config get", runConfigGet], ["config update", runConfigUpdate], ["background upload", runBackgroundUpload], ["background clear", runBackgroundClear], ["prizes list", runPrizesList], ["prizes create", runPrizesCreate], ["prizes update", runPrizesUpdate], ["prizes delete", runPrizesDelete], ["prizes reorder", runPrizesReorder]]), runLuckyDrawSetupCommand = __name2(async (input) => {
9493
- const { parsed, runtime, authenticate } = input, [, action, subAction] = parsed.positionals, handler = LUCKY_DRAW_SETUP_HANDLERS.get("".concat(action, " ").concat(subAction));
9479
+ const { parsed, runtime, authenticate } = input, [, action, subAction] = parsed.positionals, handler = LUCKY_DRAW_SETUP_HANDLERS.get(
9480
+ "".concat(action, " ").concat(subAction)
9481
+ );
9494
9482
  return handler ? (await handler({ parsed, runtime, authenticate }), !0) : !1;
9495
9483
  }, "runLuckyDrawSetupCommand");
9496
9484
  import { readFile as readFile5 } from "fs/promises";
@@ -9499,20 +9487,19 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
9499
9487
  if (cells.length <= MAX_COLUMNS) return cells;
9500
9488
  if (cells.slice(MAX_COLUMNS).some(isFilled)) throw columnLimitError();
9501
9489
  return cells.slice(0, MAX_COLUMNS);
9502
- }, "clampColumns"), isZip = __name2((bytes) => bytes[0] === 80 && bytes[1] === 75 && bytes[2] === 3, "isZip"), decodeXml = __name2((value) => value.replace(new __cliRegExp("_x([0-9A-Fa-f]{4})_", "g"), (_, hex) => String.fromCharCode(Number.parseInt(hex, 16))).replace(new __cliRegExp("&#x([0-9A-Fa-f]+);", "g"), (_, hex) => String.fromCodePoint(Number.parseInt(hex, 16))).replace(new __cliRegExp("&#(\\d+);", "g"), (_, digits) => String.fromCodePoint(Number.parseInt(digits, 10))).replace(new __cliRegExp("&lt;", "g"), "<").replace(
9503
- new __cliRegExp("&gt;", "g"),
9504
- ">"
9505
- ).replace(new __cliRegExp("&quot;", "g"), '"').replace(new __cliRegExp("&apos;", "g"), "'").replace(new __cliRegExp("&amp;", "g"), "&"), "decodeXml"), textRuns = __name2((xml) => [...xml.replace(new __cliRegExp("<rPh\\b[\\s\\S]*?<\\/rPh>", "g"), "").matchAll(new __cliRegExp("<t\\b[^>]*>([\\s\\S]*?)<\\/t>", "g"))].map((match) => decodeXml(match[1] ?? "")).join(""), "textRuns"), attribute = __name2((tag, name) => new RegExp("\\s".concat(name, '="([^"]*)"')).exec(tag)?.[1], "attribute"), columnIndex = __name2((reference) => {
9490
+ }, "clampColumns"), isZip = __name2((bytes) => bytes[0] === 80 && bytes[1] === 75 && bytes[2] === 3, "isZip"), decodeXml = __name2(
9491
+ (value) => value.replace(new __cliRegExp("_x([0-9A-Fa-f]{4})_", "g"), (_, hex) => String.fromCharCode(Number.parseInt(hex, 16))).replace(new __cliRegExp("&#x([0-9A-Fa-f]+);", "g"), (_, hex) => String.fromCodePoint(Number.parseInt(hex, 16))).replace(new __cliRegExp("&#(\\d+);", "g"), (_, digits) => String.fromCodePoint(Number.parseInt(digits, 10))).replace(new __cliRegExp("&lt;", "g"), "<").replace(new __cliRegExp("&gt;", "g"), ">").replace(new __cliRegExp("&quot;", "g"), '"').replace(new __cliRegExp("&apos;", "g"), "'").replace(new __cliRegExp("&amp;", "g"), "&"),
9492
+ "decodeXml"
9493
+ ), textRuns = __name2((xml) => [...xml.replace(new __cliRegExp("<rPh\\b[\\s\\S]*?<\\/rPh>", "g"), "").matchAll(new __cliRegExp("<t\\b[^>]*>([\\s\\S]*?)<\\/t>", "g"))].map((match) => decodeXml(match[1] ?? "")).join(""), "textRuns"), attribute = __name2((tag, name) => new RegExp("\\s".concat(name, '="([^"]*)"')).exec(tag)?.[1], "attribute"), columnIndex = __name2((reference) => {
9506
9494
  const letters = new __cliRegExp("^[A-Z]+", "").exec(reference)?.[0] ?? "";
9507
9495
  let index = 0;
9508
- for (const letter of letters) index = index * 26 + letter.charCodeAt(0) - 64;
9496
+ for (const letter of letters)
9497
+ index = index * 26 + letter.charCodeAt(0) - 64;
9509
9498
  return index - 1;
9510
9499
  }, "columnIndex"), sheetPathFromTarget = __name2((target) => target.startsWith("/") ? target.slice(1) : "xl/".concat(target), "sheetPathFromTarget"), readWorkbookSheets = __name2(async (zip) => {
9511
9500
  const workbook = await zip.file("xl/workbook.xml")?.async("string");
9512
9501
  if (!workbook) return [];
9513
- const rels = await zip.file("xl/_rels/workbook.xml.rels")?.async(
9514
- "string"
9515
- ), relationships = rels ? [...rels.matchAll(new __cliRegExp("<Relationship\\b[^>]*>", "g"))].map((match) => match[0]) : [];
9502
+ const rels = await zip.file("xl/_rels/workbook.xml.rels")?.async("string"), relationships = rels ? [...rels.matchAll(new __cliRegExp("<Relationship\\b[^>]*>", "g"))].map((match) => match[0]) : [];
9516
9503
  return [...workbook.matchAll(new __cliRegExp("<sheet\\b[^>]*>", "g"))].map((match) => {
9517
9504
  const relationId = attribute(match[0], "r:id"), relationship = relationships.find((tag) => attribute(tag, "Id") === relationId), target = relationship ? attribute(relationship, "Target") : void 0;
9518
9505
  return { name: decodeXml(attribute(match[0], "name") ?? ""), path: target ? sheetPathFromTarget(target) : void 0 };
@@ -9528,15 +9515,15 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
9528
9515
  if (type === "inlineStr") return textRuns(cellXml);
9529
9516
  const raw = new __cliRegExp("<v>([\\s\\S]*?)<\\/v>", "").exec(cellXml)?.[1];
9530
9517
  return raw === void 0 ? "" : type === "s" ? sharedStrings[Number(raw)] ?? "" : type === "b" ? raw === "1" ? "TRUE" : "FALSE" : decodeXml(raw);
9531
- }, "cellValue"), readSharedStrings = __name2(async (zip) => {
9532
- const xml = await zip.file("xl/sharedStrings.xml")?.async("string");
9533
- return xml ? [...xml.matchAll(new __cliRegExp("<si\\b[^>]*>([\\s\\S]*?)<\\/si>", "g"))].map((match) => textRuns(match[1] ?? "")) : [];
9534
- }, "readSharedStrings"), readRowCells = __name2((rowXml, sharedStrings) => {
9518
+ }, "cellValue"), readSharedStrings = __name2(
9519
+ async (zip) => {
9520
+ const xml = await zip.file("xl/sharedStrings.xml")?.async("string");
9521
+ return xml ? [...xml.matchAll(new __cliRegExp("<si\\b[^>]*>([\\s\\S]*?)<\\/si>", "g"))].map((match) => textRuns(match[1] ?? "")) : [];
9522
+ },
9523
+ "readSharedStrings"
9524
+ ), readRowCells = __name2((rowXml, sharedStrings) => {
9535
9525
  const cells = [];
9536
- for (const cellMatch of rowXml.matchAll(new __cliRegExp(
9537
- "<c\\b[^>]*?(?:\\/>|>[\\s\\S]*?<\\/c>)",
9538
- "g"
9539
- ))) {
9526
+ for (const cellMatch of rowXml.matchAll(new __cliRegExp("<c\\b[^>]*?(?:\\/>|>[\\s\\S]*?<\\/c>)", "g"))) {
9540
9527
  const reference = attribute(cellMatch[0], "r"), column = reference ? columnIndex(reference) : cells.length, value = cellValue(cellMatch[0], sharedStrings);
9541
9528
  if (column < 0 || column >= MAX_COLUMNS) {
9542
9529
  if (isFilled(value)) throw columnLimitError();
@@ -9572,10 +9559,7 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
9572
9559
  for (; table.length > 0 && (table.at(-1) ?? []).every((value) => !value?.trim()); ) table.pop();
9573
9560
  const width = Math.max(0, ...table.map((row) => row.length));
9574
9561
  return table.map((row) => Array.from({ length: width }, (_, index) => row[index] ?? ""));
9575
- }, "squareTable"), toBytes = __name2(
9576
- (data) => data instanceof Uint8Array ? data : new Uint8Array(data),
9577
- "toBytes"
9578
- ), isXlsx = __name2((fileName, bytes) => fileName.toLowerCase().endsWith(".xlsx") || isZip(bytes), "isXlsx"), assertNotLegacyXls = __name2((fileName) => {
9562
+ }, "squareTable"), toBytes = __name2((data) => data instanceof Uint8Array ? data : new Uint8Array(data), "toBytes"), isXlsx = __name2((fileName, bytes) => fileName.toLowerCase().endsWith(".xlsx") || isZip(bytes), "isXlsx"), assertNotLegacyXls = __name2((fileName) => {
9579
9563
  if (fileName.toLowerCase().endsWith(".xls")) throw new Error("Save the file as .xlsx or .csv and try again.");
9580
9564
  }, "assertNotLegacyXls"), readSpreadsheetTable = __name2(async (fileName, data, options = {}) => {
9581
9565
  assertNotLegacyXls(fileName);
@@ -9618,38 +9602,39 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
9618
9602
  detail || row.contains).map(({ name, detail, contains }) => ({ name, ...detail ? { detail } : {}, ...contains ? { contains } : {} }))).pipe(array(object({ name: string2().min(1, "Menu items need a name."), detail: string2().optional(), contains: string2().optional() })).max(PASSPORT_STATION_INFO_MENU_MAX)).transform((rows) => rows.length > 0 ? rows : void 0), passportStationInfoSchema = object({ subtitle: optionalInfoText(PASSPORT_STATION_INFO_SUBTITLE_MAX), steps: passportStationInfoStepsSchema.optional(), menu: passportStationInfoMenuSchema.optional(), note: optionalInfoText(PASSPORT_STATION_INFO_NOTE_MAX) }).transform((info) => {
9619
9603
  const normalised = { ...info.subtitle ? { subtitle: info.subtitle } : {}, ...info.steps ? { steps: info.steps } : {}, ...info.menu ? { menu: info.menu } : {}, ...info.note ? { note: info.note } : {} };
9620
9604
  return Object.keys(normalised).length > 0 ? normalised : void 0;
9621
- }), passportStationInfoInputSchema = union([_null3(), passportStationInfoSchema.transform((info) => info ?? null)]), passportLoginMethodsSchema = object({
9622
- emailOtp: boolean2(),
9623
- google: boolean2(),
9624
- guest: boolean2(),
9625
- staffId: boolean2().default(!1),
9626
- staffIdRequiresLastName: boolean2().default(!0)
9627
- }).strict().refine((methods) => methods.emailOtp || methods.google || methods.staffId, { message: "Keep email OTP, Google or roster sign-in available for passport recovery." }), PASSPORT_QUEUE_STATUSES = ["UNDER_10_MIN", "UNDER_30_MIN", "OVER_30_MIN"], passportQueueStatusSchema = _enum(PASSPORT_QUEUE_STATUSES), PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN = 1, PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX = 240, PASSPORT_STAFF_ID_LABEL_DEFAULT = "Employee Number", PASSPORT_STAFF_ID_LABEL_MAX = 40, passportStaffIdLabelSchema = string2().trim().min(1).max(PASSPORT_STAFF_ID_LABEL_MAX), passportConfigSchema = object({
9628
- version: literal(1),
9629
- loginMethods: passportLoginMethodsSchema,
9630
- guestScan: boolean2().optional(),
9631
- simplifiedChinese: boolean2().optional(),
9632
- staffIdLabel: passportStaffIdLabelSchema.optional().catch(void 0),
9633
- categoryLabels: unknown().transform(sanitizePassportCategoryLabels).optional(),
9634
- queueStatus: boolean2().optional().catch(void 0),
9635
- queueStatusStaleMinutes: number2().int().min(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN).max(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX).optional().catch(void 0)
9636
- }), PRIZE_DESK_AWARD_MODES = ["SELF_SCAN", "STAFF_SCAN"], passportStationConfigSchema = object({ version: literal(1), collectionMode: _enum(["SELF_SCAN", "STAFF_SCAN", "STAFF_SCORE", "STAFF_TALLY"]), maxPoints: pointsSchema, printedQrVersion: printVersionSchema, printedQrEnabled: boolean2(), stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), tallyItems: passportTallyItemsSchema.optional(), tallyEarnsStamp: boolean2().optional(), menuItems: passportMenuItemsSchema.optional(), showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionLimit: _enum(["ONCE", "UNLIMITED"]).optional(), prizeDeskAward: boolean2().optional(), info: passportStationInfoSchema.optional().catch(void 0) }).superRefine((config, context) => {
9605
+ }), passportStationInfoInputSchema = union([_null3(), passportStationInfoSchema.transform((info) => info ?? null)]), passportLoginMethodsSchema = object({ emailOtp: boolean2(), google: boolean2(), guest: boolean2(), staffId: boolean2().default(!1), staffIdRequiresLastName: boolean2().default(!0) }).strict().refine((methods) => methods.emailOtp || methods.google || methods.staffId, { message: "Keep email OTP, Google or roster sign-in available for passport recovery." }), PASSPORT_QUEUE_STATUSES = ["UNDER_10_MIN", "UNDER_30_MIN", "OVER_30_MIN"], passportQueueStatusSchema = _enum(PASSPORT_QUEUE_STATUSES), PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN = 1, PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX = 240, PASSPORT_STAFF_ID_LABEL_DEFAULT = "Employee Number", PASSPORT_STAFF_ID_LABEL_MAX = 40, passportStaffIdLabelSchema = string2().trim().min(1).max(PASSPORT_STAFF_ID_LABEL_MAX), passportConfigSchema = object({ version: literal(1), loginMethods: passportLoginMethodsSchema, guestScan: boolean2().optional(),
9606
+ simplifiedChinese: boolean2().optional(), staffIdLabel: passportStaffIdLabelSchema.optional().catch(void 0), categoryLabels: unknown().transform(sanitizePassportCategoryLabels).optional(), queueStatus: boolean2().optional().catch(void 0), queueStatusStaleMinutes: number2().int().min(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN).max(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX).optional().catch(void 0) }), PRIZE_DESK_AWARD_MODES = ["SELF_SCAN", "STAFF_SCAN"], passportStationConfigSchema = object({ version: literal(1), collectionMode: _enum(["SELF_SCAN", "STAFF_SCAN", "STAFF_SCORE", "STAFF_TALLY"]), maxPoints: pointsSchema, printedQrVersion: printVersionSchema, printedQrEnabled: boolean2(), stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), tallyItems: passportTallyItemsSchema.optional(), tallyEarnsStamp: boolean2().optional(), menuItems: passportMenuItemsSchema.optional(), showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionLimit: _enum(
9607
+ ["ONCE", "UNLIMITED"]).optional(), prizeDeskAward: boolean2().optional(), info: passportStationInfoSchema.optional().catch(void 0) }).superRefine((config, context) => {
9637
9608
  validateMenuCollection(config, context);
9638
9609
  const tally = config.collectionMode === "STAFF_TALLY";
9639
9610
  tally && !config.tallyItems && context.addIssue({ code: "custom", path: ["tallyItems"], message: "Tally stations need at least one item." }), !tally && (config.tallyItems !== void 0 || config.tallyEarnsStamp !== void 0) && context.addIssue({ code: "custom", path: ["tallyItems"], message: "Only tally stations can list items." }), config.prizeDeskAward === !0 && (PRIZE_DESK_AWARD_MODES.includes(config.collectionMode) || context.addIssue({ code: "custom", path: ["prizeDeskAward"], message: "Only self-scan and staff-scan stations can be awarded at the prize desk." }), config.category === "BINGO" && context.addIssue({ code: "custom", path: ["prizeDeskAward"], message: "The Bingo station cannot be awarded at the prize desk." })), config.collectionMode !== "STAFF_SCORE" && config.maxPoints !== 0 && context.addIssue({ code: "custom", path: ["maxPoints"], message: "Only scored stations can award points." }), config.collectionMode !== "SELF_SCAN" && config.printedQrEnabled && context.addIssue(
9640
9611
  { code: "custom", path: ["printedQrEnabled"], message: "Only self-scan stations can issue printed QR codes." });
9641
- }), passportStationCollectionSchema = discriminatedUnion("collectionMode", [object({ showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionMode: literal("SELF_SCAN"), stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), prizeDeskAward: boolean2().optional(), info: passportStationInfoInputSchema.optional() }).strict(), object({ showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionMode: literal("STAFF_SCAN"), menuItems: passportMenuItemsSchema.nullable().optional(), collectionLimit: _enum(["ONCE", "UNLIMITED"]).optional(), stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), prizeDeskAward: boolean2().optional(), info: passportStationInfoInputSchema.optional() }).strict(), object({ showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionMode: literal("STAFF_SCORE"), maxPoints: pointsSchema, stampValue: stampValueSchema.optional(),
9642
- category: passportStationCategorySchema.optional(), info: passportStationInfoInputSchema.optional() }).strict(), object({ showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionMode: literal("STAFF_TALLY"), tallyItems: passportTallyItemsSchema, tallyEarnsStamp: boolean2().default(!1), stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), info: passportStationInfoInputSchema.optional() }).strict()]), passportEventIdSchema = object({ eventId: string2().min(1) }), passportStationIdSchema = passportEventIdSchema.extend({ stationId: string2().min(1) }), passportQrInputSchema = passportEventIdSchema.extend({ code: string2().min(1).max(2048) }), passportPrintQrMutationSchema = passportStationIdSchema.extend({ expectedPrintedQrVersion: printVersionSchema }), collectPassportStampByStaffSchema = passportStationIdSchema.extend({ profileCode: string2().min(1).max(2048), site: string2().trim().min(1).max(60).optional(), requestId: uuid2().
9643
- optional(), points: pointsSchema.optional(), item: string2().trim().min(1).max(PASSPORT_TALLY_ITEM_NAME_MAX).optional() }), recordPassportTallySchema = passportStationIdSchema.extend({ profileCode: string2().min(1).max(2048), item: string2().trim().min(1).max(PASSPORT_TALLY_ITEM_NAME_MAX), quantity: number2().int().min(1).max(PASSPORT_TALLY_QUANTITY_MAX).default(1) }), reversePassportTallySchema = passportEventIdSchema.extend({ tallyId: string2().min(1), reason: string2().trim().min(1).max(200) }), correctPassportStampSchema = passportStationIdSchema.extend({ participantId: string2().min(1), collectionId: string2().min(1).optional(), site: string2().trim().min(1).max(60).optional(), stamped: boolean2(), reason: string2().trim().min(1).max(500), points: pointsSchema.optional(), item: string2().trim().min(1).max(PASSPORT_TALLY_ITEM_NAME_MAX).optional() }), beginPassportAccountLinkSchema = discriminatedUnion("method", [passportEventIdSchema.extend({ method: literal("EMAIL_OTP"), email: string2().
9644
- trim().toLowerCase().pipe(email2()) }).strict(), passportEventIdSchema.extend({ method: literal("GOOGLE") }).strict()]), passportAccountLinkIntentSchema = passportEventIdSchema.extend({ intent: string2().regex(new __cliRegExp("^epl1\\.[A-Za-z0-9_-]{43}$", "")) }), requestPassportAccountLinkOtpSchema = passportAccountLinkIntentSchema.extend({ email: string2().trim().toLowerCase().pipe(email2()) }), joinPassportSchema = passportEventIdSchema.extend({ name: string2().trim().min(1).max(100) }), passportCategoryLabelInputSchema = string2().trim().max(PASSPORT_CATEGORY_LABEL_MAX), passportCategoryLabelEntryInputSchema = strictObject({ en: passportCategoryLabelInputSchema.optional(), "zh-CN": passportCategoryLabelInputSchema.optional() }), passportCategoryLabelsInputSchema = strictObject({ GAME: passportCategoryLabelEntryInputSchema.optional(), FOOD: passportCategoryLabelEntryInputSchema.optional(), DRINK: passportCategoryLabelEntryInputSchema.optional(), BINGO: passportCategoryLabelEntryInputSchema.
9645
- optional() }).transform((labels) => sanitizePassportCategoryLabels(labels) ?? {}), passportSettingsSchema = passportEventIdSchema.extend({ luckyDrawStampThreshold: number2().int().positive().nullable(), prizeStampThreshold: number2().int().positive().nullable(), maxRedemptionsPerParticipant: number2().int().min(0).max(2147483647), linkedDrawEventId: string2().min(1).nullable(), loginMethods: passportLoginMethodsSchema.optional(), guestScan: boolean2().optional(), simplifiedChinese: boolean2().optional(), staffIdLabel: union([_null3(), string2().trim().max(PASSPORT_STAFF_ID_LABEL_MAX).transform((label) => label === "" ? null : label)]).optional(), categoryLabels: union([_null3(), passportCategoryLabelsInputSchema]).optional(), queueStatus: boolean2().optional(), queueStatusStaleMinutes: number2().int().min(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN).max(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX).nullable().optional() }), setPassportStationQueueStatusSchema = passportEventIdSchema.extend({ stationId: string2().
9646
- min(1), status: passportQueueStatusSchema.nullable() }), renamePassportBingoSchema = passportEventIdSchema.extend({ name: string2().trim().min(1).max(100) }), passportStationSchema = passportEventIdSchema.extend({ id: string2().optional(), name: string2().trim().min(
9612
+ }), passportStationCollectionSchema = discriminatedUnion("collectionMode", [object({ showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionMode: literal("SELF_SCAN"), stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), prizeDeskAward: boolean2().optional(), info: passportStationInfoInputSchema.optional() }).strict(), object({
9613
+ showHowToCollect: boolean2().optional(),
9614
+ showMyQr: boolean2().optional(),
9615
+ collectionMode: literal("STAFF_SCAN"),
9616
+ menuItems: passportMenuItemsSchema.nullable().optional(),
9617
+ collectionLimit: _enum(["ONCE", "UNLIMITED"]).optional(),
9618
+ stampValue: stampValueSchema.optional(),
9619
+ category: passportStationCategorySchema.optional(),
9620
+ prizeDeskAward: boolean2().optional(),
9621
+ info: passportStationInfoInputSchema.optional()
9622
+ }).strict(), object({ showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionMode: literal("STAFF_SCORE"), maxPoints: pointsSchema, stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), info: passportStationInfoInputSchema.optional() }).strict(), object({ showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionMode: literal("STAFF_TALLY"), tallyItems: passportTallyItemsSchema, tallyEarnsStamp: boolean2().default(!1), stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), info: passportStationInfoInputSchema.optional() }).strict()]), passportEventIdSchema = object({ eventId: string2().min(1) }), passportStationIdSchema = passportEventIdSchema.extend({ stationId: string2().min(1) }), passportQrInputSchema = passportEventIdSchema.extend({ code: string2().min(1).max(2048) }), passportPrintQrMutationSchema = passportStationIdSchema.extend({ expectedPrintedQrVersion: printVersionSchema }),
9623
+ collectPassportStampByStaffSchema = passportStationIdSchema.extend({ profileCode: string2().min(1).max(2048), site: string2().trim().min(1).max(60).optional(), requestId: uuid2().optional(), points: pointsSchema.optional(), item: string2().trim().min(1).max(PASSPORT_TALLY_ITEM_NAME_MAX).optional() }), recordPassportTallySchema = passportStationIdSchema.extend({ profileCode: string2().min(1).max(2048), item: string2().trim().min(1).max(PASSPORT_TALLY_ITEM_NAME_MAX), quantity: number2().int().min(1).max(PASSPORT_TALLY_QUANTITY_MAX).default(1) }), reversePassportTallySchema = passportEventIdSchema.extend({ tallyId: string2().min(1), reason: string2().trim().min(1).max(200) }), correctPassportStampSchema = passportStationIdSchema.extend({ participantId: string2().min(1), collectionId: string2().min(1).optional(), site: string2().trim().min(1).max(60).optional(), stamped: boolean2(), reason: string2().trim().min(1).max(500), points: pointsSchema.optional(), item: string2().trim().min(
9624
+ 1
9625
+ ).max(PASSPORT_TALLY_ITEM_NAME_MAX).optional() }), beginPassportAccountLinkSchema = discriminatedUnion("method", [passportEventIdSchema.extend({ method: literal("EMAIL_OTP"), email: string2().trim().toLowerCase().pipe(email2()) }).strict(), passportEventIdSchema.extend({ method: literal("GOOGLE") }).strict()]), passportAccountLinkIntentSchema = passportEventIdSchema.extend({ intent: string2().regex(new __cliRegExp("^epl1\\.[A-Za-z0-9_-]{43}$", "")) }), requestPassportAccountLinkOtpSchema = passportAccountLinkIntentSchema.extend({ email: string2().trim().toLowerCase().pipe(email2()) }), joinPassportSchema = passportEventIdSchema.extend({ name: string2().trim().min(1).max(100) }), passportCategoryLabelInputSchema = string2().trim().max(PASSPORT_CATEGORY_LABEL_MAX), passportCategoryLabelEntryInputSchema = strictObject({ en: passportCategoryLabelInputSchema.optional(), "zh-CN": passportCategoryLabelInputSchema.optional() }), passportCategoryLabelsInputSchema = strictObject({ GAME: passportCategoryLabelEntryInputSchema.
9626
+ optional(), FOOD: passportCategoryLabelEntryInputSchema.optional(), DRINK: passportCategoryLabelEntryInputSchema.optional(), BINGO: passportCategoryLabelEntryInputSchema.optional() }).transform((labels) => sanitizePassportCategoryLabels(labels) ?? {}), passportSettingsSchema = passportEventIdSchema.extend({ luckyDrawStampThreshold: number2().int().positive().nullable(), prizeStampThreshold: number2().int().positive().nullable(), maxRedemptionsPerParticipant: number2().int().min(0).max(2147483647), linkedDrawEventId: string2().min(1).nullable(), loginMethods: passportLoginMethodsSchema.optional(), guestScan: boolean2().optional(), simplifiedChinese: boolean2().optional(), staffIdLabel: union([_null3(), string2().trim().max(PASSPORT_STAFF_ID_LABEL_MAX).transform((label) => label === "" ? null : label)]).optional(), categoryLabels: union([_null3(), passportCategoryLabelsInputSchema]).optional(), queueStatus: boolean2().optional(), queueStatusStaleMinutes: number2().int().min(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN).
9627
+ max(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX).nullable().optional() }), setPassportStationQueueStatusSchema = passportEventIdSchema.extend({ stationId: string2().min(1), status: passportQueueStatusSchema.nullable() }), renamePassportBingoSchema = passportEventIdSchema.extend({ name: string2().trim().min(1).max(100) }), passportStationSchema = passportEventIdSchema.extend({ id: string2().optional(), name: string2().trim().min(1).max(100), description: string2().trim().max(1e3).nullable(), location: string2().trim().max(200).nullable(), address: string2().trim().max(300).nullable().optional(), imageKey: string2().nullable().optional(), order: number2().int().min(0), opensAt: date2().nullable(), closesAt: date2().nullable(), collection: passportStationCollectionSchema.optional() }), passportPrizeSchema = passportEventIdSchema.extend({ id: string2().optional(), name: string2().trim().min(1).max(100), description: string2().trim().max(1e3).nullable(), imageKey: string2().max(2048).nullable().
9628
+ optional(), stock: number2().int().min(0), stampCost: number2().int().min(0).max(PASSPORT_PRIZE_STAMP_COST_MAX).optional(), order: number2().int().min(0) }), passportRedemptionRequestIdSchema = uuid2(), redeemPassportPrizeSchema = passportEventIdSchema.extend({ participantId: string2().min(1), prizeId: string2().min(1), quantity: number2().int().min(1).max(PASSPORT_REDEMPTION_QUANTITY_MAX).default(1), awardStationId: string2().min(1).optional(), bonusStamps: passportBonusStampsSchema.default(0), requestId: passportRedemptionRequestIdSchema.optional() }), PASSPORT_ROSTER_STAFF_ID_MAX = 64, PASSPORT_ROSTER_NAME_MAX = 100, PASSPORT_ROSTER_IMPORT_MAX = 2e4, PASSPORT_ROSTER_PAGE_MAX = 100, normalizePassportRosterKey = __name2((value) => value.normalize("NFKD").replace(new __cliRegExp("\\p{M}", "gu"), "").toLocaleLowerCase("en").replace(new __cliRegExp("[^\\p{L}\\p{N}]", "gu"), ""), "normalizePassportRosterKey"), rosterStaffIdSchema = string2().trim().min(1, "Enter an ID.").max(PASSPORT_ROSTER_STAFF_ID_MAX).
9629
+ refine((value) => normalizePassportRosterKey(value) !== "", { message: "The ID needs at least one letter or digit." }), rosterLastNameSchema = string2().trim().min(1, "Enter a last name.").max(PASSPORT_ROSTER_NAME_MAX).refine((value) => normalizePassportRosterKey(
9630
+ value
9631
+ ) !== "", { message: "Last name needs at least one letter or digit." }), rosterOptionalLastNameSchema = string2().trim().max(PASSPORT_ROSTER_NAME_MAX).nullable().transform((value) => value || null).refine((value) => value === null || normalizePassportRosterKey(value) !== "", { message: "Last name needs at least one letter or digit." }), passportStaffIdSignInSchema = passportEventIdSchema.extend({ staffId: rosterStaffIdSchema, lastName: rosterLastNameSchema.optional() }).strict(), passportRosterEntrySchema = passportEventIdSchema.extend({ id: string2().min(1).optional(), staffId: rosterStaffIdSchema, lastName: rosterOptionalLastNameSchema, displayName: string2().trim().max(PASSPORT_ROSTER_NAME_MAX).nullable().transform((value) => value || null) }).strict(), passportRosterEntryIdSchema = passportEventIdSchema.extend({ entryId: string2().min(1) }).strict(), passportRosterListSchema = passportEventIdSchema.extend({ search: string2().trim().max(200).optional(), limit: number2().int().min(1).
9632
+ max(PASSPORT_ROSTER_PAGE_MAX).default(25), cursor: string2().min(
9647
9633
  1
9648
- ).max(100), description: string2().trim().max(1e3).nullable(), location: string2().trim().max(200).nullable(), address: string2().trim().max(300).nullable().optional(), imageKey: string2().nullable().optional(), order: number2().int().min(0), opensAt: date2().nullable(), closesAt: date2().nullable(), collection: passportStationCollectionSchema.optional() }), passportPrizeSchema = passportEventIdSchema.extend({ id: string2().optional(), name: string2().trim().min(1).max(100), description: string2().trim().max(1e3).nullable(), imageKey: string2().max(2048).nullable().optional(), stock: number2().int().min(0), stampCost: number2().int().min(0).max(PASSPORT_PRIZE_STAMP_COST_MAX).optional(), order: number2().int().min(0) }), passportRedemptionRequestIdSchema = uuid2(), redeemPassportPrizeSchema = passportEventIdSchema.extend({ participantId: string2().min(1), prizeId: string2().min(1), quantity: number2().int().min(1).max(PASSPORT_REDEMPTION_QUANTITY_MAX).default(1), awardStationId: string2().
9649
- min(1).optional(), bonusStamps: passportBonusStampsSchema.default(0), requestId: passportRedemptionRequestIdSchema.optional() }), PASSPORT_ROSTER_STAFF_ID_MAX = 64, PASSPORT_ROSTER_NAME_MAX = 100, PASSPORT_ROSTER_IMPORT_MAX = 2e4, PASSPORT_ROSTER_PAGE_MAX = 100, normalizePassportRosterKey = __name2((value) => value.normalize("NFKD").replace(new __cliRegExp("\\p{M}", "gu"), "").toLocaleLowerCase("en").replace(new __cliRegExp("[^\\p{L}\\p{N}]", "gu"), ""), "normalizePassportRosterKey"), rosterStaffIdSchema = string2().trim().min(1, "Enter an ID.").max(PASSPORT_ROSTER_STAFF_ID_MAX).refine((value) => normalizePassportRosterKey(value) !== "", { message: "The ID needs at least one letter or digit." }), rosterLastNameSchema = string2().trim().min(1, "Enter a last name.").max(PASSPORT_ROSTER_NAME_MAX).refine((value) => normalizePassportRosterKey(value) !== "", { message: "Last name needs at least one letter or digit." }), rosterOptionalLastNameSchema = string2().trim().max(PASSPORT_ROSTER_NAME_MAX).
9650
- nullable().transform((value) => value || null).refine((value) => value === null || normalizePassportRosterKey(value) !== "", { message: "Last name needs at least one letter or digit." }), passportStaffIdSignInSchema = passportEventIdSchema.extend({ staffId: rosterStaffIdSchema, lastName: rosterLastNameSchema.optional() }).strict(), passportRosterEntrySchema = passportEventIdSchema.extend({ id: string2().min(1).optional(), staffId: rosterStaffIdSchema, lastName: rosterOptionalLastNameSchema, displayName: string2().trim().max(PASSPORT_ROSTER_NAME_MAX).nullable().transform((value) => value || null) }).strict(), passportRosterEntryIdSchema = passportEventIdSchema.extend({ entryId: string2().min(1) }).strict(), passportRosterListSchema = passportEventIdSchema.extend({ search: string2().trim().max(200).optional(), limit: number2().int().min(1).max(PASSPORT_ROSTER_PAGE_MAX).default(25), cursor: string2().min(1).max(8192).nullish(), direction: literal("forward").optional() }).strict(), passportRosterCountsSchema = passportEventIdSchema.
9651
- extend({ search: string2().trim().max(200).optional() }).strict(), passportRosterImportRowSchema = object({ row: number2().int().min(1), staffId: string2().max(1e3), lastName: string2().max(1e3), displayName: string2().max(1e3).nullable() }).strict(), importPassportRosterSchema = passportEventIdSchema.extend({ rows: array(passportRosterImportRowSchema).max(PASSPORT_ROSTER_IMPORT_MAX, "A roster can have at most ".concat(PASSPORT_ROSTER_IMPORT_MAX, " rows.")) }).strict(), passportRosterRejectReasonLabels = __name2((staffIdLabel) => ({ MISSING_STAFF_ID: "The ".concat(staffIdLabel, " is blank"), MISSING_LAST_NAME: "Last name is blank", DUPLICATE_STAFF_ID: "The ".concat(staffIdLabel, " appears earlier in the file"), TOO_LONG: "The ".concat(staffIdLabel, " is over ").concat(PASSPORT_ROSTER_STAFF_ID_MAX, " characters or a name is over ").concat(PASSPORT_ROSTER_NAME_MAX) }), "passportRosterRejectReasonLabels"), passportRosterRejectReasonLabel = passportRosterRejectReasonLabels(PASSPORT_STAFF_ID_LABEL_DEFAULT),
9652
- cell = __name2((row, index) => index === null ? "" : (row[index] ?? "").trim(), "cell"), surnameOf = __name2((fullName, position) => {
9634
+ ).max(8192).nullish(), direction: literal("forward").optional() }).strict(), passportRosterCountsSchema = passportEventIdSchema.extend({ search: string2().trim().max(200).optional() }).strict(), passportRosterImportRowSchema = object({ row: number2().int().min(1), staffId: string2().max(1e3), lastName: string2().max(1e3), displayName: string2().max(1e3).nullable() }).strict(), importPassportRosterSchema = passportEventIdSchema.extend({ rows: array(passportRosterImportRowSchema).max(PASSPORT_ROSTER_IMPORT_MAX, "A roster can have at most ".concat(PASSPORT_ROSTER_IMPORT_MAX, " rows.")) }).strict(), passportRosterRejectReasonLabels = __name2((staffIdLabel) => ({ MISSING_STAFF_ID: "The ".concat(staffIdLabel, " is blank"), MISSING_LAST_NAME: "Last name is blank", DUPLICATE_STAFF_ID: "The ".concat(staffIdLabel, " appears earlier in the file"), TOO_LONG: "The ".concat(staffIdLabel, " is over ").concat(PASSPORT_ROSTER_STAFF_ID_MAX, " characters or a name is over ").concat(PASSPORT_ROSTER_NAME_MAX) }),
9635
+ "passportRosterRejectReasonLabels"), passportRosterRejectReasonLabel = passportRosterRejectReasonLabels(
9636
+ PASSPORT_STAFF_ID_LABEL_DEFAULT
9637
+ ), cell = __name2((row, index) => index === null ? "" : (row[index] ?? "").trim(), "cell"), surnameOf = __name2((fullName, position) => {
9653
9638
  const words = fullName.split(new __cliRegExp("\\s+", "")).filter(Boolean);
9654
9639
  return (position === "first" ? words[0] : words.at(-1)) ?? "";
9655
9640
  }, "surnameOf"), assertPassportRosterMapping = __name2((mapping, columnCount, requireLastName) => {
@@ -9660,29 +9645,29 @@ cell = __name2((row, index) => index === null ? "" : (row[index] ?? "").trim(),
9660
9645
  const rows = [];
9661
9646
  if (table.slice(1).forEach((row, index) => {
9662
9647
  if (row.every((value) => value.trim() === "")) return;
9663
- const fullName = cell(row, mapping.fullName), lastName = mapping.lastName === null ? surnameOf(fullName, mapping.surnamePosition) : cell(row, mapping.lastName), displayName = cell(row, mapping.displayName ?? mapping.fullName) || null;
9664
- rows.push({ row: index + 2, staffId: cell(
9648
+ const fullName = cell(
9665
9649
  row,
9666
- mapping.staffId
9667
- ), lastName, displayName });
9650
+ mapping.fullName
9651
+ ), lastName = mapping.lastName === null ? surnameOf(fullName, mapping.surnamePosition) : cell(row, mapping.lastName), displayName = cell(row, mapping.displayName ?? mapping.fullName) || null;
9652
+ rows.push({ row: index + 2, staffId: cell(row, mapping.staffId), lastName, displayName });
9668
9653
  }), rows.length > PASSPORT_ROSTER_IMPORT_MAX) throw new Error("This file has ".concat(rows.length.toLocaleString("en-US"), " rows with data. A roster can have at most ").concat(PASSPORT_ROSTER_IMPORT_MAX.toLocaleString("en-US"), ". Split the file or remove rows you do not need."));
9669
9654
  return rows;
9670
- }, "mapPassportRosterTable"), headerPatterns = { staffId: new __cliRegExp("^(staff|employee|emp|personnel|badge|worker)[\\s_-]*(id|no|number|#|code)?$|^(staff|employee)$|^id$", ""), lastName: new __cliRegExp("^(last[\\s_-]*name|surname|family[\\s_-]*name|lname)$", ""), fullName: new __cliRegExp("^(full[\\s_-]*name|name|staff[\\s_-]*name|employee[\\s_-]*name)$", ""), displayName: new __cliRegExp("^(display[\\s_-]*name|preferred[\\s_-]*name|nickname)$", "") }, guessPassportRosterMapping = __name2((headers) => {
9671
- const find = __name2((pattern) => {
9672
- const index = headers.findIndex((header) => pattern.test(header.trim().toLowerCase()));
9673
- return index === -1 ? null : index;
9674
- }, "find");
9675
- return { staffId: find(headerPatterns.staffId) ?? 0, lastName: find(headerPatterns.lastName), fullName: find(headerPatterns.fullName), displayName: find(headerPatterns.displayName), surnamePosition: "last" };
9676
- }, "guessPassportRosterMapping"), PASSPORT_STATION_PASSWORD_MIN = 6, PASSPORT_STATION_PASSWORD_MAX = 128, PASSPORT_STATION_RECIPIENTS_PAGE_MAX = 100, stationStaffPasswordSchema = string2().min(PASSPORT_STATION_PASSWORD_MIN, "Use at least ".concat(PASSPORT_STATION_PASSWORD_MIN, " characters.")).max(PASSPORT_STATION_PASSWORD_MAX, "Use at most ".concat(PASSPORT_STATION_PASSWORD_MAX, " characters.")).refine((value) => value === value.trim(), { message: "Remove the spaces at the start or end of the password." }), signInToStationStaffSchema = passportEventIdSchema.extend({ password: string2().min(1).max(PASSPORT_STATION_PASSWORD_MAX) }).strict(), setPassportStationPasswordSchema = passportEventIdSchema.extend({ password: stationStaffPasswordSchema }).strict(), participantCodeSchema = string2().min(1).max(2048), stationStaffParticipantSchema = union([passportStationIdSchema.extend(
9677
- { profileCode: participantCodeSchema, site: string2().trim().min(1).max(60).optional() }
9678
- ), passportStationIdSchema.extend({ staffId: string2().trim().min(1).max(PASSPORT_ROSTER_STAFF_ID_MAX), site: string2().trim().min(1).max(60).optional() })]), stationPrizeClaimParticipantSchema = union([passportEventIdSchema.extend({ profileCode: participantCodeSchema }), passportEventIdSchema.extend({ staffId: string2().trim().min(1).max(PASSPORT_ROSTER_STAFF_ID_MAX) })]), redeemPrizeAsStationStaffSchema = passportEventIdSchema.extend({ profileCode: participantCodeSchema, prizeId: string2().min(1), awardStationId: string2().min(1).optional(), bonusStamps: passportBonusStampsSchema.default(0), requestId: passportRedemptionRequestIdSchema.optional() }).strict(), stationStampRecipientFiltersSchema = object({ search: string2().trim().max(200).optional() }).strict(), passportStationStampRecipientsSchema = passportStationIdSchema.extend({ filters: stationStampRecipientFiltersSchema.default({}), limit: number2().int().min(1).max(PASSPORT_STATION_RECIPIENTS_PAGE_MAX).default(25), cursor: string2().
9679
- min(1).max(8192).nullish(), direction: _enum(["forward", "backward"]).default("forward") }).strict().refine((input) => input.direction === "forward" || !!input.cursor, { message: "A backward page needs a cursor.", path: ["cursor"] }), passportStationStampRecipientCountsSchema = passportStationIdSchema.extend({ filters: stationStampRecipientFiltersSchema.default({}) }).strict();
9655
+ }, "mapPassportRosterTable"), headerPatterns = { staffId: new __cliRegExp("^(staff|employee|emp|personnel|badge|worker)[\\s_-]*(id|no|number|#|code)?$|^(staff|employee)$|^id$", ""), lastName: new __cliRegExp("^(last[\\s_-]*name|surname|family[\\s_-]*name|lname)$", ""), fullName: new __cliRegExp("^(full[\\s_-]*name|name|staff[\\s_-]*name|employee[\\s_-]*name)$", ""), displayName: new __cliRegExp("^(display[\\s_-]*name|preferred[\\s_-]*name|nickname)$", "") }, guessPassportRosterMapping = __name2(
9656
+ (headers) => {
9657
+ const find = __name2((pattern) => {
9658
+ const index = headers.findIndex((header) => pattern.test(header.trim().toLowerCase()));
9659
+ return index === -1 ? null : index;
9660
+ }, "find");
9661
+ return { staffId: find(headerPatterns.staffId) ?? 0, lastName: find(headerPatterns.lastName), fullName: find(headerPatterns.fullName), displayName: find(headerPatterns.displayName), surnamePosition: "last" };
9662
+ },
9663
+ "guessPassportRosterMapping"
9664
+ ), PASSPORT_STATION_PASSWORD_MIN = 6, PASSPORT_STATION_PASSWORD_MAX = 128, PASSPORT_STATION_RECIPIENTS_PAGE_MAX = 100, stationStaffPasswordSchema = string2().min(PASSPORT_STATION_PASSWORD_MIN, "Use at least ".concat(PASSPORT_STATION_PASSWORD_MIN, " characters.")).max(PASSPORT_STATION_PASSWORD_MAX, "Use at most ".concat(PASSPORT_STATION_PASSWORD_MAX, " characters.")).refine((value) => value === value.trim(), { message: "Remove the spaces at the start or end of the password." }), signInToStationStaffSchema = passportEventIdSchema.extend({ password: string2().min(1).max(PASSPORT_STATION_PASSWORD_MAX) }).strict(), setPassportStationPasswordSchema = passportEventIdSchema.extend({ password: stationStaffPasswordSchema }).strict(), participantCodeSchema = string2().min(1).max(2048), stationStaffParticipantSchema = union([passportStationIdSchema.extend({ profileCode: participantCodeSchema, site: string2().trim().min(1).max(60).optional() }), passportStationIdSchema.extend({ staffId: string2().trim().
9665
+ min(1).max(PASSPORT_ROSTER_STAFF_ID_MAX), site: string2().trim().min(1).max(60).optional() })]), stationPrizeClaimParticipantSchema = union([passportEventIdSchema.extend({ profileCode: participantCodeSchema }), passportEventIdSchema.extend({ staffId: string2().trim().min(1).max(PASSPORT_ROSTER_STAFF_ID_MAX) })]), redeemPrizeAsStationStaffSchema = passportEventIdSchema.extend({ profileCode: participantCodeSchema, prizeId: string2().min(1), awardStationId: string2().min(1).optional(), bonusStamps: passportBonusStampsSchema.default(0), requestId: passportRedemptionRequestIdSchema.optional() }).strict(), stationStampRecipientFiltersSchema = object({ search: string2().trim().max(200).optional() }).strict(), passportStationStampRecipientsSchema = passportStationIdSchema.extend({ filters: stationStampRecipientFiltersSchema.default({}), limit: number2().int().min(1).max(PASSPORT_STATION_RECIPIENTS_PAGE_MAX).default(25), cursor: string2().min(1).max(8192).nullish(), direction: _enum(["forward",
9666
+ "backward"]).default("forward") }).strict().refine((input) => input.direction === "forward" || !!input.cursor, { message: "A backward page needs a cursor.", path: ["cursor"] }), passportStationStampRecipientCountsSchema = passportStationIdSchema.extend({ filters: stationStampRecipientFiltersSchema.default({}) }).strict();
9680
9667
  import { readFile as readFile4 } from "fs/promises";
9681
9668
  import { basename as basename2 } from "path";
9682
- var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTES = 200 * 1024 * 1024, MAX_HUMAN_BINGO_MEDIA_UPLOAD_BYTES = 1024 * 1024 * 1024, SAFE_IMAGE_CONTENT_TYPES = ["image/jpeg", "image/png", "image/webp", "image/gif"], VIDEO_CONTENT_TYPES = ["video/mp4", "video/quicktime", "video/webm", "video/ogg"], SAFE_EVENT_IMAGE_CONTENT_TYPES = [...SAFE_IMAGE_CONTENT_TYPES], SAFE_EVENT_VIDEO_CONTENT_TYPES = [...VIDEO_CONTENT_TYPES], SAFE_EVENT_UPLOAD_CONTENT_TYPES = [...SAFE_IMAGE_CONTENT_TYPES, ...VIDEO_CONTENT_TYPES], getEventPassportUploadBaseFolder = __name2(
9683
- (kind) => "event-passport/".concat(kind),
9684
- "getEventPassportUploadBaseFolder"
9685
- ), EVENT_TECH_EVENT_TYPES = Object.values(EventType), HEX_COLOR_PATTERN = new __cliRegExp("^#[0-9a-f]{6}$", "i"), isEventThemeHexColor = __name2((value) => HEX_COLOR_PATTERN.test(value), "isEventThemeHexColor"), DEFAULT_PASSPORT_SKIN_SETTINGS = { heroImage: null, logo: null, colors: { graphic: null, dark: null }, emphasis: "accent" }, isRecord = __name2((value) => typeof value == "object" && value !== null && !Array.isArray(value), "isRecord"), toKey = __name2((value) => typeof value == "string" && value.trim().length > 0 ? value.trim() : null, "toKey"), toPercent = __name2((value) => typeof value == "number" && Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 50, "toPercent"), toHex = __name2((value) => typeof value == "string" && isEventThemeHexColor(value) ? value.toLowerCase() : null, "toHex"), readHeroImage = __name2((value) => {
9669
+ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTES = 200 * 1024 * 1024, MAX_HUMAN_BINGO_MEDIA_UPLOAD_BYTES = 1024 * 1024 * 1024, SAFE_IMAGE_CONTENT_TYPES = ["image/jpeg", "image/png", "image/webp", "image/gif"], VIDEO_CONTENT_TYPES = ["video/mp4", "video/quicktime", "video/webm", "video/ogg"], SAFE_EVENT_IMAGE_CONTENT_TYPES = [...SAFE_IMAGE_CONTENT_TYPES], SAFE_EVENT_VIDEO_CONTENT_TYPES = [...VIDEO_CONTENT_TYPES], SAFE_EVENT_UPLOAD_CONTENT_TYPES = [...SAFE_IMAGE_CONTENT_TYPES, ...VIDEO_CONTENT_TYPES], getEventPassportUploadBaseFolder = __name2((kind) => "event-passport/".concat(kind), "getEventPassportUploadBaseFolder"), EVENT_TECH_EVENT_TYPES = Object.values(EventType), HEX_COLOR_PATTERN = new __cliRegExp("^#[0-9a-f]{6}$", "i"), isEventThemeHexColor = __name2((value) => HEX_COLOR_PATTERN.test(value), "isEventThemeHexColor"), DEFAULT_PASSPORT_SKIN_SETTINGS = { heroImage: null, logo: null, colors: { graphic: null, dark: null }, emphasis: "accent" }, isRecord = __name2(
9670
+ (value) => typeof value == "object" && value !== null && !Array.isArray(value), "isRecord"), toKey = __name2((value) => typeof value == "string" && value.trim().length > 0 ? value.trim() : null, "toKey"), toPercent = __name2((value) => typeof value == "number" && Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 50, "toPercent"), toHex = __name2((value) => typeof value == "string" && isEventThemeHexColor(value) ? value.toLowerCase() : null, "toHex"), readHeroImage = __name2((value) => {
9686
9671
  if (!isRecord(value)) return null;
9687
9672
  const key = toKey(value.key);
9688
9673
  return key ? { key, focalX: toPercent(value.focalX), focalY: toPercent(value.focalY) } : null;
@@ -9694,11 +9679,11 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
9694
9679
  if (!isRecord(value)) return DEFAULT_PASSPORT_SKIN_SETTINGS;
9695
9680
  const colors = isRecord(value.colors) ? value.colors : {};
9696
9681
  return { heroImage: readHeroImage(value.heroImage), logo: readLogo(value.logo), colors: { graphic: toHex(colors.graphic), dark: toHex(colors.dark) }, emphasis: value.emphasis === "ink" ? "ink" : "accent" };
9697
- }, "resolvePassportSkinSettings"), resolvePassportSkinSettingsFromAppearance = __name2((appearance) => resolvePassportSkinSettings(isRecord(appearance) ? appearance.passport : void 0), "resolvePassportSkinSettingsFromAppearance"), photoWallScreenSchema = object({ width: number2().int().min(240).max(16384), height: number2().int().min(240).max(16384) }), photoWallSubmissionSettingsSchema = object({ mode: _enum(["photo-only", "comment-only", "photo-and-comment"]), photoRequired: boolean2(), commentRequired: boolean2() }), DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS = {
9698
- mode: "photo-and-comment",
9699
- photoRequired: !0,
9700
- commentRequired: !1
9701
- }, hexColorSchema = string2().trim().regex(new __cliRegExp("^#[0-9a-f]{6}$", "i"), "Color must be a six-digit hex color").transform((value) => value.toLowerCase()), getRelativeLuminance = __name2((color) => {
9682
+ }, "resolvePassportSkinSettings"), resolvePassportSkinSettingsFromAppearance = __name2((appearance) => resolvePassportSkinSettings(isRecord(appearance) ? appearance.passport : void 0), "resolvePassportSkinSettingsFromAppearance"), photoWallScreenSchema = object({ width: number2().int().min(240).max(16384), height: number2().int().min(240).max(16384) }), photoWallSubmissionSettingsSchema = object({
9683
+ mode: _enum(["photo-only", "comment-only", "photo-and-comment"]),
9684
+ photoRequired: boolean2(),
9685
+ commentRequired: boolean2()
9686
+ }), DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS = { mode: "photo-and-comment", photoRequired: !0, commentRequired: !1 }, hexColorSchema = string2().trim().regex(new __cliRegExp("^#[0-9a-f]{6}$", "i"), "Color must be a six-digit hex color").transform((value) => value.toLowerCase()), getRelativeLuminance = __name2((color) => {
9702
9687
  const toLinear = __name2((channel) => {
9703
9688
  const normalized = channel / 255;
9704
9689
  return normalized <= 0.04045 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
@@ -9707,14 +9692,29 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
9707
9692
  }, "getRelativeLuminance"), hasReadableTextContrast = __name2((textColor, backgroundColor) => {
9708
9693
  const textLuminance = getRelativeLuminance(textColor), backgroundLuminance = getRelativeLuminance(backgroundColor);
9709
9694
  return (Math.max(textLuminance, backgroundLuminance) + 0.05) / (Math.min(textLuminance, backgroundLuminance) + 0.05) >= 4.5;
9710
- }, "hasReadableTextContrast"), eventThemeSchema = object({ accentColor: hexColorSchema, backgroundColor: hexColorSchema, textColor: hexColorSchema, fontFamily: _enum(
9711
- ["SYSTEM", "JAKARTA", "SERIF"]
9712
- ) }).superRefine((theme, context) => {
9695
+ }, "hasReadableTextContrast"), eventThemeSchema = object(
9696
+ { accentColor: hexColorSchema, backgroundColor: hexColorSchema, textColor: hexColorSchema, fontFamily: _enum(["SYSTEM", "JAKARTA", "SERIF"]) }
9697
+ ).superRefine((theme, context) => {
9713
9698
  hasReadableTextContrast(theme.textColor, theme.backgroundColor) || context.addIssue({ code: "custom", message: "Text color must have at least 4.5:1 contrast on the background color", path: ["textColor"] });
9714
9699
  }), appearanceMediaSchema = discriminatedUnion("type", [object({ type: literal("none"), key: _null3() }), object({ type: literal("image"), key: string2().min(1).max(1024) })]), displayMediaSchema = discriminatedUnion("type", [object({ type: literal("none"), key: _null3() }), object({ type: literal("image"), key: string2().min(1).max(1024) }), object({ type: literal("video"), key: string2().min(1).max(1024) })]), passportImageKeySchema = string2().trim().min(1).max(1024), passportFocalSchema = number2().min(0).max(100), passportSkinSchema = object({ heroImage: object({ key: passportImageKeySchema, focalX: passportFocalSchema.default(50), focalY: passportFocalSchema.default(50) }).nullable().default(null), logo: object({ key: passportImageKeySchema }).nullable().default(null), colors: object({ graphic: hexColorSchema.nullable().default(null), dark: hexColorSchema.nullable().default(null).refine((color) => color === null || hasReadableTextContrast("#ffffff", color), "Dark colour must have\
9715
- at least 4.5:1 contrast with white text") }).default({ graphic: null, dark: null }), emphasis: _enum(["accent", "ink"]).default("accent") }), bingoScreenAppearanceSchema = object({ title: string2().trim().max(80).default(""), joinHeading: string2().trim().min(1).max(40).default("Scan to join"), joinInstructions: string2().trim().min(1).max(180).default("Open your camera, scan the QR code and enter your name."), titleFontSize: number2().int().min(32).max(96).default(64), nameFontSize: number2().int().min(24).max(52).default(40) }), DEFAULT_BINGO_SCREEN_APPEARANCE = bingoScreenAppearanceSchema.parse({}), eventAppearanceSchema = object({ version: literal(1), theme: eventThemeSchema, guestBackground: appearanceMediaSchema, displayBackground: displayMediaSchema, passport: passportSkinSchema.optional(), humanBingo: bingoScreenAppearanceSchema.optional(), photoWall: object({ durationSeconds: number2().int().min(10).max(40), maxVisible: number2().int().min(1).max(16), motion: _enum(["gentle",
9716
- "lively", "roaming"]), showQrCode: boolean2(), qrCodeLabel: string2().trim().max(80, "QR code text must be 80 characters or fewer").transform((value) => value || "Scan to share").default("Scan to share"), showEventName: boolean2(), screen: photoWallScreenSchema.nullable().default(null), submission: photoWallSubmissionSettingsSchema.default(DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS) }) }), DEFAULT_PASSPORT_SKIN = { heroImage: null, logo: null, colors: { graphic: null, dark: null }, emphasis: "accent" }, DEFAULT_EVENT_APPEARANCE2 = { version: 1, theme: { accentColor: "#f84404", backgroundColor: "#f6f7f9", textColor: "#20242a", fontFamily: "SYSTEM" }, guestBackground: { type: "none", key: null }, displayBackground: { type: "none", key: null }, photoWall: { durationSeconds: 18, maxVisible: 4, motion: "gentle", showQrCode: !0, qrCodeLabel: "Scan to share", showEventName: !0, screen: null, submission: DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS } }, IMAGE_CONTENT_TYPES = ["image/jpeg", "image/png", "\
9717
- image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requiredValue = __name2((flags, name) => {
9700
+ at least 4.5:1 contrast with white text") }).default({ graphic: null, dark: null }), emphasis: _enum(["accent", "ink"]).default("accent") }), bingoScreenAppearanceSchema = object({ title: string2().trim().max(80).default(""), joinHeading: string2().trim().min(1).max(40).default("Scan to join"), joinInstructions: string2().trim().min(1).max(180).default("Open your camera, scan the QR code and enter your name."), titleFontSize: number2().int().min(32).max(96).default(64), nameFontSize: number2().int().min(24).max(52).default(40) }), DEFAULT_BINGO_SCREEN_APPEARANCE = bingoScreenAppearanceSchema.parse({}), eventAppearanceSchema = object({
9701
+ version: literal(1),
9702
+ theme: eventThemeSchema,
9703
+ guestBackground: appearanceMediaSchema,
9704
+ displayBackground: displayMediaSchema,
9705
+ passport: passportSkinSchema.optional(),
9706
+ humanBingo: bingoScreenAppearanceSchema.optional(),
9707
+ photoWall: object({ durationSeconds: number2().int().min(10).max(40), maxVisible: number2().int().min(1).max(16), motion: _enum(["gentle", "lively", "roaming"]), showQrCode: boolean2(), qrCodeLabel: string2().trim().max(80, "QR code text must be 80 characters or fewer").transform((value) => value || "Scan to share").default("Scan to share"), showEventName: boolean2(), screen: photoWallScreenSchema.nullable().default(null), submission: photoWallSubmissionSettingsSchema.default(DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS) })
9708
+ }), DEFAULT_PASSPORT_SKIN = { heroImage: null, logo: null, colors: { graphic: null, dark: null }, emphasis: "accent" }, DEFAULT_EVENT_APPEARANCE2 = { version: 1, theme: { accentColor: "#f84404", backgroundColor: "#f6f7f9", textColor: "#20242a", fontFamily: "SYSTEM" }, guestBackground: { type: "none", key: null }, displayBackground: { type: "none", key: null }, photoWall: {
9709
+ durationSeconds: 18,
9710
+ maxVisible: 4,
9711
+ motion: "gentle",
9712
+ showQrCode: !0,
9713
+ qrCodeLabel: "Scan to share",
9714
+ showEventName: !0,
9715
+ screen: null,
9716
+ submission: DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS
9717
+ } }, IMAGE_CONTENT_TYPES = ["image/jpeg", "image/png", "image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requiredValue = __name2((flags, name) => {
9718
9718
  const value = flags.get(name);
9719
9719
  if (typeof value != "string" || value === "") throw new CliUsageError("--".concat(name, " is required and needs a value."));
9720
9720
  return value;
@@ -9743,15 +9743,14 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
9743
9743
  }, "readCanonicalAppearance"), getPassportSkin = __name2(async (eventId) => {
9744
9744
  const { projection, appearance } = await readCanonicalAppearance(eventId);
9745
9745
  return { appearanceVersion: projection.appearanceVersion, hasCustomAppearance: projection.hasCustomAppearance, passport: resolvePassportSkinSettingsFromAppearance(appearance), passportHeroImageUrl: projection.passportHeroImageUrl, passportLogoUrl: projection.passportLogoUrl };
9746
- }, "getPassportSkin"), saveSkin = __name2(
9747
- async (eventId, appearanceVersion, buildSkin) => {
9748
- const { projection, appearance } = await readCanonicalAppearance(eventId);
9749
- if (projection.appearanceVersion !== appearanceVersion) throw new CliUsageError("The appearance is at version ".concat(projection.appearanceVersion, ", not ").concat(appearanceVersion, ". Read it with `et passport skin get` and retry."));
9750
- const next = { ...appearance, passport: buildSkin(resolvePassportSkinSettingsFromAppearance(appearance)) };
9751
- return api2.event.updateEventAppearance.mutate({ eventId, appearance: next, appearanceVersion });
9752
- },
9753
- "saveSkin"
9754
- ), isUploadKind = __name2((kinds, value) => kinds.some((kind) => kind === value), "isUploadKind"), uploadPassportImage = __name2(async (eventId, kind, flags) => {
9746
+ }, "getPassportSkin"), saveSkin = __name2(async (eventId, appearanceVersion, buildSkin) => {
9747
+ const { projection, appearance } = await readCanonicalAppearance(eventId);
9748
+ if (projection.appearanceVersion !== appearanceVersion) throw new CliUsageError("The appearance is at version ".concat(projection.appearanceVersion, ", not ").concat(appearanceVersion, ". Read it with `et passport skin get` and retry."));
9749
+ const next = { ...appearance, passport: buildSkin(resolvePassportSkinSettingsFromAppearance(
9750
+ appearance
9751
+ )) };
9752
+ return api2.event.updateEventAppearance.mutate({ eventId, appearance: next, appearanceVersion });
9753
+ }, "saveSkin"), isUploadKind = __name2((kinds, value) => kinds.some((kind) => kind === value), "isUploadKind"), uploadPassportImage = __name2(async (eventId, kind, flags) => {
9755
9754
  const filePath = requiredValue(flags, "file"), contentType = requiredValue(flags, "content-type");
9756
9755
  if (!IMAGE_CONTENT_TYPES.some((allowed) => allowed === contentType)) throw new CliUsageError("--content-type must be one of: ".concat(IMAGE_CONTENT_TYPES.join(", "), "."));
9757
9756
  const file = await readFile4(filePath);
@@ -9759,45 +9758,51 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
9759
9758
  const signed = await api2.attachment.getPresignedUrlToUpload.mutate({ folder: getEventPassportUploadBaseFolder(kind), fileName: basename2(filePath), contentType, size: file.byteLength, eventId }), uploadResponse = await fetch(signed.uploadUrl, { method: "PUT", headers: { "content-type": contentType }, body: file });
9760
9759
  if (!uploadResponse.ok) throw new Error("Passport image upload failed with HTTP ".concat(uploadResponse.status, "."));
9761
9760
  return signed;
9762
- }, "uploadPassportImage"), createSkinOperation = __name2(
9763
- (subcommand, { eventId, flags, allowed }) => {
9764
- switch (subcommand) {
9765
- case "get":
9766
- return () => getPassportSkin(eventId);
9767
- case "set": {
9768
- allowed.push("appearance-version", "skin-json");
9769
- const version2 = nonnegativeInteger(requiredValue(flags, "appearance-version"), "appearance-version"), patch = parseJsonRecord(requiredValue(flags, "skin-json"), "skin-json");
9770
- return () => saveSkin(eventId, version2, (current) => mergeSkinPatch(current, patch));
9771
- }
9772
- case "clear": {
9773
- allowed.push("appearance-version");
9774
- const version2 = nonnegativeInteger(requiredValue(flags, "appearance-version"), "appearance-version");
9775
- return () => saveSkin(eventId, version2, () => DEFAULT_PASSPORT_SKIN);
9776
- }
9777
- case "upload": {
9778
- allowed.push("kind", "file", "content-type");
9779
- const kind = requiredValue(flags, "kind");
9780
- if (!isUploadKind(PASSPORT_SKIN_UPLOAD_KINDS, kind)) throw new CliUsageError("--kind must be one of: ".concat(PASSPORT_SKIN_UPLOAD_KINDS.join(", "), "."));
9781
- return () => uploadPassportImage(eventId, kind, flags);
9782
- }
9783
- default:
9784
- return null;
9761
+ }, "uploadPassportImage"), createSkinOperation = __name2((subcommand, { eventId, flags, allowed }) => {
9762
+ switch (subcommand) {
9763
+ case "get":
9764
+ return () => getPassportSkin(eventId);
9765
+ case "set": {
9766
+ allowed.push("appearance-version", "skin-json");
9767
+ const version2 = nonnegativeInteger(requiredValue(flags, "appearance-version"), "appearance-version"), patch = parseJsonRecord(requiredValue(flags, "skin-json"), "skin-json");
9768
+ return () => saveSkin(eventId, version2, (current) => mergeSkinPatch(current, patch));
9769
+ }
9770
+ case "clear": {
9771
+ allowed.push("appearance-version");
9772
+ const version2 = nonnegativeInteger(requiredValue(flags, "appearance-version"), "appearance-version");
9773
+ return () => saveSkin(eventId, version2, () => DEFAULT_PASSPORT_SKIN);
9774
+ }
9775
+ case "upload": {
9776
+ allowed.push("kind", "file", "content-type");
9777
+ const kind = requiredValue(flags, "kind");
9778
+ if (!isUploadKind(PASSPORT_SKIN_UPLOAD_KINDS, kind)) throw new CliUsageError("--kind must be one of: ".concat(PASSPORT_SKIN_UPLOAD_KINDS.join(", "), "."));
9779
+ return () => uploadPassportImage(
9780
+ eventId,
9781
+ kind,
9782
+ flags
9783
+ );
9785
9784
  }
9786
- },
9787
- "createSkinOperation"
9788
- ), setStationImage = __name2(async (eventId, stationId, imageKey) => {
9785
+ default:
9786
+ return null;
9787
+ }
9788
+ }, "createSkinOperation"), setStationImage = __name2(async (eventId, stationId, imageKey) => {
9789
9789
  const station = (await api2.event.passport.getPassportOverview.query({ eventId })).stations.find((item) => item.id === stationId);
9790
9790
  if (!station) throw new CliUsageError("Station not found for this event.");
9791
9791
  return api2.event.passport.upsertPassportStation.mutate({ eventId, id: station.id, name: station.name, description: station.description, location: station.location, imageKey: imageKey ? await imageKey() : null, order: station.order, opensAt: station.opensAt, closesAt: station.closesAt });
9792
9792
  }, "setStationImage"), setPrizeImage = __name2(async (eventId, prizeId, imageKey) => {
9793
9793
  const prize = (await api2.event.passport.getPassportOverview.query({ eventId })).prizes.find((item) => item.id === prizeId);
9794
9794
  if (!prize) throw new CliUsageError("Prize not found for this event.");
9795
- return api2.event.passport.upsertPassportPrize.mutate({ eventId, id: prize.id, name: prize.name, description: prize.description, imageKey: imageKey ? await imageKey() : null, stock: prize.stock, stampCost: prize.stampCost, order: prize.order });
9796
- }, "setPrizeImage"), createImageOperation = __name2((resource, subcommand, {
9797
- eventId,
9798
- flags,
9799
- allowed
9800
- }) => {
9795
+ return api2.event.passport.upsertPassportPrize.mutate({
9796
+ eventId,
9797
+ id: prize.id,
9798
+ name: prize.name,
9799
+ description: prize.description,
9800
+ imageKey: imageKey ? await imageKey() : null,
9801
+ stock: prize.stock,
9802
+ stampCost: prize.stampCost,
9803
+ order: prize.order
9804
+ });
9805
+ }, "setPrizeImage"), createImageOperation = __name2((resource, subcommand, { eventId, flags, allowed }) => {
9801
9806
  if (subcommand !== "image-set" && subcommand !== "image-clear") return null;
9802
9807
  const idFlag = "".concat(resource, "-id");
9803
9808
  allowed.push(idFlag);
@@ -9808,9 +9813,7 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
9808
9813
  return first === "skin" && second ? createSkinOperation(second, context) : (first === "station" || first === "prize") && second ? createImageOperation(first, second, context) : null;
9809
9814
  }, "createPassportMediaOperation"), flag = __name2((flags, name, required2 = !0) => {
9810
9815
  const value = flags.get(name);
9811
- if (value === !0 || required2 && !value) throw new CliUsageError(
9812
- "--".concat(name, " requires a value.")
9813
- );
9816
+ if (value === !0 || required2 && !value) throw new CliUsageError("--".concat(name, " requires a value."));
9814
9817
  return value;
9815
9818
  }, "flag"), requiredFlag = __name2((flags, name) => {
9816
9819
  const value = flag(flags, name);
@@ -9857,11 +9860,9 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
9857
9860
  }, "json"), keys = __name2((value, allowed, name) => {
9858
9861
  if (Object.keys(value).some((key) => !allowed.includes(key))) throw new CliUsageError("".concat(name, " contains unsupported fields."));
9859
9862
  }, "keys"), date4 = __name2((value, name) => {
9860
- if (value == null) return null;
9861
- if (typeof value != "string" || !new __cliRegExp("^\\d{4}-\\d\\d-\\d\\dT", "").test(value)) throw new CliUsageError("".concat(
9862
- name,
9863
- " must be an ISO date-time or null."
9864
- ));
9863
+ if (value == null)
9864
+ return null;
9865
+ if (typeof value != "string" || !new __cliRegExp("^\\d{4}-\\d\\d-\\d\\dT", "").test(value)) throw new CliUsageError("".concat(name, " must be an ISO date-time or null."));
9865
9866
  const parsed = new Date(value);
9866
9867
  if (Number.isNaN(parsed.getTime())) throw new CliUsageError("".concat(name, " must be a valid ISO date-time."));
9867
9868
  return parsed;
@@ -9871,17 +9872,18 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
9871
9872
  const tallyItems = item.tallyItems.map((name, index) => text(name, "tallyItems[".concat(index, "]"), 60));
9872
9873
  if (new Set(tallyItems.map((name) => name.toLocaleLowerCase())).size !== tallyItems.length) throw new CliUsageError("tallyItems must be unique ignoring case.");
9873
9874
  if (item.tallyEarnsStamp !== void 0 && typeof item.tallyEarnsStamp != "boolean") throw new CliUsageError("tallyEarnsStamp must be true or false.");
9874
- return {
9875
- collectionMode: "STAFF_TALLY",
9876
- tallyItems,
9877
- tallyEarnsStamp: item.tallyEarnsStamp === !0,
9878
- ...extras
9879
- };
9875
+ return { collectionMode: "STAFF_TALLY", tallyItems, tallyEarnsStamp: item.tallyEarnsStamp === !0, ...extras };
9880
9876
  }, "parseStaffTallyCollection"), parseStaffScanCollection = __name2((item, extras) => {
9881
9877
  if (keys(item, ["collectionMode", "stampValue", "category", "prizeDeskAward", "showHowToCollect", "showMyQr", "collectionLimit", "menuItems", "info"], "collection"), item.collectionMode !== "STAFF_SCAN" && (item.menuItems !== void 0 || item.collectionLimit !== void 0)) throw new CliUsageError("Only STAFF_SCAN stations can configure menuItems or collectionLimit.");
9882
9878
  if (item.prizeDeskAward !== void 0 && typeof item.prizeDeskAward != "boolean") throw new CliUsageError("prizeDeskAward must be true or false.");
9883
9879
  if (item.collectionLimit !== void 0 && item.collectionLimit !== "ONCE" && item.collectionLimit !== "UNLIMITED") throw new CliUsageError("collectionLimit must be ONCE or UNLIMITED.");
9884
- return { collectionMode: item.collectionMode, ...item.collectionLimit === void 0 ? {} : { collectionLimit: item.collectionLimit }, ...item.menuItems === void 0 ? {} : { menuItems: item.menuItems === null ? null : parseStaffScanMenuItems(item.menuItems) }, ...extras, ...item.prizeDeskAward === void 0 ? {} : { prizeDeskAward: item.prizeDeskAward } };
9880
+ return {
9881
+ collectionMode: item.collectionMode,
9882
+ ...item.collectionLimit === void 0 ? {} : { collectionLimit: item.collectionLimit },
9883
+ ...item.menuItems === void 0 ? {} : { menuItems: item.menuItems === null ? null : parseStaffScanMenuItems(item.menuItems) },
9884
+ ...extras,
9885
+ ...item.prizeDeskAward === void 0 ? {} : { prizeDeskAward: item.prizeDeskAward }
9886
+ };
9885
9887
  }, "parseStaffScanCollection"), parseStaffScanMenuItems = __name2((value) => {
9886
9888
  if (!Array.isArray(value)) throw new CliUsageError("menuItems must be an array of menu item objects.");
9887
9889
  if (value.length < 1 || value.length > 30) throw new CliUsageError("menuItems must have 1 to 30 items.");
@@ -9895,13 +9897,15 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
9895
9897
  return parsed.data;
9896
9898
  }, "parseStaffScanMenuItems"), parsePassportCollection = __name2((raw) => {
9897
9899
  const item = object2(raw, "collection"), stampValue = item.stampValue === void 0 ? {} : { stampValue: integer2(item.stampValue, "stampValue", 0, 1e3) }, category = item.category === void 0 ? {} : { category: stationCategory(item.category) }, info = { ...item.showMyQr === void 0 ? {} : { showMyQr: boolean4(item.showMyQr, "showMyQr") }, ...item.info === void 0 ? {} : { info: stationInfo(item.info) }, ...item.showHowToCollect === void 0 ? {} : { showHowToCollect: boolean4(item.showHowToCollect, "showHowToCollect") } };
9898
- if (item.collectionMode === "STAFF_SCORE") return keys(item, ["collectionMode", "maxPoints", "stampValue", "category", "info", "showHowToCollect", "showMyQr"], "collection"), {
9899
- collectionMode: "STAFF_SCORE",
9900
- maxPoints: integer2(item.maxPoints, "maxPoints"),
9901
- ...stampValue,
9902
- ...category,
9903
- ...info
9904
- };
9900
+ if (item.collectionMode === "STAFF_SCORE") return keys(item, [
9901
+ "collectionMode",
9902
+ "maxPoints",
9903
+ "stampValue",
9904
+ "category",
9905
+ "info",
9906
+ "showHowToCollect",
9907
+ "showMyQr"
9908
+ ], "collection"), { collectionMode: "STAFF_SCORE", maxPoints: integer2(item.maxPoints, "maxPoints"), ...stampValue, ...category, ...info };
9905
9909
  if (item.collectionMode === "STAFF_TALLY") return parseStaffTallyCollection(item, { ...stampValue, ...category, ...info });
9906
9910
  if (item.collectionMode === "SELF_SCAN" || item.collectionMode === "STAFF_SCAN") return parseStaffScanCollection(item, { ...stampValue, ...category, ...info });
9907
9911
  throw new CliUsageError("collectionMode must be SELF_SCAN, STAFF_SCAN, STAFF_SCORE or STAFF_TALLY.");
@@ -9909,30 +9913,19 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
9909
9913
  const value = json(raw, "--station-json");
9910
9914
  keys(value, ["id", "name", "description", "location", "address", "imageKey", "order", "opensAt", "closesAt", "collection"], "Station");
9911
9915
  const collection = value.collection === void 0 ? void 0 : parsePassportCollection(value.collection);
9912
- return {
9913
- eventId,
9914
- ...value.id === void 0 ? {} : { id: text(value.id, "id", 200) },
9915
- name: text(value.name, "name", 100),
9916
- description: nullableText(value.description, "description", 1e3),
9917
- location: nullableText(value.location, "location", 200),
9918
- ...value.address === void 0 ? {} : { address: nullableText(value.address, "address", 300) },
9919
- ...value.imageKey === void 0 ? {} : { imageKey: nullableText(value.imageKey, "imageKey", 2048) },
9920
- order: integer2(value.order ?? 0, "order"),
9921
- opensAt: date4(value.opensAt, "opensAt"),
9922
- closesAt: date4(value.closesAt, "closesAt"),
9923
- ...collection ? { collection } : {}
9924
- };
9916
+ return { eventId, ...value.id === void 0 ? {} : { id: text(value.id, "id", 200) }, name: text(value.name, "name", 100), description: nullableText(value.description, "description", 1e3), location: nullableText(value.location, "location", 200), ...value.address === void 0 ? {} : { address: nullableText(value.address, "address", 300) }, ...value.imageKey === void 0 ? {} : { imageKey: nullableText(value.imageKey, "imageKey", 2048) }, order: integer2(value.order ?? 0, "order"), opensAt: date4(value.opensAt, "opensAt"), closesAt: date4(value.closesAt, "closesAt"), ...collection ? { collection } : {} };
9925
9917
  }, "parsePassportStationInput"), QUEUE_STATUS_FLAGS = { "under-10": "UNDER_10_MIN", "under-30": "UNDER_30_MIN", "over-30": "OVER_30_MIN", clear: null }, queueStatusFlag = __name2((value) => {
9926
9918
  const status = QUEUE_STATUS_FLAGS[value];
9927
9919
  if (status === void 0) throw new CliUsageError("--status must be one of ".concat(Object.keys(QUEUE_STATUS_FLAGS).join(", "), "."));
9928
9920
  return status;
9929
9921
  }, "queueStatusFlag"), parseSettingsSwitches = __name2((value) => {
9930
9922
  const switches = {};
9931
- value.queueStatusStaleMinutes !== void 0 && (switches.queueStatusStaleMinutes = value.queueStatusStaleMinutes === null ? null : integer2(value.queueStatusStaleMinutes, "queueStatusStaleMinutes", PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN, PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX)), value.staffIdLabel !== void 0 && (switches.staffIdLabel = nullableText(
9932
- value.staffIdLabel,
9933
- "staffIdLabel",
9934
- PASSPORT_STAFF_ID_LABEL_MAX
9935
- )), value.categoryLabels !== void 0 && (switches.categoryLabels = categoryLabels(value.categoryLabels));
9923
+ value.queueStatusStaleMinutes !== void 0 && (switches.queueStatusStaleMinutes = value.queueStatusStaleMinutes === null ? null : integer2(
9924
+ value.queueStatusStaleMinutes,
9925
+ "queueStatusStaleMinutes",
9926
+ PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN,
9927
+ PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX
9928
+ )), value.staffIdLabel !== void 0 && (switches.staffIdLabel = nullableText(value.staffIdLabel, "staffIdLabel", PASSPORT_STAFF_ID_LABEL_MAX)), value.categoryLabels !== void 0 && (switches.categoryLabels = categoryLabels(value.categoryLabels));
9936
9929
  for (const name of ["guestScan", "simplifiedChinese", "queueStatus"]) {
9937
9930
  const item = value[name];
9938
9931
  if (item !== void 0) {
@@ -9952,18 +9945,17 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
9952
9945
  if (loginMethods = { emailOtp: methods.emailOtp, google: methods.google, guest: methods.guest, staffId: methods.staffId === !0, staffIdRequiresLastName: methods.staffIdRequiresLastName !== !1 }, !loginMethods.emailOtp && !loginMethods.google && !loginMethods.staffId) throw new CliUsageError("Keep email OTP, Google or roster sign-in available for recovery.");
9953
9946
  }
9954
9947
  if (value.linkedDrawEventId === void 0) throw new CliUsageError("linkedDrawEventId is required (use null to disable).");
9955
- return { eventId, luckyDrawStampThreshold: threshold(value.luckyDrawStampThreshold, "luckyDrawStampThreshold"), prizeStampThreshold: threshold(
9956
- value.prizeStampThreshold,
9957
- "prizeStampThreshold"
9958
- ), maxRedemptionsPerParticipant: integer2(value.maxRedemptionsPerParticipant, "maxRedemptionsPerParticipant", 0), linkedDrawEventId: value.linkedDrawEventId === null ? null : text(value.linkedDrawEventId, "linkedDrawEventId", 200), ...loginMethods ? { loginMethods } : {}, ...switches };
9948
+ return { eventId, luckyDrawStampThreshold: threshold(
9949
+ value.luckyDrawStampThreshold,
9950
+ "luckyDrawStampThreshold"
9951
+ ), prizeStampThreshold: threshold(value.prizeStampThreshold, "prizeStampThreshold"), maxRedemptionsPerParticipant: integer2(value.maxRedemptionsPerParticipant, "maxRedemptionsPerParticipant", 0), linkedDrawEventId: value.linkedDrawEventId === null ? null : text(value.linkedDrawEventId, "linkedDrawEventId", 200), ...loginMethods ? { loginMethods } : {}, ...switches };
9959
9952
  }, "parsePassportSettingsInput"), parsePassportRosterEntryInput = __name2((raw, eventId) => {
9960
9953
  const value = json(raw, "--entry-json");
9961
9954
  if (keys(value, ["id", "staffId", "lastName", "displayName"], "Roster entry"), value.lastName === void 0) throw new CliUsageError("lastName is required (use null for none).");
9962
9955
  return { eventId, ...value.id === void 0 ? {} : { id: text(value.id, "id", 200) }, staffId: text(value.staffId, "staffId", 64), lastName: nullableText(value.lastName, "lastName", 100) || null, displayName: nullableText(value.displayName, "displayName", 100) || null };
9963
9956
  }, "parsePassportRosterEntryInput"), headerIndex = __name2((headers, name) => {
9964
9957
  const wanted = name.trim().toLowerCase(), index = headers.findIndex((header) => header.trim().toLowerCase() === wanted);
9965
- if (index === -1)
9966
- throw new CliUsageError('Column "'.concat(name, '" is not in the file. Headers: ').concat(headers.join(", "), "."));
9958
+ if (index === -1) throw new CliUsageError('Column "'.concat(name, '" is not in the file. Headers: ').concat(headers.join(", "), "."));
9967
9959
  return index;
9968
9960
  }, "headerIndex"), resolvePassportRosterMapping = __name2((headers, flags, requireLastName) => {
9969
9961
  const guess = guessPassportRosterMapping(headers), column = __name2((name, fallback) => {
@@ -9972,9 +9964,7 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
9972
9964
  }, "column"), staffIdFlag = flag(flags, "staff-id-column", !1), position = flag(flags, "surname-position", !1) ?? "last";
9973
9965
  if (position !== "last" && position !== "first") throw new CliUsageError("--surname-position must be last or first.");
9974
9966
  const mapping = { staffId: staffIdFlag === void 0 ? guess.staffId : headerIndex(headers, staffIdFlag), lastName: column("last-name-column", guess.lastName), fullName: column("full-name-column", guess.fullName), displayName: column("display-name-column", guess.displayName), surnamePosition: position };
9975
- if (requireLastName && mapping.lastName === null && mapping.fullName === null) throw new CliUsageError(
9976
- "Map a last-name column (--last-name-column) or a full-name column (--full-name-column)."
9977
- );
9967
+ if (requireLastName && mapping.lastName === null && mapping.fullName === null) throw new CliUsageError("Map a last-name column (--last-name-column) or a full-name column (--full-name-column).");
9978
9968
  return mapping;
9979
9969
  }, "resolvePassportRosterMapping"), readRosterRows = __name2(async (path2, flags, requireLastName) => {
9980
9970
  let table;
@@ -9990,7 +9980,9 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
9990
9980
  throw new CliUsageError("Could not import ".concat(path2, ": ").concat(error2 instanceof Error ? error2.message : "unknown error"));
9991
9981
  }
9992
9982
  }, "readRosterRows"), optionalEntry = __name2((key, value, parse) => value === void 0 ? {} : { [key]: parse(value) }, "optionalEntry"), readPasswordFromStdin = __name2(async () => {
9993
- if (process.stdin.isTTY) throw new CliUsageError("--password-stdin reads the password from stdin. Pipe it in, for example: printf '%s' \"$PASSWORD\" | et passport station-access set-password --event-id <id> --password-stdin ...");
9983
+ if (process.stdin.isTTY) throw new CliUsageError(
9984
+ "--password-stdin reads the password from stdin. Pipe it in, for example: printf '%s' \"$PASSWORD\" | et passport station-access set-password --event-id <id> --password-stdin ..."
9985
+ );
9994
9986
  return (await Bun.stdin.text()).replace(new __cliRegExp("\\r?\\n$", ""), "");
9995
9987
  }, "readPasswordFromStdin"), searchFilters = __name2((flags) => {
9996
9988
  const search = flag(flags, "search", !1);
@@ -10003,11 +9995,12 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10003
9995
  }, "recipientDirection"), parseStampRecipientsInput = __name2((flags, station) => {
10004
9996
  const limit = flag(flags, "limit", !1), cursor = flag(flags, "cursor", !1), direction = recipientDirection(flag(flags, "direction", !1));
10005
9997
  if (direction === "backward" && cursor === void 0) throw new CliUsageError("--direction backward needs --cursor.");
10006
- return { ...station, filters: searchFilters(flags), ...optionalEntry("limit", limit, (raw) => integer2(raw, "--limit", 1, PASSPORT_STATION_RECIPIENTS_PAGE_MAX)), ...optionalEntry(
10007
- "cursor",
10008
- cursor,
10009
- (raw) => text(raw, "--cursor", 8192)
10010
- ), ...direction === void 0 ? {} : { direction } };
9998
+ return { ...station, filters: searchFilters(flags), ...optionalEntry("limit", limit, (raw) => integer2(
9999
+ raw,
10000
+ "--limit",
10001
+ 1,
10002
+ PASSPORT_STATION_RECIPIENTS_PAGE_MAX
10003
+ )), ...optionalEntry("cursor", cursor, (raw) => text(raw, "--cursor", 8192)), ...direction === void 0 ? {} : { direction } };
10011
10004
  }, "parseStampRecipientsInput"), createStationAccessOperation = __name2(async (action, { eventId, flags, allowed, station, confirm }) => {
10012
10005
  const event = { eventId };
10013
10006
  let operation;
@@ -10043,10 +10036,10 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10043
10036
  }
10044
10037
  return operation;
10045
10038
  }, "createStationAccessOperation"), runPassportCommand = __name2(async (input) => {
10046
- const { flags, positionals } = input, action = positionals.slice(1).join(" "), allowed = ["event-id"], eventId = requiredFlag(flags, "event-id"), event = { eventId }, station = __name2(() => ({ eventId, stationId: requiredFlag(flags, "station-id") }), "station"), version2 = __name2(() => integer2(requiredFlag(
10047
- flags,
10048
- "expected-printed-qr-version"
10049
- ), "--expected-printed-qr-version"), "version"), confirm = __name2(() => {
10039
+ const { flags, positionals } = input, action = positionals.slice(1).join(" "), allowed = ["event-id"], eventId = requiredFlag(flags, "event-id"), event = { eventId }, station = __name2(
10040
+ () => ({ eventId, stationId: requiredFlag(flags, "station-id") }),
10041
+ "station"
10042
+ ), version2 = __name2(() => integer2(requiredFlag(flags, "expected-printed-qr-version"), "--expected-printed-qr-version"), "version"), confirm = __name2(() => {
10050
10043
  if (allowed.push("allow-state-change", "target"), flags.get("allow-state-change") !== !0 || requiredFlag(flags, "target") !== eventId) throw new CliUsageError("This operation requires --allow-state-change and --target exactly equal to --event-id.");
10051
10044
  }, "confirm");
10052
10045
  let operation;
@@ -10083,7 +10076,9 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10083
10076
  operation = __name2(() => api2.event.passport.joinPassportBingo.mutate(event), "operation");
10084
10077
  break;
10085
10078
  case "bingo claim-stamp":
10086
- operation = __name2(() => api2.event.passport.claimPassportBingoStamp.mutate(event), "operation");
10079
+ operation = __name2(() => api2.event.passport.claimPassportBingoStamp.mutate(
10080
+ event
10081
+ ), "operation");
10087
10082
  break;
10088
10083
  case "bingo status":
10089
10084
  operation = __name2(() => api2.event.passport.getMyPassportBingo.query(event), "operation");
@@ -10132,15 +10127,14 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10132
10127
  case "station archive": {
10133
10128
  allowed.push("station-id"), confirm();
10134
10129
  const payload = station();
10135
- operation = __name2(() => api2.event.passport.archivePassportStation.mutate(payload), "operation");
10130
+ operation = __name2(() => api2.event.passport.archivePassportStation.mutate(
10131
+ payload
10132
+ ), "operation");
10136
10133
  break;
10137
10134
  }
10138
10135
  case "station hidden": {
10139
10136
  allowed.push("station-id", "hidden");
10140
- const payload = {
10141
- ...station(),
10142
- hidden: boolean4(requiredFlag(flags, "hidden"), "--hidden")
10143
- };
10137
+ const payload = { ...station(), hidden: boolean4(requiredFlag(flags, "hidden"), "--hidden") };
10144
10138
  operation = __name2(() => api2.event.passport.setPassportStationHidden.mutate(payload), "operation");
10145
10139
  break;
10146
10140
  }
@@ -10164,10 +10158,7 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10164
10158
  }
10165
10159
  case "collect": {
10166
10160
  allowed.push("station-id", "profile-code", "points", "item", "site", "request-id");
10167
- const points = flag(flags, "points", !1), item = flag(flags, "item", !1), payload = { ...station(), profileCode: requiredFlag(
10168
- flags,
10169
- "profile-code"
10170
- ), ...optionalEntry("site", flag(flags, "site", !1), (raw) => text(raw, "--site", 60)), ...optionalEntry("requestId", flag(flags, "request-id", !1), (raw) => {
10161
+ const points = flag(flags, "points", !1), item = flag(flags, "item", !1), payload = { ...station(), profileCode: requiredFlag(flags, "profile-code"), ...optionalEntry("site", flag(flags, "site", !1), (raw) => text(raw, "--site", 60)), ...optionalEntry("requestId", flag(flags, "request-id", !1), (raw) => {
10171
10162
  const parsed = passportRedemptionRequestIdSchema.safeParse(raw);
10172
10163
  if (!parsed.success) throw new CliUsageError("--request-id must be a UUID.");
10173
10164
  return parsed.data;
@@ -10183,11 +10174,7 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10183
10174
  }
10184
10175
  case "stamp correct": {
10185
10176
  allowed.push("station-id", "participant-id", "stamped", "reason", "points", "item", "collection-id", "site"), confirm();
10186
- const points = flag(flags, "points", !1), item = flag(flags, "item", !1), payload = { ...station(), participantId: requiredFlag(flags, "participant-id"), ...optionalEntry(
10187
- "collectionId",
10188
- flag(flags, "collection-id", !1),
10189
- (raw) => text(raw, "--collection-id", 200)
10190
- ), ...optionalEntry("site", flag(flags, "site", !1), (raw) => text(raw, "--site", 60)), stamped: boolean4(requiredFlag(flags, "stamped"), "--stamped"), reason: requiredFlag(flags, "reason"), ...optionalEntry("points", points, (raw) => integer2(raw, "--points")), ...optionalEntry("item", item, (raw) => text(raw, "--item", 60)) };
10177
+ const points = flag(flags, "points", !1), item = flag(flags, "item", !1), payload = { ...station(), participantId: requiredFlag(flags, "participant-id"), ...optionalEntry("collectionId", flag(flags, "collection-id", !1), (raw) => text(raw, "--collection-id", 200)), ...optionalEntry("site", flag(flags, "site", !1), (raw) => text(raw, "--site", 60)), stamped: boolean4(requiredFlag(flags, "stamped"), "--stamped"), reason: requiredFlag(flags, "reason"), ...optionalEntry("points", points, (raw) => integer2(raw, "--points")), ...optionalEntry("item", item, (raw) => text(raw, "--item", 60)) };
10191
10178
  operation = __name2(() => api2.event.passport.correctPassportStamp.mutate(payload), "operation");
10192
10179
  break;
10193
10180
  }
@@ -10218,7 +10205,14 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10218
10205
  break;
10219
10206
  }
10220
10207
  case "redemption create": {
10221
- allowed.push("prize-id", "participant-id", "quantity", "award-station-id", "bonus-stamps", "request-id");
10208
+ allowed.push(
10209
+ "prize-id",
10210
+ "participant-id",
10211
+ "quantity",
10212
+ "award-station-id",
10213
+ "bonus-stamps",
10214
+ "request-id"
10215
+ );
10222
10216
  const quantity = flag(flags, "quantity", !1), awardStationId = flag(flags, "award-station-id", !1), bonusStamps = flag(flags, "bonus-stamps", !1), requestId = flag(flags, "request-id", !1), payload = { eventId, ...optionalEntry("quantity", quantity, (raw) => integer2(raw, "--quantity", 1, 20)), ...optionalEntry("bonusStamps", bonusStamps, (raw) => {
10223
10217
  const value = integer2(raw, "--bonus-stamps", 0, 1e3);
10224
10218
  return redeemPassportPrizeSchema.shape.bonusStamps.parse(value);
@@ -10232,10 +10226,7 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10232
10226
  }
10233
10227
  case "redemption reverse": {
10234
10228
  allowed.push("redemption-id", "reason"), confirm();
10235
- const payload = { eventId, redemptionId: requiredFlag(
10236
- flags,
10237
- "redemption-id"
10238
- ), reason: requiredFlag(flags, "reason") };
10229
+ const payload = { eventId, redemptionId: requiredFlag(flags, "redemption-id"), reason: requiredFlag(flags, "reason") };
10239
10230
  operation = __name2(() => api2.event.passport.reversePassportRedemption.mutate(payload), "operation");
10240
10231
  break;
10241
10232
  }
@@ -10253,11 +10244,11 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10253
10244
  }
10254
10245
  case "roster list": {
10255
10246
  allowed.push("search", "limit", "cursor");
10256
- const search = flag(flags, "search", !1), limit = flag(flags, "limit", !1), cursor = flag(flags, "cursor", !1), payload = { eventId, ...optionalEntry(
10247
+ const search = flag(
10248
+ flags,
10257
10249
  "search",
10258
- search,
10259
- (raw) => text(raw, "--search", 200)
10260
- ), ...optionalEntry("limit", limit, (raw) => integer2(raw, "--limit", 1, PASSPORT_ROSTER_PAGE_MAX)), ...optionalEntry("cursor", cursor, (raw) => text(raw, "--cursor", 8192)) };
10250
+ !1
10251
+ ), limit = flag(flags, "limit", !1), cursor = flag(flags, "cursor", !1), payload = { eventId, ...optionalEntry("search", search, (raw) => text(raw, "--search", 200)), ...optionalEntry("limit", limit, (raw) => integer2(raw, "--limit", 1, PASSPORT_ROSTER_PAGE_MAX)), ...optionalEntry("cursor", cursor, (raw) => text(raw, "--cursor", 8192)) };
10261
10252
  operation = __name2(() => api2.event.passport.getPassportRoster.query(payload), "operation");
10262
10253
  break;
10263
10254
  }
@@ -10275,7 +10266,10 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10275
10266
  }
10276
10267
  case "roster remove": {
10277
10268
  allowed.push("entry-id"), confirm();
10278
- const payload = { eventId, entryId: requiredFlag(flags, "entry-id") };
10269
+ const payload = { eventId, entryId: requiredFlag(
10270
+ flags,
10271
+ "entry-id"
10272
+ ) };
10279
10273
  operation = __name2(() => api2.event.passport.deletePassportRosterEntry.mutate(payload), "operation");
10280
10274
  break;
10281
10275
  }
@@ -10298,10 +10292,10 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10298
10292
  allowed.push("station-id"), operation = __name2(() => api2.event.passport.getPassportStationTallies.query(station()), "operation");
10299
10293
  break;
10300
10294
  default: {
10301
- const mediaOperation = await createStationAccessOperation(action, { eventId, flags, allowed, station, confirm }) ?? createPassportMediaOperation(
10295
+ const mediaOperation = await createStationAccessOperation(
10302
10296
  action,
10303
- { eventId, flags, allowed }
10304
- );
10297
+ { eventId, flags, allowed, station, confirm }
10298
+ ) ?? createPassportMediaOperation(action, { eventId, flags, allowed });
10305
10299
  if (!mediaOperation) throw new CliUsageError("Unknown passport command. Run et --help for supported commands.");
10306
10300
  operation = mediaOperation;
10307
10301
  }
@@ -10312,30 +10306,46 @@ image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requir
10312
10306
  }, "runPassportCommand");
10313
10307
  import { readFile as readFile6, writeFile } from "fs/promises";
10314
10308
  import { basename as basename4 } from "path";
10315
- var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAFF_REDEMPTION_SHIFT_MAX = 8, STAFF_REDEMPTION_ELIGIBLE_SHIFTS_MAX = 20, STAFF_REDEMPTION_ALLOWANCE_MAX = 20, STAFF_REDEMPTION_QUANTITY_MAX = 1e5, STAFF_REDEMPTION_REASON_MAX = 500, STAFF_REDEMPTION_ROLLOVER_REASON_MAX = 300, STAFF_REDEMPTION_ROLLOVER_LIST_DEFAULT = 20, STAFF_REDEMPTION_ROLLOVER_LIST_MAX = 50, STAFF_REDEMPTION_PAGE_MAX = 100, STAFF_REDEMPTION_CLAIM_ITEMS_MAX = 20, STAFF_REDEMPTION_ITEM_RULES = [
10316
- "ONE_FROM_EACH_GROUP",
10317
- "AT_MOST_ONE_PER_GROUP",
10318
- "AT_MOST_ONE_PER_GROUP_OR_NONE"
10319
- ], STAFF_REDEMPTION_WRONG_SITE_RULES = ["REFUSE", "SERVE_FROM_COUNTER"], STAFF_REDEMPTION_SESSION_RULES = ["OWN_SHIFT", "ANY_OPEN_SESSION"], STAFF_REDEMPTION_DRAW_POLICIES = ["REMAINING_HEADCOUNT", "FIXED_RATE"], STAFF_REDEMPTION_COUNTER_ORDERS = ["FOOD_THEN_DRAW", "DRAW_THEN_FOOD"], STAFF_REDEMPTION_ARCHIVABLE = ["site", "session", "itemGroup", "item", "prize", "rosterEntry"], idSchema = string2().min(1).max(64), nameSchema = string2().trim().min(1).max(STAFF_REDEMPTION_NAME_MAX), orderSchema = number2().int().min(0).max(1e4), quantitySchema = number2().int().min(0).max(STAFF_REDEMPTION_QUANTITY_MAX), reasonSchema = string2().trim().min(1).max(STAFF_REDEMPTION_REASON_MAX), staffRedemptionShiftSchema = string2().trim().min(1).max(STAFF_REDEMPTION_SHIFT_MAX).transform((value) => value.toUpperCase()).refine((value) => new __cliRegExp("^[A-Z0-9]+$", "").test(value), { message: "Use letters and digits only." }), staffRedemptionEmployeeIdSchema = string2().trim().min(1).max(
10320
- STAFF_REDEMPTION_EMPLOYEE_ID_MAX
10321
- ), staffRedemptionClientRequestIdSchema = uuid2(), staffRedemptionEventIdSchema = object({ eventId: idSchema }).strict(), staffRedemptionSiteIdSchema = staffRedemptionEventIdSchema.extend({ siteId: idSchema }).strict(), STAFF_REDEMPTION_STAFF_ID_LABEL_MAX = PASSPORT_STAFF_ID_LABEL_MAX, STAFF_REDEMPTION_WRONG_SITE_MESSAGE_MAX = 300, STAFF_REDEMPTION_LAST_NAME_MAX = STAFF_REDEMPTION_NAME_MAX, staffRedemptionLoginMethodsSchema = object({ emailOtp: boolean2(), google: boolean2(), guest: boolean2(), staffId: boolean2().default(!1), staffIdRequiresLastName: boolean2().default(!0) }).strict(), customTextOrNull = __name2((max) => union([_null3(), string2().trim().max(max).transform((value) => value === "" ? null : value)]), "customTextOrNull"), lastNameSchema = string2().trim().min(1).max(STAFF_REDEMPTION_LAST_NAME_MAX).optional(), signInToStaffRedemptionEmployeeSchema = staffRedemptionEventIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema, lastName: lastNameSchema }).strict(), requestStaffRedemptionEmployeeEmailOtpSchema = staffRedemptionEventIdSchema.
10322
- extend({ email: email2().trim().toLowerCase() }).strict(), updateStaffRedemptionSettingsSchema = staffRedemptionEventIdSchema.extend({ eligibleShifts: array(staffRedemptionShiftSchema).min(1).max(STAFF_REDEMPTION_ELIGIBLE_SHIFTS_MAX).optional(), itemRule: _enum(STAFF_REDEMPTION_ITEM_RULES).optional(), wrongSite: _enum(STAFF_REDEMPTION_WRONG_SITE_RULES).optional(), sessionRule: _enum(STAFF_REDEMPTION_SESSION_RULES).optional(), drawPolicy: _enum(STAFF_REDEMPTION_DRAW_POLICIES).optional(), fixedWinRatePercent: number2().min(0).max(100).optional(), counterOrder: _enum(STAFF_REDEMPTION_COUNTER_ORDERS).optional(), loginMethods: staffRedemptionLoginMethodsSchema.optional(), staffIdLabel: customTextOrNull(STAFF_REDEMPTION_STAFF_ID_LABEL_MAX).optional(), wrongSiteMessage: customTextOrNull(STAFF_REDEMPTION_WRONG_SITE_MESSAGE_MAX).optional(), overrideReason: reasonSchema.optional() }).strict(), upsertStaffRedemptionSiteSchema = staffRedemptionEventIdSchema.extend({ siteId: idSchema.optional(), name: nameSchema,
10323
- order: orderSchema.optional() }).strict(), setStaffRedemptionCrewPasswordSchema = staffRedemptionSiteIdSchema.extend({ password: stationStaffPasswordSchema }).strict(), signInToStaffRedemptionCrewSchema = staffRedemptionSiteIdSchema.extend({ password: string2().min(1).max(128) }).strict(), upsertStaffRedemptionSessionSchema = staffRedemptionEventIdSchema.extend({ sessionId: idSchema.optional(), name: nameSchema, shift: staffRedemptionShiftSchema, startsAt: exports_coerce.date().nullable().default(null), endsAt: exports_coerce.date().nullable().default(null) }).strict().refine((input) => input.startsAt === null || input.endsAt === null || input.endsAt > input.startsAt, { message: "The session must end after it starts.", path: ["endsAt"] }), setStaffRedemptionSlotSchema = staffRedemptionEventIdSchema.extend({ sessionId: idSchema, siteId: idSchema, setQuantity: quantitySchema }).strict(), rolloverSessionsShape = { fromSessionId: idSchema.describe("Session whose leftover sets and prizes mo\
10324
- ve out (id from setup get). Must belong to this event and not be archived."), toSessionId: idSchema.describe("Session that receives them (id from setup get). Must differ from fromSessionId, belong to this event and not be archived.") }, rolloverReasonSchema = __name2((description) => string2().trim().min(1).max(STAFF_REDEMPTION_ROLLOVER_REASON_MAX).describe(description), "rolloverReasonSchema"), staffRedemptionRolloverPreviewSchema = staffRedemptionEventIdSchema.extend(rolloverSessionsShape).strict(), rolloverStaffRedemptionStockSchema = staffRedemptionEventIdSchema.extend({ ...rolloverSessionsShape, sets: boolean2().default(!0).describe("Move the leftover sets (set quantity minus active, not voided, redemptions) of each site. Defaults to true."), prizes: boolean2().default(!0).describe("Move the leftover prizes (stock minus prizes drawn and not released) of each site. Defaults to true."), reason: rolloverReasonSchema("Why the leftovers move (1 to 300 characters). Recorded in the activ\
10325
- ity log.") }).strict().refine((input) => input.sets || input.prizes, { message: "Choose sets, prizes or both.", path: ["sets"] }), staffRedemptionRolloversSchema = staffRedemptionEventIdSchema.extend({ limit: number2().int().min(1).max(STAFF_REDEMPTION_ROLLOVER_LIST_MAX).default(STAFF_REDEMPTION_ROLLOVER_LIST_DEFAULT).describe("How many rollovers to return, newest first (1 to 50). Defaults to 20.") }).strict(), undoStaffRedemptionRolloverSchema = staffRedemptionEventIdSchema.extend({ rolloverId: idSchema.describe("Id of the rollover to undo (id from rollover list). Must belong to this event and not be undone already."), reason: rolloverReasonSchema("Why the rollover is undone (1 to 300 characters). Recorded in the activity log.") }).strict(), upsertStaffRedemptionItemGroupSchema = staffRedemptionEventIdSchema.extend({ groupId: idSchema.optional(), name: nameSchema, order: orderSchema.optional() }).strict(), upsertStaffRedemptionItemSchema = staffRedemptionEventIdSchema.extend({ itemId: idSchema.
10309
+ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAFF_REDEMPTION_SHIFT_MAX = 8, STAFF_REDEMPTION_ELIGIBLE_SHIFTS_MAX = 20, STAFF_REDEMPTION_ALLOWANCE_MAX = 20, STAFF_REDEMPTION_QUANTITY_MAX = 1e5, STAFF_REDEMPTION_REASON_MAX = 500, STAFF_REDEMPTION_ROLLOVER_REASON_MAX = 300, STAFF_REDEMPTION_ROLLOVER_LIST_DEFAULT = 20, STAFF_REDEMPTION_ROLLOVER_LIST_MAX = 50, STAFF_REDEMPTION_PAGE_MAX = 100, STAFF_REDEMPTION_CLAIM_ITEMS_MAX = 20, STAFF_REDEMPTION_ITEM_RULES = ["ONE_FROM_EACH_GROUP", "AT_MOST_ONE_PER_GROUP", "AT_MOST_ONE_PER_GROUP_OR_NONE"], STAFF_REDEMPTION_WRONG_SITE_RULES = ["REFUSE", "SERVE_FROM_COUNTER"], STAFF_REDEMPTION_SESSION_RULES = ["OWN_SHIFT", "ANY_OPEN_SESSION"], STAFF_REDEMPTION_WALK_IN_DRAWS = ["NO_PRIZE", "AT_COUNTER_SITE"], STAFF_REDEMPTION_DRAW_POLICIES = ["REMAINING_HEADCOUNT", "FIXED_RATE"], STAFF_REDEMPTION_COUNTER_ORDERS = ["FOOD_THEN_DRAW", "DRAW_THEN_FOOD"], STAFF_REDEMPTION_ARCHIVABLE = ["site", "session", "itemGroup", "item", "prize",
10310
+ "rosterEntry"], idSchema = string2().min(1).max(64), nameSchema = string2().trim().min(1).max(STAFF_REDEMPTION_NAME_MAX), orderSchema = number2().int().min(0).max(1e4), quantitySchema = number2().int().min(0).max(STAFF_REDEMPTION_QUANTITY_MAX), reasonSchema = string2().trim().min(1).max(STAFF_REDEMPTION_REASON_MAX), staffRedemptionShiftSchema = string2().trim().min(1).max(STAFF_REDEMPTION_SHIFT_MAX).transform((value) => value.toUpperCase()).refine(
10311
+ (value) => new __cliRegExp("^[A-Z0-9]+$", "").test(value),
10312
+ { message: "Use letters and digits only." }
10313
+ ), staffRedemptionEmployeeIdSchema = string2().trim().min(1).max(STAFF_REDEMPTION_EMPLOYEE_ID_MAX), staffRedemptionClientRequestIdSchema = uuid2(), staffRedemptionEventIdSchema = object({ eventId: idSchema }).strict(), staffRedemptionSiteIdSchema = staffRedemptionEventIdSchema.extend({ siteId: idSchema }).strict(), STAFF_REDEMPTION_STAFF_ID_LABEL_MAX = PASSPORT_STAFF_ID_LABEL_MAX, STAFF_REDEMPTION_WRONG_SITE_MESSAGE_MAX = 300, STAFF_REDEMPTION_LAST_NAME_MAX = STAFF_REDEMPTION_NAME_MAX, staffRedemptionLoginMethodsSchema = object({ emailOtp: boolean2(), google: boolean2(), guest: boolean2(), staffId: boolean2().default(!1), staffIdRequiresLastName: boolean2().default(!0) }).strict(), customTextOrNull = __name2((max) => union([_null3(), string2().trim().max(max).transform((value) => value === "" ? null : value)]), "customTextOrNull"), lastNameSchema = string2().trim().min(1).max(STAFF_REDEMPTION_LAST_NAME_MAX).optional(), signInToStaffRedemptionEmployeeSchema = staffRedemptionEventIdSchema.
10314
+ extend({ employeeId: staffRedemptionEmployeeIdSchema, lastName: lastNameSchema }).strict(), requestStaffRedemptionEmployeeEmailOtpSchema = staffRedemptionEventIdSchema.extend({ email: email2().trim().toLowerCase() }).strict(), updateStaffRedemptionSettingsSchema = staffRedemptionEventIdSchema.extend({ eligibleShifts: array(staffRedemptionShiftSchema).min(1).max(STAFF_REDEMPTION_ELIGIBLE_SHIFTS_MAX).optional(), itemRule: _enum(STAFF_REDEMPTION_ITEM_RULES).optional(), wrongSite: _enum(STAFF_REDEMPTION_WRONG_SITE_RULES).optional(), sessionRule: _enum(STAFF_REDEMPTION_SESSION_RULES).optional(), drawPolicy: _enum(STAFF_REDEMPTION_DRAW_POLICIES).optional(), walkInDraw: _enum(STAFF_REDEMPTION_WALK_IN_DRAWS).optional(), fixedWinRatePercent: number2().min(0).max(100).optional(), counterOrder: _enum(STAFF_REDEMPTION_COUNTER_ORDERS).optional(), loginMethods: staffRedemptionLoginMethodsSchema.optional(), staffIdLabel: customTextOrNull(STAFF_REDEMPTION_STAFF_ID_LABEL_MAX).optional(), wrongSiteMessage: customTextOrNull(
10315
+ STAFF_REDEMPTION_WRONG_SITE_MESSAGE_MAX).optional(), overrideReason: reasonSchema.optional() }).strict(), upsertStaffRedemptionSiteSchema = staffRedemptionEventIdSchema.extend({ siteId: idSchema.optional(), name: nameSchema, order: orderSchema.optional() }).strict(), setStaffRedemptionCrewPasswordSchema = staffRedemptionSiteIdSchema.extend({ password: stationStaffPasswordSchema }).strict(), signInToStaffRedemptionCrewSchema = staffRedemptionSiteIdSchema.extend({ password: string2().min(1).max(128) }).strict(), upsertStaffRedemptionSessionSchema = staffRedemptionEventIdSchema.extend({ sessionId: idSchema.optional(), name: nameSchema, shift: staffRedemptionShiftSchema, startsAt: exports_coerce.date().nullable().default(null), endsAt: exports_coerce.date().nullable().default(null) }).strict().refine((input) => input.startsAt === null || input.endsAt === null || input.endsAt > input.startsAt, { message: "The session must end after it starts.", path: ["endsAt"] }), setStaffRedemptionSlotSchema = staffRedemptionEventIdSchema.
10316
+ extend({ sessionId: idSchema, siteId: idSchema, setQuantity: quantitySchema }).strict(), rolloverSessionsShape = { fromSessionId: idSchema.describe("Session whose leftover sets and prizes move out (id from setup get). Must belong to this event and not be archived."), toSessionId: idSchema.describe("Session that receives them (id from setup get). Must differ from fromSessionId, belong to this event and not be archived.") }, rolloverReasonSchema = __name2((description) => string2().trim().min(1).max(STAFF_REDEMPTION_ROLLOVER_REASON_MAX).describe(description), "rolloverReasonSchema"), staffRedemptionRolloverPreviewSchema = staffRedemptionEventIdSchema.extend(rolloverSessionsShape).strict(), rolloverStaffRedemptionStockSchema = staffRedemptionEventIdSchema.extend({ ...rolloverSessionsShape, sets: boolean2().default(!0).describe("Move the leftover sets (set quantity minus active, not voided, redemptions) of each site. Defaults to true."), prizes: boolean2().default(!0).describe("Move the le\
10317
+ ftover prizes (stock minus prizes drawn and not released) of each site. Defaults to true."), reason: rolloverReasonSchema(
10318
+ "Why the leftovers move (1 to 300 characters). Recorded in the activity log."
10319
+ ) }).strict().refine((input) => input.sets || input.prizes, { message: "Choose sets, prizes or both.", path: ["sets"] }), staffRedemptionRolloversSchema = staffRedemptionEventIdSchema.extend({ limit: number2().int().min(1).max(STAFF_REDEMPTION_ROLLOVER_LIST_MAX).default(STAFF_REDEMPTION_ROLLOVER_LIST_DEFAULT).describe("How many rollovers to return, newest first (1 to 50). Defaults to 20.") }).strict(), undoStaffRedemptionRolloverSchema = staffRedemptionEventIdSchema.extend({ rolloverId: idSchema.describe("Id of the rollover to undo (id from rollover list). Must belong to this event and not be undone already."), reason: rolloverReasonSchema("Why the rollover is undone (1 to 300 characters). Recorded in the activity log.") }).strict(), upsertStaffRedemptionItemGroupSchema = staffRedemptionEventIdSchema.extend({ groupId: idSchema.optional(), name: nameSchema, order: orderSchema.optional() }).strict(), upsertStaffRedemptionItemSchema = staffRedemptionEventIdSchema.extend({ itemId: idSchema.
10326
10320
  optional(), groupId: idSchema, name: nameSchema, order: orderSchema.optional() }).strict(), upsertStaffRedemptionPrizeSchema = staffRedemptionEventIdSchema.extend({ prizeId: idSchema.optional(), name: nameSchema, order: orderSchema.optional() }).strict(), setStaffRedemptionPrizeStockSchema = staffRedemptionEventIdSchema.extend({ slotId: idSchema, prizeId: idSchema, quantity: quantitySchema, reason: reasonSchema.optional() }).strict(), setStaffRedemptionArchivedSchema = staffRedemptionEventIdSchema.extend({ entity: _enum(STAFF_REDEMPTION_ARCHIVABLE), id: idSchema, archived: boolean2() }).strict(), upsertStaffRedemptionRosterEntrySchema = staffRedemptionEventIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema, name: string2().trim().max(STAFF_REDEMPTION_NAME_MAX).nullable(), siteName: string2().trim().max(STAFF_REDEMPTION_NAME_MAX).nullable(), shift: staffRedemptionShiftSchema.nullable(), workShift: string2().trim().max(STAFF_REDEMPTION_NAME_MAX).nullable(), allowance: number2().
10327
- int().min(0).max(STAFF_REDEMPTION_ALLOWANCE_MAX).optional() }).strict(), rosterFiltersShape = {
10328
- search: string2().trim().max(200).optional(),
10329
- siteId: idSchema.optional(),
10330
- shift: staffRedemptionShiftSchema.optional(),
10331
- archived: _enum(["active", "archived", "all"]).default("active"),
10332
- collected: _enum(["any", "collected", "not-collected"]).default("any")
10333
- }, staffRedemptionRosterListSchema = staffRedemptionEventIdSchema.extend({ ...rosterFiltersShape, limit: number2().int().min(1).max(STAFF_REDEMPTION_PAGE_MAX).default(25), cursor: string2().min(1).max(8192).nullish(), direction: literal("forward").optional() }).strict(), staffRedemptionRosterCountsSchema = staffRedemptionEventIdSchema.extend(rosterFiltersShape).strict(), STAFF_REDEMPTION_EMPLOYEE_CODE_MAX = 512, lookupStaffRedemptionSchema = staffRedemptionSiteIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema.optional(), code: string2().trim().min(1).max(STAFF_REDEMPTION_EMPLOYEE_CODE_MAX).optional().describe("Employee QR code as scanned from the employee page. Give either employeeId or code.") }).strict().refine((input) => input.employeeId === void 0 != (input.code === void 0), { message: "Give either an Employee ID or a QR code.", path: ["employeeId"] }), claimItemIdsSchema = array(idSchema).max(STAFF_REDEMPTION_CLAIM_ITEMS_MAX).refine((ids) => new Set(
10334
- ids
10335
- ).size === ids.length, { message: "Pick each item once." }), redeemStaffRedemptionSchema = staffRedemptionSiteIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema, clientRequestId: staffRedemptionClientRequestIdSchema, itemIds: claimItemIdsSchema }).strict(), recordStaffRedemptionClaimItemsSchema = staffRedemptionSiteIdSchema.extend({ claimId: idSchema, itemIds: claimItemIdsSchema }).strict(), STAFF_REDEMPTION_COUNTER_CLAIM_SCOPES = ["mine", "site"], staffRedemptionCounterClaimsSchema = staffRedemptionSiteIdSchema.extend({ limit: number2().int().min(1).max(50).default(20), scope: _enum(STAFF_REDEMPTION_COUNTER_CLAIM_SCOPES).default("mine"), status: _enum(["all", "items-pending"]).default("all") }).strict(), STAFF_REDEMPTION_CLAIM_STATUSES = ["active", "items-pending", "voided", "all"], claimFiltersShape = { search: string2().trim().max(200).optional(), siteId: idSchema.optional(), sessionId: idSchema.optional(), status: _enum(STAFF_REDEMPTION_CLAIM_STATUSES).default("all") }, staffRedemptionClaimListSchema = staffRedemptionEventIdSchema.
10336
- extend({ ...claimFiltersShape, limit: number2().int().min(1).max(STAFF_REDEMPTION_PAGE_MAX).default(25), cursor: string2().min(1).max(8192).nullish(), direction: literal("forward").optional() }).strict(), staffRedemptionClaimCountsSchema = staffRedemptionEventIdSchema.extend(claimFiltersShape).strict(), voidStaffRedemptionClaimSchema = staffRedemptionEventIdSchema.extend({ claimId: idSchema, reason: reasonSchema }).strict(), releaseStaffRedemptionDrawSchema = staffRedemptionEventIdSchema.extend({ drawId: idSchema, reason: reasonSchema, allowWhileClaimActive: boolean2().optional().describe("Override: release the draw even though an active (not voided) redemption still shows it, for a redemption that stays recorded (for example a paper entry with no spin). Omit to refuse while any active redemption uses the draw.") }).strict(), staffRedemptionExportSchema = staffRedemptionEventIdSchema.extend(claimFiltersShape).strict(), STAFF_REDEMPTION_ROSTER_IMPORT_MAX = 2e4, staffRedemptionRosterImportRowSchema = object(
10337
- { row: number2().int().min(1), employeeId: string2().max(1e3), name: string2().max(1e3).nullable(), siteName: string2().max(1e3).nullable(), shift: string2().max(1e3).nullable(), workShift: string2().max(1e3).nullable(), allowance: string2().max(1e3).nullable() }).strict(), importStaffRedemptionRosterSchema = staffRedemptionEventIdSchema.extend({ rows: array(staffRedemptionRosterImportRowSchema).min(1).max(STAFF_REDEMPTION_ROSTER_IMPORT_MAX, "A roster can have at most ".concat(STAFF_REDEMPTION_ROSTER_IMPORT_MAX, " rows.")), archiveMissing: boolean2().default(!1) }).strict(), HEADER_PATTERNS = { employeeId: new __cliRegExp("^(employee|staff|worker)\\s*(id|no|number)$|^(emp|staff)\\s*id$", "i"), name: new __cliRegExp("^(worker|name|full\\s*name|employee\\s*name|staff\\s*name)$", "i"), siteName: new __cliRegExp("^(site|location|fab)$", "i"), shift: new __cliRegExp("^shift$", "i"), workShift: new __cliRegExp("^work\\s*shift$", "i"), allowance: new __cliRegExp("^(allowance|sets|entitlement|\
10338
- balance)$", "i") }, guessStaffRedemptionRosterMapping = __name2((header) => {
10321
+ int().min(0).max(STAFF_REDEMPTION_ALLOWANCE_MAX).optional() }).strict(), rosterFiltersShape = { search: string2().trim().max(200).optional(), siteId: idSchema.optional(), shift: staffRedemptionShiftSchema.optional(), archived: _enum(["active", "archived", "all"]).default("active"), collected: _enum(["any", "collected", "not-collected"]).default("any") }, staffRedemptionRosterListSchema = staffRedemptionEventIdSchema.extend({ ...rosterFiltersShape, limit: number2().int().min(1).max(STAFF_REDEMPTION_PAGE_MAX).default(25), cursor: string2().min(1).max(8192).nullish(), direction: literal("forward").optional() }).strict(), staffRedemptionRosterCountsSchema = staffRedemptionEventIdSchema.extend(rosterFiltersShape).strict(), STAFF_REDEMPTION_EMPLOYEE_CODE_MAX = 512, lookupStaffRedemptionSchema = staffRedemptionSiteIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema.optional(), code: string2().trim().min(1).max(STAFF_REDEMPTION_EMPLOYEE_CODE_MAX).optional().describe("Employee QR code\
10322
+ as scanned from the employee page. Give either employeeId or code.") }).strict().refine((input) => input.employeeId === void 0 != (input.code === void 0), { message: "Give either an Employee ID or a QR code.", path: ["employeeId"] }), claimItemIdsSchema = array(idSchema).max(STAFF_REDEMPTION_CLAIM_ITEMS_MAX).refine((ids) => new Set(ids).size === ids.length, { message: "Pick each item once." }), redeemStaffRedemptionSchema = staffRedemptionSiteIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema, clientRequestId: staffRedemptionClientRequestIdSchema, itemIds: claimItemIdsSchema }).strict(), recordStaffRedemptionClaimItemsSchema = staffRedemptionSiteIdSchema.extend({ claimId: idSchema, itemIds: claimItemIdsSchema }).strict(), STAFF_REDEMPTION_COUNTER_CLAIM_SCOPES = ["mine", "site"], staffRedemptionCounterClaimsSchema = staffRedemptionSiteIdSchema.extend({ limit: number2().int().min(1).max(50).default(20), scope: _enum(STAFF_REDEMPTION_COUNTER_CLAIM_SCOPES).default("mine"), status: _enum(
10323
+ ["all", "items-pending"]).default("all") }).strict(), STAFF_REDEMPTION_CLAIM_STATUSES = ["active", "items-pending", "voided", "all"], claimFiltersShape = { search: string2().trim().max(200).optional(), siteId: idSchema.optional(), sessionId: idSchema.optional(), status: _enum(STAFF_REDEMPTION_CLAIM_STATUSES).default("all") }, staffRedemptionClaimListSchema = staffRedemptionEventIdSchema.extend({ ...claimFiltersShape, limit: number2().int().min(1).max(STAFF_REDEMPTION_PAGE_MAX).default(25), cursor: string2().min(1).max(8192).nullish(), direction: literal("forward").optional() }).strict(), staffRedemptionClaimCountsSchema = staffRedemptionEventIdSchema.extend(claimFiltersShape).strict(), voidStaffRedemptionClaimSchema = staffRedemptionEventIdSchema.extend({ claimId: idSchema, reason: reasonSchema }).strict(), releaseStaffRedemptionDrawSchema = staffRedemptionEventIdSchema.extend({ drawId: idSchema, reason: reasonSchema, allowWhileClaimActive: boolean2().optional().describe("Override: rel\
10324
+ ease the draw even though an active (not voided) redemption still shows it, for a redemption that stays recorded (for example a paper entry with no spin). Omit to refuse while any active redemption uses the draw.") }).strict(), staffRedemptionExportSchema = staffRedemptionEventIdSchema.extend(claimFiltersShape).strict(), STAFF_REDEMPTION_EMPLOYEE_ISSUE_KINDS = ["qr-not-visible", "qr-render-failed", "qr-refresh-failed", "qr-expired", "page-load-failed", "device-problem", "reload-tapped"], STAFF_REDEMPTION_DEVICE_PROBLEMS = ["offline", "site-data-blocked", "in-app-browser", "forced-colors", "forced-dark-mode", "old-browser", "data-saver", "clock-wrong"], STAFF_REDEMPTION_EMPLOYEE_PAGE_STATES = ["loading", "signed-out", "crew-device", "needs-employee-id", "not-on-roster", "ready", "error"], staffRedemptionEmployeeIssueKindSchema = _enum(STAFF_REDEMPTION_EMPLOYEE_ISSUE_KINDS), staffRedemptionDeviceProblemSchema = _enum(STAFF_REDEMPTION_DEVICE_PROBLEMS), deviceDimensionSchema = number2().int().
10325
+ min(0).max(1e5), staffRedemptionDeviceSnapshotSchema = object({
10326
+ userAgent: string2().max(500),
10327
+ platform: string2().max(100).nullable(),
10328
+ language: string2().max(35).nullable(),
10329
+ timeZone: string2().max(64).nullable(),
10330
+ screenWidth: deviceDimensionSchema,
10331
+ screenHeight: deviceDimensionSchema,
10332
+ viewportWidth: deviceDimensionSchema,
10333
+ viewportHeight: deviceDimensionSchema,
10334
+ pixelRatio: number2().min(0).max(20),
10335
+ online: boolean2(),
10336
+ siteDataAllowed: boolean2(),
10337
+ inAppBrowser: string2().max(40).nullable(),
10338
+ browser: string2().max(40).nullable(),
10339
+ os: string2().max(40).nullable(),
10340
+ colorScheme: _enum(["light", "dark"]),
10341
+ forcedColors: boolean2(),
10342
+ standalone: boolean2(),
10343
+ connection: string2().max(20).nullable(),
10344
+ saveData: boolean2(),
10345
+ clockOffsetMs: number2().int().nullable()
10346
+ }), staffRedemptionEmployeeIssueSchema = staffRedemptionEventIdSchema.extend({ kind: staffRedemptionEmployeeIssueKindSchema, problems: array(staffRedemptionDeviceProblemSchema).max(8), detail: string2().trim().max(300).optional(), pageState: _enum(STAFF_REDEMPTION_EMPLOYEE_PAGE_STATES), device: staffRedemptionDeviceSnapshotSchema }).strict(), STAFF_REDEMPTION_DEVICE_ISSUES_LIMIT_MAX = 100, STAFF_REDEMPTION_DEVICE_ISSUES_LIMIT_DEFAULT = 50, deviceIssueFiltersShape = { kind: staffRedemptionEmployeeIssueKindSchema.optional() }, staffRedemptionDeviceIssuesSchema = staffRedemptionEventIdSchema.extend({ ...deviceIssueFiltersShape, limit: number2().int().min(1).max(STAFF_REDEMPTION_DEVICE_ISSUES_LIMIT_MAX).default(STAFF_REDEMPTION_DEVICE_ISSUES_LIMIT_DEFAULT), cursor: string2().min(1).max(8192).nullish(), direction: literal("forward").optional() }).strict(), staffRedemptionDeviceIssueCountsSchema = staffRedemptionEventIdSchema.extend(deviceIssueFiltersShape).strict(), STAFF_REDEMPTION_ROSTER_IMPORT_MAX = 2e4,
10347
+ staffRedemptionRosterImportRowSchema = object({ row: number2().int().min(1), employeeId: string2().max(1e3), name: string2().max(1e3).nullable(), siteName: string2().max(1e3).nullable(), shift: string2().max(1e3).nullable(), workShift: string2().max(1e3).nullable(), allowance: string2().max(1e3).nullable() }).strict(), importStaffRedemptionRosterSchema = staffRedemptionEventIdSchema.extend({ rows: array(staffRedemptionRosterImportRowSchema).min(1).max(STAFF_REDEMPTION_ROSTER_IMPORT_MAX, "A roster can have at most ".concat(STAFF_REDEMPTION_ROSTER_IMPORT_MAX, " rows.")), archiveMissing: boolean2().default(!1) }).strict(), HEADER_PATTERNS = { employeeId: new __cliRegExp("^(employee|staff|worker)\\s*(id|no|number)$|^(emp|staff)\\s*id$", "i"), name: new __cliRegExp("^(worker|name|full\\s*name|employee\\s*name|staff\\s*name)$", "i"), siteName: new __cliRegExp("^(site|location|fab)$", "i"), shift: new __cliRegExp("^shift$", "i"), workShift: new __cliRegExp("^work\\s*shift$", "i"), allowance: new __cliRegExp(
10348
+ "^(allowance|sets|entitlement|balance)$", "i") }, guessStaffRedemptionRosterMapping = __name2((header) => {
10339
10349
  const find = __name2((key) => {
10340
10350
  const index = header.findIndex((cell2) => HEADER_PATTERNS[key].test(cell2.trim()));
10341
10351
  return index === -1 ? null : index;
@@ -10347,13 +10357,7 @@ balance)$", "i") }, guessStaffRedemptionRosterMapping = __name2((header) => {
10347
10357
  line.every((value) => !value?.trim()) || rows.push({ row: offset + 2, employeeId: line[mapping.employeeId] ?? "", name: cell2(line, mapping.name), siteName: cell2(line, mapping.siteName), shift: cell2(line, mapping.shift), workShift: cell2(line, mapping.workShift), allowance: cell2(line, mapping.allowance) });
10348
10358
  }), rows.length > STAFF_REDEMPTION_ROSTER_IMPORT_MAX) throw new Error("A roster can have at most ".concat(STAFF_REDEMPTION_ROSTER_IMPORT_MAX, " rows."));
10349
10359
  return rows;
10350
- }, "mapStaffRedemptionRosterTable"), optionalRosterColumns = [
10351
- ["name", "name-column"],
10352
- ["siteName", "site-column"],
10353
- ["shift", "shift-column"],
10354
- ["workShift", "work-shift-column"],
10355
- ["allowance", "allowance-column"]
10356
- ], rosterImportFlags = ["event-id", "file", "sheet", "employee-id-column", ...optionalRosterColumns.map(([, flag2]) => flag2), "archive-missing", "allow-state-change", "target"], exportFlags = ["event-id", "search", "site-id", "session-id", "status", "csv-file", "force"], headerIndex2 = __name2((headers, name) => {
10360
+ }, "mapStaffRedemptionRosterTable"), optionalRosterColumns = [["name", "name-column"], ["siteName", "site-column"], ["shift", "shift-column"], ["workShift", "work-shift-column"], ["allowance", "allowance-column"]], rosterImportFlags = ["event-id", "file", "sheet", "employee-id-column", ...optionalRosterColumns.map(([, flag2]) => flag2), "archive-missing", "allow-state-change", "target"], exportFlags = ["event-id", "search", "site-id", "session-id", "status", "csv-file", "force"], headerIndex2 = __name2((headers, name) => {
10357
10361
  const wanted = name.trim().toLowerCase(), index = headers.findIndex((header) => header.trim().toLowerCase() === wanted);
10358
10362
  if (index === -1) throw new CliUsageError('Column "'.concat(name, '" is not in the file. Headers: ').concat(headers.join(", "), "."));
10359
10363
  return index;
@@ -10371,19 +10375,22 @@ balance)$", "i") }, guessStaffRedemptionRosterMapping = __name2((header) => {
10371
10375
  } catch (error2) {
10372
10376
  throw new CliUsageError("Could not read ".concat(path2, ": ").concat(error2 instanceof Error ? error2.message : "unknown error"));
10373
10377
  }
10374
- }, "readRosterTable"), prepareRosterImport = __name2(async (parsed) => {
10375
- const eventId = getRequiredFlag(parsed, "event-id"), path2 = getRequiredFlag(parsed, "file"), sheet = getOptionalFlag(parsed, "sheet");
10376
- assertStateChangeTarget(parsed, eventId);
10377
- const table = await readRosterTable(path2, sheet), mapping = resolveStaffRedemptionRosterMapping(table[0] ?? [], parsed);
10378
- let rows;
10379
- try {
10380
- rows = mapStaffRedemptionRosterTable(table, mapping);
10381
- } catch (error2) {
10382
- throw new CliUsageError("Could not import ".concat(path2, ": ").concat(error2 instanceof Error ? error2.message : "unknown error"));
10383
- }
10384
- if (rows.length === 0) throw new CliUsageError("".concat(path2, " has a header but no data rows."));
10385
- return { eventId, rows, archiveMissing: parsed.flags.get("archive-missing") === !0 };
10386
- }, "prepareRosterImport"), exportFilters = __name2((parsed, eventId) => {
10378
+ }, "readRosterTable"), prepareRosterImport = __name2(
10379
+ async (parsed) => {
10380
+ const eventId = getRequiredFlag(parsed, "event-id"), path2 = getRequiredFlag(parsed, "file"), sheet = getOptionalFlag(parsed, "sheet");
10381
+ assertStateChangeTarget(parsed, eventId);
10382
+ const table = await readRosterTable(path2, sheet), mapping = resolveStaffRedemptionRosterMapping(table[0] ?? [], parsed);
10383
+ let rows;
10384
+ try {
10385
+ rows = mapStaffRedemptionRosterTable(table, mapping);
10386
+ } catch (error2) {
10387
+ throw new CliUsageError("Could not import ".concat(path2, ": ").concat(error2 instanceof Error ? error2.message : "unknown error"));
10388
+ }
10389
+ if (rows.length === 0) throw new CliUsageError("".concat(path2, " has a header but no data rows."));
10390
+ return { eventId, rows, archiveMissing: parsed.flags.get("archive-missing") === !0 };
10391
+ },
10392
+ "prepareRosterImport"
10393
+ ), exportFilters = __name2((parsed, eventId) => {
10387
10394
  const checked = staffRedemptionExportSchema.safeParse({ eventId, search: getOptionalFlag(parsed, "search"), siteId: getOptionalFlag(parsed, "site-id"), sessionId: getOptionalFlag(parsed, "session-id"), status: getOptionalFlag(parsed, "status") });
10388
10395
  if (!checked.success) {
10389
10396
  const issue2 = checked.error.issues[0], name = String(issue2?.path[0] ?? "filter");
@@ -10393,19 +10400,36 @@ balance)$", "i") }, guessStaffRedemptionRosterMapping = __name2((header) => {
10393
10400
  }, "exportFilters"), formulaStart = new __cliRegExp("^[=+\\-@\\t\\r]", ""), csvCell = __name2((value) => {
10394
10401
  const text2 = value ?? "", safe = formulaStart.test(text2) ? "'".concat(text2) : text2;
10395
10402
  return new __cliRegExp('[",\\r\\n]', "").test(safe) ? '"'.concat(safe.replaceAll('"', '""'), '"') : safe;
10396
- }, "csvCell"), csvColumns = [["Created at", (row) => row.createdAt.toISOString()], ["Employee ID", (row) => row.employeeId], ["Name", (row) => row.name], ["Site", (row) => row.site.name], ["Roster site", (row) => row.rosterSiteName], ["Away from roster site", (row) => row.awayFromRosterSite ? "yes" : "no"], ["Session", (row) => row.session.name], ["Items", (row) => row.items.map((item) => {
10397
- const label = "".concat(item.groupName, ": ").concat(item.name);
10398
- return item.quantity === 1 ? label : "".concat(label, " x").concat(item.quantity);
10399
- }).join("; ")], ["Items recorded", (row) => row.itemsPending ? "no" : "yes"], ["Items recorded at", (row) => row.itemsRecordedAt?.toISOString() ?? null], ["Outcome", (row) => row.draw?.outcome ?? null], ["Prize", (row) => row.draw?.prize?.name ?? null], ["Operator kind", (row) => row.operatorKind], ["Voided at", (row) => row.voidedAt?.toISOString() ?? null], ["Void reason", (row) => row.voidReason], ["Draw released at", (row) => row.draw?.releasedAt?.toISOString() ?? null]], staffRedemptionClaimsToCsv = __name2((rows) => {
10400
- const lines = [csvColumns.map(
10401
- ([header]) => csvCell(header)
10402
- ).join(","), ...rows.map((row) => csvColumns.map(([, read]) => csvCell(read(row))).join(","))];
10403
+ }, "csvCell"), csvColumns = [
10404
+ ["Created at", (row) => row.createdAt.toISOString()],
10405
+ ["Employee ID", (row) => row.employeeId],
10406
+ ["Name", (row) => row.name],
10407
+ ["Site", (row) => row.site.name],
10408
+ ["Roster site", (row) => row.rosterSiteName],
10409
+ ["Away from roster site", (row) => row.awayFromRosterSite ? "yes" : "no"],
10410
+ ["Session", (row) => row.session.name],
10411
+ ["Items", (row) => row.items.map((item) => {
10412
+ const label = "".concat(item.groupName, ": ").concat(item.name);
10413
+ return item.quantity === 1 ? label : "".concat(label, " x").concat(item.quantity);
10414
+ }).join("; ")],
10415
+ ["Items recorded", (row) => row.itemsPending ? "no" : "yes"],
10416
+ ["Items recorded at", (row) => row.itemsRecordedAt?.toISOString() ?? null],
10417
+ ["Outcome", (row) => row.draw?.outcome ?? null],
10418
+ ["Prize", (row) => row.draw?.prize?.name ?? null],
10419
+ ["Operator kind", (row) => row.operatorKind],
10420
+ ["Voided at", (row) => row.voidedAt?.toISOString() ?? null],
10421
+ ["Void reason", (row) => row.voidReason],
10422
+ ["Draw released at", (row) => row.draw?.releasedAt?.toISOString() ?? null]
10423
+ ], staffRedemptionClaimsToCsv = __name2((rows) => {
10424
+ const lines = [csvColumns.map(([header]) => csvCell(header)).join(","), ...rows.map((row) => csvColumns.map(([, read]) => csvCell(read(row))).join(","))];
10403
10425
  return "\uFEFF".concat(lines.join("\r\n"), "\r\n");
10404
10426
  }, "staffRedemptionClaimsToCsv"), writeCsvFile = __name2(async (path2, content, force) => {
10405
10427
  try {
10406
10428
  await writeFile(path2, content, { encoding: "utf8", flag: force ? "w" : "wx" });
10407
10429
  } catch (error2) {
10408
- throw (error2 instanceof Error && "code" in error2 ? error2.code : void 0) === "EEXIST" ? new CliUsageError("".concat(path2, " already exists. Choose another --csv-file or pass --force to overwrite it.")) : new CliUsageError("Could not write ".concat(path2, ": ").concat(error2 instanceof Error ? error2.message : "unknown error"));
10430
+ throw (error2 instanceof Error && "code" in error2 ? error2.code : void 0) === "EEXIST" ? new CliUsageError("".concat(path2, " already exists. Choose another --csv-file or pass --force to overwrite it.")) : new CliUsageError(
10431
+ "Could not write ".concat(path2, ": ").concat(error2 instanceof Error ? error2.message : "unknown error")
10432
+ );
10409
10433
  }
10410
10434
  }, "writeCsvFile"), exportClaims = __name2(async (input) => {
10411
10435
  const { parsed, runtime } = input;
@@ -10422,7 +10446,9 @@ balance)$", "i") }, guessStaffRedemptionRosterMapping = __name2((header) => {
10422
10446
  }, "exportClaims"), importRoster = __name2(async (input) => {
10423
10447
  const { parsed, runtime } = input;
10424
10448
  assertOnlyFlags(parsed, rosterImportFlags), assertPositionalCount(parsed, 3);
10425
- const payload = await prepareRosterImport(parsed);
10449
+ const payload = await prepareRosterImport(
10450
+ parsed
10451
+ );
10426
10452
  await input.authenticate(), writeSuccess(runtime, await api2.event.staffRedemption.importStaffRedemptionRoster.mutate(payload));
10427
10453
  }, "importRoster"), runStaffRedemptionCommand = __name2(async (input) => {
10428
10454
  switch (input.parsed.positionals.slice(1).join(" ")) {
@@ -10436,13 +10462,15 @@ balance)$", "i") }, guessStaffRedemptionRosterMapping = __name2((header) => {
10436
10462
  throw new CliUsageError("Unknown staff-redemption command. Run `et commands` for the registry commands and `et --help` for the rest.");
10437
10463
  }
10438
10464
  }, "runStaffRedemptionCommand"), command_manifest_default = [
10439
- { path: ["organization", "member", "list"], procedure: "organization.getOrganizationMembersById", operation: "query", summary: "List an organization's members and pending invitations (paged; expired links included until resent or canceled), with each invitation's stored emailDeliveryStatus.", effects: [], dates: [], input: { type: "object", properties: { organizationId: { type: "string" }, page: { default: 1, type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { default: 10, type: "integer", minimum: 1, maximum: 100 }, search: { default: "", type: "string" } }, required: ["organizationId"] } },
10465
+ { path: ["organization", "member", "list"], procedure: "organization.getOrganizationMembersById", operation: "query", summary: "List an organization's members and pending invitations (paged; expired links included until resent or canceled), with each invitation's stored emailDeliveryStatus.", effects: [], dates: [], input: { type: "object", properties: { organizationId: { type: "string" }, page: { default: 1, type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: {
10466
+ default: 10,
10467
+ type: "integer",
10468
+ minimum: 1,
10469
+ maximum: 100
10470
+ }, search: { default: "", type: "string" } }, required: ["organizationId"] } },
10440
10471
  { path: ["organization", "member", "list-all"], procedure: "organization.getMembersByOrganization", operation: "query", summary: "List every member of an organization without paging.", effects: [], dates: [], input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] } },
10441
10472
  { path: ["organization", "member", "invite"], procedure: "organization.createOrganizationMember", operation: "mutation", summary: "Invite a member to an organization and email the invitation; reports deliveryStatus and the stored emailDeliveryStatus.", effects: ["state-change", "email"], target: "email", dates: [], input: { type: "object", properties: { email: { type: "string", format: "email", pattern: "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, organizationId: { type: "string", minLength: 1 }, organizationRole: { default: "MEMBER", type: "string", enum: ["OWNER", "ADMIN", "MEMBER"] } }, required: ["email", "organizationId"] } },
10442
- { path: ["organization", "member", "invitation-resend"], procedure: "organization.resendOrganizationMemberInvitation", operation: "mutation", summary: "Resend the invitation email to a pending legacy member invitation created before organization invitations; reports deliveryStatus and the stored emailDeliveryStatus.", effects: ["state-change", "email"], target: "memberId", dates: [], input: { type: "object", properties: {
10443
- organizationId: { type: "string", minLength: 1 },
10444
- memberId: { type: "string", minLength: 1 }
10445
- }, required: ["organizationId", "memberId"] } },
10473
+ { path: ["organization", "member", "invitation-resend"], procedure: "organization.resendOrganizationMemberInvitation", operation: "mutation", summary: "Resend the invitation email to a pending legacy member invitation created before organization invitations; reports deliveryStatus and the stored emailDeliveryStatus.", effects: ["state-change", "email"], target: "memberId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, memberId: { type: "string", minLength: 1 } }, required: ["organizationId", "memberId"] } },
10446
10474
  { path: ["organization", "member", "remove"], procedure: "organization.deleteOrganizationMember", operation: "mutation", summary: "Remove a member (or leave with isLeaving) and revoke their event access.", effects: ["state-change"], target: "memberId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, memberId: { type: "string", minLength: 1 }, isLeaving: { default: !1, type: "boolean" } }, required: ["organizationId", "memberId"] } },
10447
10475
  { path: ["organization", "member", "role-update"], procedure: "organization.updateOrganizationMemberRole", operation: "mutation", summary: "Change an organization member's role.", effects: ["state-change"], target: "memberId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, memberId: { type: "string", minLength: 1 }, newRole: { type: "string", enum: ["OWNER", "ADMIN", "MEMBER"] } }, required: ["organizationId", "memberId", "newRole"] } },
10448
10476
  { path: ["organization", "owner", "transfer"], procedure: "organization.transferOwnership", operation: "mutation", summary: "Transfer organization ownership to another active member.", effects: ["state-change"], target: "memberId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, memberId: { type: "string", minLength: 1 } }, required: ["organizationId", "memberId"] } },
@@ -10452,34 +10480,19 @@ balance)$", "i") }, guessStaffRedemptionRosterMapping = __name2((header) => {
10452
10480
  { path: ["organization", "invitation", "accept"], procedure: "organization.acceptInvitation", operation: "mutation", summary: "Accept the current user's invitation to an organization.", effects: ["state-change"], target: "organizationId", dates: [], input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] } },
10453
10481
  { path: ["organization", "invitation", "reject"], procedure: "organization.rejectInvitation", operation: "mutation", summary: "Reject the current user's invitation to an organization.", effects: ["state-change"], target: "organizationId", dates: [], input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] } },
10454
10482
  { path: ["organization", "invitation", "accept-access"], procedure: "organization.acceptAccessInvitation", operation: "mutation", summary: "Accept an access invitation (organization or event staff) by invitation ID.", effects: ["state-change"], target: "invitationId", dates: [], input: { type: "object", properties: { invitationId: { type: "string", minLength: 1 } }, required: ["invitationId"] } },
10455
- { path: ["organization", "invitation", "reject-access"], procedure: "organization.rejectAccessInvitation", operation: "mutation", summary: "Reject an access invitation by invitation ID.", effects: ["state-change"], target: "invitationId", dates: [], input: { type: "object", properties: { invitationId: { type: "string", minLength: 1 } }, required: ["invitationId"] } },
10483
+ { path: ["organization", "invitation", "reject-access"], procedure: "organization.rejectAccessInvitation", operation: "mutation", summary: "Reject an access invitation by invitation ID.", effects: ["state-change"], target: "invitationId", dates: [], input: { type: "object", properties: { invitationId: { type: "string", minLength: 1 } }, required: [
10484
+ "invitationId"
10485
+ ] } },
10456
10486
  { path: ["organization", "invitation", "cancel"], procedure: "organization.cancelInvitation", operation: "mutation", summary: "Cancel a pending organization invitation.", effects: ["state-change"], target: "invitationId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, invitationId: { type: "string", minLength: 1 } }, required: ["organizationId", "invitationId"] } },
10457
10487
  { path: ["organization", "invitation", "resend"], procedure: "organization.resendInvitation", operation: "mutation", summary: "Replace a pending organization invitation (including an expired one) and email a fresh link; reports deliveryStatus and the stored emailDeliveryStatus.", effects: ["state-change", "email"], target: "invitationId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, invitationId: { type: "string", minLength: 1 } }, required: ["organizationId", "invitationId"] } },
10458
10488
  { path: ["organization", "update"], procedure: "organization.updateOrganizationById", operation: "mutation", summary: "Update organization details. name is required; omitted optional fields are unchanged.", effects: ["state-change"], target: "organizationId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, name: { type: "string", minLength: 1 }, slug: { type: "string" }, description: { type: "string" }, website: { anyOf: [{ type: "string", format: "uri" }, { type: "string", const: "" }] }, email: { anyOf: [{ type: "string", format: "email", pattern: "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, { type: "string", const: "" }] }, allowedEventTypes: { type: "array", items: { type: "string", enum: ["POST_IT_NOTE", "PHOTO_WALL", "STORY_COLLECTION", "LUCKY_DRAW", "SCAVENGER_HUNT", "HUMAN_BINGO", "SIGNATURE_WALL", "GARDENS_BY_THE_BAY", "RATING_SYSTEM", "EVENT_PASSPORT", "ST\
10459
10489
  AFF_REDEMPTION"] } }, image: { type: ["string", "null"] } }, required: ["organizationId", "name"] } },
10460
10490
  { path: ["organization", "image", "update"], procedure: "organization.updateOrganizationImageById", operation: "mutation", summary: "Set the organization image to an uploaded key (see et upload, folder organization-images).", effects: ["state-change"], target: "organizationId", dates: [], input: { type: "object", properties: { organizationId: { type: "string" }, image: { type: ["string", "null"] } }, required: ["organizationId", "image"] } },
10461
- {
10462
- path: ["organization", "archive"],
10463
- procedure: "organization.archiveOrganization",
10464
- operation: "mutation",
10465
- summary: "Archive an organization as its owner.",
10466
- effects: ["state-change"],
10467
- target: "organizationId",
10468
- dates: [],
10469
- input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] }
10470
- },
10491
+ { path: ["organization", "archive"], procedure: "organization.archiveOrganization", operation: "mutation", summary: "Archive an organization as its owner.", effects: ["state-change"], target: "organizationId", dates: [], input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] } },
10471
10492
  { path: ["organization", "access", "check"], procedure: "organization.checkOrganizationAccess", operation: "query", summary: "Check the current user's access to an organization.", effects: [], dates: [], input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] } },
10472
10493
  { path: ["organization", "dashboard"], procedure: "organization.getOrganizationDashboardStats", operation: "query", summary: "Get an organization's dashboard totals.", effects: [], dates: [], input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] } },
10473
10494
  { path: ["organization", "analytics"], procedure: "organization.getOrganizationEventAnalytics", operation: "query", summary: "Get per-event analytics for an organization.", effects: [], dates: [], input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] } },
10474
- {
10475
- path: ["organization", "event-types"],
10476
- procedure: "organization.getAllowedEventTypeByOrganizationId",
10477
- operation: "query",
10478
- summary: "List the event types an organization may create.",
10479
- effects: [],
10480
- dates: [],
10481
- input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] }
10482
- },
10495
+ { path: ["organization", "event-types"], procedure: "organization.getAllowedEventTypeByOrganizationId", operation: "query", summary: "List the event types an organization may create.", effects: [], dates: [], input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] } },
10483
10496
  { path: ["organization", "onboarding"], procedure: "organization.getOnboardingState", operation: "query", summary: "Get the current user's onboarding state.", effects: [], dates: [], input: null },
10484
10497
  { path: ["admin", "organization", "list"], procedure: "admin.organization.getOrganizations", operation: "query", summary: "List every organization (paged, searchable) as a global admin.", effects: [], dates: [], input: { type: "object", properties: { archiveStatus: { default: "active", type: "string", enum: ["active", "archived", "all"] }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 6, type: "number", minimum: 1, maximum: 100 }, search: { default: "", type: "string" } } } },
10485
10498
  { path: ["admin", "organization", "get"], procedure: "admin.organization.getOrganization", operation: "query", summary: "Get any organization by ID as a global admin.", effects: [], dates: [], input: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } },
@@ -10501,76 +10514,89 @@ AFF_REDEMPTION"] } }, image: { type: ["string", "null"] } }, required: ["organiz
10501
10514
  { path: ["admin", "user", "list"], procedure: "admin.user.getUsers", operation: "query", summary: "List users A to Z by name (paged; filter by search).", effects: [], dates: [], input: { type: "object", properties: { search: { type: "string", maxLength: 200 }, limit: { default: 25, type: "integer", minimum: 1, maximum: 100 }, cursor: { anyOf: [{ type: "string", minLength: 1, maxLength: 2048 }, { type: "null" }] }, direction: { type: "string", const: "forward" } }, additionalProperties: !1 } },
10502
10515
  { path: ["admin", "user", "get"], procedure: "admin.user.getUserById", operation: "query", summary: "Get one user as a global admin.", effects: [], dates: [], input: { type: "object", properties: { userId: { type: "string", minLength: 1 } }, required: ["userId"] } },
10503
10516
  { path: ["admin", "user", "role-update"], procedure: "admin.user.updateSystemRole", operation: "mutation", summary: "Change a user's system role (ADMIN, USER, GUEST).", effects: ["state-change"], target: "userId", dates: [], input: { type: "object", properties: { role: { type: "string", enum: ["ADMIN", "USER", "GUEST"] }, userId: { type: "string", minLength: 1 } }, required: ["role", "userId"] } },
10504
- { path: ["event", "access", "mine"], procedure: "access.getMyEventAccess", operation: "query", summary: "Show the current user's role and permissions for an event.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 }, allowArchived: { type: "boolean" } }, required: ["eventId", "organizationId"] } },
10517
+ {
10518
+ path: ["event", "access", "mine"],
10519
+ procedure: "access.getMyEventAccess",
10520
+ operation: "query",
10521
+ summary: "Show the current user's role and permissions for an event.",
10522
+ effects: [],
10523
+ dates: [],
10524
+ input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 }, allowArchived: { type: "boolean" } }, required: ["eventId", "organizationId"] }
10525
+ },
10505
10526
  { path: ["event", "access", "my-assignments"], procedure: "access.listMyEventAssignments", operation: "query", summary: "List the current user's own event staff assignments in an organization (optionally one eventId), each with status ACTIVE, SCHEDULED, ENDED or REVOKED.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 } }, required: ["organizationId"] } },
10506
- { path: ["event", "access", "list"], procedure: "access.listEventAssignments", operation: "query", summary: "List event staff assignments and pending staff invitations (expired links included until resent or revoked), with each invitation's stored emailDeliveryStatus.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 } }, required: ["eventId", "organizationId"] } },
10527
+ { path: ["event", "access", "list"], procedure: "access.listEventAssignments", operation: "query", summary: "List event staff assignments and pending staff invitations (expired links included until resent or revoked), with each invitation's stored emailDeliveryStatus.", effects: [], dates: [], input: {
10528
+ type: "object",
10529
+ properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 } },
10530
+ required: ["eventId", "organizationId"]
10531
+ } },
10507
10532
  { path: ["event", "access", "invite"], procedure: "access.inviteEventStaff", operation: "mutation", summary: "Invite event staff by email; roles include HELPDESK for Event Passport roster lookup and new entries only. Reports deliveryStatus and the stored emailDeliveryStatus. startsAt/expiresAt are ISO date-times or null; set expiresAt for temporary access.", effects: ["state-change", "email"], target: "email", dates: ["expiresAt", "startsAt"], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 }, canExport: { default: !1, type: "boolean" }, email: { type: "string" }, expiresAt: { anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] }, role: { type: "string", enum: ["MANAGER", "OPERATOR", "VIEWER", "HELPDESK"] }, startsAt: { anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] } }, required: ["eventId", "organizationId", "email", "role"] } },
10508
- { path: ["event", "access", "invitation-resend"], procedure: "access.resendEventStaffInvitation", operation: "mutation", summary: "Replace a pending event staff invitation (including an expired one) and email a fresh link; reports deliveryStatus and the stored emailDeliveryStatus.", effects: ["state-change", "email"], target: "invitationId", dates: [], input: { type: "object", properties: {
10509
- eventId: { type: "string", minLength: 1 },
10510
- organizationId: { type: "string", minLength: 1 },
10511
- invitationId: { type: "string", minLength: 1 }
10512
- }, required: ["eventId", "organizationId", "invitationId"] } },
10533
+ { path: [
10534
+ "event",
10535
+ "access",
10536
+ "invitation-resend"
10537
+ ], procedure: "access.resendEventStaffInvitation", operation: "mutation", summary: "Replace a pending event staff invitation (including an expired one) and email a fresh link; reports deliveryStatus and the stored emailDeliveryStatus.", effects: ["state-change", "email"], target: "invitationId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 }, invitationId: { type: "string", minLength: 1 } }, required: ["eventId", "organizationId", "invitationId"] } },
10513
10538
  { path: ["event", "access", "invitation-revoke"], procedure: "access.revokeEventStaffInvitation", operation: "mutation", summary: "Revoke a pending event staff invitation.", effects: ["state-change"], target: "invitationId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 }, invitationId: { type: "string", minLength: 1 } }, required: ["eventId", "organizationId", "invitationId"] } },
10514
- { path: ["event", "access", "assign"], procedure: "access.upsertEventAssignment", operation: "mutation", summary: "Create or update an existing user's event staff assignment. HELPDESK can look up the Event Passport roster and add new entries only; set expiresAt for temporary access.", effects: ["state-change"], target: "userId", dates: ["expiresAt", "startsAt"], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 }, canExport: {
10515
- default: !1,
10516
- type: "boolean"
10517
- }, expiresAt: { anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] }, role: { type: "string", enum: ["MANAGER", "OPERATOR", "VIEWER", "HELPDESK"] }, startsAt: { anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] }, userId: { type: "string", minLength: 1 } }, required: ["eventId", "organizationId", "role", "userId"] } },
10539
+ {
10540
+ path: ["event", "access", "assign"],
10541
+ procedure: "access.upsertEventAssignment",
10542
+ operation: "mutation",
10543
+ summary: "Create or update an existing user's event staff assignment. HELPDESK can look up the Event Passport roster and add new entries only; set expiresAt for temporary access.",
10544
+ effects: ["state-change"],
10545
+ target: "userId",
10546
+ dates: ["expiresAt", "startsAt"],
10547
+ input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 }, canExport: { default: !1, type: "boolean" }, expiresAt: { anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] }, role: { type: "string", enum: ["MANAGER", "OPERATOR", "VIEWER", "HELPDESK"] }, startsAt: { anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] }, userId: { type: "string", minLength: 1 } }, required: ["eventId", "organizationId", "role", "userId"] }
10548
+ },
10518
10549
  { path: ["event", "access", "revoke"], procedure: "access.revokeEventAssignment", operation: "mutation", summary: "Revoke a user's event staff assignment.", effects: ["state-change"], target: "userId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 }, userId: { type: "string", minLength: 1 } }, required: ["eventId", "organizationId", "userId"] } },
10519
10550
  { path: ["activity", "list"], procedure: "activity.getByResource", operation: "query", summary: "List the activity log for an organization, event or other resource (cursor paged).", effects: [], dates: ["startAt", "endAt"], input: { type: "object", properties: { organizationId: { type: "string" }, resourceType: { type: "string", minLength: 1 }, resourceId: { type: "string", minLength: 1 }, eventId: { type: "string" }, includeEventChildren: { default: !1, type: "boolean" }, eventCategory: { type: "string", enum: ["ORGANIZATION", "MEMBER", "EVENT", "CONFIG", "SUBMISSION", "PARTICIPANT", "EXPORT", "SYSTEM"] }, actorUserId: { type: "string" }, startAt: { type: "string", format: "date-time" }, endAt: { type: "string", format: "date-time" }, cursor: { type: "string" }, limit: { default: 25, type: "number", minimum: 1, maximum: 50 } }, required: ["organizationId", "resourceType", "resourceId"] } },
10520
10551
  { path: ["event", "recent"], procedure: "event.getRecentEvents", operation: "query", summary: "List the events the current user opened most recently.", effects: [], dates: [], input: null },
10521
10552
  { path: ["event", "details"], procedure: "event.getEventById", operation: "query", summary: "Get an event's full details (description, tags, background, dates).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 } }, required: ["eventId"] } },
10522
- { path: ["event", "update"], procedure: "event.updateEvent", operation: "mutation", summary: "Replace an event's details. Send every field from event details; dates are ISO.", effects: ["state-change"], target: "id", dates: ["eventDateRange.from", "eventDateRange.to"], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, name: { type: "string", minLength: 1, maxLength: 100 }, type: { type: "string", enum: ["POST_IT_NOTE", "PHOTO_WALL", "STORY_COLLECTION", "LUCKY_DRAW", "SCAVENGER_HUNT", "HUMAN_BINGO", "SIGNATURE_WALL", "GARDENS_BY_THE_BAY", "RATING_SYSTEM", "EVENT_PASSPORT", "STAFF_REDEMPTION"] }, descriptionDelta: {}, descriptionRichText: { anyOf: [{}, { type: "null" }] }, filtering: { type: "boolean" }, location: { type: "string", minLength: 1 }, eventDateRange: { type: "object", properties: { from: { type: "string", format: "date-time" }, to: { type: "string", format: "date-time" } }, required: ["from"] }, tags: { type: "array", items: { type: "\
10523
- string" } }, backgroundImageKey: { type: ["string", "null"] }, id: { type: "string", minLength: 1 } }, required: ["organizationId", "name", "type", "location", "eventDateRange", "id"] } },
10524
- { path: [
10525
- "event",
10526
- "status-update"
10527
- ], procedure: "event.updateEventStatus", operation: "mutation", summary: "Set an event's status (DRAFT, ONGOING, COMPLETED).", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, organizationId: { type: "string" }, status: { type: "string", enum: ["DRAFT", "ONGOING", "COMPLETED"] } }, required: ["eventId", "organizationId", "status"] } },
10528
- { path: ["event", "archive"], procedure: "event.archiveEvent", operation: "mutation", summary: "Archive an event.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 } }, required: ["eventId", "organizationId"] } },
10553
+ { path: ["event", "update"], procedure: "event.updateEvent", operation: "mutation", summary: "Replace an event's details. Send every field from event details; dates are ISO.", effects: ["state-change"], target: "id", dates: ["eventDateRange.from", "eventDateRange.to"], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, name: { type: "string", minLength: 1, maxLength: 100 }, type: { type: "string", enum: ["POST_IT_NOTE", "PHOTO_WALL", "STORY_COLLECTION", "LUCKY_DRAW", "SCAVENGER_HUNT", "HUMAN_BINGO", "SIGNATURE_WALL", "GARDENS_BY_THE_BAY", "RATING_SYSTEM", "EVENT_PASSPORT", "STAFF_REDEMPTION"] }, descriptionDelta: {}, descriptionRichText: {
10554
+ anyOf: [{}, { type: "null" }]
10555
+ }, filtering: { type: "boolean" }, location: { type: "string", minLength: 1 }, eventDateRange: { type: "object", properties: { from: { type: "string", format: "date-time" }, to: { type: "string", format: "date-time" } }, required: ["from"] }, tags: { type: "array", items: { type: "string" } }, backgroundImageKey: { type: ["string", "null"] }, id: { type: "string", minLength: 1 } }, required: ["organizationId", "name", "type", "location", "eventDateRange", "id"] } },
10556
+ { path: ["event", "status-update"], procedure: "event.updateEventStatus", operation: "mutation", summary: "Set an event's status (DRAFT, ONGOING, COMPLETED).", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, organizationId: { type: "string" }, status: { type: "string", enum: ["DRAFT", "ONGOING", "COMPLETED"] } }, required: ["eventId", "organizationId", "status"] } },
10557
+ { path: ["event", "archive"], procedure: "event.archiveEvent", operation: "mutation", summary: "Archive an event.", effects: ["state-change"], target: "eventId", dates: [], input: {
10558
+ type: "object",
10559
+ properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 } },
10560
+ required: ["eventId", "organizationId"]
10561
+ } },
10529
10562
  { path: ["event", "restore"], procedure: "event.restoreEvent", operation: "mutation", summary: "Restore an archived event.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 } }, required: ["eventId", "organizationId"] } },
10530
10563
  { path: ["event", "duplicate"], procedure: "event.duplicateEvent", operation: "mutation", summary: "Duplicate an event and its setup into a new draft.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10531
10564
  { path: ["event", "export"], procedure: "event.getEventDataToExport", operation: "query", summary: "Export an event's submissions and results.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10532
10565
  { path: ["event", "retired", "export"], procedure: "event.getRetiredEventExport", operation: "query", summary: "Export a retired Scavenger Hunt or Gardens by the Bay event (read-only): full setup and results with stable IDs, archived rows marked by archivedAt, and 1-hour signed media links. These types cannot be created or edited.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10533
10566
  { path: ["event", "background", "get"], procedure: "event.getEventBackgroundImage", operation: "query", summary: "Get an event's background image URL.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10534
10567
  { path: ["event", "story", "list"], procedure: "event.getStoryItemsByEventId", operation: "query", summary: "List Story Collection submissions (paged).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, email: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 5, type: "number", minimum: 1, maximum: 100 } }, required: ["eventId"] } },
10535
- { path: ["event", "story", "archive"], procedure: "event.archiveStoryItems", operation: "mutation", summary: "Archive Story Collection submissions by ID. --target is the comma-joined ids.", effects: ["state-change"], target: "ids", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, ids: { type: "array", items: { type: "string" } } }, required: ["eventId", "ids"] } },
10536
- {
10537
- path: ["lucky-draw", "passport-sync"],
10538
- procedure: "event.luckyDraw.getPassportDrawSyncStatus",
10539
- operation: "query",
10540
- summary: "Show whether a Passport-linked draw roster is in sync.",
10541
- effects: [],
10542
- dates: [],
10543
- input: { type: "object", properties: { eventId: { type: "string", minLength: 1 } }, required: ["eventId"] }
10544
- },
10568
+ { path: [
10569
+ "event",
10570
+ "story",
10571
+ "archive"
10572
+ ], procedure: "event.archiveStoryItems", operation: "mutation", summary: "Archive Story Collection submissions by ID. --target is the comma-joined ids.", effects: ["state-change"], target: "ids", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, ids: { type: "array", items: { type: "string" } } }, required: ["eventId", "ids"] } },
10573
+ { path: ["lucky-draw", "passport-sync"], procedure: "event.luckyDraw.getPassportDrawSyncStatus", operation: "query", summary: "Show whether a Passport-linked draw roster is in sync.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 } }, required: ["eventId"] } },
10545
10574
  { path: ["lucky-draw", "participants", "eligible"], procedure: "event.luckyDraw.getFilteredLuckyDrawParticipantsByEventId", operation: "query", summary: "List participants still eligible after domain/email filters and winners.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10546
10575
  { path: ["lucky-draw", "wheel", "participants"], procedure: "event.luckyDraw.getLuckyDrawWheelParticipantsByEventId", operation: "query", summary: "List the participants currently shown on the draw board.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10547
- { path: ["lucky-draw", "boards", "list"], procedure: "event.luckyDraw.getLuckyDrawItemsByEventId", operation: "query", summary: "List an event's lucky draw boards (paged).", effects: [], dates: [], input: {
10548
- type: "object",
10549
- properties: { eventId: { type: "string" }, name: { type: "string" }, note: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 10, type: "number", minimum: 1, maximum: 100 } },
10550
- required: ["eventId"]
10551
- } },
10576
+ { path: ["lucky-draw", "boards", "list"], procedure: "event.luckyDraw.getLuckyDrawItemsByEventId", operation: "query", summary: "List an event's lucky draw boards (paged).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, name: { type: "string" }, note: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 10, type: "number", minimum: 1, maximum: 100 } }, required: ["eventId"] } },
10552
10577
  { path: ["lucky-draw", "winners", "list"], procedure: "event.luckyDraw.getLuckyDrawPrizesWinnerByEventId", operation: "query", summary: "List prizes with their winners.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10553
10578
  { path: ["lucky-draw", "winners", "accept"], procedure: "event.luckyDraw.acceptWinner", operation: "mutation", summary: "Assign a prize to a drawn participant.", effects: ["state-change"], target: "winnerLuckyDrawParticipantId", dates: [], input: { type: "object", properties: { winnerLuckyDrawParticipantId: { type: "string" }, winnerLuckyDrawPrizeId: { type: "string" } }, required: ["winnerLuckyDrawParticipantId", "winnerLuckyDrawPrizeId"] } },
10554
10579
  { path: ["lucky-draw", "winners", "remove"], procedure: "event.luckyDraw.removeLuckyDrawPrize", operation: "mutation", summary: "Take the prize back from a winning participant.", effects: ["state-change"], target: "participantId", dates: [], input: { type: "object", properties: { participantId: { type: "string" } }, required: ["participantId"] } },
10555
- { path: ["lucky-draw", "participants", "delete"], procedure: "event.luckyDraw.deleteLuckyDrawParticipant", operation: "mutation", summary: "Permanently delete participants by ID. --target is the comma-joined ids.", effects: ["state-change", "delete"], target: "ids", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, ids: { type: "array", items: { type: "string" } } }, required: ["eventId", "ids"] } },
10580
+ { path: ["lucky-draw", "participants", "delete"], procedure: "event.luckyDraw.deleteLuckyDrawParticipant", operation: "mutation", summary: "Permanently delete participants by ID. --target is the comma-joined ids.", effects: ["state-change", "delete"], target: "ids", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, ids: { type: "array", items: { type: "string" } } }, required: [
10581
+ "eventId",
10582
+ "ids"
10583
+ ] } },
10556
10584
  { path: ["passport", "lucky-draws"], procedure: "event.passport.getAvailableLuckyDraws", operation: "query", summary: "List lucky draw events a Passport can link to.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 } }, required: ["eventId"] } },
10557
10585
  { path: ["passport", "operator-metadata"], procedure: "event.passport.getPassportOperatorMetadata", operation: "query", summary: "Get the staff operator view metadata (stations, prizes, permissions).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 } }, required: ["eventId"] } },
10558
10586
  { path: ["photo-wall", "items", "list"], procedure: "event.photoWall.getPhotoWallItemsByEventId", operation: "query", summary: "List Photo Wall photos (paged).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, name: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 5, type: "number", minimum: 1, maximum: 100 } }, required: ["eventId"] } },
10559
10587
  { path: ["photo-wall", "items", "archive"], procedure: "event.photoWall.archivePhotoWallItems", operation: "mutation", summary: "Archive Photo Wall photos by ID. --target is the comma-joined ids.", effects: ["state-change"], target: "ids", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, ids: { type: "array", items: { type: "string" } } }, required: ["eventId", "ids"] } },
10560
10588
  { path: ["photo-wall", "submissions", "list"], procedure: "event.photoWall.getPhotoWallSubmissionForApproval", operation: "query", summary: "List Photo Wall submissions for moderation (filter by state).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, state: { default: "PENDING", type: "string", enum: ["PENDING", "APPROVED", "REJECTED"] }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 6, type: "number", minimum: 1, maximum: 100 } }, required: ["eventId"] } },
10561
10589
  { path: ["photo-wall", "submissions", "respond"], procedure: "event.photoWall.respondToPhotoWallSubmission", operation: "mutation", summary: "Approve or reject a Photo Wall submission.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, id: { type: "string" }, status: { type: "string", enum: ["PENDING", "APPROVED", "REJECTED"] } }, required: ["eventId", "id", "status"] } },
10562
- { path: ["photo-wall", "display-link"], procedure: "event.photoWall.getPhotoWallDisplayLink", operation: "mutation", summary: "Get the Photo Wall display link, creating its access code on first use.", effects: ["state-change"], target: "eventId", dates: [], input: {
10563
- type: "object",
10564
- properties: { eventId: { type: "string", minLength: 1, maxLength: 128, pattern: "^[a-zA-Z0-9_-]+$" } },
10565
- required: ["eventId"]
10566
- } },
10590
+ { path: ["photo-wall", "display-link"], procedure: "event.photoWall.getPhotoWallDisplayLink", operation: "mutation", summary: "Get the Photo Wall display link, creating its access code on first use.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 128, pattern: "^[a-zA-Z0-9_-]+$" } }, required: ["eventId"] } },
10567
10591
  { path: ["post-it", "notes", "list"], procedure: "event.postItNote.getPostItNotesByEventId", operation: "query", summary: "List approved Post-it Notes (paged).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, name: { type: "string" }, note: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 10, type: "number", minimum: 1, maximum: 100 } }, required: ["eventId"] } },
10568
10592
  { path: ["post-it", "notes", "list-all"], procedure: "event.postItNote.getAllPostItNotesByEventId", operation: "query", summary: "List every Post-it Note for an event.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10569
- { path: ["post-it", "notes", "table"], procedure: "event.postItNote.getPostItNoteTable", operation: "query", summary: "List Post-it Notes in the admin table shape (paged).", effects: [], dates: [], input: { type: "object", properties: { eventId: {
10570
- type: "string"
10571
- }, name: { type: "string" }, note: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 10, type: "number", minimum: 1, maximum: 100 } }, required: ["eventId"] } },
10593
+ { path: ["post-it", "notes", "table"], procedure: "event.postItNote.getPostItNoteTable", operation: "query", summary: "List Post-it Notes in the admin table shape (paged).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, name: { type: "string" }, note: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 10, type: "number", minimum: 1, maximum: 100 } }, required: ["eventId"] } },
10572
10594
  { path: ["post-it", "notes", "archive"], procedure: "event.postItNote.archivePostItNotes", operation: "mutation", summary: "Archive Post-it Notes by ID. --target is the comma-joined ids.", effects: ["state-change"], target: "ids", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, ids: { type: "array", items: { type: "string" } } }, required: ["eventId", "ids"] } },
10573
- { path: ["post-it", "submissions", "list"], procedure: "event.postItNote.getPostItNoteSubmissionForApproval", operation: "query", summary: "List Post-it Note submissions for moderation.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, name: { type: "string" }, note: { type: "string" }, state: { type: "string", enum: ["PENDING", "APPROVED", "REJECTED"] }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 6, type: "number", minimum: 1, maximum: 100 } }, required: ["eventId"] } },
10595
+ { path: [
10596
+ "post-it",
10597
+ "submissions",
10598
+ "list"
10599
+ ], procedure: "event.postItNote.getPostItNoteSubmissionForApproval", operation: "query", summary: "List Post-it Note submissions for moderation.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, name: { type: "string" }, note: { type: "string" }, state: { type: "string", enum: ["PENDING", "APPROVED", "REJECTED"] }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 6, type: "number", minimum: 1, maximum: 100 } }, required: ["eventId"] } },
10574
10600
  { path: ["post-it", "submissions", "respond"], procedure: "event.postItNote.respondToPostItNoteSubmission", operation: "mutation", summary: "Approve or reject a Post-it Note submission.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, id: { type: "string" }, status: { type: "string", enum: ["PENDING", "APPROVED", "REJECTED"] } }, required: ["eventId", "id", "status"] } },
10575
10601
  { path: ["signature-wall", "config", "get"], procedure: "event.signatureWall.getSignatureWallByEventId", operation: "query", summary: "Get the Signature Wall config.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10576
10602
  { path: ["signature-wall", "config", "update"], procedure: "event.signatureWall.updateSignatureWallConfigs", operation: "mutation", summary: "Replace the Signature Wall config.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, config: { type: "object", properties: { backgroundColor: { type: "string" }, titleColor: { type: "string" }, titleFontSize: { type: "number" }, titleFont: { type: "string" }, title: { type: "string" }, cardBackgroundColor: { type: "string" }, cardBorderColor: { type: "string" }, nameColor: { type: "string" }, nameCardBackgroundColor: { type: "string" }, nameCardBorderColor: { type: "string" }, animationVideoKey: { type: ["string", "null"] }, signatureCounts: { type: "number" } }, required: ["backgroundColor", "titleColor", "titleFontSize", "titleFont", "title", "cardBackgroundColor", "cardBorderColor", "nameColor", "nameCardBackgroundColor", "nameCardBorderColor"] } }, required: ["even\
@@ -10579,82 +10605,74 @@ tId", "config"] } },
10579
10605
  { path: ["signature-wall", "signatures", "strokes"], procedure: "event.signatureWall.getSignatureStrokes", operation: "query", summary: "Get one signature's pen strokes (list rows omit them).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, signatureId: { type: "string" } }, required: ["eventId", "signatureId"] } },
10580
10606
  { path: ["signature-wall", "signatures", "archive"], procedure: "event.signatureWall.archiveSignatures", operation: "mutation", summary: "Archive signatures by ID. --target is the comma-joined ids.", effects: ["state-change"], target: "ids", dates: [], input: { type: "object", properties: { ids: { type: "array", items: { type: "string" } } }, required: ["ids"] } },
10581
10607
  { path: ["rating", "config", "get"], procedure: "event.ratingSystem.getRatingSystemByEventId", operation: "query", summary: "Get the Rating System config.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10582
- { path: ["rating", "config", "update"], procedure: "event.ratingSystem.updateRatingSystemConfig", operation: "mutation", summary: "Replace the Rating System config.", effects: [
10583
- "state-change"
10584
- ], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, config: { type: "object", properties: { mobileBackgroundImageKey: { type: ["string", "null"] } } } }, required: ["eventId", "config"] } },
10608
+ { path: ["rating", "config", "update"], procedure: "event.ratingSystem.updateRatingSystemConfig", operation: "mutation", summary: "Replace the Rating System config.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, config: { type: "object", properties: { mobileBackgroundImageKey: { type: ["string", "null"] } } } }, required: ["eventId", "config"] } },
10585
10609
  { path: ["rating", "background", "get"], procedure: "event.ratingSystem.getRatingSystemBackgroundByEventId", operation: "query", summary: "Get the Rating System background images.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10586
10610
  { path: ["rating", "subjects", "list"], procedure: "event.ratingSystem.getRatingSubjects", operation: "query", summary: "List rating subjects with their scores.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10587
10611
  { path: ["rating", "subjects", "create"], procedure: "event.ratingSystem.createRatingSubject", operation: "mutation", summary: "Create a rating subject.", effects: ["state-change"], target: "ratingSystemId", dates: [], input: { type: "object", properties: { ratingSystemId: { type: "string" }, name: { type: "string", minLength: 1 }, description: { type: ["string", "null"] }, order: { default: 0, type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, imageKey: { type: ["string", "null"] } }, required: ["ratingSystemId", "name"] } },
10588
10612
  { path: ["rating", "subjects", "update"], procedure: "event.ratingSystem.updateRatingSubject", operation: "mutation", summary: "Update a rating subject.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: { id: { type: "string" }, name: { type: "string", minLength: 1 }, description: { type: ["string", "null"] }, order: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, imageKey: { type: ["string", "null"] } }, required: ["id"] } },
10589
10613
  { path: ["rating", "subjects", "archive"], procedure: "event.ratingSystem.archiveRatingSubject", operation: "mutation", summary: "Archive a rating subject.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } },
10590
10614
  { path: ["human-bingo", "config", "get"], procedure: "event.humanBingo.getHumanBingoByEventId", operation: "query", summary: "Get the Human Bingo board and config.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10591
- { path: ["human-bingo", "config", "update"], procedure: "event.humanBingo.updateHumanBingoConfigs", operation: "mutation", summary: "Replace the Human Bingo config.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, config: { type: "object", properties: { textColor: { type: "string" }, titleFontSize: { type: "number" }, backgroundColor: { type: "string" }, backgroundImageKey: { type: ["string", "null"] }, nameCardTextColor: { type: "string" }, nameCardBackgroundColor: { type: "string" }, nameCardBorderColor: { type: "string" }, cardBackgroundColor: { type: "string" }, cardBorderColor: { type: "string" }, cardTextColor: { type: "string" }, numberOfParticipants: { type: "number" }, bingoCellDialogBackgroundColor: { type: "string" }, bingoCellDialogTextColor: { type: "string" }, bingoCellDialogButtonTextColor: { type: "string" }, bingoCellDialogButtonColor: { type: "string" }, bingoCellDialogUploadTextColor: { type: "\
10592
- string" }, bingoCellImageKey: { type: ["string", "null"] }, minRowsForBingo: { type: "number" }, infoTextColor: { type: "string" }, infoTextPosition: { type: "string" }, mobileBackgroundColor: { type: "string" }, mobileBackgroundImageKey: { type: ["string", "null"] }, loginTitle: { type: "string" }, loginDescription: { type: ["string", "null"] }, loginTitleColor: { type: "string" }, loginButtonColor: { type: "string" }, loginButtonTextColor: { type: "string" }, loginCardBackgroundColor: { type: "string" }, loginInputColor: { type: "string" }, leaderboardCardBackgroundColor: { type: "string" }, leaderboardCardTextColor: { type: "string" }, leaderboardBorderColor: { type: "string" } }, required: ["textColor", "titleFontSize", "backgroundColor", "nameCardTextColor", "nameCardBackgroundColor", "nameCardBorderColor", "cardBackgroundColor", "cardBorderColor", "cardTextColor", "numberOfParticipants", "bingoCellDialogBackgroundColor", "bingoCellDialogTextColor", "bingoCellDialogButtonTextColor",
10593
- "bingoCellDialogButtonColor", "bingoCellDialogUploadTextColor", "minRowsForBingo", "infoTextColor", "infoTextPosition", "mobileBackgroundColor", "loginTitle", "loginTitleColor", "loginButtonColor", "loginButtonTextColor", "loginCardBackgroundColor", "loginInputColor", "leaderboardCardBackgroundColor", "leaderboardCardTextColor", "leaderboardBorderColor"] } }, required: ["eventId", "config"] } },
10594
- { path: ["human-bingo", "background", "get"], procedure: "event.humanBingo.getHumanBingoBoardBackgroundByEventId", operation: "query", summary: "Get the Human Bingo board background images.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10615
+ { path: ["human-bingo", "config", "update"], procedure: "event.humanBingo.updateHumanBingoConfigs", operation: "mutation", summary: "Replace the Human Bingo config.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, config: { type: "object", properties: { textColor: { type: "string" }, titleFontSize: { type: "number" }, backgroundColor: {
10616
+ type: "string"
10617
+ }, backgroundImageKey: { type: ["string", "null"] }, nameCardTextColor: { type: "string" }, nameCardBackgroundColor: { type: "string" }, nameCardBorderColor: { type: "string" }, cardBackgroundColor: { type: "string" }, cardBorderColor: { type: "string" }, cardTextColor: { type: "string" }, numberOfParticipants: { type: "number" }, bingoCellDialogBackgroundColor: { type: "string" }, bingoCellDialogTextColor: { type: "string" }, bingoCellDialogButtonTextColor: { type: "string" }, bingoCellDialogButtonColor: { type: "string" }, bingoCellDialogUploadTextColor: { type: "string" }, bingoCellImageKey: { type: ["string", "null"] }, minRowsForBingo: { type: "number" }, infoTextColor: { type: "string" }, infoTextPosition: { type: "string" }, mobileBackgroundColor: { type: "string" }, mobileBackgroundImageKey: { type: ["string", "null"] }, loginTitle: { type: "string" }, loginDescription: { type: ["string", "null"] }, loginTitleColor: { type: "string" }, loginButtonColor: { type: "string" }, loginButtonTextColor: {
10618
+ type: "string" }, loginCardBackgroundColor: { type: "string" }, loginInputColor: { type: "string" }, leaderboardCardBackgroundColor: {
10619
+ type: "string"
10620
+ }, leaderboardCardTextColor: { type: "string" }, leaderboardBorderColor: { type: "string" } }, required: ["textColor", "titleFontSize", "backgroundColor", "nameCardTextColor", "nameCardBackgroundColor", "nameCardBorderColor", "cardBackgroundColor", "cardBorderColor", "cardTextColor", "numberOfParticipants", "bingoCellDialogBackgroundColor", "bingoCellDialogTextColor", "bingoCellDialogButtonTextColor", "bingoCellDialogButtonColor", "bingoCellDialogUploadTextColor", "minRowsForBingo", "infoTextColor", "infoTextPosition", "mobileBackgroundColor", "loginTitle", "loginTitleColor", "loginButtonColor", "loginButtonTextColor", "loginCardBackgroundColor", "loginInputColor", "leaderboardCardBackgroundColor", "leaderboardCardTextColor", "leaderboardBorderColor"] } }, required: ["eventId", "config"] } },
10621
+ { path: ["human-bingo", "background", "get"], procedure: "event.humanBingo.getHumanBingoBoardBackgroundByEventId", operation: "query", summary: "Get the Human Bingo board background images.", effects: [], dates: [], input: { type: "object", properties: {
10622
+ eventId: { type: "string" }
10623
+ }, required: ["eventId"] } },
10595
10624
  { path: ["human-bingo", "items", "list"], procedure: "event.humanBingo.admin.getHumanBingoItemsByEventId", operation: "query", summary: "List Human Bingo items.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, archiveStatus: { default: "active", type: "string", enum: ["active", "archived", "all"] } }, required: ["eventId"] } },
10596
- { path: [
10597
- "human-bingo",
10598
- "items",
10599
- "table"
10600
- ], procedure: "event.humanBingo.admin.getHumanBingoItemsTable", operation: "query", summary: "List Human Bingo items in the admin table shape (paged).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, name: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 10, type: "number", minimum: 1, maximum: 100 }, archiveStatus: { default: "active", type: "string", enum: ["active", "archived", "all"] } }, required: ["eventId"] } },
10625
+ { path: ["human-bingo", "items", "table"], procedure: "event.humanBingo.admin.getHumanBingoItemsTable", operation: "query", summary: "List Human Bingo items in the admin table shape (paged).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, name: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 10, type: "number", minimum: 1, maximum: 100 }, archiveStatus: { default: "active", type: "string", enum: ["active", "archived", "all"] } }, required: ["eventId"] } },
10601
10626
  { path: ["human-bingo", "items", "replace"], procedure: "event.humanBingo.admin.createHumanBingoItems", operation: "mutation", summary: "Replace every Human Bingo item: existing items are deleted first.", effects: ["state-change", "delete"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, items: { type: "array", items: { type: "object", properties: { name: { type: "string", minLength: 1, maxLength: 200 }, description: { type: "string", maxLength: 500 }, type: { default: "PHOTO_UPLOAD", type: "string", enum: ["SINGLE_SELECT", "TEXT_INPUT", "PHOTO_UPLOAD", "VIDEO_UPLOAD"] }, options: { default: [], maxItems: 20, type: "array", items: { type: "object", properties: { name: { type: "string", minLength: 1, maxLength: 100 }, isCorrect: { default: !1, type: "boolean" } }, required: ["name"] } }, correctAnswer: { type: "string", maxLength: 100 } }, required: ["name"] } } }, required: ["eventId", "items"] } },
10602
- { path: ["human-bingo", "items", "update"], procedure: "event.humanBingo.admin.editHumanBingoItems", operation: "mutation", summary: "Update one Human Bingo item.", effects: ["state-change"], target: "id", dates: [], input: {
10603
- type: "object",
10604
- properties: { name: { type: "string", minLength: 1, maxLength: 200 }, description: { type: "string", maxLength: 500 }, type: { default: "PHOTO_UPLOAD", type: "string", enum: ["SINGLE_SELECT", "TEXT_INPUT", "PHOTO_UPLOAD", "VIDEO_UPLOAD"] }, options: { default: [], maxItems: 20, type: "array", items: { type: "object", properties: { name: { type: "string", minLength: 1, maxLength: 100 }, isCorrect: { default: !1, type: "boolean" } }, required: ["name"] } }, correctAnswer: { type: "string", maxLength: 100 }, id: { type: "string", minLength: 1 } },
10605
- required: ["name", "id"]
10606
- } },
10627
+ { path: ["human-bingo", "items", "update"], procedure: "event.humanBingo.admin.editHumanBingoItems", operation: "mutation", summary: "Update one Human Bingo item.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: { name: { type: "string", minLength: 1, maxLength: 200 }, description: {
10628
+ type: "string",
10629
+ maxLength: 500
10630
+ }, type: { default: "PHOTO_UPLOAD", type: "string", enum: ["SINGLE_SELECT", "TEXT_INPUT", "PHOTO_UPLOAD", "VIDEO_UPLOAD"] }, options: { default: [], maxItems: 20, type: "array", items: { type: "object", properties: { name: { type: "string", minLength: 1, maxLength: 100 }, isCorrect: { default: !1, type: "boolean" } }, required: ["name"] } }, correctAnswer: { type: "string", maxLength: 100 }, id: { type: "string", minLength: 1 } }, required: ["name", "id"] } },
10607
10631
  { path: ["human-bingo", "items", "archive"], procedure: "event.humanBingo.admin.archiveHumanBingoItem", operation: "mutation", summary: "Archive one Human Bingo item.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } },
10608
- { path: ["human-bingo", "items", "archive-many"], procedure: "event.humanBingo.admin.archiveManyHumanBingoItems", operation: "mutation", summary: "Archive Human Bingo items by ID. --target is the comma-joined ids.", effects: ["state-change"], target: "ids", dates: [], input: { type: "object", properties: { ids: { type: "array", items: { type: "string" } } }, required: ["ids"] } },
10632
+ { path: ["human-bingo", "items", "archive-many"], procedure: "event.humanBingo.admin.archiveManyHumanBingoItems", operation: "mutation", summary: "Archive Human Bingo items by ID. --target is the comma-joined ids.", effects: ["state-change"], target: "ids", dates: [], input: { type: "object", properties: { ids: {
10633
+ type: "array",
10634
+ items: { type: "string" }
10635
+ } }, required: ["ids"] } },
10609
10636
  { path: ["human-bingo", "items", "restore"], procedure: "event.humanBingo.admin.restoreHumanBingoItem", operation: "mutation", summary: "Restore an archived Human Bingo item.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } },
10610
10637
  { path: ["human-bingo", "leaderboard"], procedure: "event.humanBingo.admin.getLeaderboard", operation: "query", summary: "Get the completed-card leaderboard (eventRoomId is the Human Bingo ID).", effects: [], dates: [], input: { type: "object", properties: { eventRoomId: { type: "string" } }, required: ["eventRoomId"] } },
10611
10638
  { path: ["human-bingo", "participants", "leaderboard"], procedure: "event.humanBingo.admin.getParticipantLeaderboard", operation: "query", summary: "Get the participant leaderboard.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
10612
10639
  { path: ["human-bingo", "participants", "list"], procedure: "event.humanBingo.admin.getParticipantsByEvent", operation: "query", summary: "List Human Bingo participants.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, archiveStatus: { default: "active", type: "string", enum: ["active", "archived", "all"] } }, required: ["eventId"] } },
10613
10640
  { path: ["human-bingo", "participants", "table"], procedure: "event.humanBingo.admin.getParticipantsTable", operation: "query", summary: "List Human Bingo participants in the admin table shape (paged).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, name: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 10, type: "number", minimum: 1, maximum: 100 }, archiveStatus: { default: "active", type: "string", enum: ["active", "archived", "all"] } }, required: ["eventId"] } },
10614
- { path: ["human-bingo", "participants", "card"], procedure: "event.humanBingo.admin.getParticipantBingoCard", operation: "query", summary: "Get one participant's bingo card.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, participantId: { type: "string" } }, required: ["eventId", "participantId"] } },
10641
+ { path: ["human-bingo", "participants", "card"], procedure: "event.humanBingo.admin.getParticipantBingoCard", operation: "query", summary: "Get one participant's bingo card.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, participantId: { type: "string" } }, required: [
10642
+ "eventId",
10643
+ "participantId"
10644
+ ] } },
10615
10645
  { path: ["human-bingo", "participants", "ban"], procedure: "event.humanBingo.admin.updateParticipantBanStatus", operation: "mutation", summary: "Ban or unban a participant.", effects: ["state-change"], target: "participantId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, participantId: { type: "string" }, banned: { type: "boolean" } }, required: ["eventId", "participantId", "banned"] } },
10616
10646
  { path: ["human-bingo", "participants", "archive"], procedure: "event.humanBingo.admin.archiveHumanBingoParticipants", operation: "mutation", summary: "Archive participants by ID. --target is the comma-joined ids.", effects: ["state-change"], target: "ids", dates: [], input: { type: "object", properties: { ids: { type: "array", items: { type: "string" } } }, required: ["ids"] } },
10617
10647
  { path: ["human-bingo", "participants", "restore"], procedure: "event.humanBingo.admin.restoreHumanBingoParticipants", operation: "mutation", summary: "Restore participants; cards that no longer match the board are deleted and rebuilt.", effects: ["state-change", "delete"], target: "ids", dates: [], input: { type: "object", properties: { ids: { type: "array", items: { type: "string" } } }, required: ["ids"] } },
10618
10648
  { path: ["human-bingo", "submissions", "list"], procedure: "event.humanBingo.admin.getSubmissions", operation: "query", summary: "List Human Bingo submissions (paged).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, page: { type: "number", minimum: 1 }, cursor: { type: "number", minimum: 1 }, perPage: { default: 6, type: "number", minimum: 1, maximum: 50 }, direction: { type: "string", enum: ["forward", "backward"] } }, required: ["eventId"] } },
10619
10649
  { path: ["human-bingo", "submissions", "pending"], procedure: "event.humanBingo.admin.getHumanBingoSubmissionsForApproval", operation: "query", summary: "List Human Bingo submissions for moderation (filter by state).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, page: { default: 1, type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, perPage: { default: 10, type: "integer", minimum: 1, maximum: 100 }, name: { type: "string" }, state: { default: "PENDING", type: "string", enum: ["PENDING", "APPROVED", "REJECTED"] } }, required: ["eventId"] } },
10620
- { path: ["human-bingo", "submissions", "respond"], procedure: "event.humanBingo.admin.respondToBingoCardItemSubmission", operation: "mutation", summary: "Approve or reject a Human Bingo card item submission.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: {
10621
- eventId: { type: "string" },
10622
- id: { type: "string" },
10623
- status: { type: "string", enum: ["PENDING", "APPROVED", "REJECTED"] },
10624
- bingoCardId: { type: "string" }
10625
- }, required: ["eventId", "id", "status", "bingoCardId"] } },
10626
- { path: ["staff-redemption", "setup", "get"], procedure: "event.staffRedemption.getStaffRedemptionSetup", operation: "query", summary: "Get the whole staff redemption setup: settings (including counterOrder, always resolved: FOOD_THEN_DRAW when never set, and the employee sign-in settings loginMethods, staffIdLabel and wrongSiteMessage, the two texts null while unset), employeeLogin.googleAvailable (whether Google sign-in can be turned on), missingPolicies and policiesLocked, sites (with crew access status), sessions, slots with setsIssued, item groups and items, prizes and prize stock. readiness lists what is still missing before counters can serve people (ready, and items of code plus short text); truncated is true when a list was cut at its cap. Archived rows are included with archivedAt; holds no personal data. Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId"], additionalProperties: !1 } },
10627
- { path: ["staff-redemption", "settings", "update"], procedure: "event.staffRedemption.updateStaffRedemptionSettings", operation: "mutation", summary: "Update eligibleShifts, itemRule, wrongSite, sessionRule, drawPolicy, fixedWinRatePercent, counterOrder and the employee sign-in settings loginMethods (emailOtp, google, guest, staffId, staffIdRequiresLastName; every method is off until turned on; google needs the server's Google sign-in), staffIdLabel (what the roster identifier is called, default 'Employee ID') and wrongSiteMessage (the warning both counters show for a person rostered at another site, max 300 characters); null or blank resets a text to its default. Omitted fields are unchanged. sessionRule is OWN_SHIFT (the default when unset: only during the person's own shift's session, from its sets and prizes) or ANY_OPEN_SESSION ('any open session: own shift's stock first'. A person rostered at the counter's site gets their set, from their session's (Singapore) day onwards whatev\
10628
- er the hour (on an earlier day they are served like a walk-in), from their own shift's slot there while it has sets left, else from the slot at the same site of the open session with the most sets left (NO_SETS_LEFT when none has), and always draws from their own shift's slot's prizes there; they are never refused NO_OPEN_SESSION. A walk-in rostered at another site (or none) is served only while a session is open (NO_OPEN_SESSION otherwise), from their own shift's slot at the counter's site while their session is open and it has sets left, else from the open session's slot there with the most sets left, and their spin is always no prize; works with either drawPolicy, and under REMAINING_HEADCOUNT a site's prizes are shared only over its own people). counterOrder is FOOD_THEN_DRAW (the default when never set) or DRAW_THEN_FOOD (the person spins first and the food is recorded afterwards); it is not a required policy (never in missingPolicies). Policies, sessionRule and counterOrder inclu\
10629
- ded, lock once a redemption exists (setup get shows policiesLocked): then a change needs overrideReason, recorded in the activity log. loginMethods, staffIdLabel and wrongSiteMessage are not policies: they never lock and never need overrideReason.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: {
10630
- eventId: { type: "string", minLength: 1, maxLength: 64 },
10631
- eligibleShifts: { minItems: 1, maxItems: 20, type: "array", items: { type: "string", minLength: 1, maxLength: 8 } },
10632
- itemRule: { type: "string", enum: ["ONE_FROM_EACH_GROUP", "AT_MOST_ONE_PER_GROUP", "AT_MOST_ONE_PER_GROUP_OR_NONE"] },
10633
- wrongSite: { type: "string", enum: ["REFUSE", "SERVE_FROM_COUNTER"] },
10634
- sessionRule: { type: "string", enum: ["OWN_SHIFT", "ANY_OPEN_SESSION"] },
10635
- drawPolicy: { type: "string", enum: ["REMAINING_HEADCOUNT", "FIXED_RATE"] },
10636
- fixedWinRatePercent: { type: "number", minimum: 0, maximum: 100 },
10637
- counterOrder: { type: "string", enum: ["FOOD_THEN_DRAW", "DRAW_THEN_FOOD"] },
10638
- loginMethods: { type: "object", properties: { emailOtp: { type: "boolean" }, google: { type: "boolean" }, guest: { type: "boolean" }, staffId: { default: !1, type: "boolean" }, staffIdRequiresLastName: { default: !0, type: "boolean" } }, required: ["emailOtp", "google", "guest"], additionalProperties: !1 },
10639
- staffIdLabel: { anyOf: [{ type: "null" }, { type: "string", maxLength: 40 }] },
10640
- wrongSiteMessage: { anyOf: [{ type: "null" }, { type: "string", maxLength: 300 }] },
10641
- overrideReason: { type: "string", minLength: 1, maxLength: 500 }
10642
- }, required: ["eventId"], additionalProperties: !1 } },
10643
- { path: ["staff-redemption", "site", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionSite", operation: "mutation", summary: "Create a site (omit siteId) or rename and reorder one (give siteId). Use staff-redemption archive set to archive or unarchive it.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: {
10650
+ { path: ["human-bingo", "submissions", "respond"], procedure: "event.humanBingo.admin.respondToBingoCardItemSubmission", operation: "mutation", summary: "Approve or reject a Human Bingo card item submission.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, id: { type: "string" }, status: { type: "string", enum: ["PENDING", "APPROVED", "REJECTED"] }, bingoCardId: { type: "string" } }, required: ["eventId", "id", "status", "bingoCardId"] } },
10651
+ { path: ["staff-redemption", "setup", "get"], procedure: "event.staffRedemption.getStaffRedemptionSetup", operation: "query", summary: "Get the whole staff redemption setup: settings (including counterOrder, always resolved: FOOD_THEN_DRAW when never set, walkInDraw, always resolved: NO_PRIZE when never set, and the employee sign-in settings loginMethods, staffIdLabel and wrongSiteMessage, the two texts null while unset), employeeLogin.googleAvailable (whether Google sign-in can be turned on), missingPolicies and policiesLocked, sites (with crew access status), sessions, slots with setsIssued, item groups and items, prizes and prize stock. readiness lists what is still missing before counters can serve people (ready, and items of code plus short text); truncated is true when a list was cut at its cap. Archived rows are included with archivedAt; holds no personal data. Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1,
10652
+ maxLength: 64 } }, required: ["eventId"], additionalProperties: !1 } },
10653
+ { path: ["staff-redemption", "settings", "update"], procedure: "event.staffRedemption.updateStaffRedemptionSettings", operation: "mutation", summary: "Update eligibleShifts, itemRule, wrongSite, sessionRule, drawPolicy, walkInDraw, fixedWinRatePercent, counterOrder and the employee sign-in settings loginMethods (emailOtp, google, guest, staffId, staffIdRequiresLastName; every method is off until turned on; google needs the server's Google sign-in), staffIdLabel (what the roster identifier is called, default 'Employee ID') and wrongSiteMessage (the warning both counters show for a person rostered at another site, max 300 characters); null or blank resets a text to its default. Omitted fields are unchanged. sessionRule is OWN_SHIFT (the default when unset: only during the person's own shift's session, from its sets and prizes) or ANY_OPEN_SESSION ('any open session: own shift's stock first'. A person rostered at the counter's site gets their set, from their session's (Singapore) day on\
10654
+ wards whatever the hour (on an earlier day they are served like a walk-in), from their own shift's slot there while it has sets left, else from the slot at the same site of the open session with the most sets left (NO_SETS_LEFT when none has), and always draws from their own shift's slot's prizes there; they are never refused NO_OPEN_SESSION. A walk-in rostered at another site (or none) is served only while a session is open (NO_OPEN_SESSION otherwise), from their own shift's slot at the counter's site while their session is open and it has sets left, else from the open session's slot there with the most sets left, and their spin is no prize unless walkInDraw is AT_COUNTER_SITE; works with either drawPolicy, and under REMAINING_HEADCOUNT a site's prizes are shared only over its own people). walkInDraw is NO_PRIZE (the default when unset) or AT_COUNTER_SITE: under ANY_OPEN_SESSION with wrongSite SERVE_FROM_COUNTER and drawPolicy REMAINING_HEADCOUNT, a walk-in draws from the prizes of th\
10655
+ e counter site's slot their set comes from, added to that slot's people (odds prizes left / (headcount + 1)), so each walk-in win is one fewer prize for that site's own people; ignored (no prize) under any other combination. counterOrder is FOOD_THEN_DRAW (the default when never set) or DRAW_THEN_FOOD (the person spins first and the food is recorded afterwards); it is not a required policy (never in missingPolicies). Policies, sessionRule, walkInDraw and counterOrder included, lock once a redemption exists (setup get shows policiesLocked): then a change needs overrideReason, recorded in the activity log. loginMethods, staffIdLabel and wrongSiteMessage are not policies: they never lock and never need overrideReason.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, eligibleShifts: { minItems: 1, maxItems: 20, type: "array", items: { type: "string", minLength: 1, maxLength: 8 } }, itemRule: {
10656
+ type: "string", enum: ["ONE_FROM_EACH_GROUP", "AT_MOST_ONE_PER_GROUP", "AT_MOST_ONE_PER_GROUP_OR_NONE"] }, wrongSite: { type: "string", enum: ["REFUSE", "SERVE_FROM_COUNTER"] }, sessionRule: { type: "string", enum: ["OWN_SHIFT", "ANY_OPEN_SESSION"] }, drawPolicy: { type: "string", enum: ["REMAINING_HEADCOUNT", "FIXED_RATE"] }, walkInDraw: { type: "string", enum: ["NO_PRIZE", "AT_COUNTER_SITE"] }, fixedWinRatePercent: { type: "number", minimum: 0, maximum: 100 }, counterOrder: {
10644
10657
  type: "string",
10645
- minLength: 1,
10646
- maxLength: 64
10647
- }, name: { type: "string", minLength: 1, maxLength: 120 }, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "name"], additionalProperties: !1 } },
10658
+ enum: ["FOOD_THEN_DRAW", "DRAW_THEN_FOOD"]
10659
+ }, loginMethods: { type: "object", properties: { emailOtp: { type: "boolean" }, google: { type: "boolean" }, guest: { type: "boolean" }, staffId: { default: !1, type: "boolean" }, staffIdRequiresLastName: { default: !0, type: "boolean" } }, required: ["emailOtp", "google", "guest"], additionalProperties: !1 }, staffIdLabel: { anyOf: [{ type: "null" }, { type: "string", maxLength: 40 }] }, wrongSiteMessage: { anyOf: [{ type: "null" }, { type: "string", maxLength: 300 }] }, overrideReason: { type: "string", minLength: 1, maxLength: 500 } }, required: ["eventId"], additionalProperties: !1 } },
10660
+ { path: ["staff-redemption", "site", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionSite", operation: "mutation", summary: "Create a site (omit siteId) or rename and reorder one (give siteId). Use staff-redemption archive set to archive or unarchive it.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: {
10661
+ eventId: { type: "string", minLength: 1, maxLength: 64 },
10662
+ siteId: { type: "string", minLength: 1, maxLength: 64 },
10663
+ name: { type: "string", minLength: 1, maxLength: 120 },
10664
+ order: { type: "integer", minimum: 0, maximum: 1e4 }
10665
+ }, required: ["eventId", "name"], additionalProperties: !1 } },
10648
10666
  { path: ["staff-redemption", "crew-password", "set"], procedure: "event.staffRedemption.setStaffRedemptionCrewPassword", operation: "mutation", summary: "Set a site's shared crew password (6-128 characters), which turns the site's crew link on. Ends every crew session at that site. Prefer --input-file over --input so the password stays out of shell history.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, password: { type: "string", minLength: 6, maxLength: 128 } }, required: ["eventId", "siteId", "password"], additionalProperties: !1 } },
10649
10667
  { path: ["staff-redemption", "crew-password", "clear"], procedure: "event.staffRedemption.clearStaffRedemptionCrewPassword", operation: "mutation", summary: "Clear a site's crew password, which turns its crew link off and ends every crew session at that site.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId", "siteId"], additionalProperties: !1 } },
10650
10668
  { path: ["staff-redemption", "session", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionSession", operation: "mutation", summary: "Create a session (omit sessionId) or update one: name, shift letter, and optional startsAt and endsAt (ISO date-times; null or omitted means the session is open whenever the event is). Each shift has one session; a session with redemptions or unreleased draws in its slots keeps its shift. Under sessionRule ANY_OPEN_SESSION the times decide which other sessions' stock counters may use: only sessions open now (started, or no startsAt, and not ended, or no endsAt). A person rostered at the counter's site uses their own shift's slot there from their session's (Singapore) day onwards, whatever the hour, (the set while it has sets left, prizes always), then the open session's slot there with the most sets left. A walk-in from another site gets a set only from sessions open now (their own shift's slot there while their session is open and it ha\
10651
10669
  s sets left, else the open session's slot with the most sets left; NO_OPEN_SESSION when none is open) and always spins for no prize. Set the times correctly.", effects: ["state-change"], target: "eventId", dates: ["startsAt", "endsAt"], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, sessionId: { type: "string", minLength: 1, maxLength: 64 }, name: { type: "string", minLength: 1, maxLength: 120 }, shift: { type: "string", minLength: 1, maxLength: 8 }, startsAt: { default: null, anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] }, endsAt: { default: null, anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] } }, required: ["eventId", "name", "shift"], additionalProperties: !1 } },
10652
- { path: [
10653
- "staff-redemption",
10654
- "slot",
10655
- "set"
10656
- ], procedure: "event.staffRedemption.setStaffRedemptionSlot", operation: "mutation", summary: "Set how many sets a site has for a session (setQuantity). It cannot go below the sets already issued.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, sessionId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, setQuantity: { type: "integer", minimum: 0, maximum: 1e5 } }, required: ["eventId", "sessionId", "siteId", "setQuantity"], additionalProperties: !1 } },
10657
- { path: ["staff-redemption", "item-group", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionItemGroup", operation: "mutation", summary: "Create an item group (omit groupId; a choice such as wrap or pancake) or rename and reorder one.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, groupId: { type: "string", minLength: 1, maxLength: 64 }, name: { type: "string", minLength: 1, maxLength: 120 }, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "name"], additionalProperties: !1 } },
10670
+ { path: ["staff-redemption", "slot", "set"], procedure: "event.staffRedemption.setStaffRedemptionSlot", operation: "mutation", summary: "Set how many sets a site has for a session (setQuantity). It cannot go below the sets already issued.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, sessionId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, setQuantity: { type: "integer", minimum: 0, maximum: 1e5 } }, required: ["eventId", "sessionId", "siteId", "setQuantity"], additionalProperties: !1 } },
10671
+ { path: ["staff-redemption", "item-group", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionItemGroup", operation: "mutation", summary: "Create an item group (omit groupId; a choice such as wrap or pancake) or rename and reorder one.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, groupId: { type: "string", minLength: 1, maxLength: 64 }, name: {
10672
+ type: "string",
10673
+ minLength: 1,
10674
+ maxLength: 120
10675
+ }, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "name"], additionalProperties: !1 } },
10658
10676
  { path: ["staff-redemption", "item", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionItem", operation: "mutation", summary: "Create an item in a group (omit itemId) or rename, reorder or move one to another groupId; past claims keep their group.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, itemId: { type: "string", minLength: 1, maxLength: 64 }, groupId: { type: "string", minLength: 1, maxLength: 64 }, name: { type: "string", minLength: 1, maxLength: 120 }, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "groupId", "name"], additionalProperties: !1 } },
10659
10677
  { path: ["staff-redemption", "prize", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionPrize", operation: "mutation", summary: "Create a prize (omit prizeId) or rename and reorder one. Stock is set per slot with staff-redemption prize-stock set.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, prizeId: { type: "string", minLength: 1, maxLength: 64 }, name: { type: "string", minLength: 1, maxLength: 120 }, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "name"], additionalProperties: !1 } },
10660
10678
  { path: ["staff-redemption", "prize-stock", "set"], procedure: "event.staffRedemption.setStaffRedemptionPrizeStock", operation: "mutation", summary: "Set a prize's stock for one slot (slotId from setup get). An optional reason is recorded; stock cannot go below the prizes already drawn there and not released.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, slotId: { type: "string", minLength: 1, maxLength: 64 }, prizeId: { type: "string", minLength: 1, maxLength: 64 }, quantity: { type: "integer", minimum: 0, maximum: 1e5 }, reason: { type: "string", minLength: 1, maxLength: 500 } }, required: ["eventId", "slotId", "prizeId", "quantity"], additionalProperties: !1 } },
@@ -10662,11 +10680,7 @@ s sets left, else the open session's slot with the most sets left; NO_OPEN_SESSI
10662
10680
  sion that receives them (id from setup get). Must differ from fromSessionId, belong to this event and not be archived." } }, required: ["eventId", "fromSessionId", "toSessionId"], additionalProperties: !1 } },
10663
10681
  { path: ["staff-redemption", "rollover", "run"], procedure: "event.staffRedemption.rolloverStaffRedemptionStock", operation: "mutation", summary: "Move the leftover sets (sets) and/or prizes (prizes), both default true, of every site from fromSessionId into toSessionId, with a required reason (1-300 characters) that is logged. The source keeps exactly what it issued, so it never drops below issued. Skipped sites come back with a reason; moved is false and nothing is written (no quantity, log entry or lock) when nothing would move. Undo it exactly with rollover undo (the result's rolloverId is the id); running it the other way is not an undo. Returns rolloverId, null when nothing moved. Not automatic: a manager runs it. Needs event.setup.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, fromSessionId: { type: "string", minLength: 1, maxLength: 64, description: "Session whose left\
10664
10682
  over sets and prizes move out (id from setup get). Must belong to this event and not be archived." }, toSessionId: { type: "string", minLength: 1, maxLength: 64, description: "Session that receives them (id from setup get). Must differ from fromSessionId, belong to this event and not be archived." }, sets: { default: !0, description: "Move the leftover sets (set quantity minus active, not voided, redemptions) of each site. Defaults to true.", type: "boolean" }, prizes: { default: !0, description: "Move the leftover prizes (stock minus prizes drawn and not released) of each site. Defaults to true.", type: "boolean" }, reason: { type: "string", minLength: 1, maxLength: 300, description: "Why the leftovers move (1 to 300 characters). Recorded in the activity log." } }, required: ["eventId", "fromSessionId", "toSessionId", "reason"], additionalProperties: !1 } },
10665
- { path: [
10666
- "staff-redemption",
10667
- "rollover",
10668
- "list"
10669
- ], procedure: "event.staffRedemption.getStaffRedemptionRollovers", operation: "query", summary: "List the event's rollovers, newest first (limit 1-50, default 20): id (use it for rollover undo), who ran it and when, reason, from and to sessions, totals, the sets and prizes moved per site, undoable, and undone (null, or who, when and why). total counts all of them. Needs event.setup.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, limit: { default: 20, description: "How many rollovers to return, newest first (1 to 50). Defaults to 20.", type: "integer", minimum: 1, maximum: 50 } }, required: ["eventId"], additionalProperties: !1 } },
10683
+ { path: ["staff-redemption", "rollover", "list"], procedure: "event.staffRedemption.getStaffRedemptionRollovers", operation: "query", summary: "List the event's rollovers, newest first (limit 1-50, default 20): id (use it for rollover undo), who ran it and when, reason, from and to sessions, totals, the sets and prizes moved per site, undoable, and undone (null, or who, when and why). total counts all of them. Needs event.setup.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, limit: { default: 20, description: "How many rollovers to return, newest first (1 to 50). Defaults to 20.", type: "integer", minimum: 1, maximum: 50 } }, required: ["eventId"], additionalProperties: !1 } },
10670
10684
  { path: ["staff-redemption", "rollover", "undo"], procedure: "event.staffRedemption.undoStaffRedemptionRollover", operation: "mutation", summary: "Undo one rollover exactly (rolloverId from rollover list), with a required reason (1-300 characters) that is logged: subtract exactly the sets and prizes it moved from the target session's slots and add them back to the source's, including a source left at 0 sets. The target's own sets and prizes are untouched. All or nothing: refused with CONFLICT, listing the sites and prizes, when a target site has since handed out or drawn part of what moved (it must still have the moved amount unissued), and with CONFLICT when already undone. A rolloverId of another event is NOT_FOUND. Does not check archived state: it restores exactly even if a session, site or prize was archived since. Redo or release voided target redemptions first, as an unreleased void's set counts as free. Recorded as its own activity entry. Needs event.setup.", effects: ["state\
10671
10685
  -change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, rolloverId: { type: "string", minLength: 1, maxLength: 64, description: "Id of the rollover to undo (id from rollover list). Must belong to this event and not be undone already." }, reason: {
10672
10686
  type: "string",
@@ -10689,38 +10703,36 @@ over sets and prizes move out (id from setup get). Must belong to this event and
10689
10703
  minLength: 1,
10690
10704
  maxLength: 64
10691
10705
  }, reason: { type: "string", minLength: 1, maxLength: 500 }, allowWhileClaimActive: { description: "Override: release the draw even though an active (not voided) redemption still shows it, for a redemption that stays recorded (for example a paper entry with no spin). Omit to refuse while any active redemption uses the draw.", type: "boolean" } }, required: ["eventId", "drawId", "reason"], additionalProperties: !1 } },
10692
- { path: ["staff-redemption", "stock", "summary"], procedure: "event.staffRedemption.getStaffRedemptionStockSummary", operation: "query", summary: "Show sets and prizes issued and left per site and session, with per-slot item counts (items), roster headcount and how many of them collected, walk-ins (walkIns: unreleased draws in the slot by people whose roster site or shift is not the slot's, leaving out no-prize draws by another shift, which are the placeholders recorded where a set came from when no prize slot could be used) and how many of them won (walkInPrizes; under ANY_OPEN_SESSION walk-ins from another site spin for no prize since 19 Nov 2026, so it only counts earlier draws there), plus event-wide item totals.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId"], additionalProperties: !1 } },
10706
+ { path: ["staff-redemption", "stock", "summary"], procedure: "event.staffRedemption.getStaffRedemptionStockSummary", operation: "query", summary: "Show sets and prizes issued and left per site and session, with per-slot item counts (items), roster headcount and how many of them collected, walk-ins (walkIns: unreleased draws in the slot by people whose roster site or shift is not the slot's, leaving out no-prize draws by another shift, which are the placeholders recorded where a set came from when no prize slot could be used) and how many of them won (walkInPrizes; under ANY_OPEN_SESSION walk-ins from another site spin for no prize since 19 Nov 2026 unless walkInDraw is AT_COUNTER_SITE, so otherwise it only counts earlier draws there), plus event-wide item totals.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId"], additionalProperties: !1 } },
10693
10707
  { path: ["staff-redemption", "counter", "context"], procedure: "event.staffRedemption.getStaffRedemptionCounterContext", operation: "query", summary: "Counter view for one site (siteId): the event (name, status, dates), counterOrder (FOOD_THEN_DRAW or DRAW_THEN_FOOD, the order crew follow), items to choose from, the site's sessions with sets and prizes left, and any missing policies. wrongSite is the policy for people rostered at another site (null while unset), wrongSiteMessage the warning to show for them and staffIdLabel what the roster identifier is called (defaults applied). sessionRule is the session policy; under ANY_OPEN_SESSION, openSessionIds are the sessions open now and openSessionChangesAt when that next changes (serverTime is the server clock at the read); openSession (the open session that started most recently) is informational only, as no single session serves everyone (a person rostered at the site uses their own shift's slot from that session's Singapore day onward\
10694
10708
  s, whatever the hour; walk-ins and people whose session is on a later day use only open sessions' stock). Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId", "siteId"], additionalProperties: !1 } },
10695
10709
  { path: ["staff-redemption", "lookup"], procedure: "event.staffRedemption.lookupStaffRedemptionEmployee", operation: "mutation", summary: "Look up an Employee ID (employeeId) or a scanned employee QR code (code, from the employee page; valid for ten minutes, refused with a message to refresh when expired or forged) at a site, giving exactly one of the two: who they are, the card's awayFromRosterSite and rosterSiteId (true when their roster site is not this site), what they already collected (a collected card's receipt carries itemsPending and itemsRecordedAt), their own shift's session (card.session, the only one whose prizes they can draw from), the session whose sets at this site a redemption would use now (card.setSession, with card.setsFromOtherSession true when it is not their own; both null and false on a card refused before sets are counted; card.slotSetsLeft is what is left in it), card.prizesHere (false when the spin here can only be no prize: no slot for their shift at this\
10696
- site, or under ANY_OPEN_SESSION they are rostered at another site or their own session is on a later Singapore day), card.heldDraw (their unreleased draw from an earlier, voided redemption, shown again instead of a new spin; null when the next redemption draws afresh), card.ownSessionTiming (ANY_OPEN_SESSION only: NOT_STARTED or ENDED when their own session is not open, a warning; a person rostered here whose session has started or is due that Singapore day still uses their own shift's sets and prizes, while a walk-in or a person whose session is on a later day gets an open session's set and a no-prize spin; null otherwise) and whether a redemption would go ahead (refusal code otherwise). Writes nothing and is not rate-limited, so it needs no confirmation flags. Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, employeeId: { type: "stri\
10697
- ng", minLength: 1, maxLength: 64 }, code: { description: "Employee QR code as scanned from the employee page. Give either employeeId or code.", type: "string", minLength: 1, maxLength: 512 } }, required: ["eventId", "siteId"], additionalProperties: !1 } },
10710
+ site, or under ANY_OPEN_SESSION they are rostered at another site or their own session is on a later Singapore day and walkInDraw is not AT_COUNTER_SITE), card.walkInPrizeDraw (true when such a walk-in draws from card.setSession's prizes at this site instead, walkInDraw AT_COUNTER_SITE), card.heldDraw (their unreleased draw from an earlier, voided redemption, shown again instead of a new spin; null when the next redemption draws afresh), card.ownSessionTiming (ANY_OPEN_SESSION only: NOT_STARTED or ENDED when their own session is not open, a warning; a person rostered here whose session has started or is due that Singapore day still uses their own shift's sets and prizes, while a walk-in or a person whose session is on a later day gets an open session's set and a no-prize spin; null otherwise) and whether a redemption would go ahead (refusal code otherwise). Writes nothing and is not rate-limited, so it needs no confirmation flags. Needs event.operate.", effects: [], dates: [], input: {
10711
+ type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, employeeId: { type: "string", minLength: 1, maxLength: 64 }, code: { description: "Employee QR code as scanned from the employee page. Give either employeeId or code.", type: "string", minLength: 1, maxLength: 512 } }, required: ["eventId", "siteId"], additionalProperties: !1 } },
10698
10712
  { path: ["staff-redemption", "redeem"], procedure: "event.staffRedemption.redeemStaffRedemption", operation: "mutation", summary: "Redeem for an Employee ID at a site: records the chosen itemIds and reveals the prize outcome the server decides in the same transaction. clientRequestId is a UUID you generate; retry with the same one and you get the stored receipt, never a second redemption. The set and the draw follow the event's sessionRule. Under ANY_OPEN_SESSION a person rostered at this site gets the set, from their session's (Singapore) day onwards whatever the hour (on an earlier day they are served like a walk-in), from their own shift's slot here while it has sets left, else the open session's slot here with the most sets left (receipt.session names it; NO_SETS_LEFT when none has), and always draws from their own shift's slot's prizes here; a walk-in rostered at another site is served only while a session is open (NO_OPEN_SESSION otherwise), from their own shift's slot here whi\
10699
10713
  le their session is open and it has sets left, else the open session's slot here with the most sets left, and always gets no prize. receipt.draw.slot is the slot, session and site the draw was made in (a reused draw keeps its own). When the event's counterOrder is DRAW_THEN_FOOD, itemIds must be [] (anything else is BAD_REQUEST): the claim, the set and the prize draw are recorded together and the receipt has itemsPending true until staff-redemption claims record-items. The item rule is not checked at the spin. Needs event.operate.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, employeeId: { type: "string", minLength: 1, maxLength: 64 }, clientRequestId: { type: "string", format: "uuid", pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|\
10700
10714
  ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array", items: { type: "string", minLength: 1, maxLength: 64 } } }, required: ["eventId", "siteId", "employeeId", "clientRequestId", "itemIds"], additionalProperties: !1 } },
10701
10715
  { path: ["staff-redemption", "claims", "record-items"], procedure: "event.staffRedemption.recordStaffRedemptionClaimItems", operation: "mutation", summary: "Record the food (itemIds, checked against the item rule) for a claim that was drawn first (itemsPending true, counterOrder DRAW_THEN_FOOD). siteId must be the claim's own site (claims list shows it). Writes the items, sets itemsPending false and itemsRecordedAt, and logs it; it deducts no set and makes no draw. Idempotent: the same items again return replayed true with the stored receipt. CONFLICT when different items were already recorded, when the claim is voided, or when the claim was food-first (nothing pending). Needs event.operate at that site (a manager has it). Returns status recorded, replayed and the receipt.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, claimId: {
10702
- type: "string", minLength: 1, maxLength: 64 }, itemIds: {
10703
- maxItems: 20,
10704
- type: "array",
10705
- items: { type: "string", minLength: 1, maxLength: 64 }
10706
- } }, required: ["eventId", "siteId", "claimId", "itemIds"], additionalProperties: !1 } },
10707
- { path: ["staff-redemption", "counter", "claims"], procedure: "event.staffRedemption.getStaffRedemptionCounterClaims", operation: "query", summary: "List a site's recent claims (limit 1-50, default 20) as the counter sees them. scope mine (default) is the claims you made at the site, site is every claim at the site. status all (default) includes every recent claim; items-pending selects active claims whose food is not recorded before applying the limit. Each receipt carries itemsPending and itemsRecordedAt. Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, limit: { default: 20, type: "integer", minimum: 1, maximum: 50 }, scope: { default: "mine", type: "string", enum: ["mine", "site"] }, status: { default: "all", type: "string", enum: ["all", "items-pending"] } }, required: [
10708
- "eventId",
10709
- "siteId"
10710
- ], additionalProperties: !1 } }
10716
+ type: "string", minLength: 1, maxLength: 64 }, itemIds: { maxItems: 20, type: "array", items: { type: "string", minLength: 1, maxLength: 64 } } }, required: ["eventId", "siteId", "claimId", "itemIds"], additionalProperties: !1 } },
10717
+ { path: ["staff-redemption", "device-issues", "list"], procedure: "event.staffRedemption.getStaffRedemptionDeviceIssues", operation: "query", summary: "List the problems the employee QR page reported, newest first, one cursor page per call (limit 1-100, default 50; cursor and direction forward from the previous pageInfo.nextCursor; optional kind filter; a cursor from other filters is rejected, so restart without it): returns { items, pageInfo: { hasNextPage, nextCursor } }. Each item has id, createdAt, kind (qr-not-visible, qr-render-failed, qr-refresh-failed, qr-expired, page-load-failed, device-problem or reload-tapped), problems found by the device check (offline, site-data-blocked, in-app-browser, forced-colors, forced-dark-mode, old-browser, data-saver, clock-wrong), detail, pageState, employeeId and employeeName when the browser was signed in as an employee, the device snapshot (browser, OS, screen, viewport, language, time zone, connection, clockOffsetMs and more), userAgent a\
10718
+ nd ipAddress. Totals are in device-issues counts. Holds names and device details; needs event.setup.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, kind: { type: "string", enum: ["qr-not-visible", "qr-render-failed", "qr-refresh-failed", "qr-expired", "page-load-failed", "device-problem", "reload-tapped"] }, limit: { default: 50, type: "integer", minimum: 1, maximum: 100 }, cursor: { anyOf: [{ type: "string", minLength: 1, maxLength: 8192 }, { type: "null" }] }, direction: { type: "string", const: "forward" } }, required: ["eventId"], additionalProperties: !1 } },
10719
+ { path: ["staff-redemption", "device-issues", "counts"], procedure: "event.staffRedemption.getStaffRedemptionDeviceIssueCounts", operation: "query", summary: "Count the employee QR page reports for the same optional kind filter as device-issues list: returns totalCount (follows the kind filter), allCount (every report of the event) and counts (reports per kind, never filtered). Needs event.setup.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, kind: { type: "string", enum: ["qr-not-visible", "qr-render-failed", "qr-refresh-failed", "qr-expired", "page-load-failed", "device-problem", "reload-tapped"] } }, required: ["eventId"], additionalProperties: !1 } },
10720
+ { path: ["staff-redemption", "counter", "claims"], procedure: "event.staffRedemption.getStaffRedemptionCounterClaims", operation: "query", summary: "List a site's recent claims (limit 1-50, default 20) as the counter sees them. scope mine (default) is the claims you made at the site, site is every claim at the site. status all (default) includes every recent claim; items-pending selects active claims whose food is not recorded before applying the limit. Each receipt carries itemsPending and itemsRecordedAt. Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, limit: { default: 20, type: "integer", minimum: 1, maximum: 50 }, scope: { default: "mine", type: "string", enum: ["mine", "site"] }, status: { default: "all", type: "string", enum: ["all", "items-pending"] } }, required: ["eventId", "siteId"], additionalProperties: !1 } }
10711
10721
  ], manifest = command_manifest_default, registryFlags = ["input", "input-file", "allow-state-change", "allow-delete", "allow-email", "target"], isoDateTimePattern = new __cliRegExp("^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d", ""), isRecord3 = __name2((value) => typeof value == "object" && value !== null && !Array.isArray(value), "isRecord3"), commandName = __name2((entry) => "et ".concat(entry.path.join(" ")), "commandName"), findManifestEntry = __name2((positionals) => manifest.find((entry) => entry.path.length === positionals.length && entry.path.every((segment, index) => positionals[index] === segment)), "findManifestEntry"), listRegistryCommands = __name2(() => manifest.map((entry) => ({ command: commandName(entry), summary: entry.summary, effects: entry.effects })), "listRegistryCommands"), coerceDateAt = __name2((value, segments, label) => {
10712
10722
  const [head, ...rest] = segments;
10713
10723
  if (head === void 0) {
10714
10724
  if (typeof value != "string") return value;
10715
10725
  const parsed = new Date(value);
10716
- if (!isoDateTimePattern.test(value) || Number.isNaN(parsed.getTime())) throw new CliUsageError(
10717
- "".concat(label, " must be an ISO 8601 date-time such as 2026-11-20T18:00:00+08:00.")
10718
- );
10726
+ if (!isoDateTimePattern.test(value) || Number.isNaN(parsed.getTime())) throw new CliUsageError("".concat(label, " must be an ISO 8601 date-time such as 2026-11-20T18:00:00+08:00."));
10719
10727
  return parsed;
10720
10728
  }
10721
10729
  const isArray = head.endsWith("[]"), key = isArray ? head.slice(0, -2) : head, apply = __name2((child) => isArray ? Array.isArray(child) ? child.map((item) => coerceDateAt(item, rest, label)) : child : coerceDateAt(child, rest, label), "apply");
10722
10730
  return key === "" ? apply(value) : !isRecord3(value) || !(key in value) ? value : { ...value, [key]: apply(value[key]) };
10723
- }, "coerceDateAt"), coerceDates = __name2((input, datePaths) => datePaths.reduce((current, path2) => coerceDateAt(current, path2 === "" ? [] : path2.split("."), path2 || "input"), input), "coerceDates"), readInput = __name2(async (parsed, entry) => {
10731
+ }, "coerceDateAt"), coerceDates = __name2((input, datePaths) => datePaths.reduce((current, path2) => coerceDateAt(
10732
+ current,
10733
+ path2 === "" ? [] : path2.split("."),
10734
+ path2 || "input"
10735
+ ), input), "coerceDates"), readInput = __name2(async (parsed, entry) => {
10724
10736
  const provided = parsed.flags.has("input") || parsed.flags.has("input-file");
10725
10737
  if (!entry.input) {
10726
10738
  if (provided) throw new CliUsageError("".concat(commandName(entry), " does not take --input."));
@@ -10750,19 +10762,16 @@ ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array
10750
10762
  const expected = targetText(isRecord3(input) ? input[entry.target] : void 0);
10751
10763
  if (expected === void 0) throw new CliUsageError("--input must include ".concat(entry.target, " so the target can be confirmed."));
10752
10764
  if (getOptionalFlag(parsed, "target") !== expected) throw new CliUsageError("--target must exactly match input.".concat(entry.target, " (").concat(expected, ")."));
10753
- }, "assertConfirmed"), describe2 = __name2((entry) => ({ command: commandName(entry), summary: entry.summary, procedure: entry.procedure, operation: entry.operation, effects: entry.effects, confirmation: entry.effects.length > 0 ? [...entry.effects.map((effect) => "--allow-".concat(effect)), ...entry.target ? ["--target <input.".concat(entry.target).concat(entry.target.endsWith("s") ? " joined with commas" : "", ">")] : []] : [], input: entry.input ? "--input '<json>' or --input-file <path> matching inputSchema" : "none", dateFields: entry.dates, inputSchema: entry.input }), "describe2"), resolveProcedureClient = __name2((procedure) => procedure.split(".").reduce((node2, segment) => node2[segment], api2), "resolveProcedureClient"), runRegistryCommand = __name2(
10754
- async (input) => {
10755
- const { parsed, runtime, authenticate } = input, entry = findManifestEntry(parsed.positionals);
10756
- if (!entry) return !1;
10757
- if (parsed.flags.has("help")) return assertOnlyFlags(parsed, ["help"]), writeSuccess(runtime, describe2(entry)), !0;
10758
- assertOnlyFlags(parsed, registryFlags);
10759
- const procedureInput = await readInput(parsed, entry);
10760
- assertConfirmed(parsed, entry, procedureInput), await authenticate();
10761
- const client = resolveProcedureClient(entry.procedure);
10762
- return writeSuccess(runtime, entry.operation === "query" ? await client.query(procedureInput) : await client.mutate(procedureInput)), !0;
10763
- },
10764
- "runRegistryCommand"
10765
- ), getInstalledCliVersion = __name2(() => {
10765
+ }, "assertConfirmed"), describe2 = __name2((entry) => ({ command: commandName(entry), summary: entry.summary, procedure: entry.procedure, operation: entry.operation, effects: entry.effects, confirmation: entry.effects.length > 0 ? [...entry.effects.map((effect) => "--allow-".concat(effect)), ...entry.target ? ["--target <input.".concat(entry.target).concat(entry.target.endsWith("s") ? " joined with commas" : "", ">")] : []] : [], input: entry.input ? "--input '<json>' or --input-file <path> matching inputSchema" : "none", dateFields: entry.dates, inputSchema: entry.input }), "describe2"), resolveProcedureClient = __name2((procedure) => procedure.split(".").reduce((node2, segment) => node2[segment], api2), "resolveProcedureClient"), runRegistryCommand = __name2(async (input) => {
10766
+ const { parsed, runtime, authenticate } = input, entry = findManifestEntry(parsed.positionals);
10767
+ if (!entry) return !1;
10768
+ if (parsed.flags.has("help")) return assertOnlyFlags(parsed, ["help"]), writeSuccess(runtime, describe2(entry)), !0;
10769
+ assertOnlyFlags(parsed, registryFlags);
10770
+ const procedureInput = await readInput(parsed, entry);
10771
+ assertConfirmed(parsed, entry, procedureInput), await authenticate();
10772
+ const client = resolveProcedureClient(entry.procedure);
10773
+ return writeSuccess(runtime, entry.operation === "query" ? await client.query(procedureInput) : await client.mutate(procedureInput)), !0;
10774
+ }, "runRegistryCommand"), getInstalledCliVersion = __name2(() => {
10766
10775
  try {
10767
10776
  const packageJson = JSON.parse(readFileSync(resolve(import.meta.dir, "../package.json"), "utf8"));
10768
10777
  return typeof packageJson.version == "string" ? packageJson.version : "unknown";
@@ -10797,7 +10806,9 @@ ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array
10797
10806
  return parsed;
10798
10807
  }, "parseRetainedIds"), luckyDrawParticipantFields = /* @__PURE__ */ new Set(["email", "luckyDrawId", "name"]), asParticipantRecord = __name2((participant, index) => {
10799
10808
  if (typeof participant != "object" || participant === null || Array.isArray(participant)) throw new CliUsageError("--participants[".concat(index, "] must be an object."));
10800
- if (Object.keys(participant).some((key) => !luckyDrawParticipantFields.has(key))) throw new CliUsageError("--participants[".concat(index, "] contains an unsupported field."));
10809
+ if (Object.keys(participant).some((key) => !luckyDrawParticipantFields.has(key))) throw new CliUsageError(
10810
+ "--participants[".concat(index, "] contains an unsupported field.")
10811
+ );
10801
10812
  return participant;
10802
10813
  }, "asParticipantRecord"), readParticipantField = __name2((participant, key) => key in participant ? participant[key] : void 0, "readParticipantField"), parseLuckyDrawParticipant = __name2((participant, index) => {
10803
10814
  const record = asParticipantRecord(participant, index), luckyDrawId = readParticipantField(record, "luckyDrawId"), name = readParticipantField(record, "name"), email3 = readParticipantField(record, "email");
@@ -10805,16 +10816,19 @@ ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array
10805
10816
  if (name !== void 0 && typeof name != "string") throw new CliUsageError("--participants[".concat(index, "].name must be a string."));
10806
10817
  if (email3 != null && typeof email3 != "string") throw new CliUsageError("--participants[".concat(index, "].email must be a string or null."));
10807
10818
  return { luckyDrawId, ...name === void 0 ? {} : { name }, ...email3 === void 0 ? {} : { email: email3 } };
10808
- }, "parseLuckyDrawParticipant"), parseLuckyDrawParticipants = __name2((value) => {
10809
- let parsed;
10810
- try {
10811
- parsed = JSON.parse(value);
10812
- } catch {
10813
- throw new CliUsageError("--participants must be valid JSON.");
10814
- }
10815
- if (!Array.isArray(parsed)) throw new CliUsageError("--participants must be a JSON array.");
10816
- return parsed.map(parseLuckyDrawParticipant);
10817
- }, "parseLuckyDrawParticipants"), parseAppearanceMediaType = __name2((value) => {
10819
+ }, "parseLuckyDrawParticipant"), parseLuckyDrawParticipants = __name2(
10820
+ (value) => {
10821
+ let parsed;
10822
+ try {
10823
+ parsed = JSON.parse(value);
10824
+ } catch {
10825
+ throw new CliUsageError("--participants must be valid JSON.");
10826
+ }
10827
+ if (!Array.isArray(parsed)) throw new CliUsageError("--participants must be a JSON array.");
10828
+ return parsed.map(parseLuckyDrawParticipant);
10829
+ },
10830
+ "parseLuckyDrawParticipants"
10831
+ ), parseAppearanceMediaType = __name2((value) => {
10818
10832
  if (value === "image" || value === "video") return value;
10819
10833
  throw new CliUsageError("--media-type must be one of: image, video.");
10820
10834
  }, "parseAppearanceMediaType"), eventStatuses = ["DRAFT", "ONGOING", "COMPLETED", "ALL"], archiveStatuses = ["active", "archived", "all"], parseEventListStatus = __name2((value) => {
@@ -10823,11 +10837,14 @@ ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array
10823
10837
  }, "parseEventListStatus"), parseArchiveStatus = __name2((value) => {
10824
10838
  if (!archiveStatuses.some((status) => status === value)) throw new CliUsageError("--archive-status must be one of: ".concat(archiveStatuses.join(", "), "."));
10825
10839
  return value;
10826
- }, "parseArchiveStatus"), parseCreatableEventType = __name2((value) => {
10827
- const result = activeEventTypeSchema.safeParse(value);
10828
- if (!result.success) throw new CliUsageError("--type must be one of: ".concat(activeEventTypeSchema.options.join(", "), "."));
10829
- return result.data;
10830
- }, "parseCreatableEventType"), parseEventTypeList = __name2((value) => {
10840
+ }, "parseArchiveStatus"), parseCreatableEventType = __name2(
10841
+ (value) => {
10842
+ const result = activeEventTypeSchema.safeParse(value);
10843
+ if (!result.success) throw new CliUsageError("--type must be one of: ".concat(activeEventTypeSchema.options.join(", "), "."));
10844
+ return result.data;
10845
+ },
10846
+ "parseCreatableEventType"
10847
+ ), parseEventTypeList = __name2((value) => {
10831
10848
  const types = value.split(",").map((type) => type.trim());
10832
10849
  return [...new Set(types)].map((type) => {
10833
10850
  const result = activeEventTypeSchema.safeParse(type);
@@ -10839,13 +10856,13 @@ ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array
10839
10856
  const parsed = new Date(value);
10840
10857
  if (Number.isNaN(parsed.getTime())) throw new CliUsageError("--".concat(name, " must be a valid date-time."));
10841
10858
  return parsed;
10842
- }, "parseIsoDateTime"), commandKey = __name2((action, subAction) => JSON.stringify([action ?? null, subAction ?? null]), "commandKey"), runAuthLogin = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl, cliVersion }) => {
10859
+ }, "parseIsoDateTime"), commandKey = __name2(
10860
+ (action, subAction) => JSON.stringify([action ?? null, subAction ?? null]),
10861
+ "commandKey"
10862
+ ), runAuthLogin = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl, cliVersion }) => {
10843
10863
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["no-browser"]);
10844
10864
  const credentials = await loginWithBrowser({ apiBaseUrl, clientVersion: cliVersion, onVerification: __name2(({ browserOpened, userCode, verificationUriComplete }) => {
10845
- runtime.stderr.write("".concat(browserOpened ? "Opened" : "Open", " ").concat(
10846
- verificationUriComplete,
10847
- "\nCode: "
10848
- ).concat(userCode, "\nWaiting for approval\u2026\n"));
10865
+ runtime.stderr.write("".concat(browserOpened ? "Opened" : "Open", " ").concat(verificationUriComplete, "\nCode: ").concat(userCode, "\nWaiting for approval\u2026\n"));
10849
10866
  }, "onVerification"), ...parsed.flags.get("no-browser") === !0 ? { openBrowser: __name2(async () => !1, "openBrowser") } : {}, store: credentialStore });
10850
10867
  writeSuccess(runtime, { authenticated: !0, session: credentials.session, storage: "Bun.secrets" });
10851
10868
  }, "runAuthLogin"), runAuthStatus = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl }) => {
@@ -10853,9 +10870,7 @@ ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array
10853
10870
  const credentials = await credentialStore.get();
10854
10871
  writeSuccess(runtime, credentials && isCliCredentialForIssuer(credentials, apiBaseUrl) ? { authenticated: !0, accessTokenExpiresAt: credentials.accessTokenExpiresAt, refreshTokenExpiresAt: credentials.refreshTokenExpiresAt, session: credentials.session, storage: "Bun.secrets" } : { authenticated: !1, storage: "Bun.secrets" });
10855
10872
  }, "runAuthStatus"), runAuthLogout = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl }) => {
10856
- assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), writeSuccess(runtime, { loggedOut: !0, ...await logoutCliSession(
10857
- { apiBaseUrl, store: credentialStore }
10858
- ) });
10873
+ assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), writeSuccess(runtime, { loggedOut: !0, ...await logoutCliSession({ apiBaseUrl, store: credentialStore }) });
10859
10874
  }, "runAuthLogout"), runAuthWhoami = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10860
10875
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), await ensureAuthentication(), writeSuccess(runtime, await api2.auth.whoami.query(void 0));
10861
10876
  }, "runAuthWhoami"), runOrganizationList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
@@ -10868,10 +10883,7 @@ ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array
10868
10883
  await ensureAuthentication(), writeSuccess(runtime, await api2.admin.organization.createOrganization.mutate(input));
10869
10884
  }, "runOrganizationCreate"), runEventCreate = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10870
10885
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["organization-id", "name", "type", "start", "end", "location"]);
10871
- const end = getOptionalFlag(parsed, "end"), input = { organizationId: getRequiredFlag(parsed, "organization-id"), name: getRequiredFlag(parsed, "name"), type: parseCreatableEventType(getRequiredFlag(parsed, "type")), location: getRequiredFlag(parsed, "location"), eventDateRange: { from: parseIsoDateTime(getRequiredFlag(parsed, "start"), "start"), ...end === void 0 ? {} : { to: parseIsoDateTime(
10872
- end,
10873
- "end"
10874
- ) } } };
10886
+ const end = getOptionalFlag(parsed, "end"), input = { organizationId: getRequiredFlag(parsed, "organization-id"), name: getRequiredFlag(parsed, "name"), type: parseCreatableEventType(getRequiredFlag(parsed, "type")), location: getRequiredFlag(parsed, "location"), eventDateRange: { from: parseIsoDateTime(getRequiredFlag(parsed, "start"), "start"), ...end === void 0 ? {} : { to: parseIsoDateTime(end, "end") } } };
10875
10887
  await ensureAuthentication(), writeSuccess(runtime, await api2.event.createEvent.mutate(input));
10876
10888
  }, "runEventCreate"), runEventList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10877
10889
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["organization-id", "page", "per-page", "name", "status", "archive-status"]);
@@ -10894,7 +10906,11 @@ ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array
10894
10906
  if (!reset && appearanceValue === void 0) throw new CliUsageError("--appearance is required unless --reset is provided.");
10895
10907
  const input = { eventId: getRequiredFlag(parsed, "event-id"), appearanceVersion: parseNonnegativeInteger(getRequiredFlag(parsed, "appearance-version"), "appearance-version"), appearance: reset ? null : parseAppearance(appearanceValue) };
10896
10908
  await ensureAuthentication(), writeSuccess(runtime, await api2.event.updateEventAppearance.mutate(input));
10897
- }, "runEventAppearanceUpdate"), runEventAppearanceUpload = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10909
+ }, "runEventAppearanceUpdate"), runEventAppearanceUpload = __name2(async ({
10910
+ parsed,
10911
+ runtime,
10912
+ ensureAuthentication
10913
+ }) => {
10898
10914
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "file", "content-type", "media-type"]);
10899
10915
  const eventId = getRequiredFlag(parsed, "event-id"), filePath = getRequiredFlag(parsed, "file"), contentType = getRequiredFlag(parsed, "content-type"), mediaType = parseAppearanceMediaType(getRequiredFlag(parsed, "media-type")), file = await readFile7(filePath);
10900
10916
  await ensureAuthentication();
@@ -10902,14 +10918,20 @@ ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array
10902
10918
  if (!uploadResponse.ok) throw new Error("Appearance media upload failed with HTTP ".concat(uploadResponse.status, "."));
10903
10919
  writeSuccess(runtime, signed);
10904
10920
  }, "runEventAppearanceUpload"), runPhotoWallDisplayItems = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10905
- assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "limit", "cursor", "retained-ids"]);
10921
+ assertPositionalCount(
10922
+ parsed,
10923
+ 3
10924
+ ), assertOnlyFlags(parsed, ["event-id", "limit", "cursor", "retained-ids"]);
10906
10925
  const cursorValue = getOptionalFlag(parsed, "cursor"), retainedIdsValue = getOptionalFlag(parsed, "retained-ids"), input = { eventId: getRequiredFlag(parsed, "event-id"), limit: parseBoundedInteger(getOptionalFlag(parsed, "limit") ?? "30", "limit", 1, 60), ...cursorValue === void 0 ? {} : { cursor: parseCursor(cursorValue) }, retainedIds: retainedIdsValue === void 0 ? [] : parseRetainedIds(retainedIdsValue) };
10907
10926
  await ensureAuthentication(), writeSuccess(runtime, await api2.event.photoWall.getPhotoWallDisplayItems.query(input));
10908
- }, "runPhotoWallDisplayItems"), runLuckyDrawPreDraw = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10909
- assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["event-id", "prize-count"]);
10910
- const input = { eventId: getRequiredFlag(parsed, "event-id"), prizeCount: parsePositiveInteger(getRequiredFlag(parsed, "prize-count"), "prize-count") };
10911
- await ensureAuthentication(), writeSuccess(runtime, await api2.event.luckyDraw.preDrawPrizes.mutate(input));
10912
- }, "runLuckyDrawPreDraw"), runLuckyDrawParticipantsReplace = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10927
+ }, "runPhotoWallDisplayItems"), runLuckyDrawPreDraw = __name2(
10928
+ async ({ parsed, runtime, ensureAuthentication }) => {
10929
+ assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["event-id", "prize-count"]);
10930
+ const input = { eventId: getRequiredFlag(parsed, "event-id"), prizeCount: parsePositiveInteger(getRequiredFlag(parsed, "prize-count"), "prize-count") };
10931
+ await ensureAuthentication(), writeSuccess(runtime, await api2.event.luckyDraw.preDrawPrizes.mutate(input));
10932
+ },
10933
+ "runLuckyDrawPreDraw"
10934
+ ), runLuckyDrawParticipantsReplace = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10913
10935
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "participants", "participants-file", "allow-state-change", "target"]);
10914
10936
  const eventId = getRequiredFlag(parsed, "event-id");
10915
10937
  assertStateChangeTarget(parsed, eventId);
@@ -10919,13 +10941,10 @@ ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array
10919
10941
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "page", "per-page"]);
10920
10942
  const input = { eventId: getRequiredFlag(parsed, "event-id"), page: parsePositiveInteger(getOptionalFlag(parsed, "page") ?? "1", "page"), perPage: parseBoundedInteger(getOptionalFlag(parsed, "per-page") ?? "100", "per-page", 1, 100) };
10921
10943
  await ensureAuthentication(), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawParticipantsByEventId.query(input));
10922
- }, "runLuckyDrawParticipantsList"), organizationCommands = /* @__PURE__ */ new Map([[commandKey("list"), runOrganizationList], [commandKey("get"), runOrganizationGet], [commandKey("create"), runOrganizationCreate]]), commandTable = /* @__PURE__ */ new Map([
10923
- ["auth", /* @__PURE__ */ new Map([[commandKey("login"), runAuthLogin], [commandKey("status"), runAuthStatus], [commandKey("logout"), runAuthLogout], [commandKey("whoami"), runAuthWhoami]])],
10924
- ["organization", organizationCommands],
10925
- ["org", organizationCommands],
10926
- ["event", /* @__PURE__ */ new Map([[commandKey("create"), runEventCreate], [commandKey("list"), runEventList], [commandKey("get"), runEventGet], [commandKey("appearance", "get"), runEventAppearanceGet], [commandKey("appearance", "update"), runEventAppearanceUpdate], [commandKey("appearance", "reset"), runEventAppearanceUpdate], [commandKey("appearance", "upload"), runEventAppearanceUpload], [commandKey("photo-wall", "display-items"), runPhotoWallDisplayItems], [commandKey("photo-wall", "display"), runPhotoWallDisplayItems]])],
10927
- ["lucky-draw", /* @__PURE__ */ new Map([[commandKey("pre-draw"), runLuckyDrawPreDraw], [commandKey("participants", "replace"), runLuckyDrawParticipantsReplace], [commandKey("participants", "list"), runLuckyDrawParticipantsList]])]
10928
- ]), runCommand = __name2(async (parsed, runtime, credentialStore, apiBaseUrl, configureAccessToken) => {
10944
+ }, "runLuckyDrawParticipantsList"), organizationCommands = /* @__PURE__ */ new Map([[commandKey("list"), runOrganizationList], [commandKey("get"), runOrganizationGet], [commandKey("create"), runOrganizationCreate]]), commandTable = /* @__PURE__ */ new Map([["auth", /* @__PURE__ */ new Map([[commandKey("login"), runAuthLogin], [commandKey("status"), runAuthStatus], [commandKey("logout"), runAuthLogout], [commandKey("whoami"), runAuthWhoami]])], ["organization", organizationCommands], ["org", organizationCommands], ["event", /* @__PURE__ */ new Map([[commandKey("create"), runEventCreate], [commandKey("list"), runEventList], [commandKey("get"), runEventGet], [commandKey("appearance", "get"), runEventAppearanceGet], [commandKey("appearance", "update"), runEventAppearanceUpdate], [commandKey("appearance", "reset"), runEventAppearanceUpdate], [commandKey("appearance", "upload"), runEventAppearanceUpload], [commandKey("photo-wall", "display-items"), runPhotoWallDisplayItems], [commandKey(
10945
+ "photo-wall",
10946
+ "display"
10947
+ ), runPhotoWallDisplayItems]])], ["lucky-draw", /* @__PURE__ */ new Map([[commandKey("pre-draw"), runLuckyDrawPreDraw], [commandKey("participants", "replace"), runLuckyDrawParticipantsReplace], [commandKey("participants", "list"), runLuckyDrawParticipantsList]])]]), runCommand = __name2(async (parsed, runtime, credentialStore, apiBaseUrl, configureAccessToken) => {
10929
10948
  const [group, action, subAction] = parsed.positionals, cliVersion = getInstalledCliVersion();
10930
10949
  let accessToken;
10931
10950
  const ensureAuthentication = __name2(async () => {