@go-labs-sg/event-tech 1.10.0 → 1.11.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 +50 -7
- package/command-reference.md +1 -0
- package/dist/index.js +485 -76
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -95,6 +95,8 @@ et event appearance update --event-id <id> --appearance-version <n> --appearance
|
|
|
95
95
|
et event appearance reset --event-id <id> --appearance-version <n>
|
|
96
96
|
et event appearance upload --event-id <id> --file ./background.mp4 --media-type video --content-type video/mp4
|
|
97
97
|
et event photo-wall display-items --event-id <id> --limit 30
|
|
98
|
+
et passport skin get --event-id <id>
|
|
99
|
+
et passport station image-set --event-id <id> --station-id <id> --file ./cover.jpg --content-type image/jpeg
|
|
98
100
|
et lucky-draw participants replace --event-id <id> --participants '[{"luckyDrawId":"illustrative-001","name":"Example Person","email":"example@example.test"}]' --allow-state-change --target <id>
|
|
99
101
|
et lucky-draw participants list --event-id <id> --page 1 --per-page 100
|
|
100
102
|
et lucky-draw config get --event-id <id>
|
|
@@ -133,6 +135,7 @@ et passport overview --event-id <id>
|
|
|
133
135
|
et passport login-options --event-id <id>
|
|
134
136
|
et passport mine --event-id <id>
|
|
135
137
|
et passport bingo enable --event-id <id>
|
|
138
|
+
et passport bingo rename --event-id <id> --name "Staff Bingo"
|
|
136
139
|
et passport bingo join --event-id <id>
|
|
137
140
|
et passport bingo status --event-id <id>
|
|
138
141
|
et passport bingo claim-stamp --event-id <id>
|
|
@@ -180,7 +183,7 @@ them accidentally. Its JSON requires `linkedDrawEventId`,
|
|
|
180
183
|
`luckyDrawStampThreshold`, `prizeStampThreshold` and
|
|
181
184
|
`maxRedemptionsPerParticipant`; optional `loginMethods` is
|
|
182
185
|
`{"emailOtp":true,"google":false,"guest":true,"staffId":false}` (`staffId` may be
|
|
183
|
-
omitted and defaults to false). Omit `loginMethods` to preserve it. At least
|
|
186
|
+
omitted and defaults to false; `staffIdRequiresLastName` may be omitted and defaults to true, so include it as false each time you resend `loginMethods` on an event that has it off). Omit `loginMethods` to preserve it. At least
|
|
184
187
|
email OTP, Google or Staff ID must remain enabled for recovery, and enabling
|
|
185
188
|
Google requires configured provider credentials. Points never replace the
|
|
186
189
|
existing stamp-based reward thresholds.
|
|
@@ -216,11 +219,16 @@ returns per-item totals; `tally list` returns a station's tallies; `export`
|
|
|
216
219
|
includes `tallies` and `tallySummary`. Plain `collect`, `claim` and rotating QR routes reject tally stations; only a manager stamp correction can add or remove the
|
|
217
220
|
station stamp there. Reversing a tally keeps the station stamp, and a revoked station stamp is not restored by later tallies. The CLI prints the server response unchanged.
|
|
218
221
|
|
|
219
|
-
Bingo: `bingo enable` (manager) creates the hunt and a hidden Bingo station (stamp value 3 by default). `bingo join`, `bingo status` and `bingo claim-stamp` act as the signed-in passport participant; `claim-stamp` is the catch-up for a completed card. Overview, participant detail and `export` report bingo joined, completed and stamp counts.
|
|
222
|
+
Bingo: `bingo enable` (manager) creates the hunt and a hidden Bingo station (stamp value 3 by default). The game's display name is that station's name (default "Human Bingo"); `bingo rename --name <name>` (manager, 1-100 characters, bingo must be enabled) changes it, and `bingo status` returns it as `name`. `bingo join`, `bingo status` and `bingo claim-stamp` act as the signed-in passport participant; `claim-stamp` is the catch-up for a completed card. Overview, participant detail and `export` report bingo joined, completed and stamp counts.
|
|
220
223
|
|
|
221
|
-
Staff roster: with `loginMethods.staffId` on, guests sign in with a Staff ID and
|
|
222
|
-
last name from the event
|
|
223
|
-
punctuation and accents).
|
|
224
|
+
Staff roster: with `loginMethods.staffId` on, guests sign in with a Staff ID and,
|
|
225
|
+
unless `loginMethods.staffIdRequiresLastName` is false, a last name from the event
|
|
226
|
+
roster (matched case-insensitively, ignoring spaces, punctuation and accents). With
|
|
227
|
+
the requirement off, a Staff ID alone signs in, so anyone who knows or guesses one
|
|
228
|
+
can open that passport; use it only when Staff IDs are hard to guess. Blank last
|
|
229
|
+
names are then accepted in `roster import` and `roster upsert` (`"lastName":null`).
|
|
230
|
+
If the requirement is turned back on, those entries cannot sign in until they have
|
|
231
|
+
a last name; `roster counts` reports them as `missingLastNameCount`. One Staff ID owns one passport per event, so signing in
|
|
224
232
|
again on another device resumes it. Failed attempts lock a Staff ID for 10 minutes
|
|
225
233
|
after 5 misses, and an IP after 50. Only event hosts (setup permission) can read
|
|
226
234
|
or change the roster. `roster import` reads a CSV or `.xlsx` file locally,
|
|
@@ -229,8 +237,8 @@ header row, and replaces the whole roster. Override a guess with the column
|
|
|
229
237
|
flags, or pass `none` to ignore an optional column. Without a last-name column
|
|
230
238
|
the last name is the last word of the full name, or the first word with
|
|
231
239
|
`--surname-position first`. The response reports `imported`, `replaced` and
|
|
232
|
-
each `rejected` row (`MISSING_STAFF_ID`, `MISSING_LAST_NAME
|
|
233
|
-
`DUPLICATE_STAFF_ID` or `TOO_LONG`). Re-importing is safe: existing Staff ID
|
|
240
|
+
each `rejected` row (`MISSING_STAFF_ID`, `MISSING_LAST_NAME` when the event
|
|
241
|
+
requires one, `DUPLICATE_STAFF_ID` or `TOO_LONG`). Re-importing is safe: existing Staff ID
|
|
234
242
|
passports keep their stamps. A file may hold up to 20,000 rows with data and
|
|
235
243
|
200 columns. A file with data past those limits (including data below row
|
|
236
244
|
50,000), a misplaced or unclosed CSV quote, or no importable rows at all is refused and the
|
|
@@ -243,6 +251,41 @@ owned by the current CLI identity; it cannot recover a guest by name or assume a
|
|
|
243
251
|
participant ID. No CLI auth transport or organiser access boundary is bypassed.
|
|
244
252
|
See the [Passport workflow and rollout gates](../../../docs/design/event-tech-passport-event-type.md).
|
|
245
253
|
|
|
254
|
+
#### Passport skin and station art
|
|
255
|
+
|
|
256
|
+
Every event renders the Go Labs default Passport look. An organiser may skin one
|
|
257
|
+
event through the optional `passport` block of the event appearance (hero key
|
|
258
|
+
visual with a focal point, logo, a graphics-only colour, a dark block colour and
|
|
259
|
+
`emphasis`). `skin` commands read and write only that block, using the same
|
|
260
|
+
version-fenced `updateEventAppearance` procedure and `event.setup` permission as
|
|
261
|
+
the web editor; every other appearance setting is preserved.
|
|
262
|
+
|
|
263
|
+
```sh
|
|
264
|
+
et passport skin get --event-id <id>
|
|
265
|
+
et passport skin upload --event-id <id> --kind hero --file ./key-visual.jpg --content-type image/jpeg
|
|
266
|
+
et passport skin set --event-id <id> --appearance-version 3 \
|
|
267
|
+
--skin-json '{"heroImage":{"key":"<key from upload>","focalX":60,"focalY":30},"colors":{"graphic":"#e8483b","dark":"#0b2d5b"},"emphasis":"ink"}'
|
|
268
|
+
et passport skin set --event-id <id> --appearance-version 4 --skin-json '{"heroImage":{"focalX":30}}'
|
|
269
|
+
et passport skin clear --event-id <id> --appearance-version 5
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
- `skin set` is a merge patch. Omitted keys keep their stored value, an object merges into the stored `heroImage`, `logo` or `colors`, and `null` clears `heroImage` or `logo`.
|
|
273
|
+
- `colors.graphic` paints shapes only, never text. `colors.dark` needs 4.5:1 contrast with white.
|
|
274
|
+
- `skin clear` returns the event to the Go Labs default look (the reverse of `skin set`). Appearance saves that omit `passport`, including `event appearance update`, keep the stored skin.
|
|
275
|
+
- Uploads accept JPEG, PNG, WebP or GIF up to 25 MB. SVG is not allowed.
|
|
276
|
+
|
|
277
|
+
Station cover art uses the station's existing `imageKey`:
|
|
278
|
+
|
|
279
|
+
```sh
|
|
280
|
+
et passport station image-set --event-id <id> --station-id <id> --file ./cover.jpg --content-type image/jpeg
|
|
281
|
+
et passport station image-clear --event-id <id> --station-id <id>
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
`image-set` uploads to the event's station-art folder and saves the key, keeping
|
|
285
|
+
every other station setting and the collection mode. `image-clear` removes it.
|
|
286
|
+
A new `imageKey` passed through `station upsert` must also be an upload to this
|
|
287
|
+
event's `event-passport/stations` folder; an unchanged key always passes.
|
|
288
|
+
|
|
246
289
|
### Deprecated event types
|
|
247
290
|
|
|
248
291
|
Scavenger Hunt (Amazing Race) and Gardens by the Bay are deprecated and frozen.
|
package/command-reference.md
CHANGED
|
@@ -378,6 +378,7 @@ Run `et <command> --help` for the full input JSON Schema.
|
|
|
378
378
|
- `event.passport.getPassportTallySummary`: hand-written
|
|
379
379
|
- `event.passport.getPassportStationTallies`: hand-written
|
|
380
380
|
- `event.passport.enablePassportBingo`: hand-written
|
|
381
|
+
- `event.passport.renamePassportBingo`: hand-written
|
|
381
382
|
- `event.passport.joinPassportBingo`: hand-written
|
|
382
383
|
- `event.passport.claimPassportBingoStamp`: hand-written
|
|
383
384
|
- `event.passport.getMyPassportBingo`: hand-written
|
package/dist/index.js
CHANGED
|
@@ -17175,8 +17175,8 @@ var logoutCliSession = async ({
|
|
|
17175
17175
|
};
|
|
17176
17176
|
// src/cli.ts
|
|
17177
17177
|
import { readFileSync } from "fs";
|
|
17178
|
-
import { readFile as
|
|
17179
|
-
import { basename as
|
|
17178
|
+
import { readFile as readFile6 } from "fs/promises";
|
|
17179
|
+
import { basename as basename4, resolve } from "path";
|
|
17180
17180
|
|
|
17181
17181
|
// ../db/src/generated/prisma/enums.ts
|
|
17182
17182
|
var EventType = {
|
|
@@ -17200,7 +17200,7 @@ var DEPRECATED_EVENT_TYPES = [
|
|
|
17200
17200
|
var activeEventTypeSchema = _enum(EventType).exclude(DEPRECATED_EVENT_TYPES);
|
|
17201
17201
|
var ACTIVE_EVENT_TYPES = activeEventTypeSchema.options;
|
|
17202
17202
|
|
|
17203
|
-
// ../../../node_modules/.bun/@trpc+server@11.
|
|
17203
|
+
// ../../../node_modules/.bun/@trpc+server@11.28.0+431a08decb845963/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
|
|
17204
17204
|
function observable(subscribe) {
|
|
17205
17205
|
const self2 = {
|
|
17206
17206
|
subscribe(observer) {
|
|
@@ -17416,7 +17416,7 @@ function observableToAsyncIterable(observable, signal) {
|
|
|
17416
17416
|
return iterator;
|
|
17417
17417
|
}
|
|
17418
17418
|
|
|
17419
|
-
// ../../../node_modules/.bun/@trpc+server@11.
|
|
17419
|
+
// ../../../node_modules/.bun/@trpc+server@11.28.0+431a08decb845963/node_modules/@trpc/server/dist/observable-BjUZYMQq.mjs
|
|
17420
17420
|
function share(_opts) {
|
|
17421
17421
|
return (source) => {
|
|
17422
17422
|
let refCount = 0;
|
|
@@ -17538,7 +17538,7 @@ function behaviorSubject(initialValue) {
|
|
|
17538
17538
|
return obs;
|
|
17539
17539
|
}
|
|
17540
17540
|
|
|
17541
|
-
// ../../../node_modules/.bun/@trpc+client@11.
|
|
17541
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.0+86c0a2ff0813b553/node_modules/@trpc/client/dist/splitLink-PFsRy7Mf.mjs
|
|
17542
17542
|
function createChain(opts) {
|
|
17543
17543
|
return observable((observer) => {
|
|
17544
17544
|
function execute(index = 0, op = opts.op) {
|
|
@@ -17556,7 +17556,7 @@ function createChain(opts) {
|
|
|
17556
17556
|
});
|
|
17557
17557
|
}
|
|
17558
17558
|
|
|
17559
|
-
// ../../../node_modules/.bun/@trpc+client@11.
|
|
17559
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.0+86c0a2ff0813b553/node_modules/@trpc/client/dist/objectSpread2-pyA4QVO4.mjs
|
|
17560
17560
|
function _typeof(o) {
|
|
17561
17561
|
"@babel/helpers - typeof";
|
|
17562
17562
|
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o) {
|
|
@@ -17611,7 +17611,7 @@ function _objectSpread2(e) {
|
|
|
17611
17611
|
return e;
|
|
17612
17612
|
}
|
|
17613
17613
|
|
|
17614
|
-
// ../../../node_modules/.bun/@trpc+server@11.
|
|
17614
|
+
// ../../../node_modules/.bun/@trpc+server@11.28.0+431a08decb845963/node_modules/@trpc/server/dist/codes-BCsCCyMj.mjs
|
|
17615
17615
|
function isObject2(value) {
|
|
17616
17616
|
return !!value && !Array.isArray(value) && typeof value === "object";
|
|
17617
17617
|
}
|
|
@@ -17648,7 +17648,7 @@ var retryableRpcCodes = [
|
|
|
17648
17648
|
TRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR
|
|
17649
17649
|
];
|
|
17650
17650
|
|
|
17651
|
-
// ../../../node_modules/.bun/@trpc+server@11.
|
|
17651
|
+
// ../../../node_modules/.bun/@trpc+server@11.28.0+431a08decb845963/node_modules/@trpc/server/dist/getErrorShape-CVrl8_-w.mjs
|
|
17652
17652
|
var noop = () => {};
|
|
17653
17653
|
var freezeIfAvailable = (obj) => {
|
|
17654
17654
|
if (Object.freeze)
|
|
@@ -17751,7 +17751,7 @@ function _objectSpread22(e) {
|
|
|
17751
17751
|
return e;
|
|
17752
17752
|
}
|
|
17753
17753
|
|
|
17754
|
-
// ../../../node_modules/.bun/@trpc+server@11.
|
|
17754
|
+
// ../../../node_modules/.bun/@trpc+server@11.28.0+431a08decb845963/node_modules/@trpc/server/dist/asyncGeneratorDelegate-BRQGtkYG.mjs
|
|
17755
17755
|
function transformResultInner(response, transformer) {
|
|
17756
17756
|
if ("error" in response) {
|
|
17757
17757
|
const error = transformer.deserialize(response.error);
|
|
@@ -17847,7 +17847,7 @@ AsyncGenerator.prototype[typeof Symbol == "function" && Symbol.asyncIterator ||
|
|
|
17847
17847
|
};
|
|
17848
17848
|
var trackedSymbol = Symbol();
|
|
17849
17849
|
|
|
17850
|
-
// ../../../node_modules/.bun/@trpc+client@11.
|
|
17850
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.0+86c0a2ff0813b553/node_modules/@trpc/client/dist/TRPCClientError-DE6-fd1n.mjs
|
|
17851
17851
|
function isTRPCClientError(cause) {
|
|
17852
17852
|
return cause instanceof TRPCClientError;
|
|
17853
17853
|
}
|
|
@@ -17893,7 +17893,7 @@ var TRPCClientError = class TRPCClientError extends Error {
|
|
|
17893
17893
|
}
|
|
17894
17894
|
};
|
|
17895
17895
|
|
|
17896
|
-
// ../../../node_modules/.bun/@trpc+client@11.
|
|
17896
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.0+86c0a2ff0813b553/node_modules/@trpc/client/dist/unstable-internals.mjs
|
|
17897
17897
|
function getTransformer(transformer) {
|
|
17898
17898
|
const _transformer = transformer;
|
|
17899
17899
|
if (!_transformer)
|
|
@@ -17915,7 +17915,7 @@ function getTransformer(transformer) {
|
|
|
17915
17915
|
};
|
|
17916
17916
|
}
|
|
17917
17917
|
|
|
17918
|
-
// ../../../node_modules/.bun/@trpc+client@11.
|
|
17918
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.0+86c0a2ff0813b553/node_modules/@trpc/client/dist/httpUtils-CtMuyl9j.mjs
|
|
17919
17919
|
var isFunction2 = (fn) => typeof fn === "function";
|
|
17920
17920
|
function getFetch(customFetchImpl) {
|
|
17921
17921
|
if (customFetchImpl)
|
|
@@ -17963,6 +17963,23 @@ function raceAbortSignalsWithCleanup(...signals) {
|
|
|
17963
17963
|
cleanup
|
|
17964
17964
|
};
|
|
17965
17965
|
}
|
|
17966
|
+
var AbortError = class extends Error {
|
|
17967
|
+
constructor() {
|
|
17968
|
+
const name = "AbortError";
|
|
17969
|
+
super(name);
|
|
17970
|
+
this.name = name;
|
|
17971
|
+
this.message = name;
|
|
17972
|
+
}
|
|
17973
|
+
};
|
|
17974
|
+
var throwIfAborted = (signal) => {
|
|
17975
|
+
var _signal$throwIfAborte;
|
|
17976
|
+
if (!(signal === null || signal === undefined ? undefined : signal.aborted))
|
|
17977
|
+
return;
|
|
17978
|
+
(_signal$throwIfAborte = signal.throwIfAborted) === null || _signal$throwIfAborte === undefined || _signal$throwIfAborte.call(signal);
|
|
17979
|
+
if (typeof DOMException !== "undefined")
|
|
17980
|
+
throw new DOMException("AbortError", "AbortError");
|
|
17981
|
+
throw new AbortError;
|
|
17982
|
+
};
|
|
17966
17983
|
function resolveHTTPLinkOptions(opts) {
|
|
17967
17984
|
return {
|
|
17968
17985
|
url: opts.url.toString(),
|
|
@@ -18018,23 +18035,6 @@ var jsonHttpRequester = (opts) => {
|
|
|
18018
18035
|
getBody
|
|
18019
18036
|
}));
|
|
18020
18037
|
};
|
|
18021
|
-
var AbortError = class extends Error {
|
|
18022
|
-
constructor() {
|
|
18023
|
-
const name = "AbortError";
|
|
18024
|
-
super(name);
|
|
18025
|
-
this.name = name;
|
|
18026
|
-
this.message = name;
|
|
18027
|
-
}
|
|
18028
|
-
};
|
|
18029
|
-
var throwIfAborted = (signal) => {
|
|
18030
|
-
var _signal$throwIfAborte;
|
|
18031
|
-
if (!(signal === null || signal === undefined ? undefined : signal.aborted))
|
|
18032
|
-
return;
|
|
18033
|
-
(_signal$throwIfAborte = signal.throwIfAborted) === null || _signal$throwIfAborte === undefined || _signal$throwIfAborte.call(signal);
|
|
18034
|
-
if (typeof DOMException !== "undefined")
|
|
18035
|
-
throw new DOMException("AbortError", "AbortError");
|
|
18036
|
-
throw new AbortError;
|
|
18037
|
-
};
|
|
18038
18038
|
async function fetchHTTPResponse(opts) {
|
|
18039
18039
|
var _opts$methodOverride, _opts$trpcAcceptHeade;
|
|
18040
18040
|
throwIfAborted(opts.signal);
|
|
@@ -18068,7 +18068,7 @@ async function httpRequest(opts) {
|
|
|
18068
18068
|
};
|
|
18069
18069
|
}
|
|
18070
18070
|
|
|
18071
|
-
// ../../../node_modules/.bun/@trpc+client@11.
|
|
18071
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.0+86c0a2ff0813b553/node_modules/@trpc/client/dist/httpBatchLink-BkVNtNND.mjs
|
|
18072
18072
|
var throwFatalError = () => {
|
|
18073
18073
|
throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
|
|
18074
18074
|
};
|
|
@@ -18263,7 +18263,7 @@ function httpBatchLink(opts) {
|
|
|
18263
18263
|
};
|
|
18264
18264
|
}
|
|
18265
18265
|
|
|
18266
|
-
// ../../../node_modules/.bun/@trpc+client@11.
|
|
18266
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.0+86c0a2ff0813b553/node_modules/@trpc/client/dist/wsLink-BiIe_j6D.mjs
|
|
18267
18267
|
var resultOf = (value, ...args) => {
|
|
18268
18268
|
return typeof value === "function" ? value(...args) : value;
|
|
18269
18269
|
};
|
|
@@ -18416,7 +18416,7 @@ var WsConnection = class WsConnection {
|
|
|
18416
18416
|
};
|
|
18417
18417
|
_defineProperty(WsConnection, "connectCount", 0);
|
|
18418
18418
|
|
|
18419
|
-
// ../../../node_modules/.bun/@trpc+client@11.
|
|
18419
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.0+86c0a2ff0813b553/node_modules/@trpc/client/dist/index.mjs
|
|
18420
18420
|
var observerKeys = [
|
|
18421
18421
|
"onStarted",
|
|
18422
18422
|
"onData",
|
|
@@ -18916,12 +18916,19 @@ Usage:
|
|
|
18916
18916
|
et passport mine --event-id <id>
|
|
18917
18917
|
et passport login-options --event-id <id>
|
|
18918
18918
|
et passport bingo enable --event-id <id> (host: creates the hidden Bingo station and the HumanBingo)
|
|
18919
|
+
et passport bingo rename --event-id <id> --name <name> (host: the game's display name guests see; 1-100 chars, default "Human Bingo")
|
|
18919
18920
|
et passport bingo join --event-id <id> (guest, passport participants only)
|
|
18920
18921
|
et passport bingo claim-stamp --event-id <id> (guest: catch-up award for a completed card)
|
|
18921
18922
|
et passport bingo status --event-id <id> (guest: own bingo progress and stamp)
|
|
18922
18923
|
et passport export --event-id <id>
|
|
18923
18924
|
et passport settings update --event-id <id> --settings-json <json> (maxRedemptionsPerParticipant 0 = no cap)
|
|
18924
18925
|
et passport station upsert --event-id <id> --station-json <json> (collection.stampValue 0-1000, default 1; collection.category GAME|FOOD|DRINK|BINGO, default GAME)
|
|
18926
|
+
et passport skin get --event-id <id>
|
|
18927
|
+
et passport skin set --event-id <id> --appearance-version <n> --skin-json <json>
|
|
18928
|
+
et passport skin clear --event-id <id> --appearance-version <n>
|
|
18929
|
+
et passport skin upload --event-id <id> --kind <hero|logo> --file <path> --content-type <image-mime>
|
|
18930
|
+
et passport station image-set --event-id <id> --station-id <id> --file <path> --content-type <image-mime>
|
|
18931
|
+
et passport station image-clear --event-id <id> --station-id <id>
|
|
18925
18932
|
et passport station hidden --event-id <id> --station-id <id> --hidden <true|false>
|
|
18926
18933
|
et passport station archive --event-id <id> --station-id <id> --allow-state-change --target <same-event-id>
|
|
18927
18934
|
et passport station print-get --event-id <id> --station-id <id>
|
|
@@ -18945,7 +18952,7 @@ Usage:
|
|
|
18945
18952
|
et passport roster list --event-id <id> [--search <text>] [--limit <1-100>] [--cursor <cursor>]
|
|
18946
18953
|
et passport roster counts --event-id <id> [--search <text>]
|
|
18947
18954
|
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>]
|
|
18948
|
-
et passport roster upsert --event-id <id> --entry-json <json> ({id?,staffId,lastName,displayName})
|
|
18955
|
+
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)
|
|
18949
18956
|
et passport roster remove --event-id <id> --entry-id <id> --allow-state-change --target <same-event-id>
|
|
18950
18957
|
et passport roster purge --event-id <id> --allow-state-change --target <same-event-id>
|
|
18951
18958
|
|
|
@@ -18957,17 +18964,29 @@ Event Passport:
|
|
|
18957
18964
|
collection.category groups stations for guests: GAME, FOOD, DRINK or BINGO. Omit it to keep the stored one.
|
|
18958
18965
|
Omit collection on an existing station to preserve its current mode.
|
|
18959
18966
|
Station JSON supports id/name/description/location/imageKey/order/opensAt/closesAt/collection.
|
|
18967
|
+
Station cover art: image-set uploads a jpeg/png/webp/gif (up to 25 MB) to the event's station-art folder and
|
|
18968
|
+
saves it as the station's imageKey, keeping every other station setting; image-clear removes it. A new
|
|
18969
|
+
imageKey given in station JSON must be an upload to this event's event-passport/stations folder.
|
|
18970
|
+
Passport skin (optional per-event look; no skin renders the Go Labs default): lives in the event
|
|
18971
|
+
appearance as the optional passport block {heroImage:{key,focalX,focalY}|null, logo:{key}|null,
|
|
18972
|
+
colors:{graphic,dark}, emphasis:accent|ink}. skin get reads it with the version and image URLs.
|
|
18973
|
+
skin set is a version-fenced merge patch: --skin-json '{"heroImage":{"focalX":30}}' changes only the
|
|
18974
|
+
focal point; null clears heroImage or logo. skin upload --kind hero|logo returns the key to reference
|
|
18975
|
+
in skin set. skin clear returns the event to the Go Labs default look and keeps the rest of the appearance.
|
|
18976
|
+
Other appearance saves that omit passport keep the stored skin. colors.dark needs 4.5:1 contrast with white.
|
|
18960
18977
|
Date-time fields are ISO strings or null; order defaults to zero.
|
|
18961
18978
|
Settings JSON requires linkedDrawEventId, luckyDrawStampThreshold, prizeStampThreshold,
|
|
18962
|
-
maxRedemptionsPerParticipant; optional loginMethods is {emailOtp,google,guest,staffId}.
|
|
18963
|
-
Keep email OTP, Google or Staff ID enabled for recovery; staffId defaults to false
|
|
18979
|
+
maxRedemptionsPerParticipant; optional loginMethods is {emailOtp,google,guest,staffId,staffIdRequiresLastName}.
|
|
18980
|
+
Keep email OTP, Google or Staff ID enabled for recovery; staffId defaults to false and
|
|
18981
|
+
staffIdRequiresLastName to true, so set it false again whenever you resend loginMethods.
|
|
18964
18982
|
Omit loginMethods to preserve it.
|
|
18965
18983
|
Staff roster (event hosts only): import replaces the roster and returns imported, replaced and
|
|
18966
18984
|
rejected rows (blank, too long, or a Staff ID repeated in the file). Columns are matched from
|
|
18967
18985
|
header names; override with the column flags. Without a last-name column, the last name is
|
|
18968
18986
|
taken from the full name (--surname-position last|first, default last). Files over 20,000 data
|
|
18969
|
-
rows or 200 columns, or with no importable rows, are refused and the roster is unchanged.
|
|
18970
|
-
|
|
18987
|
+
rows or 200 columns, or with no importable rows, are refused and the roster is unchanged. A blank
|
|
18988
|
+
last name is rejected only when the event requires one; counts reports missingLastNameCount.
|
|
18989
|
+
Staff ID sign-in matches case-insensitively, ignoring spaces and punctuation, and needs the browser.
|
|
18971
18990
|
Printed QR issue/revoke requires the last observed print version; stale versions conflict.
|
|
18972
18991
|
claim scans a station QR; collect scans a participant profile QR as an event operator.
|
|
18973
18992
|
Repeat scans never add a second stamp or change its original points.
|
|
@@ -19425,8 +19444,8 @@ var runLuckyDrawSetupCommand = async (input) => {
|
|
|
19425
19444
|
};
|
|
19426
19445
|
|
|
19427
19446
|
// src/commands/passport.ts
|
|
19428
|
-
import { readFile as
|
|
19429
|
-
import { basename as
|
|
19447
|
+
import { readFile as readFile5 } from "fs/promises";
|
|
19448
|
+
import { basename as basename3 } from "path";
|
|
19430
19449
|
|
|
19431
19450
|
// ../utils/src/lib/spreadsheet-table.ts
|
|
19432
19451
|
var import_jszip = __toESM(require_lib3(), 1);
|
|
@@ -19588,7 +19607,8 @@ var passportLoginMethodsSchema = object({
|
|
|
19588
19607
|
emailOtp: boolean2(),
|
|
19589
19608
|
google: boolean2(),
|
|
19590
19609
|
guest: boolean2(),
|
|
19591
|
-
staffId: boolean2().default(false)
|
|
19610
|
+
staffId: boolean2().default(false),
|
|
19611
|
+
staffIdRequiresLastName: boolean2().default(true)
|
|
19592
19612
|
}).strict().refine((methods) => methods.emailOtp || methods.google || methods.staffId, {
|
|
19593
19613
|
message: "Keep email OTP, Google or Staff ID available for passport recovery."
|
|
19594
19614
|
});
|
|
@@ -19719,6 +19739,9 @@ var passportSettingsSchema = passportEventIdSchema.extend({
|
|
|
19719
19739
|
linkedDrawEventId: string2().min(1).nullable(),
|
|
19720
19740
|
loginMethods: passportLoginMethodsSchema.optional()
|
|
19721
19741
|
});
|
|
19742
|
+
var renamePassportBingoSchema = passportEventIdSchema.extend({
|
|
19743
|
+
name: string2().trim().min(1).max(100)
|
|
19744
|
+
});
|
|
19722
19745
|
var passportStationSchema = passportEventIdSchema.extend({
|
|
19723
19746
|
id: string2().optional(),
|
|
19724
19747
|
name: string2().trim().min(1).max(100),
|
|
@@ -19756,11 +19779,15 @@ var rosterStaffIdSchema = string2().trim().min(1, "Enter a Staff ID.").max(PASSP
|
|
|
19756
19779
|
var rosterLastNameSchema = string2().trim().min(1, "Enter a last name.").max(PASSPORT_ROSTER_NAME_MAX).refine((value) => normalizePassportRosterKey(value) !== "", {
|
|
19757
19780
|
message: "Last name needs at least one letter or digit."
|
|
19758
19781
|
});
|
|
19759
|
-
var
|
|
19782
|
+
var rosterOptionalLastNameSchema = string2().trim().max(PASSPORT_ROSTER_NAME_MAX).nullable().transform((value) => value || null).refine((value) => value === null || normalizePassportRosterKey(value) !== "", { message: "Last name needs at least one letter or digit." });
|
|
19783
|
+
var passportStaffIdSignInSchema = passportEventIdSchema.extend({
|
|
19784
|
+
staffId: rosterStaffIdSchema,
|
|
19785
|
+
lastName: rosterLastNameSchema.optional()
|
|
19786
|
+
}).strict();
|
|
19760
19787
|
var passportRosterEntrySchema = passportEventIdSchema.extend({
|
|
19761
19788
|
id: string2().min(1).optional(),
|
|
19762
19789
|
staffId: rosterStaffIdSchema,
|
|
19763
|
-
lastName:
|
|
19790
|
+
lastName: rosterOptionalLastNameSchema,
|
|
19764
19791
|
displayName: string2().trim().max(PASSPORT_ROSTER_NAME_MAX).nullable().transform((value) => value || null)
|
|
19765
19792
|
}).strict();
|
|
19766
19793
|
var passportRosterEntryIdSchema = passportEventIdSchema.extend({ entryId: string2().min(1) }).strict();
|
|
@@ -19791,7 +19818,7 @@ var surnameOf = (fullName, position) => {
|
|
|
19791
19818
|
const words = fullName.split(/\s+/).filter(Boolean);
|
|
19792
19819
|
return (position === "first" ? words[0] : words.at(-1)) ?? "";
|
|
19793
19820
|
};
|
|
19794
|
-
var assertPassportRosterMapping = (mapping, columnCount) => {
|
|
19821
|
+
var assertPassportRosterMapping = (mapping, columnCount, requireLastName) => {
|
|
19795
19822
|
const columns = [
|
|
19796
19823
|
mapping.staffId,
|
|
19797
19824
|
mapping.lastName,
|
|
@@ -19800,11 +19827,11 @@ var assertPassportRosterMapping = (mapping, columnCount) => {
|
|
|
19800
19827
|
];
|
|
19801
19828
|
if (columns.some((index) => index !== null && (!Number.isInteger(index) || index < 0 || index >= columnCount)))
|
|
19802
19829
|
throw new Error("A mapped column is not in the file.");
|
|
19803
|
-
if (mapping.lastName === null && mapping.fullName === null)
|
|
19830
|
+
if (requireLastName && mapping.lastName === null && mapping.fullName === null)
|
|
19804
19831
|
throw new Error("Map a Last Name column or a Full Name column.");
|
|
19805
19832
|
};
|
|
19806
|
-
var mapPassportRosterTable = (table, mapping) => {
|
|
19807
|
-
assertPassportRosterMapping(mapping, table[0]?.length ?? 0);
|
|
19833
|
+
var mapPassportRosterTable = (table, mapping, { requireLastName }) => {
|
|
19834
|
+
assertPassportRosterMapping(mapping, table[0]?.length ?? 0, requireLastName);
|
|
19808
19835
|
const rows = [];
|
|
19809
19836
|
table.slice(1).forEach((row, index) => {
|
|
19810
19837
|
if (row.every((value) => value.trim() === ""))
|
|
@@ -19844,6 +19871,371 @@ var guessPassportRosterMapping = (headers) => {
|
|
|
19844
19871
|
};
|
|
19845
19872
|
};
|
|
19846
19873
|
|
|
19874
|
+
// src/commands/passport-media.ts
|
|
19875
|
+
import { readFile as readFile4 } from "fs/promises";
|
|
19876
|
+
import { basename as basename2 } from "path";
|
|
19877
|
+
|
|
19878
|
+
// ../utils/src/lib/event-s3-upload.ts
|
|
19879
|
+
var MAX_EVENT_IMAGE_UPLOAD_BYTES = 25 * 1024 * 1024;
|
|
19880
|
+
var MAX_EVENT_VIDEO_UPLOAD_BYTES = 200 * 1024 * 1024;
|
|
19881
|
+
var MAX_HUMAN_BINGO_MEDIA_UPLOAD_BYTES = 1024 * 1024 * 1024;
|
|
19882
|
+
var SAFE_IMAGE_CONTENT_TYPES = [
|
|
19883
|
+
"image/jpeg",
|
|
19884
|
+
"image/png",
|
|
19885
|
+
"image/webp",
|
|
19886
|
+
"image/gif"
|
|
19887
|
+
];
|
|
19888
|
+
var VIDEO_CONTENT_TYPES = [
|
|
19889
|
+
"video/mp4",
|
|
19890
|
+
"video/quicktime",
|
|
19891
|
+
"video/webm",
|
|
19892
|
+
"video/ogg"
|
|
19893
|
+
];
|
|
19894
|
+
var SAFE_EVENT_IMAGE_CONTENT_TYPES = [
|
|
19895
|
+
...SAFE_IMAGE_CONTENT_TYPES
|
|
19896
|
+
];
|
|
19897
|
+
var SAFE_EVENT_VIDEO_CONTENT_TYPES = [...VIDEO_CONTENT_TYPES];
|
|
19898
|
+
var SAFE_EVENT_UPLOAD_CONTENT_TYPES = [
|
|
19899
|
+
...SAFE_IMAGE_CONTENT_TYPES,
|
|
19900
|
+
...VIDEO_CONTENT_TYPES
|
|
19901
|
+
];
|
|
19902
|
+
var getEventPassportUploadBaseFolder = (kind) => `event-passport/${kind}`;
|
|
19903
|
+
|
|
19904
|
+
// ../utils/src/lib/event-theme.ts
|
|
19905
|
+
var EVENT_TECH_EVENT_TYPES = Object.values(EventType);
|
|
19906
|
+
var HEX_COLOR_PATTERN = /^#[0-9a-f]{6}$/i;
|
|
19907
|
+
var isEventThemeHexColor = (value) => HEX_COLOR_PATTERN.test(value);
|
|
19908
|
+
|
|
19909
|
+
// ../utils/src/lib/passport-skin.ts
|
|
19910
|
+
var DEFAULT_PASSPORT_SKIN_SETTINGS = {
|
|
19911
|
+
heroImage: null,
|
|
19912
|
+
logo: null,
|
|
19913
|
+
colors: { graphic: null, dark: null },
|
|
19914
|
+
emphasis: "accent"
|
|
19915
|
+
};
|
|
19916
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19917
|
+
var toKey = (value) => typeof value === "string" && value.trim().length > 0 ? value.trim() : null;
|
|
19918
|
+
var toPercent = (value) => typeof value === "number" && Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 50;
|
|
19919
|
+
var toHex = (value) => typeof value === "string" && isEventThemeHexColor(value) ? value.toLowerCase() : null;
|
|
19920
|
+
var readHeroImage = (value) => {
|
|
19921
|
+
if (!isRecord(value))
|
|
19922
|
+
return null;
|
|
19923
|
+
const key = toKey(value.key);
|
|
19924
|
+
if (!key)
|
|
19925
|
+
return null;
|
|
19926
|
+
return {
|
|
19927
|
+
key,
|
|
19928
|
+
focalX: toPercent(value.focalX),
|
|
19929
|
+
focalY: toPercent(value.focalY)
|
|
19930
|
+
};
|
|
19931
|
+
};
|
|
19932
|
+
var readLogo = (value) => {
|
|
19933
|
+
if (!isRecord(value))
|
|
19934
|
+
return null;
|
|
19935
|
+
const key = toKey(value.key);
|
|
19936
|
+
return key ? { key } : null;
|
|
19937
|
+
};
|
|
19938
|
+
var resolvePassportSkinSettings = (value) => {
|
|
19939
|
+
if (!isRecord(value))
|
|
19940
|
+
return DEFAULT_PASSPORT_SKIN_SETTINGS;
|
|
19941
|
+
const colors = isRecord(value.colors) ? value.colors : {};
|
|
19942
|
+
return {
|
|
19943
|
+
heroImage: readHeroImage(value.heroImage),
|
|
19944
|
+
logo: readLogo(value.logo),
|
|
19945
|
+
colors: { graphic: toHex(colors.graphic), dark: toHex(colors.dark) },
|
|
19946
|
+
emphasis: value.emphasis === "ink" ? "ink" : "accent"
|
|
19947
|
+
};
|
|
19948
|
+
};
|
|
19949
|
+
var resolvePassportSkinSettingsFromAppearance = (appearance) => resolvePassportSkinSettings(isRecord(appearance) ? appearance.passport : undefined);
|
|
19950
|
+
|
|
19951
|
+
// ../validators/src/photo-wall-screen.schema.ts
|
|
19952
|
+
var photoWallScreenSchema = object({
|
|
19953
|
+
width: number2().int().min(240).max(16384),
|
|
19954
|
+
height: number2().int().min(240).max(16384)
|
|
19955
|
+
});
|
|
19956
|
+
|
|
19957
|
+
// ../validators/src/photo-wall-submission-settings.schema.ts
|
|
19958
|
+
var photoWallSubmissionSettingsSchema = object({
|
|
19959
|
+
mode: _enum(["photo-only", "comment-only", "photo-and-comment"]),
|
|
19960
|
+
photoRequired: boolean2(),
|
|
19961
|
+
commentRequired: boolean2()
|
|
19962
|
+
});
|
|
19963
|
+
var DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS = {
|
|
19964
|
+
mode: "photo-and-comment",
|
|
19965
|
+
photoRequired: true,
|
|
19966
|
+
commentRequired: false
|
|
19967
|
+
};
|
|
19968
|
+
|
|
19969
|
+
// ../validators/src/event-appearance.schema.ts
|
|
19970
|
+
var hexColorSchema = string2().trim().regex(/^#[0-9a-f]{6}$/i, "Color must be a six-digit hex color").transform((value) => value.toLowerCase());
|
|
19971
|
+
var getRelativeLuminance = (color) => {
|
|
19972
|
+
const toLinear = (channel) => {
|
|
19973
|
+
const normalized = channel / 255;
|
|
19974
|
+
return normalized <= 0.04045 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
|
|
19975
|
+
};
|
|
19976
|
+
const red = toLinear(Number.parseInt(color.slice(1, 3), 16));
|
|
19977
|
+
const green = toLinear(Number.parseInt(color.slice(3, 5), 16));
|
|
19978
|
+
const blue = toLinear(Number.parseInt(color.slice(5, 7), 16));
|
|
19979
|
+
return 0.2126 * red + 0.7152 * green + 0.0722 * blue;
|
|
19980
|
+
};
|
|
19981
|
+
var hasReadableTextContrast = (textColor, backgroundColor) => {
|
|
19982
|
+
const textLuminance = getRelativeLuminance(textColor);
|
|
19983
|
+
const backgroundLuminance = getRelativeLuminance(backgroundColor);
|
|
19984
|
+
return (Math.max(textLuminance, backgroundLuminance) + 0.05) / (Math.min(textLuminance, backgroundLuminance) + 0.05) >= 4.5;
|
|
19985
|
+
};
|
|
19986
|
+
var eventThemeSchema = object({
|
|
19987
|
+
accentColor: hexColorSchema,
|
|
19988
|
+
backgroundColor: hexColorSchema,
|
|
19989
|
+
textColor: hexColorSchema,
|
|
19990
|
+
fontFamily: _enum(["SYSTEM", "JAKARTA", "SERIF"])
|
|
19991
|
+
}).superRefine((theme, context) => {
|
|
19992
|
+
if (!hasReadableTextContrast(theme.textColor, theme.backgroundColor)) {
|
|
19993
|
+
context.addIssue({
|
|
19994
|
+
code: "custom",
|
|
19995
|
+
message: "Text color must have at least 4.5:1 contrast on the background color",
|
|
19996
|
+
path: ["textColor"]
|
|
19997
|
+
});
|
|
19998
|
+
}
|
|
19999
|
+
});
|
|
20000
|
+
var appearanceMediaSchema = discriminatedUnion("type", [
|
|
20001
|
+
object({ type: literal("none"), key: _null3() }),
|
|
20002
|
+
object({ type: literal("image"), key: string2().min(1).max(1024) })
|
|
20003
|
+
]);
|
|
20004
|
+
var displayMediaSchema = discriminatedUnion("type", [
|
|
20005
|
+
object({ type: literal("none"), key: _null3() }),
|
|
20006
|
+
object({ type: literal("image"), key: string2().min(1).max(1024) }),
|
|
20007
|
+
object({ type: literal("video"), key: string2().min(1).max(1024) })
|
|
20008
|
+
]);
|
|
20009
|
+
var passportImageKeySchema = string2().trim().min(1).max(1024);
|
|
20010
|
+
var passportFocalSchema = number2().min(0).max(100);
|
|
20011
|
+
var passportSkinSchema = object({
|
|
20012
|
+
heroImage: object({
|
|
20013
|
+
key: passportImageKeySchema,
|
|
20014
|
+
focalX: passportFocalSchema.default(50),
|
|
20015
|
+
focalY: passportFocalSchema.default(50)
|
|
20016
|
+
}).nullable().default(null),
|
|
20017
|
+
logo: object({ key: passportImageKeySchema }).nullable().default(null),
|
|
20018
|
+
colors: object({
|
|
20019
|
+
graphic: hexColorSchema.nullable().default(null),
|
|
20020
|
+
dark: hexColorSchema.nullable().default(null).refine((color) => color === null || hasReadableTextContrast("#ffffff", color), "Dark colour must have at least 4.5:1 contrast with white text")
|
|
20021
|
+
}).default({ graphic: null, dark: null }),
|
|
20022
|
+
emphasis: _enum(["accent", "ink"]).default("accent")
|
|
20023
|
+
});
|
|
20024
|
+
var eventAppearanceSchema = object({
|
|
20025
|
+
version: literal(1),
|
|
20026
|
+
theme: eventThemeSchema,
|
|
20027
|
+
guestBackground: appearanceMediaSchema,
|
|
20028
|
+
displayBackground: displayMediaSchema,
|
|
20029
|
+
passport: passportSkinSchema.optional(),
|
|
20030
|
+
photoWall: object({
|
|
20031
|
+
durationSeconds: number2().int().min(10).max(40),
|
|
20032
|
+
maxVisible: number2().int().min(1).max(16),
|
|
20033
|
+
motion: _enum(["gentle", "lively", "roaming"]),
|
|
20034
|
+
showQrCode: boolean2(),
|
|
20035
|
+
qrCodeLabel: string2().trim().max(80, "QR code text must be 80 characters or fewer").transform((value) => value || "Scan to share").default("Scan to share"),
|
|
20036
|
+
showEventName: boolean2(),
|
|
20037
|
+
screen: photoWallScreenSchema.nullable().default(null),
|
|
20038
|
+
submission: photoWallSubmissionSettingsSchema.default(DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS)
|
|
20039
|
+
})
|
|
20040
|
+
});
|
|
20041
|
+
var DEFAULT_PASSPORT_SKIN = {
|
|
20042
|
+
heroImage: null,
|
|
20043
|
+
logo: null,
|
|
20044
|
+
colors: { graphic: null, dark: null },
|
|
20045
|
+
emphasis: "accent"
|
|
20046
|
+
};
|
|
20047
|
+
var DEFAULT_EVENT_APPEARANCE2 = {
|
|
20048
|
+
version: 1,
|
|
20049
|
+
theme: {
|
|
20050
|
+
accentColor: "#f84404",
|
|
20051
|
+
backgroundColor: "#f6f7f9",
|
|
20052
|
+
textColor: "#20242a",
|
|
20053
|
+
fontFamily: "SYSTEM"
|
|
20054
|
+
},
|
|
20055
|
+
guestBackground: { type: "none", key: null },
|
|
20056
|
+
displayBackground: { type: "none", key: null },
|
|
20057
|
+
photoWall: {
|
|
20058
|
+
durationSeconds: 18,
|
|
20059
|
+
maxVisible: 4,
|
|
20060
|
+
motion: "gentle",
|
|
20061
|
+
showQrCode: true,
|
|
20062
|
+
qrCodeLabel: "Scan to share",
|
|
20063
|
+
showEventName: true,
|
|
20064
|
+
screen: null,
|
|
20065
|
+
submission: DEFAULT_PHOTO_WALL_SUBMISSION_SETTINGS
|
|
20066
|
+
}
|
|
20067
|
+
};
|
|
20068
|
+
|
|
20069
|
+
// src/commands/passport-media.ts
|
|
20070
|
+
var IMAGE_CONTENT_TYPES = [
|
|
20071
|
+
"image/jpeg",
|
|
20072
|
+
"image/png",
|
|
20073
|
+
"image/webp",
|
|
20074
|
+
"image/gif"
|
|
20075
|
+
];
|
|
20076
|
+
var PASSPORT_SKIN_UPLOAD_KINDS = ["hero", "logo"];
|
|
20077
|
+
var requiredValue = (flags, name) => {
|
|
20078
|
+
const value = flags.get(name);
|
|
20079
|
+
if (typeof value !== "string" || value === "")
|
|
20080
|
+
throw new CliUsageError(`--${name} is required and needs a value.`);
|
|
20081
|
+
return value;
|
|
20082
|
+
};
|
|
20083
|
+
var nonnegativeInteger = (value, name) => {
|
|
20084
|
+
const parsed = Number(value);
|
|
20085
|
+
if (!/^\d+$/.test(value) || !Number.isSafeInteger(parsed))
|
|
20086
|
+
throw new CliUsageError(`--${name} must be a non-negative whole number.`);
|
|
20087
|
+
return parsed;
|
|
20088
|
+
};
|
|
20089
|
+
var isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
20090
|
+
var parseJsonRecord = (raw, name) => {
|
|
20091
|
+
let parsed;
|
|
20092
|
+
try {
|
|
20093
|
+
parsed = JSON.parse(raw);
|
|
20094
|
+
} catch {
|
|
20095
|
+
throw new CliUsageError(`--${name} must be valid JSON.`);
|
|
20096
|
+
}
|
|
20097
|
+
if (!isRecord2(parsed))
|
|
20098
|
+
throw new CliUsageError(`--${name} must be a JSON object.`);
|
|
20099
|
+
return parsed;
|
|
20100
|
+
};
|
|
20101
|
+
var mergeSkinPatch = (current, patch) => {
|
|
20102
|
+
const allowed = ["heroImage", "logo", "colors", "emphasis"];
|
|
20103
|
+
if (Object.keys(patch).some((key) => !allowed.includes(key)))
|
|
20104
|
+
throw new CliUsageError(`--skin-json supports only: ${allowed.join(", ")}.`);
|
|
20105
|
+
const merged = {
|
|
20106
|
+
heroImage: patch.heroImage === undefined ? current.heroImage : isRecord2(patch.heroImage) ? { ...current.heroImage, ...patch.heroImage } : patch.heroImage,
|
|
20107
|
+
logo: patch.logo === undefined ? current.logo : isRecord2(patch.logo) ? { ...current.logo, ...patch.logo } : patch.logo,
|
|
20108
|
+
colors: isRecord2(patch.colors) ? { ...current.colors, ...patch.colors } : patch.colors ?? current.colors,
|
|
20109
|
+
emphasis: patch.emphasis ?? current.emphasis
|
|
20110
|
+
};
|
|
20111
|
+
const parsed = passportSkinSchema.safeParse(merged);
|
|
20112
|
+
if (!parsed.success)
|
|
20113
|
+
throw new CliUsageError(`Invalid passport skin: ${parsed.error.issues.map((issue) => `${issue.path.join(".") || "skin"}: ${issue.message}`).join("; ")}`);
|
|
20114
|
+
return parsed.data;
|
|
20115
|
+
};
|
|
20116
|
+
var readCanonicalAppearance = async (eventId) => {
|
|
20117
|
+
const projection = await api2.event.getEventAppearance.query({ eventId });
|
|
20118
|
+
const appearance = eventAppearanceSchema.parse(projection.appearance ?? DEFAULT_EVENT_APPEARANCE2);
|
|
20119
|
+
return { projection, appearance };
|
|
20120
|
+
};
|
|
20121
|
+
var getPassportSkin = async (eventId) => {
|
|
20122
|
+
const { projection, appearance } = await readCanonicalAppearance(eventId);
|
|
20123
|
+
return {
|
|
20124
|
+
appearanceVersion: projection.appearanceVersion,
|
|
20125
|
+
hasCustomAppearance: projection.hasCustomAppearance,
|
|
20126
|
+
passport: resolvePassportSkinSettingsFromAppearance(appearance),
|
|
20127
|
+
passportHeroImageUrl: projection.passportHeroImageUrl,
|
|
20128
|
+
passportLogoUrl: projection.passportLogoUrl
|
|
20129
|
+
};
|
|
20130
|
+
};
|
|
20131
|
+
var saveSkin = async (eventId, appearanceVersion, buildSkin) => {
|
|
20132
|
+
const { projection, appearance } = await readCanonicalAppearance(eventId);
|
|
20133
|
+
if (projection.appearanceVersion !== appearanceVersion)
|
|
20134
|
+
throw new CliUsageError(`The appearance is at version ${projection.appearanceVersion}, not ${appearanceVersion}. Read it with \`et passport skin get\` and retry.`);
|
|
20135
|
+
const next = {
|
|
20136
|
+
...appearance,
|
|
20137
|
+
passport: buildSkin(resolvePassportSkinSettingsFromAppearance(appearance))
|
|
20138
|
+
};
|
|
20139
|
+
return api2.event.updateEventAppearance.mutate({
|
|
20140
|
+
eventId,
|
|
20141
|
+
appearance: next,
|
|
20142
|
+
appearanceVersion
|
|
20143
|
+
});
|
|
20144
|
+
};
|
|
20145
|
+
var isUploadKind = (kinds, value) => kinds.some((kind) => kind === value);
|
|
20146
|
+
var uploadPassportImage = async (eventId, kind, flags) => {
|
|
20147
|
+
const filePath = requiredValue(flags, "file");
|
|
20148
|
+
const contentType = requiredValue(flags, "content-type");
|
|
20149
|
+
if (!IMAGE_CONTENT_TYPES.some((allowed) => allowed === contentType))
|
|
20150
|
+
throw new CliUsageError(`--content-type must be one of: ${IMAGE_CONTENT_TYPES.join(", ")}.`);
|
|
20151
|
+
const file = await readFile4(filePath);
|
|
20152
|
+
if (file.byteLength > MAX_EVENT_IMAGE_UPLOAD_BYTES)
|
|
20153
|
+
throw new CliUsageError("The image must be 25 MB or smaller.");
|
|
20154
|
+
const signed = await api2.attachment.getPresignedUrlToUpload.mutate({
|
|
20155
|
+
folder: getEventPassportUploadBaseFolder(kind),
|
|
20156
|
+
fileName: basename2(filePath),
|
|
20157
|
+
contentType,
|
|
20158
|
+
size: file.byteLength,
|
|
20159
|
+
eventId
|
|
20160
|
+
});
|
|
20161
|
+
const uploadResponse = await fetch(signed.uploadUrl, {
|
|
20162
|
+
method: "PUT",
|
|
20163
|
+
headers: { "content-type": contentType },
|
|
20164
|
+
body: file
|
|
20165
|
+
});
|
|
20166
|
+
if (!uploadResponse.ok)
|
|
20167
|
+
throw new Error(`Passport image upload failed with HTTP ${uploadResponse.status}.`);
|
|
20168
|
+
return signed;
|
|
20169
|
+
};
|
|
20170
|
+
var createSkinOperation = (subcommand, { eventId, flags, allowed }) => {
|
|
20171
|
+
switch (subcommand) {
|
|
20172
|
+
case "get":
|
|
20173
|
+
return () => getPassportSkin(eventId);
|
|
20174
|
+
case "set": {
|
|
20175
|
+
allowed.push("appearance-version", "skin-json");
|
|
20176
|
+
const version = nonnegativeInteger(requiredValue(flags, "appearance-version"), "appearance-version");
|
|
20177
|
+
const patch = parseJsonRecord(requiredValue(flags, "skin-json"), "skin-json");
|
|
20178
|
+
return () => saveSkin(eventId, version, (current) => mergeSkinPatch(current, patch));
|
|
20179
|
+
}
|
|
20180
|
+
case "clear": {
|
|
20181
|
+
allowed.push("appearance-version");
|
|
20182
|
+
const version = nonnegativeInteger(requiredValue(flags, "appearance-version"), "appearance-version");
|
|
20183
|
+
return () => saveSkin(eventId, version, () => DEFAULT_PASSPORT_SKIN);
|
|
20184
|
+
}
|
|
20185
|
+
case "upload": {
|
|
20186
|
+
allowed.push("kind", "file", "content-type");
|
|
20187
|
+
const kind = requiredValue(flags, "kind");
|
|
20188
|
+
if (!isUploadKind(PASSPORT_SKIN_UPLOAD_KINDS, kind))
|
|
20189
|
+
throw new CliUsageError(`--kind must be one of: ${PASSPORT_SKIN_UPLOAD_KINDS.join(", ")}.`);
|
|
20190
|
+
return () => uploadPassportImage(eventId, kind, flags);
|
|
20191
|
+
}
|
|
20192
|
+
default:
|
|
20193
|
+
return null;
|
|
20194
|
+
}
|
|
20195
|
+
};
|
|
20196
|
+
var setStationImage = async (eventId, stationId, imageKey) => {
|
|
20197
|
+
const overview = await api2.event.passport.getPassportOverview.query({
|
|
20198
|
+
eventId
|
|
20199
|
+
});
|
|
20200
|
+
const station = overview.stations.find((item) => item.id === stationId);
|
|
20201
|
+
if (!station)
|
|
20202
|
+
throw new CliUsageError("Station not found for this event.");
|
|
20203
|
+
return api2.event.passport.upsertPassportStation.mutate({
|
|
20204
|
+
eventId,
|
|
20205
|
+
id: station.id,
|
|
20206
|
+
name: station.name,
|
|
20207
|
+
description: station.description,
|
|
20208
|
+
location: station.location,
|
|
20209
|
+
imageKey: imageKey ? await imageKey() : null,
|
|
20210
|
+
order: station.order,
|
|
20211
|
+
opensAt: station.opensAt,
|
|
20212
|
+
closesAt: station.closesAt
|
|
20213
|
+
});
|
|
20214
|
+
};
|
|
20215
|
+
var createStationImageOperation = (subcommand, { eventId, flags, allowed }) => {
|
|
20216
|
+
if (subcommand !== "image-set" && subcommand !== "image-clear")
|
|
20217
|
+
return null;
|
|
20218
|
+
allowed.push("station-id");
|
|
20219
|
+
const stationId = requiredValue(flags, "station-id");
|
|
20220
|
+
if (subcommand === "image-clear")
|
|
20221
|
+
return () => setStationImage(eventId, stationId, null);
|
|
20222
|
+
allowed.push("file", "content-type");
|
|
20223
|
+
requiredValue(flags, "file");
|
|
20224
|
+
requiredValue(flags, "content-type");
|
|
20225
|
+
return () => setStationImage(eventId, stationId, async () => {
|
|
20226
|
+
const signed = await uploadPassportImage(eventId, "stations", flags);
|
|
20227
|
+
return signed.key;
|
|
20228
|
+
});
|
|
20229
|
+
};
|
|
20230
|
+
var createPassportMediaOperation = (action, context) => {
|
|
20231
|
+
const [first, second] = action.split(" ");
|
|
20232
|
+
if (first === "skin" && second)
|
|
20233
|
+
return createSkinOperation(second, context);
|
|
20234
|
+
if (first === "station" && second)
|
|
20235
|
+
return createStationImageOperation(second, context);
|
|
20236
|
+
return null;
|
|
20237
|
+
};
|
|
20238
|
+
|
|
19847
20239
|
// src/commands/passport.ts
|
|
19848
20240
|
var flag = (flags, name, required = true) => {
|
|
19849
20241
|
const value = flags.get(name);
|
|
@@ -20008,14 +20400,15 @@ var parsePassportSettingsInput = (raw, eventId) => {
|
|
|
20008
20400
|
let loginMethods;
|
|
20009
20401
|
if (value.loginMethods !== undefined) {
|
|
20010
20402
|
const methods = object2(value.loginMethods, "loginMethods");
|
|
20011
|
-
keys(methods, ["emailOtp", "google", "guest", "staffId"], "loginMethods");
|
|
20012
|
-
if (typeof methods.emailOtp !== "boolean" || typeof methods.google !== "boolean" || typeof methods.guest !== "boolean" || methods.staffId !== undefined && typeof methods.staffId !== "boolean")
|
|
20403
|
+
keys(methods, ["emailOtp", "google", "guest", "staffId", "staffIdRequiresLastName"], "loginMethods");
|
|
20404
|
+
if (typeof methods.emailOtp !== "boolean" || typeof methods.google !== "boolean" || typeof methods.guest !== "boolean" || methods.staffId !== undefined && typeof methods.staffId !== "boolean" || methods.staffIdRequiresLastName !== undefined && typeof methods.staffIdRequiresLastName !== "boolean")
|
|
20013
20405
|
throw new CliUsageError("loginMethods values must be JSON booleans.");
|
|
20014
20406
|
loginMethods = {
|
|
20015
20407
|
emailOtp: methods.emailOtp,
|
|
20016
20408
|
google: methods.google,
|
|
20017
20409
|
guest: methods.guest,
|
|
20018
|
-
staffId: methods.staffId === true
|
|
20410
|
+
staffId: methods.staffId === true,
|
|
20411
|
+
staffIdRequiresLastName: methods.staffIdRequiresLastName !== false
|
|
20019
20412
|
};
|
|
20020
20413
|
if (!loginMethods.emailOtp && !loginMethods.google && !loginMethods.staffId)
|
|
20021
20414
|
throw new CliUsageError("Keep email OTP, Google or Staff ID available for recovery.");
|
|
@@ -20034,11 +20427,13 @@ var parsePassportSettingsInput = (raw, eventId) => {
|
|
|
20034
20427
|
var parsePassportRosterEntryInput = (raw, eventId) => {
|
|
20035
20428
|
const value = json(raw, "--entry-json");
|
|
20036
20429
|
keys(value, ["id", "staffId", "lastName", "displayName"], "Roster entry");
|
|
20430
|
+
if (value.lastName === undefined)
|
|
20431
|
+
throw new CliUsageError("lastName is required (use null for none).");
|
|
20037
20432
|
return {
|
|
20038
20433
|
eventId,
|
|
20039
20434
|
...value.id === undefined ? {} : { id: text(value.id, "id", 200) },
|
|
20040
20435
|
staffId: text(value.staffId, "staffId", 64),
|
|
20041
|
-
lastName:
|
|
20436
|
+
lastName: nullableText(value.lastName, "lastName", 100) || null,
|
|
20042
20437
|
displayName: nullableText(value.displayName, "displayName", 100) || null
|
|
20043
20438
|
};
|
|
20044
20439
|
};
|
|
@@ -20049,7 +20444,7 @@ var headerIndex = (headers, name) => {
|
|
|
20049
20444
|
throw new CliUsageError(`Column "${name}" is not in the file. Headers: ${headers.join(", ")}.`);
|
|
20050
20445
|
return index;
|
|
20051
20446
|
};
|
|
20052
|
-
var resolvePassportRosterMapping = (headers, flags) => {
|
|
20447
|
+
var resolvePassportRosterMapping = (headers, flags, requireLastName) => {
|
|
20053
20448
|
const guess = guessPassportRosterMapping(headers);
|
|
20054
20449
|
const column = (name, fallback) => {
|
|
20055
20450
|
const value = flag(flags, name, false);
|
|
@@ -20068,20 +20463,20 @@ var resolvePassportRosterMapping = (headers, flags) => {
|
|
|
20068
20463
|
displayName: column("display-name-column", guess.displayName),
|
|
20069
20464
|
surnamePosition: position
|
|
20070
20465
|
};
|
|
20071
|
-
if (mapping.lastName === null && mapping.fullName === null)
|
|
20466
|
+
if (requireLastName && mapping.lastName === null && mapping.fullName === null)
|
|
20072
20467
|
throw new CliUsageError("Map a last-name column (--last-name-column) or a full-name column (--full-name-column).");
|
|
20073
20468
|
return mapping;
|
|
20074
20469
|
};
|
|
20075
|
-
var readRosterRows = async (path, flags) => {
|
|
20470
|
+
var readRosterRows = async (path, flags, requireLastName) => {
|
|
20076
20471
|
let table;
|
|
20077
20472
|
try {
|
|
20078
|
-
table = await readSpreadsheetTable(
|
|
20473
|
+
table = await readSpreadsheetTable(basename3(path), await readFile5(path));
|
|
20079
20474
|
} catch (error) {
|
|
20080
20475
|
throw new CliUsageError(`Could not read ${path}: ${error instanceof Error ? error.message : "unknown error"}`);
|
|
20081
20476
|
}
|
|
20082
|
-
const mapping = resolvePassportRosterMapping(table[0] ?? [], flags);
|
|
20477
|
+
const mapping = resolvePassportRosterMapping(table[0] ?? [], flags, requireLastName);
|
|
20083
20478
|
try {
|
|
20084
|
-
return mapPassportRosterTable(table, mapping);
|
|
20479
|
+
return mapPassportRosterTable(table, mapping, { requireLastName });
|
|
20085
20480
|
} catch (error) {
|
|
20086
20481
|
throw new CliUsageError(`Could not import ${path}: ${error instanceof Error ? error.message : "unknown error"}`);
|
|
20087
20482
|
}
|
|
@@ -20123,6 +20518,17 @@ var runPassportCommand = async (input) => {
|
|
|
20123
20518
|
case "bingo status":
|
|
20124
20519
|
operation = () => api2.event.passport.getMyPassportBingo.query(event);
|
|
20125
20520
|
break;
|
|
20521
|
+
case "bingo rename": {
|
|
20522
|
+
allowed.push("name");
|
|
20523
|
+
const parsed = renamePassportBingoSchema.safeParse({
|
|
20524
|
+
eventId,
|
|
20525
|
+
name: requiredFlag(flags, "name")
|
|
20526
|
+
});
|
|
20527
|
+
if (!parsed.success)
|
|
20528
|
+
throw new CliUsageError(`--name ${parsed.error.issues[0]?.message ?? "is invalid"}.`);
|
|
20529
|
+
operation = () => api2.event.passport.renamePassportBingo.mutate(parsed.data);
|
|
20530
|
+
break;
|
|
20531
|
+
}
|
|
20126
20532
|
case "login-options":
|
|
20127
20533
|
operation = () => api2.event.passport.getPassportLoginOptions.query(event);
|
|
20128
20534
|
break;
|
|
@@ -20343,10 +20749,13 @@ var runPassportCommand = async (input) => {
|
|
|
20343
20749
|
case "roster import": {
|
|
20344
20750
|
allowed.push("file", "staff-id-column", "last-name-column", "full-name-column", "display-name-column", "surname-position");
|
|
20345
20751
|
const path = requiredFlag(flags, "file");
|
|
20346
|
-
operation = async () =>
|
|
20347
|
-
|
|
20348
|
-
|
|
20349
|
-
|
|
20752
|
+
operation = async () => {
|
|
20753
|
+
const { loginMethods } = await api2.event.passport.getPassportLoginOptions.query(event);
|
|
20754
|
+
return api2.event.passport.importPassportRoster.mutate({
|
|
20755
|
+
eventId,
|
|
20756
|
+
rows: await readRosterRows(path, flags, loginMethods.staffIdRequiresLastName)
|
|
20757
|
+
});
|
|
20758
|
+
};
|
|
20350
20759
|
break;
|
|
20351
20760
|
}
|
|
20352
20761
|
case "tally summary":
|
|
@@ -20356,8 +20765,16 @@ var runPassportCommand = async (input) => {
|
|
|
20356
20765
|
allowed.push("station-id");
|
|
20357
20766
|
operation = () => api2.event.passport.getPassportStationTallies.query(station());
|
|
20358
20767
|
break;
|
|
20359
|
-
default:
|
|
20360
|
-
|
|
20768
|
+
default: {
|
|
20769
|
+
const mediaOperation = createPassportMediaOperation(action, {
|
|
20770
|
+
eventId,
|
|
20771
|
+
flags,
|
|
20772
|
+
allowed
|
|
20773
|
+
});
|
|
20774
|
+
if (!mediaOperation)
|
|
20775
|
+
throw new CliUsageError("Unknown passport command. Run et --help for supported commands.");
|
|
20776
|
+
operation = mediaOperation;
|
|
20777
|
+
}
|
|
20361
20778
|
}
|
|
20362
20779
|
const unknown = [...flags.keys()].filter((key) => key !== "api-url" && !allowed.includes(key));
|
|
20363
20780
|
if (unknown.length)
|
|
@@ -23247,10 +23664,6 @@ var command_manifest_default = [
|
|
|
23247
23664
|
correctAnswer: {
|
|
23248
23665
|
type: "string",
|
|
23249
23666
|
maxLength: 100
|
|
23250
|
-
},
|
|
23251
|
-
manualReview: {
|
|
23252
|
-
default: false,
|
|
23253
|
-
type: "boolean"
|
|
23254
23667
|
}
|
|
23255
23668
|
},
|
|
23256
23669
|
required: ["name"]
|
|
@@ -23314,10 +23727,6 @@ var command_manifest_default = [
|
|
|
23314
23727
|
type: "string",
|
|
23315
23728
|
maxLength: 100
|
|
23316
23729
|
},
|
|
23317
|
-
manualReview: {
|
|
23318
|
-
default: false,
|
|
23319
|
-
type: "boolean"
|
|
23320
|
-
},
|
|
23321
23730
|
id: {
|
|
23322
23731
|
type: "string",
|
|
23323
23732
|
minLength: 1
|
|
@@ -23674,7 +24083,7 @@ var registryFlags = [
|
|
|
23674
24083
|
"target"
|
|
23675
24084
|
];
|
|
23676
24085
|
var isoDateTimePattern = /^\d{4}-\d\d-\d\dT\d\d:\d\d/;
|
|
23677
|
-
var
|
|
24086
|
+
var isRecord3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23678
24087
|
var commandName = (entry) => `et ${entry.path.join(" ")}`;
|
|
23679
24088
|
var findManifestEntry = (positionals) => manifest.find((entry) => entry.path.length === positionals.length && entry.path.every((segment, index) => positionals[index] === segment));
|
|
23680
24089
|
var listRegistryCommands = () => manifest.map((entry) => ({
|
|
@@ -23698,7 +24107,7 @@ var coerceDateAt = (value, segments, label) => {
|
|
|
23698
24107
|
const apply = (child) => isArray ? Array.isArray(child) ? child.map((item) => coerceDateAt(item, rest, label)) : child : coerceDateAt(child, rest, label);
|
|
23699
24108
|
if (key === "")
|
|
23700
24109
|
return apply(value);
|
|
23701
|
-
if (!
|
|
24110
|
+
if (!isRecord3(value) || !(key in value))
|
|
23702
24111
|
return value;
|
|
23703
24112
|
return { ...value, [key]: apply(value[key]) };
|
|
23704
24113
|
};
|
|
@@ -23724,7 +24133,7 @@ var readInput = async (parsed, entry) => {
|
|
|
23724
24133
|
} catch {
|
|
23725
24134
|
throw new CliUsageError("--input must be valid JSON.");
|
|
23726
24135
|
}
|
|
23727
|
-
if (!
|
|
24136
|
+
if (!isRecord3(value)) {
|
|
23728
24137
|
throw new CliUsageError("--input must be a JSON object.");
|
|
23729
24138
|
}
|
|
23730
24139
|
return coerceDates(value, entry.dates);
|
|
@@ -23747,7 +24156,7 @@ var assertConfirmed = (parsed, entry, input) => {
|
|
|
23747
24156
|
}
|
|
23748
24157
|
if (!entry.target)
|
|
23749
24158
|
return;
|
|
23750
|
-
const expected = targetText(
|
|
24159
|
+
const expected = targetText(isRecord3(input) ? input[entry.target] : undefined);
|
|
23751
24160
|
if (expected === undefined) {
|
|
23752
24161
|
throw new CliUsageError(`--input must include ${entry.target} so the target can be confirmed.`);
|
|
23753
24162
|
}
|
|
@@ -24158,11 +24567,11 @@ var runEventAppearanceUpload = async ({
|
|
|
24158
24567
|
const filePath = getRequiredFlag(parsed, "file");
|
|
24159
24568
|
const contentType = getRequiredFlag(parsed, "content-type");
|
|
24160
24569
|
const mediaType = parseAppearanceMediaType(getRequiredFlag(parsed, "media-type"));
|
|
24161
|
-
const file = await
|
|
24570
|
+
const file = await readFile6(filePath);
|
|
24162
24571
|
await ensureAuthentication();
|
|
24163
24572
|
const signed = await api2.attachment.getPresignedUrlToUpload.mutate({
|
|
24164
24573
|
folder: `event-appearance/${mediaType === "image" ? "images" : "videos"}`,
|
|
24165
|
-
fileName:
|
|
24574
|
+
fileName: basename4(filePath),
|
|
24166
24575
|
contentType,
|
|
24167
24576
|
size: file.byteLength,
|
|
24168
24577
|
eventId
|