@go-labs-sg/event-tech 1.11.0 → 1.13.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 +70 -5
- package/command-reference.md +22 -6
- package/dist/index.js +306 -47
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -149,12 +149,19 @@ et passport participant detail --event-id <id> --participant-id <id>
|
|
|
149
149
|
et passport prize upsert --event-id <id> --prize-json '{"name":"Tote bag","description":null,"stock":50,"stampCost":5,"order":0}'
|
|
150
150
|
et passport redemption create --event-id <id> --participant-id <id> --prize-id <id> --quantity 2
|
|
151
151
|
et passport station upsert --event-id <id> --station-json '{"name":"Ring toss","collection":{"collectionMode":"STAFF_SCAN","stampValue":3,"category":"GAME"}}'
|
|
152
|
+
et passport station upsert --event-id <id> --station-json '{"name":"Desk basketball","collection":{"collectionMode":"STAFF_SCAN","category":"GAME","info":{"subtitle":"Game 4 · Desk basketball","steps":["Stand behind the line","Sink 3 shots"]}}}'
|
|
152
153
|
et passport station upsert --event-id <id> --station-json '{"name":"Food counter","collection":{"collectionMode":"STAFF_TALLY","tallyItems":["Laksa","Teh"],"tallyEarnsStamp":true}}'
|
|
153
154
|
et passport tally record --event-id <id> --station-id <id> --profile-code <participant-code> --item Laksa --quantity 2
|
|
154
155
|
et passport tally list --event-id <id> --station-id <id>
|
|
155
156
|
et passport tally summary --event-id <id>
|
|
156
157
|
et passport tally reverse --event-id <id> --tally-id <id> --reason "Scanned twice" --allow-state-change --target <same-event-id>
|
|
157
158
|
et passport export --event-id <id>
|
|
159
|
+
et passport station-access get --event-id <id>
|
|
160
|
+
printf '%s' "$STATION_PASSWORD" | et passport station-access set-password --event-id <id> --password-stdin --allow-state-change --target <same-event-id>
|
|
161
|
+
et passport station-access clear-password --event-id <id> --allow-state-change --target <same-event-id>
|
|
162
|
+
et passport stamps stats --event-id <id>
|
|
163
|
+
et passport stamps recipients --event-id <id> --station-id <id> --search tan --limit 25
|
|
164
|
+
et passport stamps recipient-counts --event-id <id> --station-id <id>
|
|
158
165
|
et passport roster import --event-id <id> --file staff.xlsx
|
|
159
166
|
et passport roster import --event-id <id> --file staff.csv --staff-id-column "Employee No" --full-name-column "Name" --surname-position first
|
|
160
167
|
et passport roster list --event-id <id> --search tan
|
|
@@ -164,11 +171,35 @@ et passport roster remove --event-id <id> --entry-id <id> --allow-state-change -
|
|
|
164
171
|
et passport roster purge --event-id <id> --allow-state-change --target <same-event-id>
|
|
165
172
|
```
|
|
166
173
|
|
|
174
|
+
Station links: instead of inviting operators by email, an event can share one
|
|
175
|
+
station password. Staff open `/events/<id>/event-passport/station` (or a single
|
|
176
|
+
station's link), enter the password, pick a station and stamp guests without an
|
|
177
|
+
account. `station-access get` reports `passwordSet`, `passwordUpdatedAt` and
|
|
178
|
+
`activeSessionCount`. `set-password` (6 to 128 characters, no leading or trailing
|
|
179
|
+
spaces) reads the password from stdin only (`--password-stdin`; it is never a
|
|
180
|
+
flag value) and `clear-password` turns links off; both need
|
|
181
|
+
`--allow-state-change --target <event-id>` and end every existing station
|
|
182
|
+
session. A duplicated event does not copy the password. `stamps stats` returns
|
|
183
|
+
per-station stamp counts, and `stamps recipients` / `recipient-counts` list the
|
|
184
|
+
participants (name, Staff ID) each station stamped and how (`issuedBy.kind`:
|
|
185
|
+
`participant` for a self-scan, `station-link`, `staff` with the staff member's name,
|
|
186
|
+
or `bingo` for a stamp awarded by completing bingo); recipients page with `--cursor` and
|
|
187
|
+
`--direction backward`. Station JSON also accepts `address` (up to 300
|
|
188
|
+
characters, `null` clears it). Signing in with the password is browser-only.
|
|
189
|
+
|
|
167
190
|
Station collection modes are `SELF_SCAN`, `STAFF_SCAN`, `STAFF_SCORE` and `STAFF_TALLY`.
|
|
168
191
|
`collection.stampValue` (0 to 1000, default 1) is the stamps one collection adds.
|
|
169
192
|
`collection.category` is `GAME`, `FOOD`, `DRINK` or `BINGO` (default `GAME`) and
|
|
170
193
|
groups stations for guests; the CLI rejects any other value before calling the API.
|
|
171
194
|
Omit either field on an existing station to keep the stored value.
|
|
195
|
+
`collection.info` is the guest-facing station information shown when a guest taps
|
|
196
|
+
the station in their passport: `{"subtitle":"Game 4 · Desk basketball","steps":["Stand behind the line","Sink 3 shots"],"menu":[{"name":"Smash burger","detail":"Cooked to order","contains":"Gluten, dairy"}],"note":"Allergen info is indicative. Please ask our crew if unsure."}`.
|
|
197
|
+
`subtitle` is up to 80 characters, `steps` 1 to 8 lines of up to 160 (shown as "How to
|
|
198
|
+
play"), `menu` 1 to 15 items (`name` up to 80, `detail` and `contains` up to 200) and
|
|
199
|
+
`note` up to 240. Empty strings and empty lists are dropped; omit `info` to keep the
|
|
200
|
+
stored value and send `"info":null` (or an empty object) to clear it. Station reads
|
|
201
|
+
return it under `config.info`; `mine` also returns it as `info` on each station. Guests see how
|
|
202
|
+
many of each prize are left (`remaining`) in `mine`.
|
|
172
203
|
`SELF_SCAN` uses a reusable printable QR; `STAFF_SCAN` is stamp-only; only
|
|
173
204
|
`STAFF_SCORE` accepts `collection.maxPoints` and a collection `--points` value.
|
|
174
205
|
Zero is valid. Repeat collection returns the original receipt without changing
|
|
@@ -188,6 +219,18 @@ email OTP, Google or Staff ID must remain enabled for recovery, and enabling
|
|
|
188
219
|
Google requires configured provider credentials. Points never replace the
|
|
189
220
|
existing stamp-based reward thresholds.
|
|
190
221
|
|
|
222
|
+
Guest scanning: optional `"guestScan": true|false` in `--settings-json` controls whether
|
|
223
|
+
guests can scan station QR codes themselves (for example
|
|
224
|
+
`settings update --event-id <id> --settings-json '{"linkedDrawEventId":null,"luckyDrawStampThreshold":null,"prizeStampThreshold":null,"maxRedemptionsPerParticipant":0,"guestScan":false}'`).
|
|
225
|
+
Omit it to keep the stored value; an event that never set it reads as on. While it is off,
|
|
226
|
+
`passport claim` is refused with "Station scanning is turned off for this event. Show your QR to
|
|
227
|
+
the station crew instead.", the guest passport hides the Scan tab and scan buttons, and
|
|
228
|
+
SELF_SCAN and legacy rotating-code stations (including printed QR codes) can only be collected
|
|
229
|
+
by staff or station crew, who may stamp them (`passport collect`, no `--points`) only while it is off. Staff and
|
|
230
|
+
station-session stamping of other stations is unaffected. Read the current state from
|
|
231
|
+
`overview` (`passport.guestScan`) or, as a guest, from `mine` (`settings.guestScanEnabled`).
|
|
232
|
+
Turn it back on by sending `"guestScan":true`.
|
|
233
|
+
|
|
191
234
|
`stamp correct`, `redemption reverse`, station/prize archive and print revocation
|
|
192
235
|
require `--allow-state-change --target <same-event-id>`; correction/reversal also
|
|
193
236
|
require a reason. Scored corrections accept `--points` and preserve historical
|
|
@@ -219,7 +262,7 @@ returns per-item totals; `tally list` returns a station's tallies; `export`
|
|
|
219
262
|
includes `tallies` and `tallySummary`. Plain `collect`, `claim` and rotating QR routes reject tally stations; only a manager stamp correction can add or remove the
|
|
220
263
|
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.
|
|
221
264
|
|
|
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.
|
|
265
|
+
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`, with the Bingo station's art as `station.imageUrl` (null without art) and its stamp value as `station.stampValue`. `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.
|
|
223
266
|
|
|
224
267
|
Staff roster: with `loginMethods.staffId` on, guests sign in with a Staff ID and,
|
|
225
268
|
unless `loginMethods.staffIdRequiresLastName` is false, a last name from the event
|
|
@@ -286,6 +329,21 @@ every other station setting and the collection mode. `image-clear` removes it.
|
|
|
286
329
|
A new `imageKey` passed through `station upsert` must also be an upload to this
|
|
287
330
|
event's `event-passport/stations` folder; an unchanged key always passes.
|
|
288
331
|
|
|
332
|
+
Prize photos use the prize's optional `imageKey`, with the same flow and limits:
|
|
333
|
+
|
|
334
|
+
```sh
|
|
335
|
+
et passport prize image-set --event-id <id> --prize-id <id> --file ./prize.jpg --content-type image/jpeg
|
|
336
|
+
et passport prize image-clear --event-id <id> --prize-id <id>
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
`image-set` uploads to the event's prize folder (`event-passport/prizes`) and
|
|
340
|
+
saves the key, keeping the prize's name, description, stock, `stampCost` and
|
|
341
|
+
order. `image-clear` removes the photo, and guests see the gift illustration
|
|
342
|
+
again. `prize upsert` accepts `imageKey` in `--prize-json`: omit it to keep the
|
|
343
|
+
stored photo, pass `null` to clear it. A new key must be an upload to this
|
|
344
|
+
event's `event-passport/prizes` folder; an unchanged key always passes. `overview`
|
|
345
|
+
returns `imageKey` and a signed `imageUrl` for each prize.
|
|
346
|
+
|
|
289
347
|
### Deprecated event types
|
|
290
348
|
|
|
291
349
|
Scavenger Hunt (Amazing Race) and Gardens by the Bay are deprecated and frozen.
|
|
@@ -419,11 +477,18 @@ access invite` and `event access invitation-resend` return `deliveryStatus`
|
|
|
419
477
|
(`SENT`, `FAILED`, or `SENDING` when no outcome was recorded),
|
|
420
478
|
`emailLastError` and `emailSentAt`. A rejected or uncertain send is saved as
|
|
421
479
|
`FAILED`; resending replaces the invitation and sends a new email.
|
|
422
|
-
`organization member list`, `event access list
|
|
423
|
-
show the same fields on pending invitations (`null` for invitations created
|
|
424
|
-
before tracking). Legacy
|
|
425
|
-
the member row; `organization member invitation-resend` re-sends a pending
|
|
480
|
+
`organization member list`, `event access list`, `admin organization list` and
|
|
481
|
+
`admin organization members` show the same fields on pending invitations (`null` for invitations created
|
|
482
|
+
before tracking). Legacy member invitations (pending membership rows created
|
|
483
|
+
before organization invitations) store the same fields on the member row; `organization member invitation-resend` re-sends a pending
|
|
426
484
|
legacy member's email with a new idempotency key and updates those fields.
|
|
485
|
+
|
|
486
|
+
Pending invitations stay in `organization member list` and `event access list`
|
|
487
|
+
after their 48-hour link expires (compare `expiresAt` with the current time), and
|
|
488
|
+
both resend commands replace an expired invitation with a fresh link. `event access invite` returns `CONFLICT` when the recipient already has current or
|
|
489
|
+
scheduled access to the event; use `event access assign` to change it.
|
|
490
|
+
`event access my-assignments --input '{"organizationId":"<id>"}'` lists your own
|
|
491
|
+
assignments with `status` `ACTIVE`, `SCHEDULED`, `ENDED` or `REVOKED`.
|
|
427
492
|
Owners and admins can resend to members; owner and admin invitations need an
|
|
428
493
|
owner or global admin, as for other member changes. Active members are refused.
|
|
429
494
|
|
package/command-reference.md
CHANGED
|
@@ -6,14 +6,14 @@ Run `et <command> --help` for the full input JSON Schema.
|
|
|
6
6
|
## Registry commands
|
|
7
7
|
|
|
8
8
|
- `et organization member list` → `organization.getOrganizationMembersById` (query)
|
|
9
|
-
- List an organization's members and pending invitations (paged), with each invitation's stored emailDeliveryStatus.
|
|
9
|
+
- List an organization's members and pending invitations (paged; expired links included until resent or canceled), with each invitation's stored emailDeliveryStatus.
|
|
10
10
|
- `et organization member list-all` → `organization.getMembersByOrganization` (query)
|
|
11
11
|
- List every member of an organization without paging.
|
|
12
12
|
- `et organization member invite` → `organization.createOrganizationMember` (mutation)
|
|
13
13
|
- Invite a member to an organization and email the invitation; reports deliveryStatus and the stored emailDeliveryStatus.
|
|
14
14
|
- Confirm: `--allow-state-change` `--allow-email` `--target <input.email>`
|
|
15
15
|
- `et organization member invitation-resend` → `organization.resendOrganizationMemberInvitation` (mutation)
|
|
16
|
-
- Resend the invitation email to a pending legacy
|
|
16
|
+
- Resend the invitation email to a pending legacy member invitation created before organization invitations; reports deliveryStatus and the stored emailDeliveryStatus.
|
|
17
17
|
- Confirm: `--allow-state-change` `--allow-email` `--target <input.memberId>`
|
|
18
18
|
- `et organization member remove` → `organization.deleteOrganizationMember` (mutation)
|
|
19
19
|
- Remove a member (or leave with isLeaving) and revoke their event access.
|
|
@@ -46,7 +46,7 @@ Run `et <command> --help` for the full input JSON Schema.
|
|
|
46
46
|
- Cancel a pending organization invitation.
|
|
47
47
|
- Confirm: `--allow-state-change` `--target <input.invitationId>`
|
|
48
48
|
- `et organization invitation resend` → `organization.resendInvitation` (mutation)
|
|
49
|
-
- Replace a pending organization invitation and email
|
|
49
|
+
- Replace a pending organization invitation (including an expired one) and email a fresh link; reports deliveryStatus and the stored emailDeliveryStatus.
|
|
50
50
|
- Confirm: `--allow-state-change` `--allow-email` `--target <input.invitationId>`
|
|
51
51
|
- `et organization update` → `organization.updateOrganizationById` (mutation)
|
|
52
52
|
- Update organization details. name is required; omitted optional fields are unchanged.
|
|
@@ -72,7 +72,7 @@ Run `et <command> --help` for the full input JSON Schema.
|
|
|
72
72
|
- `et admin organization get` → `admin.organization.getOrganization` (query)
|
|
73
73
|
- Get any organization by ID as a global admin.
|
|
74
74
|
- `et admin organization members` → `admin.organization.getOrganizationMembers` (query)
|
|
75
|
-
- List an organization's members as a global admin.
|
|
75
|
+
- List an organization's members as a global admin, plus pendingInvitations not yet accepted (expired links included; shown when status is ALL or PENDING, filtered by search and role).
|
|
76
76
|
- `et admin organization stats` → `organization.getOrganizationStats` (query)
|
|
77
77
|
- Get platform-wide organization totals as a global admin.
|
|
78
78
|
- `et admin organization archive` → `admin.organization.archiveOrganization` (mutation)
|
|
@@ -120,14 +120,16 @@ Run `et <command> --help` for the full input JSON Schema.
|
|
|
120
120
|
- Confirm: `--allow-state-change` `--target <input.userId>`
|
|
121
121
|
- `et event access mine` → `access.getMyEventAccess` (query)
|
|
122
122
|
- Show the current user's role and permissions for an event.
|
|
123
|
+
- `et event access my-assignments` → `access.listMyEventAssignments` (query)
|
|
124
|
+
- List the current user's own event staff assignments in an organization (optionally one eventId), each with status ACTIVE, SCHEDULED, ENDED or REVOKED.
|
|
123
125
|
- `et event access list` → `access.listEventAssignments` (query)
|
|
124
|
-
- List event staff assignments and pending staff invitations, with each invitation's stored emailDeliveryStatus.
|
|
126
|
+
- List event staff assignments and pending staff invitations (expired links included until resent or revoked), with each invitation's stored emailDeliveryStatus.
|
|
125
127
|
- `et event access invite` → `access.inviteEventStaff` (mutation)
|
|
126
128
|
- Invite event staff by email; reports deliveryStatus and the stored emailDeliveryStatus. startsAt/expiresAt are ISO date-times or null.
|
|
127
129
|
- Confirm: `--allow-state-change` `--allow-email` `--target <input.email>`
|
|
128
130
|
- Date fields: `expiresAt`, `startsAt`
|
|
129
131
|
- `et event access invitation-resend` → `access.resendEventStaffInvitation` (mutation)
|
|
130
|
-
- Replace a pending event staff invitation and email
|
|
132
|
+
- Replace a pending event staff invitation (including an expired one) and email a fresh link; reports deliveryStatus and the stored emailDeliveryStatus.
|
|
131
133
|
- Confirm: `--allow-state-change` `--allow-email` `--target <input.invitationId>`
|
|
132
134
|
- `et event access invitation-revoke` → `access.revokeEventStaffInvitation` (mutation)
|
|
133
135
|
- Revoke a pending event staff invitation.
|
|
@@ -389,6 +391,20 @@ Run `et <command> --help` for the full input JSON Schema.
|
|
|
389
391
|
- `event.passport.deletePassportRosterEntry`: hand-written
|
|
390
392
|
- `event.passport.purgePassportRoster`: hand-written
|
|
391
393
|
- `event.passport.importPassportRoster`: hand-written
|
|
394
|
+
- `event.passport.clearPassportStationPassword`: hand-written
|
|
395
|
+
- `event.passport.collectStampAsStationStaff`: browser-only
|
|
396
|
+
- `event.passport.getPassportStationAccess`: hand-written
|
|
397
|
+
- `event.passport.getPassportStationStampRecipientCounts`: hand-written
|
|
398
|
+
- `event.passport.getPassportStationStampRecipients`: hand-written
|
|
399
|
+
- `event.passport.getPassportStationStampStats`: hand-written
|
|
400
|
+
- `event.passport.getStationStaffAccess`: browser-only
|
|
401
|
+
- `event.passport.getStationStaffStations`: browser-only
|
|
402
|
+
- `event.passport.previewStationStaffParticipant`: browser-only
|
|
403
|
+
- `event.passport.previewStationStaffPrizeClaim`: browser-only
|
|
404
|
+
- `event.passport.redeemPrizeAsStationStaff`: browser-only
|
|
405
|
+
- `event.passport.recordTallyAsStationStaff`: browser-only
|
|
406
|
+
- `event.passport.setPassportStationPassword`: hand-written
|
|
407
|
+
- `event.passport.signInToStationStaff`: browser-only
|
|
392
408
|
- `event.scavengerHunt.getScavengerHuntByEventId`: frozen-scavenger-hunt
|
|
393
409
|
- `event.scavengerHunt.getScavengerHuntBoardBackgroundByEventId`: frozen-scavenger-hunt
|
|
394
410
|
- `event.scavengerHunt.getPhotoSubmissionsOnly`: frozen-scavenger-hunt
|
package/dist/index.js
CHANGED
|
@@ -9352,7 +9352,7 @@ var require_lib3 = __commonJS(function(exports, module) {
|
|
|
9352
9352
|
module.exports = JSZip;
|
|
9353
9353
|
});
|
|
9354
9354
|
|
|
9355
|
-
// ../../../node_modules/.bun/papaparse@5.7.
|
|
9355
|
+
// ../../../node_modules/.bun/papaparse@5.7.1/node_modules/papaparse/papaparse.js
|
|
9356
9356
|
var require_papaparse = __commonJS(function(exports, module) {
|
|
9357
9357
|
(function(root, factory) {
|
|
9358
9358
|
if (typeof define === "function" && define.amd) {
|
|
@@ -9479,7 +9479,9 @@ var require_papaparse = __commonJS(function(exports, module) {
|
|
|
9479
9479
|
if (typeof _input === "string")
|
|
9480
9480
|
_input = JSON.parse(_input);
|
|
9481
9481
|
if (Array.isArray(_input)) {
|
|
9482
|
-
if (!_input.length
|
|
9482
|
+
if (!_input.length)
|
|
9483
|
+
return serialize(_columns, _input, _skipEmptyLines);
|
|
9484
|
+
else if (Array.isArray(_input[0]))
|
|
9483
9485
|
return serialize(null, _input, _skipEmptyLines);
|
|
9484
9486
|
else if (typeof _input[0] === "object")
|
|
9485
9487
|
return serialize(_columns || Object.keys(_input[0]), _input, _skipEmptyLines);
|
|
@@ -9553,7 +9555,7 @@ var require_papaparse = __commonJS(function(exports, module) {
|
|
|
9553
9555
|
var emptyLine = false;
|
|
9554
9556
|
var nullLine = hasHeader ? Object.keys(data[row]).length === 0 : data[row].length === 0;
|
|
9555
9557
|
if (skipEmptyLines && !hasHeader) {
|
|
9556
|
-
emptyLine = skipEmptyLines === "greedy" ? data[row].join("").trim() === "" : data[row].length === 1 && data[row][0].length === 0;
|
|
9558
|
+
emptyLine = skipEmptyLines === "greedy" ? data[row].join("").trim() === "" : data[row].length === 1 && (data[row][0] === null || data[row][0] === undefined || data[row][0].length === 0);
|
|
9557
9559
|
}
|
|
9558
9560
|
if (skipEmptyLines === "greedy" && hasHeader) {
|
|
9559
9561
|
var line = [];
|
|
@@ -9586,11 +9588,12 @@ var require_papaparse = __commonJS(function(exports, module) {
|
|
|
9586
9588
|
return str.toISOString();
|
|
9587
9589
|
}
|
|
9588
9590
|
var needsQuotes = false;
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
+
var strValue = str.toString();
|
|
9592
|
+
if (_escapeFormulae && typeof str !== "number" && typeof str !== "bigint" && typeof str !== "boolean" && _escapeFormulae.test(strValue)) {
|
|
9593
|
+
strValue = "'" + strValue;
|
|
9594
|
+
str = strValue;
|
|
9591
9595
|
needsQuotes = true;
|
|
9592
9596
|
}
|
|
9593
|
-
var strValue = str.toString();
|
|
9594
9597
|
var escapedQuoteStr = strValue.replace(quoteCharRegex, _escapedQuote);
|
|
9595
9598
|
needsQuotes = needsQuotes || _quotes === true || typeof _quotes === "function" && _quotes(str, col) || Array.isArray(_quotes) && _quotes[col] || hasAny(escapedQuoteStr, Papa.BAD_DELIMITERS) || escapedQuoteStr.indexOf(_delimiter) > -1 || strValue.indexOf(_quoteChar) > -1 || escapedQuoteStr.charAt(0) === " " || escapedQuoteStr.charAt(escapedQuoteStr.length - 1) === " ";
|
|
9596
9599
|
return needsQuotes ? _quoteChar + escapedQuoteStr + _quoteChar : escapedQuoteStr;
|
|
@@ -10375,15 +10378,18 @@ var require_papaparse = __commonJS(function(exports, module) {
|
|
|
10375
10378
|
if (input[quoteSearch + 1 + spacesBetweenQuoteAndDelimiter + delimLen] !== quoteChar) {
|
|
10376
10379
|
quoteSearch = input.indexOf(quoteChar, cursor);
|
|
10377
10380
|
}
|
|
10378
|
-
nextDelim
|
|
10379
|
-
|
|
10381
|
+
if (nextDelim !== -1 && nextDelim < cursor)
|
|
10382
|
+
nextDelim = input.indexOf(delim, cursor);
|
|
10383
|
+
if (nextNewline !== -1 && nextNewline < cursor)
|
|
10384
|
+
nextNewline = input.indexOf(newline, cursor);
|
|
10380
10385
|
break;
|
|
10381
10386
|
}
|
|
10382
10387
|
var spacesBetweenQuoteAndNewLine = extraSpaces(nextNewline);
|
|
10383
10388
|
if (input.substring(quoteSearch + 1 + spacesBetweenQuoteAndNewLine, quoteSearch + 1 + spacesBetweenQuoteAndNewLine + newlineLen) === newline) {
|
|
10384
10389
|
row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar));
|
|
10385
10390
|
saveRow(quoteSearch + 1 + spacesBetweenQuoteAndNewLine + newlineLen);
|
|
10386
|
-
nextDelim
|
|
10391
|
+
if (nextDelim !== -1 && nextDelim < cursor)
|
|
10392
|
+
nextDelim = input.indexOf(delim, cursor);
|
|
10387
10393
|
quoteSearch = input.indexOf(quoteChar, cursor);
|
|
10388
10394
|
if (stepIsFunction) {
|
|
10389
10395
|
doStep();
|
|
@@ -10411,7 +10417,8 @@ var require_papaparse = __commonJS(function(exports, module) {
|
|
|
10411
10417
|
return returnable();
|
|
10412
10418
|
cursor = nextNewline + newlineLen;
|
|
10413
10419
|
nextNewline = input.indexOf(newline, cursor);
|
|
10414
|
-
nextDelim
|
|
10420
|
+
if (nextDelim !== -1 && nextDelim < cursor)
|
|
10421
|
+
nextDelim = input.indexOf(delim, cursor);
|
|
10415
10422
|
continue;
|
|
10416
10423
|
}
|
|
10417
10424
|
if (nextDelim !== -1 && (nextDelim < nextNewline || nextNewline === -1)) {
|
|
@@ -18751,6 +18758,7 @@ var booleanFlags = new Set([
|
|
|
18751
18758
|
"dry-run",
|
|
18752
18759
|
"help",
|
|
18753
18760
|
"no-browser",
|
|
18761
|
+
"password-stdin",
|
|
18754
18762
|
"public",
|
|
18755
18763
|
"version"
|
|
18756
18764
|
]);
|
|
@@ -18921,8 +18929,14 @@ Usage:
|
|
|
18921
18929
|
et passport bingo claim-stamp --event-id <id> (guest: catch-up award for a completed card)
|
|
18922
18930
|
et passport bingo status --event-id <id> (guest: own bingo progress and stamp)
|
|
18923
18931
|
et passport export --event-id <id>
|
|
18924
|
-
et passport settings update --event-id <id> --settings-json <json> (maxRedemptionsPerParticipant 0 = no cap)
|
|
18932
|
+
et passport settings update --event-id <id> --settings-json <json> (maxRedemptionsPerParticipant 0 = no cap; optional guestScan true|false)
|
|
18925
18933
|
et passport station upsert --event-id <id> --station-json <json> (collection.stampValue 0-1000, default 1; collection.category GAME|FOOD|DRINK|BINGO, default GAME)
|
|
18934
|
+
et passport station-access get --event-id <id>
|
|
18935
|
+
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)
|
|
18936
|
+
et passport station-access clear-password --event-id <id> --allow-state-change --target <same-event-id> (turns station links off; ends every station session)
|
|
18937
|
+
et passport stamps stats --event-id <id>
|
|
18938
|
+
et passport stamps recipients --event-id <id> --station-id <id> [--search <text>] [--limit <1-100>] [--cursor <cursor>] [--direction <forward|backward>]
|
|
18939
|
+
et passport stamps recipient-counts --event-id <id> --station-id <id> [--search <text>]
|
|
18926
18940
|
et passport skin get --event-id <id>
|
|
18927
18941
|
et passport skin set --event-id <id> --appearance-version <n> --skin-json <json>
|
|
18928
18942
|
et passport skin clear --event-id <id> --appearance-version <n>
|
|
@@ -18941,7 +18955,9 @@ Usage:
|
|
|
18941
18955
|
et passport participant search --event-id <id> [--query <text>]
|
|
18942
18956
|
et passport participant detail --event-id <id> --participant-id <id>
|
|
18943
18957
|
et passport stamp correct --event-id <id> --station-id <id> --participant-id <id> --stamped <true|false> --reason <text> [--points <n>] --allow-state-change --target <same-event-id>
|
|
18944
|
-
et passport prize upsert --event-id <id> --prize-json <json> (stampCost: stamps per unit, default 0)
|
|
18958
|
+
et passport prize upsert --event-id <id> --prize-json <json> (stampCost: stamps per unit, default 0; imageKey: omit keeps the photo, null clears it)
|
|
18959
|
+
et passport prize image-set --event-id <id> --prize-id <id> --file <path> --content-type <image-mime>
|
|
18960
|
+
et passport prize image-clear --event-id <id> --prize-id <id>
|
|
18945
18961
|
et passport prize archive --event-id <id> --prize-id <id> --allow-state-change --target <same-event-id>
|
|
18946
18962
|
et passport redemption create --event-id <id> --participant-id <id> --prize-id <id> [--quantity <1-20>]
|
|
18947
18963
|
et passport redemption reverse --event-id <id> --redemption-id <id> --reason <text> --allow-state-change --target <same-event-id>
|
|
@@ -18963,10 +18979,20 @@ Event Passport:
|
|
|
18963
18979
|
Include collection.maxPoints only for STAFF_SCORE; zero is a valid score.
|
|
18964
18980
|
collection.category groups stations for guests: GAME, FOOD, DRINK or BINGO. Omit it to keep the stored one.
|
|
18965
18981
|
Omit collection on an existing station to preserve its current mode.
|
|
18966
|
-
Station JSON supports id/name/description/location/imageKey/order/opensAt/closesAt/collection.
|
|
18982
|
+
Station JSON supports id/name/description/location/address/imageKey/order/opensAt/closesAt/collection.
|
|
18983
|
+
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).
|
|
18984
|
+
Station links: one shared password per passport lets staff without accounts open /events/<id>/event-passport/station,
|
|
18985
|
+
pick a station and stamp guests. station-access get shows whether a password is set and how many station sessions are
|
|
18986
|
+
active; set-password (stdin only) and clear-password both end every existing station session; no password means links are
|
|
18987
|
+
off. stamps stats reports per-station stamp counts; stamps recipients lists who each station stamped and how
|
|
18988
|
+
(issuedBy.kind: participant self-scan, station-link, staff by name, or bingo for a bingo award; page with
|
|
18989
|
+
--cursor, backward needs a cursor). Station sessions themselves are browser-only.
|
|
18967
18990
|
Station cover art: image-set uploads a jpeg/png/webp/gif (up to 25 MB) to the event's station-art folder and
|
|
18968
18991
|
saves it as the station's imageKey, keeping every other station setting; image-clear removes it. A new
|
|
18969
18992
|
imageKey given in station JSON must be an upload to this event's event-passport/stations folder.
|
|
18993
|
+
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
|
|
18994
|
+
saves it as the prize's imageKey, keeping every other prize setting; image-clear removes it (guests then see the gift
|
|
18995
|
+
illustration). A new imageKey given in prize JSON must be an upload to this event's event-passport/prizes folder.
|
|
18970
18996
|
Passport skin (optional per-event look; no skin renders the Go Labs default): lives in the event
|
|
18971
18997
|
appearance as the optional passport block {heroImage:{key,focalX,focalY}|null, logo:{key}|null,
|
|
18972
18998
|
colors:{graphic,dark}, emphasis:accent|ink}. skin get reads it with the version and image URLs.
|
|
@@ -18979,7 +19005,10 @@ Event Passport:
|
|
|
18979
19005
|
maxRedemptionsPerParticipant; optional loginMethods is {emailOtp,google,guest,staffId,staffIdRequiresLastName}.
|
|
18980
19006
|
Keep email OTP, Google or Staff ID enabled for recovery; staffId defaults to false and
|
|
18981
19007
|
staffIdRequiresLastName to true, so set it false again whenever you resend loginMethods.
|
|
18982
|
-
Omit loginMethods to preserve it.
|
|
19008
|
+
Omit loginMethods to preserve it. Optional guestScan (boolean) turns guest station QR scanning
|
|
19009
|
+
on or off; omit it to keep the stored value (absent means on). When off, guests cannot self-scan
|
|
19010
|
+
(staff and station crew still stamp) and the guest passport hides the Scan tab. overview shows
|
|
19011
|
+
passport.guestScan and mine shows settings.guestScanEnabled.
|
|
18983
19012
|
Staff roster (event hosts only): import replaces the roster and returns imported, replaced and
|
|
18984
19013
|
rejected rows (blank, too long, or a Staff ID repeated in the file). Columns are matched from
|
|
18985
19014
|
header names; override with the column flags. Without a last-name column, the last name is
|
|
@@ -19603,6 +19632,46 @@ var passportTallyItemsSchema = array(string2().trim().min(1).max(PASSPORT_TALLY_
|
|
|
19603
19632
|
seen.add(key);
|
|
19604
19633
|
});
|
|
19605
19634
|
});
|
|
19635
|
+
var PASSPORT_STATION_INFO_SUBTITLE_MAX = 80;
|
|
19636
|
+
var PASSPORT_STATION_INFO_STEPS_MAX = 8;
|
|
19637
|
+
var PASSPORT_STATION_INFO_STEP_MAX = 160;
|
|
19638
|
+
var PASSPORT_STATION_INFO_MENU_MAX = 15;
|
|
19639
|
+
var PASSPORT_STATION_INFO_MENU_NAME_MAX = 80;
|
|
19640
|
+
var PASSPORT_STATION_INFO_MENU_DETAIL_MAX = 200;
|
|
19641
|
+
var PASSPORT_STATION_INFO_NOTE_MAX = 240;
|
|
19642
|
+
var optionalInfoText = (maximum) => string2().trim().max(maximum).optional().transform((value) => value || undefined);
|
|
19643
|
+
var 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 : undefined);
|
|
19644
|
+
var passportStationInfoMenuSchema = array(object({
|
|
19645
|
+
name: string2().trim().max(PASSPORT_STATION_INFO_MENU_NAME_MAX),
|
|
19646
|
+
detail: optionalInfoText(PASSPORT_STATION_INFO_MENU_DETAIL_MAX),
|
|
19647
|
+
contains: optionalInfoText(PASSPORT_STATION_INFO_MENU_DETAIL_MAX)
|
|
19648
|
+
})).transform((rows) => rows.filter((row) => row.name !== "" || row.detail || row.contains).map(({ name, detail, contains }) => ({
|
|
19649
|
+
name,
|
|
19650
|
+
...detail ? { detail } : {},
|
|
19651
|
+
...contains ? { contains } : {}
|
|
19652
|
+
}))).pipe(array(object({
|
|
19653
|
+
name: string2().min(1, "Menu items need a name."),
|
|
19654
|
+
detail: string2().optional(),
|
|
19655
|
+
contains: string2().optional()
|
|
19656
|
+
})).max(PASSPORT_STATION_INFO_MENU_MAX)).transform((rows) => rows.length > 0 ? rows : undefined);
|
|
19657
|
+
var passportStationInfoSchema = object({
|
|
19658
|
+
subtitle: optionalInfoText(PASSPORT_STATION_INFO_SUBTITLE_MAX),
|
|
19659
|
+
steps: passportStationInfoStepsSchema.optional(),
|
|
19660
|
+
menu: passportStationInfoMenuSchema.optional(),
|
|
19661
|
+
note: optionalInfoText(PASSPORT_STATION_INFO_NOTE_MAX)
|
|
19662
|
+
}).transform((info) => {
|
|
19663
|
+
const normalised = {
|
|
19664
|
+
...info.subtitle ? { subtitle: info.subtitle } : {},
|
|
19665
|
+
...info.steps ? { steps: info.steps } : {},
|
|
19666
|
+
...info.menu ? { menu: info.menu } : {},
|
|
19667
|
+
...info.note ? { note: info.note } : {}
|
|
19668
|
+
};
|
|
19669
|
+
return Object.keys(normalised).length > 0 ? normalised : undefined;
|
|
19670
|
+
});
|
|
19671
|
+
var passportStationInfoInputSchema = union([
|
|
19672
|
+
_null3(),
|
|
19673
|
+
passportStationInfoSchema.transform((info) => info ?? null)
|
|
19674
|
+
]);
|
|
19606
19675
|
var passportLoginMethodsSchema = object({
|
|
19607
19676
|
emailOtp: boolean2(),
|
|
19608
19677
|
google: boolean2(),
|
|
@@ -19614,7 +19683,8 @@ var passportLoginMethodsSchema = object({
|
|
|
19614
19683
|
});
|
|
19615
19684
|
var passportConfigSchema = object({
|
|
19616
19685
|
version: literal(1),
|
|
19617
|
-
loginMethods: passportLoginMethodsSchema
|
|
19686
|
+
loginMethods: passportLoginMethodsSchema,
|
|
19687
|
+
guestScan: boolean2().optional()
|
|
19618
19688
|
});
|
|
19619
19689
|
var passportStationConfigSchema = object({
|
|
19620
19690
|
version: literal(1),
|
|
@@ -19630,7 +19700,8 @@ var passportStationConfigSchema = object({
|
|
|
19630
19700
|
stampValue: stampValueSchema.optional(),
|
|
19631
19701
|
category: passportStationCategorySchema.optional(),
|
|
19632
19702
|
tallyItems: passportTallyItemsSchema.optional(),
|
|
19633
|
-
tallyEarnsStamp: boolean2().optional()
|
|
19703
|
+
tallyEarnsStamp: boolean2().optional(),
|
|
19704
|
+
info: passportStationInfoSchema.optional().catch(undefined)
|
|
19634
19705
|
}).superRefine((config, context) => {
|
|
19635
19706
|
const tally = config.collectionMode === "STAFF_TALLY";
|
|
19636
19707
|
if (tally && !config.tallyItems) {
|
|
@@ -19666,25 +19737,29 @@ var passportStationCollectionSchema = discriminatedUnion("collectionMode", [
|
|
|
19666
19737
|
object({
|
|
19667
19738
|
collectionMode: literal("SELF_SCAN"),
|
|
19668
19739
|
stampValue: stampValueSchema.optional(),
|
|
19669
|
-
category: passportStationCategorySchema.optional()
|
|
19740
|
+
category: passportStationCategorySchema.optional(),
|
|
19741
|
+
info: passportStationInfoInputSchema.optional()
|
|
19670
19742
|
}).strict(),
|
|
19671
19743
|
object({
|
|
19672
19744
|
collectionMode: literal("STAFF_SCAN"),
|
|
19673
19745
|
stampValue: stampValueSchema.optional(),
|
|
19674
|
-
category: passportStationCategorySchema.optional()
|
|
19746
|
+
category: passportStationCategorySchema.optional(),
|
|
19747
|
+
info: passportStationInfoInputSchema.optional()
|
|
19675
19748
|
}).strict(),
|
|
19676
19749
|
object({
|
|
19677
19750
|
collectionMode: literal("STAFF_SCORE"),
|
|
19678
19751
|
maxPoints: pointsSchema,
|
|
19679
19752
|
stampValue: stampValueSchema.optional(),
|
|
19680
|
-
category: passportStationCategorySchema.optional()
|
|
19753
|
+
category: passportStationCategorySchema.optional(),
|
|
19754
|
+
info: passportStationInfoInputSchema.optional()
|
|
19681
19755
|
}).strict(),
|
|
19682
19756
|
object({
|
|
19683
19757
|
collectionMode: literal("STAFF_TALLY"),
|
|
19684
19758
|
tallyItems: passportTallyItemsSchema,
|
|
19685
19759
|
tallyEarnsStamp: boolean2().default(false),
|
|
19686
19760
|
stampValue: stampValueSchema.optional(),
|
|
19687
|
-
category: passportStationCategorySchema.optional()
|
|
19761
|
+
category: passportStationCategorySchema.optional(),
|
|
19762
|
+
info: passportStationInfoInputSchema.optional()
|
|
19688
19763
|
}).strict()
|
|
19689
19764
|
]);
|
|
19690
19765
|
var passportEventIdSchema = object({ eventId: string2().min(1) });
|
|
@@ -19737,7 +19812,8 @@ var passportSettingsSchema = passportEventIdSchema.extend({
|
|
|
19737
19812
|
prizeStampThreshold: number2().int().positive().nullable(),
|
|
19738
19813
|
maxRedemptionsPerParticipant: number2().int().min(0).max(2147483647),
|
|
19739
19814
|
linkedDrawEventId: string2().min(1).nullable(),
|
|
19740
|
-
loginMethods: passportLoginMethodsSchema.optional()
|
|
19815
|
+
loginMethods: passportLoginMethodsSchema.optional(),
|
|
19816
|
+
guestScan: boolean2().optional()
|
|
19741
19817
|
});
|
|
19742
19818
|
var renamePassportBingoSchema = passportEventIdSchema.extend({
|
|
19743
19819
|
name: string2().trim().min(1).max(100)
|
|
@@ -19747,6 +19823,7 @@ var passportStationSchema = passportEventIdSchema.extend({
|
|
|
19747
19823
|
name: string2().trim().min(1).max(100),
|
|
19748
19824
|
description: string2().trim().max(1000).nullable(),
|
|
19749
19825
|
location: string2().trim().max(200).nullable(),
|
|
19826
|
+
address: string2().trim().max(300).nullable().optional(),
|
|
19750
19827
|
imageKey: string2().nullable(),
|
|
19751
19828
|
order: number2().int().min(0),
|
|
19752
19829
|
opensAt: date2().nullable(),
|
|
@@ -19757,6 +19834,7 @@ var passportPrizeSchema = passportEventIdSchema.extend({
|
|
|
19757
19834
|
id: string2().optional(),
|
|
19758
19835
|
name: string2().trim().min(1).max(100),
|
|
19759
19836
|
description: string2().trim().max(1000).nullable(),
|
|
19837
|
+
imageKey: string2().max(2048).nullable().optional(),
|
|
19760
19838
|
stock: number2().int().min(0),
|
|
19761
19839
|
stampCost: number2().int().min(0).max(PASSPORT_PRIZE_STAMP_COST_MAX).optional(),
|
|
19762
19840
|
order: number2().int().min(0)
|
|
@@ -19871,6 +19949,41 @@ var guessPassportRosterMapping = (headers) => {
|
|
|
19871
19949
|
};
|
|
19872
19950
|
};
|
|
19873
19951
|
|
|
19952
|
+
// ../validators/src/event-passport/passport-station-access.schema.ts
|
|
19953
|
+
var PASSPORT_STATION_PASSWORD_MIN = 6;
|
|
19954
|
+
var PASSPORT_STATION_PASSWORD_MAX = 128;
|
|
19955
|
+
var PASSPORT_STATION_RECIPIENTS_PAGE_MAX = 100;
|
|
19956
|
+
var stationStaffPasswordSchema = string2().min(PASSPORT_STATION_PASSWORD_MIN, `Use at least ${PASSPORT_STATION_PASSWORD_MIN} characters.`).max(PASSPORT_STATION_PASSWORD_MAX, `Use at most ${PASSPORT_STATION_PASSWORD_MAX} characters.`).refine((value) => value === value.trim(), {
|
|
19957
|
+
message: "Remove the spaces at the start or end of the password."
|
|
19958
|
+
});
|
|
19959
|
+
var signInToStationStaffSchema = passportEventIdSchema.extend({ password: string2().min(1).max(PASSPORT_STATION_PASSWORD_MAX) }).strict();
|
|
19960
|
+
var setPassportStationPasswordSchema = passportEventIdSchema.extend({ password: stationStaffPasswordSchema }).strict();
|
|
19961
|
+
var participantCodeSchema = string2().min(1).max(2048);
|
|
19962
|
+
var stationStaffParticipantSchema = union([
|
|
19963
|
+
passportStationIdSchema.extend({ profileCode: participantCodeSchema }),
|
|
19964
|
+
passportStationIdSchema.extend({
|
|
19965
|
+
staffId: string2().trim().min(1).max(PASSPORT_ROSTER_STAFF_ID_MAX)
|
|
19966
|
+
})
|
|
19967
|
+
]);
|
|
19968
|
+
var stationPrizeClaimParticipantSchema = union([
|
|
19969
|
+
passportEventIdSchema.extend({ profileCode: participantCodeSchema }),
|
|
19970
|
+
passportEventIdSchema.extend({
|
|
19971
|
+
staffId: string2().trim().min(1).max(PASSPORT_ROSTER_STAFF_ID_MAX)
|
|
19972
|
+
})
|
|
19973
|
+
]);
|
|
19974
|
+
var redeemPrizeAsStationStaffSchema = passportEventIdSchema.extend({ profileCode: participantCodeSchema, prizeId: string2().min(1) }).strict();
|
|
19975
|
+
var stationStampRecipientFiltersSchema = object({ search: string2().trim().max(200).optional() }).strict();
|
|
19976
|
+
var passportStationStampRecipientsSchema = passportStationIdSchema.extend({
|
|
19977
|
+
filters: stationStampRecipientFiltersSchema.default({}),
|
|
19978
|
+
limit: number2().int().min(1).max(PASSPORT_STATION_RECIPIENTS_PAGE_MAX).default(25),
|
|
19979
|
+
cursor: string2().min(1).max(8192).nullish(),
|
|
19980
|
+
direction: _enum(["forward", "backward"]).default("forward")
|
|
19981
|
+
}).strict().refine((input) => input.direction === "forward" || Boolean(input.cursor), {
|
|
19982
|
+
message: "A backward page needs a cursor.",
|
|
19983
|
+
path: ["cursor"]
|
|
19984
|
+
});
|
|
19985
|
+
var passportStationStampRecipientCountsSchema = passportStationIdSchema.extend({ filters: stationStampRecipientFiltersSchema.default({}) }).strict();
|
|
19986
|
+
|
|
19874
19987
|
// src/commands/passport-media.ts
|
|
19875
19988
|
import { readFile as readFile4 } from "fs/promises";
|
|
19876
19989
|
import { basename as basename2 } from "path";
|
|
@@ -20212,18 +20325,38 @@ var setStationImage = async (eventId, stationId, imageKey) => {
|
|
|
20212
20325
|
closesAt: station.closesAt
|
|
20213
20326
|
});
|
|
20214
20327
|
};
|
|
20215
|
-
var
|
|
20328
|
+
var setPrizeImage = async (eventId, prizeId, imageKey) => {
|
|
20329
|
+
const overview = await api2.event.passport.getPassportOverview.query({
|
|
20330
|
+
eventId
|
|
20331
|
+
});
|
|
20332
|
+
const prize = overview.prizes.find((item) => item.id === prizeId);
|
|
20333
|
+
if (!prize)
|
|
20334
|
+
throw new CliUsageError("Prize not found for this event.");
|
|
20335
|
+
return api2.event.passport.upsertPassportPrize.mutate({
|
|
20336
|
+
eventId,
|
|
20337
|
+
id: prize.id,
|
|
20338
|
+
name: prize.name,
|
|
20339
|
+
description: prize.description,
|
|
20340
|
+
imageKey: imageKey ? await imageKey() : null,
|
|
20341
|
+
stock: prize.stock,
|
|
20342
|
+
stampCost: prize.stampCost,
|
|
20343
|
+
order: prize.order
|
|
20344
|
+
});
|
|
20345
|
+
};
|
|
20346
|
+
var createImageOperation = (resource, subcommand, { eventId, flags, allowed }) => {
|
|
20216
20347
|
if (subcommand !== "image-set" && subcommand !== "image-clear")
|
|
20217
20348
|
return null;
|
|
20218
|
-
|
|
20219
|
-
|
|
20349
|
+
const idFlag = `${resource}-id`;
|
|
20350
|
+
allowed.push(idFlag);
|
|
20351
|
+
const id = requiredValue(flags, idFlag);
|
|
20352
|
+
const save = (imageKey) => resource === "station" ? setStationImage(eventId, id, imageKey) : setPrizeImage(eventId, id, imageKey);
|
|
20220
20353
|
if (subcommand === "image-clear")
|
|
20221
|
-
return () =>
|
|
20354
|
+
return () => save(null);
|
|
20222
20355
|
allowed.push("file", "content-type");
|
|
20223
20356
|
requiredValue(flags, "file");
|
|
20224
20357
|
requiredValue(flags, "content-type");
|
|
20225
|
-
return () =>
|
|
20226
|
-
const signed = await uploadPassportImage(eventId, "stations", flags);
|
|
20358
|
+
return () => save(async () => {
|
|
20359
|
+
const signed = await uploadPassportImage(eventId, resource === "station" ? "stations" : "prizes", flags);
|
|
20227
20360
|
return signed.key;
|
|
20228
20361
|
});
|
|
20229
20362
|
};
|
|
@@ -20231,8 +20364,8 @@ var createPassportMediaOperation = (action, context) => {
|
|
|
20231
20364
|
const [first, second] = action.split(" ");
|
|
20232
20365
|
if (first === "skin" && second)
|
|
20233
20366
|
return createSkinOperation(second, context);
|
|
20234
|
-
if (first === "station" && second)
|
|
20235
|
-
return
|
|
20367
|
+
if ((first === "station" || first === "prize") && second)
|
|
20368
|
+
return createImageOperation(first, second, context);
|
|
20236
20369
|
return null;
|
|
20237
20370
|
};
|
|
20238
20371
|
|
|
@@ -20281,6 +20414,12 @@ var nullableText = (value, name, maximum) => {
|
|
|
20281
20414
|
throw new CliUsageError(`${name} must be a string of at most ${maximum} characters or null.`);
|
|
20282
20415
|
return value.trim();
|
|
20283
20416
|
};
|
|
20417
|
+
var stationInfo = (value) => {
|
|
20418
|
+
const parsed = passportStationInfoInputSchema.safeParse(value);
|
|
20419
|
+
if (!parsed.success)
|
|
20420
|
+
throw new CliUsageError(`info is invalid: ${parsed.error.issues.map((issue) => `${issue.path.join(".") || "info"} ${issue.message}`).join("; ")}`);
|
|
20421
|
+
return parsed.data;
|
|
20422
|
+
};
|
|
20284
20423
|
var object2 = (value, name) => {
|
|
20285
20424
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
20286
20425
|
throw new CliUsageError(`${name} must be an object.`);
|
|
@@ -20316,7 +20455,8 @@ var parseStaffTallyCollection = (item, extras) => {
|
|
|
20316
20455
|
"tallyItems",
|
|
20317
20456
|
"tallyEarnsStamp",
|
|
20318
20457
|
"stampValue",
|
|
20319
|
-
"category"
|
|
20458
|
+
"category",
|
|
20459
|
+
"info"
|
|
20320
20460
|
], "collection");
|
|
20321
20461
|
if (!Array.isArray(item.tallyItems))
|
|
20322
20462
|
throw new CliUsageError("tallyItems must be an array of item names.");
|
|
@@ -20338,24 +20478,31 @@ var parsePassportCollection = (raw) => {
|
|
|
20338
20478
|
const item = object2(raw, "collection");
|
|
20339
20479
|
const stampValue = item.stampValue === undefined ? {} : { stampValue: integer2(item.stampValue, "stampValue", 0, 1000) };
|
|
20340
20480
|
const category = item.category === undefined ? {} : { category: stationCategory(item.category) };
|
|
20481
|
+
const info = item.info === undefined ? {} : { info: stationInfo(item.info) };
|
|
20341
20482
|
if (item.collectionMode === "STAFF_SCORE") {
|
|
20342
|
-
keys(item, ["collectionMode", "maxPoints", "stampValue", "category"], "collection");
|
|
20483
|
+
keys(item, ["collectionMode", "maxPoints", "stampValue", "category", "info"], "collection");
|
|
20343
20484
|
return {
|
|
20344
20485
|
collectionMode: "STAFF_SCORE",
|
|
20345
20486
|
maxPoints: integer2(item.maxPoints, "maxPoints"),
|
|
20346
20487
|
...stampValue,
|
|
20347
|
-
...category
|
|
20488
|
+
...category,
|
|
20489
|
+
...info
|
|
20348
20490
|
};
|
|
20349
20491
|
}
|
|
20350
20492
|
if (item.collectionMode === "STAFF_TALLY") {
|
|
20351
|
-
return parseStaffTallyCollection(item, {
|
|
20493
|
+
return parseStaffTallyCollection(item, {
|
|
20494
|
+
...stampValue,
|
|
20495
|
+
...category,
|
|
20496
|
+
...info
|
|
20497
|
+
});
|
|
20352
20498
|
}
|
|
20353
20499
|
if (item.collectionMode === "SELF_SCAN" || item.collectionMode === "STAFF_SCAN") {
|
|
20354
|
-
keys(item, ["collectionMode", "stampValue", "category"], "collection");
|
|
20500
|
+
keys(item, ["collectionMode", "stampValue", "category", "info"], "collection");
|
|
20355
20501
|
return {
|
|
20356
20502
|
collectionMode: item.collectionMode,
|
|
20357
20503
|
...stampValue,
|
|
20358
|
-
...category
|
|
20504
|
+
...category,
|
|
20505
|
+
...info
|
|
20359
20506
|
};
|
|
20360
20507
|
}
|
|
20361
20508
|
throw new CliUsageError("collectionMode must be SELF_SCAN, STAFF_SCAN, STAFF_SCORE or STAFF_TALLY.");
|
|
@@ -20367,6 +20514,7 @@ var parsePassportStationInput = (raw, eventId) => {
|
|
|
20367
20514
|
"name",
|
|
20368
20515
|
"description",
|
|
20369
20516
|
"location",
|
|
20517
|
+
"address",
|
|
20370
20518
|
"imageKey",
|
|
20371
20519
|
"order",
|
|
20372
20520
|
"opensAt",
|
|
@@ -20380,6 +20528,7 @@ var parsePassportStationInput = (raw, eventId) => {
|
|
|
20380
20528
|
name: text(value.name, "name", 100),
|
|
20381
20529
|
description: nullableText(value.description, "description", 1000),
|
|
20382
20530
|
location: nullableText(value.location, "location", 200),
|
|
20531
|
+
...value.address === undefined ? {} : { address: nullableText(value.address, "address", 300) },
|
|
20383
20532
|
imageKey: nullableText(value.imageKey, "imageKey", 2048),
|
|
20384
20533
|
order: integer2(value.order ?? 0, "order"),
|
|
20385
20534
|
opensAt: date3(value.opensAt, "opensAt"),
|
|
@@ -20394,8 +20543,11 @@ var parsePassportSettingsInput = (raw, eventId) => {
|
|
|
20394
20543
|
"prizeStampThreshold",
|
|
20395
20544
|
"maxRedemptionsPerParticipant",
|
|
20396
20545
|
"linkedDrawEventId",
|
|
20397
|
-
"loginMethods"
|
|
20546
|
+
"loginMethods",
|
|
20547
|
+
"guestScan"
|
|
20398
20548
|
], "Settings");
|
|
20549
|
+
if (value.guestScan !== undefined && typeof value.guestScan !== "boolean")
|
|
20550
|
+
throw new CliUsageError("guestScan must be a JSON boolean.");
|
|
20399
20551
|
const threshold = (item, name) => item === null ? null : integer2(item, name, 1);
|
|
20400
20552
|
let loginMethods;
|
|
20401
20553
|
if (value.loginMethods !== undefined) {
|
|
@@ -20421,7 +20573,8 @@ var parsePassportSettingsInput = (raw, eventId) => {
|
|
|
20421
20573
|
prizeStampThreshold: threshold(value.prizeStampThreshold, "prizeStampThreshold"),
|
|
20422
20574
|
maxRedemptionsPerParticipant: integer2(value.maxRedemptionsPerParticipant, "maxRedemptionsPerParticipant", 0),
|
|
20423
20575
|
linkedDrawEventId: value.linkedDrawEventId === null ? null : text(value.linkedDrawEventId, "linkedDrawEventId", 200),
|
|
20424
|
-
...loginMethods ? { loginMethods } : {}
|
|
20576
|
+
...loginMethods ? { loginMethods } : {},
|
|
20577
|
+
...value.guestScan === undefined ? {} : { guestScan: value.guestScan }
|
|
20425
20578
|
};
|
|
20426
20579
|
};
|
|
20427
20580
|
var parsePassportRosterEntryInput = (raw, eventId) => {
|
|
@@ -20482,6 +20635,79 @@ var readRosterRows = async (path, flags, requireLastName) => {
|
|
|
20482
20635
|
}
|
|
20483
20636
|
};
|
|
20484
20637
|
var optionalEntry = (key, value, parse) => value === undefined ? {} : { [key]: parse(value) };
|
|
20638
|
+
var readPasswordFromStdin = async () => {
|
|
20639
|
+
if (process.stdin.isTTY)
|
|
20640
|
+
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 ...`);
|
|
20641
|
+
return (await Bun.stdin.text()).replace(/\r?\n$/, "");
|
|
20642
|
+
};
|
|
20643
|
+
var searchFilters = (flags) => {
|
|
20644
|
+
const search = flag(flags, "search", false);
|
|
20645
|
+
return search === undefined ? {} : { search: text(search, "--search", 200) };
|
|
20646
|
+
};
|
|
20647
|
+
var recipientDirection = (value) => {
|
|
20648
|
+
if (value === undefined)
|
|
20649
|
+
return;
|
|
20650
|
+
if (value === "forward" || value === "backward")
|
|
20651
|
+
return value;
|
|
20652
|
+
throw new CliUsageError("--direction must be forward or backward.");
|
|
20653
|
+
};
|
|
20654
|
+
var parseStampRecipientsInput = (flags, station) => {
|
|
20655
|
+
const limit = flag(flags, "limit", false);
|
|
20656
|
+
const cursor = flag(flags, "cursor", false);
|
|
20657
|
+
const direction = recipientDirection(flag(flags, "direction", false));
|
|
20658
|
+
if (direction === "backward" && cursor === undefined)
|
|
20659
|
+
throw new CliUsageError("--direction backward needs --cursor.");
|
|
20660
|
+
return {
|
|
20661
|
+
...station,
|
|
20662
|
+
filters: searchFilters(flags),
|
|
20663
|
+
...optionalEntry("limit", limit, (raw) => integer2(raw, "--limit", 1, PASSPORT_STATION_RECIPIENTS_PAGE_MAX)),
|
|
20664
|
+
...optionalEntry("cursor", cursor, (raw) => text(raw, "--cursor", 8192)),
|
|
20665
|
+
...direction === undefined ? {} : { direction }
|
|
20666
|
+
};
|
|
20667
|
+
};
|
|
20668
|
+
var createStationAccessOperation = async (action, { eventId, flags, allowed, station, confirm }) => {
|
|
20669
|
+
const event = { eventId };
|
|
20670
|
+
let operation;
|
|
20671
|
+
switch (action) {
|
|
20672
|
+
case "station-access get":
|
|
20673
|
+
operation = () => api2.event.passport.getPassportStationAccess.query(event);
|
|
20674
|
+
break;
|
|
20675
|
+
case "station-access set-password": {
|
|
20676
|
+
allowed.push("password-stdin");
|
|
20677
|
+
confirm();
|
|
20678
|
+
if (flags.get("password-stdin") !== true)
|
|
20679
|
+
throw new CliUsageError("--password-stdin is required; the password is never accepted as a flag value.");
|
|
20680
|
+
const parsed = setPassportStationPasswordSchema.safeParse({
|
|
20681
|
+
eventId,
|
|
20682
|
+
password: await readPasswordFromStdin()
|
|
20683
|
+
});
|
|
20684
|
+
if (!parsed.success)
|
|
20685
|
+
throw new CliUsageError(parsed.error.issues[0]?.message ?? "The password is invalid.");
|
|
20686
|
+
operation = () => api2.event.passport.setPassportStationPassword.mutate(parsed.data);
|
|
20687
|
+
break;
|
|
20688
|
+
}
|
|
20689
|
+
case "station-access clear-password":
|
|
20690
|
+
confirm();
|
|
20691
|
+
operation = () => api2.event.passport.clearPassportStationPassword.mutate(event);
|
|
20692
|
+
break;
|
|
20693
|
+
case "stamps stats":
|
|
20694
|
+
operation = () => api2.event.passport.getPassportStationStampStats.query(event);
|
|
20695
|
+
break;
|
|
20696
|
+
case "stamps recipients": {
|
|
20697
|
+
allowed.push("station-id", "search", "limit", "cursor", "direction");
|
|
20698
|
+
const payload = parseStampRecipientsInput(flags, station());
|
|
20699
|
+
operation = () => api2.event.passport.getPassportStationStampRecipients.query(payload);
|
|
20700
|
+
break;
|
|
20701
|
+
}
|
|
20702
|
+
case "stamps recipient-counts": {
|
|
20703
|
+
allowed.push("station-id", "search");
|
|
20704
|
+
const payload = { ...station(), filters: searchFilters(flags) };
|
|
20705
|
+
operation = () => api2.event.passport.getPassportStationStampRecipientCounts.query(payload);
|
|
20706
|
+
break;
|
|
20707
|
+
}
|
|
20708
|
+
}
|
|
20709
|
+
return operation;
|
|
20710
|
+
};
|
|
20485
20711
|
var runPassportCommand = async (input) => {
|
|
20486
20712
|
const { flags, positionals } = input;
|
|
20487
20713
|
const action = positionals.slice(1).join(" ");
|
|
@@ -20639,12 +20865,21 @@ var runPassportCommand = async (input) => {
|
|
|
20639
20865
|
case "prize upsert": {
|
|
20640
20866
|
allowed.push("prize-json");
|
|
20641
20867
|
const value = json(requiredFlag(flags, "prize-json"), "--prize-json");
|
|
20642
|
-
keys(value, [
|
|
20868
|
+
keys(value, [
|
|
20869
|
+
"id",
|
|
20870
|
+
"name",
|
|
20871
|
+
"description",
|
|
20872
|
+
"imageKey",
|
|
20873
|
+
"stock",
|
|
20874
|
+
"stampCost",
|
|
20875
|
+
"order"
|
|
20876
|
+
], "Prize");
|
|
20643
20877
|
const payload = {
|
|
20644
20878
|
eventId,
|
|
20645
20879
|
...optionalEntry("id", value.id, (raw) => text(raw, "id", 200)),
|
|
20646
20880
|
name: text(value.name, "name", 100),
|
|
20647
20881
|
description: nullableText(value.description, "description", 1000),
|
|
20882
|
+
...optionalEntry("imageKey", value.imageKey, (raw) => nullableText(raw, "imageKey", 2048)),
|
|
20648
20883
|
stock: integer2(value.stock, "stock"),
|
|
20649
20884
|
...optionalEntry("stampCost", value.stampCost, (raw) => integer2(raw, "stampCost", 0, 1e5)),
|
|
20650
20885
|
order: integer2(value.order ?? 0, "order")
|
|
@@ -20766,11 +21001,13 @@ var runPassportCommand = async (input) => {
|
|
|
20766
21001
|
operation = () => api2.event.passport.getPassportStationTallies.query(station());
|
|
20767
21002
|
break;
|
|
20768
21003
|
default: {
|
|
20769
|
-
const mediaOperation =
|
|
21004
|
+
const mediaOperation = await createStationAccessOperation(action, {
|
|
20770
21005
|
eventId,
|
|
20771
21006
|
flags,
|
|
20772
|
-
allowed
|
|
20773
|
-
|
|
21007
|
+
allowed,
|
|
21008
|
+
station,
|
|
21009
|
+
confirm
|
|
21010
|
+
}) ?? createPassportMediaOperation(action, { eventId, flags, allowed });
|
|
20774
21011
|
if (!mediaOperation)
|
|
20775
21012
|
throw new CliUsageError("Unknown passport command. Run et --help for supported commands.");
|
|
20776
21013
|
operation = mediaOperation;
|
|
@@ -20789,7 +21026,7 @@ var command_manifest_default = [
|
|
|
20789
21026
|
path: ["organization", "member", "list"],
|
|
20790
21027
|
procedure: "organization.getOrganizationMembersById",
|
|
20791
21028
|
operation: "query",
|
|
20792
|
-
summary: "List an organization's members and pending invitations (paged), with each invitation's stored emailDeliveryStatus.",
|
|
21029
|
+
summary: "List an organization's members and pending invitations (paged; expired links included until resent or canceled), with each invitation's stored emailDeliveryStatus.",
|
|
20793
21030
|
effects: [],
|
|
20794
21031
|
dates: [],
|
|
20795
21032
|
input: {
|
|
@@ -20868,7 +21105,7 @@ var command_manifest_default = [
|
|
|
20868
21105
|
path: ["organization", "member", "invitation-resend"],
|
|
20869
21106
|
procedure: "organization.resendOrganizationMemberInvitation",
|
|
20870
21107
|
operation: "mutation",
|
|
20871
|
-
summary: "Resend the invitation email to a pending legacy
|
|
21108
|
+
summary: "Resend the invitation email to a pending legacy member invitation created before organization invitations; reports deliveryStatus and the stored emailDeliveryStatus.",
|
|
20872
21109
|
effects: ["state-change", "email"],
|
|
20873
21110
|
target: "memberId",
|
|
20874
21111
|
dates: [],
|
|
@@ -21109,7 +21346,7 @@ var command_manifest_default = [
|
|
|
21109
21346
|
path: ["organization", "invitation", "resend"],
|
|
21110
21347
|
procedure: "organization.resendInvitation",
|
|
21111
21348
|
operation: "mutation",
|
|
21112
|
-
summary: "Replace a pending organization invitation and email
|
|
21349
|
+
summary: "Replace a pending organization invitation (including an expired one) and email a fresh link; reports deliveryStatus and the stored emailDeliveryStatus.",
|
|
21113
21350
|
effects: ["state-change", "email"],
|
|
21114
21351
|
target: "invitationId",
|
|
21115
21352
|
dates: [],
|
|
@@ -21373,7 +21610,7 @@ var command_manifest_default = [
|
|
|
21373
21610
|
path: ["admin", "organization", "members"],
|
|
21374
21611
|
procedure: "admin.organization.getOrganizationMembers",
|
|
21375
21612
|
operation: "query",
|
|
21376
|
-
summary: "List an organization's members as a global admin.",
|
|
21613
|
+
summary: "List an organization's members as a global admin, plus pendingInvitations not yet accepted (expired links included; shown when status is ALL or PENDING, filtered by search and role).",
|
|
21377
21614
|
effects: [],
|
|
21378
21615
|
dates: [],
|
|
21379
21616
|
input: {
|
|
@@ -21956,11 +22193,33 @@ var command_manifest_default = [
|
|
|
21956
22193
|
required: ["eventId", "organizationId"]
|
|
21957
22194
|
}
|
|
21958
22195
|
},
|
|
22196
|
+
{
|
|
22197
|
+
path: ["event", "access", "my-assignments"],
|
|
22198
|
+
procedure: "access.listMyEventAssignments",
|
|
22199
|
+
operation: "query",
|
|
22200
|
+
summary: "List the current user's own event staff assignments in an organization (optionally one eventId), each with status ACTIVE, SCHEDULED, ENDED or REVOKED.",
|
|
22201
|
+
effects: [],
|
|
22202
|
+
dates: [],
|
|
22203
|
+
input: {
|
|
22204
|
+
type: "object",
|
|
22205
|
+
properties: {
|
|
22206
|
+
eventId: {
|
|
22207
|
+
type: "string",
|
|
22208
|
+
minLength: 1
|
|
22209
|
+
},
|
|
22210
|
+
organizationId: {
|
|
22211
|
+
type: "string",
|
|
22212
|
+
minLength: 1
|
|
22213
|
+
}
|
|
22214
|
+
},
|
|
22215
|
+
required: ["organizationId"]
|
|
22216
|
+
}
|
|
22217
|
+
},
|
|
21959
22218
|
{
|
|
21960
22219
|
path: ["event", "access", "list"],
|
|
21961
22220
|
procedure: "access.listEventAssignments",
|
|
21962
22221
|
operation: "query",
|
|
21963
|
-
summary: "List event staff assignments and pending staff invitations, with each invitation's stored emailDeliveryStatus.",
|
|
22222
|
+
summary: "List event staff assignments and pending staff invitations (expired links included until resent or revoked), with each invitation's stored emailDeliveryStatus.",
|
|
21964
22223
|
effects: [],
|
|
21965
22224
|
dates: [],
|
|
21966
22225
|
input: {
|
|
@@ -22038,7 +22297,7 @@ var command_manifest_default = [
|
|
|
22038
22297
|
path: ["event", "access", "invitation-resend"],
|
|
22039
22298
|
procedure: "access.resendEventStaffInvitation",
|
|
22040
22299
|
operation: "mutation",
|
|
22041
|
-
summary: "Replace a pending event staff invitation and email
|
|
22300
|
+
summary: "Replace a pending event staff invitation (including an expired one) and email a fresh link; reports deliveryStatus and the stored emailDeliveryStatus.",
|
|
22042
22301
|
effects: ["state-change", "email"],
|
|
22043
22302
|
target: "invitationId",
|
|
22044
22303
|
dates: [],
|