@go-labs-sg/event-tech 1.25.0 → 1.26.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/README.md +40 -1
- package/dist/index.js +477 -466
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
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 = {
|
|
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(
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
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(
|
|
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(
|
|
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("<", "g"), "<").replace(new __cliRegExp(">", "g"), ">").replace(new __cliRegExp(
|
|
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("<", "g"), "<").replace(new __cliRegExp(">", "g"), ">").replace(new __cliRegExp(
|
|
9820
|
+
""",
|
|
9821
|
+
"g"
|
|
9822
|
+
), '"').replace(new __cliRegExp("'", "g"), "'").replace(new __cliRegExp("&", "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(
|
|
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(
|
|
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
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
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 = [
|
|
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: [
|
|
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({
|
|
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(
|
|
9963
|
-
|
|
9964
|
-
showMyQr: boolean2().optional(),
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
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
|
-
(
|
|
10000
|
-
const
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
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(
|
|
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))
|
|
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(
|
|
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 {
|
|
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(
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
IMAGE_CONTENT_TYPES.join(", "),
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
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()))
|
|
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, {
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
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(
|
|
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)
|
|
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
|
-
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
"
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
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(), 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({ 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 = { search: string2().trim().max(200).optional(), siteId: idSchema.optional(), shift: staffRedemptionShiftSchema.optional(), archived: _enum(["active", "archived", "all"]).default("active"), collected: _enum([
|
|
10585
|
+
"any",
|
|
10586
|
+
"collected",
|
|
10587
|
+
"not-collected"
|
|
10588
|
+
]).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 = [
|
|
10589
|
+
"mine",
|
|
10590
|
+
"site"
|
|
10591
|
+
], 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(
|
|
10592
|
+
STAFF_REDEMPTION_ROSTER_IMPORT_MAX,
|
|
10593
|
+
" rows."
|
|
10594
|
+
)), 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;
|
|
@@ -10647,10 +10622,7 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10647
10622
|
throw new CliUsageError("Could not read ".concat(path2, ": ").concat(error2 instanceof Error ? error2.message : "unknown error"));
|
|
10648
10623
|
}
|
|
10649
10624
|
}, "readRosterTable"), prepareRosterImport = __name2(async (parsed) => {
|
|
10650
|
-
const eventId = getRequiredFlag(parsed, "event-id"), path2 = getRequiredFlag(parsed, "file"), sheet = getOptionalFlag(
|
|
10651
|
-
parsed,
|
|
10652
|
-
"sheet"
|
|
10653
|
-
);
|
|
10625
|
+
const eventId = getRequiredFlag(parsed, "event-id"), path2 = getRequiredFlag(parsed, "file"), sheet = getOptionalFlag(parsed, "sheet");
|
|
10654
10626
|
assertStateChangeTarget(parsed, eventId);
|
|
10655
10627
|
const table = await readRosterTable(path2, sheet), mapping = resolveStaffRedemptionRosterMapping(table[0] ?? [], parsed);
|
|
10656
10628
|
let rows;
|
|
@@ -10662,7 +10634,10 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10662
10634
|
if (rows.length === 0) throw new CliUsageError("".concat(path2, " has a header but no data rows."));
|
|
10663
10635
|
return { eventId, rows, archiveMissing: parsed.flags.get("archive-missing") === !0 };
|
|
10664
10636
|
}, "prepareRosterImport"), exportFilters = __name2((parsed, eventId) => {
|
|
10665
|
-
const checked = staffRedemptionExportSchema.safeParse({ eventId, search: getOptionalFlag(parsed, "search"), siteId: getOptionalFlag(parsed, "site-id"), sessionId: getOptionalFlag(parsed, "session-id"), status: getOptionalFlag(
|
|
10637
|
+
const checked = staffRedemptionExportSchema.safeParse({ eventId, search: getOptionalFlag(parsed, "search"), siteId: getOptionalFlag(parsed, "site-id"), sessionId: getOptionalFlag(parsed, "session-id"), status: getOptionalFlag(
|
|
10638
|
+
parsed,
|
|
10639
|
+
"status"
|
|
10640
|
+
) });
|
|
10666
10641
|
if (!checked.success) {
|
|
10667
10642
|
const issue2 = checked.error.issues[0], name = String(issue2?.path[0] ?? "filter");
|
|
10668
10643
|
throw new CliUsageError(name === "status" ? "--status must be active, items-pending, voided or all." : "Invalid ".concat(name, ": ").concat(issue2?.message ?? "the value is invalid", "."));
|
|
@@ -10714,42 +10689,46 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10714
10689
|
throw new CliUsageError("Unknown staff-redemption command. Run `et commands` for the registry commands and `et --help` for the rest.");
|
|
10715
10690
|
}
|
|
10716
10691
|
}, "runStaffRedemptionCommand"), command_manifest_default = [
|
|
10717
|
-
{ 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: {
|
|
10718
|
-
|
|
10719
|
-
"
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
{ path: ["organization", "member", "
|
|
10692
|
+
{ 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: {
|
|
10693
|
+
default: 1,
|
|
10694
|
+
type: "integer",
|
|
10695
|
+
exclusiveMinimum: 0,
|
|
10696
|
+
maximum: 9007199254740991
|
|
10697
|
+
}, perPage: { default: 10, type: "integer", minimum: 1, maximum: 100 }, search: { default: "", 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"] } },
|
|
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: {
|
|
10700
|
+
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,}$" },
|
|
10701
|
+
organizationId: { type: "string", minLength: 1 },
|
|
10702
|
+
organizationRole: { default: "MEMBER", type: "string", enum: ["OWNER", "ADMIN", "MEMBER"] }
|
|
10703
|
+
}, required: ["email", "organizationId"] } },
|
|
10724
10704
|
{ 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"] } },
|
|
10725
|
-
{ 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: {
|
|
10705
|
+
{ 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: {
|
|
10706
|
+
organizationId: { type: "string", minLength: 1 },
|
|
10707
|
+
memberId: { type: "string", minLength: 1 },
|
|
10708
|
+
isLeaving: { default: !1, type: "boolean" }
|
|
10709
|
+
}, required: ["organizationId", "memberId"] } },
|
|
10726
10710
|
{ 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
10711
|
{ 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
|
-
{ 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
10712
|
{
|
|
10730
|
-
path: ["organization", "invitation", "
|
|
10731
|
-
procedure: "organization.
|
|
10713
|
+
path: ["organization", "invitation", "get"],
|
|
10714
|
+
procedure: "organization.getInvitation",
|
|
10732
10715
|
operation: "query",
|
|
10733
|
-
summary: "
|
|
10716
|
+
summary: "Get one event or organization access invitation by ID.",
|
|
10734
10717
|
effects: [],
|
|
10735
10718
|
dates: [],
|
|
10736
|
-
input:
|
|
10719
|
+
input: { type: "object", properties: { invitationId: { type: "string", minLength: 1 } }, required: ["invitationId"] }
|
|
10737
10720
|
},
|
|
10721
|
+
{ path: ["organization", "invitation", "list-mine"], procedure: "organization.getInvitedMemberships", operation: "query", summary: "List organization invitations addressed to the current user.", effects: [], dates: [], input: null },
|
|
10738
10722
|
{ 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
|
-
{ 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: {
|
|
10723
|
+
{ 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: {
|
|
10724
|
+
type: "string"
|
|
10725
|
+
} }, required: ["organizationId"] } },
|
|
10740
10726
|
{ 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
10727
|
{ 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
|
-
{ 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: {
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
|
|
10746
|
-
operation: "mutation",
|
|
10747
|
-
summary: "Cancel a pending organization invitation.",
|
|
10748
|
-
effects: ["state-change"],
|
|
10749
|
-
target: "invitationId",
|
|
10750
|
-
dates: [],
|
|
10751
|
-
input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, invitationId: { type: "string", minLength: 1 } }, required: ["organizationId", "invitationId"] }
|
|
10752
|
-
},
|
|
10728
|
+
{ 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: {
|
|
10729
|
+
invitationId: { type: "string", minLength: 1 }
|
|
10730
|
+
}, required: ["invitationId"] } },
|
|
10731
|
+
{ 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"] } },
|
|
10753
10732
|
{ 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
10733
|
{ 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
10734
|
{ 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"] } },
|
|
@@ -10759,267 +10738,283 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10759
10738
|
{ 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
10739
|
{ 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"] } },
|
|
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
|
-
{ 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: {
|
|
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: {
|
|
10744
|
+
type: "string"
|
|
10745
|
+
}, 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
10746
|
{ path: ["admin", "organization", "stats"], procedure: "organization.getOrganizationStats", operation: "query", summary: "Get platform-wide organization totals as a global admin.", effects: [], dates: [], input: null },
|
|
10770
10747
|
{ 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
|
-
{ 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: {
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
|
|
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
|
-
},
|
|
10748
|
+
{ 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: {
|
|
10749
|
+
type: "object",
|
|
10750
|
+
properties: { id: { type: "string" } },
|
|
10751
|
+
required: ["id"]
|
|
10752
|
+
} },
|
|
10753
|
+
{ 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
10754
|
{ 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
|
-
{ 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: {
|
|
10755
|
+
{ 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: {
|
|
10756
|
+
type: "string",
|
|
10757
|
+
maxLength: 200
|
|
10758
|
+
}, 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
10759
|
{ 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
10760
|
{ 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
10761
|
{ 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
10762
|
{ 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: [
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10763
|
+
{ 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: [
|
|
10764
|
+
"organization_provisioned",
|
|
10765
|
+
"organization_updated",
|
|
10766
|
+
"organization_archived",
|
|
10767
|
+
"organization_restored",
|
|
10768
|
+
"member_invited",
|
|
10769
|
+
"member_joined",
|
|
10770
|
+
"member_role_changed",
|
|
10771
|
+
"member_invitation_rejected",
|
|
10772
|
+
"member_left",
|
|
10773
|
+
"member_removed",
|
|
10774
|
+
"ownership_transferred"
|
|
10775
|
+
] }, 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
10776
|
{ 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
10777
|
{ 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
10778
|
{ 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 } },
|
|
10779
|
+
{ 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
10780
|
{ 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
10781
|
{ 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
|
-
{
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10782
|
+
{
|
|
10783
|
+
path: ["event", "access", "mine"],
|
|
10784
|
+
procedure: "access.getMyEventAccess",
|
|
10785
|
+
operation: "query",
|
|
10786
|
+
summary: "Show the current user's role and permissions for an event.",
|
|
10787
|
+
effects: [],
|
|
10788
|
+
dates: [],
|
|
10789
|
+
input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 }, allowArchived: { type: "boolean" } }, required: ["eventId", "organizationId"] }
|
|
10790
|
+
},
|
|
10808
10791
|
{ 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
10792
|
{ 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
|
-
{ 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: [
|
|
10793
|
+
{ 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: [
|
|
10794
|
+
"eventId",
|
|
10795
|
+
"organizationId",
|
|
10796
|
+
"email",
|
|
10797
|
+
"role"
|
|
10798
|
+
] } },
|
|
10811
10799
|
{ 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"] } },
|
|
10812
|
-
{ 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: [
|
|
10800
|
+
{ 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: [
|
|
10801
|
+
"eventId",
|
|
10802
|
+
"organizationId",
|
|
10803
|
+
"invitationId"
|
|
10804
|
+
] } },
|
|
10813
10805
|
{ 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"] } },
|
|
10814
|
-
{
|
|
10806
|
+
{
|
|
10807
|
+
path: ["event", "access", "revoke"],
|
|
10808
|
+
procedure: "access.revokeEventAssignment",
|
|
10809
|
+
operation: "mutation",
|
|
10810
|
+
summary: "Revoke a user's event staff assignment.",
|
|
10811
|
+
effects: ["state-change"],
|
|
10812
|
+
target: "userId",
|
|
10813
|
+
dates: [],
|
|
10814
|
+
input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 }, userId: { type: "string", minLength: 1 } }, required: ["eventId", "organizationId", "userId"] }
|
|
10815
|
+
},
|
|
10815
10816
|
{ 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
10817
|
{ path: ["event", "recent"], procedure: "event.getRecentEvents", operation: "query", summary: "List the events the current user opened most recently.", effects: [], dates: [], input: null },
|
|
10817
|
-
{ path: [
|
|
10818
|
-
"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"] } },
|
|
10818
|
+
{ 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"] } },
|
|
10821
10819
|
{ 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
10820
|
{ 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"] } },
|
|
10823
|
-
{ path: ["event", "archive"], procedure: "event.archiveEvent", operation: "mutation", summary: "Archive an event.", effects: [
|
|
10821
|
+
{ path: ["event", "archive"], procedure: "event.archiveEvent", operation: "mutation", summary: "Archive an event.", effects: [
|
|
10822
|
+
"state-change"
|
|
10823
|
+
], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 }, organizationId: { type: "string", minLength: 1 } }, required: ["eventId", "organizationId"] } },
|
|
10824
10824
|
{ 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
10825
|
{ 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"] } },
|
|
10826
|
-
{ path: ["event", "export"], procedure: "event.getEventDataToExport", operation: "query", summary: "Export an event's submissions and results.", effects: [], dates: [], input: {
|
|
10826
|
+
{ path: ["event", "export"], procedure: "event.getEventDataToExport", operation: "query", summary: "Export an event's submissions and results.", effects: [], dates: [], input: {
|
|
10827
|
+
type: "object",
|
|
10828
|
+
properties: { eventId: { type: "string" } },
|
|
10829
|
+
required: ["eventId"]
|
|
10830
|
+
} },
|
|
10827
10831
|
{ path: ["event", "retired", "export"], procedure: "event.getRetiredEventExport", operation: "query", summary: "Export a retired Scavenger Hunt or Gardens by the Bay event (read-only): full setup and results with stable IDs, archived rows marked by archivedAt, and 1-hour signed media links. These types cannot be created or edited.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
|
|
10828
10832
|
{ 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
10833
|
{ 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
10834
|
{ 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
10835
|
{ 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: [
|
|
10836
|
+
{ 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: [
|
|
10837
|
+
"eventId"
|
|
10838
|
+
] } },
|
|
10833
10839
|
{ 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
10840
|
{ 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
10841
|
{ 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
10842
|
{ 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
10843
|
{ 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: {
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
operation: "query",
|
|
10843
|
-
summary: "List lucky draw events a Passport can link to.",
|
|
10844
|
-
effects: [],
|
|
10845
|
-
dates: [],
|
|
10846
|
-
input: { type: "object", properties: { eventId: { type: "string", minLength: 1 } }, required: ["eventId"] }
|
|
10847
|
-
},
|
|
10844
|
+
{ 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: {
|
|
10845
|
+
type: "string"
|
|
10846
|
+
}, ids: { type: "array", items: { type: "string" } } }, required: ["eventId", "ids"] } },
|
|
10847
|
+
{ 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
10848
|
{ 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
|
-
{ path: ["photo-wall", "items", "list"], procedure: "event.photoWall.getPhotoWallItemsByEventId", operation: "query", summary: "List Photo Wall photos (paged).", effects: [], dates: [], input: {
|
|
10849
|
+
{ path: ["photo-wall", "items", "list"], procedure: "event.photoWall.getPhotoWallItemsByEventId", operation: "query", summary: "List Photo Wall photos (paged).", effects: [], dates: [], input: {
|
|
10850
|
+
type: "object",
|
|
10851
|
+
properties: { eventId: { type: "string" }, name: { type: "string" }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 5, type: "number", minimum: 1, maximum: 100 } },
|
|
10852
|
+
required: ["eventId"]
|
|
10853
|
+
} },
|
|
10850
10854
|
{ 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
10855
|
{ 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", "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"] } },
|
|
10856
10857
|
{ 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"] } },
|
|
10857
|
-
{ 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: [
|
|
10858
|
+
{ 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: [
|
|
10859
|
+
"eventId"
|
|
10860
|
+
] } },
|
|
10858
10861
|
{ 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
10862
|
{ 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"] } },
|
|
10860
|
-
{ 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: {
|
|
10863
|
+
{ 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: {
|
|
10864
|
+
type: "object",
|
|
10865
|
+
properties: { eventId: { type: "string" }, ids: { type: "array", items: { type: "string" } } },
|
|
10866
|
+
required: ["eventId", "ids"]
|
|
10867
|
+
} },
|
|
10861
10868
|
{ 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
10869
|
{ 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
10870
|
{ 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
10871
|
{ 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
|
-
},
|
|
10872
|
+
{ 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
10873
|
{ 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
|
-
{ 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: {
|
|
10874
|
+
{ 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: {
|
|
10875
|
+
type: "object",
|
|
10876
|
+
properties: { ids: { type: "array", items: { type: "string" } } },
|
|
10877
|
+
required: ["ids"]
|
|
10878
|
+
} },
|
|
10876
10879
|
{ 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
10880
|
{ 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"] } },
|
|
10878
10881
|
{ 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
|
-
},
|
|
10882
|
+
{ 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
10883
|
{ 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: {
|
|
10890
|
-
|
|
10891
|
-
|
|
10884
|
+
{ 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: {
|
|
10885
|
+
id: { type: "string" },
|
|
10886
|
+
name: { type: "string", minLength: 1 },
|
|
10887
|
+
description: { type: ["string", "null"] },
|
|
10888
|
+
order: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 },
|
|
10889
|
+
imageKey: { type: ["string", "null"] }
|
|
10890
|
+
}, required: ["id"] } },
|
|
10892
10891
|
{ 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
10892
|
{ 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: {
|
|
10893
|
+
{ 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: {
|
|
10895
10894
|
type: "string"
|
|
10896
|
-
},
|
|
10895
|
+
}, 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
10896
|
{ 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"] } },
|
|
10897
|
+
{ 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"] } },
|
|
10898
|
+
{ 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"] } },
|
|
10899
|
+
{ 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"] } },
|
|
10898
10900
|
{
|
|
10899
|
-
path: ["human-bingo", "items", "
|
|
10900
|
-
procedure: "event.humanBingo.admin.
|
|
10901
|
-
operation: "
|
|
10902
|
-
summary: "
|
|
10903
|
-
effects: [],
|
|
10901
|
+
path: ["human-bingo", "items", "update"],
|
|
10902
|
+
procedure: "event.humanBingo.admin.editHumanBingoItems",
|
|
10903
|
+
operation: "mutation",
|
|
10904
|
+
summary: "Update one Human Bingo item.",
|
|
10905
|
+
effects: ["state-change"],
|
|
10906
|
+
target: "id",
|
|
10904
10907
|
dates: [],
|
|
10905
|
-
input: { type: "object", properties: {
|
|
10908
|
+
input: { 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 }, id: { type: "string", minLength: 1 } }, required: ["name", "id"] }
|
|
10906
10909
|
},
|
|
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"] } },
|
|
10908
|
-
{ 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"] } },
|
|
10915
10910
|
{ 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
|
-
{ 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: [
|
|
10911
|
+
{ 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: [
|
|
10912
|
+
"state-change"
|
|
10913
|
+
], target: "ids", dates: [], input: { type: "object", properties: { ids: { type: "array", items: { type: "string" } } }, required: ["ids"] } },
|
|
10917
10914
|
{ 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
10915
|
{ 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
10916
|
{ 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"] } },
|
|
10917
|
+
{ 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"] } },
|
|
10918
|
+
{ 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"] } },
|
|
10920
10919
|
{
|
|
10921
|
-
path: ["human-bingo", "participants", "
|
|
10922
|
-
procedure: "event.humanBingo.admin.
|
|
10920
|
+
path: ["human-bingo", "participants", "card"],
|
|
10921
|
+
procedure: "event.humanBingo.admin.getParticipantBingoCard",
|
|
10923
10922
|
operation: "query",
|
|
10924
|
-
summary: "
|
|
10923
|
+
summary: "Get one participant's bingo card.",
|
|
10925
10924
|
effects: [],
|
|
10926
10925
|
dates: [],
|
|
10927
|
-
input: { type: "object", properties: { eventId: { type: "string" },
|
|
10926
|
+
input: { type: "object", properties: { eventId: { type: "string" }, participantId: { type: "string" } }, required: ["eventId", "participantId"] }
|
|
10928
10927
|
},
|
|
10929
|
-
{ path: ["human-bingo", "participants", "
|
|
10930
|
-
{ 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"] } },
|
|
10928
|
+
{ 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
10929
|
{ 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"] } },
|
|
10930
|
+
{ 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
10931
|
{ 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: {
|
|
10942
|
-
"
|
|
10943
|
-
"
|
|
10944
|
-
"
|
|
10945
|
-
|
|
10932
|
+
{ 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: {
|
|
10933
|
+
eventId: { type: "string" },
|
|
10934
|
+
page: { default: 1, type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 },
|
|
10935
|
+
perPage: { default: 10, type: "integer", minimum: 1, maximum: 100 },
|
|
10936
|
+
name: { type: "string" },
|
|
10937
|
+
state: { default: "PENDING", type: "string", enum: ["PENDING", "APPROVED", "REJECTED"] }
|
|
10938
|
+
}, required: ["eventId"] } },
|
|
10946
10939
|
{ 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
10940
|
{ 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: {
|
|
10941
|
+
{ 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: {
|
|
10942
|
+
type: "string",
|
|
10943
|
+
minLength: 1,
|
|
10944
|
+
maxLength: 500
|
|
10945
|
+
} }, required: ["eventId"], additionalProperties: !1 } },
|
|
10949
10946
|
{ 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 } },
|
|
10947
|
+
{ 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
10948
|
{ 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
10949
|
{ 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
10950
|
{ 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: {
|
|
10951
|
+
{ 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: {
|
|
10952
|
+
type: "object",
|
|
10953
|
+
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 } },
|
|
10954
|
+
required: ["eventId", "name"],
|
|
10955
|
+
additionalProperties: !1
|
|
10956
|
+
} },
|
|
10959
10957
|
{ 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: {
|
|
10961
|
-
type: "string",
|
|
10962
|
-
minLength: 1,
|
|
10963
|
-
maxLength: 120
|
|
10964
|
-
}, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "name"], additionalProperties: !1 } },
|
|
10965
|
-
{ 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
|
-
{ 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
|
-
{ 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
10958
|
{
|
|
10971
|
-
path: ["staff-redemption", "
|
|
10972
|
-
procedure: "event.staffRedemption.
|
|
10959
|
+
path: ["staff-redemption", "prize", "upsert"],
|
|
10960
|
+
procedure: "event.staffRedemption.upsertStaffRedemptionPrize",
|
|
10973
10961
|
operation: "mutation",
|
|
10974
|
-
summary: "
|
|
10962
|
+
summary: "Create a prize (omit prizeId) or rename and reorder one. Stock is set per slot with staff-redemption prize-stock set.",
|
|
10975
10963
|
effects: ["state-change"],
|
|
10976
10964
|
target: "eventId",
|
|
10977
10965
|
dates: [],
|
|
10978
|
-
input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 },
|
|
10966
|
+
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 }
|
|
10979
10967
|
},
|
|
10980
|
-
{ path: ["staff-redemption", "
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
maxLength: 64
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
"active",
|
|
10987
|
-
"
|
|
10988
|
-
"
|
|
10989
|
-
|
|
10990
|
-
{ path: ["staff-redemption", "
|
|
10991
|
-
{ path: ["staff-redemption", "
|
|
10968
|
+
{ 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 } },
|
|
10969
|
+
{ 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 } },
|
|
10970
|
+
{ 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: {
|
|
10971
|
+
eventId: { type: "string", minLength: 1, maxLength: 64 },
|
|
10972
|
+
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." },
|
|
10973
|
+
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." },
|
|
10974
|
+
sets: { default: !0, description: "Move the leftover sets (set quantity minus active, not voided, redemptions) of each site. Defaults to true.", type: "boolean" },
|
|
10975
|
+
prizes: { default: !0, description: "Move the leftover prizes (stock minus prizes drawn and not released) of each site. Defaults to true.", type: "boolean" },
|
|
10976
|
+
reason: { type: "string", minLength: 1, maxLength: 300, description: "Why the leftovers move (1 to 300 characters). Recorded in the activity log." }
|
|
10977
|
+
}, required: ["eventId", "fromSessionId", "toSessionId", "reason"], additionalProperties: !1 } },
|
|
10978
|
+
{ 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 } },
|
|
10979
|
+
{ 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 } },
|
|
10980
|
+
{ 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 } },
|
|
10981
|
+
{ path: ["staff-redemption", "roster", "list"], procedure: "event.staffRedemption.getStaffRedemptionRoster", operation: "query", summary: "List roster entries (cursor paged); filter by search, siteId, shift, archived (active, archived, all) and collected (any, collected, not-collected).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, shift: { type: "string", minLength: 1, maxLength: 8 }, archived: { default: "active", type: "string", enum: ["active", "archived", "all"] }, collected: { default: "any", type: "string", enum: ["any", "collected", "not-collected"] }, limit: { default: 25, type: "integer", minimum: 1, maximum: 100 }, cursor: { anyOf: [{ type: "string", minLength: 1, maxLength: 8192 }, { type: "null" }] }, direction: { type: "string", const: "forward" } }, required: ["eventId"], additionalProperties: !1 } },
|
|
10982
|
+
{ 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: {
|
|
10992
10983
|
eventId: { type: "string", minLength: 1, maxLength: 64 },
|
|
10993
10984
|
search: { type: "string", maxLength: 200 },
|
|
10994
10985
|
siteId: { type: "string", minLength: 1, maxLength: 64 },
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
cursor: { anyOf: [{ type: "string", minLength: 1, maxLength: 8192 }, { type: "null" }] },
|
|
10999
|
-
direction: { type: "string", const: "forward" }
|
|
10986
|
+
shift: { type: "string", minLength: 1, maxLength: 8 },
|
|
10987
|
+
archived: { default: "active", type: "string", enum: ["active", "archived", "all"] },
|
|
10988
|
+
collected: { default: "any", type: "string", enum: ["any", "collected", "not-collected"] }
|
|
11000
10989
|
}, required: ["eventId"], additionalProperties: !1 } },
|
|
11001
|
-
{ path: ["staff-redemption", "
|
|
11002
|
-
type: "
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
} },
|
|
11007
|
-
{ 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
|
-
{ 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
|
-
{ 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: {
|
|
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: [
|
|
10991
|
+
{ type: "string", maxLength: 120 },
|
|
10992
|
+
{ type: "null" }
|
|
10993
|
+
] }, 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 } },
|
|
10994
|
+
{ path: ["staff-redemption", "claims", "list"], procedure: "event.staffRedemption.getStaffRedemptionClaims", operation: "query", summary: "List redemption claims, newest first (cursor paged), with items (with groupName), draw outcome, site, awayFromRosterSite (served at a site other than the roster site), session and void state; each row also has itemsPending (true while the prize was drawn but the food is not recorded yet) and itemsRecordedAt; filter by search, siteId, sessionId and status (active, items-pending, voided, all). items-pending is active claims that still wait for their food.", effects: [], dates: [], input: { type: "object", properties: { eventId: {
|
|
11012
10995
|
type: "string",
|
|
11013
10996
|
minLength: 1,
|
|
11014
10997
|
maxLength: 64
|
|
11015
|
-
} },
|
|
11016
|
-
{ path: ["staff-redemption", "
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
10998
|
+
}, 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: [{ type: "string", minLength: 1, maxLength: 8192 }, { type: "null" }] }, direction: { type: "string", const: "forward" } }, required: ["eventId"], additionalProperties: !1 } },
|
|
10999
|
+
{ 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: {
|
|
11000
|
+
type: "string",
|
|
11001
|
+
minLength: 1,
|
|
11002
|
+
maxLength: 64
|
|
11003
|
+
}, sessionId: { type: "string", minLength: 1, maxLength: 64 }, status: { default: "all", type: "string", enum: ["active", "items-pending", "voided", "all"] } }, required: ["eventId"], additionalProperties: !1 } },
|
|
11004
|
+
{ 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 } },
|
|
11005
|
+
{ 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: {
|
|
11006
|
+
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.",
|
|
11007
|
+
type: "boolean"
|
|
11008
|
+
} }, required: ["eventId", "drawId", "reason"], additionalProperties: !1 } },
|
|
11009
|
+
{ 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: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId", "siteId", "employeeId"], additionalProperties: !1 } },
|
|
11012
|
+
{ 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: {
|
|
11013
|
+
type: "object",
|
|
11014
|
+
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 } } },
|
|
11015
|
+
required: ["eventId", "siteId", "employeeId", "clientRequestId", "itemIds"],
|
|
11016
|
+
additionalProperties: !1
|
|
11017
|
+
} },
|
|
11023
11018
|
{ 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
11019
|
{ 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
11020
|
], 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) => {
|
|
@@ -11031,7 +11026,9 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
11031
11026
|
return parsed;
|
|
11032
11027
|
}
|
|
11033
11028
|
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");
|
|
11034
|
-
return key === "" ? apply(value) : !isRecord3(value) || !(key in value) ? value : { ...value, [key]: apply(
|
|
11029
|
+
return key === "" ? apply(value) : !isRecord3(value) || !(key in value) ? value : { ...value, [key]: apply(
|
|
11030
|
+
value[key]
|
|
11031
|
+
) };
|
|
11035
11032
|
}, "coerceDateAt"), coerceDates = __name2((input, datePaths) => datePaths.reduce((current, path2) => coerceDateAt(current, path2 === "" ? [] : path2.split("."), path2 || "input"), input), "coerceDates"), readInput = __name2(async (parsed, entry) => {
|
|
11036
11033
|
const provided = parsed.flags.has("input") || parsed.flags.has("input-file");
|
|
11037
11034
|
if (!entry.input) {
|
|
@@ -11062,17 +11059,26 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
11062
11059
|
const expected = targetText(isRecord3(input) ? input[entry.target] : void 0);
|
|
11063
11060
|
if (expected === void 0) throw new CliUsageError("--input must include ".concat(entry.target, " so the target can be confirmed."));
|
|
11064
11061
|
if (getOptionalFlag(parsed, "target") !== expected) throw new CliUsageError("--target must exactly match input.".concat(entry.target, " (").concat(expected, ")."));
|
|
11065
|
-
}, "assertConfirmed"), describe2 = __name2((entry) => ({
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
11062
|
+
}, "assertConfirmed"), describe2 = __name2((entry) => ({
|
|
11063
|
+
command: commandName(entry),
|
|
11064
|
+
summary: entry.summary,
|
|
11065
|
+
procedure: entry.procedure,
|
|
11066
|
+
operation: entry.operation,
|
|
11067
|
+
effects: entry.effects,
|
|
11068
|
+
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" : "", ">")] : []] : [],
|
|
11069
|
+
input: entry.input ? "--input '<json>' or --input-file <path> matching inputSchema" : "none",
|
|
11070
|
+
dateFields: entry.dates,
|
|
11071
|
+
inputSchema: entry.input
|
|
11072
|
+
}), "describe2"), resolveProcedureClient = __name2((procedure) => procedure.split(".").reduce((node2, segment) => node2[segment], api2), "resolveProcedureClient"), runRegistryCommand = __name2(async (input) => {
|
|
11069
11073
|
const { parsed, runtime, authenticate } = input, entry = findManifestEntry(parsed.positionals);
|
|
11070
11074
|
if (!entry) return !1;
|
|
11071
11075
|
if (parsed.flags.has("help")) return assertOnlyFlags(parsed, ["help"]), writeSuccess(runtime, describe2(entry)), !0;
|
|
11072
11076
|
assertOnlyFlags(parsed, registryFlags);
|
|
11073
11077
|
const procedureInput = await readInput(parsed, entry);
|
|
11074
11078
|
assertConfirmed(parsed, entry, procedureInput), await authenticate();
|
|
11075
|
-
const client = resolveProcedureClient(
|
|
11079
|
+
const client = resolveProcedureClient(
|
|
11080
|
+
entry.procedure
|
|
11081
|
+
);
|
|
11076
11082
|
return writeSuccess(runtime, entry.operation === "query" ? await client.query(procedureInput) : await client.mutate(procedureInput)), !0;
|
|
11077
11083
|
}, "runRegistryCommand"), getInstalledCliVersion = __name2(() => {
|
|
11078
11084
|
try {
|
|
@@ -11094,9 +11100,7 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
11094
11100
|
const parsed = parseJsonObject(value, "cursor");
|
|
11095
11101
|
if (typeof parsed.id != "string" || parsed.id.length === 0) throw new CliUsageError("--cursor.id must be a non-empty string.");
|
|
11096
11102
|
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
|
-
);
|
|
11103
|
+
const createdAt = new Date(parsed.createdAt);
|
|
11100
11104
|
if (Number.isNaN(createdAt.getTime())) throw new CliUsageError("--cursor.createdAt must be a valid date.");
|
|
11101
11105
|
return { createdAt, id: parsed.id };
|
|
11102
11106
|
}, "parseCursor"), parseRetainedIds = __name2((value) => {
|
|
@@ -11110,11 +11114,11 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
11110
11114
|
if (parsed.length > 100 || parsed.some((id) => typeof id != "string" || id.length === 0)) throw new CliUsageError("--retained-ids must contain at most 100 non-empty strings.");
|
|
11111
11115
|
return parsed;
|
|
11112
11116
|
}, "parseRetainedIds"), luckyDrawParticipantFields = /* @__PURE__ */ new Set(["email", "luckyDrawId", "name"]), asParticipantRecord = __name2((participant, index) => {
|
|
11113
|
-
if (typeof participant != "object" || participant === null || Array.isArray(participant)) throw new CliUsageError("--participants[".concat(
|
|
11114
|
-
if (Object.keys(participant).some((key) => !luckyDrawParticipantFields.has(key))) throw new CliUsageError("--participants[".concat(
|
|
11117
|
+
if (typeof participant != "object" || participant === null || Array.isArray(participant)) throw new CliUsageError("--participants[".concat(
|
|
11115
11118
|
index,
|
|
11116
|
-
"]
|
|
11119
|
+
"] must be an object."
|
|
11117
11120
|
));
|
|
11121
|
+
if (Object.keys(participant).some((key) => !luckyDrawParticipantFields.has(key))) throw new CliUsageError("--participants[".concat(index, "] contains an unsupported field."));
|
|
11118
11122
|
return participant;
|
|
11119
11123
|
}, "asParticipantRecord"), readParticipantField = __name2((participant, key) => key in participant ? participant[key] : void 0, "readParticipantField"), parseLuckyDrawParticipant = __name2((participant, index) => {
|
|
11120
11124
|
const record = asParticipantRecord(participant, index), luckyDrawId = readParticipantField(record, "luckyDrawId"), name = readParticipantField(record, "name"), email3 = readParticipantField(record, "email");
|
|
@@ -11138,7 +11142,9 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
11138
11142
|
if (!eventStatuses.some((status) => status === value)) throw new CliUsageError("--status must be one of: ".concat(eventStatuses.join(", "), "."));
|
|
11139
11143
|
return value;
|
|
11140
11144
|
}, "parseEventListStatus"), parseArchiveStatus = __name2((value) => {
|
|
11141
|
-
if (!archiveStatuses.some((status) => status === value)) throw new CliUsageError(
|
|
11145
|
+
if (!archiveStatuses.some((status) => status === value)) throw new CliUsageError(
|
|
11146
|
+
"--archive-status must be one of: ".concat(archiveStatuses.join(", "), ".")
|
|
11147
|
+
);
|
|
11142
11148
|
return value;
|
|
11143
11149
|
}, "parseArchiveStatus"), parseCreatableEventType = __name2((value) => {
|
|
11144
11150
|
const result = activeEventTypeSchema.safeParse(value);
|
|
@@ -11168,16 +11174,16 @@ Waiting for approval\u2026
|
|
|
11168
11174
|
}, "runAuthLogin"), runAuthStatus = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl }) => {
|
|
11169
11175
|
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []);
|
|
11170
11176
|
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" });
|
|
11177
|
+
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
11178
|
}, "runAuthStatus"), runAuthLogout = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl }) => {
|
|
11176
11179
|
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), writeSuccess(runtime, { loggedOut: !0, ...await logoutCliSession({ apiBaseUrl, store: credentialStore }) });
|
|
11177
11180
|
}, "runAuthLogout"), runAuthWhoami = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11178
11181
|
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), await ensureAuthentication(), writeSuccess(runtime, await api2.auth.whoami.query(void 0));
|
|
11179
11182
|
}, "runAuthWhoami"), runOrganizationList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11180
|
-
assertPositionalCount(
|
|
11183
|
+
assertPositionalCount(
|
|
11184
|
+
parsed,
|
|
11185
|
+
2
|
|
11186
|
+
), assertOnlyFlags(parsed, []), await ensureAuthentication(), writeSuccess(runtime, await api2.organization.getOrganizationsForUser.query(void 0));
|
|
11181
11187
|
}, "runOrganizationList"), runOrganizationGet = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11182
11188
|
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["organization-id"]), await ensureAuthentication(), writeSuccess(runtime, await api2.organization.getOrganizationById.query({ organizationId: getRequiredFlag(parsed, "organization-id") }));
|
|
11183
11189
|
}, "runOrganizationGet"), runOrganizationCreate = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
@@ -11185,22 +11191,12 @@ Waiting for approval\u2026
|
|
|
11185
11191
|
const allowedEventTypes = getOptionalFlag(parsed, "allowed-event-types"), input = { name: getRequiredFlag(parsed, "name"), ownerEmail: getRequiredFlag(parsed, "owner-email"), ...allowedEventTypes === void 0 ? {} : { allowedEventTypes: parseEventTypeList(allowedEventTypes) } };
|
|
11186
11192
|
await ensureAuthentication(), writeSuccess(runtime, await api2.admin.organization.createOrganization.mutate(input));
|
|
11187
11193
|
}, "runOrganizationCreate"), runEventCreate = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11188
|
-
assertPositionalCount(
|
|
11189
|
-
parsed,
|
|
11190
|
-
2
|
|
11191
|
-
), assertOnlyFlags(parsed, ["organization-id", "name", "type", "start", "end", "location"]);
|
|
11194
|
+
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["organization-id", "name", "type", "start", "end", "location"]);
|
|
11192
11195
|
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
11196
|
await ensureAuthentication(), writeSuccess(runtime, await api2.event.createEvent.mutate(input));
|
|
11194
11197
|
}, "runEventCreate"), runEventList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11195
11198
|
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
|
-
};
|
|
11199
|
+
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
11200
|
await ensureAuthentication(), writeSuccess(runtime, await api2.event.getEventsByOrgId.query(input));
|
|
11205
11201
|
}, "runEventList"), runEventGet = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11206
11202
|
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["event-id"]), await ensureAuthentication(), writeSuccess(runtime, await api2.event.getEventForNav.query({ eventId: getRequiredFlag(parsed, "event-id") }));
|
|
@@ -11208,7 +11204,10 @@ Waiting for approval\u2026
|
|
|
11208
11204
|
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "public"]);
|
|
11209
11205
|
const eventId = getRequiredFlag(parsed, "event-id");
|
|
11210
11206
|
if (parsed.flags.get("public") === !0) {
|
|
11211
|
-
writeSuccess(
|
|
11207
|
+
writeSuccess(
|
|
11208
|
+
runtime,
|
|
11209
|
+
await api2.public.getEventAppearance.query({ eventId })
|
|
11210
|
+
);
|
|
11212
11211
|
return;
|
|
11213
11212
|
}
|
|
11214
11213
|
await ensureAuthentication(), writeSuccess(runtime, await api2.event.getEventAppearance.query({ eventId }));
|
|
@@ -11218,45 +11217,55 @@ Waiting for approval\u2026
|
|
|
11218
11217
|
if (reset && appearanceValue !== void 0) throw new CliUsageError("Use either --appearance or --reset, not both.");
|
|
11219
11218
|
if (!reset && appearanceValue === void 0) throw new CliUsageError("--appearance is required unless --reset is provided.");
|
|
11220
11219
|
const input = { eventId: getRequiredFlag(parsed, "event-id"), appearanceVersion: parseNonnegativeInteger(getRequiredFlag(parsed, "appearance-version"), "appearance-version"), appearance: reset ? null : parseAppearance(appearanceValue) };
|
|
11221
|
-
await ensureAuthentication(), writeSuccess(
|
|
11220
|
+
await ensureAuthentication(), writeSuccess(
|
|
11221
|
+
runtime,
|
|
11222
|
+
await api2.event.updateEventAppearance.mutate(input)
|
|
11223
|
+
);
|
|
11222
11224
|
}, "runEventAppearanceUpdate"), runEventAppearanceUpload = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11223
11225
|
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "file", "content-type", "media-type"]);
|
|
11224
11226
|
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
11227
|
await ensureAuthentication();
|
|
11226
11228
|
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 });
|
|
11227
11229
|
if (!uploadResponse.ok) throw new Error("Appearance media upload failed with HTTP ".concat(uploadResponse.status, "."));
|
|
11228
|
-
writeSuccess(
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
parsed,
|
|
11232
|
-
["event-id", "limit", "cursor", "retained-ids"]
|
|
11230
|
+
writeSuccess(
|
|
11231
|
+
runtime,
|
|
11232
|
+
signed
|
|
11233
11233
|
);
|
|
11234
|
+
}, "runEventAppearanceUpload"), runPhotoWallDisplayItems = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11235
|
+
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "limit", "cursor", "retained-ids"]);
|
|
11234
11236
|
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
11237
|
await ensureAuthentication(), writeSuccess(runtime, await api2.event.photoWall.getPhotoWallDisplayItems.query(input));
|
|
11236
11238
|
}, "runPhotoWallDisplayItems"), runLuckyDrawPreDraw = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11237
11239
|
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["event-id", "prize-count"]);
|
|
11238
|
-
const input = { eventId: getRequiredFlag(parsed, "event-id"), prizeCount: parsePositiveInteger(getRequiredFlag(
|
|
11240
|
+
const input = { eventId: getRequiredFlag(parsed, "event-id"), prizeCount: parsePositiveInteger(getRequiredFlag(
|
|
11241
|
+
parsed,
|
|
11242
|
+
"prize-count"
|
|
11243
|
+
), "prize-count") };
|
|
11239
11244
|
await ensureAuthentication(), writeSuccess(runtime, await api2.event.luckyDraw.preDrawPrizes.mutate(input));
|
|
11240
|
-
}, "runLuckyDrawPreDraw"), runLuckyDrawParticipantsReplace = __name2(
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
},
|
|
11248
|
-
"runLuckyDrawParticipantsReplace"
|
|
11249
|
-
), runLuckyDrawParticipantsList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11245
|
+
}, "runLuckyDrawPreDraw"), runLuckyDrawParticipantsReplace = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11246
|
+
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "participants", "participants-file", "allow-state-change", "target"]);
|
|
11247
|
+
const eventId = getRequiredFlag(parsed, "event-id");
|
|
11248
|
+
assertStateChangeTarget(parsed, eventId);
|
|
11249
|
+
const input = { eventId, participants: parseLuckyDrawParticipants(await readInlineOrFile(parsed, "participants", "participants-file")) };
|
|
11250
|
+
await ensureAuthentication(), writeSuccess(runtime, await api2.event.luckyDraw.createLuckyDrawParticipant.mutate(input));
|
|
11251
|
+
}, "runLuckyDrawParticipantsReplace"), runLuckyDrawParticipantsList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11250
11252
|
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "page", "per-page"]);
|
|
11251
|
-
const input = { eventId: getRequiredFlag(parsed, "event-id"), page: parsePositiveInteger(
|
|
11253
|
+
const input = { eventId: getRequiredFlag(parsed, "event-id"), page: parsePositiveInteger(
|
|
11254
|
+
getOptionalFlag(parsed, "page") ?? "1",
|
|
11255
|
+
"page"
|
|
11256
|
+
), perPage: parseBoundedInteger(getOptionalFlag(parsed, "per-page") ?? "100", "per-page", 1, 100) };
|
|
11252
11257
|
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
|
-
[
|
|
11255
|
-
["
|
|
11256
|
-
["
|
|
11257
|
-
[
|
|
11258
|
-
[
|
|
11259
|
-
|
|
11258
|
+
}, "runLuckyDrawParticipantsList"), organizationCommands = /* @__PURE__ */ new Map([[commandKey("list"), runOrganizationList], [commandKey("get"), runOrganizationGet], [commandKey("create"), runOrganizationCreate]]), commandTable = /* @__PURE__ */ new Map([["auth", /* @__PURE__ */ new Map([[commandKey("login"), runAuthLogin], [commandKey("status"), runAuthStatus], [commandKey("logout"), runAuthLogout], [commandKey("whoami"), runAuthWhoami]])], ["organization", organizationCommands], ["org", organizationCommands], ["event", /* @__PURE__ */ new Map([
|
|
11259
|
+
[commandKey("create"), runEventCreate],
|
|
11260
|
+
[commandKey("list"), runEventList],
|
|
11261
|
+
[commandKey("get"), runEventGet],
|
|
11262
|
+
[commandKey("appearance", "get"), runEventAppearanceGet],
|
|
11263
|
+
[commandKey("appearance", "update"), runEventAppearanceUpdate],
|
|
11264
|
+
[commandKey("appearance", "reset"), runEventAppearanceUpdate],
|
|
11265
|
+
[commandKey("appearance", "upload"), runEventAppearanceUpload],
|
|
11266
|
+
[commandKey("photo-wall", "display-items"), runPhotoWallDisplayItems],
|
|
11267
|
+
[commandKey("photo-wall", "display"), runPhotoWallDisplayItems]
|
|
11268
|
+
])], ["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
11269
|
const [group, action, subAction] = parsed.positionals, cliVersion = getInstalledCliVersion();
|
|
11261
11270
|
let accessToken;
|
|
11262
11271
|
const ensureAuthentication = __name2(async () => {
|
|
@@ -11287,7 +11296,9 @@ Waiting for approval\u2026
|
|
|
11287
11296
|
const handler = group === void 0 ? void 0 : commandTable.get(group)?.get(commandKey(action, subAction));
|
|
11288
11297
|
if (handler === void 0) throw new CliUsageError("Unknown command. Run `et --help` for available commands.");
|
|
11289
11298
|
await handler({ parsed, runtime, credentialStore, apiBaseUrl, cliVersion, ensureAuthentication });
|
|
11290
|
-
}, "runCommand"), runCli = __name2(async (args, runtime = processRuntime, credentialStore = createBunCredentialStore(
|
|
11299
|
+
}, "runCommand"), runCli = __name2(async (args, runtime = processRuntime, credentialStore = createBunCredentialStore(
|
|
11300
|
+
{ product: "event-tech" }
|
|
11301
|
+
), configureAccessToken = configureEventTechAccessToken) => {
|
|
11291
11302
|
try {
|
|
11292
11303
|
const parsed = parseArguments(args), apiUrl = getOptionalFlag(parsed, "api-url");
|
|
11293
11304
|
return apiUrl ? configureEventTechApiBaseUrl(apiUrl) : configureEventTechApiFromEnvironment(), await runCommand(parsed, runtime, credentialStore, getEventTechApiBaseUrl(), configureAccessToken), 0;
|