@go-labs-sg/event-tech 1.25.0 → 1.27.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
@@ -9409,6 +9409,13 @@ Usage:
9409
9409
  et event appearance update --event-id <id> --appearance-version <n> --appearance <json>
9410
9410
  et event appearance reset --event-id <id> --appearance-version <n>
9411
9411
  et event appearance upload --event-id <id> --file <path> --media-type <image|video> --content-type <mime>
9412
+ Appearance update accepts a full version:1 appearance JSON. Optional humanBingo sets
9413
+ title (max 80; empty uses the configured Bingo title), joinHeading (1\u201340),
9414
+ joinInstructions (1\u2013180), titleFontSize (32\u201396) and nameFontSize (24\u201352).
9415
+ Text is trimmed; font sizes are integers. Omitted humanBingo keeps saved settings;
9416
+ an absent stored block keeps the legacy layout. Appearance reset clears all overrides.
9417
+ Appearance theme colours, fonts and display image/video apply to the updated Photo, Post-it, Signature, Bingo and Rating boards.
9418
+ Photo, Post-it and Signature walls share photoWall playback: durationSeconds 10\u201340, maxVisible 1\u201316, motion gentle|lively|roaming (bounce).
9412
9419
  et event photo-wall display-items --event-id <id> [--limit <n>] [--cursor <json>] [--retained-ids <json>]
9413
9420
  et lucky-draw config get --event-id <id>
9414
9421
  et lucky-draw config update --event-id <id> (--config <json> | --config-file <path>) [--dry-run]
@@ -9662,10 +9669,7 @@ Authentication:
9662
9669
  EVENT_TECH_API_URL defaults to `.concat(DEFAULT_EVENT_TECH_API_BASE_URL, ".");
9663
9670
  import { readFile as readFile3 } from "fs/promises";
9664
9671
  import { basename } from "path";
9665
- var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH: "BOTH" }, LuckyDrawType = {
9666
- WHEEL: "WHEEL",
9667
- SLOT: "SLOT"
9668
- }, luckyDrawConfigSchema = object({
9672
+ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH: "BOTH" }, LuckyDrawType = { WHEEL: "WHEEL", SLOT: "SLOT" }, luckyDrawConfigSchema = object({
9669
9673
  title: string2(),
9670
9674
  titleColor: string2(),
9671
9675
  isTitleVisible: boolean2(),
@@ -9701,43 +9705,7 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
9701
9705
  prizePositionY: number2(),
9702
9706
  prizeDivWidth: number2(),
9703
9707
  prizeDivHeight: number2()
9704
- }), 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 = {
9705
- title: "Lucky Draw Title",
9706
- titleColor: "#111111",
9707
- isTitleVisible: !0,
9708
- titleFontSize: 40,
9709
- prizeColor: "#111111",
9710
- prizeFontSize: 30,
9711
- isPrizeVisible: !0,
9712
- slotBackgroundColor: "#ffffff",
9713
- slotBorderColor: "#ffffff",
9714
- slotTextColor: "#111111",
9715
- slotFontSize: 5,
9716
- backgroundPreset: "#ede9fe",
9717
- numberOfSegments: 12,
9718
- includeDomains: [],
9719
- excludeDomains: [],
9720
- includeEmails: [],
9721
- excludeEmails: [],
9722
- segmentPreset: "Vibrant",
9723
- segmentText: LuckyDrawSegmentText.NAME,
9724
- luckyDrawType: LuckyDrawType.WHEEL,
9725
- titleFont: "font-sans",
9726
- prizeFont: "font-sans",
9727
- wheelSegmentFont: "font-sans",
9728
- wheelSegmentFontSize: 12,
9729
- slotTextFont: "font-sans",
9730
- customBackgroundImage: null,
9731
- titlePositionX: 750,
9732
- titlePositionY: 100,
9733
- slotPositionX: 600,
9734
- slotPositionY: 300,
9735
- prizePositionX: 800,
9736
- prizePositionY: 200,
9737
- prizeDivWidth: 500,
9738
- prizeDivHeight: 100,
9739
- wheelSegmentColorsPreset: "Vibrant"
9740
- }, 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) => {
9708
+ }), 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, 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) => {
9741
9709
  const path2 = issue2.path.map(String).join(".");
9742
9710
  return path2 ? "".concat(path2, ": ").concat(issue2.message) : issue2.message;
9743
9711
  }).join("; "), "."), "formatIssues"), parseLuckyDrawConfigPatch = __name2((raw) => {
@@ -9748,7 +9716,11 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
9748
9716
  if (Object.keys(result.data).length === 0) throw new CliUsageError("--config must change at least one field.");
9749
9717
  return result.data;
9750
9718
  }, "parseLuckyDrawConfigPatch"), mergeLuckyDrawConfig = __name2((current, patch) => {
9751
- const merged = { ...DEFAULT_LUCKY_DRAW_CONFIG_INPUT_VALUES, ...current ?? {}, ...patch }, result = luckyDrawConfigSchema.safeParse(merged);
9719
+ const merged = {
9720
+ ...DEFAULT_LUCKY_DRAW_CONFIG_INPUT_VALUES,
9721
+ ...current ?? {},
9722
+ ...patch
9723
+ }, result = luckyDrawConfigSchema.safeParse(merged);
9752
9724
  if (!result.success) throw new CliUsageError(formatIssues("Merged lucky draw config", result.error.issues));
9753
9725
  return result.data;
9754
9726
  }, "mergeLuckyDrawConfig"), parsePrizeList = __name2((raw) => {
@@ -9757,22 +9729,19 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
9757
9729
  if (value.length > 500) throw new CliUsageError("--prizes must contain at most 500 prizes.");
9758
9730
  return value.map((item, index) => {
9759
9731
  const result = luckyDrawPrizeInputSchema.strict().safeParse(item);
9760
- if (!result.success) throw new CliUsageError(formatIssues(
9761
- "--prizes[".concat(index, "]"),
9762
- result.error.issues
9763
- ));
9732
+ if (!result.success) throw new CliUsageError(formatIssues("--prizes[".concat(index, "]"), result.error.issues));
9764
9733
  return result.data;
9765
9734
  });
9766
- }, "parsePrizeList"), loadCurrentConfig = __name2(async (eventId) => (await api2.event.luckyDraw.getLuckyDrawByEventId.query({ eventId })).config, "loadCurrentConfig"), loadPrizes = __name2(async (eventId) => (await api2.event.luckyDraw.getLuckyDrawPrizesByEventId.query({ eventId })).prizes, "loadPrizes"), assertPrizesBelongToEvent = __name2((prizes, prizeIds, eventId) => {
9767
- const known = new Set(prizes.map((prize) => prize.id)), missing = prizeIds.filter((id) => !known.has(id));
9768
- if (missing.length > 0) throw new CliUsageError("Prize ID(s) not found on event ".concat(eventId, ": ").concat(missing.join(", "), "."));
9769
- }, "assertPrizesBelongToEvent"), saveConfig = __name2((eventId, config) => api2.event.luckyDraw.updateLuckyDrawConfigJson.mutate({ eventId, config }), "saveConfig"), runConfigGet = __name2(async ({ parsed, runtime, authenticate }) => {
9735
+ }, "parsePrizeList"), loadCurrentConfig = __name2(async (eventId) => (await api2.event.luckyDraw.getLuckyDrawByEventId.query({ eventId })).config, "loadCurrentConfig"), loadPrizes = __name2(async (eventId) => (await api2.event.luckyDraw.getLuckyDrawPrizesByEventId.query({ eventId })).prizes, "loadPrizes"), assertPrizesBelongToEvent = __name2(
9736
+ (prizes, prizeIds, eventId) => {
9737
+ const known = new Set(prizes.map((prize) => prize.id)), missing = prizeIds.filter((id) => !known.has(id));
9738
+ if (missing.length > 0) throw new CliUsageError("Prize ID(s) not found on event ".concat(eventId, ": ").concat(missing.join(", "), "."));
9739
+ },
9740
+ "assertPrizesBelongToEvent"
9741
+ ), saveConfig = __name2((eventId, config) => api2.event.luckyDraw.updateLuckyDrawConfigJson.mutate({ eventId, config }), "saveConfig"), runConfigGet = __name2(async ({ parsed, runtime, authenticate }) => {
9770
9742
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id"]);
9771
9743
  const eventId = getRequiredFlag(parsed, "event-id");
9772
- await authenticate(), writeSuccess(
9773
- runtime,
9774
- await api2.event.luckyDraw.getLuckyDrawByEventId.query({ eventId })
9775
- );
9744
+ await authenticate(), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawByEventId.query({ eventId }));
9776
9745
  }, "runConfigGet"), runConfigUpdate = __name2(async ({ parsed, runtime, authenticate }) => {
9777
9746
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "config", "config-file", "dry-run"]);
9778
9747
  const eventId = getRequiredFlag(parsed, "event-id"), patch = parseLuckyDrawConfigPatch(await readInlineOrFile(parsed, "config", "config-file"));
@@ -9805,7 +9774,10 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
9805
9774
  const config = mergeLuckyDrawConfig(await loadCurrentConfig(eventId), { customBackgroundImage: null });
9806
9775
  writeSuccess(runtime, await saveConfig(eventId, config));
9807
9776
  }, "runBackgroundClear"), runPrizesList = __name2(async ({ parsed, runtime, authenticate }) => {
9808
- assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id"]);
9777
+ assertPositionalCount(
9778
+ parsed,
9779
+ 3
9780
+ ), assertOnlyFlags(parsed, ["event-id"]);
9809
9781
  const eventId = getRequiredFlag(parsed, "event-id");
9810
9782
  await authenticate(), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawPrizesByEventId.query({ eventId }));
9811
9783
  }, "runPrizesList"), runPrizesCreate = __name2(async ({ parsed, runtime, authenticate }) => {
@@ -9821,22 +9793,21 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
9821
9793
  await authenticate(), assertPrizesBelongToEvent(await loadPrizes(eventId), [prizeId], eventId), writeSuccess(runtime, await api2.event.luckyDraw.updateLuckyDrawPrize.mutate({ id: prizeId, name, ...description === void 0 ? {} : { description } }));
9822
9794
  }, "runPrizesUpdate"), runPrizesDelete = __name2(async ({ parsed, runtime, authenticate }) => {
9823
9795
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "prize-ids", "allow-state-change", "target"]);
9824
- const eventId = getRequiredFlag(parsed, "event-id"), prizeIds = parseIdList(getRequiredFlag(parsed, "prize-ids"), "prize-ids");
9796
+ const eventId = getRequiredFlag(parsed, "event-id"), prizeIds = parseIdList(getRequiredFlag(
9797
+ parsed,
9798
+ "prize-ids"
9799
+ ), "prize-ids");
9825
9800
  assertStateChangeTarget(parsed, eventId), await authenticate(), assertPrizesBelongToEvent(await loadPrizes(eventId), prizeIds, eventId), writeSuccess(runtime, await api2.event.luckyDraw.deleteLuckyDrawPrize.mutate({ prizeIds }));
9826
9801
  }, "runPrizesDelete"), runPrizesReorder = __name2(async ({ parsed, runtime, authenticate }) => {
9827
9802
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "prize-ids"]);
9828
9803
  const eventId = getRequiredFlag(parsed, "event-id"), prizeIds = parseIdList(getRequiredFlag(parsed, "prize-ids"), "prize-ids");
9829
9804
  await authenticate();
9830
- const prizes = await loadPrizes(
9831
- eventId
9832
- );
9805
+ const prizes = await loadPrizes(eventId);
9833
9806
  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."));
9834
9807
  const namesById = new Map(prizes.map((prize) => [prize.id, prize.name]));
9835
9808
  writeSuccess(runtime, await api2.event.luckyDraw.updateLuckyDrawPrizesOrder.mutate({ eventId, prizes: prizeIds.map((id, order) => ({ id, order, name: namesById.get(id) ?? "" })) }));
9836
9809
  }, "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) => {
9837
- const { parsed, runtime, authenticate } = input, [, action, subAction] = parsed.positionals, handler = LUCKY_DRAW_SETUP_HANDLERS.get("".concat(action, " ").concat(
9838
- subAction
9839
- ));
9810
+ const { parsed, runtime, authenticate } = input, [, action, subAction] = parsed.positionals, handler = LUCKY_DRAW_SETUP_HANDLERS.get("".concat(action, " ").concat(subAction));
9840
9811
  return handler ? (await handler({ parsed, runtime, authenticate }), !0) : !1;
9841
9812
  }, "runLuckyDrawSetupCommand");
9842
9813
  import { readFile as readFile5 } from "fs/promises";
@@ -9845,7 +9816,10 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
9845
9816
  if (cells.length <= MAX_COLUMNS) return cells;
9846
9817
  if (cells.slice(MAX_COLUMNS).some(isFilled)) throw columnLimitError();
9847
9818
  return cells.slice(0, MAX_COLUMNS);
9848
- }, "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(new __cliRegExp("&gt;", "g"), ">").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) => {
9819
+ }, "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(new __cliRegExp("&gt;", "g"), ">").replace(new __cliRegExp(
9820
+ "&quot;",
9821
+ "g"
9822
+ ), '"').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) => {
9849
9823
  const letters = new __cliRegExp("^[A-Z]+", "").exec(reference)?.[0] ?? "";
9850
9824
  let index = 0;
9851
9825
  for (const letter of letters) index = index * 26 + letter.charCodeAt(0) - 64;
@@ -9853,7 +9827,10 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
9853
9827
  }, "columnIndex"), sheetPathFromTarget = __name2((target) => target.startsWith("/") ? target.slice(1) : "xl/".concat(target), "sheetPathFromTarget"), readWorkbookSheets = __name2(async (zip) => {
9854
9828
  const workbook = await zip.file("xl/workbook.xml")?.async("string");
9855
9829
  if (!workbook) return [];
9856
- 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]) : [];
9830
+ const rels = await zip.file("xl/_rels/workbook.xml.rels")?.async("string"), relationships = rels ? [...rels.matchAll(new __cliRegExp(
9831
+ "<Relationship\\b[^>]*>",
9832
+ "g"
9833
+ ))].map((match) => match[0]) : [];
9857
9834
  return [...workbook.matchAll(new __cliRegExp("<sheet\\b[^>]*>", "g"))].map((match) => {
9858
9835
  const relationId = attribute(match[0], "r:id"), relationship = relationships.find((tag) => attribute(tag, "Id") === relationId), target = relationship ? attribute(relationship, "Target") : void 0;
9859
9836
  return { name: decodeXml(attribute(match[0], "name") ?? ""), path: target ? sheetPathFromTarget(target) : void 0 };
@@ -9861,7 +9838,10 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
9861
9838
  }, "readWorkbookSheets"), DEFAULT_SHEET_PATH = "xl/worksheets/sheet1.xml", unknownSheetError = __name2((sheetName, sheets) => new Error('The workbook has no sheet named "'.concat(sheetName, '". Sheets: ').concat(sheets.map((sheet) => '"'.concat(sheet.name, '"')).join(", ") || "none", ".")), "unknownSheetError"), resolveSheetPath = __name2((sheets, sheetName) => {
9862
9839
  if (sheetName === void 0) return sheets[0]?.path ?? DEFAULT_SHEET_PATH;
9863
9840
  const wanted = sheetName.trim().toLowerCase(), sheet = sheets.find((candidate) => candidate.name === sheetName) ?? sheets.find((candidate) => candidate.name.trim().toLowerCase() === wanted);
9864
- if (!sheet) throw unknownSheetError(sheetName, sheets);
9841
+ if (!sheet) throw unknownSheetError(
9842
+ sheetName,
9843
+ sheets
9844
+ );
9865
9845
  if (!sheet.path) throw new Error('The sheet "'.concat(sheet.name, '" could not be read.'));
9866
9846
  return sheet.path;
9867
9847
  }, "resolveSheetPath"), cellValue = __name2((cellXml, sharedStrings) => {
@@ -9869,13 +9849,10 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
9869
9849
  if (type === "inlineStr") return textRuns(cellXml);
9870
9850
  const raw = new __cliRegExp("<v>([\\s\\S]*?)<\\/v>", "").exec(cellXml)?.[1];
9871
9851
  return raw === void 0 ? "" : type === "s" ? sharedStrings[Number(raw)] ?? "" : type === "b" ? raw === "1" ? "TRUE" : "FALSE" : decodeXml(raw);
9872
- }, "cellValue"), readSharedStrings = __name2(
9873
- async (zip) => {
9874
- const xml = await zip.file("xl/sharedStrings.xml")?.async("string");
9875
- return xml ? [...xml.matchAll(new __cliRegExp("<si\\b[^>]*>([\\s\\S]*?)<\\/si>", "g"))].map((match) => textRuns(match[1] ?? "")) : [];
9876
- },
9877
- "readSharedStrings"
9878
- ), readRowCells = __name2((rowXml, sharedStrings) => {
9852
+ }, "cellValue"), readSharedStrings = __name2(async (zip) => {
9853
+ const xml = await zip.file("xl/sharedStrings.xml")?.async("string");
9854
+ return xml ? [...xml.matchAll(new __cliRegExp("<si\\b[^>]*>([\\s\\S]*?)<\\/si>", "g"))].map((match) => textRuns(match[1] ?? "")) : [];
9855
+ }, "readSharedStrings"), readRowCells = __name2((rowXml, sharedStrings) => {
9879
9856
  const cells = [];
9880
9857
  for (const cellMatch of rowXml.matchAll(new __cliRegExp("<c\\b[^>]*?(?:\\/>|>[\\s\\S]*?<\\/c>)", "g"))) {
9881
9858
  const reference = attribute(cellMatch[0], "r"), column = reference ? columnIndex(reference) : cells.length, value = cellValue(cellMatch[0], sharedStrings);
@@ -9932,7 +9909,10 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
9932
9909
  });
9933
9910
  }), validateMenuCollection = __name2((config, context) => {
9934
9911
  config.collectionLimit !== void 0 && (!config.menuItems?.length || config.collectionMode !== "STAFF_SCAN" || !["FOOD", "DRINK"].includes(config.category ?? "GAME")) && context.addIssue({ code: "custom", path: ["collectionLimit"], message: "Collection limits require a FOOD or DRINK staff-scan menu station." }), config.menuItems && (config.collectionMode !== "STAFF_SCAN" || config.prizeDeskAward) && context.addIssue({ code: "custom", path: ["menuItems"], message: "Menu items require staff-scan collection without prize-desk awards." });
9935
- }, "validateMenuCollection"), stampValueSchema = number2().int().min(0).max(PASSPORT_STAMP_VALUE_MAX), PASSPORT_STATION_CATEGORIES = ["GAME", "FOOD", "DRINK", "BINGO"], passportStationCategorySchema = _enum(PASSPORT_STATION_CATEGORIES), PASSPORT_CATEGORY_LABEL_MAX = 40, PASSPORT_CATEGORY_LABEL_LOCALES = ["en", "zh-CN"], passportCategoryLabelTextSchema = string2().trim().min(1).max(PASSPORT_CATEGORY_LABEL_MAX), sanitizePassportCategoryLabels = __name2((value) => {
9912
+ }, "validateMenuCollection"), stampValueSchema = number2().int().min(0).max(PASSPORT_STAMP_VALUE_MAX), PASSPORT_STATION_CATEGORIES = ["GAME", "FOOD", "DRINK", "BINGO"], passportStationCategorySchema = _enum(PASSPORT_STATION_CATEGORIES), PASSPORT_CATEGORY_LABEL_MAX = 40, PASSPORT_CATEGORY_LABEL_LOCALES = [
9913
+ "en",
9914
+ "zh-CN"
9915
+ ], passportCategoryLabelTextSchema = string2().trim().min(1).max(PASSPORT_CATEGORY_LABEL_MAX), sanitizePassportCategoryLabels = __name2((value) => {
9936
9916
  if (typeof value != "object" || value === null || Array.isArray(value)) return;
9937
9917
  const labels = {};
9938
9918
  for (const category of PASSPORT_STATION_CATEGORIES) {
@@ -9950,34 +9930,30 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
9950
9930
  const seen = /* @__PURE__ */ new Set();
9951
9931
  items.forEach((item, index) => {
9952
9932
  const key = item.toLocaleLowerCase();
9953
- seen.has(key) && context.addIssue({ code: "custom", path: [index], message: '"'.concat(item, '" is listed more than once.') }), seen.add(key);
9933
+ seen.has(key) && context.addIssue({ code: "custom", path: [
9934
+ index
9935
+ ], message: '"'.concat(item, '" is listed more than once.') }), seen.add(key);
9954
9936
  });
9955
9937
  }), PASSPORT_STATION_INFO_SUBTITLE_MAX = 80, PASSPORT_STATION_INFO_STEPS_MAX = 8, PASSPORT_STATION_INFO_STEP_MAX = 160, PASSPORT_STATION_INFO_MENU_MAX = 15, PASSPORT_STATION_INFO_MENU_NAME_MAX = 80, PASSPORT_STATION_INFO_MENU_DETAIL_MAX = 200, PASSPORT_STATION_INFO_NOTE_MAX = 240, optionalInfoText = __name2((maximum) => string2().trim().max(maximum).optional().transform((value) => value || void 0), "optionalInfoText"), passportStationInfoStepsSchema = array(string2().trim().max(PASSPORT_STATION_INFO_STEP_MAX)).transform((steps) => steps.filter((step) => step !== "")).pipe(array(string2()).max(PASSPORT_STATION_INFO_STEPS_MAX)).transform((steps) => steps.length > 0 ? steps : void 0), passportStationInfoMenuSchema = array(object({ name: string2().trim().max(PASSPORT_STATION_INFO_MENU_NAME_MAX), detail: optionalInfoText(PASSPORT_STATION_INFO_MENU_DETAIL_MAX), contains: optionalInfoText(PASSPORT_STATION_INFO_MENU_DETAIL_MAX) })).transform((rows) => rows.filter((row) => row.name !== "" || row.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) => {
9956
9938
  const normalised = { ...info.subtitle ? { subtitle: info.subtitle } : {}, ...info.steps ? { steps: info.steps } : {}, ...info.menu ? { menu: info.menu } : {}, ...info.note ? { note: info.note } : {} };
9957
9939
  return Object.keys(normalised).length > 0 ? normalised : void 0;
9958
- }), 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(), 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(["ONCE", "UNLIMITED"]).optional(), prizeDeskAward: boolean2().optional(), info: passportStationInfoSchema.optional().catch(void 0) }).superRefine((config, context) => {
9940
+ }), passportStationInfoInputSchema = union([_null3(), passportStationInfoSchema.transform((info) => info ?? null)]), passportLoginMethodsSchema = object({
9941
+ emailOtp: boolean2(),
9942
+ google: boolean2(),
9943
+ guest: boolean2(),
9944
+ staffId: boolean2().default(!1),
9945
+ staffIdRequiresLastName: boolean2().default(!0)
9946
+ }).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(), 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(["ONCE", "UNLIMITED"]).optional(), prizeDeskAward: boolean2().optional(), info: passportStationInfoSchema.optional().catch(void 0) }).superRefine((config, context) => {
9959
9947
  validateMenuCollection(config, context);
9960
9948
  const tally = config.collectionMode === "STAFF_TALLY";
9961
9949
  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({ code: "custom", path: ["printedQrEnabled"], message: "Only self-scan stations can issue printed QR codes." });
9962
- }), 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({
9963
- showHowToCollect: boolean2().optional(),
9964
- showMyQr: boolean2().optional(),
9965
- collectionMode: literal("STAFF_SCAN"),
9966
- menuItems: passportMenuItemsSchema.nullable().optional(),
9967
- collectionLimit: _enum(["ONCE", "UNLIMITED"]).optional(),
9968
- stampValue: stampValueSchema.optional(),
9969
- category: passportStationCategorySchema.optional(),
9970
- prizeDeskAward: boolean2().optional(),
9971
- info: passportStationInfoInputSchema.optional()
9972
- }).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 }), 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(
9973
- 1
9974
- ).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.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).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().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).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(
9975
- value
9976
- ) !== "", { 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).max(PASSPORT_ROSTER_PAGE_MAX).default(25), cursor: string2().min(
9977
- 1
9978
- ).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) }), "passportRosterRejectReasonLabels"), passportRosterRejectReasonLabel = passportRosterRejectReasonLabels(
9979
- PASSPORT_STAFF_ID_LABEL_DEFAULT
9980
- ), cell = __name2((row, index) => index === null ? "" : (row[index] ?? "").trim(), "cell"), surnameOf = __name2((fullName, position) => {
9950
+ }), passportStationCollectionSchema = discriminatedUnion(
9951
+ "collectionMode",
9952
+ [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(), 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()]
9953
+ ), 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().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().trim().toLowerCase().pipe(email2()) }).strict(), passportEventIdSchema.extend({ method: literal("GOOGLE") }).strict()]), passportAccountLinkIntentSchema = passportEventIdSchema.extend({ intent: string2().regex(new __cliRegExp(
9954
+ "^epl1\\.[A-Za-z0-9_-]{43}$",
9955
+ ""
9956
+ )) }), 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.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().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().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).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).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.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), cell = __name2((row, index) => index === null ? "" : (row[index] ?? "").trim(), "cell"), surnameOf = __name2((fullName, position) => {
9981
9957
  const words = fullName.split(new __cliRegExp("\\s+", "")).filter(Boolean);
9982
9958
  return (position === "first" ? words[0] : words.at(-1)) ?? "";
9983
9959
  }, "surnameOf"), assertPassportRosterMapping = __name2((mapping, columnCount, requireLastName) => {
@@ -9988,26 +9964,25 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
9988
9964
  const rows = [];
9989
9965
  if (table.slice(1).forEach((row, index) => {
9990
9966
  if (row.every((value) => value.trim() === "")) return;
9991
- const fullName = cell(
9992
- row,
9993
- mapping.fullName
9994
- ), lastName = mapping.lastName === null ? surnameOf(fullName, mapping.surnamePosition) : cell(row, mapping.lastName), displayName = cell(row, mapping.displayName ?? mapping.fullName) || null;
9967
+ 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;
9995
9968
  rows.push({ row: index + 2, staffId: cell(row, mapping.staffId), lastName, displayName });
9996
9969
  }), 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."));
9997
9970
  return rows;
9998
- }, "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(
9999
- (headers) => {
10000
- const find = __name2((pattern) => {
10001
- const index = headers.findIndex((header) => pattern.test(header.trim().toLowerCase()));
10002
- return index === -1 ? null : index;
10003
- }, "find");
10004
- return { staffId: find(headerPatterns.staffId) ?? 0, lastName: find(headerPatterns.lastName), fullName: find(headerPatterns.fullName), displayName: find(headerPatterns.displayName), surnamePosition: "last" };
10005
- },
10006
- "guessPassportRosterMapping"
10007
- ), 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().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", "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();
9971
+ }, "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) => {
9972
+ const find = __name2((pattern) => {
9973
+ const index = headers.findIndex((header) => pattern.test(header.trim().toLowerCase()));
9974
+ return index === -1 ? null : index;
9975
+ }, "find");
9976
+ return { staffId: find(headerPatterns.staffId) ?? 0, lastName: find(headerPatterns.lastName), fullName: find(headerPatterns.fullName), displayName: find(headerPatterns.displayName), surnamePosition: "last" };
9977
+ }, "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({ profileCode: participantCodeSchema, site: string2().trim().min(1).max(60).optional() }), passportStationIdSchema.extend({ staffId: string2().trim().min(1).max(
9978
+ PASSPORT_ROSTER_STAFF_ID_MAX
9979
+ ), 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", "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();
10008
9980
  import { readFile as readFile4 } from "fs/promises";
10009
9981
  import { basename as basename2 } from "path";
10010
- 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((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) => {
9982
+ 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(
9983
+ "^#[0-9a-f]{6}$",
9984
+ "i"
9985
+ ), 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) => {
10011
9986
  if (!isRecord(value)) return null;
10012
9987
  const key = toKey(value.key);
10013
9988
  return key ? { key, focalX: toPercent(value.focalX), focalY: toPercent(value.focalY) } : null;
@@ -10016,14 +9991,11 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10016
9991
  const key = toKey(value.key);
10017
9992
  return key ? { key } : null;
10018
9993
  }, "readLogo"), resolvePassportSkinSettings = __name2((value) => {
10019
- if (!isRecord(value)) return DEFAULT_PASSPORT_SKIN_SETTINGS;
9994
+ if (!isRecord(value))
9995
+ return DEFAULT_PASSPORT_SKIN_SETTINGS;
10020
9996
  const colors = isRecord(value.colors) ? value.colors : {};
10021
9997
  return { heroImage: readHeroImage(value.heroImage), logo: readLogo(value.logo), colors: { graphic: toHex(colors.graphic), dark: toHex(colors.dark) }, emphasis: value.emphasis === "ink" ? "ink" : "accent" };
10022
- }, "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({
10023
- mode: _enum(["photo-only", "comment-only", "photo-and-comment"]),
10024
- photoRequired: boolean2(),
10025
- commentRequired: boolean2()
10026
- }), 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) => {
9998
+ }, "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 = { 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) => {
10027
9999
  const toLinear = __name2((channel) => {
10028
10000
  const normalized = channel / 255;
10029
10001
  return normalized <= 0.04045 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
@@ -10032,11 +10004,9 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10032
10004
  }, "getRelativeLuminance"), hasReadableTextContrast = __name2((textColor, backgroundColor) => {
10033
10005
  const textLuminance = getRelativeLuminance(textColor), backgroundLuminance = getRelativeLuminance(backgroundColor);
10034
10006
  return (Math.max(textLuminance, backgroundLuminance) + 0.05) / (Math.min(textLuminance, backgroundLuminance) + 0.05) >= 4.5;
10035
- }, "hasReadableTextContrast"), eventThemeSchema = object(
10036
- { accentColor: hexColorSchema, backgroundColor: hexColorSchema, textColor: hexColorSchema, fontFamily: _enum(["SYSTEM", "JAKARTA", "SERIF"]) }
10037
- ).superRefine((theme, context) => {
10007
+ }, "hasReadableTextContrast"), eventThemeSchema = object({ accentColor: hexColorSchema, backgroundColor: hexColorSchema, textColor: hexColorSchema, fontFamily: _enum(["SYSTEM", "JAKARTA", "SERIF"]) }).superRefine((theme, context) => {
10038
10008
  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"] });
10039
- }), 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 at least 4.5:1 contrast with white text") }).default({ graphic: null, dark: null }), emphasis: _enum(["accent", "ink"]).default("accent") }), eventAppearanceSchema = object({ version: literal(1), theme: eventThemeSchema, guestBackground: appearanceMediaSchema, displayBackground: displayMediaSchema, passport: passportSkinSchema.optional(), photoWall: object({
10009
+ }), 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 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({
10040
10010
  durationSeconds: number2().int().min(10).max(40),
10041
10011
  maxVisible: number2().int().min(1).max(16),
10042
10012
  motion: _enum(["gentle", "lively", "roaming"]),
@@ -10051,10 +10021,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10051
10021
  return value;
10052
10022
  }, "requiredValue"), nonnegativeInteger = __name2((value, name) => {
10053
10023
  const parsed = Number(value);
10054
- if (!new __cliRegExp(
10055
- "^\\d+$",
10056
- ""
10057
- ).test(value) || !Number.isSafeInteger(parsed)) throw new CliUsageError("--".concat(name, " must be a non-negative whole number."));
10024
+ if (!new __cliRegExp("^\\d+$", "").test(value) || !Number.isSafeInteger(parsed)) throw new CliUsageError("--".concat(name, " must be a non-negative whole number."));
10058
10025
  return parsed;
10059
10026
  }, "nonnegativeInteger"), isRecord2 = __name2((value) => typeof value == "object" && value !== null && !Array.isArray(value), "isRecord2"), parseJsonRecord = __name2((raw, name) => {
10060
10027
  let parsed;
@@ -10067,7 +10034,10 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10067
10034
  return parsed;
10068
10035
  }, "parseJsonRecord"), mergeSkinPatch = __name2((current, patch) => {
10069
10036
  const allowed = ["heroImage", "logo", "colors", "emphasis"];
10070
- if (Object.keys(patch).some((key) => !allowed.includes(key))) throw new CliUsageError("--skin-json supports only: ".concat(allowed.join(", "), "."));
10037
+ if (Object.keys(patch).some((key) => !allowed.includes(key))) throw new CliUsageError("--skin-json supports only: ".concat(
10038
+ allowed.join(", "),
10039
+ "."
10040
+ ));
10071
10041
  const merged = { heroImage: patch.heroImage === void 0 ? current.heroImage : isRecord2(patch.heroImage) ? { ...current.heroImage, ...patch.heroImage } : patch.heroImage, logo: patch.logo === void 0 ? current.logo : isRecord2(patch.logo) ? { ...current.logo, ...patch.logo } : patch.logo, colors: isRecord2(patch.colors) ? { ...current.colors, ...patch.colors } : patch.colors ?? current.colors, emphasis: patch.emphasis ?? current.emphasis }, parsed = passportSkinSchema.safeParse(merged);
10072
10042
  if (!parsed.success) throw new CliUsageError("Invalid passport skin: ".concat(parsed.error.issues.map((issue2) => "".concat(issue2.path.join(".") || "skin", ": ").concat(issue2.message)).join("; ")));
10073
10043
  return parsed.data;
@@ -10075,36 +10045,35 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10075
10045
  const projection = await api2.event.getEventAppearance.query({ eventId }), appearance = eventAppearanceSchema.parse(projection.appearance ?? DEFAULT_EVENT_APPEARANCE2);
10076
10046
  return { projection, appearance };
10077
10047
  }, "readCanonicalAppearance"), getPassportSkin = __name2(async (eventId) => {
10078
- const { projection, appearance } = await readCanonicalAppearance(eventId);
10048
+ const {
10049
+ projection,
10050
+ appearance
10051
+ } = await readCanonicalAppearance(eventId);
10079
10052
  return { appearanceVersion: projection.appearanceVersion, hasCustomAppearance: projection.hasCustomAppearance, passport: resolvePassportSkinSettingsFromAppearance(appearance), passportHeroImageUrl: projection.passportHeroImageUrl, passportLogoUrl: projection.passportLogoUrl };
10080
10053
  }, "getPassportSkin"), saveSkin = __name2(async (eventId, appearanceVersion, buildSkin) => {
10081
10054
  const { projection, appearance } = await readCanonicalAppearance(eventId);
10082
10055
  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."));
10083
10056
  const next = { ...appearance, passport: buildSkin(resolvePassportSkinSettingsFromAppearance(appearance)) };
10084
10057
  return api2.event.updateEventAppearance.mutate({ eventId, appearance: next, appearanceVersion });
10085
- }, "saveSkin"), isUploadKind = __name2((kinds, value) => kinds.some((kind) => kind === value), "isUploadKind"), uploadPassportImage = __name2(async (eventId, kind, flags) => {
10086
- const filePath = requiredValue(flags, "file"), contentType = requiredValue(flags, "content-type");
10087
- if (!IMAGE_CONTENT_TYPES.some((allowed) => allowed === contentType)) throw new CliUsageError("--content-type must be one of: ".concat(
10088
- IMAGE_CONTENT_TYPES.join(", "),
10089
- "."
10090
- ));
10091
- const file = await readFile4(filePath);
10092
- if (file.byteLength > MAX_EVENT_IMAGE_UPLOAD_BYTES) throw new CliUsageError("The image must be 25 MB or smaller.");
10093
- 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 });
10094
- if (!uploadResponse.ok) throw new Error("Passport image upload failed with HTTP ".concat(uploadResponse.status, "."));
10095
- return signed;
10096
- }, "uploadPassportImage"), createSkinOperation = __name2((subcommand, { eventId, flags, allowed }) => {
10058
+ }, "saveSkin"), isUploadKind = __name2((kinds, value) => kinds.some((kind) => kind === value), "isUploadKind"), uploadPassportImage = __name2(
10059
+ async (eventId, kind, flags) => {
10060
+ const filePath = requiredValue(flags, "file"), contentType = requiredValue(flags, "content-type");
10061
+ if (!IMAGE_CONTENT_TYPES.some((allowed) => allowed === contentType)) throw new CliUsageError("--content-type must be one of: ".concat(IMAGE_CONTENT_TYPES.join(", "), "."));
10062
+ const file = await readFile4(filePath);
10063
+ if (file.byteLength > MAX_EVENT_IMAGE_UPLOAD_BYTES) throw new CliUsageError("The image must be 25 MB or smaller.");
10064
+ 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 });
10065
+ if (!uploadResponse.ok) throw new Error("Passport image upload failed with HTTP ".concat(uploadResponse.status, "."));
10066
+ return signed;
10067
+ },
10068
+ "uploadPassportImage"
10069
+ ), createSkinOperation = __name2((subcommand, { eventId, flags, allowed }) => {
10097
10070
  switch (subcommand) {
10098
10071
  case "get":
10099
10072
  return () => getPassportSkin(eventId);
10100
10073
  case "set": {
10101
10074
  allowed.push("appearance-version", "skin-json");
10102
10075
  const version2 = nonnegativeInteger(requiredValue(flags, "appearance-version"), "appearance-version"), patch = parseJsonRecord(requiredValue(flags, "skin-json"), "skin-json");
10103
- return () => saveSkin(
10104
- eventId,
10105
- version2,
10106
- (current) => mergeSkinPatch(current, patch)
10107
- );
10076
+ return () => saveSkin(eventId, version2, (current) => mergeSkinPatch(current, patch));
10108
10077
  }
10109
10078
  case "clear": {
10110
10079
  allowed.push("appearance-version");
@@ -10161,8 +10130,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10161
10130
  if (typeof value != "string" || !value.trim() || value.trim().length > maximum) throw new CliUsageError("".concat(name, " must be a non-empty string of at most ").concat(maximum, " characters."));
10162
10131
  return value.trim();
10163
10132
  }, "text"), nullableText = __name2((value, name, maximum) => {
10164
- if (value == null)
10165
- return null;
10133
+ if (value == null) return null;
10166
10134
  if (typeof value != "string" || value.trim().length > maximum) throw new CliUsageError("".concat(name, " must be a string of at most ").concat(maximum, " characters or null."));
10167
10135
  return value.trim();
10168
10136
  }, "nullableText"), categoryLabels = __name2((value) => {
@@ -10175,9 +10143,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10175
10143
  if (!parsed.success) throw new CliUsageError("info is invalid: ".concat(parsed.error.issues.map((issue2) => "".concat(issue2.path.join(".") || "info", " ").concat(issue2.message)).join("; ")));
10176
10144
  return parsed.data;
10177
10145
  }, "stationInfo"), object2 = __name2((value, name) => {
10178
- if (typeof value != "object" || value === null || Array.isArray(value)) throw new CliUsageError(
10179
- "".concat(name, " must be an object.")
10180
- );
10146
+ if (typeof value != "object" || value === null || Array.isArray(value)) throw new CliUsageError("".concat(name, " must be an object."));
10181
10147
  return Object.fromEntries(Object.entries(value));
10182
10148
  }, "object2"), json = __name2((value, name) => {
10183
10149
  try {
@@ -10192,7 +10158,8 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10192
10158
  if (value == null) return null;
10193
10159
  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."));
10194
10160
  const parsed = new Date(value);
10195
- if (Number.isNaN(parsed.getTime())) throw new CliUsageError("".concat(name, " must be a valid ISO date-time."));
10161
+ if (Number.isNaN(parsed.getTime()))
10162
+ throw new CliUsageError("".concat(name, " must be a valid ISO date-time."));
10196
10163
  return parsed;
10197
10164
  }, "date4"), parseStaffTallyCollection = __name2((item, extras) => {
10198
10165
  if (keys(item, ["collectionMode", "showHowToCollect", "showMyQr", "tallyItems", "tallyEarnsStamp", "stampValue", "category", "info"], "collection"), !Array.isArray(item.tallyItems)) throw new CliUsageError("tallyItems must be an array of item names.");
@@ -10220,14 +10187,21 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10220
10187
  }, "parseStaffScanMenuItems"), parsePassportCollection = __name2((raw) => {
10221
10188
  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") } };
10222
10189
  if (item.collectionMode === "STAFF_SCORE") return keys(item, ["collectionMode", "maxPoints", "stampValue", "category", "info", "showHowToCollect", "showMyQr"], "collection"), { collectionMode: "STAFF_SCORE", maxPoints: integer2(item.maxPoints, "maxPoints"), ...stampValue, ...category, ...info };
10223
- if (item.collectionMode === "STAFF_TALLY") return parseStaffTallyCollection(item, { ...stampValue, ...category, ...info });
10190
+ if (item.collectionMode === "STAFF_TALLY") return parseStaffTallyCollection(item, {
10191
+ ...stampValue,
10192
+ ...category,
10193
+ ...info
10194
+ });
10224
10195
  if (item.collectionMode === "SELF_SCAN" || item.collectionMode === "STAFF_SCAN") return parseStaffScanCollection(item, { ...stampValue, ...category, ...info });
10225
10196
  throw new CliUsageError("collectionMode must be SELF_SCAN, STAFF_SCAN, STAFF_SCORE or STAFF_TALLY.");
10226
10197
  }, "parsePassportCollection"), parsePassportStationInput = __name2((raw, eventId) => {
10227
10198
  const value = json(raw, "--station-json");
10228
10199
  keys(value, ["id", "name", "description", "location", "address", "imageKey", "order", "opensAt", "closesAt", "collection"], "Station");
10229
10200
  const collection = value.collection === void 0 ? void 0 : parsePassportCollection(value.collection);
10230
- 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 } : {} };
10201
+ 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(
10202
+ value.order ?? 0,
10203
+ "order"
10204
+ ), opensAt: date4(value.opensAt, "opensAt"), closesAt: date4(value.closesAt, "closesAt"), ...collection ? { collection } : {} };
10231
10205
  }, "parsePassportStationInput"), QUEUE_STATUS_FLAGS = { "under-10": "UNDER_10_MIN", "under-30": "UNDER_30_MIN", "over-30": "OVER_30_MIN", clear: null }, queueStatusFlag = __name2((value) => {
10232
10206
  const status = QUEUE_STATUS_FLAGS[value];
10233
10207
  if (status === void 0) throw new CliUsageError("--status must be one of ".concat(Object.keys(QUEUE_STATUS_FLAGS).join(", "), "."));
@@ -10238,10 +10212,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10238
10212
  for (const name of ["guestScan", "simplifiedChinese", "queueStatus"]) {
10239
10213
  const item = value[name];
10240
10214
  if (item !== void 0) {
10241
- if (typeof item != "boolean") throw new CliUsageError("".concat(
10242
- name,
10243
- " must be a JSON boolean."
10244
- ));
10215
+ if (typeof item != "boolean") throw new CliUsageError("".concat(name, " must be a JSON boolean."));
10245
10216
  switches[name] = item;
10246
10217
  }
10247
10218
  }
@@ -10257,7 +10228,11 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10257
10228
  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.");
10258
10229
  }
10259
10230
  if (value.linkedDrawEventId === void 0) throw new CliUsageError("linkedDrawEventId is required (use null to disable).");
10260
- return { eventId, luckyDrawStampThreshold: threshold(value.luckyDrawStampThreshold, "luckyDrawStampThreshold"), prizeStampThreshold: threshold(value.prizeStampThreshold, "prizeStampThreshold"), maxRedemptionsPerParticipant: integer2(value.maxRedemptionsPerParticipant, "maxRedemptionsPerParticipant", 0), linkedDrawEventId: value.linkedDrawEventId === null ? null : text(value.linkedDrawEventId, "linkedDrawEventId", 200), ...loginMethods ? { loginMethods } : {}, ...switches };
10231
+ return { eventId, luckyDrawStampThreshold: threshold(value.luckyDrawStampThreshold, "luckyDrawStampThreshold"), prizeStampThreshold: threshold(value.prizeStampThreshold, "prizeStampThreshold"), maxRedemptionsPerParticipant: integer2(
10232
+ value.maxRedemptionsPerParticipant,
10233
+ "maxRedemptionsPerParticipant",
10234
+ 0
10235
+ ), linkedDrawEventId: value.linkedDrawEventId === null ? null : text(value.linkedDrawEventId, "linkedDrawEventId", 200), ...loginMethods ? { loginMethods } : {}, ...switches };
10261
10236
  }, "parsePassportSettingsInput"), parsePassportRosterEntryInput = __name2((raw, eventId) => {
10262
10237
  const value = json(raw, "--entry-json");
10263
10238
  if (keys(value, ["id", "staffId", "lastName", "displayName"], "Roster entry"), value.lastName === void 0) throw new CliUsageError("lastName is required (use null for none).");
@@ -10268,11 +10243,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10268
10243
  return index;
10269
10244
  }, "headerIndex"), resolvePassportRosterMapping = __name2((headers, flags, requireLastName) => {
10270
10245
  const guess = guessPassportRosterMapping(headers), column = __name2((name, fallback) => {
10271
- const value = flag(
10272
- flags,
10273
- name,
10274
- !1
10275
- );
10246
+ const value = flag(flags, name, !1);
10276
10247
  return value === void 0 ? fallback : value.trim().toLowerCase() === "none" ? null : headerIndex(headers, value);
10277
10248
  }, "column"), staffIdFlag = flag(flags, "staff-id-column", !1), position = flag(flags, "surname-position", !1) ?? "last";
10278
10249
  if (position !== "last" && position !== "first") throw new CliUsageError("--surname-position must be last or first.");
@@ -10297,11 +10268,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10297
10268
  return (await Bun.stdin.text()).replace(new __cliRegExp("\\r?\\n$", ""), "");
10298
10269
  }, "readPasswordFromStdin"), searchFilters = __name2((flags) => {
10299
10270
  const search = flag(flags, "search", !1);
10300
- return search === void 0 ? {} : { search: text(
10301
- search,
10302
- "--search",
10303
- 200
10304
- ) };
10271
+ return search === void 0 ? {} : { search: text(search, "--search", 200) };
10305
10272
  }, "searchFilters"), recipientDirection = __name2((value) => {
10306
10273
  if (value !== void 0) {
10307
10274
  if (value === "forward" || value === "backward") return value;
@@ -10329,14 +10296,14 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10329
10296
  confirm(), operation = __name2(() => api2.event.passport.clearPassportStationPassword.mutate(event), "operation");
10330
10297
  break;
10331
10298
  case "stamps stats":
10332
- operation = __name2(() => api2.event.passport.getPassportStationStampStats.query(event), "operation");
10299
+ operation = __name2(
10300
+ () => api2.event.passport.getPassportStationStampStats.query(event),
10301
+ "operation"
10302
+ );
10333
10303
  break;
10334
10304
  case "stamps recipients": {
10335
10305
  allowed.push("station-id", "search", "limit", "cursor", "direction");
10336
- const payload = parseStampRecipientsInput(
10337
- flags,
10338
- station()
10339
- );
10306
+ const payload = parseStampRecipientsInput(flags, station());
10340
10307
  operation = __name2(() => api2.event.passport.getPassportStationStampRecipients.query(payload), "operation");
10341
10308
  break;
10342
10309
  }
@@ -10415,7 +10382,10 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10415
10382
  }
10416
10383
  case "station upsert": {
10417
10384
  allowed.push("station-json");
10418
- const payload = parsePassportStationInput(requiredFlag(flags, "station-json"), eventId);
10385
+ const payload = parsePassportStationInput(requiredFlag(
10386
+ flags,
10387
+ "station-json"
10388
+ ), eventId);
10419
10389
  operation = __name2(() => api2.event.passport.upsertPassportStation.mutate(payload), "operation");
10420
10390
  break;
10421
10391
  }
@@ -10446,10 +10416,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10446
10416
  }
10447
10417
  case "station queue-status": {
10448
10418
  allowed.push("station-id", "status");
10449
- const payload = { ...station(), status: queueStatusFlag(requiredFlag(
10450
- flags,
10451
- "status"
10452
- )) };
10419
+ const payload = { ...station(), status: queueStatusFlag(requiredFlag(flags, "status")) };
10453
10420
  operation = __name2(() => api2.event.passport.setStationQueueStatusAsStationStaff.mutate(payload), "operation");
10454
10421
  break;
10455
10422
  }
@@ -10467,7 +10434,11 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10467
10434
  }
10468
10435
  case "collect": {
10469
10436
  allowed.push("station-id", "profile-code", "points", "item", "site", "request-id");
10470
- 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) => {
10437
+ const points = flag(flags, "points", !1), item = flag(flags, "item", !1), payload = { ...station(), profileCode: requiredFlag(flags, "profile-code"), ...optionalEntry(
10438
+ "site",
10439
+ flag(flags, "site", !1),
10440
+ (raw) => text(raw, "--site", 60)
10441
+ ), ...optionalEntry("requestId", flag(flags, "request-id", !1), (raw) => {
10471
10442
  const parsed = passportRedemptionRequestIdSchema.safeParse(raw);
10472
10443
  if (!parsed.success) throw new CliUsageError("--request-id must be a UUID.");
10473
10444
  return parsed.data;
@@ -10502,7 +10473,11 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10502
10473
  case "prize upsert": {
10503
10474
  allowed.push("prize-json");
10504
10475
  const value = json(requiredFlag(flags, "prize-json"), "--prize-json");
10505
- keys(value, ["id", "name", "description", "imageKey", "stock", "stampCost", "order"], "Prize");
10476
+ keys(
10477
+ value,
10478
+ ["id", "name", "description", "imageKey", "stock", "stampCost", "order"],
10479
+ "Prize"
10480
+ );
10506
10481
  const payload = { eventId, ...optionalEntry("id", value.id, (raw) => text(raw, "id", 200)), name: text(value.name, "name", 100), description: nullableText(value.description, "description", 1e3), ...optionalEntry("imageKey", value.imageKey, (raw) => nullableText(raw, "imageKey", 2048)), stock: integer2(value.stock, "stock"), ...optionalEntry("stampCost", value.stampCost, (raw) => integer2(raw, "stampCost", 0, 1e5)), order: integer2(value.order ?? 0, "order") };
10507
10482
  operation = __name2(() => api2.event.passport.upsertPassportPrize.mutate(payload), "operation");
10508
10483
  break;
@@ -10515,14 +10490,14 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10515
10490
  }
10516
10491
  case "redemption create": {
10517
10492
  allowed.push("prize-id", "participant-id", "quantity", "award-station-id", "bonus-stamps", "request-id");
10518
- 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(
10519
- "bonusStamps",
10520
- bonusStamps,
10521
- (raw) => {
10522
- const value = integer2(raw, "--bonus-stamps", 0, 1e3);
10523
- return redeemPassportPrizeSchema.shape.bonusStamps.parse(value);
10524
- }
10525
- ), ...optionalEntry("awardStationId", awardStationId, (raw) => text(raw, "--award-station-id", 200)), ...optionalEntry("requestId", requestId, (raw) => {
10493
+ const quantity = flag(flags, "quantity", !1), awardStationId = flag(
10494
+ flags,
10495
+ "award-station-id",
10496
+ !1
10497
+ ), 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) => {
10498
+ const value = integer2(raw, "--bonus-stamps", 0, 1e3);
10499
+ return redeemPassportPrizeSchema.shape.bonusStamps.parse(value);
10500
+ }), ...optionalEntry("awardStationId", awardStationId, (raw) => text(raw, "--award-station-id", 200)), ...optionalEntry("requestId", requestId, (raw) => {
10526
10501
  const parsed = passportRedemptionRequestIdSchema.safeParse(raw);
10527
10502
  if (!parsed.success) throw new CliUsageError("--request-id must be a UUID.");
10528
10503
  return parsed.data;
@@ -10532,7 +10507,10 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10532
10507
  }
10533
10508
  case "redemption reverse": {
10534
10509
  allowed.push("redemption-id", "reason"), confirm();
10535
- const payload = { eventId, redemptionId: requiredFlag(flags, "redemption-id"), reason: requiredFlag(flags, "reason") };
10510
+ const payload = { eventId, redemptionId: requiredFlag(flags, "redemption-id"), reason: requiredFlag(
10511
+ flags,
10512
+ "reason"
10513
+ ) };
10536
10514
  operation = __name2(() => api2.event.passport.reversePassportRedemption.mutate(payload), "operation");
10537
10515
  break;
10538
10516
  }
@@ -10551,10 +10529,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10551
10529
  case "roster list": {
10552
10530
  allowed.push("search", "limit", "cursor");
10553
10531
  const search = flag(flags, "search", !1), 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)) };
10554
- operation = __name2(
10555
- () => api2.event.passport.getPassportRoster.query(payload),
10556
- "operation"
10557
- );
10532
+ operation = __name2(() => api2.event.passport.getPassportRoster.query(payload), "operation");
10558
10533
  break;
10559
10534
  }
10560
10535
  case "roster counts": {
@@ -10595,28 +10570,28 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
10595
10570
  break;
10596
10571
  default: {
10597
10572
  const mediaOperation = await createStationAccessOperation(action, { eventId, flags, allowed, station, confirm }) ?? createPassportMediaOperation(action, { eventId, flags, allowed });
10598
- if (!mediaOperation) throw new CliUsageError("Unknown passport command. Run et --help for supported commands.");
10573
+ if (!mediaOperation)
10574
+ throw new CliUsageError("Unknown passport command. Run et --help for supported commands.");
10599
10575
  operation = mediaOperation;
10600
10576
  }
10601
10577
  }
10602
10578
  const unknown2 = [...flags.keys()].filter((key) => key !== "api-url" && !allowed.includes(key));
10603
- if (unknown2.length) throw new CliUsageError(
10604
- "Unknown option(s): ".concat(unknown2.map((key) => "--".concat(key)).join(", "), ".")
10605
- );
10579
+ if (unknown2.length) throw new CliUsageError("Unknown option(s): ".concat(unknown2.map((key) => "--".concat(key)).join(", "), "."));
10606
10580
  await input.authenticate(), writeSuccess(input.runtime, await operation());
10607
10581
  }, "runPassportCommand");
10608
10582
  import { readFile as readFile6, writeFile } from "fs/promises";
10609
10583
  import { basename as basename4 } from "path";
10610
- 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_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(STAFF_REDEMPTION_EMPLOYEE_ID_MAX), staffRedemptionClientRequestIdSchema = uuid2(), staffRedemptionEventIdSchema = object({ eventId: idSchema }).strict(), staffRedemptionSiteIdSchema = staffRedemptionEventIdSchema.extend({ siteId: idSchema }).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(), 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.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 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 activity 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.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({
10611
- entity: _enum(STAFF_REDEMPTION_ARCHIVABLE),
10612
- id: idSchema,
10613
- archived: boolean2()
10614
- }).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().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(), lookupStaffRedemptionSchema = staffRedemptionSiteIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema }).strict(), 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(["all", "items-pending"]).default(
10615
- "all"
10616
- ) }).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: 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({ 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(
10617
- "^(worker|name|full\\s*name|employee\\s*name|staff\\s*name)$",
10618
- "i"
10619
- ), 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|balance)$", "i") }, guessStaffRedemptionRosterMapping = __name2((header) => {
10584
+ 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_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(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.extend({ employeeId: staffRedemptionEmployeeIdSchema, lastName: lastNameSchema }).strict(), requestStaffRedemptionEmployeeEmailOtpSchema = staffRedemptionEventIdSchema.extend(
10585
+ { email: email2().trim().toLowerCase() }
10586
+ ).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, 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 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 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 activity 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.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().int().min(0).max(STAFF_REDEMPTION_ALLOWANCE_MAX).optional() }).strict(), rosterFiltersShape = {
10587
+ search: string2().trim().max(200).optional(),
10588
+ siteId: idSchema.optional(),
10589
+ shift: staffRedemptionShiftSchema.optional(),
10590
+ archived: _enum(["active", "archived", "all"]).default("active"),
10591
+ collected: _enum(["any", "collected", "not-collected"]).default("any")
10592
+ }, 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(
10593
+ ids
10594
+ ).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.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({ 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|balance)$", "i") }, guessStaffRedemptionRosterMapping = __name2((header) => {
10620
10595
  const find = __name2((key) => {
10621
10596
  const index = header.findIndex((cell2) => HEADER_PATTERNS[key].test(cell2.trim()));
10622
10597
  return index === -1 ? null : index;
@@ -10628,7 +10603,13 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
10628
10603
  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) });
10629
10604
  }), rows.length > STAFF_REDEMPTION_ROSTER_IMPORT_MAX) throw new Error("A roster can have at most ".concat(STAFF_REDEMPTION_ROSTER_IMPORT_MAX, " rows."));
10630
10605
  return rows;
10631
- }, "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) => {
10606
+ }, "mapStaffRedemptionRosterTable"), optionalRosterColumns = [
10607
+ ["name", "name-column"],
10608
+ ["siteName", "site-column"],
10609
+ ["shift", "shift-column"],
10610
+ ["workShift", "work-shift-column"],
10611
+ ["allowance", "allowance-column"]
10612
+ ], 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) => {
10632
10613
  const wanted = name.trim().toLowerCase(), index = headers.findIndex((header) => header.trim().toLowerCase() === wanted);
10633
10614
  if (index === -1) throw new CliUsageError('Column "'.concat(name, '" is not in the file. Headers: ').concat(headers.join(", "), "."));
10634
10615
  return index;
@@ -10647,10 +10628,7 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
10647
10628
  throw new CliUsageError("Could not read ".concat(path2, ": ").concat(error2 instanceof Error ? error2.message : "unknown error"));
10648
10629
  }
10649
10630
  }, "readRosterTable"), prepareRosterImport = __name2(async (parsed) => {
10650
- const eventId = getRequiredFlag(parsed, "event-id"), path2 = getRequiredFlag(parsed, "file"), sheet = getOptionalFlag(
10651
- parsed,
10652
- "sheet"
10653
- );
10631
+ const eventId = getRequiredFlag(parsed, "event-id"), path2 = getRequiredFlag(parsed, "file"), sheet = getOptionalFlag(parsed, "sheet");
10654
10632
  assertStateChangeTarget(parsed, eventId);
10655
10633
  const table = await readRosterTable(path2, sheet), mapping = resolveStaffRedemptionRosterMapping(table[0] ?? [], parsed);
10656
10634
  let rows;
@@ -10675,7 +10653,9 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
10675
10653
  const label = "".concat(item.groupName, ": ").concat(item.name);
10676
10654
  return item.quantity === 1 ? label : "".concat(label, " x").concat(item.quantity);
10677
10655
  }).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) => {
10678
- const lines = [csvColumns.map(([header]) => csvCell(header)).join(","), ...rows.map((row) => csvColumns.map(([, read]) => csvCell(read(row))).join(","))];
10656
+ const lines = [csvColumns.map(
10657
+ ([header]) => csvCell(header)
10658
+ ).join(","), ...rows.map((row) => csvColumns.map(([, read]) => csvCell(read(row))).join(","))];
10679
10659
  return "\uFEFF".concat(lines.join(`\r
10680
10660
  `), `\r
10681
10661
  `);
@@ -10715,111 +10695,92 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
10715
10695
  }
10716
10696
  }, "runStaffRedemptionCommand"), command_manifest_default = [
10717
10697
  { 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"] } },
10718
- { path: [
10719
- "organization",
10720
- "member",
10721
- "list-all"
10722
- ], 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"] } },
10698
+ { 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"] } },
10723
10699
  { 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"] } },
10724
- { 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"] } },
10700
+ { 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: {
10701
+ organizationId: { type: "string", minLength: 1 },
10702
+ memberId: { type: "string", minLength: 1 }
10703
+ }, required: ["organizationId", "memberId"] } },
10725
10704
  { 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"] } },
10726
10705
  { 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"] } },
10727
10706
  { 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"] } },
10728
10707
  { path: ["organization", "invitation", "get"], procedure: "organization.getInvitation", operation: "query", summary: "Get one event or organization access invitation by ID.", effects: [], dates: [], input: { type: "object", properties: { invitationId: { type: "string", minLength: 1 } }, required: ["invitationId"] } },
10729
- {
10730
- path: ["organization", "invitation", "list-mine"],
10731
- procedure: "organization.getInvitedMemberships",
10732
- operation: "query",
10733
- summary: "List organization invitations addressed to the current user.",
10734
- effects: [],
10735
- dates: [],
10736
- input: null
10737
- },
10708
+ { path: ["organization", "invitation", "list-mine"], procedure: "organization.getInvitedMemberships", operation: "query", summary: "List organization invitations addressed to the current user.", effects: [], dates: [], input: null },
10738
10709
  { path: ["organization", "invitation", "organization"], procedure: "organization.getInvitedOrganizationById", operation: "query", summary: "Get the organization behind an invitation addressed to the current user.", effects: [], dates: [], input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] } },
10739
10710
  { 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"] } },
10740
10711
  { 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"] } },
10741
10712
  { 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"] } },
10742
10713
  { 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"] } },
10714
+ { 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"] } },
10715
+ { 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"] } },
10716
+ { 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", "STAFF_REDEMPTION"] } }, image: { type: ["string", "null"] } }, required: ["organizationId", "name"] } },
10717
+ { 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"] } },
10743
10718
  {
10744
- path: ["organization", "invitation", "cancel"],
10745
- procedure: "organization.cancelInvitation",
10719
+ path: ["organization", "archive"],
10720
+ procedure: "organization.archiveOrganization",
10746
10721
  operation: "mutation",
10747
- summary: "Cancel a pending organization invitation.",
10722
+ summary: "Archive an organization as its owner.",
10748
10723
  effects: ["state-change"],
10749
- target: "invitationId",
10724
+ target: "organizationId",
10750
10725
  dates: [],
10751
- input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, invitationId: { type: "string", minLength: 1 } }, required: ["organizationId", "invitationId"] }
10726
+ input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] }
10752
10727
  },
10753
- { 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"] } },
10754
- { 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", "STAFF_REDEMPTION"] } }, image: { type: ["string", "null"] } }, required: ["organizationId", "name"] } },
10755
- { 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"] } },
10756
- { 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"] } },
10757
10728
  { 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"] } },
10758
10729
  { 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"] } },
10759
10730
  { 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"] } },
10760
- { 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"] } },
10731
+ {
10732
+ path: ["organization", "event-types"],
10733
+ procedure: "organization.getAllowedEventTypeByOrganizationId",
10734
+ operation: "query",
10735
+ summary: "List the event types an organization may create.",
10736
+ effects: [],
10737
+ dates: [],
10738
+ input: { type: "object", properties: { organizationId: { type: "string" } }, required: ["organizationId"] }
10739
+ },
10761
10740
  { path: ["organization", "onboarding"], procedure: "organization.getOnboardingState", operation: "query", summary: "Get the current user's onboarding state.", effects: [], dates: [], input: null },
10762
- { 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: {
10763
- default: "active",
10764
- type: "string",
10765
- enum: ["active", "archived", "all"]
10766
- }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 6, type: "number", minimum: 1, maximum: 100 }, search: { default: "", type: "string" } } } },
10741
+ { 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" } } } },
10767
10742
  { 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"] } },
10768
10743
  { path: ["admin", "organization", "members"], procedure: "admin.organization.getOrganizationMembers", operation: "query", summary: "List an organization's members as a global admin, plus pendingInvitations not yet accepted (expired links included; shown when status is ALL or PENDING, filtered by search and role).", effects: [], dates: [], input: { type: "object", properties: { organizationId: { type: "string" }, search: { default: "", type: "string" }, role: { default: "ALL", type: "string", enum: ["ALL", "ADMIN", "MEMBER"] }, status: { default: "ALL", type: "string", enum: ["ALL", "PENDING", "ACTIVE", "LEFT", "REMOVED", "REJECTED"] } }, required: ["organizationId"] } },
10769
10744
  { path: ["admin", "organization", "stats"], procedure: "organization.getOrganizationStats", operation: "query", summary: "Get platform-wide organization totals as a global admin.", effects: [], dates: [], input: null },
10770
10745
  { path: ["admin", "organization", "archive"], procedure: "admin.organization.archiveOrganization", operation: "mutation", summary: "Archive any organization as a global admin.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } },
10771
10746
  { path: ["admin", "organization", "restore"], procedure: "admin.organization.restoreOrganization", operation: "mutation", summary: "Restore an archived organization as a global admin.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } },
10772
- {
10773
- path: ["admin", "event", "list"],
10774
- procedure: "admin.event.getEvents",
10775
- operation: "query",
10776
- summary: "List an organization's events as a global admin.",
10777
- effects: [],
10778
- dates: [],
10779
- input: { type: "object", properties: { organizationId: { type: "string" }, archiveStatus: { default: "active", type: "string", enum: ["active", "archived", "all"] }, limit: { default: 50, type: "number", minimum: 1, maximum: 100 }, offset: { default: 0, type: "number", minimum: 0 } }, required: ["organizationId"] }
10780
- },
10747
+ { path: ["admin", "event", "list"], procedure: "admin.event.getEvents", operation: "query", summary: "List an organization's events as a global admin.", effects: [], dates: [], input: { type: "object", properties: { organizationId: { type: "string" }, archiveStatus: { default: "active", type: "string", enum: ["active", "archived", "all"] }, limit: { default: 50, type: "number", minimum: 1, maximum: 100 }, offset: { default: 0, type: "number", minimum: 0 } }, required: ["organizationId"] } },
10781
10748
  { path: ["admin", "event", "get"], procedure: "admin.event.getEvent", operation: "query", summary: "Get any event by ID as a global admin.", effects: [], dates: [], input: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } },
10782
10749
  { path: ["admin", "member", "list"], procedure: "admin.member.getAllMembers", operation: "query", summary: "List organization members across every organization (paged; filter by search, organizationId, role, status, joinedFrom/joinedTo).", effects: [], dates: ["joinedFrom", "joinedTo"], input: { type: "object", properties: { search: { type: "string", maxLength: 200 }, organizationId: { type: "string", minLength: 1 }, role: { type: "string", enum: ["OWNER", "ADMIN", "MEMBER"] }, status: { type: "string", enum: ["PENDING", "ACTIVE", "LEFT", "REMOVED", "REJECTED"] }, joinedFrom: { type: "string", format: "date-time" }, joinedTo: { type: "string", format: "date-time" }, 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 } },
10783
10750
  { path: ["admin", "member", "count"], procedure: "admin.member.getMemberCounts", operation: "query", summary: "Count members matching the list filters, with role and status splits.", effects: [], dates: ["joinedFrom", "joinedTo"], input: { type: "object", properties: { search: { type: "string", maxLength: 200 }, organizationId: { type: "string", minLength: 1 }, role: { type: "string", enum: ["OWNER", "ADMIN", "MEMBER"] }, status: { type: "string", enum: ["PENDING", "ACTIVE", "LEFT", "REMOVED", "REJECTED"] }, joinedFrom: { type: "string", format: "date-time" }, joinedTo: { type: "string", format: "date-time" } }, additionalProperties: !1 } },
10784
10751
  { path: ["admin", "member", "export"], procedure: "admin.member.exportMembers", operation: "query", summary: "Export every member matching the list filters (fails above 5,000 rows).", effects: [], dates: ["joinedFrom", "joinedTo"], input: { type: "object", properties: { search: { type: "string", maxLength: 200 }, organizationId: { type: "string", minLength: 1 }, role: { type: "string", enum: ["OWNER", "ADMIN", "MEMBER"] }, status: { type: "string", enum: ["PENDING", "ACTIVE", "LEFT", "REMOVED", "REJECTED"] }, joinedFrom: { type: "string", format: "date-time" }, joinedTo: { type: "string", format: "date-time" } }, additionalProperties: !1 } },
10785
10752
  { path: ["admin", "member", "role-update"], procedure: "admin.member.updateMemberRole", operation: "mutation", summary: "Change any organization member's role as a global admin.", 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"] } },
10786
10753
  { path: ["admin", "member", "remove"], procedure: "admin.member.removeMember", operation: "mutation", summary: "Remove a member from an organization and delete their allowed-email entries.", effects: ["state-change", "delete"], target: "memberId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, memberId: { type: "string", minLength: 1 } }, required: ["organizationId", "memberId"] } },
10787
- { path: ["admin", "activity", "list"], procedure: "admin.activity.getAll", operation: "query", summary: "List organization and member activity-log events (paged; filter by search, organizationId, eventType, from/to).", effects: [], dates: ["from", "to"], input: { type: "object", properties: { search: { type: "string", maxLength: 200 }, organizationId: { type: "string", minLength: 1 }, eventType: { type: "string", enum: ["organization_provisioned", "organization_updated", "organization_archived", "organization_restored", "member_invited", "member_joined", "member_role_changed", "member_invitation_rejected", "member_left", "member_removed", "ownership_transferred"] }, from: { type: "string", format: "date-time" }, to: { type: "string", format: "date-time" }, limit: {
10788
- default: 25,
10789
- type: "integer",
10790
- minimum: 1,
10791
- maximum: 100
10792
- }, cursor: { anyOf: [{ type: "string", minLength: 1, maxLength: 2048 }, { type: "null" }] }, direction: { type: "string", const: "forward" } }, additionalProperties: !1 } },
10754
+ { path: ["admin", "activity", "list"], procedure: "admin.activity.getAll", operation: "query", summary: "List organization and member activity-log events (paged; filter by search, organizationId, eventType, from/to).", effects: [], dates: ["from", "to"], input: { type: "object", properties: { search: { type: "string", maxLength: 200 }, organizationId: { type: "string", minLength: 1 }, eventType: { type: "string", enum: ["organization_provisioned", "organization_updated", "organization_archived", "organization_restored", "member_invited", "member_joined", "member_role_changed", "member_invitation_rejected", "member_left", "member_removed", "ownership_transferred"] }, from: { type: "string", format: "date-time" }, to: { type: "string", format: "date-time" }, 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 } },
10793
10755
  { path: ["admin", "activity", "count"], procedure: "admin.activity.getCounts", operation: "query", summary: "Count activity matching the filters, with 30-day daily and type splits.", effects: [], dates: ["from", "to"], input: { type: "object", properties: { search: { type: "string", maxLength: 200 }, organizationId: { type: "string", minLength: 1 }, eventType: { type: "string", enum: ["organization_provisioned", "organization_updated", "organization_archived", "organization_restored", "member_invited", "member_joined", "member_role_changed", "member_invitation_rejected", "member_left", "member_removed", "ownership_transferred"] }, from: { type: "string", format: "date-time" }, to: { type: "string", format: "date-time" } }, additionalProperties: !1 } },
10794
10756
  { path: ["admin", "activity", "export"], procedure: "admin.activity.export", operation: "query", summary: "Export every activity event matching the filters (fails above 5,000 rows).", effects: [], dates: ["from", "to"], input: { type: "object", properties: { search: { type: "string", maxLength: 200 }, organizationId: { type: "string", minLength: 1 }, eventType: { type: "string", enum: ["organization_provisioned", "organization_updated", "organization_archived", "organization_restored", "member_invited", "member_joined", "member_role_changed", "member_invitation_rejected", "member_left", "member_removed", "ownership_transferred"] }, from: { type: "string", format: "date-time" }, to: { type: "string", format: "date-time" } }, additionalProperties: !1 } },
10795
10757
  { path: ["admin", "dashboard", "event-analytics"], procedure: "admin.dashboard.getEventAnalytics", operation: "query", summary: "Get platform event analytics as a global admin.", effects: [], dates: [], input: null },
10796
- { 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: {
10797
- default: 25,
10798
- type: "integer",
10799
- minimum: 1,
10800
- maximum: 100
10801
- }, cursor: { anyOf: [{ type: "string", minLength: 1, maxLength: 2048 }, { type: "null" }] }, direction: { type: "string", const: "forward" } }, additionalProperties: !1 } },
10758
+ { 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 } },
10802
10759
  { 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"] } },
10803
10760
  { 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"] } },
10804
- { 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: {
10805
- type: "string",
10806
- minLength: 1
10807
- }, organizationId: { type: "string", minLength: 1 }, allowArchived: { type: "boolean" } }, required: ["eventId", "organizationId"] } },
10761
+ { 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"] } },
10808
10762
  { 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"] } },
10809
10763
  { 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"] } },
10810
10764
  { 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"] } },
10811
- { 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: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 }, invitationId: { type: "string", minLength: 1 } }, required: ["eventId", "organizationId", "invitationId"] } },
10765
+ { 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: {
10766
+ eventId: { type: "string", minLength: 1 },
10767
+ organizationId: { type: "string", minLength: 1 },
10768
+ invitationId: { type: "string", minLength: 1 }
10769
+ }, required: ["eventId", "organizationId", "invitationId"] } },
10812
10770
  { 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"] } },
10813
- { 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: { 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"] } },
10771
+ { 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: {
10772
+ default: !1,
10773
+ type: "boolean"
10774
+ }, 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"] } },
10814
10775
  { 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"] } },
10815
10776
  { 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"] } },
10816
10777
  { path: ["event", "recent"], procedure: "event.getRecentEvents", operation: "query", summary: "List the events the current user opened most recently.", effects: [], dates: [], input: null },
10778
+ { 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"] } },
10779
+ { 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: "string" } }, backgroundImageKey: { type: ["string", "null"] }, id: { type: "string", minLength: 1 } }, required: ["organizationId", "name", "type", "location", "eventDateRange", "id"] } },
10817
10780
  { path: [
10818
10781
  "event",
10819
- "details"
10820
- ], 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"] } },
10821
- { 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: "string" } }, backgroundImageKey: { type: ["string", "null"] }, id: { type: "string", minLength: 1 } }, required: ["organizationId", "name", "type", "location", "eventDateRange", "id"] } },
10822
- { 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"] } },
10782
+ "status-update"
10783
+ ], 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"] } },
10823
10784
  { 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"] } },
10824
10785
  { 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"] } },
10825
10786
  { 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"] } },
@@ -10828,198 +10789,157 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
10828
10789
  { 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"] } },
10829
10790
  { 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"] } },
10830
10791
  { 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"] } },
10831
- { 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"] } },
10832
- { 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"] } },
10833
- { 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"] } },
10834
- { 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"] } },
10835
- { 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"] } },
10836
- { 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"] } },
10837
- { 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"] } },
10838
- { 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"] } },
10839
10792
  {
10840
- path: ["passport", "lucky-draws"],
10841
- procedure: "event.passport.getAvailableLuckyDraws",
10793
+ path: ["lucky-draw", "passport-sync"],
10794
+ procedure: "event.luckyDraw.getPassportDrawSyncStatus",
10842
10795
  operation: "query",
10843
- summary: "List lucky draw events a Passport can link to.",
10796
+ summary: "Show whether a Passport-linked draw roster is in sync.",
10844
10797
  effects: [],
10845
10798
  dates: [],
10846
10799
  input: { type: "object", properties: { eventId: { type: "string", minLength: 1 } }, required: ["eventId"] }
10847
10800
  },
10801
+ { 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"] } },
10802
+ { 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"] } },
10803
+ { path: ["lucky-draw", "boards", "list"], procedure: "event.luckyDraw.getLuckyDrawItemsByEventId", operation: "query", summary: "List an event's lucky draw boards (paged).", effects: [], dates: [], input: {
10804
+ type: "object",
10805
+ 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 } },
10806
+ required: ["eventId"]
10807
+ } },
10808
+ { 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"] } },
10809
+ { 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"] } },
10810
+ { 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"] } },
10811
+ { 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"] } },
10812
+ { 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"] } },
10848
10813
  { 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"] } },
10849
10814
  { 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"] } },
10850
10815
  { 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"] } },
10851
10816
  { 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"] } },
10852
- { 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: {
10853
- type: "string",
10854
- enum: ["PENDING", "APPROVED", "REJECTED"]
10855
- } }, required: ["eventId", "id", "status"] } },
10856
- { 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"] } },
10817
+ { 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"] } },
10818
+ { 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: {
10819
+ type: "object",
10820
+ properties: { eventId: { type: "string", minLength: 1, maxLength: 128, pattern: "^[a-zA-Z0-9_-]+$" } },
10821
+ required: ["eventId"]
10822
+ } },
10857
10823
  { 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"] } },
10858
10824
  { 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"] } },
10859
- { 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"] } },
10825
+ { 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: {
10826
+ type: "string"
10827
+ }, name: { type: "string" }, note: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 10, type: "number", minimum: 1, maximum: 100 } }, required: ["eventId"] } },
10860
10828
  { 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"] } },
10861
10829
  { 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"] } },
10862
10830
  { 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"] } },
10863
10831
  { 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"] } },
10864
10832
  { 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: ["eventId", "config"] } },
10865
- {
10866
- path: ["signature-wall", "signatures", "list"],
10867
- procedure: "event.signatureWall.getSignatureTable",
10868
- operation: "query",
10869
- summary: "List signatures (paged).",
10870
- effects: [],
10871
- dates: [],
10872
- 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 } }, required: ["eventId"] }
10873
- },
10833
+ { path: ["signature-wall", "signatures", "list"], procedure: "event.signatureWall.getSignatureTable", operation: "query", summary: "List signatures (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 } }, required: ["eventId"] } },
10874
10834
  { 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"] } },
10875
10835
  { 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"] } },
10876
10836
  { 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"] } },
10877
- { 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"] } },
10837
+ { path: ["rating", "config", "update"], procedure: "event.ratingSystem.updateRatingSystemConfig", operation: "mutation", summary: "Replace the Rating System config.", effects: [
10838
+ "state-change"
10839
+ ], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, config: { type: "object", properties: { mobileBackgroundImageKey: { type: ["string", "null"] } } } }, required: ["eventId", "config"] } },
10878
10840
  { 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"] } },
10879
- {
10880
- path: ["rating", "subjects", "list"],
10881
- procedure: "event.ratingSystem.getRatingSubjects",
10882
- operation: "query",
10883
- summary: "List rating subjects with their scores.",
10884
- effects: [],
10885
- dates: [],
10886
- input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] }
10887
- },
10841
+ { 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"] } },
10888
10842
  { 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"] } },
10889
- { 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: [
10890
- "id"
10891
- ] } },
10843
+ { 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"] } },
10892
10844
  { 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"] } },
10893
10845
  { 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"] } },
10894
- { 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: {
10895
- type: "string"
10896
- }, 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: { 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", "bingoCellDialogButtonColor", "bingoCellDialogUploadTextColor", "minRowsForBingo", "infoTextColor", "infoTextPosition", "mobileBackgroundColor", "loginTitle", "loginTitleColor", "loginButtonColor", "loginButtonTextColor", "loginCardBackgroundColor", "loginInputColor", "leaderboardCardBackgroundColor", "leaderboardCardTextColor", "leaderboardBorderColor"] } }, required: ["eventId", "config"] } },
10846
+ { 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: "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", "bingoCellDialogButtonColor", "bingoCellDialogUploadTextColor", "minRowsForBingo", "infoTextColor", "infoTextPosition", "mobileBackgroundColor", "loginTitle", "loginTitleColor", "loginButtonColor", "loginButtonTextColor", "loginCardBackgroundColor", "loginInputColor", "leaderboardCardBackgroundColor", "leaderboardCardTextColor", "leaderboardBorderColor"] } }, required: ["eventId", "config"] } },
10897
10847
  { 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"] } },
10898
- {
10899
- path: ["human-bingo", "items", "list"],
10900
- procedure: "event.humanBingo.admin.getHumanBingoItemsByEventId",
10901
- operation: "query",
10902
- summary: "List Human Bingo items.",
10903
- effects: [],
10904
- dates: [],
10905
- input: { type: "object", properties: { eventId: { type: "string" }, archiveStatus: { default: "active", type: "string", enum: ["active", "archived", "all"] } }, required: ["eventId"] }
10906
- },
10907
- { 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"] } },
10848
+ { 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"] } },
10849
+ { path: [
10850
+ "human-bingo",
10851
+ "items",
10852
+ "table"
10853
+ ], 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"] } },
10908
10854
  { 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"] } },
10909
- { 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: { type: "string", maxLength: 500 }, type: { default: "PHOTO_UPLOAD", type: "string", enum: [
10910
- "SINGLE_SELECT",
10911
- "TEXT_INPUT",
10912
- "PHOTO_UPLOAD",
10913
- "VIDEO_UPLOAD"
10914
- ] }, 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"] } },
10855
+ { 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: {
10856
+ type: "object",
10857
+ 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 } },
10858
+ required: ["name", "id"]
10859
+ } },
10915
10860
  { 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"] } },
10916
10861
  { 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"] } },
10917
10862
  { 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"] } },
10918
10863
  { 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"] } },
10919
10864
  { 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"] } },
10920
- {
10921
- path: ["human-bingo", "participants", "list"],
10922
- procedure: "event.humanBingo.admin.getParticipantsByEvent",
10923
- operation: "query",
10924
- summary: "List Human Bingo participants.",
10925
- effects: [],
10926
- dates: [],
10927
- input: { type: "object", properties: { eventId: { type: "string" }, archiveStatus: { default: "active", type: "string", enum: ["active", "archived", "all"] } }, required: ["eventId"] }
10928
- },
10865
+ { 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"] } },
10929
10866
  { 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"] } },
10930
10867
  { 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"] } },
10931
- { path: [
10932
- "human-bingo",
10933
- "participants",
10934
- "ban"
10935
- ], 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"] } },
10868
+ { 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"] } },
10936
10869
  { 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"] } },
10937
- { 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: {
10938
- ids: { type: "array", items: { type: "string" } }
10939
- }, required: ["ids"] } },
10870
+ { 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"] } },
10940
10871
  { 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"] } },
10941
- { 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: [
10942
- "PENDING",
10943
- "APPROVED",
10944
- "REJECTED"
10945
- ] } }, required: ["eventId"] } },
10946
- { 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"] } },
10947
- { 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), 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 } },
10948
- { path: ["staff-redemption", "settings", "update"], procedure: "event.staffRedemption.updateStaffRedemptionSettings", operation: "mutation", summary: "Update eligibleShifts, itemRule, wrongSite, sessionRule, drawPolicy, fixedWinRatePercent and counterOrder; 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; needs drawPolicy FIXED_RATE). 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.", 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: { 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"] }, fixedWinRatePercent: { type: "number", minimum: 0, maximum: 100 }, counterOrder: { type: "string", enum: ["FOOD_THEN_DRAW", "DRAW_THEN_FOOD"] }, overrideReason: { type: "string", minLength: 1, maxLength: 500 } }, required: ["eventId"], additionalProperties: !1 } },
10949
- { 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 } },
10950
- { 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: {
10951
- eventId: { type: "string", minLength: 1, maxLength: 64 },
10952
- siteId: { type: "string", minLength: 1, maxLength: 64 },
10953
- password: { type: "string", minLength: 6, maxLength: 128 }
10954
- }, required: ["eventId", "siteId", "password"], additionalProperties: !1 } },
10872
+ { 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"] } },
10873
+ { 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: {
10874
+ eventId: { type: "string" },
10875
+ id: { type: "string" },
10876
+ status: { type: "string", enum: ["PENDING", "APPROVED", "REJECTED"] },
10877
+ bingoCardId: { type: "string" }
10878
+ }, required: ["eventId", "id", "status", "bingoCardId"] } },
10879
+ { 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 } },
10880
+ { 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; needs drawPolicy FIXED_RATE). 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: { eventId: { type: "string", minLength: 1, maxLength: 64 }, eligibleShifts: { minItems: 1, maxItems: 20, type: "array", items: { type: "string", minLength: 1, maxLength: 8 } }, itemRule: { 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"] }, fixedWinRatePercent: { type: "number", minimum: 0, maximum: 100 }, counterOrder: { type: "string", enum: ["FOOD_THEN_DRAW", "DRAW_THEN_FOOD"] }, 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 } },
10881
+ {
10882
+ path: ["staff-redemption", "site", "upsert"],
10883
+ procedure: "event.staffRedemption.upsertStaffRedemptionSite",
10884
+ operation: "mutation",
10885
+ summary: "Create a site (omit siteId) or rename and reorder one (give siteId). Use staff-redemption archive set to archive or unarchive it.",
10886
+ effects: ["state-change"],
10887
+ target: "eventId",
10888
+ dates: [],
10889
+ 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 }
10890
+ },
10891
+ { 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 } },
10955
10892
  { 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 } },
10956
10893
  { 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" }, { type: "null" }] }, endsAt: { default: null, anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] } }, required: ["eventId", "name", "shift"], additionalProperties: !1 } },
10957
- { 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 } },
10958
- { 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 } },
10959
- { 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 } },
10960
- { 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: {
10894
+ { 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: {
10961
10895
  type: "string",
10962
10896
  minLength: 1,
10963
- maxLength: 120
10964
- }, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "name"], additionalProperties: !1 } },
10897
+ maxLength: 64
10898
+ }, setQuantity: { type: "integer", minimum: 0, maximum: 1e5 } }, required: ["eventId", "sessionId", "siteId", "setQuantity"], additionalProperties: !1 } },
10899
+ { 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 } },
10900
+ { 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 } },
10901
+ { 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 } },
10965
10902
  { 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 } },
10966
10903
  { 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: "Session 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 } },
10967
10904
  { 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 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: "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 } },
10968
- { 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 } },
10969
- { 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-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 } },
10970
10905
  {
10971
- path: ["staff-redemption", "archive", "set"],
10972
- procedure: "event.staffRedemption.setStaffRedemptionArchived",
10973
- operation: "mutation",
10974
- 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.",
10975
- effects: ["state-change"],
10976
- target: "eventId",
10906
+ path: ["staff-redemption", "rollover", "list"],
10907
+ procedure: "event.staffRedemption.getStaffRedemptionRollovers",
10908
+ operation: "query",
10909
+ 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.",
10910
+ effects: [],
10977
10911
  dates: [],
10978
- 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 }
10912
+ 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 }
10979
10913
  },
10980
- { 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: {
10981
- type: "string",
10982
- minLength: 1,
10983
- maxLength: 64
10984
- }, 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 } },
10985
- { 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: [
10914
+ { 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-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 } },
10915
+ { 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 } },
10916
+ { 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: [
10986
10917
  "active",
10987
10918
  "archived",
10988
10919
  "all"
10989
- ] }, collected: { default: "any", type: "string", enum: ["any", "collected", "not-collected"] } }, required: ["eventId"], additionalProperties: !1 } },
10990
- { 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: { anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }] }, allowance: { type: "integer", minimum: 0, maximum: 20 } }, required: ["eventId", "employeeId", "name", "siteName", "shift", "workShift"], additionalProperties: !1 } },
10991
- { 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: {
10992
- eventId: { type: "string", minLength: 1, maxLength: 64 },
10993
- search: { type: "string", maxLength: 200 },
10994
- siteId: { type: "string", minLength: 1, maxLength: 64 },
10995
- sessionId: { type: "string", minLength: 1, maxLength: 64 },
10996
- status: { default: "all", type: "string", enum: ["active", "items-pending", "voided", "all"] },
10997
- limit: { default: 25, type: "integer", minimum: 1, maximum: 100 },
10998
- cursor: { anyOf: [{ type: "string", minLength: 1, maxLength: 8192 }, { type: "null" }] },
10999
- direction: { type: "string", const: "forward" }
11000
- }, required: ["eventId"], additionalProperties: !1 } },
11001
- { 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: {
11002
- type: "object",
11003
- 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"] } },
11004
- required: ["eventId"],
11005
- additionalProperties: !1
11006
- } },
10920
+ ] }, 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 } },
10921
+ { 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 } },
10922
+ { path: [
10923
+ "staff-redemption",
10924
+ "roster",
10925
+ "upsert"
10926
+ ], 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: { anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }] }, allowance: { type: "integer", minimum: 0, maximum: 20 } }, required: ["eventId", "employeeId", "name", "siteName", "shift", "workShift"], additionalProperties: !1 } },
10927
+ { path: [
10928
+ "staff-redemption",
10929
+ "claims",
10930
+ "list"
10931
+ ], 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: { 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: [{
10932
+ type: "string",
10933
+ minLength: 1,
10934
+ maxLength: 8192
10935
+ }, { type: "null" }] }, direction: { type: "string", const: "forward" } }, required: ["eventId"], additionalProperties: !1 } },
10936
+ { 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 } },
11007
10937
  { 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 } },
11008
10938
  { 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 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 } },
11009
10939
  { 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, plus event-wide item totals.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId"], additionalProperties: !1 } },
11010
- { 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. 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, maxLength: 64 } }, required: ["eventId", "siteId"], additionalProperties: !1 } },
11011
- { path: ["staff-redemption", "lookup"], procedure: "event.staffRedemption.lookupStaffRedemptionEmployee", operation: "mutation", summary: "Look up an Employee ID at a site: who they are, 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: { type: "string", minLength: 1, maxLength: 64 }, employeeId: {
11012
- type: "string",
11013
- minLength: 1,
11014
- maxLength: 64
11015
- } }, required: ["eventId", "siteId", "employeeId"], additionalProperties: !1 } },
11016
- { 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: {
11017
- eventId: { type: "string", minLength: 1, maxLength: 64 },
11018
- siteId: { type: "string", minLength: 1, maxLength: 64 },
11019
- employeeId: { type: "string", minLength: 1, maxLength: 64 },
11020
- 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|ffffffff-ffff-ffff-ffff-ffffffffffff)$" },
11021
- itemIds: { maxItems: 20, type: "array", items: { type: "string", minLength: 1, maxLength: 64 } }
11022
- }, required: ["eventId", "siteId", "employeeId", "clientRequestId", "itemIds"], additionalProperties: !1 } },
10940
+ { 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, maxLength: 64 } }, required: ["eventId", "siteId"], additionalProperties: !1 } },
10941
+ { 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: { 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 } },
10942
+ { 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: "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|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 } },
11023
10943
  { 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: { 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 } },
11024
10944
  { 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 } }
11025
10945
  ], 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) => {
@@ -11030,7 +10950,9 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
11030
10950
  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."));
11031
10951
  return parsed;
11032
10952
  }
11033
- 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");
10953
+ const isArray = head.endsWith(
10954
+ "[]"
10955
+ ), 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");
11034
10956
  return key === "" ? apply(value) : !isRecord3(value) || !(key in value) ? value : { ...value, [key]: apply(value[key]) };
11035
10957
  }, "coerceDateAt"), coerceDates = __name2((input, datePaths) => datePaths.reduce((current, path2) => coerceDateAt(current, path2 === "" ? [] : path2.split("."), path2 || "input"), input), "coerceDates"), readInput = __name2(async (parsed, entry) => {
11036
10958
  const provided = parsed.flags.has("input") || parsed.flags.has("input-file");
@@ -11062,10 +10984,7 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
11062
10984
  const expected = targetText(isRecord3(input) ? input[entry.target] : void 0);
11063
10985
  if (expected === void 0) throw new CliUsageError("--input must include ".concat(entry.target, " so the target can be confirmed."));
11064
10986
  if (getOptionalFlag(parsed, "target") !== expected) throw new CliUsageError("--target must exactly match input.".concat(entry.target, " (").concat(expected, ")."));
11065
- }, "assertConfirmed"), describe2 = __name2((entry) => ({ command: commandName(entry), summary: entry.summary, procedure: entry.procedure, operation: entry.operation, effects: entry.effects, confirmation: entry.effects.length > 0 ? [
11066
- ...entry.effects.map((effect) => "--allow-".concat(effect)),
11067
- ...entry.target ? ["--target <input.".concat(entry.target).concat(entry.target.endsWith("s") ? " joined with commas" : "", ">")] : []
11068
- ] : [], 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) => {
10987
+ }, "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) => {
11069
10988
  const { parsed, runtime, authenticate } = input, entry = findManifestEntry(parsed.positionals);
11070
10989
  if (!entry) return !1;
11071
10990
  if (parsed.flags.has("help")) return assertOnlyFlags(parsed, ["help"]), writeSuccess(runtime, describe2(entry)), !0;
@@ -11094,9 +11013,7 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
11094
11013
  const parsed = parseJsonObject(value, "cursor");
11095
11014
  if (typeof parsed.id != "string" || parsed.id.length === 0) throw new CliUsageError("--cursor.id must be a non-empty string.");
11096
11015
  if (typeof parsed.createdAt != "string") throw new CliUsageError("--cursor.createdAt must be an ISO date string.");
11097
- const createdAt = new Date(
11098
- parsed.createdAt
11099
- );
11016
+ const createdAt = new Date(parsed.createdAt);
11100
11017
  if (Number.isNaN(createdAt.getTime())) throw new CliUsageError("--cursor.createdAt must be a valid date.");
11101
11018
  return { createdAt, id: parsed.id };
11102
11019
  }, "parseCursor"), parseRetainedIds = __name2((value) => {
@@ -11111,10 +11028,7 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
11111
11028
  return parsed;
11112
11029
  }, "parseRetainedIds"), luckyDrawParticipantFields = /* @__PURE__ */ new Set(["email", "luckyDrawId", "name"]), asParticipantRecord = __name2((participant, index) => {
11113
11030
  if (typeof participant != "object" || participant === null || Array.isArray(participant)) throw new CliUsageError("--participants[".concat(index, "] must be an object."));
11114
- if (Object.keys(participant).some((key) => !luckyDrawParticipantFields.has(key))) throw new CliUsageError("--participants[".concat(
11115
- index,
11116
- "] contains an unsupported field."
11117
- ));
11031
+ if (Object.keys(participant).some((key) => !luckyDrawParticipantFields.has(key))) throw new CliUsageError("--participants[".concat(index, "] contains an unsupported field."));
11118
11032
  return participant;
11119
11033
  }, "asParticipantRecord"), readParticipantField = __name2((participant, key) => key in participant ? participant[key] : void 0, "readParticipantField"), parseLuckyDrawParticipant = __name2((participant, index) => {
11120
11034
  const record = asParticipantRecord(participant, index), luckyDrawId = readParticipantField(record, "luckyDrawId"), name = readParticipantField(record, "name"), email3 = readParticipantField(record, "email");
@@ -11134,47 +11048,60 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
11134
11048
  }, "parseLuckyDrawParticipants"), parseAppearanceMediaType = __name2((value) => {
11135
11049
  if (value === "image" || value === "video") return value;
11136
11050
  throw new CliUsageError("--media-type must be one of: image, video.");
11137
- }, "parseAppearanceMediaType"), eventStatuses = ["DRAFT", "ONGOING", "COMPLETED", "ALL"], archiveStatuses = ["active", "archived", "all"], parseEventListStatus = __name2((value) => {
11138
- if (!eventStatuses.some((status) => status === value)) throw new CliUsageError("--status must be one of: ".concat(eventStatuses.join(", "), "."));
11139
- return value;
11140
- }, "parseEventListStatus"), parseArchiveStatus = __name2((value) => {
11051
+ }, "parseAppearanceMediaType"), eventStatuses = ["DRAFT", "ONGOING", "COMPLETED", "ALL"], archiveStatuses = ["active", "archived", "all"], parseEventListStatus = __name2(
11052
+ (value) => {
11053
+ if (!eventStatuses.some((status) => status === value)) throw new CliUsageError("--status must be one of: ".concat(eventStatuses.join(", "), "."));
11054
+ return value;
11055
+ },
11056
+ "parseEventListStatus"
11057
+ ), parseArchiveStatus = __name2((value) => {
11141
11058
  if (!archiveStatuses.some((status) => status === value)) throw new CliUsageError("--archive-status must be one of: ".concat(archiveStatuses.join(", "), "."));
11142
11059
  return value;
11143
11060
  }, "parseArchiveStatus"), parseCreatableEventType = __name2((value) => {
11144
11061
  const result = activeEventTypeSchema.safeParse(value);
11145
11062
  if (!result.success) throw new CliUsageError("--type must be one of: ".concat(activeEventTypeSchema.options.join(", "), "."));
11146
11063
  return result.data;
11147
- }, "parseCreatableEventType"), parseEventTypeList = __name2((value) => {
11148
- const types = value.split(",").map((type) => type.trim());
11149
- return [...new Set(types)].map((type) => {
11150
- const result = activeEventTypeSchema.safeParse(type);
11151
- if (!result.success) throw new CliUsageError("--allowed-event-types entries must be one of: ".concat(activeEventTypeSchema.options.join(", "), "."));
11152
- return result.data;
11153
- });
11154
- }, "parseEventTypeList"), parseIsoDateTime = __name2((value, name) => {
11064
+ }, "parseCreatableEventType"), parseEventTypeList = __name2(
11065
+ (value) => {
11066
+ const types = value.split(",").map((type) => type.trim());
11067
+ return [...new Set(types)].map((type) => {
11068
+ const result = activeEventTypeSchema.safeParse(type);
11069
+ if (!result.success) throw new CliUsageError("--allowed-event-types entries must be one of: ".concat(activeEventTypeSchema.options.join(", "), "."));
11070
+ return result.data;
11071
+ });
11072
+ },
11073
+ "parseEventTypeList"
11074
+ ), parseIsoDateTime = __name2((value, name) => {
11155
11075
  if (!new __cliRegExp("^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d", "").test(value)) throw new CliUsageError("--".concat(name, " must be an ISO 8601 date-time such as 2026-11-20T18:00:00+08:00."));
11156
11076
  const parsed = new Date(value);
11157
11077
  if (Number.isNaN(parsed.getTime())) throw new CliUsageError("--".concat(name, " must be a valid date-time."));
11158
11078
  return parsed;
11159
11079
  }, "parseIsoDateTime"), commandKey = __name2((action, subAction) => JSON.stringify([action ?? null, subAction ?? null]), "commandKey"), runAuthLogin = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl, cliVersion }) => {
11160
11080
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["no-browser"]);
11161
- const credentials = await loginWithBrowser({ apiBaseUrl, clientVersion: cliVersion, onVerification: __name2(({ browserOpened, userCode, verificationUriComplete }) => {
11162
- runtime.stderr.write("".concat(browserOpened ? "Opened" : "Open", " ").concat(verificationUriComplete, `
11081
+ const credentials = await loginWithBrowser({
11082
+ apiBaseUrl,
11083
+ clientVersion: cliVersion,
11084
+ onVerification: __name2(({ browserOpened, userCode, verificationUriComplete }) => {
11085
+ runtime.stderr.write("".concat(browserOpened ? "Opened" : "Open", " ").concat(verificationUriComplete, `
11163
11086
  Code: `).concat(userCode, `
11164
11087
  Waiting for approval\u2026
11165
11088
  `));
11166
- }, "onVerification"), ...parsed.flags.get("no-browser") === !0 ? { openBrowser: __name2(async () => !1, "openBrowser") } : {}, store: credentialStore });
11089
+ }, "onVerification"),
11090
+ ...parsed.flags.get("no-browser") === !0 ? { openBrowser: __name2(async () => !1, "openBrowser") } : {},
11091
+ store: credentialStore
11092
+ });
11167
11093
  writeSuccess(runtime, { authenticated: !0, session: credentials.session, storage: "Bun.secrets" });
11168
11094
  }, "runAuthLogin"), runAuthStatus = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl }) => {
11169
11095
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []);
11170
11096
  const credentials = await credentialStore.get();
11171
- writeSuccess(runtime, credentials && isCliCredentialForIssuer(
11172
- credentials,
11173
- apiBaseUrl
11174
- ) ? { authenticated: !0, accessTokenExpiresAt: credentials.accessTokenExpiresAt, refreshTokenExpiresAt: credentials.refreshTokenExpiresAt, session: credentials.session, storage: "Bun.secrets" } : { authenticated: !1, storage: "Bun.secrets" });
11097
+ 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" });
11175
11098
  }, "runAuthStatus"), runAuthLogout = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl }) => {
11176
11099
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), writeSuccess(runtime, { loggedOut: !0, ...await logoutCliSession({ apiBaseUrl, store: credentialStore }) });
11177
- }, "runAuthLogout"), runAuthWhoami = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11100
+ }, "runAuthLogout"), runAuthWhoami = __name2(async ({
11101
+ parsed,
11102
+ runtime,
11103
+ ensureAuthentication
11104
+ }) => {
11178
11105
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), await ensureAuthentication(), writeSuccess(runtime, await api2.auth.whoami.query(void 0));
11179
11106
  }, "runAuthWhoami"), runOrganizationList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11180
11107
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), await ensureAuthentication(), writeSuccess(runtime, await api2.organization.getOrganizationsForUser.query(void 0));
@@ -11182,28 +11109,26 @@ Waiting for approval\u2026
11182
11109
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["organization-id"]), await ensureAuthentication(), writeSuccess(runtime, await api2.organization.getOrganizationById.query({ organizationId: getRequiredFlag(parsed, "organization-id") }));
11183
11110
  }, "runOrganizationGet"), runOrganizationCreate = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11184
11111
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["name", "owner-email", "allowed-event-types"]);
11185
- const allowedEventTypes = getOptionalFlag(parsed, "allowed-event-types"), input = { name: getRequiredFlag(parsed, "name"), ownerEmail: getRequiredFlag(parsed, "owner-email"), ...allowedEventTypes === void 0 ? {} : { allowedEventTypes: parseEventTypeList(allowedEventTypes) } };
11112
+ const allowedEventTypes = getOptionalFlag(
11113
+ parsed,
11114
+ "allowed-event-types"
11115
+ ), input = { name: getRequiredFlag(parsed, "name"), ownerEmail: getRequiredFlag(parsed, "owner-email"), ...allowedEventTypes === void 0 ? {} : { allowedEventTypes: parseEventTypeList(allowedEventTypes) } };
11186
11116
  await ensureAuthentication(), writeSuccess(runtime, await api2.admin.organization.createOrganization.mutate(input));
11187
11117
  }, "runOrganizationCreate"), runEventCreate = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11188
- assertPositionalCount(
11189
- parsed,
11190
- 2
11191
- ), assertOnlyFlags(parsed, ["organization-id", "name", "type", "start", "end", "location"]);
11118
+ assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["organization-id", "name", "type", "start", "end", "location"]);
11192
11119
  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") } } };
11193
- await ensureAuthentication(), writeSuccess(runtime, await api2.event.createEvent.mutate(input));
11120
+ await ensureAuthentication(), writeSuccess(runtime, await api2.event.createEvent.mutate(
11121
+ input
11122
+ ));
11194
11123
  }, "runEventCreate"), runEventList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11195
11124
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["organization-id", "page", "per-page", "name", "status", "archive-status"]);
11196
- const input = {
11197
- organizationId: getRequiredFlag(parsed, "organization-id"),
11198
- page: parsePositiveInteger(getOptionalFlag(parsed, "page") ?? "1", "page"),
11199
- perPage: parsePositiveInteger(getOptionalFlag(parsed, "per-page") ?? "20", "per-page"),
11200
- name: getOptionalFlag(parsed, "name") ?? "",
11201
- status: parseEventListStatus(getOptionalFlag(parsed, "status") ?? "ALL"),
11202
- archiveStatus: parseArchiveStatus(getOptionalFlag(parsed, "archive-status") ?? "active")
11203
- };
11125
+ const input = { organizationId: getRequiredFlag(parsed, "organization-id"), page: parsePositiveInteger(getOptionalFlag(parsed, "page") ?? "1", "page"), perPage: parsePositiveInteger(getOptionalFlag(parsed, "per-page") ?? "20", "per-page"), name: getOptionalFlag(parsed, "name") ?? "", status: parseEventListStatus(getOptionalFlag(parsed, "status") ?? "ALL"), archiveStatus: parseArchiveStatus(getOptionalFlag(parsed, "archive-status") ?? "active") };
11204
11126
  await ensureAuthentication(), writeSuccess(runtime, await api2.event.getEventsByOrgId.query(input));
11205
11127
  }, "runEventList"), runEventGet = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11206
- assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["event-id"]), await ensureAuthentication(), writeSuccess(runtime, await api2.event.getEventForNav.query({ eventId: getRequiredFlag(parsed, "event-id") }));
11128
+ assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["event-id"]), await ensureAuthentication(), writeSuccess(runtime, await api2.event.getEventForNav.query({ eventId: getRequiredFlag(
11129
+ parsed,
11130
+ "event-id"
11131
+ ) }));
11207
11132
  }, "runEventGet"), runEventAppearanceGet = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11208
11133
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "public"]);
11209
11134
  const eventId = getRequiredFlag(parsed, "event-id");
@@ -11223,40 +11148,38 @@ Waiting for approval\u2026
11223
11148
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "file", "content-type", "media-type"]);
11224
11149
  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);
11225
11150
  await ensureAuthentication();
11226
- 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 });
11151
+ const signed = await api2.attachment.getPresignedUrlToUpload.mutate({ folder: "event-appearance/".concat(mediaType === "image" ? "images" : "videos"), fileName: basename5(
11152
+ filePath
11153
+ ), contentType, size: file.byteLength, eventId }), uploadResponse = await fetch(signed.uploadUrl, { method: "PUT", headers: { "content-type": contentType }, body: file });
11227
11154
  if (!uploadResponse.ok) throw new Error("Appearance media upload failed with HTTP ".concat(uploadResponse.status, "."));
11228
11155
  writeSuccess(runtime, signed);
11229
- }, "runEventAppearanceUpload"), runPhotoWallDisplayItems = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11230
- assertPositionalCount(parsed, 3), assertOnlyFlags(
11231
- parsed,
11232
- ["event-id", "limit", "cursor", "retained-ids"]
11233
- );
11234
- 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) };
11235
- await ensureAuthentication(), writeSuccess(runtime, await api2.event.photoWall.getPhotoWallDisplayItems.query(input));
11236
- }, "runPhotoWallDisplayItems"), runLuckyDrawPreDraw = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11156
+ }, "runEventAppearanceUpload"), runPhotoWallDisplayItems = __name2(
11157
+ async ({ parsed, runtime, ensureAuthentication }) => {
11158
+ assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "limit", "cursor", "retained-ids"]);
11159
+ 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) };
11160
+ await ensureAuthentication(), writeSuccess(runtime, await api2.event.photoWall.getPhotoWallDisplayItems.query(input));
11161
+ },
11162
+ "runPhotoWallDisplayItems"
11163
+ ), runLuckyDrawPreDraw = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11237
11164
  assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["event-id", "prize-count"]);
11238
11165
  const input = { eventId: getRequiredFlag(parsed, "event-id"), prizeCount: parsePositiveInteger(getRequiredFlag(parsed, "prize-count"), "prize-count") };
11239
11166
  await ensureAuthentication(), writeSuccess(runtime, await api2.event.luckyDraw.preDrawPrizes.mutate(input));
11240
- }, "runLuckyDrawPreDraw"), runLuckyDrawParticipantsReplace = __name2(
11241
- async ({ parsed, runtime, ensureAuthentication }) => {
11242
- assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "participants", "participants-file", "allow-state-change", "target"]);
11243
- const eventId = getRequiredFlag(parsed, "event-id");
11244
- assertStateChangeTarget(parsed, eventId);
11245
- const input = { eventId, participants: parseLuckyDrawParticipants(await readInlineOrFile(parsed, "participants", "participants-file")) };
11246
- await ensureAuthentication(), writeSuccess(runtime, await api2.event.luckyDraw.createLuckyDrawParticipant.mutate(input));
11247
- },
11248
- "runLuckyDrawParticipantsReplace"
11249
- ), runLuckyDrawParticipantsList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11167
+ }, "runLuckyDrawPreDraw"), runLuckyDrawParticipantsReplace = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11168
+ assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "participants", "participants-file", "allow-state-change", "target"]);
11169
+ const eventId = getRequiredFlag(parsed, "event-id");
11170
+ assertStateChangeTarget(parsed, eventId);
11171
+ const input = { eventId, participants: parseLuckyDrawParticipants(await readInlineOrFile(parsed, "participants", "participants-file")) };
11172
+ await ensureAuthentication(), writeSuccess(runtime, await api2.event.luckyDraw.createLuckyDrawParticipant.mutate(
11173
+ input
11174
+ ));
11175
+ }, "runLuckyDrawParticipantsReplace"), runLuckyDrawParticipantsList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
11250
11176
  assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "page", "per-page"]);
11251
11177
  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) };
11252
11178
  await ensureAuthentication(), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawParticipantsByEventId.query(input));
11253
- }, "runLuckyDrawParticipantsList"), organizationCommands = /* @__PURE__ */ new Map([[commandKey("list"), runOrganizationList], [commandKey("get"), runOrganizationGet], [commandKey("create"), runOrganizationCreate]]), commandTable = /* @__PURE__ */ new Map([
11254
- ["auth", /* @__PURE__ */ new Map([[commandKey("login"), runAuthLogin], [commandKey("status"), runAuthStatus], [commandKey("logout"), runAuthLogout], [commandKey("whoami"), runAuthWhoami]])],
11255
- ["organization", organizationCommands],
11256
- ["org", organizationCommands],
11257
- ["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]])],
11258
- ["lucky-draw", /* @__PURE__ */ new Map([[commandKey("pre-draw"), runLuckyDrawPreDraw], [commandKey("participants", "replace"), runLuckyDrawParticipantsReplace], [commandKey("participants", "list"), runLuckyDrawParticipantsList]])]
11259
- ]), runCommand = __name2(async (parsed, runtime, credentialStore, apiBaseUrl, configureAccessToken) => {
11179
+ }, "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], [
11180
+ "event",
11181
+ /* @__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]])
11182
+ ], ["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) => {
11260
11183
  const [group, action, subAction] = parsed.positionals, cliVersion = getInstalledCliVersion();
11261
11184
  let accessToken;
11262
11185
  const ensureAuthentication = __name2(async () => {