@go-labs-sg/event-tech 1.28.1 → 1.29.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 but failed-lookup throttle records). 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 \
9338
- 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, 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 wheelSeg\
9339
- mentFontSize, 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 \
9340
- 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/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-s\
9341
- tock/\n archive/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_TEC\
9342
- H_API_URL defaults 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 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, ".");
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({
@@ -10624,8 +10624,9 @@ string" }, bingoCellImageKey: { type: ["string", "null"] }, minRowsForBingo: { t
10624
10624
  bingoCardId: { type: "string" }
10625
10625
  }, required: ["eventId", "id", "status", "bingoCardId"] } },
10626
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) or ANY_OPEN_SESSION (whichever session is open now, from that session's sets and prizes; works with either drawPolicy, and under REMAINING_HEADCOUNT a walk-in from another shift or site draws from th\
10628
- e open session's prizes as one extra person, so heavy walk-in traffic can use up prizes before that session's last arrivals). 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 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: {
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: {
10629
10630
  eventId: { type: "string", minLength: 1, maxLength: 64 },
10630
10631
  eligibleShifts: { minItems: 1, maxItems: 20, type: "array", items: { type: "string", minLength: 1, maxLength: 8 } },
10631
10632
  itemRule: { type: "string", enum: ["ONE_FROM_EACH_GROUP", "AT_MOST_ONE_PER_GROUP", "AT_MOST_ONE_PER_GROUP_OR_NONE"] },
@@ -10639,89 +10640,90 @@ e open session's prizes as one extra person, so heavy walk-in traffic can use up
10639
10640
  wrongSiteMessage: { anyOf: [{ type: "null" }, { type: "string", maxLength: 300 }] },
10640
10641
  overrideReason: { type: "string", minLength: 1, maxLength: 500 }
10641
10642
  }, required: ["eventId"], additionalProperties: !1 } },
10642
- { 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: { 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 } },
10643
- { 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: {
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: {
10644
10644
  type: "string",
10645
10645
  minLength: 1,
10646
10646
  maxLength: 64
10647
- }, siteId: { type: "string", minLength: 1, maxLength: 64 }, password: { type: "string", minLength: 6, maxLength: 128 } }, required: ["eventId", "siteId", "password"], additionalProperties: !1 } },
10647
+ }, name: { type: "string", minLength: 1, maxLength: 120 }, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "name"], additionalProperties: !1 } },
10648
+ { 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 } },
10648
10649
  { 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 } },
10649
- { 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 keeps its shift. Under sessionRule ANY_OPEN_SESSION, counters serve everyone from the open session that started most recently, so a session with no endsAt is used until a later one starts.", 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" },
10650
- { type: "null" }] }, endsAt: { default: null, anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] } }, required: ["eventId", "name", "shift"], additionalProperties: !1 } },
10651
- { 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 } },
10650
+ { 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
+ 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 } },
10652
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 } },
10653
10658
  { 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 } },
10654
- { 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: {
10655
- eventId: { type: "string", minLength: 1, maxLength: 64 },
10656
- prizeId: { type: "string", minLength: 1, maxLength: 64 },
10657
- name: { type: "string", minLength: 1, maxLength: 120 },
10658
- order: { type: "integer", minimum: 0, maximum: 1e4 }
10659
- }, required: ["eventId", "name"], additionalProperties: !1 } },
10659
+ { 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
10660
  { 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 } },
10661
10661
  { path: ["staff-redemption", "rollover", "preview"], procedure: "event.staffRedemption.getStaffRedemptionRolloverPreview", operation: "query", summary: "Preview rolling leftovers from fromSessionId into toSessionId, per site: sets left (set quantity minus active, not voided, redemptions) and prizes left (stock minus prizes drawn and not released) in the source, what would move and the target afterwards. A site is skipped, with a reason, unless the target session already has a slot there with sets (a rollover never creates a slot). Advisory; rollover run recomputes under lock. Needs event.setup.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, fromSessionId: { type: "string", minLength: 1, maxLength: 64, description: "Session whose leftover 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: "Ses\
10662
10662
  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
10663
  { 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
10664
  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: ["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 } },
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 } },
10666
10670
  { 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\
10667
- -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: { type: "string", minLength: 1, maxLength: 300, description: "Why the rollover is undone (1 to 300 characters). Recorded in the activity log." } }, required: ["eventId", "rolloverId", "reason"], additionalProperties: !1 } },
10671
+ -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
+ type: "string",
10673
+ minLength: 1,
10674
+ maxLength: 300,
10675
+ description: "Why the rollover is undone (1 to 300 characters). Recorded in the activity log."
10676
+ } }, required: ["eventId", "rolloverId", "reason"], additionalProperties: !1 } },
10668
10677
  { path: ["staff-redemption", "archive", "set"], procedure: "event.staffRedemption.setStaffRedemptionArchived", operation: "mutation", summary: "Archive (archived true) or unarchive (archived false) a site, session, itemGroup, item, prize or rosterEntry by entity and id. Setup get and roster list show the current state.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, entity: { type: "string", enum: ["site", "session", "itemGroup", "item", "prize", "rosterEntry"] }, id: { type: "string", minLength: 1, maxLength: 64 }, archived: { type: "boolean" } }, required: ["eventId", "entity", "id", "archived"], additionalProperties: !1 } },
10669
10678
  { path: ["staff-redemption", "roster", "list"], procedure: "event.staffRedemption.getStaffRedemptionRoster", operation: "query", summary: "List roster entries (cursor paged); filter by search, siteId, shift, archived (active, archived, all) and collected (any, collected, not-collected).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, shift: { type: "string", minLength: 1, maxLength: 8 }, archived: { default: "active", type: "string", enum: ["active", "archived", "all"] }, collected: { default: "any", type: "string", enum: ["any", "collected", "not-collected"] }, limit: { default: 25, 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 } },
10670
- { path: ["staff-redemption", "roster", "counts"], procedure: "event.staffRedemption.getStaffRedemptionRosterCounts", operation: "query", summary: "Count roster entries matching the same filters as roster list.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, shift: { type: "string", minLength: 1, maxLength: 8 }, archived: {
10671
- default: "active",
10672
- type: "string",
10673
- enum: ["active", "archived", "all"]
10674
- }, collected: { default: "any", type: "string", enum: ["any", "collected", "not-collected"] } }, required: ["eventId"], additionalProperties: !1 } },
10675
- { path: ["staff-redemption", "roster", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionRosterEntry", operation: "mutation", summary: "Add or update one roster entry by employeeId (name, siteName, shift and workShift are required and can be null; allowance is optional). The site is matched by name, and allowance cannot go below the sets the person already collected. The archived state is unchanged (use staff-redemption archive set).", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, employeeId: { type: "string", minLength: 1, maxLength: 64 }, name: { anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }] }, siteName: { anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }] }, shift: { anyOf: [{ type: "string", minLength: 1, maxLength: 8 }, { type: "null" }] }, workShift: {
10679
+ { path: ["staff-redemption", "roster", "counts"], procedure: "event.staffRedemption.getStaffRedemptionRosterCounts", operation: "query", summary: "Count roster entries matching the same filters as roster list.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, shift: { type: "string", minLength: 1, maxLength: 8 }, archived: { default: "active", type: "string", enum: ["active", "archived", "all"] }, collected: { default: "any", type: "string", enum: ["any", "collected", "not-collected"] } }, required: ["eventId"], additionalProperties: !1 } },
10680
+ { path: ["staff-redemption", "roster", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionRosterEntry", operation: "mutation", summary: "Add or update one roster entry by employeeId (name, siteName, shift and workShift are required and can be null; allowance is optional). The site is matched by name, and allowance cannot go below the sets the person already collected. The archived state is unchanged (use staff-redemption archive set).", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, employeeId: { type: "string", minLength: 1, maxLength: 64 }, name: {
10676
10681
  anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }]
10677
- }, allowance: { type: "integer", minimum: 0, maximum: 20 } }, required: ["eventId", "employeeId", "name", "siteName", "shift", "workShift"], additionalProperties: !1 } },
10678
- { path: ["staff-redemption", "claims", "list"], procedure: "event.staffRedemption.getStaffRedemptionClaims", operation: "query", summary: "List redemption claims, newest first (cursor paged), with items (with groupName), draw outcome, site, awayFromRosterSite (served at a site other than the roster site), session and void state; each row also has itemsPending (true while the prize was drawn but the food is not recorded yet) and itemsRecordedAt; filter by search, siteId, sessionId and status (active, items-pending, voided, all). items-pending is active claims that still wait for their food.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, sessionId: {
10682
+ }, siteName: { anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }] }, shift: { anyOf: [{ type: "string", minLength: 1, maxLength: 8 }, { type: "null" }] }, workShift: { anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }] }, allowance: { type: "integer", minimum: 0, maximum: 20 } }, required: ["eventId", "employeeId", "name", "siteName", "shift", "workShift"], additionalProperties: !1 } },
10683
+ { path: ["staff-redemption", "claims", "list"], procedure: "event.staffRedemption.getStaffRedemptionClaims", operation: "query", summary: "List redemption claims, newest first (cursor paged), with items (with groupName), draw outcome (draw.slot is the site and session the draw was made in, where a released prize returns; it can differ from the claim's when the set came from another session or the draw was reused), site, awayFromRosterSite (served at a site other than the roster site), session and void state; each row also has itemsPending (true while the prize was drawn but the food is not recorded yet) and itemsRecordedAt; filter by search, siteId, sessionId and status (active, items-pending, voided, all). items-pending is active claims that still wait for their food.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 },
10684
+ sessionId: { type: "string", minLength: 1, maxLength: 64 }, status: { default: "all", type: "string", enum: ["active", "items-pending", "voided", "all"] }, limit: { default: 25, 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 } },
10685
+ { path: ["staff-redemption", "claims", "counts"], procedure: "event.staffRedemption.getStaffRedemptionClaimCounts", operation: "query", summary: "Count claims matching the same filters as claims list : returns totalCount (all filters, status included), then activeCount, itemsPendingCount (active claims whose food is not recorded yet) and voidedCount, which ignore the status filter.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, sessionId: { type: "string", minLength: 1, maxLength: 64 }, status: { default: "all", type: "string", enum: ["active", "items-pending", "voided", "all"] } }, required: ["eventId"], additionalProperties: !1 } },
10686
+ { path: ["staff-redemption", "claims", "void"], procedure: "event.staffRedemption.voidStaffRedemptionClaim", operation: "mutation", summary: "Void a claim with a reason (a claim still waiting for its food too). The set returns to the person and the slot; the prize draw is kept, so a redo shows the same outcome (even a draw made in another slot or a no-prize draw) until staff-redemption draw release. Claims list shows each draw's activeClaimCount.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, claimId: { type: "string", minLength: 1, maxLength: 64 }, reason: { type: "string", minLength: 1, maxLength: 500 } }, required: ["eventId", "claimId", "reason"], additionalProperties: !1 } },
10687
+ { path: ["staff-redemption", "draw", "release"], procedure: "event.staffRedemption.releaseStaffRedemptionDraw", operation: "mutation", summary: "Release a person's prize draw (draw.id from claims list) with a reason: a won prize returns to the stock of the slot it was drawn in (claims list draw.slot) and the person draws again on their next redemption. Refused (CONFLICT) while an active, not voided redemption still shows the draw (claims list draw.activeClaimCount > 0); void it first, or pass the explicit override allowWhileClaimActive: true to release a prize while its redemption stays recorded (for example a paper entry). The override is recorded in the activity log.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, drawId: {
10679
10688
  type: "string",
10680
10689
  minLength: 1,
10681
10690
  maxLength: 64
10682
- }, status: { default: "all", type: "string", enum: ["active", "items-pending", "voided", "all"] }, limit: { default: 25, 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 } },
10683
- { path: ["staff-redemption", "claims", "counts"], procedure: "event.staffRedemption.getStaffRedemptionClaimCounts", operation: "query", summary: "Count claims matching the same filters as claims list : returns totalCount (all filters, status included), then activeCount, itemsPendingCount (active claims whose food is not recorded yet) and voidedCount, which ignore the status filter.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, sessionId: { type: "string", minLength: 1, maxLength: 64 }, status: { default: "all", type: "string", enum: ["active", "items-pending", "voided", "all"] } }, required: ["eventId"], additionalProperties: !1 } },
10684
- { path: ["staff-redemption", "claims", "void"], procedure: "event.staffRedemption.voidStaffRedemptionClaim", operation: "mutation", summary: "Void a claim with a reason (a claim still waiting for its food too). The set returns to the person and the slot; the prize draw is kept, so a redo shows the same outcome until staff-redemption draw release. Claims list shows each draw's activeClaimCount.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, claimId: { type: "string", minLength: 1, maxLength: 64 }, reason: { type: "string", minLength: 1, maxLength: 500 } }, required: ["eventId", "claimId", "reason"], additionalProperties: !1 } },
10685
- { path: ["staff-redemption", "draw", "release"], procedure: "event.staffRedemption.releaseStaffRedemptionDraw", operation: "mutation", summary: "Release a person's prize draw (draw.id from claims list) with a reason: a won prize returns to its slot's stock and the person draws again on their next redemption. Refused (CONFLICT) while an active, not voided redemption still shows the draw (claims list draw.activeClaimCount > 0); void it first, or pass the explicit override allowWhileClaimActive: true to release a prize while its redemption stays recorded (for example a paper entry). The override is recorded in the activity log.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, drawId: { type: "string", minLength: 1, maxLength: 64 }, reason: { type: "string", minLength: 1, maxLength: 500 }, allowWhileClaimActive: { description: "Override: release the draw even though an active (not v\
10686
- oided) 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 } },
10687
- { 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) and how many of them won (walkInPrizes), plus event-wide item totals.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId"], additionalProperties: !1 } },
10688
- { 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, openSession is the session every counter serves from now (null when none is open) and openSessionChangesAt when that next changes (serverTime is the server clock at the read). Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1,
10689
- maxLength: 64 } }, required: ["eventId", "siteId"], additionalProperties: !1 } },
10690
- { 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), the session whose sets would be used (card.session; under ANY_OPEN_SESSION with none open, the next to open or else the last to close) and whether a redemption would go ahead (refusal code otherwise). Writes nothing but failed-lookup throttle records, so it needs no confirmation flags. Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: {
10691
- 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 } },
10692
- { 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. 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: "s\
10693
- tring", 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|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 } },
10694
- {
10695
- path: ["staff-redemption", "claims", "record-items"],
10696
- procedure: "event.staffRedemption.recordStaffRedemptionClaimItems",
10697
- operation: "mutation",
10698
- 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.",
10699
- effects: ["state-change"],
10700
- target: "eventId",
10701
- dates: [],
10702
- input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, claimId: { 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 }
10703
- },
10704
- { 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 } }
10705
- ], 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(
10706
- (value, segments, label) => {
10707
- const [head, ...rest] = segments;
10708
- if (head === void 0) {
10709
- if (typeof value != "string") return value;
10710
- const parsed = new Date(value);
10711
- 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."));
10712
- return parsed;
10713
- }
10714
- 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");
10715
- return key === "" ? apply(value) : !isRecord3(value) || !(key in value) ? value : { ...value, [key]: apply(value[key]) };
10716
- },
10717
- "coerceDateAt"
10718
- ), coerceDates = __name2((input, datePaths) => datePaths.reduce((current, path2) => coerceDateAt(current, path2 === "" ? [] : path2.split("."), path2 || "input"), input), "coerceDates"), readInput = __name2(async (parsed, entry) => {
10691
+ }, 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 } },
10693
+ { 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
+ 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
+ { 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 } },
10698
+ { 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
+ 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
+ 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
+ { 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 } }
10711
+ ], 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
+ const [head, ...rest] = segments;
10713
+ if (head === void 0) {
10714
+ if (typeof value != "string") return value;
10715
+ 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
+ );
10719
+ return parsed;
10720
+ }
10721
+ 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
+ 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) => {
10719
10724
  const provided = parsed.flags.has("input") || parsed.flags.has("input-file");
10720
10725
  if (!entry.input) {
10721
- if (provided) throw new CliUsageError("".concat(
10722
- commandName(entry),
10723
- " does not take --input."
10724
- ));
10726
+ if (provided) throw new CliUsageError("".concat(commandName(entry), " does not take --input."));
10725
10727
  return;
10726
10728
  }
10727
10729
  if (!provided) {
@@ -10748,16 +10750,19 @@ tring", format: "uuid", pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-
10748
10750
  const expected = targetText(isRecord3(input) ? input[entry.target] : void 0);
10749
10751
  if (expected === void 0) throw new CliUsageError("--input must include ".concat(entry.target, " so the target can be confirmed."));
10750
10752
  if (getOptionalFlag(parsed, "target") !== expected) throw new CliUsageError("--target must exactly match input.".concat(entry.target, " (").concat(expected, ")."));
10751
- }, "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) => {
10752
- const { parsed, runtime, authenticate } = input, entry = findManifestEntry(parsed.positionals);
10753
- if (!entry) return !1;
10754
- if (parsed.flags.has("help")) return assertOnlyFlags(parsed, ["help"]), writeSuccess(runtime, describe2(entry)), !0;
10755
- assertOnlyFlags(parsed, registryFlags);
10756
- const procedureInput = await readInput(parsed, entry);
10757
- assertConfirmed(parsed, entry, procedureInput), await authenticate();
10758
- const client = resolveProcedureClient(entry.procedure);
10759
- return writeSuccess(runtime, entry.operation === "query" ? await client.query(procedureInput) : await client.mutate(procedureInput)), !0;
10760
- }, "runRegistryCommand"), getInstalledCliVersion = __name2(() => {
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(() => {
10761
10766
  try {
10762
10767
  const packageJson = JSON.parse(readFileSync(resolve(import.meta.dir, "../package.json"), "utf8"));
10763
10768
  return typeof packageJson.version == "string" ? packageJson.version : "unknown";
@@ -10780,20 +10785,17 @@ tring", format: "uuid", pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-
10780
10785
  const createdAt = new Date(parsed.createdAt);
10781
10786
  if (Number.isNaN(createdAt.getTime())) throw new CliUsageError("--cursor.createdAt must be a valid date.");
10782
10787
  return { createdAt, id: parsed.id };
10783
- }, "parseCursor"), parseRetainedIds = __name2(
10784
- (value) => {
10785
- let parsed;
10786
- try {
10787
- parsed = JSON.parse(value);
10788
- } catch {
10789
- throw new CliUsageError("--retained-ids must be valid JSON.");
10790
- }
10791
- if (!Array.isArray(parsed)) throw new CliUsageError("--retained-ids must be a JSON array.");
10792
- if (parsed.length > 100 || parsed.some((id) => typeof id != "string" || id.length === 0)) throw new CliUsageError("--retained-ids must contain at most 100 non-empty strings.");
10793
- return parsed;
10794
- },
10795
- "parseRetainedIds"
10796
- ), luckyDrawParticipantFields = /* @__PURE__ */ new Set(["email", "luckyDrawId", "name"]), asParticipantRecord = __name2((participant, index) => {
10788
+ }, "parseCursor"), parseRetainedIds = __name2((value) => {
10789
+ let parsed;
10790
+ try {
10791
+ parsed = JSON.parse(value);
10792
+ } catch {
10793
+ throw new CliUsageError("--retained-ids must be valid JSON.");
10794
+ }
10795
+ if (!Array.isArray(parsed)) throw new CliUsageError("--retained-ids must be a JSON array.");
10796
+ if (parsed.length > 100 || parsed.some((id) => typeof id != "string" || id.length === 0)) throw new CliUsageError("--retained-ids must contain at most 100 non-empty strings.");
10797
+ return parsed;
10798
+ }, "parseRetainedIds"), luckyDrawParticipantFields = /* @__PURE__ */ new Set(["email", "luckyDrawId", "name"]), asParticipantRecord = __name2((participant, index) => {
10797
10799
  if (typeof participant != "object" || participant === null || Array.isArray(participant)) throw new CliUsageError("--participants[".concat(index, "] must be an object."));
10798
10800
  if (Object.keys(participant).some((key) => !luckyDrawParticipantFields.has(key))) throw new CliUsageError("--participants[".concat(index, "] contains an unsupported field."));
10799
10801
  return participant;
@@ -10811,9 +10813,7 @@ tring", format: "uuid", pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-
10811
10813
  throw new CliUsageError("--participants must be valid JSON.");
10812
10814
  }
10813
10815
  if (!Array.isArray(parsed)) throw new CliUsageError("--participants must be a JSON array.");
10814
- return parsed.map(
10815
- parseLuckyDrawParticipant
10816
- );
10816
+ return parsed.map(parseLuckyDrawParticipant);
10817
10817
  }, "parseLuckyDrawParticipants"), parseAppearanceMediaType = __name2((value) => {
10818
10818
  if (value === "image" || value === "video") return value;
10819
10819
  throw new CliUsageError("--media-type must be one of: image, video.");
@@ -10840,12 +10840,12 @@ tring", format: "uuid", pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-
10840
10840
  if (Number.isNaN(parsed.getTime())) throw new CliUsageError("--".concat(name, " must be a valid date-time."));
10841
10841
  return parsed;
10842
10842
  }, "parseIsoDateTime"), commandKey = __name2((action, subAction) => JSON.stringify([action ?? null, subAction ?? null]), "commandKey"), runAuthLogin = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl, cliVersion }) => {
10843
- assertPositionalCount(
10844
- parsed,
10845
- 2
10846
- ), assertOnlyFlags(parsed, ["no-browser"]);
10843
+ assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["no-browser"]);
10847
10844
  const credentials = await loginWithBrowser({ apiBaseUrl, clientVersion: cliVersion, onVerification: __name2(({ browserOpened, userCode, verificationUriComplete }) => {
10848
- runtime.stderr.write("".concat(browserOpened ? "Opened" : "Open", " ").concat(verificationUriComplete, "\nCode: ").concat(userCode, "\nWaiting for approval\u2026\n"));
10845
+ runtime.stderr.write("".concat(browserOpened ? "Opened" : "Open", " ").concat(
10846
+ verificationUriComplete,
10847
+ "\nCode: "
10848
+ ).concat(userCode, "\nWaiting for approval\u2026\n"));
10849
10849
  }, "onVerification"), ...parsed.flags.get("no-browser") === !0 ? { openBrowser: __name2(async () => !1, "openBrowser") } : {}, store: credentialStore });
10850
10850
  writeSuccess(runtime, { authenticated: !0, session: credentials.session, storage: "Bun.secrets" });
10851
10851
  }, "runAuthLogin"), runAuthStatus = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl }) => {
@@ -10853,7 +10853,9 @@ tring", format: "uuid", pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-
10853
10853
  const credentials = await credentialStore.get();
10854
10854
  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
10855
  }, "runAuthStatus"), runAuthLogout = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl }) => {
10856
- assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), writeSuccess(runtime, { loggedOut: !0, ...await logoutCliSession({ apiBaseUrl, store: credentialStore }) });
10856
+ assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), writeSuccess(runtime, { loggedOut: !0, ...await logoutCliSession(
10857
+ { apiBaseUrl, store: credentialStore }
10858
+ ) });
10857
10859
  }, "runAuthLogout"), runAuthWhoami = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10858
10860
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), await ensureAuthentication(), writeSuccess(runtime, await api2.auth.whoami.query(void 0));
10859
10861
  }, "runAuthWhoami"), runOrganizationList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
@@ -10866,7 +10868,10 @@ tring", format: "uuid", pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-
10866
10868
  await ensureAuthentication(), writeSuccess(runtime, await api2.admin.organization.createOrganization.mutate(input));
10867
10869
  }, "runOrganizationCreate"), runEventCreate = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10868
10870
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["organization-id", "name", "type", "start", "end", "location"]);
10869
- 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") } } };
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
+ ) } } };
10870
10875
  await ensureAuthentication(), writeSuccess(runtime, await api2.event.createEvent.mutate(input));
10871
10876
  }, "runEventCreate"), runEventList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10872
10877
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["organization-id", "page", "per-page", "name", "status", "archive-status"]);
@@ -10891,20 +10896,14 @@ tring", format: "uuid", pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-
10891
10896
  await ensureAuthentication(), writeSuccess(runtime, await api2.event.updateEventAppearance.mutate(input));
10892
10897
  }, "runEventAppearanceUpdate"), runEventAppearanceUpload = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10893
10898
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "file", "content-type", "media-type"]);
10894
- const eventId = getRequiredFlag(parsed, "event-id"), filePath = getRequiredFlag(
10895
- parsed,
10896
- "file"
10897
- ), contentType = getRequiredFlag(parsed, "content-type"), mediaType = parseAppearanceMediaType(getRequiredFlag(parsed, "media-type")), file = await readFile7(filePath);
10899
+ 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);
10898
10900
  await ensureAuthentication();
10899
10901
  const signed = await api2.attachment.getPresignedUrlToUpload.mutate({ folder: "event-appearance/".concat(mediaType === "image" ? "images" : "videos"), fileName: basename5(filePath), contentType, size: file.byteLength, eventId }), uploadResponse = await fetch(signed.uploadUrl, { method: "PUT", headers: { "content-type": contentType }, body: file });
10900
10902
  if (!uploadResponse.ok) throw new Error("Appearance media upload failed with HTTP ".concat(uploadResponse.status, "."));
10901
10903
  writeSuccess(runtime, signed);
10902
10904
  }, "runEventAppearanceUpload"), runPhotoWallDisplayItems = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10903
10905
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "limit", "cursor", "retained-ids"]);
10904
- const cursorValue = getOptionalFlag(parsed, "cursor"), retainedIdsValue = getOptionalFlag(parsed, "retained-ids"), input = { eventId: getRequiredFlag(
10905
- parsed,
10906
- "event-id"
10907
- ), limit: parseBoundedInteger(getOptionalFlag(parsed, "limit") ?? "30", "limit", 1, 60), ...cursorValue === void 0 ? {} : { cursor: parseCursor(cursorValue) }, retainedIds: retainedIdsValue === void 0 ? [] : parseRetainedIds(retainedIdsValue) };
10906
+ 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) };
10908
10907
  await ensureAuthentication(), writeSuccess(runtime, await api2.event.photoWall.getPhotoWallDisplayItems.query(input));
10909
10908
  }, "runPhotoWallDisplayItems"), runLuckyDrawPreDraw = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
10910
10909
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["event-id", "prize-count"]);
@@ -10920,12 +10919,13 @@ tring", format: "uuid", pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-
10920
10919
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "page", "per-page"]);
10921
10920
  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) };
10922
10921
  await ensureAuthentication(), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawParticipantsByEventId.query(input));
10923
- }, "runLuckyDrawParticipantsList"), organizationCommands = /* @__PURE__ */ new Map([
10924
- [commandKey("list"), runOrganizationList],
10925
- [commandKey("get"), runOrganizationGet],
10926
- [commandKey("create"), runOrganizationCreate]
10927
- ]), 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("photo-wall", "display"), runPhotoWallDisplayItems]])], ["lucky-draw", /* @__PURE__ */ new Map([[commandKey("pre-draw"), runLuckyDrawPreDraw], [commandKey("participants", "replace"), runLuckyDrawParticipantsReplace], [
10928
- commandKey("participants", "list"), runLuckyDrawParticipantsList]])]]), runCommand = __name2(async (parsed, runtime, credentialStore, apiBaseUrl, configureAccessToken) => {
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) => {
10929
10929
  const [group, action, subAction] = parsed.positionals, cliVersion = getInstalledCliVersion();
10930
10930
  let accessToken;
10931
10931
  const ensureAuthentication = __name2(async () => {
@@ -10961,10 +10961,7 @@ commandKey("participants", "list"), runLuckyDrawParticipantsList]])]]), runComma
10961
10961
  const parsed = parseArguments(args), apiUrl = getOptionalFlag(parsed, "api-url");
10962
10962
  return apiUrl ? configureEventTechApiBaseUrl(apiUrl) : configureEventTechApiFromEnvironment(), await runCommand(parsed, runtime, credentialStore, getEventTechApiBaseUrl(), configureAccessToken), 0;
10963
10963
  } catch (error2) {
10964
- return writeError(
10965
- runtime,
10966
- error2
10967
- ), error2 instanceof CliUsageError ? 2 : 1;
10964
+ return writeError(runtime, error2), error2 instanceof CliUsageError ? 2 : 1;
10968
10965
  }
10969
10966
  }, "runCli");
10970
10967
  import.meta.main && (assertBunRuntime(), process.exitCode = await runCli(process.argv.slice(2)));