@go-labs-sg/event-tech 1.28.0 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -18
- package/command-reference.md +9 -9
- package/dist/index.js +441 -690
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -60,15 +60,13 @@ var __export = __name2((target, all) => {
|
|
|
60
60
|
y[45] = 1, y[46] = 1, y[95] = 1;
|
|
61
61
|
function H(e) {
|
|
62
62
|
let n = {}, t = e.toString();
|
|
63
|
-
t = t.replace(new __cliRegExp("\\r\\n?", "mg"),
|
|
64
|
-
`);
|
|
63
|
+
t = t.replace(new __cliRegExp("\\r\\n?", "mg"), "\n");
|
|
65
64
|
let r;
|
|
66
65
|
for (; (r = G.exec(t)) != null; ) {
|
|
67
66
|
let o = r[1], i = r[2] || "";
|
|
68
67
|
i = i.trim();
|
|
69
68
|
let c = i[0];
|
|
70
|
-
i = i.replace(new __cliRegExp("^(['\"`])([\\s\\S]*)\\1$", "mg"), "$2"), c === '"' && (i = i.replace(new __cliRegExp("\\\\n", "g"),
|
|
71
|
-
`), i = i.replace(new __cliRegExp("\\\\r", "g"), "\r")), n[o] = i;
|
|
69
|
+
i = i.replace(new __cliRegExp("^(['\"`])([\\s\\S]*)\\1$", "mg"), "$2"), c === '"' && (i = i.replace(new __cliRegExp("\\\\n", "g"), "\n"), i = i.replace(new __cliRegExp("\\\\r", "g"), "\r")), n[o] = i;
|
|
72
70
|
}
|
|
73
71
|
return n;
|
|
74
72
|
}
|
|
@@ -83,8 +81,7 @@ var __export = __name2((target, all) => {
|
|
|
83
81
|
__name(O, "O"), __name2(O, "O");
|
|
84
82
|
function V(e) {
|
|
85
83
|
let n = {}, t = typeof e == "string" ? e : e.toString();
|
|
86
|
-
t.indexOf("\r") !== -1 && (t = t.replace(new __cliRegExp("\\r\\n?", "g"),
|
|
87
|
-
`));
|
|
84
|
+
t.indexOf("\r") !== -1 && (t = t.replace(new __cliRegExp("\\r\\n?", "g"), "\n"));
|
|
88
85
|
let r = t.length, o = 0;
|
|
89
86
|
for (; o < r; ) {
|
|
90
87
|
let i = t.charCodeAt(o);
|
|
@@ -138,8 +135,7 @@ var __export = __name2((target, all) => {
|
|
|
138
135
|
}
|
|
139
136
|
}
|
|
140
137
|
if (!q) {
|
|
141
|
-
let u = t.indexOf(
|
|
142
|
-
`, d);
|
|
138
|
+
let u = t.indexOf("\n", d);
|
|
143
139
|
u === -1 && (u = r);
|
|
144
140
|
let s;
|
|
145
141
|
if (r < 4096) s = t.indexOf("#", d), (s === -1 || s > u) && (s = u);
|
|
@@ -152,8 +148,7 @@ var __export = __name2((target, all) => {
|
|
|
152
148
|
}
|
|
153
149
|
C === 34 && (q || l < o) && a.indexOf("\\") !== -1 && (a = a.replace(
|
|
154
150
|
new __cliRegExp("\\\\n", "g"),
|
|
155
|
-
|
|
156
|
-
`
|
|
151
|
+
"\n"
|
|
157
152
|
).replace(new __cliRegExp("\\\\r", "g"), "\r")), n[k] = a;
|
|
158
153
|
}
|
|
159
154
|
return n;
|
|
@@ -2557,7 +2552,8 @@ var __export = __name2((target, all) => {
|
|
|
2557
2552
|
}
|
|
2558
2553
|
__name(lm_init, "lm_init"), __name2(lm_init, "lm_init");
|
|
2559
2554
|
function DeflateState() {
|
|
2560
|
-
this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc =
|
|
2555
|
+
this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Z_DEFLATED, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2), this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2), this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2), zero(this.dyn_ltree), zero(this.dyn_dtree), zero(this.bl_tree), this.l_desc =
|
|
2556
|
+
null, this.d_desc = null, this.bl_desc = null, this.bl_count = new utils.Buf16(MAX_BITS + 1), this.heap = new utils.Buf16(2 * L_CODES + 1), zero(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new utils.Buf16(2 * L_CODES + 1), zero(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
|
|
2561
2557
|
}
|
|
2562
2558
|
__name(DeflateState, "DeflateState"), __name2(DeflateState, "DeflateState");
|
|
2563
2559
|
function deflateResetKeep(strm) {
|
|
@@ -2594,7 +2590,8 @@ var __export = __name2((target, all) => {
|
|
|
2594
2590
|
var old_flush, s, beg, val;
|
|
2595
2591
|
if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
|
|
2596
2592
|
if (s = strm.state, !strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH) return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR);
|
|
2597
|
-
if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE) if (s.wrap === 2) strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), s.gzhead ? (put_byte(s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (s.gzhead.extra ? 4 : 0) + (s.gzhead.name ? 8 : 0) + (s.gzhead.comment ? 16 : 0)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length && (put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255)), s.gzhead.hcrc && (strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0)), s.gzindex = 0, s.status = EXTRA_STATE) : (put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY ||
|
|
2593
|
+
if (s.strm = strm, old_flush = s.last_flush, s.last_flush = flush, s.status === INIT_STATE) if (s.wrap === 2) strm.adler = 0, put_byte(s, 31), put_byte(s, 139), put_byte(s, 8), s.gzhead ? (put_byte(s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (s.gzhead.extra ? 4 : 0) + (s.gzhead.name ? 8 : 0) + (s.gzhead.comment ? 16 : 0)), put_byte(s, s.gzhead.time & 255), put_byte(s, s.gzhead.time >> 8 & 255), put_byte(s, s.gzhead.time >> 16 & 255), put_byte(s, s.gzhead.time >> 24 & 255), put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0), put_byte(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length && (put_byte(s, s.gzhead.extra.length & 255), put_byte(s, s.gzhead.extra.length >> 8 & 255)), s.gzhead.hcrc && (strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0)), s.gzindex = 0, s.status = EXTRA_STATE) : (put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, 0), put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY ||
|
|
2594
|
+
s.level < 2 ? 4 : 0), put_byte(s, OS_CODE), s.status = BUSY_STATE);
|
|
2598
2595
|
else {
|
|
2599
2596
|
var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8, level_flags = -1;
|
|
2600
2597
|
s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? level_flags = 0 : s.level < 6 ? level_flags = 1 : s.level === 6 ? level_flags = 2 : level_flags = 3, header |= level_flags << 6, s.strstart !== 0 && (header |= PRESET_DICT), header += 31 - header % 31, s.status = BUSY_STATE, putShortMSB(s, header), s.strstart !== 0 && (putShortMSB(s, strm.adler >>> 16), putShortMSB(s, strm.adler & 65535)), strm.adler = 1;
|
|
@@ -3457,8 +3454,7 @@ var __export = __name2((target, all) => {
|
|
|
3457
3454
|
var extFileAttr = 0, versionMadeBy = 0;
|
|
3458
3455
|
dir && (extFileAttr |= 16), platform === "UNIX" ? (versionMadeBy = 798, extFileAttr |= generateUnixExternalFileAttr(file.unixPermissions, dir)) : (versionMadeBy = 20, extFileAttr |= generateDosExternalFileAttr(file.dosPermissions, dir)), dosTime = date5.getUTCHours(), dosTime = dosTime << 6, dosTime = dosTime | date5.getUTCMinutes(), dosTime = dosTime << 5, dosTime = dosTime | date5.getUTCSeconds() / 2, dosDate = date5.getUTCFullYear() - 1980, dosDate = dosDate << 4, dosDate = dosDate | date5.getUTCMonth() + 1, dosDate = dosDate << 5, dosDate = dosDate | date5.getUTCDate(), useUTF8ForFileName && (unicodePathExtraField = decToHex(1, 1) + decToHex(crc32(encodedFileName), 4) + utfEncodedFileName, extraFields += "up" + decToHex(unicodePathExtraField.length, 2) + unicodePathExtraField), useUTF8ForComment && (unicodeCommentExtraField = decToHex(1, 1) + decToHex(crc32(encodedComment), 4) + utfEncodedComment, extraFields += "uc" + decToHex(unicodeCommentExtraField.length, 2) + unicodeCommentExtraField);
|
|
3459
3456
|
var header = "";
|
|
3460
|
-
header +=
|
|
3461
|
-
\0`, header += decToHex(bitflag, 2), header += compression.magic, header += decToHex(dosTime, 2), header += decToHex(dosDate, 2), header += decToHex(dataInfo.crc32, 4), header += decToHex(dataInfo.compressedSize, 4), header += decToHex(dataInfo.uncompressedSize, 4), header += decToHex(encodedFileName.length, 2), header += decToHex(extraFields.length, 2);
|
|
3457
|
+
header += "\n\0", header += decToHex(bitflag, 2), header += compression.magic, header += decToHex(dosTime, 2), header += decToHex(dosDate, 2), header += decToHex(dataInfo.crc32, 4), header += decToHex(dataInfo.compressedSize, 4), header += decToHex(dataInfo.uncompressedSize, 4), header += decToHex(encodedFileName.length, 2), header += decToHex(extraFields.length, 2);
|
|
3462
3458
|
var fileRecord = signature.LOCAL_FILE_HEADER + header + encodedFileName + extraFields, dirRecord = signature.CENTRAL_FILE_HEADER + decToHex(versionMadeBy, 2) + header + decToHex(encodedComment.length, 2) + "\0\0\0\0" + decToHex(extFileAttr, 4) + decToHex(offset, 4) + encodedFileName + extraFields + encodedComment;
|
|
3463
3459
|
return { fileRecord, dirRecord };
|
|
3464
3460
|
},
|
|
@@ -3927,8 +3923,7 @@ var __export = __name2((target, all) => {
|
|
|
3927
3923
|
}
|
|
3928
3924
|
__name(getWorkerBlob, "getWorkerBlob"), __name2(getWorkerBlob, "getWorkerBlob");
|
|
3929
3925
|
var IS_WORKER = !global2.document && !!global2.postMessage, IS_PAPA_WORKER = global2.IS_PAPA_WORKER || !1, workers = {}, workerIdCounter = 0, Papa = {};
|
|
3930
|
-
Papa.parse = CsvToJson, Papa.unparse = JsonToCsv, Papa.RECORD_SEP = "", Papa.UNIT_SEP = "", Papa.BYTE_ORDER_MARK = "\uFEFF", Papa.BAD_DELIMITERS = ["\r",
|
|
3931
|
-
`, '"', Papa.BYTE_ORDER_MARK], Papa.WORKERS_SUPPORTED = !IS_WORKER && !!global2.Worker, Papa.NODE_STREAM_INPUT = 1, Papa.LocalChunkSize = 1024 * 1024 * 10, Papa.RemoteChunkSize = 1024 * 1024 * 5, Papa.DefaultDelimiter = ",", Papa.Parser = Parser, Papa.ParserHandle = ParserHandle, Papa.NetworkStreamer = NetworkStreamer, Papa.FileStreamer = FileStreamer, Papa.StringStreamer = StringStreamer, Papa.ReadableStreamStreamer = ReadableStreamStreamer, typeof PAPA_BROWSER_CONTEXT > "u" && (Papa.DuplexStreamStreamer = DuplexStreamStreamer), IS_PAPA_WORKER && (global2.onmessage = workerThreadReceivedMessage);
|
|
3926
|
+
Papa.parse = CsvToJson, Papa.unparse = JsonToCsv, Papa.RECORD_SEP = "", Papa.UNIT_SEP = "", Papa.BYTE_ORDER_MARK = "\uFEFF", Papa.BAD_DELIMITERS = ["\r", "\n", '"', Papa.BYTE_ORDER_MARK], Papa.WORKERS_SUPPORTED = !IS_WORKER && !!global2.Worker, Papa.NODE_STREAM_INPUT = 1, Papa.LocalChunkSize = 1024 * 1024 * 10, Papa.RemoteChunkSize = 1024 * 1024 * 5, Papa.DefaultDelimiter = ",", Papa.Parser = Parser, Papa.ParserHandle = ParserHandle, Papa.NetworkStreamer = NetworkStreamer, Papa.FileStreamer = FileStreamer, Papa.StringStreamer = StringStreamer, Papa.ReadableStreamStreamer = ReadableStreamStreamer, typeof PAPA_BROWSER_CONTEXT > "u" && (Papa.DuplexStreamStreamer = DuplexStreamStreamer), IS_PAPA_WORKER && (global2.onmessage = workerThreadReceivedMessage);
|
|
3932
3927
|
function stripBom(string) {
|
|
3933
3928
|
return string.charCodeAt(0) === 65279 ? string.slice(1) : string;
|
|
3934
3929
|
}
|
|
@@ -3951,8 +3946,7 @@ var __export = __name2((target, all) => {
|
|
|
3951
3946
|
}
|
|
3952
3947
|
__name(CsvToJson, "CsvToJson"), __name2(CsvToJson, "CsvToJson");
|
|
3953
3948
|
function JsonToCsv(_input, _config) {
|
|
3954
|
-
var _quotes = !1, _writeHeader = !0, _delimiter = ",", _newline =
|
|
3955
|
-
`, _quoteChar = '"', _escapedQuote = _quoteChar + _quoteChar, _skipEmptyLines = !1, _columns = null, _escapeFormulae = !1;
|
|
3949
|
+
var _quotes = !1, _writeHeader = !0, _delimiter = ",", _newline = "\r\n", _quoteChar = '"', _escapedQuote = _quoteChar + _quoteChar, _skipEmptyLines = !1, _columns = null, _escapeFormulae = !1;
|
|
3956
3950
|
unpackConfig();
|
|
3957
3951
|
var quoteCharRegex = new RegExp(escapeRegExp(_quoteChar), "g");
|
|
3958
3952
|
if (typeof _input == "string" && (_input = JSON.parse(_input)), Array.isArray(_input)) if (_input.length) {
|
|
@@ -4233,14 +4227,10 @@ var __export = __name2((target, all) => {
|
|
|
4233
4227
|
input = input.substring(0, 1024 * 1024);
|
|
4234
4228
|
var re = new RegExp(escapeRegExp(quoteChar) + "([^]*?)" + escapeRegExp(quoteChar), "gm");
|
|
4235
4229
|
input = input.replace(re, "");
|
|
4236
|
-
var r = input.split("\r"), n = input.split(
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
for (var numWithN = 0, i = 0; i < r.length; i++) r[i][0] === `
|
|
4241
|
-
` && numWithN++;
|
|
4242
|
-
return numWithN >= r.length / 2 ? `\r
|
|
4243
|
-
` : "\r";
|
|
4230
|
+
var r = input.split("\r"), n = input.split("\n"), nAppearsFirst = n.length > 1 && n[0].length < r[0].length;
|
|
4231
|
+
if (r.length === 1 || nAppearsFirst) return "\n";
|
|
4232
|
+
for (var numWithN = 0, i = 0; i < r.length; i++) r[i][0] === "\n" && numWithN++;
|
|
4233
|
+
return numWithN >= r.length / 2 ? "\r\n" : "\r";
|
|
4244
4234
|
};
|
|
4245
4235
|
function testEmptyLine(s) {
|
|
4246
4236
|
return _config.skipEmptyLines === "greedy" ? s.join("").trim() === "" : s.length === 1 && s[0].length === 0;
|
|
@@ -4340,10 +4330,7 @@ var __export = __name2((target, all) => {
|
|
|
4340
4330
|
config.quoteChar === void 0 || config.quoteChar === null ? quoteChar = '"' : quoteChar = config.quoteChar;
|
|
4341
4331
|
var escapeChar = quoteChar;
|
|
4342
4332
|
if (config.escapeChar !== void 0 && (escapeChar = config.escapeChar), (typeof delim != "string" || Papa.BAD_DELIMITERS.indexOf(delim) > -1) && (delim = ","), comments === delim) throw new Error("Comment character same as delimiter");
|
|
4343
|
-
comments === !0 ? comments = "#" : (typeof comments != "string" || Papa.BAD_DELIMITERS.indexOf(comments) > -1) && (comments = !1), newline !==
|
|
4344
|
-
` && newline !== "\r" && newline !== `\r
|
|
4345
|
-
` && (newline = `
|
|
4346
|
-
`);
|
|
4333
|
+
comments === !0 ? comments = "#" : (typeof comments != "string" || Papa.BAD_DELIMITERS.indexOf(comments) > -1) && (comments = !1), newline !== "\n" && newline !== "\r" && newline !== "\r\n" && (newline = "\n");
|
|
4347
4334
|
var cursor = 0, aborted2 = !1;
|
|
4348
4335
|
this.parse = function(input, baseIndex, ignoreLastRow) {
|
|
4349
4336
|
if (typeof input != "string") throw new Error("Input must be a string");
|
|
@@ -5212,7 +5199,8 @@ function emoji() {
|
|
|
5212
5199
|
return new RegExp(_emoji, "u");
|
|
5213
5200
|
}
|
|
5214
5201
|
__name(emoji, "emoji"), __name2(emoji, "emoji");
|
|
5215
|
-
var ipv4 = new __cliRegExp("^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$", ""), ipv6 = new __cliRegExp("^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$", ""), cidrv4 = new __cliRegExp("^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", ""), cidrv6 = new __cliRegExp("^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a
|
|
5202
|
+
var ipv4 = new __cliRegExp("^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$", ""), ipv6 = new __cliRegExp("^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$", ""), cidrv4 = new __cliRegExp("^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$", ""), cidrv6 = new __cliRegExp("^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a\
|
|
5203
|
+
-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$", ""), base64 = new __cliRegExp("^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$", ""), base64url = new __cliRegExp("^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$", ""), httpProtocol = new __cliRegExp("^https?$", ""), e164 = new __cliRegExp("^\\+[1-9]\\d{6,14}$", ""), dateSource = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";
|
|
5216
5204
|
function anchor(source) {
|
|
5217
5205
|
return new RegExp("^".concat(source, "$"));
|
|
5218
5206
|
}
|
|
@@ -5400,17 +5388,13 @@ class Doc {
|
|
|
5400
5388
|
arg(this, { execution: "sync" }), arg(this, { execution: "async" });
|
|
5401
5389
|
return;
|
|
5402
5390
|
}
|
|
5403
|
-
const lines = arg.split(
|
|
5404
|
-
`).filter((x) => x), minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length)), dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
5391
|
+
const lines = arg.split("\n").filter((x) => x), minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length)), dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
5405
5392
|
for (const line of dedented)
|
|
5406
5393
|
this.content.push(line);
|
|
5407
5394
|
}
|
|
5408
5395
|
compile() {
|
|
5409
5396
|
const F = Function, content = this?.content ?? [""];
|
|
5410
|
-
return new F(...Object.keys(this.closed), "return function (".concat(this.args.join(", "),
|
|
5411
|
-
`).concat(content.join(`
|
|
5412
|
-
`), `
|
|
5413
|
-
};`))(...Object.values(this.closed));
|
|
5397
|
+
return new F(...Object.keys(this.closed), "return function (".concat(this.args.join(", "), ") {\n").concat(content.join("\n"), "\n};"))(...Object.values(this.closed));
|
|
5414
5398
|
}
|
|
5415
5399
|
}
|
|
5416
5400
|
var version = { major: 4, minor: 6, patch: 7 }, $ZodType = $constructor("$ZodType", (inst, def) => {
|
|
@@ -5864,18 +5848,7 @@ var $ZodObject = $constructor("$ZodObject", (inst, def) => {
|
|
|
5864
5848
|
}), $ZodObjectJIT = $constructor("$ZodObjectJIT", (inst, def) => {
|
|
5865
5849
|
$ZodObject.init(inst, def);
|
|
5866
5850
|
const superParse = inst._zod.parse, _normalized = cached(() => normalizeDef(def)), memo2 = globalConfig.memoizer, generateFastpass = __name2((shape) => {
|
|
5867
|
-
const normalized = _normalized.value, syms = normalized.symbolKeys, doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms }), parseStr = __name2((k) => "shape[".concat(k, "]._zod.run({ value: input[").concat(k, "], issues: [] }, ctx)"), "parseStr"), prefixStr = __name2((id, k) =>
|
|
5868
|
-
let `.concat(id, `_ab = false;
|
|
5869
|
-
for (let i = 0; i < `).concat(id, `.issues.length; i++) {
|
|
5870
|
-
const iss = `).concat(id, `.issues[i];
|
|
5871
|
-
iss.path = iss.path ? [`).concat(k, ", ...iss.path] : [").concat(k, `];
|
|
5872
|
-
payload.issues.push(iss);
|
|
5873
|
-
if (iss.continue !== true) `).concat(id, `_ab = true;
|
|
5874
|
-
}
|
|
5875
|
-
if (`).concat(id, `_ab && ctx && ctx.abortEarly) {
|
|
5876
|
-
payload.value = newResult;
|
|
5877
|
-
return payload;
|
|
5878
|
-
}`), "prefixStr");
|
|
5851
|
+
const normalized = _normalized.value, syms = normalized.symbolKeys, doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms }), parseStr = __name2((k) => "shape[".concat(k, "]._zod.run({ value: input[").concat(k, "], issues: [] }, ctx)"), "parseStr"), prefixStr = __name2((id, k) => "\n let ".concat(id, "_ab = false;\n for (let i = 0; i < ").concat(id, ".issues.length; i++) {\n const iss = ").concat(id, ".issues[i];\n iss.path = iss.path ? [").concat(k, ", ...iss.path] : [").concat(k, "];\n payload.issues.push(iss);\n if (iss.continue !== true) ").concat(id, "_ab = true;\n }\n if (").concat(id, "_ab && ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }"), "prefixStr");
|
|
5879
5852
|
doc.write("const input = payload.value;");
|
|
5880
5853
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
5881
5854
|
let counter = 0;
|
|
@@ -5889,47 +5862,9 @@ var $ZodObject = $constructor("$ZodObject", (inst, def) => {
|
|
|
5889
5862
|
id,
|
|
5890
5863
|
"_present"
|
|
5891
5864
|
);
|
|
5892
|
-
doc.write(
|
|
5893
|
-
const
|
|
5894
|
-
|
|
5895
|
-
if (`).concat(id, ".issues.length) {").concat(prefixStr(id, k), `
|
|
5896
|
-
}
|
|
5897
|
-
|
|
5898
|
-
if (`).concat(assign, `) {
|
|
5899
|
-
newResult[`).concat(k, "] = ").concat(id, `.value;
|
|
5900
|
-
}
|
|
5901
|
-
}
|
|
5902
|
-
|
|
5903
|
-
`));
|
|
5904
|
-
} else isOptionalIn ? (doc.write(`
|
|
5905
|
-
if (`.concat(id, ".issues.length) {").concat(prefixStr(id, k), `
|
|
5906
|
-
}
|
|
5907
|
-
`)), optin === "defaulted" ? doc.write("newResult[".concat(k, "] = ").concat(id, ".value;")) : doc.write(`
|
|
5908
|
-
if (`.concat(id, ".value !== undefined || ").concat(isPresent, `) {
|
|
5909
|
-
newResult[`).concat(k, "] = ").concat(id, `.value;
|
|
5910
|
-
}
|
|
5911
|
-
`))) : doc.write(`
|
|
5912
|
-
const `.concat(id, "_present = ").concat(isPresent, `;
|
|
5913
|
-
if (`).concat(id, ".issues.length) {").concat(prefixStr(id, k), `
|
|
5914
|
-
}
|
|
5915
|
-
if (!`).concat(id, "_present && !").concat(id, `.issues.length) {
|
|
5916
|
-
payload.issues.push({
|
|
5917
|
-
code: "invalid_type",
|
|
5918
|
-
expected: "nonoptional",
|
|
5919
|
-
input: undefined,
|
|
5920
|
-
path: [`).concat(k, `]
|
|
5921
|
-
});
|
|
5922
|
-
if (ctx && ctx.abortEarly) {
|
|
5923
|
-
payload.value = newResult;
|
|
5924
|
-
return payload;
|
|
5925
|
-
}
|
|
5926
|
-
}
|
|
5927
|
-
|
|
5928
|
-
if (`).concat(id, `_present) {
|
|
5929
|
-
newResult[`).concat(k, "] = ").concat(id, `.value;
|
|
5930
|
-
}
|
|
5931
|
-
|
|
5932
|
-
`));
|
|
5865
|
+
doc.write("\n const ".concat(id, "_present = ").concat(isPresent, ";\n if (!").concat(id, ".issues.length || ").concat(id, "_present) {\n if (").concat(id, ".issues.length) {").concat(prefixStr(id, k), "\n }\n\n if (").concat(assign, ") {\n newResult[").concat(k, "] = ").concat(id, ".value;\n }\n }\n\n "));
|
|
5866
|
+
} else isOptionalIn ? (doc.write("\n if (".concat(id, ".issues.length) {").concat(prefixStr(id, k), "\n }\n ")), optin === "defaulted" ? doc.write("newResult[".concat(k, "] = ").concat(id, ".value;")) : doc.write("\n if (".concat(id, ".value !== undefined || ").concat(isPresent, ") {\n newResult[").concat(k, "] = ").concat(id, ".value;\n }\n "))) : doc.write("\n const ".concat(id, "_present = ").concat(isPresent, ";\n if (").concat(id, ".issues.length) {").concat(prefixStr(id, k), "\n }\n if (!").concat(id, "_present && !").concat(id, '.issues.length) {\n payload.issues.push({\n code: "invalid_type",\n expected: "nonoptional",\n input: undefined,\n path: [').concat(k, "]\n });\n if (ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }\n }\n\n if (").concat(id, "_present\
|
|
5867
|
+
) {\n newResult[").concat(k, "] = ").concat(id, ".value;\n }\n\n "));
|
|
5933
5868
|
}
|
|
5934
5869
|
return doc.write("payload.value = newResult;"), doc.write("return payload;"), doc.compile();
|
|
5935
5870
|
}, "generateFastpass");
|
|
@@ -7940,7 +7875,8 @@ var MINIMUM_BUN_VERSION = [1, 4, 0], parseBunVersion = __name2((version2) => {
|
|
|
7940
7875
|
}, "compareVersions"), assertBunRuntime = __name2((runtime = globalThis.Bun) => {
|
|
7941
7876
|
if (!runtime) throw new Error("This CLI requires Bun 1.4.0 or newer. Install it with `npm install --global bun`, then retry the command.");
|
|
7942
7877
|
if (compareVersions(parseBunVersion(runtime.version), MINIMUM_BUN_VERSION) < 0) throw new Error("This CLI requires Bun 1.4.0 or newer (found ".concat(runtime.version, "). Run `bun upgrade`, then retry the command."));
|
|
7943
|
-
}, "assertBunRuntime"), guidance = { "missing-library": "Install the runtime's native credential-store library and ensure your own native keyring/session is accessible and unlocked; Linux desktop storage requires libsecret AND an accessible, unlocked Secret Service.", "bus-unavailable": "The Linux user D-Bus session is absent or unreachable. --no-browser does not provide storage. Start or repair your own user session and native keyring before retrying.", "bus-denied": "Access to the Linux user bus was denied. Fix your own native keyring/session permissions or host policy; do not change bus/socket permissions or borrow another user's bus.", "service-unavailable": "The user bus is reachable but your own Secret Service is unavailable. Start or repair your own native keyring session; do not expose another user's store.", locked: "Unlock your own native credential collection/session before retrying. The CLI will not wait indefinitely for an unlock prompt.", timeout: "The native credential
|
|
7878
|
+
}, "assertBunRuntime"), guidance = { "missing-library": "Install the runtime's native credential-store library and ensure your own native keyring/session is accessible and unlocked; Linux desktop storage requires libsecret AND an accessible, unlocked Secret Service.", "bus-unavailable": "The Linux user D-Bus session is absent or unreachable. --no-browser does not provide storage. Start or repair your own user session and native keyring before retrying.", "bus-denied": "Access to the Linux user bus was denied. Fix your own native keyring/session permissions or host policy; do not change bus/socket permissions or borrow another user's bus.", "service-unavailable": "The user bus is reachable but your own Secret Service is unavailable. Start or repair your own native keyring session; do not expose another user's store.", locked: "Unlock your own native credential collection/session before retrying. The CLI will not wait indefinitely for an unlock prompt.", timeout: "The native credential b\
|
|
7879
|
+
ackend did not finish within 10 seconds and its process was terminated. Fix or unlock your own native keyring/session outside the CLI; the CLI will not bypass host permissions.", "invalid-response": "The native credential backend returned an invalid response. Check your own keyring/session and configuration; no credential output was disclosed.", "read-failed": "The native credential backend could not read credentials. Check your own keyring/session availability and permissions; this is not evidence that you are logged out.", "write-failed": "The native credential backend could not persist credentials. Check your own keyring/session write permissions and availability; no plaintext fallback is used.", "delete-failed": "The native credential backend could not delete its entry. Check your own keyring/session permissions and remove any non-secret preflight probe through that backend if necessary." };
|
|
7944
7880
|
class CliCredentialStoreUnavailableError extends Error {
|
|
7945
7881
|
static {
|
|
7946
7882
|
__name(this, "CliCredentialStoreUnavailableError");
|
|
@@ -7976,8 +7912,7 @@ var getCliStorageError = __name2((error2) => {
|
|
|
7976
7912
|
}, "getCliStorageError"), timeoutMs = 1e4, maxBuffer = 64 * 1024, runBackend = __name2((product, executable, args, input, failure2) => new Promise((resolve2, reject) => {
|
|
7977
7913
|
const child = execFile(executable, args, { timeout: timeoutMs, killSignal: "SIGKILL", maxBuffer, windowsHide: !0 }, (error2, stdout, stderr) => {
|
|
7978
7914
|
if (error2) {
|
|
7979
|
-
const reason = error2.code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER" ? "invalid-response" : error2.killed ? "timeout" : classifyCredentialStoreFailure("".concat(stdout,
|
|
7980
|
-
`).concat(stderr), failure2);
|
|
7915
|
+
const reason = error2.code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER" ? "invalid-response" : error2.killed ? "timeout" : classifyCredentialStoreFailure("".concat(stdout, "\n").concat(stderr), failure2);
|
|
7981
7916
|
reject(new CliCredentialStoreUnavailableError(product, reason));
|
|
7982
7917
|
return;
|
|
7983
7918
|
}
|
|
@@ -7985,19 +7920,7 @@ var getCliStorageError = __name2((error2) => {
|
|
|
7985
7920
|
});
|
|
7986
7921
|
child.stdin?.on("error", () => {
|
|
7987
7922
|
}), child.stdin?.end(input);
|
|
7988
|
-
}), "runBackend"), nativeWorker =
|
|
7989
|
-
try {
|
|
7990
|
-
const { operation, input } = JSON.parse(await Bun.stdin.text());
|
|
7991
|
-
const value = await Bun.secrets[operation](input);
|
|
7992
|
-
process.stdout.write(JSON.stringify({ value: value ?? null }));
|
|
7993
|
-
} catch (error) {
|
|
7994
|
-
const message = error instanceof Error ? error.message : "Credential backend failed";
|
|
7995
|
-
// libsecret's bus transport errors can omit the D-Bus context.
|
|
7996
|
-
const context = process.platform === "linux" && /^Could not connect:/i.test(message) ? "D-Bus: " : "";
|
|
7997
|
-
process.stderr.write(context + message);
|
|
7998
|
-
process.exitCode = 1;
|
|
7999
|
-
}
|
|
8000
|
-
`, nativeResponse = object({ value: union([string2(), boolean2(), _null3()]) }).strict(), createIsolatedBunSecrets = __name2((product) => {
|
|
7923
|
+
}), "runBackend"), nativeWorker = '\ntry {\n const { operation, input } = JSON.parse(await Bun.stdin.text());\n const value = await Bun.secrets[operation](input);\n process.stdout.write(JSON.stringify({ value: value ?? null }));\n} catch (error) {\n const message = error instanceof Error ? error.message : "Credential backend failed";\n // libsecret\'s bus transport errors can omit the D-Bus context.\n const context = process.platform === "linux" && /^Could not connect:/i.test(message) ? "D-Bus: " : "";\n process.stderr.write(context + message);\n process.exitCode = 1;\n}\n', nativeResponse = object({ value: union([string2(), boolean2(), _null3()]) }).strict(), createIsolatedBunSecrets = __name2((product) => {
|
|
8001
7924
|
const run = __name2(async (operation, input) => {
|
|
8002
7925
|
assertBunRuntime();
|
|
8003
7926
|
const output = await runBackend(product, process.execPath, ["--no-env-file", "--eval", nativeWorker], JSON.stringify({ operation, input }), operation === "set" ? "write-failed" : operation === "delete" ? "delete-failed" : "read-failed");
|
|
@@ -9295,8 +9218,7 @@ class CliUsageError extends Error {
|
|
|
9295
9218
|
super(message), this.name = "CliUsageError";
|
|
9296
9219
|
}
|
|
9297
9220
|
}
|
|
9298
|
-
var canonicalize = __name2((value) => Array.isArray(value) ? value.map(canonicalize) : value instanceof Date ? value.toJSON() : typeof value == "object" && value !== null ? Object.fromEntries(Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, nested]) => [key, canonicalize(nested)])) : value, "canonicalize"), serialize = __name2((value) => "".concat(JSON.stringify(canonicalize(value), null, 2),
|
|
9299
|
-
`), "serialize"), writeSuccess = __name2((runtime, data) => {
|
|
9221
|
+
var canonicalize = __name2((value) => Array.isArray(value) ? value.map(canonicalize) : value instanceof Date ? value.toJSON() : typeof value == "object" && value !== null ? Object.fromEntries(Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, nested]) => [key, canonicalize(nested)])) : value, "canonicalize"), serialize = __name2((value) => "".concat(JSON.stringify(canonicalize(value), null, 2), "\n"), "serialize"), writeSuccess = __name2((runtime, data) => {
|
|
9300
9222
|
runtime.stdout.write(serialize({ ok: !0, data }));
|
|
9301
9223
|
}, "writeSuccess"), sanitizeErrorMessage = __name2((message) => message.replace(new __cliRegExp("\\bBearer\\s+\\S+", "giu"), "Bearer [REDACTED]"), "sanitizeErrorMessage"), errorCode = __name2((error2) => {
|
|
9302
9224
|
if (error2 instanceof CliUsageError || error2 instanceof CliConfigurationError) return error2.code;
|
|
@@ -9390,283 +9312,34 @@ var canonicalize = __name2((value) => Array.isArray(value) ? value.map(canonical
|
|
|
9390
9312
|
if (ids.some((id) => id.length === 0)) throw new CliUsageError("--".concat(name, " must not contain blank entries."));
|
|
9391
9313
|
if (new Set(ids).size !== ids.length) throw new CliUsageError("--".concat(name, " must not contain duplicates."));
|
|
9392
9314
|
return ids;
|
|
9393
|
-
}, "parseIdList"), usage =
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
et
|
|
9399
|
-
et
|
|
9400
|
-
et
|
|
9401
|
-
et
|
|
9402
|
-
et
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
an
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
et lucky-draw config update --event-id <id> (--config <json> | --config-file <path>) [--dry-run]
|
|
9422
|
-
et lucky-draw background upload --event-id <id> --file <path> --content-type <image-mime>
|
|
9423
|
-
et lucky-draw background clear --event-id <id> --allow-state-change --target <same-event-id>
|
|
9424
|
-
et lucky-draw prizes list --event-id <id>
|
|
9425
|
-
et lucky-draw prizes create --event-id <id> (--name <text> [--description <text>] | --prizes <json-array> | --prizes-file <path>)
|
|
9426
|
-
et lucky-draw prizes update --event-id <id> --prize-id <id> --name <text> [--description <text>]
|
|
9427
|
-
et lucky-draw prizes delete --event-id <id> --prize-ids <id,...> --allow-state-change --target <same-event-id>
|
|
9428
|
-
et lucky-draw prizes reorder --event-id <id> --prize-ids <id,...>
|
|
9429
|
-
et lucky-draw pre-draw --event-id <id> --prize-count <n>
|
|
9430
|
-
et lucky-draw participants replace --event-id <id> (--participants <json-array> | --participants-file <path>) --allow-state-change --target <same-event-id>
|
|
9431
|
-
et lucky-draw participants list --event-id <id> [--page <n>] [--per-page <n>]
|
|
9432
|
-
et passport overview --event-id <id>
|
|
9433
|
-
et passport mine --event-id <id>
|
|
9434
|
-
et passport menu-stock --event-id <id> [--station-id <id>] [--site <building>] (guest stock; --station-id reads organizer stock; includes building pools)
|
|
9435
|
-
et passport login-options --event-id <id>
|
|
9436
|
-
et passport queue-status --event-id <id> (what guests see: enabled, staleMinutes and the crew-set waits in stations, plus defaultStatus and defaultStationIds for visible stations crew set none for, which read "< 10 mins"; overview gives each station's queueStatus and queueStatusDefault)
|
|
9437
|
-
et passport bingo enable --event-id <id> (host: creates the hidden Bingo station and the HumanBingo)
|
|
9438
|
-
et passport bingo rename --event-id <id> --name <name> (host: the game's display name guests see; 1-100 chars, default "Human Bingo")
|
|
9439
|
-
et passport bingo join --event-id <id> (guest, passport participants only)
|
|
9440
|
-
et passport bingo claim-stamp --event-id <id> (guest: catch-up award for a completed card)
|
|
9441
|
-
et passport bingo status --event-id <id> (guest: own bingo progress and stamp)
|
|
9442
|
-
et passport export --event-id <id>
|
|
9443
|
-
et passport settings update --event-id <id> --settings-json <json> (maxRedemptionsPerParticipant 0 = no cap; optional guestScan and simplifiedChinese true|false; optional staffIdLabel string|null; optional categoryLabels object|null; optional queueStatus true|false and queueStatusStaleMinutes 1-240|null)
|
|
9444
|
-
et passport station upsert --event-id <id> --station-json <json> (collection.stampValue 0-1000, default 1; collection.category GAME|FOOD|DRINK|BINGO, default GAME; collection.prizeDeskAward true|false on SELF_SCAN/STAFF_SCAN, default false; collection.showHowToCollect true|false and collection.showMyQr true|false, default true; collection.collectionLimit ONCE|UNLIMITED for food/drink menus, default ONCE)
|
|
9445
|
-
et passport station-access get --event-id <id>
|
|
9446
|
-
et passport station-access set-password --event-id <id> --password-stdin --allow-state-change --target <same-event-id> (password read from stdin; 6-128 chars; ends every station session)
|
|
9447
|
-
et passport station-access clear-password --event-id <id> --allow-state-change --target <same-event-id> (turns station links off; ends every station session)
|
|
9448
|
-
et passport stamps stats --event-id <id>
|
|
9449
|
-
et passport stamps recipients --event-id <id> --station-id <id> [--search <text>] [--limit <1-100>] [--cursor <cursor>] [--direction <forward|backward>]
|
|
9450
|
-
et passport stamps recipient-counts --event-id <id> --station-id <id> [--search <text>]
|
|
9451
|
-
et passport skin get --event-id <id>
|
|
9452
|
-
et passport skin set --event-id <id> --appearance-version <n> --skin-json <json>
|
|
9453
|
-
et passport skin clear --event-id <id> --appearance-version <n>
|
|
9454
|
-
et passport skin upload --event-id <id> --kind <hero|logo> --file <path> --content-type <image-mime>
|
|
9455
|
-
et passport station image-set --event-id <id> --station-id <id> --file <path> --content-type <image-mime>
|
|
9456
|
-
et passport station image-clear --event-id <id> --station-id <id>
|
|
9457
|
-
et passport station hidden --event-id <id> --station-id <id> --hidden <true|false>
|
|
9458
|
-
et passport station queue-status --event-id <id> --station-id <id> --status <under-10|under-30|over-30|clear> (set or clear the wait guests see; clear returns the station to the "< 10 mins" default; needs queueStatus on; re-sending a wait refreshes its time)
|
|
9459
|
-
et passport station archive --event-id <id> --station-id <id> --allow-state-change --target <same-event-id>
|
|
9460
|
-
et passport station print-get --event-id <id> --station-id <id>
|
|
9461
|
-
et passport station print-issue --event-id <id> --station-id <id> --expected-printed-qr-version <n>
|
|
9462
|
-
et passport station print-revoke --event-id <id> --station-id <id> --expected-printed-qr-version <n> --allow-state-change --target <same-event-id>
|
|
9463
|
-
et passport station start-qr --event-id <id> --station-id <id>
|
|
9464
|
-
et passport station qr-status --event-id <id> --session-id <id>
|
|
9465
|
-
et passport collect --event-id <id> --station-id <id> --profile-code <code> [--points <n>] [--item <menu-item>] [--site <building>] [--request-id <uuid>]
|
|
9466
|
-
et passport claim --event-id <id> --code <code>
|
|
9467
|
-
et passport participant search --event-id <id> [--query <text>]
|
|
9468
|
-
et passport participant detail --event-id <id> --participant-id <id>
|
|
9469
|
-
et passport stamp correct --event-id <id> --station-id <id> --participant-id <id> --stamped <true|false> --reason <text> [--points <n>] [--item <menu-item>] [--site <building>] [--collection-id <id>] --allow-state-change --target <same-event-id>
|
|
9470
|
-
et passport prize upsert --event-id <id> --prize-json <json> (stampCost: stamps per unit, default 0; imageKey: omit keeps the photo, null clears it)
|
|
9471
|
-
et passport prize image-set --event-id <id> --prize-id <id> --file <path> --content-type <image-mime>
|
|
9472
|
-
et passport prize image-clear --event-id <id> --prize-id <id>
|
|
9473
|
-
et passport prize archive --event-id <id> --prize-id <id> --allow-state-change --target <same-event-id>
|
|
9474
|
-
et passport redemption create --event-id <id> --participant-id <id> --prize-id <id> [--quantity <1-20>] [--award-station-id <id>] [--bonus-stamps <0-1000>] [--request-id <uuid>]
|
|
9475
|
-
et passport redemption reverse --event-id <id> --redemption-id <id> --reason <text> --allow-state-change --target <same-event-id>
|
|
9476
|
-
et passport tally record --event-id <id> --station-id <id> --profile-code <code> --item <name> [--quantity <1-20>]
|
|
9477
|
-
et passport tally reverse --event-id <id> --tally-id <id> --reason <text> --allow-state-change --target <same-event-id>
|
|
9478
|
-
et passport tally summary --event-id <id>
|
|
9479
|
-
et passport tally list --event-id <id> --station-id <id>
|
|
9480
|
-
et passport roster list --event-id <id> [--search <text>] [--limit <1-100>] [--cursor <cursor>]
|
|
9481
|
-
et passport roster counts --event-id <id> [--search <text>]
|
|
9482
|
-
et passport roster import --event-id <id> --file <path.csv|path.xlsx> [--staff-id-column <header>] [--last-name-column <header|none>] [--full-name-column <header|none>] [--display-name-column <header|none>] [--surname-position <last|first>]
|
|
9483
|
-
et passport roster upsert --event-id <id> --entry-json <json> ({id?,staffId,lastName,displayName}; lastName may be null only when the event does not require it)
|
|
9484
|
-
et passport roster remove --event-id <id> --entry-id <id> --allow-state-change --target <same-event-id>
|
|
9485
|
-
et passport roster purge --event-id <id> --allow-state-change --target <same-event-id>
|
|
9486
|
-
et staff-redemption roster import --event-id <id> --file <path.csv|path.xlsx> [--sheet <name>] [--employee-id-column <header>] [--name-column <header|none>] [--site-column <header|none>] [--shift-column <header|none>] [--work-shift-column <header|none>] [--allowance-column <header|none>] [--archive-missing] --allow-state-change --target <same-event-id>
|
|
9487
|
-
et staff-redemption export --event-id <id> [--search <text>] [--site-id <id>] [--session-id <id>] [--status <active|voided|all>] [--csv-file <path> [--force]]
|
|
9488
|
-
|
|
9489
|
-
Event Passport:
|
|
9490
|
-
Uses the same typed procedures and event permissions as the web app.
|
|
9491
|
-
Station collection modes: SELF_SCAN, STAFF_SCAN, STAFF_SCORE, STAFF_TALLY.
|
|
9492
|
-
STAFF_TALLY needs collection.tallyItems (1-30 unique names) and optional tallyEarnsStamp (default false).
|
|
9493
|
-
collection.showMyQr false hides the station sheet's Show my QR action (including the self-scan alternative); omit preserves the stored value (default true).
|
|
9494
|
-
collection.showHowToCollect false hides the guest instructions panel in any mode; omit preserves the stored value (default true).
|
|
9495
|
-
FOOD/DRINK STAFF_SCAN may set collection.menuItems to 1-30 {name,stock,siteStocks?} entries; names are unique ignoring case and surrounding whitespace, max 60 chars. stock is 0..2147483647 or null for unlimited; omit menuItems to preserve, null to clear. Optional siteStocks is [{site,stock}]; every item needs the same sites. Building pools replace the single pool, and collect requires --site for them.
|
|
9496
|
-
collection.collectionLimit ONCE (default) blocks a second collection per person across buildings; UNLIMITED allows repeats. Omit preserves the stored limit. Each new collection uses one unit; repeats add no stamp credit. collect --request-id <uuid> is required for UNLIMITED and must be reused for a retry; a new deliberate give needs a new UUID. stamp correct --stamped false --collection-id <id> reverses that specific collection and restores its unit; --stamped true with the same collection ID restores the serving from its original stock. Omit item/site/points with collection-id. mine, participant detail, tally list and export include collections with item and site.
|
|
9497
|
-
Include collection.maxPoints only for STAFF_SCORE; zero is a valid score.
|
|
9498
|
-
collection.category groups stations for guests: GAME, FOOD, DRINK or BINGO. Omit it to keep the stored one.
|
|
9499
|
-
Omit collection on an existing station to preserve its current mode.
|
|
9500
|
-
Station JSON supports id/name/description/location/address/imageKey/order/opensAt/closesAt/collection.
|
|
9501
|
-
imageKey is the cover art: omit it to keep the stored image, null clears it.
|
|
9502
|
-
location is the in-venue spot ("Level 2 pantry"); address is the street or site address (up to 300 chars, null clears it, omit keeps it).
|
|
9503
|
-
Station links: one shared password per passport lets staff without accounts open /events/<id>/event-passport/station,
|
|
9504
|
-
pick a station and stamp guests. station-access get shows whether a password is set and how many station sessions are
|
|
9505
|
-
active; set-password (stdin only) and clear-password both end every existing station session; no password means links are
|
|
9506
|
-
off. stamps stats reports per-station stamp counts; stamps recipients lists who each station stamped and how
|
|
9507
|
-
(issuedBy.kind: participant self-scan, station-link, staff by name, bingo for a bingo award, or prize-desk for a stamp
|
|
9508
|
-
awarded with a prize redemption; page with
|
|
9509
|
-
--cursor, backward needs a cursor). Station sessions themselves are browser-only.
|
|
9510
|
-
Prize-desk award: collection.prizeDeskAward (true|false, SELF_SCAN and STAFF_SCAN only, not the Bingo category; omit
|
|
9511
|
-
to keep, absent means off) lets crew give that station's stamp with a prize. redemption create --award-station-id
|
|
9512
|
-
<id> gives one such station's stamp (its stampValue, source PRIZE_DESK) in the same transaction as the redemption;
|
|
9513
|
-
its stamps count toward this redemption's threshold and cost; a failure awards neither the stamp nor the prize.
|
|
9514
|
-
A station the participant already holds is refused, and
|
|
9515
|
-
--bonus-stamps awards 0-1000 extra stamps (default 0) once per redemption, alongside any station award;
|
|
9516
|
-
they count toward earned and spendable stamps and the lucky draw. Reversal removes the bonus.
|
|
9517
|
-
redemption reverse revokes the awarded stamp. participant detail lists awardStations (alreadyCollected,
|
|
9518
|
-
blockedReason) and redemptions[].awardedStation and bonusStamps. --request-id makes a retry safe (a retry of a since-reversed redemption is refused; use a new id).
|
|
9519
|
-
Station cover art: image-set uploads a jpeg/png/webp/gif (up to 25 MB) to the event's station-art folder and
|
|
9520
|
-
saves it as the station's imageKey, keeping every other station setting; image-clear removes it. A new
|
|
9521
|
-
imageKey given in station JSON must be an upload to this event's event-passport/stations folder.
|
|
9522
|
-
Prize photos work the same way: prize image-set uploads a jpeg/png/webp/gif (up to 25 MB) to the event's prize folder and
|
|
9523
|
-
saves it as the prize's imageKey, keeping every other prize setting; image-clear removes it (guests then see the gift
|
|
9524
|
-
illustration). A new imageKey given in prize JSON must be an upload to this event's event-passport/prizes folder.
|
|
9525
|
-
Passport skin (optional per-event look; no skin renders the Go Labs default): lives in the event
|
|
9526
|
-
appearance as the optional passport block {heroImage:{key,focalX,focalY}|null, logo:{key}|null,
|
|
9527
|
-
colors:{graphic,dark}, emphasis:accent|ink}. skin get reads it with the version and image URLs.
|
|
9528
|
-
skin set is a version-fenced merge patch: --skin-json '{"heroImage":{"focalX":30}}' changes only the
|
|
9529
|
-
focal point; null clears heroImage or logo. skin upload --kind hero|logo returns the key to reference
|
|
9530
|
-
in skin set. skin clear returns the event to the Go Labs default look and keeps the rest of the appearance.
|
|
9531
|
-
Other appearance saves that omit passport keep the stored skin. colors.dark needs 4.5:1 contrast with white.
|
|
9532
|
-
Staff Redemption events use the same block and commands: colors.graphic, colors.dark and emphasis (with the event
|
|
9533
|
-
theme) also theme the crew counter and its prize wheel (Settings > Appearance > Counter look). heroImage and logo are
|
|
9534
|
-
Passport-only: the counter ignores them; skin set keeps stored ones unless the patch names them, skin clear resets
|
|
9535
|
-
the whole block.
|
|
9536
|
-
Date-time fields are ISO strings or null; order defaults to zero.
|
|
9537
|
-
Settings JSON requires linkedDrawEventId, luckyDrawStampThreshold, prizeStampThreshold,
|
|
9538
|
-
maxRedemptionsPerParticipant; optional loginMethods is {emailOtp,google,guest,staffId,staffIdRequiresLastName}.
|
|
9539
|
-
Keep email OTP, Google or roster sign-in (staffId) enabled for recovery; staffId defaults to false and
|
|
9540
|
-
staffIdRequiresLastName to true, so set it false again whenever you resend loginMethods.
|
|
9541
|
-
Omit loginMethods to preserve it. Optional guestScan (boolean) turns guest station QR scanning
|
|
9542
|
-
on or off; omit it to keep the stored value (absent means on). When off, guests cannot self-scan
|
|
9543
|
-
(staff and station crew still stamp) and the guest passport hides the Scan tab. overview shows
|
|
9544
|
-
passport.guestScan and mine shows settings.guestScanEnabled. Optional simplifiedChinese (boolean,
|
|
9545
|
-
absent means off) offers a Simplified Chinese option on the guest passport; organiser-entered text
|
|
9546
|
-
stays as entered. overview shows passport.simplifiedChinese and login-options shows simplifiedChinese.
|
|
9547
|
-
Optional staffIdLabel (string up to 40 chars, or null to reset) names the roster identifier guests,
|
|
9548
|
-
station crew and organisers see; it defaults to "Employee Number", so send "Staff ID" for events
|
|
9549
|
-
that call it that. Omit it to keep the stored label; the Chinese passport keeps \u5458\u5DE5\u7F16\u53F7. overview
|
|
9550
|
-
shows passport.staffIdLabel, login-options shows staffIdLabel, mine shows settings.staffIdLabel and
|
|
9551
|
-
export returns staffIdLabel. Only the wording changes; the staffId fields and flags keep their names.
|
|
9552
|
-
Optional categoryLabels ({GAME,FOOD,DRINK,BINGO: {en,"zh-CN"}}, each name 1-40 chars after trimming, or null
|
|
9553
|
-
to clear) renames the station categories guests, crew and organisers see; omit it to keep the stored names,
|
|
9554
|
-
send an object to replace them all (a blank name means the built-in wording) and null to clear them. A
|
|
9555
|
-
Simplified Chinese guest sees the zh-CN name, else the built-in Chinese, never the English one. overview
|
|
9556
|
-
shows passport.categoryLabels, login-options shows categoryLabels and mine shows settings.categoryLabels.
|
|
9557
|
-
Optional queueStatus (boolean, absent means off) lets station crew set a wait per station that guests
|
|
9558
|
-
see in their passport: under-10, under-30 or over-30 minutes. Optional queueStatusStaleMinutes (1-240,
|
|
9559
|
-
or null to reset to 10) is how long a set wait stays trusted before guests see "Not updated recently".
|
|
9560
|
-
overview shows passport.queueStatus, passport.queueStatusStaleMinutes and each station's queueStatus
|
|
9561
|
-
({status,updatedAt} for a crew-set wait, else null) and queueStatusDefault; queue-status shows the guest
|
|
9562
|
-
view. While queueStatus is on, every visible station shows a wait: a station crew never set (or cleared)
|
|
9563
|
-
has queueStatus null and queueStatusDefault UNDER_10_MIN ("< 10 mins"), a default that never goes stale; a
|
|
9564
|
-
crew-set wait overrides it (queueStatusDefault null) and reads "Not updated recently" after
|
|
9565
|
-
queueStatusStaleMinutes. queueStatusDefault is null while queueStatus is off and for hidden stations.
|
|
9566
|
-
station queue-status sets or clears one wait as an event operator (crew do the same in the browser; clear
|
|
9567
|
-
prints queueStatus null and queueStatusDefault UNDER_10_MIN), is refused while queueStatus is off, and
|
|
9568
|
-
every change is recorded in the activity log. Turning queueStatus off hides waits from guests but keeps them.
|
|
9569
|
-
Staff roster: event Helpdesk can list/count and add new entries with roster upsert (omit id).
|
|
9570
|
-
Helpdesk cannot edit an existing entry, import, remove, purge, export, or use other event tools.
|
|
9571
|
-
Managers retain full roster access. Assign/invite HELPDESK with expiresAt for event-day access;
|
|
9572
|
-
normal verified-email login and event assignment/revocation apply, not the station password.
|
|
9573
|
-
Host-only import replaces the roster and returns imported, replaced and
|
|
9574
|
-
rejected rows (blank, too long, or a Staff ID repeated in the file). Columns are matched from
|
|
9575
|
-
header names; override with the column flags. Without a last-name column, the last name is
|
|
9576
|
-
taken from the full name (--surname-position last|first, default last). Files over 20,000 data
|
|
9577
|
-
rows or 200 columns, or with no importable rows, are refused and the roster is unchanged. A blank
|
|
9578
|
-
last name is rejected only when the event requires one; counts reports missingLastNameCount.
|
|
9579
|
-
Staff ID sign-in matches case-insensitively, ignoring spaces and punctuation, and needs the browser.
|
|
9580
|
-
Printed QR issue/revoke requires the last observed print version; stale versions conflict.
|
|
9581
|
-
claim scans a station QR; collect scans a participant profile QR as an event operator.
|
|
9582
|
-
Repeat scans never add a second stamp or change its original points.
|
|
9583
|
-
Destructive corrections, archive, reverse and print revoke require explicit target confirmation.
|
|
9584
|
-
Points are scores only; existing stamp-based Lucky Draw and prize thresholds still apply.
|
|
9585
|
-
Guest enrollment and account-linking require the browser; CLI uses existing device-approved auth.
|
|
9586
|
-
|
|
9587
|
-
Staff redemption (STAFF_REDEMPTION events; most commands are registry commands, see below):
|
|
9588
|
-
Crew look up an Employee ID at a site counter, record the food items handed over and reveal a prize
|
|
9589
|
-
outcome the server decides in the same transaction. Setup is: settings, sites, crew passwords,
|
|
9590
|
-
sessions (one per shift), slots (sets per session and site), item groups and items, prizes, prize
|
|
9591
|
-
stock, roster. Run 'et staff-redemption setup get' for the IDs and what is still missing.
|
|
9592
|
-
roster import reads a CSV, or an XLSX sheet (the first unless --sheet <name> names another; an unknown
|
|
9593
|
-
name lists the workbook's sheets; a CSV has no sheets and refuses --sheet), matches columns from header names (override
|
|
9594
|
-
with the column flags; "none" clears an optional column), adds new Employee IDs and updates existing
|
|
9595
|
-
ones, and reports created, updated, unchanged, archived, rejectedCount, rejected rows and
|
|
9596
|
-
unmatchedSites. Existing rows are never deleted, so redemptions survive a re-import; --archive-missing archives active entries that are not in the file.
|
|
9597
|
-
Use --sheet "Master list" to import that tab of a workbook (exact name, else ignoring case and spaces).
|
|
9598
|
-
export prints the redemption rows as JSON, or with --csv-file writes a CSV (UTF-8 with BOM, CRLF,
|
|
9599
|
-
one row per claim, oldest first, text that would run as a spreadsheet formula gets a leading
|
|
9600
|
-
apostrophe) and prints { file, rows }. It never overwrites a file unless --force. It needs event.export
|
|
9601
|
-
and fails above 20,000 rows; narrow the filters.
|
|
9602
|
-
Crew sign-in with a site password and the counter access check are browser-only; the CLI operates
|
|
9603
|
-
counters as event staff (event.operate) and names the site with siteId.
|
|
9604
|
-
Archive and unarchive use 'staff-redemption archive set' with archived true or false.
|
|
9605
|
-
Every write repeats the event ID as --target. Lookup needs no confirmation (it writes nothing
|
|
9606
|
-
but failed-lookup throttle records). Redeem takes a clientRequestId UUID you generate;
|
|
9607
|
-
retrying with the same UUID returns the stored receipt and never redeems twice.
|
|
9608
|
-
|
|
9609
|
-
Organization and event setup:
|
|
9610
|
-
organization create is global-admin only. It provisions the org and emails an owner invitation
|
|
9611
|
-
to --owner-email after it is saved; deliveryStatus (sent/failed) and
|
|
9612
|
-
ownerInvitation.emailDeliveryStatus report the outcome. Names must be unique.
|
|
9613
|
-
event create needs org owner/admin (or global admin). --type is an active event type such as
|
|
9614
|
-
LUCKY_DRAW; a LUCKY_DRAW event gets its board with default config automatically.
|
|
9615
|
-
--start/--end are ISO 8601 date-times with an offset, for example 2026-11-20T18:00:00+08:00.
|
|
9616
|
-
|
|
9617
|
-
Lucky draw:
|
|
9618
|
-
config, background and prize writes need event.setup, the same as the web board settings.
|
|
9619
|
-
config update is a merge patch: only the given keys change. Unknown keys and wrong value types
|
|
9620
|
-
are rejected before any request. Arrays (includeDomains etc.) are replaced, not appended.
|
|
9621
|
-
--dry-run prints the merged config without saving it.
|
|
9622
|
-
Keys: title, titleColor, isTitleVisible, titleFontSize, titleFont, prizeColor, prizeFontSize,
|
|
9623
|
-
isPrizeVisible, prizeFont, luckyDrawType (WHEEL|SLOT), slotBackgroundColor, slotBorderColor,
|
|
9624
|
-
slotTextColor, slotFontSize, slotTextFont, backgroundPreset, customBackgroundImage,
|
|
9625
|
-
numberOfSegments, segmentPreset, segmentText (NAME|LUCKY_DRAW_ID|BOTH), wheelSegmentFont,
|
|
9626
|
-
wheelSegmentFontSize, wheelSegmentColorsPreset, includeDomains, excludeDomains, includeEmails,
|
|
9627
|
-
excludeEmails, titlePositionX/Y, slotPositionX/Y, prizePositionX/Y, prizeDivWidth, prizeDivHeight.
|
|
9628
|
-
Positions are pixels on the 1920x1080 board.
|
|
9629
|
-
background upload stores the image (jpeg/png/webp/gif) and sets customBackgroundImage;
|
|
9630
|
-
the readback contains a signed /api/attachments URL. background clear unsets it.
|
|
9631
|
-
prizes create appends after the last prize; --prizes takes [{"name","description"?}].
|
|
9632
|
-
prizes delete permanently removes unassigned prizes and renumbers the rest.
|
|
9633
|
-
prizes reorder takes every active prize ID once, in the new order.
|
|
9634
|
-
pre-draw immediately saves winners for the next unassigned prizes in order.
|
|
9635
|
-
Uses the live draw random selection and participant filters in the backend.
|
|
9636
|
-
participants replace replaces the imported source roster; it is not an append.
|
|
9637
|
-
It requires --allow-state-change and --target exactly equal to --event-id.
|
|
9638
|
-
participants list defaults to page 1 with 100 results per page; inspect every page.
|
|
9639
|
-
|
|
9640
|
-
Registry commands (staff and admin operations, one per API procedure):
|
|
9641
|
-
et commands List every registry command as JSON.
|
|
9642
|
-
et <command> --help Show its input JSON Schema and confirmations.
|
|
9643
|
-
et <command> [--input <json> | --input-file <path>]
|
|
9644
|
-
et <write command> --input <json> --allow-state-change [--allow-delete] [--allow-email] --target <value>
|
|
9645
|
-
Groups: organization member/owner/invitation/update/image/archive/access/dashboard/analytics,
|
|
9646
|
-
admin organization/event/member/user/activity/dashboard, event access/details/update/
|
|
9647
|
-
status-update/archive/restore/duplicate/export/recent/background/story, activity list,
|
|
9648
|
-
lucky-draw winners/boards/participants eligible|delete/wheel/passport-sync,
|
|
9649
|
-
passport lucky-draws/operator-metadata, photo-wall, post-it, signature-wall, rating, human-bingo,
|
|
9650
|
-
staff-redemption setup/settings/site/crew-password/session/slot/item-group/item/prize/prize-stock/
|
|
9651
|
-
archive/roster list|counts|upsert/claims/draw/stock/counter/lookup/redeem.
|
|
9652
|
-
--input is passed unchanged to the procedure, so field names match the web app.
|
|
9653
|
-
Date fields take ISO 8601 strings and are sent as dates.
|
|
9654
|
-
Writes require --allow-state-change and --target equal to the input key shown by --help
|
|
9655
|
-
(arrays joined with commas). Hard deletes add --allow-delete; emails add --allow-email.
|
|
9656
|
-
Run every write once with --help first and read back the result afterwards.
|
|
9657
|
-
|
|
9658
|
-
Global options:
|
|
9659
|
-
Bare flags (--dry-run, --allow-state-change, --allow-delete, --allow-email, --public,
|
|
9660
|
-
--no-browser) take no value;
|
|
9661
|
-
--flag=value spellings are rejected before any request.
|
|
9662
|
-
--api-url <url> Override EVENT_TECH_API_URL.
|
|
9663
|
-
--help Print this help as JSON.
|
|
9664
|
-
--version Print the CLI version as JSON.
|
|
9665
|
-
|
|
9666
|
-
Authentication:
|
|
9667
|
-
Run et auth login, then approve the matching device in Event Tech.
|
|
9668
|
-
Credentials are stored exclusively through Bun.secrets.
|
|
9669
|
-
EVENT_TECH_API_URL defaults to `.concat(DEFAULT_EVENT_TECH_API_BASE_URL, ".");
|
|
9315
|
+
}, "parseIdList"), usage = 'Event Tech CLI\n\nFirst step before each task: update to the latest published release with \'bun add --global @go-labs-sg/event-tech@latest\', then run \'et version\' and \'et --help\' before using commands. Update once per task. If updating fails, stop and report it. Preserve an explicitly requested pinned or development/staging version.\n\nUsage:\n et auth login [--no-browser]\n et auth status\n et auth logout\n et auth whoami\n et organization list\n et organization get --organization-id <id>\n et organization create --name <text> --owner-email <email> [--allowed-event-types <TYPE,...>]\n et event list --organization-id <id> [--page <n>] [--per-page <n>] [--name <text>] [--status <status>] [--archive-status <status>]\n et event get --event-id <id>\n et event create --organization-id <id> --name <text> --type <type> --location <text> --start <iso> [--end <iso>]\n et event appearance get --event-id <id> [--public]\n et event appearance update --event-id <id> --appear\
|
|
9316
|
+
ance-version <n> --appearance <json>\n et event appearance reset --event-id <id> --appearance-version <n>\n et event appearance upload --event-id <id> --file <path> --media-type <image|video> --content-type <mime>\n Appearance update accepts a full version:1 appearance JSON. Optional humanBingo sets\n title (max 80; empty uses the configured Bingo title), joinHeading (1\u201340),\n joinInstructions (1\u2013180), titleFontSize (32\u201396) and nameFontSize (24\u201352).\n Text is trimmed; font sizes are integers. Omitted humanBingo keeps saved settings;\n an absent stored block keeps the legacy layout. Appearance reset clears all overrides.\n Appearance theme colours, fonts and display image/video apply to the updated Photo, Post-it, Signature, Bingo and Rating boards.\n Photo, Post-it and Signature walls share photoWall playback: durationSeconds 10\u201340, maxVisible 1\u201316, motion gentle|lively|roaming (bounce).\n et event photo-wall display-items --event-id <id> [--limit <n>] [--cursor <json>] [--retained-ids\
|
|
9317
|
+
<json>]\n et lucky-draw config get --event-id <id>\n et lucky-draw config update --event-id <id> (--config <json> | --config-file <path>) [--dry-run]\n et lucky-draw background upload --event-id <id> --file <path> --content-type <image-mime>\n et lucky-draw background clear --event-id <id> --allow-state-change --target <same-event-id>\n et lucky-draw prizes list --event-id <id>\n et lucky-draw prizes create --event-id <id> (--name <text> [--description <text>] | --prizes <json-array> | --prizes-file <path>)\n et lucky-draw prizes update --event-id <id> --prize-id <id> --name <text> [--description <text>]\n et lucky-draw prizes delete --event-id <id> --prize-ids <id,...> --allow-state-change --target <same-event-id>\n et lucky-draw prizes reorder --event-id <id> --prize-ids <id,...>\n et lucky-draw pre-draw --event-id <id> --prize-count <n>\n et lucky-draw participants replace --event-id <id> (--participants <json-array> | --participants-file <path>) --allow-state-change --target <same\
|
|
9318
|
+
-event-id>\n et lucky-draw participants list --event-id <id> [--page <n>] [--per-page <n>]\n et passport overview --event-id <id>\n et passport mine --event-id <id>\n et passport menu-stock --event-id <id> [--station-id <id>] [--site <building>] (guest stock; --station-id reads organizer stock; includes building pools)\n et passport login-options --event-id <id>\n et passport queue-status --event-id <id> (what guests see: enabled, staleMinutes and the crew-set waits in stations, plus defaultStatus and defaultStationIds for visible stations crew set none for, which read "< 10 mins"; overview gives each station\'s queueStatus and queueStatusDefault)\n et passport bingo enable --event-id <id> (host: creates the hidden Bingo station and the HumanBingo)\n et passport bingo rename --event-id <id> --name <name> (host: the game\'s display name guests see; 1-100 chars, default "Human Bingo")\n et passport bingo join --event-id <id> (guest, passport participants only)\n et passport bingo\
|
|
9319
|
+
claim-stamp --event-id <id> (guest: catch-up award for a completed card)\n et passport bingo status --event-id <id> (guest: own bingo progress and stamp)\n et passport export --event-id <id>\n et passport settings update --event-id <id> --settings-json <json> (maxRedemptionsPerParticipant 0 = no cap; optional guestScan and simplifiedChinese true|false; optional staffIdLabel string|null; optional categoryLabels object|null; optional queueStatus true|false and queueStatusStaleMinutes 1-240|null)\n et passport station upsert --event-id <id> --station-json <json> (collection.stampValue 0-1000, default 1; collection.category GAME|FOOD|DRINK|BINGO, default GAME; collection.prizeDeskAward true|false on SELF_SCAN/STAFF_SCAN, default false; collection.showHowToCollect true|false and collection.showMyQr true|false, default true; collection.collectionLimit ONCE|UNLIMITED for food/drink menus, default ONCE)\n et passport station-access get --event-id <id>\n et passport station-access set-\
|
|
9320
|
+
password --event-id <id> --password-stdin --allow-state-change --target <same-event-id> (password read from stdin; 6-128 chars; ends every station session)\n et passport station-access clear-password --event-id <id> --allow-state-change --target <same-event-id> (turns station links off; ends every station session)\n et passport stamps stats --event-id <id>\n et passport stamps recipients --event-id <id> --station-id <id> [--search <text>] [--limit <1-100>] [--cursor <cursor>] [--direction <forward|backward>]\n et passport stamps recipient-counts --event-id <id> --station-id <id> [--search <text>]\n et passport skin get --event-id <id>\n et passport skin set --event-id <id> --appearance-version <n> --skin-json <json>\n et passport skin clear --event-id <id> --appearance-version <n>\n et passport skin upload --event-id <id> --kind <hero|logo> --file <path> --content-type <image-mime>\n et passport station image-set --event-id <id> --station-id <id> --file <path> --content-type <image\
|
|
9321
|
+
-mime>\n et passport station image-clear --event-id <id> --station-id <id>\n et passport station hidden --event-id <id> --station-id <id> --hidden <true|false>\n et passport station queue-status --event-id <id> --station-id <id> --status <under-10|under-30|over-30|clear> (set or clear the wait guests see; clear returns the station to the "< 10 mins" default; needs queueStatus on; re-sending a wait refreshes its time)\n et passport station archive --event-id <id> --station-id <id> --allow-state-change --target <same-event-id>\n et passport station print-get --event-id <id> --station-id <id>\n et passport station print-issue --event-id <id> --station-id <id> --expected-printed-qr-version <n>\n et passport station print-revoke --event-id <id> --station-id <id> --expected-printed-qr-version <n> --allow-state-change --target <same-event-id>\n et passport station start-qr --event-id <id> --station-id <id>\n et passport station qr-status --event-id <id> --session-id <id>\n et passport colle\
|
|
9322
|
+
ct --event-id <id> --station-id <id> --profile-code <code> [--points <n>] [--item <menu-item>] [--site <building>] [--request-id <uuid>]\n et passport claim --event-id <id> --code <code>\n et passport participant search --event-id <id> [--query <text>]\n et passport participant detail --event-id <id> --participant-id <id>\n et passport stamp correct --event-id <id> --station-id <id> --participant-id <id> --stamped <true|false> --reason <text> [--points <n>] [--item <menu-item>] [--site <building>] [--collection-id <id>] --allow-state-change --target <same-event-id>\n et passport prize upsert --event-id <id> --prize-json <json> (stampCost: stamps per unit, default 0; imageKey: omit keeps the photo, null clears it)\n et passport prize image-set --event-id <id> --prize-id <id> --file <path> --content-type <image-mime>\n et passport prize image-clear --event-id <id> --prize-id <id>\n et passport prize archive --event-id <id> --prize-id <id> --allow-state-change --target <same-event-id>\n \
|
|
9323
|
+
et passport redemption create --event-id <id> --participant-id <id> --prize-id <id> [--quantity <1-20>] [--award-station-id <id>] [--bonus-stamps <0-1000>] [--request-id <uuid>]\n et passport redemption reverse --event-id <id> --redemption-id <id> --reason <text> --allow-state-change --target <same-event-id>\n et passport tally record --event-id <id> --station-id <id> --profile-code <code> --item <name> [--quantity <1-20>]\n et passport tally reverse --event-id <id> --tally-id <id> --reason <text> --allow-state-change --target <same-event-id>\n et passport tally summary --event-id <id>\n et passport tally list --event-id <id> --station-id <id>\n et passport roster list --event-id <id> [--search <text>] [--limit <1-100>] [--cursor <cursor>]\n et passport roster counts --event-id <id> [--search <text>]\n et passport roster import --event-id <id> --file <path.csv|path.xlsx> [--staff-id-column <header>] [--last-name-column <header|none>] [--full-name-column <header|none>] [--display-name-\
|
|
9324
|
+
column <header|none>] [--surname-position <last|first>]\n et passport roster upsert --event-id <id> --entry-json <json> ({id?,staffId,lastName,displayName}; lastName may be null only when the event does not require it)\n et passport roster remove --event-id <id> --entry-id <id> --allow-state-change --target <same-event-id>\n et passport roster purge --event-id <id> --allow-state-change --target <same-event-id>\n et staff-redemption roster import --event-id <id> --file <path.csv|path.xlsx> [--sheet <name>] [--employee-id-column <header>] [--name-column <header|none>] [--site-column <header|none>] [--shift-column <header|none>] [--work-shift-column <header|none>] [--allowance-column <header|none>] [--archive-missing] --allow-state-change --target <same-event-id>\n et staff-redemption export --event-id <id> [--search <text>] [--site-id <id>] [--session-id <id>] [--status <active|voided|all>] [--csv-file <path> [--force]]\n\nEvent Passport:\n Uses the same typed procedures and event permis\
|
|
9325
|
+
sions as the web app.\n Station collection modes: SELF_SCAN, STAFF_SCAN, STAFF_SCORE, STAFF_TALLY.\n STAFF_TALLY needs collection.tallyItems (1-30 unique names) and optional tallyEarnsStamp (default false).\n collection.showMyQr false hides the station sheet\'s Show my QR action (including the self-scan alternative); omit preserves the stored value (default true).\n collection.showHowToCollect false hides the guest instructions panel in any mode; omit preserves the stored value (default true).\n FOOD/DRINK STAFF_SCAN may set collection.menuItems to 1-30 {name,stock,siteStocks?} entries; names are unique ignoring case and surrounding whitespace, max 60 chars. stock is 0..2147483647 or null for unlimited; omit menuItems to preserve, null to clear. Optional siteStocks is [{site,stock}]; every item needs the same sites. Building pools replace the single pool, and collect requires --site for them.\n collection.collectionLimit ONCE (default) blocks a second collection per person across buildi\
|
|
9326
|
+
ngs; UNLIMITED allows repeats. Omit preserves the stored limit. Each new collection uses one unit; repeats add no stamp credit. collect --request-id <uuid> is required for UNLIMITED and must be reused for a retry; a new deliberate give needs a new UUID. stamp correct --stamped false --collection-id <id> reverses that specific collection and restores its unit; --stamped true with the same collection ID restores the serving from its original stock. Omit item/site/points with collection-id. mine, participant detail, tally list and export include collections with item and site.\n Include collection.maxPoints only for STAFF_SCORE; zero is a valid score.\n collection.category groups stations for guests: GAME, FOOD, DRINK or BINGO. Omit it to keep the stored one.\n Omit collection on an existing station to preserve its current mode.\n Station JSON supports id/name/description/location/address/imageKey/order/opensAt/closesAt/collection.\n imageKey is the cover art: omit it to keep the stored i\
|
|
9327
|
+
mage, null clears it.\n location is the in-venue spot ("Level 2 pantry"); address is the street or site address (up to 300 chars, null clears it, omit keeps it).\n Station links: one shared password per passport lets staff without accounts open /events/<id>/event-passport/station,\n pick a station and stamp guests. station-access get shows whether a password is set and how many station sessions are\n active; set-password (stdin only) and clear-password both end every existing station session; no password means links are\n off. stamps stats reports per-station stamp counts; stamps recipients lists who each station stamped and how\n (issuedBy.kind: participant self-scan, station-link, staff by name, bingo for a bingo award, or prize-desk for a stamp\n awarded with a prize redemption; page with\n --cursor, backward needs a cursor). Station sessions themselves are browser-only.\n Prize-desk award: collection.prizeDeskAward (true|false, SELF_SCAN and STAFF_SCAN only, not the Bingo category;\
|
|
9328
|
+
omit\n to keep, absent means off) lets crew give that station\'s stamp with a prize. redemption create --award-station-id\n <id> gives one such station\'s stamp (its stampValue, source PRIZE_DESK) in the same transaction as the redemption;\n its stamps count toward this redemption\'s threshold and cost; a failure awards neither the stamp nor the prize.\n A station the participant already holds is refused, and\n --bonus-stamps awards 0-1000 extra stamps (default 0) once per redemption, alongside any station award;\n they count toward earned and spendable stamps and the lucky draw. Reversal removes the bonus.\n redemption reverse revokes the awarded stamp. participant detail lists awardStations (alreadyCollected,\n blockedReason) and redemptions[].awardedStation and bonusStamps. --request-id makes a retry safe (a retry of a since-reversed redemption is refused; use a new id).\n Station cover art: image-set uploads a jpeg/png/webp/gif (up to 25 MB) to the event\'s station-art folder and\n sa\
|
|
9329
|
+
ves it as the station\'s imageKey, keeping every other station setting; image-clear removes it. A new\n imageKey given in station JSON must be an upload to this event\'s event-passport/stations folder.\n Prize photos work the same way: prize image-set uploads a jpeg/png/webp/gif (up to 25 MB) to the event\'s prize folder and\n saves it as the prize\'s imageKey, keeping every other prize setting; image-clear removes it (guests then see the gift\n illustration). A new imageKey given in prize JSON must be an upload to this event\'s event-passport/prizes folder.\n Passport skin (optional per-event look; no skin renders the Go Labs default): lives in the event\n appearance as the optional passport block {heroImage:{key,focalX,focalY}|null, logo:{key}|null,\n colors:{graphic,dark}, emphasis:accent|ink}. skin get reads it with the version and image URLs.\n skin set is a version-fenced merge patch: --skin-json \'{"heroImage":{"focalX":30}}\' changes only the\n focal point; null clears heroImage or lo\
|
|
9330
|
+
go. skin upload --kind hero|logo returns the key to reference\n in skin set. skin clear returns the event to the Go Labs default look and keeps the rest of the appearance.\n Other appearance saves that omit passport keep the stored skin. colors.dark needs 4.5:1 contrast with white.\n Staff Redemption events use the same block and commands: colors.graphic, colors.dark and emphasis (with the event\n theme) also theme the crew counter and its prize wheel (Settings > Appearance > Counter look). heroImage and logo show\n only on the employee sign-in and QR page (as on the Passport sign-in), not on the counter; skin set keeps stored ones\n unless the patch names them, skin clear resets the whole block.\n Date-time fields are ISO strings or null; order defaults to zero.\n Settings JSON requires linkedDrawEventId, luckyDrawStampThreshold, prizeStampThreshold,\n maxRedemptionsPerParticipant; optional loginMethods is {emailOtp,google,guest,staffId,staffIdRequiresLastName}.\n Keep email OTP, Goog\
|
|
9331
|
+
le or roster sign-in (staffId) enabled for recovery; staffId defaults to false and\n staffIdRequiresLastName to true, so set it false again whenever you resend loginMethods.\n Omit loginMethods to preserve it. Optional guestScan (boolean) turns guest station QR scanning\n on or off; omit it to keep the stored value (absent means on). When off, guests cannot self-scan\n (staff and station crew still stamp) and the guest passport hides the Scan tab. overview shows\n passport.guestScan and mine shows settings.guestScanEnabled. Optional simplifiedChinese (boolean,\n absent means off) offers a Simplified Chinese option on the guest passport; organiser-entered text\n stays as entered. overview shows passport.simplifiedChinese and login-options shows simplifiedChinese.\n Optional staffIdLabel (string up to 40 chars, or null to reset) names the roster identifier guests,\n station crew and organisers see; it defaults to "Employee Number", so send "Staff ID" for events\n that call it that. Omit \
|
|
9332
|
+
it to keep the stored label; the Chinese passport keeps \u5458\u5DE5\u7F16\u53F7. overview\n shows passport.staffIdLabel, login-options shows staffIdLabel, mine shows settings.staffIdLabel and\n export returns staffIdLabel. Only the wording changes; the staffId fields and flags keep their names.\n Optional categoryLabels ({GAME,FOOD,DRINK,BINGO: {en,"zh-CN"}}, each name 1-40 chars after trimming, or null\n to clear) renames the station categories guests, crew and organisers see; omit it to keep the stored names,\n send an object to replace them all (a blank name means the built-in wording) and null to clear them. A\n Simplified Chinese guest sees the zh-CN name, else the built-in Chinese, never the English one. overview\n shows passport.categoryLabels, login-options shows categoryLabels and mine shows settings.categoryLabels.\n Optional queueStatus (boolean, absent means off) lets station crew set a wait per station that guests\n see in their passport: under-10, under-30 or over-30 minutes. Optional queue\
|
|
9333
|
+
StatusStaleMinutes (1-240,\n or null to reset to 10) is how long a set wait stays trusted before guests see "Not updated recently".\n overview shows passport.queueStatus, passport.queueStatusStaleMinutes and each station\'s queueStatus\n ({status,updatedAt} for a crew-set wait, else null) and queueStatusDefault; queue-status shows the guest\n view. While queueStatus is on, every visible station shows a wait: a station crew never set (or cleared)\n has queueStatus null and queueStatusDefault UNDER_10_MIN ("< 10 mins"), a default that never goes stale; a\n crew-set wait overrides it (queueStatusDefault null) and reads "Not updated recently" after\n queueStatusStaleMinutes. queueStatusDefault is null while queueStatus is off and for hidden stations.\n station queue-status sets or clears one wait as an event operator (crew do the same in the browser; clear\n prints queueStatus null and queueStatusDefault UNDER_10_MIN), is refused while queueStatus is off, and\n every change is recorded in t\
|
|
9334
|
+
he activity log. Turning queueStatus off hides waits from guests but keeps them.\n Staff roster: event Helpdesk can list/count and add new entries with roster upsert (omit id).\n Helpdesk cannot edit an existing entry, import, remove, purge, export, or use other event tools.\n Managers retain full roster access. Assign/invite HELPDESK with expiresAt for event-day access;\n normal verified-email login and event assignment/revocation apply, not the station password.\n Host-only import replaces the roster and returns imported, replaced and\n rejected rows (blank, too long, or a Staff ID repeated in the file). Columns are matched from\n header names; override with the column flags. Without a last-name column, the last name is\n taken from the full name (--surname-position last|first, default last). Files over 20,000 data\n rows or 200 columns, or with no importable rows, are refused and the roster is unchanged. A blank\n last name is rejected only when the event requires one; counts report\
|
|
9335
|
+
s missingLastNameCount.\n Staff ID sign-in matches case-insensitively, ignoring spaces and punctuation, and needs the browser.\n Printed QR issue/revoke requires the last observed print version; stale versions conflict.\n claim scans a station QR; collect scans a participant profile QR as an event operator.\n Repeat scans never add a second stamp or change its original points.\n Destructive corrections, archive, reverse and print revoke require explicit target confirmation.\n Points are scores only; existing stamp-based Lucky Draw and prize thresholds still apply.\n Guest enrollment and account-linking require the browser; CLI uses existing device-approved auth.\n\nStaff redemption (STAFF_REDEMPTION events; most commands are registry commands, see below):\n Crew look up an Employee ID at a site counter, record the food items handed over and reveal a prize\n outcome the server decides in the same transaction. Setup is: settings, sites, crew passwords,\n sessions (one per shift), slots (se\
|
|
9336
|
+
ts per session and site), item groups and items, prizes, prize\n stock, roster. Run \'et staff-redemption setup get\' for the IDs and what is still missing.\n roster import reads a CSV, or an XLSX sheet (the first unless --sheet <name> names another; an unknown\n name lists the workbook\'s sheets; a CSV has no sheets and refuses --sheet), matches columns from header names (override\n with the column flags; "none" clears an optional column), adds new Employee IDs and updates existing\n ones, and reports created, updated, unchanged, archived, rejectedCount, rejected rows and\n unmatchedSites. Existing rows are never deleted, so redemptions survive a re-import; --archive-missing archives active entries that are not in the file.\n Use --sheet "Master list" to import that tab of a workbook (exact name, else ignoring case and spaces).\n export prints the redemption rows as JSON, or with --csv-file writes a CSV (UTF-8 with BOM, CRLF,\n one row per claim, oldest first, text that would run as a sp\
|
|
9337
|
+
readsheet formula gets a leading\n apostrophe) and prints { file, rows }. It never overwrites a file unless --force. It needs event.export\n and fails above 20,000 rows; narrow the filters.\n Crew sign-in with a site password and the counter access check are browser-only; the CLI operates\n counters as event staff (event.operate) and names the site with siteId.\n Archive and unarchive use \'staff-redemption archive set\' with archived true or false.\n Every write repeats the event ID as --target. Lookup needs no confirmation (it writes nothing\n and is not rate-limited). Redeem takes a clientRequestId UUID you generate;\n retrying with the same UUID returns the stored receipt and never redeems twice.\n\nOrganization and event setup:\n organization create is global-admin only. It provisions the org and emails an owner invitation\n to --owner-email after it is saved; deliveryStatus (sent/failed) and\n ownerInvitation.emailDeliveryStatus report the outcome. Names must be unique.\n event creat\
|
|
9338
|
+
e needs org owner/admin (or global admin). --type is an active event type such as\n LUCKY_DRAW; a LUCKY_DRAW event gets its board with default config automatically.\n --start/--end are ISO 8601 date-times with an offset, for example 2026-11-20T18:00:00+08:00.\n\nLucky draw:\n config, background and prize writes need event.setup, the same as the web board settings.\n config update is a merge patch: only the given keys change. Unknown keys and wrong value types\n are rejected before any request. Arrays (includeDomains etc.) are replaced, not appended.\n --dry-run prints the merged config without saving it.\n Keys: title, titleColor, isTitleVisible, titleFontSize, titleFont, prizeColor, prizeFontSize,\n isPrizeVisible, prizeFont, luckyDrawType (WHEEL|SLOT), slotBackgroundColor, slotBorderColor,\n slotTextColor, slotFontSize, slotTextFont, backgroundPreset, customBackgroundImage,\n numberOfSegments, segmentPreset, segmentText (NAME|LUCKY_DRAW_ID|BOTH), wheelSegmentFont,\n wheelSegmentFontSiz\
|
|
9339
|
+
e, wheelSegmentColorsPreset, includeDomains, excludeDomains, includeEmails,\n excludeEmails, titlePositionX/Y, slotPositionX/Y, prizePositionX/Y, prizeDivWidth, prizeDivHeight.\n Positions are pixels on the 1920x1080 board.\n background upload stores the image (jpeg/png/webp/gif) and sets customBackgroundImage;\n the readback contains a signed /api/attachments URL. background clear unsets it.\n prizes create appends after the last prize; --prizes takes [{"name","description"?}].\n prizes delete permanently removes unassigned prizes and renumbers the rest.\n prizes reorder takes every active prize ID once, in the new order.\n pre-draw immediately saves winners for the next unassigned prizes in order.\n Uses the live draw random selection and participant filters in the backend.\n participants replace replaces the imported source roster; it is not an append.\n It requires --allow-state-change and --target exactly equal to --event-id.\n participants list defaults to page 1 with 100 results\
|
|
9340
|
+
per page; inspect every page.\n\nRegistry commands (staff and admin operations, one per API procedure):\n et commands List every registry command as JSON.\n et <command> --help Show its input JSON Schema and confirmations.\n et <command> [--input <json> | --input-file <path>]\n et <write command> --input <json> --allow-state-change [--allow-delete] [--allow-email] --target <value>\n Groups: organization member/owner/invitation/update/image/archive/access/dashboard/analytics,\n admin organization/event/member/user/activity/dashboard, event access/details/update/\n status-update/archive/restore/duplicate/export/recent/background/story, activity list,\n lucky-draw winners/boards/participants eligible|delete/wheel/passport-sync,\n passport lucky-draws/operator-metadata, photo-wall, post-it, signature-wall, rating, human-bingo,\n staff-redemption setup/settings/site/crew-password/session/slot/item-group/item/prize/prize-stock/\n arc\
|
|
9341
|
+
hive/roster list|counts|upsert/claims/draw/stock/counter/lookup/redeem.\n --input is passed unchanged to the procedure, so field names match the web app.\n Date fields take ISO 8601 strings and are sent as dates.\n Writes require --allow-state-change and --target equal to the input key shown by --help\n (arrays joined with commas). Hard deletes add --allow-delete; emails add --allow-email.\n Run every write once with --help first and read back the result afterwards.\n\nGlobal options:\n Bare flags (--dry-run, --allow-state-change, --allow-delete, --allow-email, --public,\n --no-browser) take no value;\n --flag=value spellings are rejected before any request.\n --api-url <url> Override EVENT_TECH_API_URL.\n --help Print this help as JSON.\n --version Print the CLI version as JSON.\n\nAuthentication:\n Run et auth login, then approve the matching device in Event Tech.\n Credentials are stored exclusively through Bun.secrets.\n EVENT_TECH_API_URL d\
|
|
9342
|
+
efaults to '.concat(DEFAULT_EVENT_TECH_API_BASE_URL, ".");
|
|
9670
9343
|
import { readFile as readFile3 } from "fs/promises";
|
|
9671
9344
|
import { basename } from "path";
|
|
9672
9345
|
var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH: "BOTH" }, LuckyDrawType = { WHEEL: "WHEEL", SLOT: "SLOT" }, luckyDrawConfigSchema = object({
|
|
@@ -9705,7 +9378,12 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
|
|
|
9705
9378
|
prizePositionY: number2(),
|
|
9706
9379
|
prizeDivWidth: number2(),
|
|
9707
9380
|
prizeDivHeight: number2()
|
|
9708
|
-
}), luckyDrawConfigInputProcedureSchema = object({ eventId: string2(), config: luckyDrawConfigSchema }), luckyDrawConfigInputSchema = object({ ...luckyDrawConfigSchema.omit({ customBackgroundImage: !0 }).shape, customBackgroundImage: union(
|
|
9381
|
+
}), luckyDrawConfigInputProcedureSchema = object({ eventId: string2(), config: luckyDrawConfigSchema }), luckyDrawConfigInputSchema = object({ ...luckyDrawConfigSchema.omit({ customBackgroundImage: !0 }).shape, customBackgroundImage: union(
|
|
9382
|
+
[_instanceof(File), string2()]
|
|
9383
|
+
).optional().nullable() }), DEFAULT_LUCKY_DRAW_CONFIG_INPUT_VALUES = { title: "Lucky Draw Title", titleColor: "#111111", isTitleVisible: !0, titleFontSize: 40, prizeColor: "#111111", prizeFontSize: 30, isPrizeVisible: !0, slotBackgroundColor: "#ffffff", slotBorderColor: "#ffffff", slotTextColor: "#111111", slotFontSize: 5, backgroundPreset: "#ede9fe", numberOfSegments: 12, includeDomains: [], excludeDomains: [], includeEmails: [], excludeEmails: [], segmentPreset: "Vibrant", segmentText: LuckyDrawSegmentText.NAME, luckyDrawType: LuckyDrawType.WHEEL, titleFont: "font-sans", prizeFont: "font-sans", wheelSegmentFont: "font-sans", wheelSegmentFontSize: 12, slotTextFont: "font-sans", customBackgroundImage: null, titlePositionX: 750, titlePositionY: 100, slotPositionX: 600, slotPositionY: 300, prizePositionX: 800, prizePositionY: 200, prizeDivWidth: 500, prizeDivHeight: 100, wheelSegmentColorsPreset: "Vibrant" }, luckyDrawPrizeInputSchema = object({ name: string2().min(1), description: string2().
|
|
9384
|
+
optional() }), multipleLuckyDrawPrizeInputSchema = object(
|
|
9385
|
+
{ eventId: string2().min(1, "EventID is required"), prizes: array(luckyDrawPrizeInputSchema) }
|
|
9386
|
+
), LUCKY_DRAW_BACKGROUND_FOLDER = "lucky-draw/backgrounds", luckyDrawConfigPatchSchema = luckyDrawConfigSchema.partial().strict(), formatIssues = __name2((label, issues) => "".concat(label, " is invalid: ").concat(issues.map((issue2) => {
|
|
9709
9387
|
const path2 = issue2.path.map(String).join(".");
|
|
9710
9388
|
return path2 ? "".concat(path2, ": ").concat(issue2.message) : issue2.message;
|
|
9711
9389
|
}).join("; "), "."), "formatIssues"), parseLuckyDrawConfigPatch = __name2((raw) => {
|
|
@@ -9716,11 +9394,7 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
|
|
|
9716
9394
|
if (Object.keys(result.data).length === 0) throw new CliUsageError("--config must change at least one field.");
|
|
9717
9395
|
return result.data;
|
|
9718
9396
|
}, "parseLuckyDrawConfigPatch"), mergeLuckyDrawConfig = __name2((current, patch) => {
|
|
9719
|
-
const merged = {
|
|
9720
|
-
...DEFAULT_LUCKY_DRAW_CONFIG_INPUT_VALUES,
|
|
9721
|
-
...current ?? {},
|
|
9722
|
-
...patch
|
|
9723
|
-
}, result = luckyDrawConfigSchema.safeParse(merged);
|
|
9397
|
+
const merged = { ...DEFAULT_LUCKY_DRAW_CONFIG_INPUT_VALUES, ...current ?? {}, ...patch }, result = luckyDrawConfigSchema.safeParse(merged);
|
|
9724
9398
|
if (!result.success) throw new CliUsageError(formatIssues("Merged lucky draw config", result.error.issues));
|
|
9725
9399
|
return result.data;
|
|
9726
9400
|
}, "mergeLuckyDrawConfig"), parsePrizeList = __name2((raw) => {
|
|
@@ -9732,19 +9406,18 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
|
|
|
9732
9406
|
if (!result.success) throw new CliUsageError(formatIssues("--prizes[".concat(index, "]"), result.error.issues));
|
|
9733
9407
|
return result.data;
|
|
9734
9408
|
});
|
|
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
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
},
|
|
9740
|
-
"assertPrizesBelongToEvent"
|
|
9741
|
-
), saveConfig = __name2((eventId, config) => api2.event.luckyDraw.updateLuckyDrawConfigJson.mutate({ eventId, config }), "saveConfig"), runConfigGet = __name2(async ({ parsed, runtime, authenticate }) => {
|
|
9409
|
+
}, "parsePrizeList"), loadCurrentConfig = __name2(async (eventId) => (await api2.event.luckyDraw.getLuckyDrawByEventId.query({ eventId })).config, "loadCurrentConfig"), loadPrizes = __name2(async (eventId) => (await api2.event.luckyDraw.getLuckyDrawPrizesByEventId.query({ eventId })).prizes, "loadPrizes"), assertPrizesBelongToEvent = __name2((prizes, prizeIds, eventId) => {
|
|
9410
|
+
const known = new Set(prizes.map((prize) => prize.id)), missing = prizeIds.filter((id) => !known.has(id));
|
|
9411
|
+
if (missing.length > 0) throw new CliUsageError("Prize ID(s) not found on event ".concat(eventId, ": ").concat(missing.join(", "), "."));
|
|
9412
|
+
}, "assertPrizesBelongToEvent"), saveConfig = __name2((eventId, config) => api2.event.luckyDraw.updateLuckyDrawConfigJson.mutate({ eventId, config }), "saveConfig"), runConfigGet = __name2(async ({ parsed, runtime, authenticate }) => {
|
|
9742
9413
|
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id"]);
|
|
9743
9414
|
const eventId = getRequiredFlag(parsed, "event-id");
|
|
9744
9415
|
await authenticate(), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawByEventId.query({ eventId }));
|
|
9745
9416
|
}, "runConfigGet"), runConfigUpdate = __name2(async ({ parsed, runtime, authenticate }) => {
|
|
9746
9417
|
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "config", "config-file", "dry-run"]);
|
|
9747
|
-
const eventId = getRequiredFlag(parsed, "event-id"), patch = parseLuckyDrawConfigPatch(
|
|
9418
|
+
const eventId = getRequiredFlag(parsed, "event-id"), patch = parseLuckyDrawConfigPatch(
|
|
9419
|
+
await readInlineOrFile(parsed, "config", "config-file")
|
|
9420
|
+
);
|
|
9748
9421
|
await authenticate();
|
|
9749
9422
|
const config = mergeLuckyDrawConfig(await loadCurrentConfig(eventId), patch);
|
|
9750
9423
|
if (parsed.flags.get("dry-run") === !0) {
|
|
@@ -9763,7 +9436,13 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
|
|
|
9763
9436
|
throw new CliUsageError("--file could not be read.");
|
|
9764
9437
|
}
|
|
9765
9438
|
await authenticate();
|
|
9766
|
-
const signed = await api2.attachment.getPresignedUrlToUpload.mutate({
|
|
9439
|
+
const signed = await api2.attachment.getPresignedUrlToUpload.mutate({
|
|
9440
|
+
folder: LUCKY_DRAW_BACKGROUND_FOLDER,
|
|
9441
|
+
fileName: basename(filePath),
|
|
9442
|
+
contentType,
|
|
9443
|
+
size: file.byteLength,
|
|
9444
|
+
eventId
|
|
9445
|
+
}), uploadResponse = await fetch(signed.uploadUrl, { method: "PUT", headers: { "content-type": contentType }, body: file });
|
|
9767
9446
|
if (!uploadResponse.ok) throw new Error("Lucky draw background upload failed with HTTP ".concat(uploadResponse.status, "."));
|
|
9768
9447
|
const config = mergeLuckyDrawConfig(await loadCurrentConfig(eventId), { customBackgroundImage: signed.key });
|
|
9769
9448
|
await saveConfig(eventId, config), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawByEventId.query({ eventId }));
|
|
@@ -9773,11 +9452,12 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
|
|
|
9773
9452
|
assertStateChangeTarget(parsed, eventId), await authenticate();
|
|
9774
9453
|
const config = mergeLuckyDrawConfig(await loadCurrentConfig(eventId), { customBackgroundImage: null });
|
|
9775
9454
|
writeSuccess(runtime, await saveConfig(eventId, config));
|
|
9776
|
-
}, "runBackgroundClear"), runPrizesList = __name2(async ({
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9455
|
+
}, "runBackgroundClear"), runPrizesList = __name2(async ({
|
|
9456
|
+
parsed,
|
|
9457
|
+
runtime,
|
|
9458
|
+
authenticate
|
|
9459
|
+
}) => {
|
|
9460
|
+
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id"]);
|
|
9781
9461
|
const eventId = getRequiredFlag(parsed, "event-id");
|
|
9782
9462
|
await authenticate(), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawPrizesByEventId.query({ eventId }));
|
|
9783
9463
|
}, "runPrizesList"), runPrizesCreate = __name2(async ({ parsed, runtime, authenticate }) => {
|
|
@@ -9793,10 +9473,10 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
|
|
|
9793
9473
|
await authenticate(), assertPrizesBelongToEvent(await loadPrizes(eventId), [prizeId], eventId), writeSuccess(runtime, await api2.event.luckyDraw.updateLuckyDrawPrize.mutate({ id: prizeId, name, ...description === void 0 ? {} : { description } }));
|
|
9794
9474
|
}, "runPrizesUpdate"), runPrizesDelete = __name2(async ({ parsed, runtime, authenticate }) => {
|
|
9795
9475
|
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "prize-ids", "allow-state-change", "target"]);
|
|
9796
|
-
const eventId = getRequiredFlag(
|
|
9476
|
+
const eventId = getRequiredFlag(
|
|
9797
9477
|
parsed,
|
|
9798
|
-
"
|
|
9799
|
-
), "prize-ids");
|
|
9478
|
+
"event-id"
|
|
9479
|
+
), prizeIds = parseIdList(getRequiredFlag(parsed, "prize-ids"), "prize-ids");
|
|
9800
9480
|
assertStateChangeTarget(parsed, eventId), await authenticate(), assertPrizesBelongToEvent(await loadPrizes(eventId), prizeIds, eventId), writeSuccess(runtime, await api2.event.luckyDraw.deleteLuckyDrawPrize.mutate({ prizeIds }));
|
|
9801
9481
|
}, "runPrizesDelete"), runPrizesReorder = __name2(async ({ parsed, runtime, authenticate }) => {
|
|
9802
9482
|
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "prize-ids"]);
|
|
@@ -9805,7 +9485,10 @@ var LuckyDrawSegmentText = { NAME: "NAME", LUCKY_DRAW_ID: "LUCKY_DRAW_ID", BOTH:
|
|
|
9805
9485
|
const prizes = await loadPrizes(eventId);
|
|
9806
9486
|
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."));
|
|
9807
9487
|
const namesById = new Map(prizes.map((prize) => [prize.id, prize.name]));
|
|
9808
|
-
writeSuccess(runtime, await api2.event.luckyDraw.updateLuckyDrawPrizesOrder.mutate({
|
|
9488
|
+
writeSuccess(runtime, await api2.event.luckyDraw.updateLuckyDrawPrizesOrder.mutate({
|
|
9489
|
+
eventId,
|
|
9490
|
+
prizes: prizeIds.map((id, order) => ({ id, order, name: namesById.get(id) ?? "" }))
|
|
9491
|
+
}));
|
|
9809
9492
|
}, "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) => {
|
|
9810
9493
|
const { parsed, runtime, authenticate } = input, [, action, subAction] = parsed.positionals, handler = LUCKY_DRAW_SETUP_HANDLERS.get("".concat(action, " ").concat(subAction));
|
|
9811
9494
|
return handler ? (await handler({ parsed, runtime, authenticate }), !0) : !1;
|
|
@@ -9816,10 +9499,10 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
|
|
|
9816
9499
|
if (cells.length <= MAX_COLUMNS) return cells;
|
|
9817
9500
|
if (cells.slice(MAX_COLUMNS).some(isFilled)) throw columnLimitError();
|
|
9818
9501
|
return cells.slice(0, MAX_COLUMNS);
|
|
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(
|
|
9820
|
-
"&
|
|
9821
|
-
"
|
|
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) => {
|
|
9502
|
+
}, "clampColumns"), isZip = __name2((bytes) => bytes[0] === 80 && bytes[1] === 75 && bytes[2] === 3, "isZip"), decodeXml = __name2((value) => value.replace(new __cliRegExp("_x([0-9A-Fa-f]{4})_", "g"), (_, hex) => String.fromCharCode(Number.parseInt(hex, 16))).replace(new __cliRegExp("&#x([0-9A-Fa-f]+);", "g"), (_, hex) => String.fromCodePoint(Number.parseInt(hex, 16))).replace(new __cliRegExp("&#(\\d+);", "g"), (_, digits) => String.fromCodePoint(Number.parseInt(digits, 10))).replace(new __cliRegExp("<", "g"), "<").replace(
|
|
9503
|
+
new __cliRegExp(">", "g"),
|
|
9504
|
+
">"
|
|
9505
|
+
).replace(new __cliRegExp(""", "g"), '"').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) => {
|
|
9823
9506
|
const letters = new __cliRegExp("^[A-Z]+", "").exec(reference)?.[0] ?? "";
|
|
9824
9507
|
let index = 0;
|
|
9825
9508
|
for (const letter of letters) index = index * 26 + letter.charCodeAt(0) - 64;
|
|
@@ -9827,10 +9510,9 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
|
|
|
9827
9510
|
}, "columnIndex"), sheetPathFromTarget = __name2((target) => target.startsWith("/") ? target.slice(1) : "xl/".concat(target), "sheetPathFromTarget"), readWorkbookSheets = __name2(async (zip) => {
|
|
9828
9511
|
const workbook = await zip.file("xl/workbook.xml")?.async("string");
|
|
9829
9512
|
if (!workbook) return [];
|
|
9830
|
-
const rels = await zip.file("xl/_rels/workbook.xml.rels")?.async(
|
|
9831
|
-
"
|
|
9832
|
-
|
|
9833
|
-
))].map((match) => match[0]) : [];
|
|
9513
|
+
const rels = await zip.file("xl/_rels/workbook.xml.rels")?.async(
|
|
9514
|
+
"string"
|
|
9515
|
+
), relationships = rels ? [...rels.matchAll(new __cliRegExp("<Relationship\\b[^>]*>", "g"))].map((match) => match[0]) : [];
|
|
9834
9516
|
return [...workbook.matchAll(new __cliRegExp("<sheet\\b[^>]*>", "g"))].map((match) => {
|
|
9835
9517
|
const relationId = attribute(match[0], "r:id"), relationship = relationships.find((tag) => attribute(tag, "Id") === relationId), target = relationship ? attribute(relationship, "Target") : void 0;
|
|
9836
9518
|
return { name: decodeXml(attribute(match[0], "name") ?? ""), path: target ? sheetPathFromTarget(target) : void 0 };
|
|
@@ -9838,10 +9520,7 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
|
|
|
9838
9520
|
}, "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) => {
|
|
9839
9521
|
if (sheetName === void 0) return sheets[0]?.path ?? DEFAULT_SHEET_PATH;
|
|
9840
9522
|
const wanted = sheetName.trim().toLowerCase(), sheet = sheets.find((candidate) => candidate.name === sheetName) ?? sheets.find((candidate) => candidate.name.trim().toLowerCase() === wanted);
|
|
9841
|
-
if (!sheet) throw unknownSheetError(
|
|
9842
|
-
sheetName,
|
|
9843
|
-
sheets
|
|
9844
|
-
);
|
|
9523
|
+
if (!sheet) throw unknownSheetError(sheetName, sheets);
|
|
9845
9524
|
if (!sheet.path) throw new Error('The sheet "'.concat(sheet.name, '" could not be read.'));
|
|
9846
9525
|
return sheet.path;
|
|
9847
9526
|
}, "resolveSheetPath"), cellValue = __name2((cellXml, sharedStrings) => {
|
|
@@ -9854,7 +9533,10 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
|
|
|
9854
9533
|
return xml ? [...xml.matchAll(new __cliRegExp("<si\\b[^>]*>([\\s\\S]*?)<\\/si>", "g"))].map((match) => textRuns(match[1] ?? "")) : [];
|
|
9855
9534
|
}, "readSharedStrings"), readRowCells = __name2((rowXml, sharedStrings) => {
|
|
9856
9535
|
const cells = [];
|
|
9857
|
-
for (const cellMatch of rowXml.matchAll(new __cliRegExp(
|
|
9536
|
+
for (const cellMatch of rowXml.matchAll(new __cliRegExp(
|
|
9537
|
+
"<c\\b[^>]*?(?:\\/>|>[\\s\\S]*?<\\/c>)",
|
|
9538
|
+
"g"
|
|
9539
|
+
))) {
|
|
9858
9540
|
const reference = attribute(cellMatch[0], "r"), column = reference ? columnIndex(reference) : cells.length, value = cellValue(cellMatch[0], sharedStrings);
|
|
9859
9541
|
if (column < 0 || column >= MAX_COLUMNS) {
|
|
9860
9542
|
if (isFilled(value)) throw columnLimitError();
|
|
@@ -9890,7 +9572,10 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
|
|
|
9890
9572
|
for (; table.length > 0 && (table.at(-1) ?? []).every((value) => !value?.trim()); ) table.pop();
|
|
9891
9573
|
const width = Math.max(0, ...table.map((row) => row.length));
|
|
9892
9574
|
return table.map((row) => Array.from({ length: width }, (_, index) => row[index] ?? ""));
|
|
9893
|
-
}, "squareTable"), toBytes = __name2(
|
|
9575
|
+
}, "squareTable"), toBytes = __name2(
|
|
9576
|
+
(data) => data instanceof Uint8Array ? data : new Uint8Array(data),
|
|
9577
|
+
"toBytes"
|
|
9578
|
+
), isXlsx = __name2((fileName, bytes) => fileName.toLowerCase().endsWith(".xlsx") || isZip(bytes), "isXlsx"), assertNotLegacyXls = __name2((fileName) => {
|
|
9894
9579
|
if (fileName.toLowerCase().endsWith(".xls")) throw new Error("Save the file as .xlsx or .csv and try again.");
|
|
9895
9580
|
}, "assertNotLegacyXls"), readSpreadsheetTable = __name2(async (fileName, data, options = {}) => {
|
|
9896
9581
|
assertNotLegacyXls(fileName);
|
|
@@ -9909,10 +9594,7 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
|
|
|
9909
9594
|
});
|
|
9910
9595
|
}), validateMenuCollection = __name2((config, context) => {
|
|
9911
9596
|
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." });
|
|
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) => {
|
|
9597
|
+
}, "validateMenuCollection"), stampValueSchema = number2().int().min(0).max(PASSPORT_STAMP_VALUE_MAX), PASSPORT_STATION_CATEGORIES = ["GAME", "FOOD", "DRINK", "BINGO"], passportStationCategorySchema = _enum(PASSPORT_STATION_CATEGORIES), PASSPORT_CATEGORY_LABEL_MAX = 40, PASSPORT_CATEGORY_LABEL_LOCALES = ["en", "zh-CN"], passportCategoryLabelTextSchema = string2().trim().min(1).max(PASSPORT_CATEGORY_LABEL_MAX), sanitizePassportCategoryLabels = __name2((value) => {
|
|
9916
9598
|
if (typeof value != "object" || value === null || Array.isArray(value)) return;
|
|
9917
9599
|
const labels = {};
|
|
9918
9600
|
for (const category of PASSPORT_STATION_CATEGORIES) {
|
|
@@ -9930,11 +9612,10 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
|
|
|
9930
9612
|
const seen = /* @__PURE__ */ new Set();
|
|
9931
9613
|
items.forEach((item, index) => {
|
|
9932
9614
|
const key = item.toLocaleLowerCase();
|
|
9933
|
-
seen.has(key) && context.addIssue({ code: "custom", path: [
|
|
9934
|
-
index
|
|
9935
|
-
], message: '"'.concat(item, '" is listed more than once.') }), seen.add(key);
|
|
9615
|
+
seen.has(key) && context.addIssue({ code: "custom", path: [index], message: '"'.concat(item, '" is listed more than once.') }), seen.add(key);
|
|
9936
9616
|
});
|
|
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.
|
|
9617
|
+
}), 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.
|
|
9618
|
+
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) => {
|
|
9938
9619
|
const normalised = { ...info.subtitle ? { subtitle: info.subtitle } : {}, ...info.steps ? { steps: info.steps } : {}, ...info.menu ? { menu: info.menu } : {}, ...info.note ? { note: info.note } : {} };
|
|
9939
9620
|
return Object.keys(normalised).length > 0 ? normalised : void 0;
|
|
9940
9621
|
}), passportStationInfoInputSchema = union([_null3(), passportStationInfoSchema.transform((info) => info ?? null)]), passportLoginMethodsSchema = object({
|
|
@@ -9943,17 +9624,32 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
|
|
|
9943
9624
|
guest: boolean2(),
|
|
9944
9625
|
staffId: boolean2().default(!1),
|
|
9945
9626
|
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({
|
|
9627
|
+
}).strict().refine((methods) => methods.emailOtp || methods.google || methods.staffId, { message: "Keep email OTP, Google or roster sign-in available for passport recovery." }), PASSPORT_QUEUE_STATUSES = ["UNDER_10_MIN", "UNDER_30_MIN", "OVER_30_MIN"], passportQueueStatusSchema = _enum(PASSPORT_QUEUE_STATUSES), PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN = 1, PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX = 240, PASSPORT_STAFF_ID_LABEL_DEFAULT = "Employee Number", PASSPORT_STAFF_ID_LABEL_MAX = 40, passportStaffIdLabelSchema = string2().trim().min(1).max(PASSPORT_STAFF_ID_LABEL_MAX), passportConfigSchema = object({
|
|
9628
|
+
version: literal(1),
|
|
9629
|
+
loginMethods: passportLoginMethodsSchema,
|
|
9630
|
+
guestScan: boolean2().optional(),
|
|
9631
|
+
simplifiedChinese: boolean2().optional(),
|
|
9632
|
+
staffIdLabel: passportStaffIdLabelSchema.optional().catch(void 0),
|
|
9633
|
+
categoryLabels: unknown().transform(sanitizePassportCategoryLabels).optional(),
|
|
9634
|
+
queueStatus: boolean2().optional().catch(void 0),
|
|
9635
|
+
queueStatusStaleMinutes: number2().int().min(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN).max(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX).optional().catch(void 0)
|
|
9636
|
+
}), PRIZE_DESK_AWARD_MODES = ["SELF_SCAN", "STAFF_SCAN"], passportStationConfigSchema = object({ version: literal(1), collectionMode: _enum(["SELF_SCAN", "STAFF_SCAN", "STAFF_SCORE", "STAFF_TALLY"]), maxPoints: pointsSchema, printedQrVersion: printVersionSchema, printedQrEnabled: boolean2(), stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), tallyItems: passportTallyItemsSchema.optional(), tallyEarnsStamp: boolean2().optional(), menuItems: passportMenuItemsSchema.optional(), showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionLimit: _enum(["ONCE", "UNLIMITED"]).optional(), prizeDeskAward: boolean2().optional(), info: passportStationInfoSchema.optional().catch(void 0) }).superRefine((config, context) => {
|
|
9947
9637
|
validateMenuCollection(config, context);
|
|
9948
9638
|
const tally = config.collectionMode === "STAFF_TALLY";
|
|
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(
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9639
|
+
tally && !config.tallyItems && context.addIssue({ code: "custom", path: ["tallyItems"], message: "Tally stations need at least one item." }), !tally && (config.tallyItems !== void 0 || config.tallyEarnsStamp !== void 0) && context.addIssue({ code: "custom", path: ["tallyItems"], message: "Only tally stations can list items." }), config.prizeDeskAward === !0 && (PRIZE_DESK_AWARD_MODES.includes(config.collectionMode) || context.addIssue({ code: "custom", path: ["prizeDeskAward"], message: "Only self-scan and staff-scan stations can be awarded at the prize desk." }), config.category === "BINGO" && context.addIssue({ code: "custom", path: ["prizeDeskAward"], message: "The Bingo station cannot be awarded at the prize desk." })), config.collectionMode !== "STAFF_SCORE" && config.maxPoints !== 0 && context.addIssue({ code: "custom", path: ["maxPoints"], message: "Only scored stations can award points." }), config.collectionMode !== "SELF_SCAN" && config.printedQrEnabled && context.addIssue(
|
|
9640
|
+
{ code: "custom", path: ["printedQrEnabled"], message: "Only self-scan stations can issue printed QR codes." });
|
|
9641
|
+
}), passportStationCollectionSchema = discriminatedUnion("collectionMode", [object({ showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionMode: literal("SELF_SCAN"), stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), prizeDeskAward: boolean2().optional(), info: passportStationInfoInputSchema.optional() }).strict(), object({ showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionMode: literal("STAFF_SCAN"), menuItems: passportMenuItemsSchema.nullable().optional(), collectionLimit: _enum(["ONCE", "UNLIMITED"]).optional(), stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), prizeDeskAward: boolean2().optional(), info: passportStationInfoInputSchema.optional() }).strict(), object({ showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionMode: literal("STAFF_SCORE"), maxPoints: pointsSchema, stampValue: stampValueSchema.optional(),
|
|
9642
|
+
category: passportStationCategorySchema.optional(), info: passportStationInfoInputSchema.optional() }).strict(), object({ showHowToCollect: boolean2().optional(), showMyQr: boolean2().optional(), collectionMode: literal("STAFF_TALLY"), tallyItems: passportTallyItemsSchema, tallyEarnsStamp: boolean2().default(!1), stampValue: stampValueSchema.optional(), category: passportStationCategorySchema.optional(), info: passportStationInfoInputSchema.optional() }).strict()]), passportEventIdSchema = object({ eventId: string2().min(1) }), passportStationIdSchema = passportEventIdSchema.extend({ stationId: string2().min(1) }), passportQrInputSchema = passportEventIdSchema.extend({ code: string2().min(1).max(2048) }), passportPrintQrMutationSchema = passportStationIdSchema.extend({ expectedPrintedQrVersion: printVersionSchema }), collectPassportStampByStaffSchema = passportStationIdSchema.extend({ profileCode: string2().min(1).max(2048), site: string2().trim().min(1).max(60).optional(), requestId: uuid2().
|
|
9643
|
+
optional(), points: pointsSchema.optional(), item: string2().trim().min(1).max(PASSPORT_TALLY_ITEM_NAME_MAX).optional() }), recordPassportTallySchema = passportStationIdSchema.extend({ profileCode: string2().min(1).max(2048), item: string2().trim().min(1).max(PASSPORT_TALLY_ITEM_NAME_MAX), quantity: number2().int().min(1).max(PASSPORT_TALLY_QUANTITY_MAX).default(1) }), reversePassportTallySchema = passportEventIdSchema.extend({ tallyId: string2().min(1), reason: string2().trim().min(1).max(200) }), correctPassportStampSchema = passportStationIdSchema.extend({ participantId: string2().min(1), collectionId: string2().min(1).optional(), site: string2().trim().min(1).max(60).optional(), stamped: boolean2(), reason: string2().trim().min(1).max(500), points: pointsSchema.optional(), item: string2().trim().min(1).max(PASSPORT_TALLY_ITEM_NAME_MAX).optional() }), beginPassportAccountLinkSchema = discriminatedUnion("method", [passportEventIdSchema.extend({ method: literal("EMAIL_OTP"), email: string2().
|
|
9644
|
+
trim().toLowerCase().pipe(email2()) }).strict(), passportEventIdSchema.extend({ method: literal("GOOGLE") }).strict()]), passportAccountLinkIntentSchema = passportEventIdSchema.extend({ intent: string2().regex(new __cliRegExp("^epl1\\.[A-Za-z0-9_-]{43}$", "")) }), requestPassportAccountLinkOtpSchema = passportAccountLinkIntentSchema.extend({ email: string2().trim().toLowerCase().pipe(email2()) }), joinPassportSchema = passportEventIdSchema.extend({ name: string2().trim().min(1).max(100) }), passportCategoryLabelInputSchema = string2().trim().max(PASSPORT_CATEGORY_LABEL_MAX), passportCategoryLabelEntryInputSchema = strictObject({ en: passportCategoryLabelInputSchema.optional(), "zh-CN": passportCategoryLabelInputSchema.optional() }), passportCategoryLabelsInputSchema = strictObject({ GAME: passportCategoryLabelEntryInputSchema.optional(), FOOD: passportCategoryLabelEntryInputSchema.optional(), DRINK: passportCategoryLabelEntryInputSchema.optional(), BINGO: passportCategoryLabelEntryInputSchema.
|
|
9645
|
+
optional() }).transform((labels) => sanitizePassportCategoryLabels(labels) ?? {}), passportSettingsSchema = passportEventIdSchema.extend({ luckyDrawStampThreshold: number2().int().positive().nullable(), prizeStampThreshold: number2().int().positive().nullable(), maxRedemptionsPerParticipant: number2().int().min(0).max(2147483647), linkedDrawEventId: string2().min(1).nullable(), loginMethods: passportLoginMethodsSchema.optional(), guestScan: boolean2().optional(), simplifiedChinese: boolean2().optional(), staffIdLabel: union([_null3(), string2().trim().max(PASSPORT_STAFF_ID_LABEL_MAX).transform((label) => label === "" ? null : label)]).optional(), categoryLabels: union([_null3(), passportCategoryLabelsInputSchema]).optional(), queueStatus: boolean2().optional(), queueStatusStaleMinutes: number2().int().min(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN).max(PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX).nullable().optional() }), setPassportStationQueueStatusSchema = passportEventIdSchema.extend({ stationId: string2().
|
|
9646
|
+
min(1), status: passportQueueStatusSchema.nullable() }), renamePassportBingoSchema = passportEventIdSchema.extend({ name: string2().trim().min(1).max(100) }), passportStationSchema = passportEventIdSchema.extend({ id: string2().optional(), name: string2().trim().min(
|
|
9647
|
+
1
|
|
9648
|
+
).max(100), description: string2().trim().max(1e3).nullable(), location: string2().trim().max(200).nullable(), address: string2().trim().max(300).nullable().optional(), imageKey: string2().nullable().optional(), order: number2().int().min(0), opensAt: date2().nullable(), closesAt: date2().nullable(), collection: passportStationCollectionSchema.optional() }), passportPrizeSchema = passportEventIdSchema.extend({ id: string2().optional(), name: string2().trim().min(1).max(100), description: string2().trim().max(1e3).nullable(), imageKey: string2().max(2048).nullable().optional(), stock: number2().int().min(0), stampCost: number2().int().min(0).max(PASSPORT_PRIZE_STAMP_COST_MAX).optional(), order: number2().int().min(0) }), passportRedemptionRequestIdSchema = uuid2(), redeemPassportPrizeSchema = passportEventIdSchema.extend({ participantId: string2().min(1), prizeId: string2().min(1), quantity: number2().int().min(1).max(PASSPORT_REDEMPTION_QUANTITY_MAX).default(1), awardStationId: string2().
|
|
9649
|
+
min(1).optional(), bonusStamps: passportBonusStampsSchema.default(0), requestId: passportRedemptionRequestIdSchema.optional() }), PASSPORT_ROSTER_STAFF_ID_MAX = 64, PASSPORT_ROSTER_NAME_MAX = 100, PASSPORT_ROSTER_IMPORT_MAX = 2e4, PASSPORT_ROSTER_PAGE_MAX = 100, normalizePassportRosterKey = __name2((value) => value.normalize("NFKD").replace(new __cliRegExp("\\p{M}", "gu"), "").toLocaleLowerCase("en").replace(new __cliRegExp("[^\\p{L}\\p{N}]", "gu"), ""), "normalizePassportRosterKey"), rosterStaffIdSchema = string2().trim().min(1, "Enter an ID.").max(PASSPORT_ROSTER_STAFF_ID_MAX).refine((value) => normalizePassportRosterKey(value) !== "", { message: "The ID needs at least one letter or digit." }), rosterLastNameSchema = string2().trim().min(1, "Enter a last name.").max(PASSPORT_ROSTER_NAME_MAX).refine((value) => normalizePassportRosterKey(value) !== "", { message: "Last name needs at least one letter or digit." }), rosterOptionalLastNameSchema = string2().trim().max(PASSPORT_ROSTER_NAME_MAX).
|
|
9650
|
+
nullable().transform((value) => value || null).refine((value) => value === null || normalizePassportRosterKey(value) !== "", { message: "Last name needs at least one letter or digit." }), passportStaffIdSignInSchema = passportEventIdSchema.extend({ staffId: rosterStaffIdSchema, lastName: rosterLastNameSchema.optional() }).strict(), passportRosterEntrySchema = passportEventIdSchema.extend({ id: string2().min(1).optional(), staffId: rosterStaffIdSchema, lastName: rosterOptionalLastNameSchema, displayName: string2().trim().max(PASSPORT_ROSTER_NAME_MAX).nullable().transform((value) => value || null) }).strict(), passportRosterEntryIdSchema = passportEventIdSchema.extend({ entryId: string2().min(1) }).strict(), passportRosterListSchema = passportEventIdSchema.extend({ search: string2().trim().max(200).optional(), limit: number2().int().min(1).max(PASSPORT_ROSTER_PAGE_MAX).default(25), cursor: string2().min(1).max(8192).nullish(), direction: literal("forward").optional() }).strict(), passportRosterCountsSchema = passportEventIdSchema.
|
|
9651
|
+
extend({ search: string2().trim().max(200).optional() }).strict(), passportRosterImportRowSchema = object({ row: number2().int().min(1), staffId: string2().max(1e3), lastName: string2().max(1e3), displayName: string2().max(1e3).nullable() }).strict(), importPassportRosterSchema = passportEventIdSchema.extend({ rows: array(passportRosterImportRowSchema).max(PASSPORT_ROSTER_IMPORT_MAX, "A roster can have at most ".concat(PASSPORT_ROSTER_IMPORT_MAX, " rows.")) }).strict(), passportRosterRejectReasonLabels = __name2((staffIdLabel) => ({ MISSING_STAFF_ID: "The ".concat(staffIdLabel, " is blank"), MISSING_LAST_NAME: "Last name is blank", DUPLICATE_STAFF_ID: "The ".concat(staffIdLabel, " appears earlier in the file"), TOO_LONG: "The ".concat(staffIdLabel, " is over ").concat(PASSPORT_ROSTER_STAFF_ID_MAX, " characters or a name is over ").concat(PASSPORT_ROSTER_NAME_MAX) }), "passportRosterRejectReasonLabels"), passportRosterRejectReasonLabel = passportRosterRejectReasonLabels(PASSPORT_STAFF_ID_LABEL_DEFAULT),
|
|
9652
|
+
cell = __name2((row, index) => index === null ? "" : (row[index] ?? "").trim(), "cell"), surnameOf = __name2((fullName, position) => {
|
|
9957
9653
|
const words = fullName.split(new __cliRegExp("\\s+", "")).filter(Boolean);
|
|
9958
9654
|
return (position === "first" ? words[0] : words.at(-1)) ?? "";
|
|
9959
9655
|
}, "surnameOf"), assertPassportRosterMapping = __name2((mapping, columnCount, requireLastName) => {
|
|
@@ -9965,7 +9661,10 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
|
|
|
9965
9661
|
if (table.slice(1).forEach((row, index) => {
|
|
9966
9662
|
if (row.every((value) => value.trim() === "")) return;
|
|
9967
9663
|
const fullName = cell(row, mapping.fullName), lastName = mapping.lastName === null ? surnameOf(fullName, mapping.surnamePosition) : cell(row, mapping.lastName), displayName = cell(row, mapping.displayName ?? mapping.fullName) || null;
|
|
9968
|
-
rows.push({ row: index + 2, staffId: cell(
|
|
9664
|
+
rows.push({ row: index + 2, staffId: cell(
|
|
9665
|
+
row,
|
|
9666
|
+
mapping.staffId
|
|
9667
|
+
), lastName, displayName });
|
|
9969
9668
|
}), 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."));
|
|
9970
9669
|
return rows;
|
|
9971
9670
|
}, "mapPassportRosterTable"), headerPatterns = { staffId: new __cliRegExp("^(staff|employee|emp|personnel|badge|worker)[\\s_-]*(id|no|number|#|code)?$|^(staff|employee)$|^id$", ""), lastName: new __cliRegExp("^(last[\\s_-]*name|surname|family[\\s_-]*name|lname)$", ""), fullName: new __cliRegExp("^(full[\\s_-]*name|name|staff[\\s_-]*name|employee[\\s_-]*name)$", ""), displayName: new __cliRegExp("^(display[\\s_-]*name|preferred[\\s_-]*name|nickname)$", "") }, guessPassportRosterMapping = __name2((headers) => {
|
|
@@ -9974,15 +9673,16 @@ var import_jszip = __toESM(require_lib3(), 1), import_papaparse = __toESM(requir
|
|
|
9974
9673
|
return index === -1 ? null : index;
|
|
9975
9674
|
}, "find");
|
|
9976
9675
|
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(
|
|
9978
|
-
|
|
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().
|
|
9676
|
+
}, "guessPassportRosterMapping"), PASSPORT_STATION_PASSWORD_MIN = 6, PASSPORT_STATION_PASSWORD_MAX = 128, PASSPORT_STATION_RECIPIENTS_PAGE_MAX = 100, stationStaffPasswordSchema = string2().min(PASSPORT_STATION_PASSWORD_MIN, "Use at least ".concat(PASSPORT_STATION_PASSWORD_MIN, " characters.")).max(PASSPORT_STATION_PASSWORD_MAX, "Use at most ".concat(PASSPORT_STATION_PASSWORD_MAX, " characters.")).refine((value) => value === value.trim(), { message: "Remove the spaces at the start or end of the password." }), signInToStationStaffSchema = passportEventIdSchema.extend({ password: string2().min(1).max(PASSPORT_STATION_PASSWORD_MAX) }).strict(), setPassportStationPasswordSchema = passportEventIdSchema.extend({ password: stationStaffPasswordSchema }).strict(), participantCodeSchema = string2().min(1).max(2048), stationStaffParticipantSchema = union([passportStationIdSchema.extend(
|
|
9677
|
+
{ profileCode: participantCodeSchema, site: string2().trim().min(1).max(60).optional() }
|
|
9678
|
+
), passportStationIdSchema.extend({ staffId: string2().trim().min(1).max(PASSPORT_ROSTER_STAFF_ID_MAX), site: string2().trim().min(1).max(60).optional() })]), stationPrizeClaimParticipantSchema = union([passportEventIdSchema.extend({ profileCode: participantCodeSchema }), passportEventIdSchema.extend({ staffId: string2().trim().min(1).max(PASSPORT_ROSTER_STAFF_ID_MAX) })]), redeemPrizeAsStationStaffSchema = passportEventIdSchema.extend({ profileCode: participantCodeSchema, prizeId: string2().min(1), awardStationId: string2().min(1).optional(), bonusStamps: passportBonusStampsSchema.default(0), requestId: passportRedemptionRequestIdSchema.optional() }).strict(), stationStampRecipientFiltersSchema = object({ search: string2().trim().max(200).optional() }).strict(), passportStationStampRecipientsSchema = passportStationIdSchema.extend({ filters: stationStampRecipientFiltersSchema.default({}), limit: number2().int().min(1).max(PASSPORT_STATION_RECIPIENTS_PAGE_MAX).default(25), cursor: string2().
|
|
9679
|
+
min(1).max(8192).nullish(), direction: _enum(["forward", "backward"]).default("forward") }).strict().refine((input) => input.direction === "forward" || !!input.cursor, { message: "A backward page needs a cursor.", path: ["cursor"] }), passportStationStampRecipientCountsSchema = passportStationIdSchema.extend({ filters: stationStampRecipientFiltersSchema.default({}) }).strict();
|
|
9980
9680
|
import { readFile as readFile4 } from "fs/promises";
|
|
9981
9681
|
import { basename as basename2 } from "path";
|
|
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(
|
|
9983
|
-
"
|
|
9984
|
-
"
|
|
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) => {
|
|
9682
|
+
var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTES = 200 * 1024 * 1024, MAX_HUMAN_BINGO_MEDIA_UPLOAD_BYTES = 1024 * 1024 * 1024, SAFE_IMAGE_CONTENT_TYPES = ["image/jpeg", "image/png", "image/webp", "image/gif"], VIDEO_CONTENT_TYPES = ["video/mp4", "video/quicktime", "video/webm", "video/ogg"], SAFE_EVENT_IMAGE_CONTENT_TYPES = [...SAFE_IMAGE_CONTENT_TYPES], SAFE_EVENT_VIDEO_CONTENT_TYPES = [...VIDEO_CONTENT_TYPES], SAFE_EVENT_UPLOAD_CONTENT_TYPES = [...SAFE_IMAGE_CONTENT_TYPES, ...VIDEO_CONTENT_TYPES], getEventPassportUploadBaseFolder = __name2(
|
|
9683
|
+
(kind) => "event-passport/".concat(kind),
|
|
9684
|
+
"getEventPassportUploadBaseFolder"
|
|
9685
|
+
), EVENT_TECH_EVENT_TYPES = Object.values(EventType), HEX_COLOR_PATTERN = new __cliRegExp("^#[0-9a-f]{6}$", "i"), isEventThemeHexColor = __name2((value) => HEX_COLOR_PATTERN.test(value), "isEventThemeHexColor"), DEFAULT_PASSPORT_SKIN_SETTINGS = { heroImage: null, logo: null, colors: { graphic: null, dark: null }, emphasis: "accent" }, isRecord = __name2((value) => typeof value == "object" && value !== null && !Array.isArray(value), "isRecord"), toKey = __name2((value) => typeof value == "string" && value.trim().length > 0 ? value.trim() : null, "toKey"), toPercent = __name2((value) => typeof value == "number" && Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 50, "toPercent"), toHex = __name2((value) => typeof value == "string" && isEventThemeHexColor(value) ? value.toLowerCase() : null, "toHex"), readHeroImage = __name2((value) => {
|
|
9986
9686
|
if (!isRecord(value)) return null;
|
|
9987
9687
|
const key = toKey(value.key);
|
|
9988
9688
|
return key ? { key, focalX: toPercent(value.focalX), focalY: toPercent(value.focalY) } : null;
|
|
@@ -9991,11 +9691,14 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
9991
9691
|
const key = toKey(value.key);
|
|
9992
9692
|
return key ? { key } : null;
|
|
9993
9693
|
}, "readLogo"), resolvePassportSkinSettings = __name2((value) => {
|
|
9994
|
-
if (!isRecord(value))
|
|
9995
|
-
return DEFAULT_PASSPORT_SKIN_SETTINGS;
|
|
9694
|
+
if (!isRecord(value)) return DEFAULT_PASSPORT_SKIN_SETTINGS;
|
|
9996
9695
|
const colors = isRecord(value.colors) ? value.colors : {};
|
|
9997
9696
|
return { heroImage: readHeroImage(value.heroImage), logo: readLogo(value.logo), colors: { graphic: toHex(colors.graphic), dark: toHex(colors.dark) }, emphasis: value.emphasis === "ink" ? "ink" : "accent" };
|
|
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 = {
|
|
9697
|
+
}, "resolvePassportSkinSettings"), resolvePassportSkinSettingsFromAppearance = __name2((appearance) => resolvePassportSkinSettings(isRecord(appearance) ? appearance.passport : void 0), "resolvePassportSkinSettingsFromAppearance"), photoWallScreenSchema = object({ width: number2().int().min(240).max(16384), height: number2().int().min(240).max(16384) }), photoWallSubmissionSettingsSchema = object({ mode: _enum(["photo-only", "comment-only", "photo-and-comment"]), photoRequired: boolean2(), commentRequired: boolean2() }), DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS = {
|
|
9698
|
+
mode: "photo-and-comment",
|
|
9699
|
+
photoRequired: !0,
|
|
9700
|
+
commentRequired: !1
|
|
9701
|
+
}, hexColorSchema = string2().trim().regex(new __cliRegExp("^#[0-9a-f]{6}$", "i"), "Color must be a six-digit hex color").transform((value) => value.toLowerCase()), getRelativeLuminance = __name2((color) => {
|
|
9999
9702
|
const toLinear = __name2((channel) => {
|
|
10000
9703
|
const normalized = channel / 255;
|
|
10001
9704
|
return normalized <= 0.04045 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
|
|
@@ -10004,18 +9707,14 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10004
9707
|
}, "getRelativeLuminance"), hasReadableTextContrast = __name2((textColor, backgroundColor) => {
|
|
10005
9708
|
const textLuminance = getRelativeLuminance(textColor), backgroundLuminance = getRelativeLuminance(backgroundColor);
|
|
10006
9709
|
return (Math.max(textLuminance, backgroundLuminance) + 0.05) / (Math.min(textLuminance, backgroundLuminance) + 0.05) >= 4.5;
|
|
10007
|
-
}, "hasReadableTextContrast"), eventThemeSchema = object({ accentColor: hexColorSchema, backgroundColor: hexColorSchema, textColor: hexColorSchema, fontFamily: _enum(
|
|
9710
|
+
}, "hasReadableTextContrast"), eventThemeSchema = object({ accentColor: hexColorSchema, backgroundColor: hexColorSchema, textColor: hexColorSchema, fontFamily: _enum(
|
|
9711
|
+
["SYSTEM", "JAKARTA", "SERIF"]
|
|
9712
|
+
) }).superRefine((theme, context) => {
|
|
10008
9713
|
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"] });
|
|
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
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
showQrCode: boolean2(),
|
|
10014
|
-
qrCodeLabel: string2().trim().max(80, "QR code text must be 80 characters or fewer").transform((value) => value || "Scan to share").default("Scan to share"),
|
|
10015
|
-
showEventName: boolean2(),
|
|
10016
|
-
screen: photoWallScreenSchema.nullable().default(null),
|
|
10017
|
-
submission: photoWallSubmissionSettingsSchema.default(DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS)
|
|
10018
|
-
}) }), DEFAULT_PASSPORT_SKIN = { heroImage: null, logo: null, colors: { graphic: null, dark: null }, emphasis: "accent" }, DEFAULT_EVENT_APPEARANCE2 = { version: 1, theme: { accentColor: "#f84404", backgroundColor: "#f6f7f9", textColor: "#20242a", fontFamily: "SYSTEM" }, guestBackground: { type: "none", key: null }, displayBackground: { type: "none", key: null }, photoWall: { durationSeconds: 18, maxVisible: 4, motion: "gentle", showQrCode: !0, qrCodeLabel: "Scan to share", showEventName: !0, screen: null, submission: DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS } }, IMAGE_CONTENT_TYPES = ["image/jpeg", "image/png", "image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requiredValue = __name2((flags, name) => {
|
|
9714
|
+
}), appearanceMediaSchema = discriminatedUnion("type", [object({ type: literal("none"), key: _null3() }), object({ type: literal("image"), key: string2().min(1).max(1024) })]), displayMediaSchema = discriminatedUnion("type", [object({ type: literal("none"), key: _null3() }), object({ type: literal("image"), key: string2().min(1).max(1024) }), object({ type: literal("video"), key: string2().min(1).max(1024) })]), passportImageKeySchema = string2().trim().min(1).max(1024), passportFocalSchema = number2().min(0).max(100), passportSkinSchema = object({ heroImage: object({ key: passportImageKeySchema, focalX: passportFocalSchema.default(50), focalY: passportFocalSchema.default(50) }).nullable().default(null), logo: object({ key: passportImageKeySchema }).nullable().default(null), colors: object({ graphic: hexColorSchema.nullable().default(null), dark: hexColorSchema.nullable().default(null).refine((color) => color === null || hasReadableTextContrast("#ffffff", color), "Dark colour must have\
|
|
9715
|
+
at least 4.5:1 contrast with white text") }).default({ graphic: null, dark: null }), emphasis: _enum(["accent", "ink"]).default("accent") }), bingoScreenAppearanceSchema = object({ title: string2().trim().max(80).default(""), joinHeading: string2().trim().min(1).max(40).default("Scan to join"), joinInstructions: string2().trim().min(1).max(180).default("Open your camera, scan the QR code and enter your name."), titleFontSize: number2().int().min(32).max(96).default(64), nameFontSize: number2().int().min(24).max(52).default(40) }), DEFAULT_BINGO_SCREEN_APPEARANCE = bingoScreenAppearanceSchema.parse({}), eventAppearanceSchema = object({ version: literal(1), theme: eventThemeSchema, guestBackground: appearanceMediaSchema, displayBackground: displayMediaSchema, passport: passportSkinSchema.optional(), humanBingo: bingoScreenAppearanceSchema.optional(), photoWall: object({ durationSeconds: number2().int().min(10).max(40), maxVisible: number2().int().min(1).max(16), motion: _enum(["gentle",
|
|
9716
|
+
"lively", "roaming"]), showQrCode: boolean2(), qrCodeLabel: string2().trim().max(80, "QR code text must be 80 characters or fewer").transform((value) => value || "Scan to share").default("Scan to share"), showEventName: boolean2(), screen: photoWallScreenSchema.nullable().default(null), submission: photoWallSubmissionSettingsSchema.default(DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS) }) }), DEFAULT_PASSPORT_SKIN = { heroImage: null, logo: null, colors: { graphic: null, dark: null }, emphasis: "accent" }, DEFAULT_EVENT_APPEARANCE2 = { version: 1, theme: { accentColor: "#f84404", backgroundColor: "#f6f7f9", textColor: "#20242a", fontFamily: "SYSTEM" }, guestBackground: { type: "none", key: null }, displayBackground: { type: "none", key: null }, photoWall: { durationSeconds: 18, maxVisible: 4, motion: "gentle", showQrCode: !0, qrCodeLabel: "Scan to share", showEventName: !0, screen: null, submission: DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS } }, IMAGE_CONTENT_TYPES = ["image/jpeg", "image/png", "\
|
|
9717
|
+
image/webp", "image/gif"], PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"], requiredValue = __name2((flags, name) => {
|
|
10019
9718
|
const value = flags.get(name);
|
|
10020
9719
|
if (typeof value != "string" || value === "") throw new CliUsageError("--".concat(name, " is required and needs a value."));
|
|
10021
9720
|
return value;
|
|
@@ -10034,10 +9733,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10034
9733
|
return parsed;
|
|
10035
9734
|
}, "parseJsonRecord"), mergeSkinPatch = __name2((current, patch) => {
|
|
10036
9735
|
const allowed = ["heroImage", "logo", "colors", "emphasis"];
|
|
10037
|
-
if (Object.keys(patch).some((key) => !allowed.includes(key))) throw new CliUsageError("--skin-json supports only: ".concat(
|
|
10038
|
-
allowed.join(", "),
|
|
10039
|
-
"."
|
|
10040
|
-
));
|
|
9736
|
+
if (Object.keys(patch).some((key) => !allowed.includes(key))) throw new CliUsageError("--skin-json supports only: ".concat(allowed.join(", "), "."));
|
|
10041
9737
|
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);
|
|
10042
9738
|
if (!parsed.success) throw new CliUsageError("Invalid passport skin: ".concat(parsed.error.issues.map((issue2) => "".concat(issue2.path.join(".") || "skin", ": ").concat(issue2.message)).join("; ")));
|
|
10043
9739
|
return parsed.data;
|
|
@@ -10045,51 +9741,51 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10045
9741
|
const projection = await api2.event.getEventAppearance.query({ eventId }), appearance = eventAppearanceSchema.parse(projection.appearance ?? DEFAULT_EVENT_APPEARANCE2);
|
|
10046
9742
|
return { projection, appearance };
|
|
10047
9743
|
}, "readCanonicalAppearance"), getPassportSkin = __name2(async (eventId) => {
|
|
10048
|
-
const {
|
|
10049
|
-
projection,
|
|
10050
|
-
appearance
|
|
10051
|
-
} = await readCanonicalAppearance(eventId);
|
|
10052
|
-
return { appearanceVersion: projection.appearanceVersion, hasCustomAppearance: projection.hasCustomAppearance, passport: resolvePassportSkinSettingsFromAppearance(appearance), passportHeroImageUrl: projection.passportHeroImageUrl, passportLogoUrl: projection.passportLogoUrl };
|
|
10053
|
-
}, "getPassportSkin"), saveSkin = __name2(async (eventId, appearanceVersion, buildSkin) => {
|
|
10054
9744
|
const { projection, appearance } = await readCanonicalAppearance(eventId);
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
const
|
|
10061
|
-
|
|
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;
|
|
9745
|
+
return { appearanceVersion: projection.appearanceVersion, hasCustomAppearance: projection.hasCustomAppearance, passport: resolvePassportSkinSettingsFromAppearance(appearance), passportHeroImageUrl: projection.passportHeroImageUrl, passportLogoUrl: projection.passportLogoUrl };
|
|
9746
|
+
}, "getPassportSkin"), saveSkin = __name2(
|
|
9747
|
+
async (eventId, appearanceVersion, buildSkin) => {
|
|
9748
|
+
const { projection, appearance } = await readCanonicalAppearance(eventId);
|
|
9749
|
+
if (projection.appearanceVersion !== appearanceVersion) throw new CliUsageError("The appearance is at version ".concat(projection.appearanceVersion, ", not ").concat(appearanceVersion, ". Read it with `et passport skin get` and retry."));
|
|
9750
|
+
const next = { ...appearance, passport: buildSkin(resolvePassportSkinSettingsFromAppearance(appearance)) };
|
|
9751
|
+
return api2.event.updateEventAppearance.mutate({ eventId, appearance: next, appearanceVersion });
|
|
10067
9752
|
},
|
|
10068
|
-
"
|
|
10069
|
-
),
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
9753
|
+
"saveSkin"
|
|
9754
|
+
), isUploadKind = __name2((kinds, value) => kinds.some((kind) => kind === value), "isUploadKind"), uploadPassportImage = __name2(async (eventId, kind, flags) => {
|
|
9755
|
+
const filePath = requiredValue(flags, "file"), contentType = requiredValue(flags, "content-type");
|
|
9756
|
+
if (!IMAGE_CONTENT_TYPES.some((allowed) => allowed === contentType)) throw new CliUsageError("--content-type must be one of: ".concat(IMAGE_CONTENT_TYPES.join(", "), "."));
|
|
9757
|
+
const file = await readFile4(filePath);
|
|
9758
|
+
if (file.byteLength > MAX_EVENT_IMAGE_UPLOAD_BYTES) throw new CliUsageError("The image must be 25 MB or smaller.");
|
|
9759
|
+
const signed = await api2.attachment.getPresignedUrlToUpload.mutate({ folder: getEventPassportUploadBaseFolder(kind), fileName: basename2(filePath), contentType, size: file.byteLength, eventId }), uploadResponse = await fetch(signed.uploadUrl, { method: "PUT", headers: { "content-type": contentType }, body: file });
|
|
9760
|
+
if (!uploadResponse.ok) throw new Error("Passport image upload failed with HTTP ".concat(uploadResponse.status, "."));
|
|
9761
|
+
return signed;
|
|
9762
|
+
}, "uploadPassportImage"), createSkinOperation = __name2(
|
|
9763
|
+
(subcommand, { eventId, flags, allowed }) => {
|
|
9764
|
+
switch (subcommand) {
|
|
9765
|
+
case "get":
|
|
9766
|
+
return () => getPassportSkin(eventId);
|
|
9767
|
+
case "set": {
|
|
9768
|
+
allowed.push("appearance-version", "skin-json");
|
|
9769
|
+
const version2 = nonnegativeInteger(requiredValue(flags, "appearance-version"), "appearance-version"), patch = parseJsonRecord(requiredValue(flags, "skin-json"), "skin-json");
|
|
9770
|
+
return () => saveSkin(eventId, version2, (current) => mergeSkinPatch(current, patch));
|
|
9771
|
+
}
|
|
9772
|
+
case "clear": {
|
|
9773
|
+
allowed.push("appearance-version");
|
|
9774
|
+
const version2 = nonnegativeInteger(requiredValue(flags, "appearance-version"), "appearance-version");
|
|
9775
|
+
return () => saveSkin(eventId, version2, () => DEFAULT_PASSPORT_SKIN);
|
|
9776
|
+
}
|
|
9777
|
+
case "upload": {
|
|
9778
|
+
allowed.push("kind", "file", "content-type");
|
|
9779
|
+
const kind = requiredValue(flags, "kind");
|
|
9780
|
+
if (!isUploadKind(PASSPORT_SKIN_UPLOAD_KINDS, kind)) throw new CliUsageError("--kind must be one of: ".concat(PASSPORT_SKIN_UPLOAD_KINDS.join(", "), "."));
|
|
9781
|
+
return () => uploadPassportImage(eventId, kind, flags);
|
|
9782
|
+
}
|
|
9783
|
+
default:
|
|
9784
|
+
return null;
|
|
10088
9785
|
}
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
}, "createSkinOperation"), setStationImage = __name2(async (eventId, stationId, imageKey) => {
|
|
9786
|
+
},
|
|
9787
|
+
"createSkinOperation"
|
|
9788
|
+
), setStationImage = __name2(async (eventId, stationId, imageKey) => {
|
|
10093
9789
|
const station = (await api2.event.passport.getPassportOverview.query({ eventId })).stations.find((item) => item.id === stationId);
|
|
10094
9790
|
if (!station) throw new CliUsageError("Station not found for this event.");
|
|
10095
9791
|
return api2.event.passport.upsertPassportStation.mutate({ eventId, id: station.id, name: station.name, description: station.description, location: station.location, imageKey: imageKey ? await imageKey() : null, order: station.order, opensAt: station.opensAt, closesAt: station.closesAt });
|
|
@@ -10097,7 +9793,11 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10097
9793
|
const prize = (await api2.event.passport.getPassportOverview.query({ eventId })).prizes.find((item) => item.id === prizeId);
|
|
10098
9794
|
if (!prize) throw new CliUsageError("Prize not found for this event.");
|
|
10099
9795
|
return api2.event.passport.upsertPassportPrize.mutate({ eventId, id: prize.id, name: prize.name, description: prize.description, imageKey: imageKey ? await imageKey() : null, stock: prize.stock, stampCost: prize.stampCost, order: prize.order });
|
|
10100
|
-
}, "setPrizeImage"), createImageOperation = __name2((resource, subcommand, {
|
|
9796
|
+
}, "setPrizeImage"), createImageOperation = __name2((resource, subcommand, {
|
|
9797
|
+
eventId,
|
|
9798
|
+
flags,
|
|
9799
|
+
allowed
|
|
9800
|
+
}) => {
|
|
10101
9801
|
if (subcommand !== "image-set" && subcommand !== "image-clear") return null;
|
|
10102
9802
|
const idFlag = "".concat(resource, "-id");
|
|
10103
9803
|
allowed.push(idFlag);
|
|
@@ -10108,7 +9808,9 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10108
9808
|
return first === "skin" && second ? createSkinOperation(second, context) : (first === "station" || first === "prize") && second ? createImageOperation(first, second, context) : null;
|
|
10109
9809
|
}, "createPassportMediaOperation"), flag = __name2((flags, name, required2 = !0) => {
|
|
10110
9810
|
const value = flags.get(name);
|
|
10111
|
-
if (value === !0 || required2 && !value) throw new CliUsageError(
|
|
9811
|
+
if (value === !0 || required2 && !value) throw new CliUsageError(
|
|
9812
|
+
"--".concat(name, " requires a value.")
|
|
9813
|
+
);
|
|
10112
9814
|
return value;
|
|
10113
9815
|
}, "flag"), requiredFlag = __name2((flags, name) => {
|
|
10114
9816
|
const value = flag(flags, name);
|
|
@@ -10156,10 +9858,12 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10156
9858
|
if (Object.keys(value).some((key) => !allowed.includes(key))) throw new CliUsageError("".concat(name, " contains unsupported fields."));
|
|
10157
9859
|
}, "keys"), date4 = __name2((value, name) => {
|
|
10158
9860
|
if (value == null) return null;
|
|
10159
|
-
if (typeof value != "string" || !new __cliRegExp("^\\d{4}-\\d\\d-\\d\\dT", "").test(value)) throw new CliUsageError("".concat(
|
|
9861
|
+
if (typeof value != "string" || !new __cliRegExp("^\\d{4}-\\d\\d-\\d\\dT", "").test(value)) throw new CliUsageError("".concat(
|
|
9862
|
+
name,
|
|
9863
|
+
" must be an ISO date-time or null."
|
|
9864
|
+
));
|
|
10160
9865
|
const parsed = new Date(value);
|
|
10161
|
-
if (Number.isNaN(parsed.getTime()))
|
|
10162
|
-
throw new CliUsageError("".concat(name, " must be a valid ISO date-time."));
|
|
9866
|
+
if (Number.isNaN(parsed.getTime())) throw new CliUsageError("".concat(name, " must be a valid ISO date-time."));
|
|
10163
9867
|
return parsed;
|
|
10164
9868
|
}, "date4"), parseStaffTallyCollection = __name2((item, extras) => {
|
|
10165
9869
|
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.");
|
|
@@ -10167,7 +9871,12 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10167
9871
|
const tallyItems = item.tallyItems.map((name, index) => text(name, "tallyItems[".concat(index, "]"), 60));
|
|
10168
9872
|
if (new Set(tallyItems.map((name) => name.toLocaleLowerCase())).size !== tallyItems.length) throw new CliUsageError("tallyItems must be unique ignoring case.");
|
|
10169
9873
|
if (item.tallyEarnsStamp !== void 0 && typeof item.tallyEarnsStamp != "boolean") throw new CliUsageError("tallyEarnsStamp must be true or false.");
|
|
10170
|
-
return {
|
|
9874
|
+
return {
|
|
9875
|
+
collectionMode: "STAFF_TALLY",
|
|
9876
|
+
tallyItems,
|
|
9877
|
+
tallyEarnsStamp: item.tallyEarnsStamp === !0,
|
|
9878
|
+
...extras
|
|
9879
|
+
};
|
|
10171
9880
|
}, "parseStaffTallyCollection"), parseStaffScanCollection = __name2((item, extras) => {
|
|
10172
9881
|
if (keys(item, ["collectionMode", "stampValue", "category", "prizeDeskAward", "showHowToCollect", "showMyQr", "collectionLimit", "menuItems", "info"], "collection"), item.collectionMode !== "STAFF_SCAN" && (item.menuItems !== void 0 || item.collectionLimit !== void 0)) throw new CliUsageError("Only STAFF_SCAN stations can configure menuItems or collectionLimit.");
|
|
10173
9882
|
if (item.prizeDeskAward !== void 0 && typeof item.prizeDeskAward != "boolean") throw new CliUsageError("prizeDeskAward must be true or false.");
|
|
@@ -10186,29 +9895,44 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10186
9895
|
return parsed.data;
|
|
10187
9896
|
}, "parseStaffScanMenuItems"), parsePassportCollection = __name2((raw) => {
|
|
10188
9897
|
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") } };
|
|
10189
|
-
if (item.collectionMode === "STAFF_SCORE") return keys(item, ["collectionMode", "maxPoints", "stampValue", "category", "info", "showHowToCollect", "showMyQr"], "collection"), {
|
|
10190
|
-
|
|
9898
|
+
if (item.collectionMode === "STAFF_SCORE") return keys(item, ["collectionMode", "maxPoints", "stampValue", "category", "info", "showHowToCollect", "showMyQr"], "collection"), {
|
|
9899
|
+
collectionMode: "STAFF_SCORE",
|
|
9900
|
+
maxPoints: integer2(item.maxPoints, "maxPoints"),
|
|
10191
9901
|
...stampValue,
|
|
10192
9902
|
...category,
|
|
10193
9903
|
...info
|
|
10194
|
-
}
|
|
9904
|
+
};
|
|
9905
|
+
if (item.collectionMode === "STAFF_TALLY") return parseStaffTallyCollection(item, { ...stampValue, ...category, ...info });
|
|
10195
9906
|
if (item.collectionMode === "SELF_SCAN" || item.collectionMode === "STAFF_SCAN") return parseStaffScanCollection(item, { ...stampValue, ...category, ...info });
|
|
10196
9907
|
throw new CliUsageError("collectionMode must be SELF_SCAN, STAFF_SCAN, STAFF_SCORE or STAFF_TALLY.");
|
|
10197
9908
|
}, "parsePassportCollection"), parsePassportStationInput = __name2((raw, eventId) => {
|
|
10198
9909
|
const value = json(raw, "--station-json");
|
|
10199
9910
|
keys(value, ["id", "name", "description", "location", "address", "imageKey", "order", "opensAt", "closesAt", "collection"], "Station");
|
|
10200
9911
|
const collection = value.collection === void 0 ? void 0 : parsePassportCollection(value.collection);
|
|
10201
|
-
return {
|
|
10202
|
-
|
|
10203
|
-
"
|
|
10204
|
-
|
|
9912
|
+
return {
|
|
9913
|
+
eventId,
|
|
9914
|
+
...value.id === void 0 ? {} : { id: text(value.id, "id", 200) },
|
|
9915
|
+
name: text(value.name, "name", 100),
|
|
9916
|
+
description: nullableText(value.description, "description", 1e3),
|
|
9917
|
+
location: nullableText(value.location, "location", 200),
|
|
9918
|
+
...value.address === void 0 ? {} : { address: nullableText(value.address, "address", 300) },
|
|
9919
|
+
...value.imageKey === void 0 ? {} : { imageKey: nullableText(value.imageKey, "imageKey", 2048) },
|
|
9920
|
+
order: integer2(value.order ?? 0, "order"),
|
|
9921
|
+
opensAt: date4(value.opensAt, "opensAt"),
|
|
9922
|
+
closesAt: date4(value.closesAt, "closesAt"),
|
|
9923
|
+
...collection ? { collection } : {}
|
|
9924
|
+
};
|
|
10205
9925
|
}, "parsePassportStationInput"), QUEUE_STATUS_FLAGS = { "under-10": "UNDER_10_MIN", "under-30": "UNDER_30_MIN", "over-30": "OVER_30_MIN", clear: null }, queueStatusFlag = __name2((value) => {
|
|
10206
9926
|
const status = QUEUE_STATUS_FLAGS[value];
|
|
10207
9927
|
if (status === void 0) throw new CliUsageError("--status must be one of ".concat(Object.keys(QUEUE_STATUS_FLAGS).join(", "), "."));
|
|
10208
9928
|
return status;
|
|
10209
9929
|
}, "queueStatusFlag"), parseSettingsSwitches = __name2((value) => {
|
|
10210
9930
|
const switches = {};
|
|
10211
|
-
value.queueStatusStaleMinutes !== void 0 && (switches.queueStatusStaleMinutes = value.queueStatusStaleMinutes === null ? null : integer2(value.queueStatusStaleMinutes, "queueStatusStaleMinutes", PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN, PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX)), value.staffIdLabel !== void 0 && (switches.staffIdLabel = nullableText(
|
|
9931
|
+
value.queueStatusStaleMinutes !== void 0 && (switches.queueStatusStaleMinutes = value.queueStatusStaleMinutes === null ? null : integer2(value.queueStatusStaleMinutes, "queueStatusStaleMinutes", PASSPORT_QUEUE_STATUS_STALE_MINUTES_MIN, PASSPORT_QUEUE_STATUS_STALE_MINUTES_MAX)), value.staffIdLabel !== void 0 && (switches.staffIdLabel = nullableText(
|
|
9932
|
+
value.staffIdLabel,
|
|
9933
|
+
"staffIdLabel",
|
|
9934
|
+
PASSPORT_STAFF_ID_LABEL_MAX
|
|
9935
|
+
)), value.categoryLabels !== void 0 && (switches.categoryLabels = categoryLabels(value.categoryLabels));
|
|
10212
9936
|
for (const name of ["guestScan", "simplifiedChinese", "queueStatus"]) {
|
|
10213
9937
|
const item = value[name];
|
|
10214
9938
|
if (item !== void 0) {
|
|
@@ -10228,18 +9952,18 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10228
9952
|
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.");
|
|
10229
9953
|
}
|
|
10230
9954
|
if (value.linkedDrawEventId === void 0) throw new CliUsageError("linkedDrawEventId is required (use null to disable).");
|
|
10231
|
-
return { eventId, luckyDrawStampThreshold: threshold(value.luckyDrawStampThreshold, "luckyDrawStampThreshold"), prizeStampThreshold: threshold(
|
|
10232
|
-
value.
|
|
10233
|
-
"
|
|
10234
|
-
|
|
10235
|
-
), linkedDrawEventId: value.linkedDrawEventId === null ? null : text(value.linkedDrawEventId, "linkedDrawEventId", 200), ...loginMethods ? { loginMethods } : {}, ...switches };
|
|
9955
|
+
return { eventId, luckyDrawStampThreshold: threshold(value.luckyDrawStampThreshold, "luckyDrawStampThreshold"), prizeStampThreshold: threshold(
|
|
9956
|
+
value.prizeStampThreshold,
|
|
9957
|
+
"prizeStampThreshold"
|
|
9958
|
+
), maxRedemptionsPerParticipant: integer2(value.maxRedemptionsPerParticipant, "maxRedemptionsPerParticipant", 0), linkedDrawEventId: value.linkedDrawEventId === null ? null : text(value.linkedDrawEventId, "linkedDrawEventId", 200), ...loginMethods ? { loginMethods } : {}, ...switches };
|
|
10236
9959
|
}, "parsePassportSettingsInput"), parsePassportRosterEntryInput = __name2((raw, eventId) => {
|
|
10237
9960
|
const value = json(raw, "--entry-json");
|
|
10238
9961
|
if (keys(value, ["id", "staffId", "lastName", "displayName"], "Roster entry"), value.lastName === void 0) throw new CliUsageError("lastName is required (use null for none).");
|
|
10239
9962
|
return { eventId, ...value.id === void 0 ? {} : { id: text(value.id, "id", 200) }, staffId: text(value.staffId, "staffId", 64), lastName: nullableText(value.lastName, "lastName", 100) || null, displayName: nullableText(value.displayName, "displayName", 100) || null };
|
|
10240
9963
|
}, "parsePassportRosterEntryInput"), headerIndex = __name2((headers, name) => {
|
|
10241
9964
|
const wanted = name.trim().toLowerCase(), index = headers.findIndex((header) => header.trim().toLowerCase() === wanted);
|
|
10242
|
-
if (index === -1)
|
|
9965
|
+
if (index === -1)
|
|
9966
|
+
throw new CliUsageError('Column "'.concat(name, '" is not in the file. Headers: ').concat(headers.join(", "), "."));
|
|
10243
9967
|
return index;
|
|
10244
9968
|
}, "headerIndex"), resolvePassportRosterMapping = __name2((headers, flags, requireLastName) => {
|
|
10245
9969
|
const guess = guessPassportRosterMapping(headers), column = __name2((name, fallback) => {
|
|
@@ -10248,7 +9972,9 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10248
9972
|
}, "column"), staffIdFlag = flag(flags, "staff-id-column", !1), position = flag(flags, "surname-position", !1) ?? "last";
|
|
10249
9973
|
if (position !== "last" && position !== "first") throw new CliUsageError("--surname-position must be last or first.");
|
|
10250
9974
|
const mapping = { staffId: staffIdFlag === void 0 ? guess.staffId : headerIndex(headers, staffIdFlag), lastName: column("last-name-column", guess.lastName), fullName: column("full-name-column", guess.fullName), displayName: column("display-name-column", guess.displayName), surnamePosition: position };
|
|
10251
|
-
if (requireLastName && mapping.lastName === null && mapping.fullName === null) throw new CliUsageError(
|
|
9975
|
+
if (requireLastName && mapping.lastName === null && mapping.fullName === null) throw new CliUsageError(
|
|
9976
|
+
"Map a last-name column (--last-name-column) or a full-name column (--full-name-column)."
|
|
9977
|
+
);
|
|
10252
9978
|
return mapping;
|
|
10253
9979
|
}, "resolvePassportRosterMapping"), readRosterRows = __name2(async (path2, flags, requireLastName) => {
|
|
10254
9980
|
let table;
|
|
@@ -10264,7 +9990,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10264
9990
|
throw new CliUsageError("Could not import ".concat(path2, ": ").concat(error2 instanceof Error ? error2.message : "unknown error"));
|
|
10265
9991
|
}
|
|
10266
9992
|
}, "readRosterRows"), optionalEntry = __name2((key, value, parse) => value === void 0 ? {} : { [key]: parse(value) }, "optionalEntry"), readPasswordFromStdin = __name2(async () => {
|
|
10267
|
-
if (process.stdin.isTTY) throw new CliUsageError(
|
|
9993
|
+
if (process.stdin.isTTY) throw new CliUsageError("--password-stdin reads the password from stdin. Pipe it in, for example: printf '%s' \"$PASSWORD\" | et passport station-access set-password --event-id <id> --password-stdin ...");
|
|
10268
9994
|
return (await Bun.stdin.text()).replace(new __cliRegExp("\\r?\\n$", ""), "");
|
|
10269
9995
|
}, "readPasswordFromStdin"), searchFilters = __name2((flags) => {
|
|
10270
9996
|
const search = flag(flags, "search", !1);
|
|
@@ -10277,7 +10003,11 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10277
10003
|
}, "recipientDirection"), parseStampRecipientsInput = __name2((flags, station) => {
|
|
10278
10004
|
const limit = flag(flags, "limit", !1), cursor = flag(flags, "cursor", !1), direction = recipientDirection(flag(flags, "direction", !1));
|
|
10279
10005
|
if (direction === "backward" && cursor === void 0) throw new CliUsageError("--direction backward needs --cursor.");
|
|
10280
|
-
return { ...station, filters: searchFilters(flags), ...optionalEntry("limit", limit, (raw) => integer2(raw, "--limit", 1, PASSPORT_STATION_RECIPIENTS_PAGE_MAX)), ...optionalEntry(
|
|
10006
|
+
return { ...station, filters: searchFilters(flags), ...optionalEntry("limit", limit, (raw) => integer2(raw, "--limit", 1, PASSPORT_STATION_RECIPIENTS_PAGE_MAX)), ...optionalEntry(
|
|
10007
|
+
"cursor",
|
|
10008
|
+
cursor,
|
|
10009
|
+
(raw) => text(raw, "--cursor", 8192)
|
|
10010
|
+
), ...direction === void 0 ? {} : { direction } };
|
|
10281
10011
|
}, "parseStampRecipientsInput"), createStationAccessOperation = __name2(async (action, { eventId, flags, allowed, station, confirm }) => {
|
|
10282
10012
|
const event = { eventId };
|
|
10283
10013
|
let operation;
|
|
@@ -10296,10 +10026,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10296
10026
|
confirm(), operation = __name2(() => api2.event.passport.clearPassportStationPassword.mutate(event), "operation");
|
|
10297
10027
|
break;
|
|
10298
10028
|
case "stamps stats":
|
|
10299
|
-
operation = __name2(
|
|
10300
|
-
() => api2.event.passport.getPassportStationStampStats.query(event),
|
|
10301
|
-
"operation"
|
|
10302
|
-
);
|
|
10029
|
+
operation = __name2(() => api2.event.passport.getPassportStationStampStats.query(event), "operation");
|
|
10303
10030
|
break;
|
|
10304
10031
|
case "stamps recipients": {
|
|
10305
10032
|
allowed.push("station-id", "search", "limit", "cursor", "direction");
|
|
@@ -10316,7 +10043,10 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10316
10043
|
}
|
|
10317
10044
|
return operation;
|
|
10318
10045
|
}, "createStationAccessOperation"), runPassportCommand = __name2(async (input) => {
|
|
10319
|
-
const { flags, positionals } = input, action = positionals.slice(1).join(" "), allowed = ["event-id"], eventId = requiredFlag(flags, "event-id"), event = { eventId }, station = __name2(() => ({ eventId, stationId: requiredFlag(flags, "station-id") }), "station"), version2 = __name2(() => integer2(requiredFlag(
|
|
10046
|
+
const { flags, positionals } = input, action = positionals.slice(1).join(" "), allowed = ["event-id"], eventId = requiredFlag(flags, "event-id"), event = { eventId }, station = __name2(() => ({ eventId, stationId: requiredFlag(flags, "station-id") }), "station"), version2 = __name2(() => integer2(requiredFlag(
|
|
10047
|
+
flags,
|
|
10048
|
+
"expected-printed-qr-version"
|
|
10049
|
+
), "--expected-printed-qr-version"), "version"), confirm = __name2(() => {
|
|
10320
10050
|
if (allowed.push("allow-state-change", "target"), flags.get("allow-state-change") !== !0 || requiredFlag(flags, "target") !== eventId) throw new CliUsageError("This operation requires --allow-state-change and --target exactly equal to --event-id.");
|
|
10321
10051
|
}, "confirm");
|
|
10322
10052
|
let operation;
|
|
@@ -10382,10 +10112,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10382
10112
|
}
|
|
10383
10113
|
case "station upsert": {
|
|
10384
10114
|
allowed.push("station-json");
|
|
10385
|
-
const payload = parsePassportStationInput(requiredFlag(
|
|
10386
|
-
flags,
|
|
10387
|
-
"station-json"
|
|
10388
|
-
), eventId);
|
|
10115
|
+
const payload = parsePassportStationInput(requiredFlag(flags, "station-json"), eventId);
|
|
10389
10116
|
operation = __name2(() => api2.event.passport.upsertPassportStation.mutate(payload), "operation");
|
|
10390
10117
|
break;
|
|
10391
10118
|
}
|
|
@@ -10410,7 +10137,10 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10410
10137
|
}
|
|
10411
10138
|
case "station hidden": {
|
|
10412
10139
|
allowed.push("station-id", "hidden");
|
|
10413
|
-
const payload = {
|
|
10140
|
+
const payload = {
|
|
10141
|
+
...station(),
|
|
10142
|
+
hidden: boolean4(requiredFlag(flags, "hidden"), "--hidden")
|
|
10143
|
+
};
|
|
10414
10144
|
operation = __name2(() => api2.event.passport.setPassportStationHidden.mutate(payload), "operation");
|
|
10415
10145
|
break;
|
|
10416
10146
|
}
|
|
@@ -10434,11 +10164,10 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10434
10164
|
}
|
|
10435
10165
|
case "collect": {
|
|
10436
10166
|
allowed.push("station-id", "profile-code", "points", "item", "site", "request-id");
|
|
10437
|
-
const points = flag(flags, "points", !1), item = flag(flags, "item", !1), payload = { ...station(), profileCode: requiredFlag(
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
|
|
10441
|
-
), ...optionalEntry("requestId", flag(flags, "request-id", !1), (raw) => {
|
|
10167
|
+
const points = flag(flags, "points", !1), item = flag(flags, "item", !1), payload = { ...station(), profileCode: requiredFlag(
|
|
10168
|
+
flags,
|
|
10169
|
+
"profile-code"
|
|
10170
|
+
), ...optionalEntry("site", flag(flags, "site", !1), (raw) => text(raw, "--site", 60)), ...optionalEntry("requestId", flag(flags, "request-id", !1), (raw) => {
|
|
10442
10171
|
const parsed = passportRedemptionRequestIdSchema.safeParse(raw);
|
|
10443
10172
|
if (!parsed.success) throw new CliUsageError("--request-id must be a UUID.");
|
|
10444
10173
|
return parsed.data;
|
|
@@ -10454,7 +10183,11 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10454
10183
|
}
|
|
10455
10184
|
case "stamp correct": {
|
|
10456
10185
|
allowed.push("station-id", "participant-id", "stamped", "reason", "points", "item", "collection-id", "site"), confirm();
|
|
10457
|
-
const points = flag(flags, "points", !1), item = flag(flags, "item", !1), payload = { ...station(), participantId: requiredFlag(flags, "participant-id"), ...optionalEntry(
|
|
10186
|
+
const points = flag(flags, "points", !1), item = flag(flags, "item", !1), payload = { ...station(), participantId: requiredFlag(flags, "participant-id"), ...optionalEntry(
|
|
10187
|
+
"collectionId",
|
|
10188
|
+
flag(flags, "collection-id", !1),
|
|
10189
|
+
(raw) => text(raw, "--collection-id", 200)
|
|
10190
|
+
), ...optionalEntry("site", flag(flags, "site", !1), (raw) => text(raw, "--site", 60)), stamped: boolean4(requiredFlag(flags, "stamped"), "--stamped"), reason: requiredFlag(flags, "reason"), ...optionalEntry("points", points, (raw) => integer2(raw, "--points")), ...optionalEntry("item", item, (raw) => text(raw, "--item", 60)) };
|
|
10458
10191
|
operation = __name2(() => api2.event.passport.correctPassportStamp.mutate(payload), "operation");
|
|
10459
10192
|
break;
|
|
10460
10193
|
}
|
|
@@ -10473,11 +10206,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10473
10206
|
case "prize upsert": {
|
|
10474
10207
|
allowed.push("prize-json");
|
|
10475
10208
|
const value = json(requiredFlag(flags, "prize-json"), "--prize-json");
|
|
10476
|
-
keys(
|
|
10477
|
-
value,
|
|
10478
|
-
["id", "name", "description", "imageKey", "stock", "stampCost", "order"],
|
|
10479
|
-
"Prize"
|
|
10480
|
-
);
|
|
10209
|
+
keys(value, ["id", "name", "description", "imageKey", "stock", "stampCost", "order"], "Prize");
|
|
10481
10210
|
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") };
|
|
10482
10211
|
operation = __name2(() => api2.event.passport.upsertPassportPrize.mutate(payload), "operation");
|
|
10483
10212
|
break;
|
|
@@ -10490,11 +10219,7 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10490
10219
|
}
|
|
10491
10220
|
case "redemption create": {
|
|
10492
10221
|
allowed.push("prize-id", "participant-id", "quantity", "award-station-id", "bonus-stamps", "request-id");
|
|
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) => {
|
|
10222
|
+
const quantity = flag(flags, "quantity", !1), awardStationId = flag(flags, "award-station-id", !1), bonusStamps = flag(flags, "bonus-stamps", !1), requestId = flag(flags, "request-id", !1), payload = { eventId, ...optionalEntry("quantity", quantity, (raw) => integer2(raw, "--quantity", 1, 20)), ...optionalEntry("bonusStamps", bonusStamps, (raw) => {
|
|
10498
10223
|
const value = integer2(raw, "--bonus-stamps", 0, 1e3);
|
|
10499
10224
|
return redeemPassportPrizeSchema.shape.bonusStamps.parse(value);
|
|
10500
10225
|
}), ...optionalEntry("awardStationId", awardStationId, (raw) => text(raw, "--award-station-id", 200)), ...optionalEntry("requestId", requestId, (raw) => {
|
|
@@ -10507,10 +10232,10 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10507
10232
|
}
|
|
10508
10233
|
case "redemption reverse": {
|
|
10509
10234
|
allowed.push("redemption-id", "reason"), confirm();
|
|
10510
|
-
const payload = { eventId, redemptionId: requiredFlag(
|
|
10235
|
+
const payload = { eventId, redemptionId: requiredFlag(
|
|
10511
10236
|
flags,
|
|
10512
|
-
"
|
|
10513
|
-
) };
|
|
10237
|
+
"redemption-id"
|
|
10238
|
+
), reason: requiredFlag(flags, "reason") };
|
|
10514
10239
|
operation = __name2(() => api2.event.passport.reversePassportRedemption.mutate(payload), "operation");
|
|
10515
10240
|
break;
|
|
10516
10241
|
}
|
|
@@ -10528,7 +10253,11 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10528
10253
|
}
|
|
10529
10254
|
case "roster list": {
|
|
10530
10255
|
allowed.push("search", "limit", "cursor");
|
|
10531
|
-
const search = flag(flags, "search", !1), limit = flag(flags, "limit", !1), cursor = flag(flags, "cursor", !1), payload = { eventId, ...optionalEntry(
|
|
10256
|
+
const search = flag(flags, "search", !1), limit = flag(flags, "limit", !1), cursor = flag(flags, "cursor", !1), payload = { eventId, ...optionalEntry(
|
|
10257
|
+
"search",
|
|
10258
|
+
search,
|
|
10259
|
+
(raw) => text(raw, "--search", 200)
|
|
10260
|
+
), ...optionalEntry("limit", limit, (raw) => integer2(raw, "--limit", 1, PASSPORT_ROSTER_PAGE_MAX)), ...optionalEntry("cursor", cursor, (raw) => text(raw, "--cursor", 8192)) };
|
|
10532
10261
|
operation = __name2(() => api2.event.passport.getPassportRoster.query(payload), "operation");
|
|
10533
10262
|
break;
|
|
10534
10263
|
}
|
|
@@ -10569,9 +10298,11 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10569
10298
|
allowed.push("station-id"), operation = __name2(() => api2.event.passport.getPassportStationTallies.query(station()), "operation");
|
|
10570
10299
|
break;
|
|
10571
10300
|
default: {
|
|
10572
|
-
const mediaOperation = await createStationAccessOperation(action, { eventId, flags, allowed, station, confirm }) ?? createPassportMediaOperation(
|
|
10573
|
-
|
|
10574
|
-
|
|
10301
|
+
const mediaOperation = await createStationAccessOperation(action, { eventId, flags, allowed, station, confirm }) ?? createPassportMediaOperation(
|
|
10302
|
+
action,
|
|
10303
|
+
{ eventId, flags, allowed }
|
|
10304
|
+
);
|
|
10305
|
+
if (!mediaOperation) throw new CliUsageError("Unknown passport command. Run et --help for supported commands.");
|
|
10575
10306
|
operation = mediaOperation;
|
|
10576
10307
|
}
|
|
10577
10308
|
}
|
|
@@ -10581,9 +10312,19 @@ var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024, MAX_EVENT_VIDEO_UPLOAD_BYTE
|
|
|
10581
10312
|
}, "runPassportCommand");
|
|
10582
10313
|
import { readFile as readFile6, writeFile } from "fs/promises";
|
|
10583
10314
|
import { basename as basename4 } from "path";
|
|
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 = [
|
|
10585
|
-
|
|
10586
|
-
|
|
10315
|
+
var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAFF_REDEMPTION_SHIFT_MAX = 8, STAFF_REDEMPTION_ELIGIBLE_SHIFTS_MAX = 20, STAFF_REDEMPTION_ALLOWANCE_MAX = 20, STAFF_REDEMPTION_QUANTITY_MAX = 1e5, STAFF_REDEMPTION_REASON_MAX = 500, STAFF_REDEMPTION_ROLLOVER_REASON_MAX = 300, STAFF_REDEMPTION_ROLLOVER_LIST_DEFAULT = 20, STAFF_REDEMPTION_ROLLOVER_LIST_MAX = 50, STAFF_REDEMPTION_PAGE_MAX = 100, STAFF_REDEMPTION_CLAIM_ITEMS_MAX = 20, STAFF_REDEMPTION_ITEM_RULES = [
|
|
10316
|
+
"ONE_FROM_EACH_GROUP",
|
|
10317
|
+
"AT_MOST_ONE_PER_GROUP",
|
|
10318
|
+
"AT_MOST_ONE_PER_GROUP_OR_NONE"
|
|
10319
|
+
], STAFF_REDEMPTION_WRONG_SITE_RULES = ["REFUSE", "SERVE_FROM_COUNTER"], STAFF_REDEMPTION_SESSION_RULES = ["OWN_SHIFT", "ANY_OPEN_SESSION"], STAFF_REDEMPTION_DRAW_POLICIES = ["REMAINING_HEADCOUNT", "FIXED_RATE"], STAFF_REDEMPTION_COUNTER_ORDERS = ["FOOD_THEN_DRAW", "DRAW_THEN_FOOD"], STAFF_REDEMPTION_ARCHIVABLE = ["site", "session", "itemGroup", "item", "prize", "rosterEntry"], idSchema = string2().min(1).max(64), nameSchema = string2().trim().min(1).max(STAFF_REDEMPTION_NAME_MAX), orderSchema = number2().int().min(0).max(1e4), quantitySchema = number2().int().min(0).max(STAFF_REDEMPTION_QUANTITY_MAX), reasonSchema = string2().trim().min(1).max(STAFF_REDEMPTION_REASON_MAX), staffRedemptionShiftSchema = string2().trim().min(1).max(STAFF_REDEMPTION_SHIFT_MAX).transform((value) => value.toUpperCase()).refine((value) => new __cliRegExp("^[A-Z0-9]+$", "").test(value), { message: "Use letters and digits only." }), staffRedemptionEmployeeIdSchema = string2().trim().min(1).max(
|
|
10320
|
+
STAFF_REDEMPTION_EMPLOYEE_ID_MAX
|
|
10321
|
+
), staffRedemptionClientRequestIdSchema = uuid2(), staffRedemptionEventIdSchema = object({ eventId: idSchema }).strict(), staffRedemptionSiteIdSchema = staffRedemptionEventIdSchema.extend({ siteId: idSchema }).strict(), STAFF_REDEMPTION_STAFF_ID_LABEL_MAX = PASSPORT_STAFF_ID_LABEL_MAX, STAFF_REDEMPTION_WRONG_SITE_MESSAGE_MAX = 300, STAFF_REDEMPTION_LAST_NAME_MAX = STAFF_REDEMPTION_NAME_MAX, staffRedemptionLoginMethodsSchema = object({ emailOtp: boolean2(), google: boolean2(), guest: boolean2(), staffId: boolean2().default(!1), staffIdRequiresLastName: boolean2().default(!0) }).strict(), customTextOrNull = __name2((max) => union([_null3(), string2().trim().max(max).transform((value) => value === "" ? null : value)]), "customTextOrNull"), lastNameSchema = string2().trim().min(1).max(STAFF_REDEMPTION_LAST_NAME_MAX).optional(), signInToStaffRedemptionEmployeeSchema = staffRedemptionEventIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema, lastName: lastNameSchema }).strict(), requestStaffRedemptionEmployeeEmailOtpSchema = staffRedemptionEventIdSchema.
|
|
10322
|
+
extend({ email: email2().trim().toLowerCase() }).strict(), updateStaffRedemptionSettingsSchema = staffRedemptionEventIdSchema.extend({ eligibleShifts: array(staffRedemptionShiftSchema).min(1).max(STAFF_REDEMPTION_ELIGIBLE_SHIFTS_MAX).optional(), itemRule: _enum(STAFF_REDEMPTION_ITEM_RULES).optional(), wrongSite: _enum(STAFF_REDEMPTION_WRONG_SITE_RULES).optional(), sessionRule: _enum(STAFF_REDEMPTION_SESSION_RULES).optional(), drawPolicy: _enum(STAFF_REDEMPTION_DRAW_POLICIES).optional(), fixedWinRatePercent: number2().min(0).max(100).optional(), counterOrder: _enum(STAFF_REDEMPTION_COUNTER_ORDERS).optional(), loginMethods: staffRedemptionLoginMethodsSchema.optional(), staffIdLabel: customTextOrNull(STAFF_REDEMPTION_STAFF_ID_LABEL_MAX).optional(), wrongSiteMessage: customTextOrNull(STAFF_REDEMPTION_WRONG_SITE_MESSAGE_MAX).optional(), overrideReason: reasonSchema.optional() }).strict(), upsertStaffRedemptionSiteSchema = staffRedemptionEventIdSchema.extend({ siteId: idSchema.optional(), name: nameSchema,
|
|
10323
|
+
order: orderSchema.optional() }).strict(), setStaffRedemptionCrewPasswordSchema = staffRedemptionSiteIdSchema.extend({ password: stationStaffPasswordSchema }).strict(), signInToStaffRedemptionCrewSchema = staffRedemptionSiteIdSchema.extend({ password: string2().min(1).max(128) }).strict(), upsertStaffRedemptionSessionSchema = staffRedemptionEventIdSchema.extend({ sessionId: idSchema.optional(), name: nameSchema, shift: staffRedemptionShiftSchema, startsAt: exports_coerce.date().nullable().default(null), endsAt: exports_coerce.date().nullable().default(null) }).strict().refine((input) => input.startsAt === null || input.endsAt === null || input.endsAt > input.startsAt, { message: "The session must end after it starts.", path: ["endsAt"] }), setStaffRedemptionSlotSchema = staffRedemptionEventIdSchema.extend({ sessionId: idSchema, siteId: idSchema, setQuantity: quantitySchema }).strict(), rolloverSessionsShape = { fromSessionId: idSchema.describe("Session whose leftover sets and prizes mo\
|
|
10324
|
+
ve out (id from setup get). Must belong to this event and not be archived."), toSessionId: idSchema.describe("Session that receives them (id from setup get). Must differ from fromSessionId, belong to this event and not be archived.") }, rolloverReasonSchema = __name2((description) => string2().trim().min(1).max(STAFF_REDEMPTION_ROLLOVER_REASON_MAX).describe(description), "rolloverReasonSchema"), staffRedemptionRolloverPreviewSchema = staffRedemptionEventIdSchema.extend(rolloverSessionsShape).strict(), rolloverStaffRedemptionStockSchema = staffRedemptionEventIdSchema.extend({ ...rolloverSessionsShape, sets: boolean2().default(!0).describe("Move the leftover sets (set quantity minus active, not voided, redemptions) of each site. Defaults to true."), prizes: boolean2().default(!0).describe("Move the leftover prizes (stock minus prizes drawn and not released) of each site. Defaults to true."), reason: rolloverReasonSchema("Why the leftovers move (1 to 300 characters). Recorded in the activ\
|
|
10325
|
+
ity log.") }).strict().refine((input) => input.sets || input.prizes, { message: "Choose sets, prizes or both.", path: ["sets"] }), staffRedemptionRolloversSchema = staffRedemptionEventIdSchema.extend({ limit: number2().int().min(1).max(STAFF_REDEMPTION_ROLLOVER_LIST_MAX).default(STAFF_REDEMPTION_ROLLOVER_LIST_DEFAULT).describe("How many rollovers to return, newest first (1 to 50). Defaults to 20.") }).strict(), undoStaffRedemptionRolloverSchema = staffRedemptionEventIdSchema.extend({ rolloverId: idSchema.describe("Id of the rollover to undo (id from rollover list). Must belong to this event and not be undone already."), reason: rolloverReasonSchema("Why the rollover is undone (1 to 300 characters). Recorded in the activity log.") }).strict(), upsertStaffRedemptionItemGroupSchema = staffRedemptionEventIdSchema.extend({ groupId: idSchema.optional(), name: nameSchema, order: orderSchema.optional() }).strict(), upsertStaffRedemptionItemSchema = staffRedemptionEventIdSchema.extend({ itemId: idSchema.
|
|
10326
|
+
optional(), groupId: idSchema, name: nameSchema, order: orderSchema.optional() }).strict(), upsertStaffRedemptionPrizeSchema = staffRedemptionEventIdSchema.extend({ prizeId: idSchema.optional(), name: nameSchema, order: orderSchema.optional() }).strict(), setStaffRedemptionPrizeStockSchema = staffRedemptionEventIdSchema.extend({ slotId: idSchema, prizeId: idSchema, quantity: quantitySchema, reason: reasonSchema.optional() }).strict(), setStaffRedemptionArchivedSchema = staffRedemptionEventIdSchema.extend({ entity: _enum(STAFF_REDEMPTION_ARCHIVABLE), id: idSchema, archived: boolean2() }).strict(), upsertStaffRedemptionRosterEntrySchema = staffRedemptionEventIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema, name: string2().trim().max(STAFF_REDEMPTION_NAME_MAX).nullable(), siteName: string2().trim().max(STAFF_REDEMPTION_NAME_MAX).nullable(), shift: staffRedemptionShiftSchema.nullable(), workShift: string2().trim().max(STAFF_REDEMPTION_NAME_MAX).nullable(), allowance: number2().
|
|
10327
|
+
int().min(0).max(STAFF_REDEMPTION_ALLOWANCE_MAX).optional() }).strict(), rosterFiltersShape = {
|
|
10587
10328
|
search: string2().trim().max(200).optional(),
|
|
10588
10329
|
siteId: idSchema.optional(),
|
|
10589
10330
|
shift: staffRedemptionShiftSchema.optional(),
|
|
@@ -10591,7 +10332,10 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10591
10332
|
collected: _enum(["any", "collected", "not-collected"]).default("any")
|
|
10592
10333
|
}, staffRedemptionRosterListSchema = staffRedemptionEventIdSchema.extend({ ...rosterFiltersShape, limit: number2().int().min(1).max(STAFF_REDEMPTION_PAGE_MAX).default(25), cursor: string2().min(1).max(8192).nullish(), direction: literal("forward").optional() }).strict(), staffRedemptionRosterCountsSchema = staffRedemptionEventIdSchema.extend(rosterFiltersShape).strict(), STAFF_REDEMPTION_EMPLOYEE_CODE_MAX = 512, lookupStaffRedemptionSchema = staffRedemptionSiteIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema.optional(), code: string2().trim().min(1).max(STAFF_REDEMPTION_EMPLOYEE_CODE_MAX).optional().describe("Employee QR code as scanned from the employee page. Give either employeeId or code.") }).strict().refine((input) => input.employeeId === void 0 != (input.code === void 0), { message: "Give either an Employee ID or a QR code.", path: ["employeeId"] }), claimItemIdsSchema = array(idSchema).max(STAFF_REDEMPTION_CLAIM_ITEMS_MAX).refine((ids) => new Set(
|
|
10593
10334
|
ids
|
|
10594
|
-
).size === ids.length, { message: "Pick each item once." }), redeemStaffRedemptionSchema = staffRedemptionSiteIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema, clientRequestId: staffRedemptionClientRequestIdSchema, itemIds: claimItemIdsSchema }).strict(), recordStaffRedemptionClaimItemsSchema = staffRedemptionSiteIdSchema.extend({ claimId: idSchema, itemIds: claimItemIdsSchema }).strict(), STAFF_REDEMPTION_COUNTER_CLAIM_SCOPES = ["mine", "site"], staffRedemptionCounterClaimsSchema = staffRedemptionSiteIdSchema.extend({ limit: number2().int().min(1).max(50).default(20), scope: _enum(STAFF_REDEMPTION_COUNTER_CLAIM_SCOPES).default("mine"), status: _enum(["all", "items-pending"]).default("all") }).strict(), STAFF_REDEMPTION_CLAIM_STATUSES = ["active", "items-pending", "voided", "all"], claimFiltersShape = { search: string2().trim().max(200).optional(), siteId: idSchema.optional(), sessionId: idSchema.optional(), status: _enum(STAFF_REDEMPTION_CLAIM_STATUSES).default("all") }, staffRedemptionClaimListSchema = staffRedemptionEventIdSchema.
|
|
10335
|
+
).size === ids.length, { message: "Pick each item once." }), redeemStaffRedemptionSchema = staffRedemptionSiteIdSchema.extend({ employeeId: staffRedemptionEmployeeIdSchema, clientRequestId: staffRedemptionClientRequestIdSchema, itemIds: claimItemIdsSchema }).strict(), recordStaffRedemptionClaimItemsSchema = staffRedemptionSiteIdSchema.extend({ claimId: idSchema, itemIds: claimItemIdsSchema }).strict(), STAFF_REDEMPTION_COUNTER_CLAIM_SCOPES = ["mine", "site"], staffRedemptionCounterClaimsSchema = staffRedemptionSiteIdSchema.extend({ limit: number2().int().min(1).max(50).default(20), scope: _enum(STAFF_REDEMPTION_COUNTER_CLAIM_SCOPES).default("mine"), status: _enum(["all", "items-pending"]).default("all") }).strict(), STAFF_REDEMPTION_CLAIM_STATUSES = ["active", "items-pending", "voided", "all"], claimFiltersShape = { search: string2().trim().max(200).optional(), siteId: idSchema.optional(), sessionId: idSchema.optional(), status: _enum(STAFF_REDEMPTION_CLAIM_STATUSES).default("all") }, staffRedemptionClaimListSchema = staffRedemptionEventIdSchema.
|
|
10336
|
+
extend({ ...claimFiltersShape, limit: number2().int().min(1).max(STAFF_REDEMPTION_PAGE_MAX).default(25), cursor: string2().min(1).max(8192).nullish(), direction: literal("forward").optional() }).strict(), staffRedemptionClaimCountsSchema = staffRedemptionEventIdSchema.extend(claimFiltersShape).strict(), voidStaffRedemptionClaimSchema = staffRedemptionEventIdSchema.extend({ claimId: idSchema, reason: reasonSchema }).strict(), releaseStaffRedemptionDrawSchema = staffRedemptionEventIdSchema.extend({ drawId: idSchema, reason: reasonSchema, allowWhileClaimActive: boolean2().optional().describe("Override: release the draw even though an active (not voided) redemption still shows it, for a redemption that stays recorded (for example a paper entry with no spin). Omit to refuse while any active redemption uses the draw.") }).strict(), staffRedemptionExportSchema = staffRedemptionEventIdSchema.extend(claimFiltersShape).strict(), STAFF_REDEMPTION_ROSTER_IMPORT_MAX = 2e4, staffRedemptionRosterImportRowSchema = object(
|
|
10337
|
+
{ row: number2().int().min(1), employeeId: string2().max(1e3), name: string2().max(1e3).nullable(), siteName: string2().max(1e3).nullable(), shift: string2().max(1e3).nullable(), workShift: string2().max(1e3).nullable(), allowance: string2().max(1e3).nullable() }).strict(), importStaffRedemptionRosterSchema = staffRedemptionEventIdSchema.extend({ rows: array(staffRedemptionRosterImportRowSchema).min(1).max(STAFF_REDEMPTION_ROSTER_IMPORT_MAX, "A roster can have at most ".concat(STAFF_REDEMPTION_ROSTER_IMPORT_MAX, " rows.")), archiveMissing: boolean2().default(!1) }).strict(), HEADER_PATTERNS = { employeeId: new __cliRegExp("^(employee|staff|worker)\\s*(id|no|number)$|^(emp|staff)\\s*id$", "i"), name: new __cliRegExp("^(worker|name|full\\s*name|employee\\s*name|staff\\s*name)$", "i"), siteName: new __cliRegExp("^(site|location|fab)$", "i"), shift: new __cliRegExp("^shift$", "i"), workShift: new __cliRegExp("^work\\s*shift$", "i"), allowance: new __cliRegExp("^(allowance|sets|entitlement|\
|
|
10338
|
+
balance)$", "i") }, guessStaffRedemptionRosterMapping = __name2((header) => {
|
|
10595
10339
|
const find = __name2((key) => {
|
|
10596
10340
|
const index = header.findIndex((cell2) => HEADER_PATTERNS[key].test(cell2.trim()));
|
|
10597
10341
|
return index === -1 ? null : index;
|
|
@@ -10656,9 +10400,7 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10656
10400
|
const lines = [csvColumns.map(
|
|
10657
10401
|
([header]) => csvCell(header)
|
|
10658
10402
|
).join(","), ...rows.map((row) => csvColumns.map(([, read]) => csvCell(read(row))).join(","))];
|
|
10659
|
-
return "\uFEFF".concat(lines.join(
|
|
10660
|
-
`), `\r
|
|
10661
|
-
`);
|
|
10403
|
+
return "\uFEFF".concat(lines.join("\r\n"), "\r\n");
|
|
10662
10404
|
}, "staffRedemptionClaimsToCsv"), writeCsvFile = __name2(async (path2, content, force) => {
|
|
10663
10405
|
try {
|
|
10664
10406
|
await writeFile(path2, content, { encoding: "utf8", flag: force ? "w" : "wx" });
|
|
@@ -10713,7 +10455,8 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10713
10455
|
{ path: ["organization", "invitation", "reject-access"], procedure: "organization.rejectAccessInvitation", operation: "mutation", summary: "Reject an access invitation by invitation ID.", effects: ["state-change"], target: "invitationId", dates: [], input: { type: "object", properties: { invitationId: { type: "string", minLength: 1 } }, required: ["invitationId"] } },
|
|
10714
10456
|
{ path: ["organization", "invitation", "cancel"], procedure: "organization.cancelInvitation", operation: "mutation", summary: "Cancel a pending organization invitation.", effects: ["state-change"], target: "invitationId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, invitationId: { type: "string", minLength: 1 } }, required: ["organizationId", "invitationId"] } },
|
|
10715
10457
|
{ path: ["organization", "invitation", "resend"], procedure: "organization.resendInvitation", operation: "mutation", summary: "Replace a pending organization invitation (including an expired one) and email a fresh link; reports deliveryStatus and the stored emailDeliveryStatus.", effects: ["state-change", "email"], target: "invitationId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, invitationId: { type: "string", minLength: 1 } }, required: ["organizationId", "invitationId"] } },
|
|
10716
|
-
{ path: ["organization", "update"], procedure: "organization.updateOrganizationById", operation: "mutation", summary: "Update organization details. name is required; omitted optional fields are unchanged.", effects: ["state-change"], target: "organizationId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, name: { type: "string", minLength: 1 }, slug: { type: "string" }, description: { type: "string" }, website: { anyOf: [{ type: "string", format: "uri" }, { type: "string", const: "" }] }, email: { anyOf: [{ type: "string", format: "email", pattern: "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, { type: "string", const: "" }] }, allowedEventTypes: { type: "array", items: { type: "string", enum: ["POST_IT_NOTE", "PHOTO_WALL", "STORY_COLLECTION", "LUCKY_DRAW", "SCAVENGER_HUNT", "HUMAN_BINGO", "SIGNATURE_WALL", "GARDENS_BY_THE_BAY", "RATING_SYSTEM", "EVENT_PASSPORT", "
|
|
10458
|
+
{ path: ["organization", "update"], procedure: "organization.updateOrganizationById", operation: "mutation", summary: "Update organization details. name is required; omitted optional fields are unchanged.", effects: ["state-change"], target: "organizationId", dates: [], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, name: { type: "string", minLength: 1 }, slug: { type: "string" }, description: { type: "string" }, website: { anyOf: [{ type: "string", format: "uri" }, { type: "string", const: "" }] }, email: { anyOf: [{ type: "string", format: "email", pattern: "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, { type: "string", const: "" }] }, allowedEventTypes: { type: "array", items: { type: "string", enum: ["POST_IT_NOTE", "PHOTO_WALL", "STORY_COLLECTION", "LUCKY_DRAW", "SCAVENGER_HUNT", "HUMAN_BINGO", "SIGNATURE_WALL", "GARDENS_BY_THE_BAY", "RATING_SYSTEM", "EVENT_PASSPORT", "ST\
|
|
10459
|
+
AFF_REDEMPTION"] } }, image: { type: ["string", "null"] } }, required: ["organizationId", "name"] } },
|
|
10717
10460
|
{ 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"] } },
|
|
10718
10461
|
{
|
|
10719
10462
|
path: ["organization", "archive"],
|
|
@@ -10776,7 +10519,8 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10776
10519
|
{ 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"] } },
|
|
10777
10520
|
{ path: ["event", "recent"], procedure: "event.getRecentEvents", operation: "query", summary: "List the events the current user opened most recently.", effects: [], dates: [], input: null },
|
|
10778
10521
|
{ path: ["event", "details"], procedure: "event.getEventById", operation: "query", summary: "Get an event's full details (description, tags, background, dates).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1 } }, required: ["eventId"] } },
|
|
10779
|
-
{ path: ["event", "update"], procedure: "event.updateEvent", operation: "mutation", summary: "Replace an event's details. Send every field from event details; dates are ISO.", effects: ["state-change"], target: "id", dates: ["eventDateRange.from", "eventDateRange.to"], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, name: { type: "string", minLength: 1, maxLength: 100 }, type: { type: "string", enum: ["POST_IT_NOTE", "PHOTO_WALL", "STORY_COLLECTION", "LUCKY_DRAW", "SCAVENGER_HUNT", "HUMAN_BINGO", "SIGNATURE_WALL", "GARDENS_BY_THE_BAY", "RATING_SYSTEM", "EVENT_PASSPORT", "STAFF_REDEMPTION"] }, descriptionDelta: {}, descriptionRichText: { anyOf: [{}, { type: "null" }] }, filtering: { type: "boolean" }, location: { type: "string", minLength: 1 }, eventDateRange: { type: "object", properties: { from: { type: "string", format: "date-time" }, to: { type: "string", format: "date-time" } }, required: ["from"] }, tags: { type: "array", items: { type: "
|
|
10522
|
+
{ path: ["event", "update"], procedure: "event.updateEvent", operation: "mutation", summary: "Replace an event's details. Send every field from event details; dates are ISO.", effects: ["state-change"], target: "id", dates: ["eventDateRange.from", "eventDateRange.to"], input: { type: "object", properties: { organizationId: { type: "string", minLength: 1 }, name: { type: "string", minLength: 1, maxLength: 100 }, type: { type: "string", enum: ["POST_IT_NOTE", "PHOTO_WALL", "STORY_COLLECTION", "LUCKY_DRAW", "SCAVENGER_HUNT", "HUMAN_BINGO", "SIGNATURE_WALL", "GARDENS_BY_THE_BAY", "RATING_SYSTEM", "EVENT_PASSPORT", "STAFF_REDEMPTION"] }, descriptionDelta: {}, descriptionRichText: { anyOf: [{}, { type: "null" }] }, filtering: { type: "boolean" }, location: { type: "string", minLength: 1 }, eventDateRange: { type: "object", properties: { from: { type: "string", format: "date-time" }, to: { type: "string", format: "date-time" } }, required: ["from"] }, tags: { type: "array", items: { type: "\
|
|
10523
|
+
string" } }, backgroundImageKey: { type: ["string", "null"] }, id: { type: "string", minLength: 1 } }, required: ["organizationId", "name", "type", "location", "eventDateRange", "id"] } },
|
|
10780
10524
|
{ path: [
|
|
10781
10525
|
"event",
|
|
10782
10526
|
"status-update"
|
|
@@ -10829,7 +10573,8 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10829
10573
|
{ path: ["post-it", "submissions", "list"], procedure: "event.postItNote.getPostItNoteSubmissionForApproval", operation: "query", summary: "List Post-it Note submissions for moderation.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, name: { type: "string" }, note: { type: "string" }, state: { type: "string", enum: ["PENDING", "APPROVED", "REJECTED"] }, page: { default: 1, type: "number", minimum: 1 }, perPage: { default: 6, type: "number", minimum: 1, maximum: 100 } }, required: ["eventId"] } },
|
|
10830
10574
|
{ 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"] } },
|
|
10831
10575
|
{ 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"] } },
|
|
10832
|
-
{ path: ["signature-wall", "config", "update"], procedure: "event.signatureWall.updateSignatureWallConfigs", operation: "mutation", summary: "Replace the Signature Wall config.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, config: { type: "object", properties: { backgroundColor: { type: "string" }, titleColor: { type: "string" }, titleFontSize: { type: "number" }, titleFont: { type: "string" }, title: { type: "string" }, cardBackgroundColor: { type: "string" }, cardBorderColor: { type: "string" }, nameColor: { type: "string" }, nameCardBackgroundColor: { type: "string" }, nameCardBorderColor: { type: "string" }, animationVideoKey: { type: ["string", "null"] }, signatureCounts: { type: "number" } }, required: ["backgroundColor", "titleColor", "titleFontSize", "titleFont", "title", "cardBackgroundColor", "cardBorderColor", "nameColor", "nameCardBackgroundColor", "nameCardBorderColor"] } }, required: ["
|
|
10576
|
+
{ path: ["signature-wall", "config", "update"], procedure: "event.signatureWall.updateSignatureWallConfigs", operation: "mutation", summary: "Replace the Signature Wall config.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, config: { type: "object", properties: { backgroundColor: { type: "string" }, titleColor: { type: "string" }, titleFontSize: { type: "number" }, titleFont: { type: "string" }, title: { type: "string" }, cardBackgroundColor: { type: "string" }, cardBorderColor: { type: "string" }, nameColor: { type: "string" }, nameCardBackgroundColor: { type: "string" }, nameCardBorderColor: { type: "string" }, animationVideoKey: { type: ["string", "null"] }, signatureCounts: { type: "number" } }, required: ["backgroundColor", "titleColor", "titleFontSize", "titleFont", "title", "cardBackgroundColor", "cardBorderColor", "nameColor", "nameCardBackgroundColor", "nameCardBorderColor"] } }, required: ["even\
|
|
10577
|
+
tId", "config"] } },
|
|
10833
10578
|
{ 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"] } },
|
|
10834
10579
|
{ 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"] } },
|
|
10835
10580
|
{ path: ["signature-wall", "signatures", "archive"], procedure: "event.signatureWall.archiveSignatures", operation: "mutation", summary: "Archive signatures by ID. --target is the comma-joined ids.", effects: ["state-change"], target: "ids", dates: [], input: { type: "object", properties: { ids: { type: "array", items: { type: "string" } } }, required: ["ids"] } },
|
|
@@ -10843,7 +10588,9 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10843
10588
|
{ path: ["rating", "subjects", "update"], procedure: "event.ratingSystem.updateRatingSubject", operation: "mutation", summary: "Update a rating subject.", effects: ["state-change"], target: "id", dates: [], input: { type: "object", properties: { id: { type: "string" }, name: { type: "string", minLength: 1 }, description: { type: ["string", "null"] }, order: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, imageKey: { type: ["string", "null"] } }, required: ["id"] } },
|
|
10844
10589
|
{ 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"] } },
|
|
10845
10590
|
{ 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"] } },
|
|
10846
|
-
{ path: ["human-bingo", "config", "update"], procedure: "event.humanBingo.updateHumanBingoConfigs", operation: "mutation", summary: "Replace the Human Bingo config.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, config: { type: "object", properties: { textColor: { type: "string" }, titleFontSize: { type: "number" }, backgroundColor: { type: "string" }, backgroundImageKey: { type: ["string", "null"] }, nameCardTextColor: { type: "string" }, nameCardBackgroundColor: { type: "string" }, nameCardBorderColor: { type: "string" }, cardBackgroundColor: { type: "string" }, cardBorderColor: { type: "string" }, cardTextColor: { type: "string" }, numberOfParticipants: { type: "number" }, bingoCellDialogBackgroundColor: { type: "string" }, bingoCellDialogTextColor: { type: "string" }, bingoCellDialogButtonTextColor: { type: "string" }, bingoCellDialogButtonColor: { type: "string" }, bingoCellDialogUploadTextColor: { type: "
|
|
10591
|
+
{ path: ["human-bingo", "config", "update"], procedure: "event.humanBingo.updateHumanBingoConfigs", operation: "mutation", summary: "Replace the Human Bingo config.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string" }, config: { type: "object", properties: { textColor: { type: "string" }, titleFontSize: { type: "number" }, backgroundColor: { type: "string" }, backgroundImageKey: { type: ["string", "null"] }, nameCardTextColor: { type: "string" }, nameCardBackgroundColor: { type: "string" }, nameCardBorderColor: { type: "string" }, cardBackgroundColor: { type: "string" }, cardBorderColor: { type: "string" }, cardTextColor: { type: "string" }, numberOfParticipants: { type: "number" }, bingoCellDialogBackgroundColor: { type: "string" }, bingoCellDialogTextColor: { type: "string" }, bingoCellDialogButtonTextColor: { type: "string" }, bingoCellDialogButtonColor: { type: "string" }, bingoCellDialogUploadTextColor: { type: "\
|
|
10592
|
+
string" }, bingoCellImageKey: { type: ["string", "null"] }, minRowsForBingo: { type: "number" }, infoTextColor: { type: "string" }, infoTextPosition: { type: "string" }, mobileBackgroundColor: { type: "string" }, mobileBackgroundImageKey: { type: ["string", "null"] }, loginTitle: { type: "string" }, loginDescription: { type: ["string", "null"] }, loginTitleColor: { type: "string" }, loginButtonColor: { type: "string" }, loginButtonTextColor: { type: "string" }, loginCardBackgroundColor: { type: "string" }, loginInputColor: { type: "string" }, leaderboardCardBackgroundColor: { type: "string" }, leaderboardCardTextColor: { type: "string" }, leaderboardBorderColor: { type: "string" } }, required: ["textColor", "titleFontSize", "backgroundColor", "nameCardTextColor", "nameCardBackgroundColor", "nameCardBorderColor", "cardBackgroundColor", "cardBorderColor", "cardTextColor", "numberOfParticipants", "bingoCellDialogBackgroundColor", "bingoCellDialogTextColor", "bingoCellDialogButtonTextColor",
|
|
10593
|
+
"bingoCellDialogButtonColor", "bingoCellDialogUploadTextColor", "minRowsForBingo", "infoTextColor", "infoTextPosition", "mobileBackgroundColor", "loginTitle", "loginTitleColor", "loginButtonColor", "loginButtonTextColor", "loginCardBackgroundColor", "loginInputColor", "leaderboardCardBackgroundColor", "leaderboardCardTextColor", "leaderboardBorderColor"] } }, required: ["eventId", "config"] } },
|
|
10847
10594
|
{ path: ["human-bingo", "background", "get"], procedure: "event.humanBingo.getHumanBingoBoardBackgroundByEventId", operation: "query", summary: "Get the Human Bingo board background images.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" } }, required: ["eventId"] } },
|
|
10848
10595
|
{ path: ["human-bingo", "items", "list"], procedure: "event.humanBingo.admin.getHumanBingoItemsByEventId", operation: "query", summary: "List Human Bingo items.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string" }, archiveStatus: { default: "active", type: "string", enum: ["active", "archived", "all"] } }, required: ["eventId"] } },
|
|
10849
10596
|
{ path: [
|
|
@@ -10877,7 +10624,9 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10877
10624
|
bingoCardId: { type: "string" }
|
|
10878
10625
|
}, required: ["eventId", "id", "status", "bingoCardId"] } },
|
|
10879
10626
|
{ path: ["staff-redemption", "setup", "get"], procedure: "event.staffRedemption.getStaffRedemptionSetup", operation: "query", summary: "Get the whole staff redemption setup: settings (including counterOrder, always resolved: FOOD_THEN_DRAW when never set, and the employee sign-in settings loginMethods, staffIdLabel and wrongSiteMessage, the two texts null while unset), employeeLogin.googleAvailable (whether Google sign-in can be turned on), missingPolicies and policiesLocked, sites (with crew access status), sessions, slots with setsIssued, item groups and items, prizes and prize stock. readiness lists what is still missing before counters can serve people (ready, and items of code plus short text); truncated is true when a list was cut at its cap. Archived rows are included with archivedAt; holds no personal data. Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId"], additionalProperties: !1 } },
|
|
10880
|
-
{ path: ["staff-redemption", "settings", "update"], procedure: "event.staffRedemption.updateStaffRedemptionSettings", operation: "mutation", summary: "Update eligibleShifts, itemRule, wrongSite, sessionRule, drawPolicy, fixedWinRatePercent, counterOrder and the employee sign-in settings loginMethods (emailOtp, google, guest, staffId, staffIdRequiresLastName; every method is off until turned on; google needs the server's Google sign-in), staffIdLabel (what the roster identifier is called, default 'Employee ID') and wrongSiteMessage (the warning both counters show for a person rostered at another site, max 300 characters); null or blank resets a text to its default. Omitted fields are unchanged. sessionRule is OWN_SHIFT (the default when unset: only during the person's own shift's session
|
|
10627
|
+
{ path: ["staff-redemption", "settings", "update"], procedure: "event.staffRedemption.updateStaffRedemptionSettings", operation: "mutation", summary: "Update eligibleShifts, itemRule, wrongSite, sessionRule, drawPolicy, fixedWinRatePercent, counterOrder and the employee sign-in settings loginMethods (emailOtp, google, guest, staffId, staffIdRequiresLastName; every method is off until turned on; google needs the server's Google sign-in), staffIdLabel (what the roster identifier is called, default 'Employee ID') and wrongSiteMessage (the warning both counters show for a person rostered at another site, max 300 characters); null or blank resets a text to its default. Omitted fields are unchanged. sessionRule is OWN_SHIFT (the default when unset: only during the person's own shift's session, from its sets and prizes) or ANY_OPEN_SESSION ('any open session: own shift's stock first'. A person rostered at the counter's site gets their set, from their session's (Singapore) day onwards whatev\
|
|
10628
|
+
er the hour (on an earlier day they are served like a walk-in), from their own shift's slot there while it has sets left, else from the slot at the same site of the open session with the most sets left (NO_SETS_LEFT when none has), and always draws from their own shift's slot's prizes there; they are never refused NO_OPEN_SESSION. A walk-in rostered at another site (or none) is served only while a session is open (NO_OPEN_SESSION otherwise), from their own shift's slot at the counter's site while their session is open and it has sets left, else from the open session's slot there with the most sets left, and their spin is always no prize; works with either drawPolicy, and under REMAINING_HEADCOUNT a site's prizes are shared only over its own people). counterOrder is FOOD_THEN_DRAW (the default when never set) or DRAW_THEN_FOOD (the person spins first and the food is recorded afterwards); it is not a required policy (never in missingPolicies). Policies, sessionRule and counterOrder inclu\
|
|
10629
|
+
ded, lock once a redemption exists (setup get shows policiesLocked): then a change needs overrideReason, recorded in the activity log. loginMethods, staffIdLabel and wrongSiteMessage are not policies: they never lock and never need overrideReason.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: {
|
|
10881
10630
|
eventId: { type: "string", minLength: 1, maxLength: 64 },
|
|
10882
10631
|
eligibleShifts: { minItems: 1, maxItems: 20, type: "array", items: { type: "string", minLength: 1, maxLength: 8 } },
|
|
10883
10632
|
itemRule: { type: "string", enum: ["ONE_FROM_EACH_GROUP", "AT_MOST_ONE_PER_GROUP", "AT_MOST_ONE_PER_GROUP_OR_NONE"] },
|
|
@@ -10891,81 +10640,90 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10891
10640
|
wrongSiteMessage: { anyOf: [{ type: "null" }, { type: "string", maxLength: 300 }] },
|
|
10892
10641
|
overrideReason: { type: "string", minLength: 1, maxLength: 500 }
|
|
10893
10642
|
}, required: ["eventId"], additionalProperties: !1 } },
|
|
10894
|
-
{ 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: {
|
|
10895
|
-
{ path: ["staff-redemption", "crew-password", "set"], procedure: "event.staffRedemption.setStaffRedemptionCrewPassword", operation: "mutation", summary: "Set a site's shared crew password (6-128 characters), which turns the site's crew link on. Ends every crew session at that site. Prefer --input-file over --input so the password stays out of shell history.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: {
|
|
10643
|
+
{ path: ["staff-redemption", "site", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionSite", operation: "mutation", summary: "Create a site (omit siteId) or rename and reorder one (give siteId). Use staff-redemption archive set to archive or unarchive it.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: {
|
|
10896
10644
|
type: "string",
|
|
10897
10645
|
minLength: 1,
|
|
10898
10646
|
maxLength: 64
|
|
10899
|
-
},
|
|
10647
|
+
}, name: { type: "string", minLength: 1, maxLength: 120 }, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "name"], additionalProperties: !1 } },
|
|
10648
|
+
{ path: ["staff-redemption", "crew-password", "set"], procedure: "event.staffRedemption.setStaffRedemptionCrewPassword", operation: "mutation", summary: "Set a site's shared crew password (6-128 characters), which turns the site's crew link on. Ends every crew session at that site. Prefer --input-file over --input so the password stays out of shell history.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, password: { type: "string", minLength: 6, maxLength: 128 } }, required: ["eventId", "siteId", "password"], additionalProperties: !1 } },
|
|
10900
10649
|
{ path: ["staff-redemption", "crew-password", "clear"], procedure: "event.staffRedemption.clearStaffRedemptionCrewPassword", operation: "mutation", summary: "Clear a site's crew password, which turns its crew link off and ends every crew session at that site.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId", "siteId"], additionalProperties: !1 } },
|
|
10901
|
-
{ 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
|
|
10902
|
-
|
|
10650
|
+
{ path: ["staff-redemption", "session", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionSession", operation: "mutation", summary: "Create a session (omit sessionId) or update one: name, shift letter, and optional startsAt and endsAt (ISO date-times; null or omitted means the session is open whenever the event is). Each shift has one session; a session with redemptions or unreleased draws in its slots keeps its shift. Under sessionRule ANY_OPEN_SESSION the times decide which other sessions' stock counters may use: only sessions open now (started, or no startsAt, and not ended, or no endsAt). A person rostered at the counter's site uses their own shift's slot there from their session's (Singapore) day onwards, whatever the hour, (the set while it has sets left, prizes always), then the open session's slot there with the most sets left. A walk-in from another site gets a set only from sessions open now (their own shift's slot there while their session is open and it ha\
|
|
10651
|
+
s sets left, else the open session's slot with the most sets left; NO_OPEN_SESSION when none is open) and always spins for no prize. Set the times correctly.", effects: ["state-change"], target: "eventId", dates: ["startsAt", "endsAt"], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, sessionId: { type: "string", minLength: 1, maxLength: 64 }, name: { type: "string", minLength: 1, maxLength: 120 }, shift: { type: "string", minLength: 1, maxLength: 8 }, startsAt: { default: null, anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] }, endsAt: { default: null, anyOf: [{ type: "string", format: "date-time" }, { type: "null" }] } }, required: ["eventId", "name", "shift"], additionalProperties: !1 } },
|
|
10652
|
+
{ path: [
|
|
10653
|
+
"staff-redemption",
|
|
10654
|
+
"slot",
|
|
10655
|
+
"set"
|
|
10656
|
+
], procedure: "event.staffRedemption.setStaffRedemptionSlot", operation: "mutation", summary: "Set how many sets a site has for a session (setQuantity). It cannot go below the sets already issued.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, sessionId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, setQuantity: { type: "integer", minimum: 0, maximum: 1e5 } }, required: ["eventId", "sessionId", "siteId", "setQuantity"], additionalProperties: !1 } },
|
|
10903
10657
|
{ path: ["staff-redemption", "item-group", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionItemGroup", operation: "mutation", summary: "Create an item group (omit groupId; a choice such as wrap or pancake) or rename and reorder one.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, groupId: { type: "string", minLength: 1, maxLength: 64 }, name: { type: "string", minLength: 1, maxLength: 120 }, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "name"], additionalProperties: !1 } },
|
|
10904
10658
|
{ path: ["staff-redemption", "item", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionItem", operation: "mutation", summary: "Create an item in a group (omit itemId) or rename, reorder or move one to another groupId; past claims keep their group.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, itemId: { type: "string", minLength: 1, maxLength: 64 }, groupId: { type: "string", minLength: 1, maxLength: 64 }, name: { type: "string", minLength: 1, maxLength: 120 }, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "groupId", "name"], additionalProperties: !1 } },
|
|
10905
|
-
{ 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: {
|
|
10906
|
-
eventId: { type: "string", minLength: 1, maxLength: 64 },
|
|
10907
|
-
prizeId: { type: "string", minLength: 1, maxLength: 64 },
|
|
10908
|
-
name: { type: "string", minLength: 1, maxLength: 120 },
|
|
10909
|
-
order: { type: "integer", minimum: 0, maximum: 1e4 }
|
|
10910
|
-
}, required: ["eventId", "name"], additionalProperties: !1 } },
|
|
10659
|
+
{ path: ["staff-redemption", "prize", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionPrize", operation: "mutation", summary: "Create a prize (omit prizeId) or rename and reorder one. Stock is set per slot with staff-redemption prize-stock set.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, prizeId: { type: "string", minLength: 1, maxLength: 64 }, name: { type: "string", minLength: 1, maxLength: 120 }, order: { type: "integer", minimum: 0, maximum: 1e4 } }, required: ["eventId", "name"], additionalProperties: !1 } },
|
|
10911
10660
|
{ path: ["staff-redemption", "prize-stock", "set"], procedure: "event.staffRedemption.setStaffRedemptionPrizeStock", operation: "mutation", summary: "Set a prize's stock for one slot (slotId from setup get). An optional reason is recorded; stock cannot go below the prizes already drawn there and not released.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, slotId: { type: "string", minLength: 1, maxLength: 64 }, prizeId: { type: "string", minLength: 1, maxLength: 64 }, quantity: { type: "integer", minimum: 0, maximum: 1e5 }, reason: { type: "string", minLength: 1, maxLength: 500 } }, required: ["eventId", "slotId", "prizeId", "quantity"], additionalProperties: !1 } },
|
|
10912
|
-
{ 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: "
|
|
10913
|
-
|
|
10914
|
-
{ path: ["staff-redemption", "rollover", "
|
|
10915
|
-
|
|
10661
|
+
{ path: ["staff-redemption", "rollover", "preview"], procedure: "event.staffRedemption.getStaffRedemptionRolloverPreview", operation: "query", summary: "Preview rolling leftovers from fromSessionId into toSessionId, per site: sets left (set quantity minus active, not voided, redemptions) and prizes left (stock minus prizes drawn and not released) in the source, what would move and the target afterwards. A site is skipped, with a reason, unless the target session already has a slot there with sets (a rollover never creates a slot). Advisory; rollover run recomputes under lock. Needs event.setup.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, fromSessionId: { type: "string", minLength: 1, maxLength: 64, description: "Session whose leftover sets and prizes move out (id from setup get). Must belong to this event and not be archived." }, toSessionId: { type: "string", minLength: 1, maxLength: 64, description: "Ses\
|
|
10662
|
+
sion that receives them (id from setup get). Must differ from fromSessionId, belong to this event and not be archived." } }, required: ["eventId", "fromSessionId", "toSessionId"], additionalProperties: !1 } },
|
|
10663
|
+
{ path: ["staff-redemption", "rollover", "run"], procedure: "event.staffRedemption.rolloverStaffRedemptionStock", operation: "mutation", summary: "Move the leftover sets (sets) and/or prizes (prizes), both default true, of every site from fromSessionId into toSessionId, with a required reason (1-300 characters) that is logged. The source keeps exactly what it issued, so it never drops below issued. Skipped sites come back with a reason; moved is false and nothing is written (no quantity, log entry or lock) when nothing would move. Undo it exactly with rollover undo (the result's rolloverId is the id); running it the other way is not an undo. Returns rolloverId, null when nothing moved. Not automatic: a manager runs it. Needs event.setup.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, fromSessionId: { type: "string", minLength: 1, maxLength: 64, description: "Session whose left\
|
|
10664
|
+
over sets and prizes move out (id from setup get). Must belong to this event and not be archived." }, toSessionId: { type: "string", minLength: 1, maxLength: 64, description: "Session that receives them (id from setup get). Must differ from fromSessionId, belong to this event and not be archived." }, sets: { default: !0, description: "Move the leftover sets (set quantity minus active, not voided, redemptions) of each site. Defaults to true.", type: "boolean" }, prizes: { default: !0, description: "Move the leftover prizes (stock minus prizes drawn and not released) of each site. Defaults to true.", type: "boolean" }, reason: { type: "string", minLength: 1, maxLength: 300, description: "Why the leftovers move (1 to 300 characters). Recorded in the activity log." } }, required: ["eventId", "fromSessionId", "toSessionId", "reason"], additionalProperties: !1 } },
|
|
10665
|
+
{ path: [
|
|
10666
|
+
"staff-redemption",
|
|
10667
|
+
"rollover",
|
|
10668
|
+
"list"
|
|
10669
|
+
], procedure: "event.staffRedemption.getStaffRedemptionRollovers", operation: "query", summary: "List the event's rollovers, newest first (limit 1-50, default 20): id (use it for rollover undo), who ran it and when, reason, from and to sessions, totals, the sets and prizes moved per site, undoable, and undone (null, or who, when and why). total counts all of them. Needs event.setup.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, limit: { default: 20, description: "How many rollovers to return, newest first (1 to 50). Defaults to 20.", type: "integer", minimum: 1, maximum: 50 } }, required: ["eventId"], additionalProperties: !1 } },
|
|
10670
|
+
{ path: ["staff-redemption", "rollover", "undo"], procedure: "event.staffRedemption.undoStaffRedemptionRollover", operation: "mutation", summary: "Undo one rollover exactly (rolloverId from rollover list), with a required reason (1-300 characters) that is logged: subtract exactly the sets and prizes it moved from the target session's slots and add them back to the source's, including a source left at 0 sets. The target's own sets and prizes are untouched. All or nothing: refused with CONFLICT, listing the sites and prizes, when a target site has since handed out or drawn part of what moved (it must still have the moved amount unissued), and with CONFLICT when already undone. A rolloverId of another event is NOT_FOUND. Does not check archived state: it restores exactly even if a session, site or prize was archived since. Redo or release voided target redemptions first, as an unreleased void's set counts as free. Recorded as its own activity entry. Needs event.setup.", effects: ["state\
|
|
10671
|
+
-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, rolloverId: { type: "string", minLength: 1, maxLength: 64, description: "Id of the rollover to undo (id from rollover list). Must belong to this event and not be undone already." }, reason: {
|
|
10672
|
+
type: "string",
|
|
10673
|
+
minLength: 1,
|
|
10674
|
+
maxLength: 300,
|
|
10675
|
+
description: "Why the rollover is undone (1 to 300 characters). Recorded in the activity log."
|
|
10676
|
+
} }, required: ["eventId", "rolloverId", "reason"], additionalProperties: !1 } },
|
|
10916
10677
|
{ path: ["staff-redemption", "archive", "set"], procedure: "event.staffRedemption.setStaffRedemptionArchived", operation: "mutation", summary: "Archive (archived true) or unarchive (archived false) a site, session, itemGroup, item, prize or rosterEntry by entity and id. Setup get and roster list show the current state.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, entity: { type: "string", enum: ["site", "session", "itemGroup", "item", "prize", "rosterEntry"] }, id: { type: "string", minLength: 1, maxLength: 64 }, archived: { type: "boolean" } }, required: ["eventId", "entity", "id", "archived"], additionalProperties: !1 } },
|
|
10917
10678
|
{ path: ["staff-redemption", "roster", "list"], procedure: "event.staffRedemption.getStaffRedemptionRoster", operation: "query", summary: "List roster entries (cursor paged); filter by search, siteId, shift, archived (active, archived, all) and collected (any, collected, not-collected).", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, shift: { type: "string", minLength: 1, maxLength: 8 }, archived: { default: "active", type: "string", enum: ["active", "archived", "all"] }, collected: { default: "any", type: "string", enum: ["any", "collected", "not-collected"] }, limit: { default: 25, type: "integer", minimum: 1, maximum: 100 }, cursor: { anyOf: [{ type: "string", minLength: 1, maxLength: 8192 }, { type: "null" }] }, direction: { type: "string", const: "forward" } }, required: ["eventId"], additionalProperties: !1 } },
|
|
10918
|
-
{ path: ["staff-redemption", "roster", "counts"], procedure: "event.staffRedemption.getStaffRedemptionRosterCounts", operation: "query", summary: "Count roster entries matching the same filters as roster list.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, shift: { type: "string", minLength: 1, maxLength: 8 }, archived: {
|
|
10919
|
-
|
|
10920
|
-
type: "string",
|
|
10921
|
-
enum: ["active", "archived", "all"]
|
|
10922
|
-
}, collected: { default: "any", type: "string", enum: ["any", "collected", "not-collected"] } }, required: ["eventId"], additionalProperties: !1 } },
|
|
10923
|
-
{ path: ["staff-redemption", "roster", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionRosterEntry", operation: "mutation", summary: "Add or update one roster entry by employeeId (name, siteName, shift and workShift are required and can be null; allowance is optional). The site is matched by name, and allowance cannot go below the sets the person already collected. The archived state is unchanged (use staff-redemption archive set).", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, employeeId: { type: "string", minLength: 1, maxLength: 64 }, name: { anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }] }, siteName: { anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }] }, shift: { anyOf: [{ type: "string", minLength: 1, maxLength: 8 }, { type: "null" }] }, workShift: {
|
|
10679
|
+
{ path: ["staff-redemption", "roster", "counts"], procedure: "event.staffRedemption.getStaffRedemptionRosterCounts", operation: "query", summary: "Count roster entries matching the same filters as roster list.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, shift: { type: "string", minLength: 1, maxLength: 8 }, archived: { default: "active", type: "string", enum: ["active", "archived", "all"] }, collected: { default: "any", type: "string", enum: ["any", "collected", "not-collected"] } }, required: ["eventId"], additionalProperties: !1 } },
|
|
10680
|
+
{ path: ["staff-redemption", "roster", "upsert"], procedure: "event.staffRedemption.upsertStaffRedemptionRosterEntry", operation: "mutation", summary: "Add or update one roster entry by employeeId (name, siteName, shift and workShift are required and can be null; allowance is optional). The site is matched by name, and allowance cannot go below the sets the person already collected. The archived state is unchanged (use staff-redemption archive set).", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, employeeId: { type: "string", minLength: 1, maxLength: 64 }, name: {
|
|
10924
10681
|
anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }]
|
|
10925
|
-
}, allowance: { type: "integer", minimum: 0, maximum: 20 } }, required: ["eventId", "employeeId", "name", "siteName", "shift", "workShift"], additionalProperties: !1 } },
|
|
10926
|
-
{ path: ["staff-redemption", "claims", "list"], procedure: "event.staffRedemption.getStaffRedemptionClaims", operation: "query", summary: "List redemption claims, newest first (cursor paged), with items (with groupName), draw outcome, site, awayFromRosterSite (served at a site other than the roster site), session and void state; each row also has itemsPending (true while the prize was drawn but the food is not recorded yet) and itemsRecordedAt; filter by search, siteId, sessionId and status (active, items-pending, voided, all). items-pending is active claims that still wait for their food.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 },
|
|
10682
|
+
}, siteName: { anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }] }, shift: { anyOf: [{ type: "string", minLength: 1, maxLength: 8 }, { type: "null" }] }, workShift: { anyOf: [{ type: "string", maxLength: 120 }, { type: "null" }] }, allowance: { type: "integer", minimum: 0, maximum: 20 } }, required: ["eventId", "employeeId", "name", "siteName", "shift", "workShift"], additionalProperties: !1 } },
|
|
10683
|
+
{ path: ["staff-redemption", "claims", "list"], procedure: "event.staffRedemption.getStaffRedemptionClaims", operation: "query", summary: "List redemption claims, newest first (cursor paged), with items (with groupName), draw outcome (draw.slot is the site and session the draw was made in, where a released prize returns; it can differ from the claim's when the set came from another session or the draw was reused), site, awayFromRosterSite (served at a site other than the roster site), session and void state; each row also has itemsPending (true while the prize was drawn but the food is not recorded yet) and itemsRecordedAt; filter by search, siteId, sessionId and status (active, items-pending, voided, all). items-pending is active claims that still wait for their food.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 },
|
|
10684
|
+
sessionId: { type: "string", minLength: 1, maxLength: 64 }, status: { default: "all", type: "string", enum: ["active", "items-pending", "voided", "all"] }, limit: { default: 25, type: "integer", minimum: 1, maximum: 100 }, cursor: { anyOf: [{ type: "string", minLength: 1, maxLength: 8192 }, { type: "null" }] }, direction: { type: "string", const: "forward" } }, required: ["eventId"], additionalProperties: !1 } },
|
|
10685
|
+
{ path: ["staff-redemption", "claims", "counts"], procedure: "event.staffRedemption.getStaffRedemptionClaimCounts", operation: "query", summary: "Count claims matching the same filters as claims list : returns totalCount (all filters, status included), then activeCount, itemsPendingCount (active claims whose food is not recorded yet) and voidedCount, which ignore the status filter.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, search: { type: "string", maxLength: 200 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, sessionId: { type: "string", minLength: 1, maxLength: 64 }, status: { default: "all", type: "string", enum: ["active", "items-pending", "voided", "all"] } }, required: ["eventId"], additionalProperties: !1 } },
|
|
10686
|
+
{ path: ["staff-redemption", "claims", "void"], procedure: "event.staffRedemption.voidStaffRedemptionClaim", operation: "mutation", summary: "Void a claim with a reason (a claim still waiting for its food too). The set returns to the person and the slot; the prize draw is kept, so a redo shows the same outcome (even a draw made in another slot or a no-prize draw) until staff-redemption draw release. Claims list shows each draw's activeClaimCount.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, claimId: { type: "string", minLength: 1, maxLength: 64 }, reason: { type: "string", minLength: 1, maxLength: 500 } }, required: ["eventId", "claimId", "reason"], additionalProperties: !1 } },
|
|
10687
|
+
{ path: ["staff-redemption", "draw", "release"], procedure: "event.staffRedemption.releaseStaffRedemptionDraw", operation: "mutation", summary: "Release a person's prize draw (draw.id from claims list) with a reason: a won prize returns to the stock of the slot it was drawn in (claims list draw.slot) and the person draws again on their next redemption. Refused (CONFLICT) while an active, not voided redemption still shows the draw (claims list draw.activeClaimCount > 0); void it first, or pass the explicit override allowWhileClaimActive: true to release a prize while its redemption stays recorded (for example a paper entry). The override is recorded in the activity log.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, drawId: {
|
|
10927
10688
|
type: "string",
|
|
10928
10689
|
minLength: 1,
|
|
10929
10690
|
maxLength: 64
|
|
10930
|
-
},
|
|
10931
|
-
{ path: ["staff-redemption", "
|
|
10932
|
-
{ path: ["staff-redemption", "
|
|
10933
|
-
|
|
10934
|
-
{ path: ["staff-redemption", "
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
{ 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.
|
|
10938
|
-
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
],
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
"
|
|
10962
|
-
), coerceDates = __name2((input, datePaths) => datePaths.reduce((current, path2) => coerceDateAt(current, path2 === "" ? [] : path2.split("."), path2 || "input"), input), "coerceDates"), readInput = __name2(async (parsed, entry) => {
|
|
10691
|
+
}, reason: { type: "string", minLength: 1, maxLength: 500 }, allowWhileClaimActive: { description: "Override: release the draw even though an active (not voided) redemption still shows it, for a redemption that stays recorded (for example a paper entry with no spin). Omit to refuse while any active redemption uses the draw.", type: "boolean" } }, required: ["eventId", "drawId", "reason"], additionalProperties: !1 } },
|
|
10692
|
+
{ path: ["staff-redemption", "stock", "summary"], procedure: "event.staffRedemption.getStaffRedemptionStockSummary", operation: "query", summary: "Show sets and prizes issued and left per site and session, with per-slot item counts (items), roster headcount and how many of them collected, walk-ins (walkIns: unreleased draws in the slot by people whose roster site or shift is not the slot's, leaving out no-prize draws by another shift, which are the placeholders recorded where a set came from when no prize slot could be used) and how many of them won (walkInPrizes; under ANY_OPEN_SESSION walk-ins from another site spin for no prize since 19 Nov 2026, so it only counts earlier draws there), plus event-wide item totals.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId"], additionalProperties: !1 } },
|
|
10693
|
+
{ path: ["staff-redemption", "counter", "context"], procedure: "event.staffRedemption.getStaffRedemptionCounterContext", operation: "query", summary: "Counter view for one site (siteId): the event (name, status, dates), counterOrder (FOOD_THEN_DRAW or DRAW_THEN_FOOD, the order crew follow), items to choose from, the site's sessions with sets and prizes left, and any missing policies. wrongSite is the policy for people rostered at another site (null while unset), wrongSiteMessage the warning to show for them and staffIdLabel what the roster identifier is called (defaults applied). sessionRule is the session policy; under ANY_OPEN_SESSION, openSessionIds are the sessions open now and openSessionChangesAt when that next changes (serverTime is the server clock at the read); openSession (the open session that started most recently) is informational only, as no single session serves everyone (a person rostered at the site uses their own shift's slot from that session's Singapore day onward\
|
|
10694
|
+
s, whatever the hour; walk-ins and people whose session is on a later day use only open sessions' stock). Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 } }, required: ["eventId", "siteId"], additionalProperties: !1 } },
|
|
10695
|
+
{ path: ["staff-redemption", "lookup"], procedure: "event.staffRedemption.lookupStaffRedemptionEmployee", operation: "mutation", summary: "Look up an Employee ID (employeeId) or a scanned employee QR code (code, from the employee page; valid for ten minutes, refused with a message to refresh when expired or forged) at a site, giving exactly one of the two: who they are, the card's awayFromRosterSite and rosterSiteId (true when their roster site is not this site), what they already collected (a collected card's receipt carries itemsPending and itemsRecordedAt), their own shift's session (card.session, the only one whose prizes they can draw from), the session whose sets at this site a redemption would use now (card.setSession, with card.setsFromOtherSession true when it is not their own; both null and false on a card refused before sets are counted; card.slotSetsLeft is what is left in it), card.prizesHere (false when the spin here can only be no prize: no slot for their shift at this\
|
|
10696
|
+
site, or under ANY_OPEN_SESSION they are rostered at another site or their own session is on a later Singapore day), card.heldDraw (their unreleased draw from an earlier, voided redemption, shown again instead of a new spin; null when the next redemption draws afresh), card.ownSessionTiming (ANY_OPEN_SESSION only: NOT_STARTED or ENDED when their own session is not open, a warning; a person rostered here whose session has started or is due that Singapore day still uses their own shift's sets and prizes, while a walk-in or a person whose session is on a later day gets an open session's set and a no-prize spin; null otherwise) and whether a redemption would go ahead (refusal code otherwise). Writes nothing and is not rate-limited, so it needs no confirmation flags. Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, employeeId: { type: "stri\
|
|
10697
|
+
ng", minLength: 1, maxLength: 64 }, code: { description: "Employee QR code as scanned from the employee page. Give either employeeId or code.", type: "string", minLength: 1, maxLength: 512 } }, required: ["eventId", "siteId"], additionalProperties: !1 } },
|
|
10698
|
+
{ path: ["staff-redemption", "redeem"], procedure: "event.staffRedemption.redeemStaffRedemption", operation: "mutation", summary: "Redeem for an Employee ID at a site: records the chosen itemIds and reveals the prize outcome the server decides in the same transaction. clientRequestId is a UUID you generate; retry with the same one and you get the stored receipt, never a second redemption. The set and the draw follow the event's sessionRule. Under ANY_OPEN_SESSION a person rostered at this site gets the set, from their session's (Singapore) day onwards whatever the hour (on an earlier day they are served like a walk-in), from their own shift's slot here while it has sets left, else the open session's slot here with the most sets left (receipt.session names it; NO_SETS_LEFT when none has), and always draws from their own shift's slot's prizes here; a walk-in rostered at another site is served only while a session is open (NO_OPEN_SESSION otherwise), from their own shift's slot here whi\
|
|
10699
|
+
le their session is open and it has sets left, else the open session's slot here with the most sets left, and always gets no prize. receipt.draw.slot is the slot, session and site the draw was made in (a reused draw keeps its own). When the event's counterOrder is DRAW_THEN_FOOD, itemIds must be [] (anything else is BAD_REQUEST): the claim, the set and the prize draw are recorded together and the receipt has itemsPending true until staff-redemption claims record-items. The item rule is not checked at the spin. Needs event.operate.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, employeeId: { type: "string", minLength: 1, maxLength: 64 }, clientRequestId: { type: "string", format: "uuid", pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|\
|
|
10700
|
+
ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, itemIds: { maxItems: 20, type: "array", items: { type: "string", minLength: 1, maxLength: 64 } } }, required: ["eventId", "siteId", "employeeId", "clientRequestId", "itemIds"], additionalProperties: !1 } },
|
|
10701
|
+
{ path: ["staff-redemption", "claims", "record-items"], procedure: "event.staffRedemption.recordStaffRedemptionClaimItems", operation: "mutation", summary: "Record the food (itemIds, checked against the item rule) for a claim that was drawn first (itemsPending true, counterOrder DRAW_THEN_FOOD). siteId must be the claim's own site (claims list shows it). Writes the items, sets itemsPending false and itemsRecordedAt, and logs it; it deducts no set and makes no draw. Idempotent: the same items again return replayed true with the stored receipt. CONFLICT when different items were already recorded, when the claim is voided, or when the claim was food-first (nothing pending). Needs event.operate at that site (a manager has it). Returns status recorded, replayed and the receipt.", effects: ["state-change"], target: "eventId", dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, claimId: {
|
|
10702
|
+
type: "string", minLength: 1, maxLength: 64 }, itemIds: {
|
|
10703
|
+
maxItems: 20,
|
|
10704
|
+
type: "array",
|
|
10705
|
+
items: { type: "string", minLength: 1, maxLength: 64 }
|
|
10706
|
+
} }, required: ["eventId", "siteId", "claimId", "itemIds"], additionalProperties: !1 } },
|
|
10707
|
+
{ path: ["staff-redemption", "counter", "claims"], procedure: "event.staffRedemption.getStaffRedemptionCounterClaims", operation: "query", summary: "List a site's recent claims (limit 1-50, default 20) as the counter sees them. scope mine (default) is the claims you made at the site, site is every claim at the site. status all (default) includes every recent claim; items-pending selects active claims whose food is not recorded before applying the limit. Each receipt carries itemsPending and itemsRecordedAt. Needs event.operate.", effects: [], dates: [], input: { type: "object", properties: { eventId: { type: "string", minLength: 1, maxLength: 64 }, siteId: { type: "string", minLength: 1, maxLength: 64 }, limit: { default: 20, type: "integer", minimum: 1, maximum: 50 }, scope: { default: "mine", type: "string", enum: ["mine", "site"] }, status: { default: "all", type: "string", enum: ["all", "items-pending"] } }, required: [
|
|
10708
|
+
"eventId",
|
|
10709
|
+
"siteId"
|
|
10710
|
+
], additionalProperties: !1 } }
|
|
10711
|
+
], manifest = command_manifest_default, registryFlags = ["input", "input-file", "allow-state-change", "allow-delete", "allow-email", "target"], isoDateTimePattern = new __cliRegExp("^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d", ""), isRecord3 = __name2((value) => typeof value == "object" && value !== null && !Array.isArray(value), "isRecord3"), commandName = __name2((entry) => "et ".concat(entry.path.join(" ")), "commandName"), findManifestEntry = __name2((positionals) => manifest.find((entry) => entry.path.length === positionals.length && entry.path.every((segment, index) => positionals[index] === segment)), "findManifestEntry"), listRegistryCommands = __name2(() => manifest.map((entry) => ({ command: commandName(entry), summary: entry.summary, effects: entry.effects })), "listRegistryCommands"), coerceDateAt = __name2((value, segments, label) => {
|
|
10712
|
+
const [head, ...rest] = segments;
|
|
10713
|
+
if (head === void 0) {
|
|
10714
|
+
if (typeof value != "string") return value;
|
|
10715
|
+
const parsed = new Date(value);
|
|
10716
|
+
if (!isoDateTimePattern.test(value) || Number.isNaN(parsed.getTime())) throw new CliUsageError(
|
|
10717
|
+
"".concat(label, " must be an ISO 8601 date-time such as 2026-11-20T18:00:00+08:00.")
|
|
10718
|
+
);
|
|
10719
|
+
return parsed;
|
|
10720
|
+
}
|
|
10721
|
+
const isArray = head.endsWith("[]"), key = isArray ? head.slice(0, -2) : head, apply = __name2((child) => isArray ? Array.isArray(child) ? child.map((item) => coerceDateAt(item, rest, label)) : child : coerceDateAt(child, rest, label), "apply");
|
|
10722
|
+
return key === "" ? apply(value) : !isRecord3(value) || !(key in value) ? value : { ...value, [key]: apply(value[key]) };
|
|
10723
|
+
}, "coerceDateAt"), coerceDates = __name2((input, datePaths) => datePaths.reduce((current, path2) => coerceDateAt(current, path2 === "" ? [] : path2.split("."), path2 || "input"), input), "coerceDates"), readInput = __name2(async (parsed, entry) => {
|
|
10963
10724
|
const provided = parsed.flags.has("input") || parsed.flags.has("input-file");
|
|
10964
10725
|
if (!entry.input) {
|
|
10965
|
-
if (provided) throw new CliUsageError("".concat(
|
|
10966
|
-
commandName(entry),
|
|
10967
|
-
" does not take --input."
|
|
10968
|
-
));
|
|
10726
|
+
if (provided) throw new CliUsageError("".concat(commandName(entry), " does not take --input."));
|
|
10969
10727
|
return;
|
|
10970
10728
|
}
|
|
10971
10729
|
if (!provided) {
|
|
@@ -10992,16 +10750,19 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
10992
10750
|
const expected = targetText(isRecord3(input) ? input[entry.target] : void 0);
|
|
10993
10751
|
if (expected === void 0) throw new CliUsageError("--input must include ".concat(entry.target, " so the target can be confirmed."));
|
|
10994
10752
|
if (getOptionalFlag(parsed, "target") !== expected) throw new CliUsageError("--target must exactly match input.".concat(entry.target, " (").concat(expected, ")."));
|
|
10995
|
-
}, "assertConfirmed"), describe2 = __name2((entry) => ({ command: commandName(entry), summary: entry.summary, procedure: entry.procedure, operation: entry.operation, effects: entry.effects, confirmation: entry.effects.length > 0 ? [...entry.effects.map((effect) => "--allow-".concat(effect)), ...entry.target ? ["--target <input.".concat(entry.target).concat(entry.target.endsWith("s") ? " joined with commas" : "", ">")] : []] : [], input: entry.input ? "--input '<json>' or --input-file <path> matching inputSchema" : "none", dateFields: entry.dates, inputSchema: entry.input }), "describe2"), resolveProcedureClient = __name2((procedure) => procedure.split(".").reduce((node2, segment) => node2[segment], api2), "resolveProcedureClient"), runRegistryCommand = __name2(
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
10753
|
+
}, "assertConfirmed"), describe2 = __name2((entry) => ({ command: commandName(entry), summary: entry.summary, procedure: entry.procedure, operation: entry.operation, effects: entry.effects, confirmation: entry.effects.length > 0 ? [...entry.effects.map((effect) => "--allow-".concat(effect)), ...entry.target ? ["--target <input.".concat(entry.target).concat(entry.target.endsWith("s") ? " joined with commas" : "", ">")] : []] : [], input: entry.input ? "--input '<json>' or --input-file <path> matching inputSchema" : "none", dateFields: entry.dates, inputSchema: entry.input }), "describe2"), resolveProcedureClient = __name2((procedure) => procedure.split(".").reduce((node2, segment) => node2[segment], api2), "resolveProcedureClient"), runRegistryCommand = __name2(
|
|
10754
|
+
async (input) => {
|
|
10755
|
+
const { parsed, runtime, authenticate } = input, entry = findManifestEntry(parsed.positionals);
|
|
10756
|
+
if (!entry) return !1;
|
|
10757
|
+
if (parsed.flags.has("help")) return assertOnlyFlags(parsed, ["help"]), writeSuccess(runtime, describe2(entry)), !0;
|
|
10758
|
+
assertOnlyFlags(parsed, registryFlags);
|
|
10759
|
+
const procedureInput = await readInput(parsed, entry);
|
|
10760
|
+
assertConfirmed(parsed, entry, procedureInput), await authenticate();
|
|
10761
|
+
const client = resolveProcedureClient(entry.procedure);
|
|
10762
|
+
return writeSuccess(runtime, entry.operation === "query" ? await client.query(procedureInput) : await client.mutate(procedureInput)), !0;
|
|
10763
|
+
},
|
|
10764
|
+
"runRegistryCommand"
|
|
10765
|
+
), getInstalledCliVersion = __name2(() => {
|
|
11005
10766
|
try {
|
|
11006
10767
|
const packageJson = JSON.parse(readFileSync(resolve(import.meta.dir, "../package.json"), "utf8"));
|
|
11007
10768
|
return typeof packageJson.version == "string" ? packageJson.version : "unknown";
|
|
@@ -11024,20 +10785,17 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
11024
10785
|
const createdAt = new Date(parsed.createdAt);
|
|
11025
10786
|
if (Number.isNaN(createdAt.getTime())) throw new CliUsageError("--cursor.createdAt must be a valid date.");
|
|
11026
10787
|
return { createdAt, id: parsed.id };
|
|
11027
|
-
}, "parseCursor"), parseRetainedIds = __name2(
|
|
11028
|
-
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
|
|
11037
|
-
|
|
11038
|
-
},
|
|
11039
|
-
"parseRetainedIds"
|
|
11040
|
-
), luckyDrawParticipantFields = /* @__PURE__ */ new Set(["email", "luckyDrawId", "name"]), asParticipantRecord = __name2((participant, index) => {
|
|
10788
|
+
}, "parseCursor"), parseRetainedIds = __name2((value) => {
|
|
10789
|
+
let parsed;
|
|
10790
|
+
try {
|
|
10791
|
+
parsed = JSON.parse(value);
|
|
10792
|
+
} catch {
|
|
10793
|
+
throw new CliUsageError("--retained-ids must be valid JSON.");
|
|
10794
|
+
}
|
|
10795
|
+
if (!Array.isArray(parsed)) throw new CliUsageError("--retained-ids must be a JSON array.");
|
|
10796
|
+
if (parsed.length > 100 || parsed.some((id) => typeof id != "string" || id.length === 0)) throw new CliUsageError("--retained-ids must contain at most 100 non-empty strings.");
|
|
10797
|
+
return parsed;
|
|
10798
|
+
}, "parseRetainedIds"), luckyDrawParticipantFields = /* @__PURE__ */ new Set(["email", "luckyDrawId", "name"]), asParticipantRecord = __name2((participant, index) => {
|
|
11041
10799
|
if (typeof participant != "object" || participant === null || Array.isArray(participant)) throw new CliUsageError("--participants[".concat(index, "] must be an object."));
|
|
11042
10800
|
if (Object.keys(participant).some((key) => !luckyDrawParticipantFields.has(key))) throw new CliUsageError("--participants[".concat(index, "] contains an unsupported field."));
|
|
11043
10801
|
return participant;
|
|
@@ -11055,9 +10813,7 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
11055
10813
|
throw new CliUsageError("--participants must be valid JSON.");
|
|
11056
10814
|
}
|
|
11057
10815
|
if (!Array.isArray(parsed)) throw new CliUsageError("--participants must be a JSON array.");
|
|
11058
|
-
return parsed.map(
|
|
11059
|
-
parseLuckyDrawParticipant
|
|
11060
|
-
);
|
|
10816
|
+
return parsed.map(parseLuckyDrawParticipant);
|
|
11061
10817
|
}, "parseLuckyDrawParticipants"), parseAppearanceMediaType = __name2((value) => {
|
|
11062
10818
|
if (value === "image" || value === "video") return value;
|
|
11063
10819
|
throw new CliUsageError("--media-type must be one of: image, video.");
|
|
@@ -11084,15 +10840,12 @@ var STAFF_REDEMPTION_NAME_MAX = 120, STAFF_REDEMPTION_EMPLOYEE_ID_MAX = 64, STAF
|
|
|
11084
10840
|
if (Number.isNaN(parsed.getTime())) throw new CliUsageError("--".concat(name, " must be a valid date-time."));
|
|
11085
10841
|
return parsed;
|
|
11086
10842
|
}, "parseIsoDateTime"), commandKey = __name2((action, subAction) => JSON.stringify([action ?? null, subAction ?? null]), "commandKey"), runAuthLogin = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl, cliVersion }) => {
|
|
11087
|
-
assertPositionalCount(
|
|
11088
|
-
parsed,
|
|
11089
|
-
2
|
|
11090
|
-
), assertOnlyFlags(parsed, ["no-browser"]);
|
|
10843
|
+
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["no-browser"]);
|
|
11091
10844
|
const credentials = await loginWithBrowser({ apiBaseUrl, clientVersion: cliVersion, onVerification: __name2(({ browserOpened, userCode, verificationUriComplete }) => {
|
|
11092
|
-
runtime.stderr.write("".concat(browserOpened ? "Opened" : "Open", " ").concat(
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
10845
|
+
runtime.stderr.write("".concat(browserOpened ? "Opened" : "Open", " ").concat(
|
|
10846
|
+
verificationUriComplete,
|
|
10847
|
+
"\nCode: "
|
|
10848
|
+
).concat(userCode, "\nWaiting for approval\u2026\n"));
|
|
11096
10849
|
}, "onVerification"), ...parsed.flags.get("no-browser") === !0 ? { openBrowser: __name2(async () => !1, "openBrowser") } : {}, store: credentialStore });
|
|
11097
10850
|
writeSuccess(runtime, { authenticated: !0, session: credentials.session, storage: "Bun.secrets" });
|
|
11098
10851
|
}, "runAuthLogin"), runAuthStatus = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl }) => {
|
|
@@ -11100,7 +10853,9 @@ Waiting for approval\u2026
|
|
|
11100
10853
|
const credentials = await credentialStore.get();
|
|
11101
10854
|
writeSuccess(runtime, credentials && isCliCredentialForIssuer(credentials, apiBaseUrl) ? { authenticated: !0, accessTokenExpiresAt: credentials.accessTokenExpiresAt, refreshTokenExpiresAt: credentials.refreshTokenExpiresAt, session: credentials.session, storage: "Bun.secrets" } : { authenticated: !1, storage: "Bun.secrets" });
|
|
11102
10855
|
}, "runAuthStatus"), runAuthLogout = __name2(async ({ parsed, runtime, credentialStore, apiBaseUrl }) => {
|
|
11103
|
-
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), writeSuccess(runtime, { loggedOut: !0, ...await logoutCliSession(
|
|
10856
|
+
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), writeSuccess(runtime, { loggedOut: !0, ...await logoutCliSession(
|
|
10857
|
+
{ apiBaseUrl, store: credentialStore }
|
|
10858
|
+
) });
|
|
11104
10859
|
}, "runAuthLogout"), runAuthWhoami = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11105
10860
|
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, []), await ensureAuthentication(), writeSuccess(runtime, await api2.auth.whoami.query(void 0));
|
|
11106
10861
|
}, "runAuthWhoami"), runOrganizationList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
@@ -11113,7 +10868,10 @@ Waiting for approval\u2026
|
|
|
11113
10868
|
await ensureAuthentication(), writeSuccess(runtime, await api2.admin.organization.createOrganization.mutate(input));
|
|
11114
10869
|
}, "runOrganizationCreate"), runEventCreate = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11115
10870
|
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["organization-id", "name", "type", "start", "end", "location"]);
|
|
11116
|
-
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(
|
|
10871
|
+
const end = getOptionalFlag(parsed, "end"), input = { organizationId: getRequiredFlag(parsed, "organization-id"), name: getRequiredFlag(parsed, "name"), type: parseCreatableEventType(getRequiredFlag(parsed, "type")), location: getRequiredFlag(parsed, "location"), eventDateRange: { from: parseIsoDateTime(getRequiredFlag(parsed, "start"), "start"), ...end === void 0 ? {} : { to: parseIsoDateTime(
|
|
10872
|
+
end,
|
|
10873
|
+
"end"
|
|
10874
|
+
) } } };
|
|
11117
10875
|
await ensureAuthentication(), writeSuccess(runtime, await api2.event.createEvent.mutate(input));
|
|
11118
10876
|
}, "runEventCreate"), runEventList = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11119
10877
|
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["organization-id", "page", "per-page", "name", "status", "archive-status"]);
|
|
@@ -11138,20 +10896,14 @@ Waiting for approval\u2026
|
|
|
11138
10896
|
await ensureAuthentication(), writeSuccess(runtime, await api2.event.updateEventAppearance.mutate(input));
|
|
11139
10897
|
}, "runEventAppearanceUpdate"), runEventAppearanceUpload = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11140
10898
|
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "file", "content-type", "media-type"]);
|
|
11141
|
-
const eventId = getRequiredFlag(parsed, "event-id"), filePath = getRequiredFlag(
|
|
11142
|
-
parsed,
|
|
11143
|
-
"file"
|
|
11144
|
-
), contentType = getRequiredFlag(parsed, "content-type"), mediaType = parseAppearanceMediaType(getRequiredFlag(parsed, "media-type")), file = await readFile7(filePath);
|
|
10899
|
+
const eventId = getRequiredFlag(parsed, "event-id"), filePath = getRequiredFlag(parsed, "file"), contentType = getRequiredFlag(parsed, "content-type"), mediaType = parseAppearanceMediaType(getRequiredFlag(parsed, "media-type")), file = await readFile7(filePath);
|
|
11145
10900
|
await ensureAuthentication();
|
|
11146
10901
|
const signed = await api2.attachment.getPresignedUrlToUpload.mutate({ folder: "event-appearance/".concat(mediaType === "image" ? "images" : "videos"), fileName: basename5(filePath), contentType, size: file.byteLength, eventId }), uploadResponse = await fetch(signed.uploadUrl, { method: "PUT", headers: { "content-type": contentType }, body: file });
|
|
11147
10902
|
if (!uploadResponse.ok) throw new Error("Appearance media upload failed with HTTP ".concat(uploadResponse.status, "."));
|
|
11148
10903
|
writeSuccess(runtime, signed);
|
|
11149
10904
|
}, "runEventAppearanceUpload"), runPhotoWallDisplayItems = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11150
10905
|
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "limit", "cursor", "retained-ids"]);
|
|
11151
|
-
const cursorValue = getOptionalFlag(parsed, "cursor"), retainedIdsValue = getOptionalFlag(parsed, "retained-ids"), input = { eventId: getRequiredFlag(
|
|
11152
|
-
parsed,
|
|
11153
|
-
"event-id"
|
|
11154
|
-
), limit: parseBoundedInteger(getOptionalFlag(parsed, "limit") ?? "30", "limit", 1, 60), ...cursorValue === void 0 ? {} : { cursor: parseCursor(cursorValue) }, retainedIds: retainedIdsValue === void 0 ? [] : parseRetainedIds(retainedIdsValue) };
|
|
10906
|
+
const cursorValue = getOptionalFlag(parsed, "cursor"), retainedIdsValue = getOptionalFlag(parsed, "retained-ids"), input = { eventId: getRequiredFlag(parsed, "event-id"), limit: parseBoundedInteger(getOptionalFlag(parsed, "limit") ?? "30", "limit", 1, 60), ...cursorValue === void 0 ? {} : { cursor: parseCursor(cursorValue) }, retainedIds: retainedIdsValue === void 0 ? [] : parseRetainedIds(retainedIdsValue) };
|
|
11155
10907
|
await ensureAuthentication(), writeSuccess(runtime, await api2.event.photoWall.getPhotoWallDisplayItems.query(input));
|
|
11156
10908
|
}, "runPhotoWallDisplayItems"), runLuckyDrawPreDraw = __name2(async ({ parsed, runtime, ensureAuthentication }) => {
|
|
11157
10909
|
assertPositionalCount(parsed, 2), assertOnlyFlags(parsed, ["event-id", "prize-count"]);
|
|
@@ -11167,11 +10919,13 @@ Waiting for approval\u2026
|
|
|
11167
10919
|
assertPositionalCount(parsed, 3), assertOnlyFlags(parsed, ["event-id", "page", "per-page"]);
|
|
11168
10920
|
const input = { eventId: getRequiredFlag(parsed, "event-id"), page: parsePositiveInteger(getOptionalFlag(parsed, "page") ?? "1", "page"), perPage: parseBoundedInteger(getOptionalFlag(parsed, "per-page") ?? "100", "per-page", 1, 100) };
|
|
11169
10921
|
await ensureAuthentication(), writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawParticipantsByEventId.query(input));
|
|
11170
|
-
}, "runLuckyDrawParticipantsList"), organizationCommands = /* @__PURE__ */ new Map([
|
|
11171
|
-
[commandKey("
|
|
11172
|
-
[
|
|
11173
|
-
[
|
|
11174
|
-
|
|
10922
|
+
}, "runLuckyDrawParticipantsList"), organizationCommands = /* @__PURE__ */ new Map([[commandKey("list"), runOrganizationList], [commandKey("get"), runOrganizationGet], [commandKey("create"), runOrganizationCreate]]), commandTable = /* @__PURE__ */ new Map([
|
|
10923
|
+
["auth", /* @__PURE__ */ new Map([[commandKey("login"), runAuthLogin], [commandKey("status"), runAuthStatus], [commandKey("logout"), runAuthLogout], [commandKey("whoami"), runAuthWhoami]])],
|
|
10924
|
+
["organization", organizationCommands],
|
|
10925
|
+
["org", organizationCommands],
|
|
10926
|
+
["event", /* @__PURE__ */ new Map([[commandKey("create"), runEventCreate], [commandKey("list"), runEventList], [commandKey("get"), runEventGet], [commandKey("appearance", "get"), runEventAppearanceGet], [commandKey("appearance", "update"), runEventAppearanceUpdate], [commandKey("appearance", "reset"), runEventAppearanceUpdate], [commandKey("appearance", "upload"), runEventAppearanceUpload], [commandKey("photo-wall", "display-items"), runPhotoWallDisplayItems], [commandKey("photo-wall", "display"), runPhotoWallDisplayItems]])],
|
|
10927
|
+
["lucky-draw", /* @__PURE__ */ new Map([[commandKey("pre-draw"), runLuckyDrawPreDraw], [commandKey("participants", "replace"), runLuckyDrawParticipantsReplace], [commandKey("participants", "list"), runLuckyDrawParticipantsList]])]
|
|
10928
|
+
]), runCommand = __name2(async (parsed, runtime, credentialStore, apiBaseUrl, configureAccessToken) => {
|
|
11175
10929
|
const [group, action, subAction] = parsed.positionals, cliVersion = getInstalledCliVersion();
|
|
11176
10930
|
let accessToken;
|
|
11177
10931
|
const ensureAuthentication = __name2(async () => {
|
|
@@ -11207,10 +10961,7 @@ Waiting for approval\u2026
|
|
|
11207
10961
|
const parsed = parseArguments(args), apiUrl = getOptionalFlag(parsed, "api-url");
|
|
11208
10962
|
return apiUrl ? configureEventTechApiBaseUrl(apiUrl) : configureEventTechApiFromEnvironment(), await runCommand(parsed, runtime, credentialStore, getEventTechApiBaseUrl(), configureAccessToken), 0;
|
|
11209
10963
|
} catch (error2) {
|
|
11210
|
-
return writeError(
|
|
11211
|
-
runtime,
|
|
11212
|
-
error2
|
|
11213
|
-
), error2 instanceof CliUsageError ? 2 : 1;
|
|
10964
|
+
return writeError(runtime, error2), error2 instanceof CliUsageError ? 2 : 1;
|
|
11214
10965
|
}
|
|
11215
10966
|
}, "runCli");
|
|
11216
10967
|
import.meta.main && (assertBunRuntime(), process.exitCode = await runCli(process.argv.slice(2)));
|