@go-labs-sg/event-tech 1.11.0 → 1.12.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 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
@@ -419,11 +462,18 @@ access invite` and `event access invitation-resend` return `deliveryStatus`
419
462
  (`SENT`, `FAILED`, or `SENDING` when no outcome was recorded),
420
463
  `emailLastError` and `emailSentAt`. A rejected or uncertain send is saved as
421
464
  `FAILED`; resending replaces the invitation and sends a new email.
422
- `organization member list`, `event access list` and `admin organization list`
423
- show the same fields on pending invitations (`null` for invitations created
424
- before tracking). Legacy (policy v1) member invitations store the same fields on
425
- the member row; `organization member invitation-resend` re-sends a pending
465
+ `organization member list`, `event access list`, `admin organization list` and
466
+ `admin organization members` show the same fields on pending invitations (`null` for invitations created
467
+ before tracking). Legacy member invitations (pending membership rows created
468
+ before organization invitations) store the same fields on the member row; `organization member invitation-resend` re-sends a pending
426
469
  legacy member's email with a new idempotency key and updates those fields.
470
+
471
+ Pending invitations stay in `organization member list` and `event access list`
472
+ after their 48-hour link expires (compare `expiresAt` with the current time), and
473
+ both resend commands replace an expired invitation with a fresh link. `event access invite` returns `CONFLICT` when the recipient already has current or
474
+ scheduled access to the event; use `event access assign` to change it.
475
+ `event access my-assignments --input '{"organizationId":"<id>"}'` lists your own
476
+ assignments with `status` `ACTIVE`, `SCHEDULED`, `ENDED` or `REVOKED`.
427
477
  Owners and admins can resend to members; owner and admin invitations need an
428
478
  owner or global admin, as for other member changes. Active members are refused.
429
479
 
@@ -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 (policy v1) member; reports deliveryStatus and the stored emailDeliveryStatus.
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 it; reports deliveryStatus and the stored emailDeliveryStatus.
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 it; reports deliveryStatus and the stored emailDeliveryStatus.
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
@@ -18751,6 +18751,7 @@ var booleanFlags = new Set([
18751
18751
  "dry-run",
18752
18752
  "help",
18753
18753
  "no-browser",
18754
+ "password-stdin",
18754
18755
  "public",
18755
18756
  "version"
18756
18757
  ]);
@@ -18921,8 +18922,14 @@ Usage:
18921
18922
  et passport bingo claim-stamp --event-id <id> (guest: catch-up award for a completed card)
18922
18923
  et passport bingo status --event-id <id> (guest: own bingo progress and stamp)
18923
18924
  et passport export --event-id <id>
18924
- et passport settings update --event-id <id> --settings-json <json> (maxRedemptionsPerParticipant 0 = no cap)
18925
+ et passport settings update --event-id <id> --settings-json <json> (maxRedemptionsPerParticipant 0 = no cap; optional guestScan true|false)
18925
18926
  et passport station upsert --event-id <id> --station-json <json> (collection.stampValue 0-1000, default 1; collection.category GAME|FOOD|DRINK|BINGO, default GAME)
18927
+ et passport station-access get --event-id <id>
18928
+ 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)
18929
+ et passport station-access clear-password --event-id <id> --allow-state-change --target <same-event-id> (turns station links off; ends every station session)
18930
+ et passport stamps stats --event-id <id>
18931
+ et passport stamps recipients --event-id <id> --station-id <id> [--search <text>] [--limit <1-100>] [--cursor <cursor>] [--direction <forward|backward>]
18932
+ et passport stamps recipient-counts --event-id <id> --station-id <id> [--search <text>]
18926
18933
  et passport skin get --event-id <id>
18927
18934
  et passport skin set --event-id <id> --appearance-version <n> --skin-json <json>
18928
18935
  et passport skin clear --event-id <id> --appearance-version <n>
@@ -18963,7 +18970,14 @@ Event Passport:
18963
18970
  Include collection.maxPoints only for STAFF_SCORE; zero is a valid score.
18964
18971
  collection.category groups stations for guests: GAME, FOOD, DRINK or BINGO. Omit it to keep the stored one.
18965
18972
  Omit collection on an existing station to preserve its current mode.
18966
- Station JSON supports id/name/description/location/imageKey/order/opensAt/closesAt/collection.
18973
+ Station JSON supports id/name/description/location/address/imageKey/order/opensAt/closesAt/collection.
18974
+ 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).
18975
+ Station links: one shared password per passport lets staff without accounts open /events/<id>/event-passport/station,
18976
+ pick a station and stamp guests. station-access get shows whether a password is set and how many station sessions are
18977
+ active; set-password (stdin only) and clear-password both end every existing station session; no password means links are
18978
+ off. stamps stats reports per-station stamp counts; stamps recipients lists who each station stamped and how
18979
+ (issuedBy.kind: participant self-scan, station-link, staff by name, or bingo for a bingo award; page with
18980
+ --cursor, backward needs a cursor). Station sessions themselves are browser-only.
18967
18981
  Station cover art: image-set uploads a jpeg/png/webp/gif (up to 25 MB) to the event's station-art folder and
18968
18982
  saves it as the station's imageKey, keeping every other station setting; image-clear removes it. A new
18969
18983
  imageKey given in station JSON must be an upload to this event's event-passport/stations folder.
@@ -18979,7 +18993,10 @@ Event Passport:
18979
18993
  maxRedemptionsPerParticipant; optional loginMethods is {emailOtp,google,guest,staffId,staffIdRequiresLastName}.
18980
18994
  Keep email OTP, Google or Staff ID enabled for recovery; staffId defaults to false and
18981
18995
  staffIdRequiresLastName to true, so set it false again whenever you resend loginMethods.
18982
- Omit loginMethods to preserve it.
18996
+ Omit loginMethods to preserve it. Optional guestScan (boolean) turns guest station QR scanning
18997
+ on or off; omit it to keep the stored value (absent means on). When off, guests cannot self-scan
18998
+ (staff and station crew still stamp) and the guest passport hides the Scan tab. overview shows
18999
+ passport.guestScan and mine shows settings.guestScanEnabled.
18983
19000
  Staff roster (event hosts only): import replaces the roster and returns imported, replaced and
18984
19001
  rejected rows (blank, too long, or a Staff ID repeated in the file). Columns are matched from
18985
19002
  header names; override with the column flags. Without a last-name column, the last name is
@@ -19603,6 +19620,46 @@ var passportTallyItemsSchema = array(string2().trim().min(1).max(PASSPORT_TALLY_
19603
19620
  seen.add(key);
19604
19621
  });
19605
19622
  });
19623
+ var PASSPORT_STATION_INFO_SUBTITLE_MAX = 80;
19624
+ var PASSPORT_STATION_INFO_STEPS_MAX = 8;
19625
+ var PASSPORT_STATION_INFO_STEP_MAX = 160;
19626
+ var PASSPORT_STATION_INFO_MENU_MAX = 15;
19627
+ var PASSPORT_STATION_INFO_MENU_NAME_MAX = 80;
19628
+ var PASSPORT_STATION_INFO_MENU_DETAIL_MAX = 200;
19629
+ var PASSPORT_STATION_INFO_NOTE_MAX = 240;
19630
+ var optionalInfoText = (maximum) => string2().trim().max(maximum).optional().transform((value) => value || undefined);
19631
+ 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);
19632
+ var passportStationInfoMenuSchema = array(object({
19633
+ name: string2().trim().max(PASSPORT_STATION_INFO_MENU_NAME_MAX),
19634
+ detail: optionalInfoText(PASSPORT_STATION_INFO_MENU_DETAIL_MAX),
19635
+ contains: optionalInfoText(PASSPORT_STATION_INFO_MENU_DETAIL_MAX)
19636
+ })).transform((rows) => rows.filter((row) => row.name !== "" || row.detail || row.contains).map(({ name, detail, contains }) => ({
19637
+ name,
19638
+ ...detail ? { detail } : {},
19639
+ ...contains ? { contains } : {}
19640
+ }))).pipe(array(object({
19641
+ name: string2().min(1, "Menu items need a name."),
19642
+ detail: string2().optional(),
19643
+ contains: string2().optional()
19644
+ })).max(PASSPORT_STATION_INFO_MENU_MAX)).transform((rows) => rows.length > 0 ? rows : undefined);
19645
+ var passportStationInfoSchema = object({
19646
+ subtitle: optionalInfoText(PASSPORT_STATION_INFO_SUBTITLE_MAX),
19647
+ steps: passportStationInfoStepsSchema.optional(),
19648
+ menu: passportStationInfoMenuSchema.optional(),
19649
+ note: optionalInfoText(PASSPORT_STATION_INFO_NOTE_MAX)
19650
+ }).transform((info) => {
19651
+ const normalised = {
19652
+ ...info.subtitle ? { subtitle: info.subtitle } : {},
19653
+ ...info.steps ? { steps: info.steps } : {},
19654
+ ...info.menu ? { menu: info.menu } : {},
19655
+ ...info.note ? { note: info.note } : {}
19656
+ };
19657
+ return Object.keys(normalised).length > 0 ? normalised : undefined;
19658
+ });
19659
+ var passportStationInfoInputSchema = union([
19660
+ _null3(),
19661
+ passportStationInfoSchema.transform((info) => info ?? null)
19662
+ ]);
19606
19663
  var passportLoginMethodsSchema = object({
19607
19664
  emailOtp: boolean2(),
19608
19665
  google: boolean2(),
@@ -19614,7 +19671,8 @@ var passportLoginMethodsSchema = object({
19614
19671
  });
19615
19672
  var passportConfigSchema = object({
19616
19673
  version: literal(1),
19617
- loginMethods: passportLoginMethodsSchema
19674
+ loginMethods: passportLoginMethodsSchema,
19675
+ guestScan: boolean2().optional()
19618
19676
  });
19619
19677
  var passportStationConfigSchema = object({
19620
19678
  version: literal(1),
@@ -19630,7 +19688,8 @@ var passportStationConfigSchema = object({
19630
19688
  stampValue: stampValueSchema.optional(),
19631
19689
  category: passportStationCategorySchema.optional(),
19632
19690
  tallyItems: passportTallyItemsSchema.optional(),
19633
- tallyEarnsStamp: boolean2().optional()
19691
+ tallyEarnsStamp: boolean2().optional(),
19692
+ info: passportStationInfoSchema.optional().catch(undefined)
19634
19693
  }).superRefine((config, context) => {
19635
19694
  const tally = config.collectionMode === "STAFF_TALLY";
19636
19695
  if (tally && !config.tallyItems) {
@@ -19666,25 +19725,29 @@ var passportStationCollectionSchema = discriminatedUnion("collectionMode", [
19666
19725
  object({
19667
19726
  collectionMode: literal("SELF_SCAN"),
19668
19727
  stampValue: stampValueSchema.optional(),
19669
- category: passportStationCategorySchema.optional()
19728
+ category: passportStationCategorySchema.optional(),
19729
+ info: passportStationInfoInputSchema.optional()
19670
19730
  }).strict(),
19671
19731
  object({
19672
19732
  collectionMode: literal("STAFF_SCAN"),
19673
19733
  stampValue: stampValueSchema.optional(),
19674
- category: passportStationCategorySchema.optional()
19734
+ category: passportStationCategorySchema.optional(),
19735
+ info: passportStationInfoInputSchema.optional()
19675
19736
  }).strict(),
19676
19737
  object({
19677
19738
  collectionMode: literal("STAFF_SCORE"),
19678
19739
  maxPoints: pointsSchema,
19679
19740
  stampValue: stampValueSchema.optional(),
19680
- category: passportStationCategorySchema.optional()
19741
+ category: passportStationCategorySchema.optional(),
19742
+ info: passportStationInfoInputSchema.optional()
19681
19743
  }).strict(),
19682
19744
  object({
19683
19745
  collectionMode: literal("STAFF_TALLY"),
19684
19746
  tallyItems: passportTallyItemsSchema,
19685
19747
  tallyEarnsStamp: boolean2().default(false),
19686
19748
  stampValue: stampValueSchema.optional(),
19687
- category: passportStationCategorySchema.optional()
19749
+ category: passportStationCategorySchema.optional(),
19750
+ info: passportStationInfoInputSchema.optional()
19688
19751
  }).strict()
19689
19752
  ]);
19690
19753
  var passportEventIdSchema = object({ eventId: string2().min(1) });
@@ -19737,7 +19800,8 @@ var passportSettingsSchema = passportEventIdSchema.extend({
19737
19800
  prizeStampThreshold: number2().int().positive().nullable(),
19738
19801
  maxRedemptionsPerParticipant: number2().int().min(0).max(2147483647),
19739
19802
  linkedDrawEventId: string2().min(1).nullable(),
19740
- loginMethods: passportLoginMethodsSchema.optional()
19803
+ loginMethods: passportLoginMethodsSchema.optional(),
19804
+ guestScan: boolean2().optional()
19741
19805
  });
19742
19806
  var renamePassportBingoSchema = passportEventIdSchema.extend({
19743
19807
  name: string2().trim().min(1).max(100)
@@ -19747,6 +19811,7 @@ var passportStationSchema = passportEventIdSchema.extend({
19747
19811
  name: string2().trim().min(1).max(100),
19748
19812
  description: string2().trim().max(1000).nullable(),
19749
19813
  location: string2().trim().max(200).nullable(),
19814
+ address: string2().trim().max(300).nullable().optional(),
19750
19815
  imageKey: string2().nullable(),
19751
19816
  order: number2().int().min(0),
19752
19817
  opensAt: date2().nullable(),
@@ -19871,6 +19936,41 @@ var guessPassportRosterMapping = (headers) => {
19871
19936
  };
19872
19937
  };
19873
19938
 
19939
+ // ../validators/src/event-passport/passport-station-access.schema.ts
19940
+ var PASSPORT_STATION_PASSWORD_MIN = 6;
19941
+ var PASSPORT_STATION_PASSWORD_MAX = 128;
19942
+ var PASSPORT_STATION_RECIPIENTS_PAGE_MAX = 100;
19943
+ 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(), {
19944
+ message: "Remove the spaces at the start or end of the password."
19945
+ });
19946
+ var signInToStationStaffSchema = passportEventIdSchema.extend({ password: string2().min(1).max(PASSPORT_STATION_PASSWORD_MAX) }).strict();
19947
+ var setPassportStationPasswordSchema = passportEventIdSchema.extend({ password: stationStaffPasswordSchema }).strict();
19948
+ var participantCodeSchema = string2().min(1).max(2048);
19949
+ var stationStaffParticipantSchema = union([
19950
+ passportStationIdSchema.extend({ profileCode: participantCodeSchema }),
19951
+ passportStationIdSchema.extend({
19952
+ staffId: string2().trim().min(1).max(PASSPORT_ROSTER_STAFF_ID_MAX)
19953
+ })
19954
+ ]);
19955
+ var stationPrizeClaimParticipantSchema = union([
19956
+ passportEventIdSchema.extend({ profileCode: participantCodeSchema }),
19957
+ passportEventIdSchema.extend({
19958
+ staffId: string2().trim().min(1).max(PASSPORT_ROSTER_STAFF_ID_MAX)
19959
+ })
19960
+ ]);
19961
+ var redeemPrizeAsStationStaffSchema = passportEventIdSchema.extend({ profileCode: participantCodeSchema, prizeId: string2().min(1) }).strict();
19962
+ var stationStampRecipientFiltersSchema = object({ search: string2().trim().max(200).optional() }).strict();
19963
+ var passportStationStampRecipientsSchema = passportStationIdSchema.extend({
19964
+ filters: stationStampRecipientFiltersSchema.default({}),
19965
+ limit: number2().int().min(1).max(PASSPORT_STATION_RECIPIENTS_PAGE_MAX).default(25),
19966
+ cursor: string2().min(1).max(8192).nullish(),
19967
+ direction: _enum(["forward", "backward"]).default("forward")
19968
+ }).strict().refine((input) => input.direction === "forward" || Boolean(input.cursor), {
19969
+ message: "A backward page needs a cursor.",
19970
+ path: ["cursor"]
19971
+ });
19972
+ var passportStationStampRecipientCountsSchema = passportStationIdSchema.extend({ filters: stationStampRecipientFiltersSchema.default({}) }).strict();
19973
+
19874
19974
  // src/commands/passport-media.ts
19875
19975
  import { readFile as readFile4 } from "fs/promises";
19876
19976
  import { basename as basename2 } from "path";
@@ -20281,6 +20381,12 @@ var nullableText = (value, name, maximum) => {
20281
20381
  throw new CliUsageError(`${name} must be a string of at most ${maximum} characters or null.`);
20282
20382
  return value.trim();
20283
20383
  };
20384
+ var stationInfo = (value) => {
20385
+ const parsed = passportStationInfoInputSchema.safeParse(value);
20386
+ if (!parsed.success)
20387
+ throw new CliUsageError(`info is invalid: ${parsed.error.issues.map((issue) => `${issue.path.join(".") || "info"} ${issue.message}`).join("; ")}`);
20388
+ return parsed.data;
20389
+ };
20284
20390
  var object2 = (value, name) => {
20285
20391
  if (typeof value !== "object" || value === null || Array.isArray(value))
20286
20392
  throw new CliUsageError(`${name} must be an object.`);
@@ -20316,7 +20422,8 @@ var parseStaffTallyCollection = (item, extras) => {
20316
20422
  "tallyItems",
20317
20423
  "tallyEarnsStamp",
20318
20424
  "stampValue",
20319
- "category"
20425
+ "category",
20426
+ "info"
20320
20427
  ], "collection");
20321
20428
  if (!Array.isArray(item.tallyItems))
20322
20429
  throw new CliUsageError("tallyItems must be an array of item names.");
@@ -20338,24 +20445,31 @@ var parsePassportCollection = (raw) => {
20338
20445
  const item = object2(raw, "collection");
20339
20446
  const stampValue = item.stampValue === undefined ? {} : { stampValue: integer2(item.stampValue, "stampValue", 0, 1000) };
20340
20447
  const category = item.category === undefined ? {} : { category: stationCategory(item.category) };
20448
+ const info = item.info === undefined ? {} : { info: stationInfo(item.info) };
20341
20449
  if (item.collectionMode === "STAFF_SCORE") {
20342
- keys(item, ["collectionMode", "maxPoints", "stampValue", "category"], "collection");
20450
+ keys(item, ["collectionMode", "maxPoints", "stampValue", "category", "info"], "collection");
20343
20451
  return {
20344
20452
  collectionMode: "STAFF_SCORE",
20345
20453
  maxPoints: integer2(item.maxPoints, "maxPoints"),
20346
20454
  ...stampValue,
20347
- ...category
20455
+ ...category,
20456
+ ...info
20348
20457
  };
20349
20458
  }
20350
20459
  if (item.collectionMode === "STAFF_TALLY") {
20351
- return parseStaffTallyCollection(item, { ...stampValue, ...category });
20460
+ return parseStaffTallyCollection(item, {
20461
+ ...stampValue,
20462
+ ...category,
20463
+ ...info
20464
+ });
20352
20465
  }
20353
20466
  if (item.collectionMode === "SELF_SCAN" || item.collectionMode === "STAFF_SCAN") {
20354
- keys(item, ["collectionMode", "stampValue", "category"], "collection");
20467
+ keys(item, ["collectionMode", "stampValue", "category", "info"], "collection");
20355
20468
  return {
20356
20469
  collectionMode: item.collectionMode,
20357
20470
  ...stampValue,
20358
- ...category
20471
+ ...category,
20472
+ ...info
20359
20473
  };
20360
20474
  }
20361
20475
  throw new CliUsageError("collectionMode must be SELF_SCAN, STAFF_SCAN, STAFF_SCORE or STAFF_TALLY.");
@@ -20367,6 +20481,7 @@ var parsePassportStationInput = (raw, eventId) => {
20367
20481
  "name",
20368
20482
  "description",
20369
20483
  "location",
20484
+ "address",
20370
20485
  "imageKey",
20371
20486
  "order",
20372
20487
  "opensAt",
@@ -20380,6 +20495,7 @@ var parsePassportStationInput = (raw, eventId) => {
20380
20495
  name: text(value.name, "name", 100),
20381
20496
  description: nullableText(value.description, "description", 1000),
20382
20497
  location: nullableText(value.location, "location", 200),
20498
+ ...value.address === undefined ? {} : { address: nullableText(value.address, "address", 300) },
20383
20499
  imageKey: nullableText(value.imageKey, "imageKey", 2048),
20384
20500
  order: integer2(value.order ?? 0, "order"),
20385
20501
  opensAt: date3(value.opensAt, "opensAt"),
@@ -20394,8 +20510,11 @@ var parsePassportSettingsInput = (raw, eventId) => {
20394
20510
  "prizeStampThreshold",
20395
20511
  "maxRedemptionsPerParticipant",
20396
20512
  "linkedDrawEventId",
20397
- "loginMethods"
20513
+ "loginMethods",
20514
+ "guestScan"
20398
20515
  ], "Settings");
20516
+ if (value.guestScan !== undefined && typeof value.guestScan !== "boolean")
20517
+ throw new CliUsageError("guestScan must be a JSON boolean.");
20399
20518
  const threshold = (item, name) => item === null ? null : integer2(item, name, 1);
20400
20519
  let loginMethods;
20401
20520
  if (value.loginMethods !== undefined) {
@@ -20421,7 +20540,8 @@ var parsePassportSettingsInput = (raw, eventId) => {
20421
20540
  prizeStampThreshold: threshold(value.prizeStampThreshold, "prizeStampThreshold"),
20422
20541
  maxRedemptionsPerParticipant: integer2(value.maxRedemptionsPerParticipant, "maxRedemptionsPerParticipant", 0),
20423
20542
  linkedDrawEventId: value.linkedDrawEventId === null ? null : text(value.linkedDrawEventId, "linkedDrawEventId", 200),
20424
- ...loginMethods ? { loginMethods } : {}
20543
+ ...loginMethods ? { loginMethods } : {},
20544
+ ...value.guestScan === undefined ? {} : { guestScan: value.guestScan }
20425
20545
  };
20426
20546
  };
20427
20547
  var parsePassportRosterEntryInput = (raw, eventId) => {
@@ -20482,6 +20602,79 @@ var readRosterRows = async (path, flags, requireLastName) => {
20482
20602
  }
20483
20603
  };
20484
20604
  var optionalEntry = (key, value, parse) => value === undefined ? {} : { [key]: parse(value) };
20605
+ var readPasswordFromStdin = async () => {
20606
+ if (process.stdin.isTTY)
20607
+ 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 ...`);
20608
+ return (await Bun.stdin.text()).replace(/\r?\n$/, "");
20609
+ };
20610
+ var searchFilters = (flags) => {
20611
+ const search = flag(flags, "search", false);
20612
+ return search === undefined ? {} : { search: text(search, "--search", 200) };
20613
+ };
20614
+ var recipientDirection = (value) => {
20615
+ if (value === undefined)
20616
+ return;
20617
+ if (value === "forward" || value === "backward")
20618
+ return value;
20619
+ throw new CliUsageError("--direction must be forward or backward.");
20620
+ };
20621
+ var parseStampRecipientsInput = (flags, station) => {
20622
+ const limit = flag(flags, "limit", false);
20623
+ const cursor = flag(flags, "cursor", false);
20624
+ const direction = recipientDirection(flag(flags, "direction", false));
20625
+ if (direction === "backward" && cursor === undefined)
20626
+ throw new CliUsageError("--direction backward needs --cursor.");
20627
+ return {
20628
+ ...station,
20629
+ filters: searchFilters(flags),
20630
+ ...optionalEntry("limit", limit, (raw) => integer2(raw, "--limit", 1, PASSPORT_STATION_RECIPIENTS_PAGE_MAX)),
20631
+ ...optionalEntry("cursor", cursor, (raw) => text(raw, "--cursor", 8192)),
20632
+ ...direction === undefined ? {} : { direction }
20633
+ };
20634
+ };
20635
+ var createStationAccessOperation = async (action, { eventId, flags, allowed, station, confirm }) => {
20636
+ const event = { eventId };
20637
+ let operation;
20638
+ switch (action) {
20639
+ case "station-access get":
20640
+ operation = () => api2.event.passport.getPassportStationAccess.query(event);
20641
+ break;
20642
+ case "station-access set-password": {
20643
+ allowed.push("password-stdin");
20644
+ confirm();
20645
+ if (flags.get("password-stdin") !== true)
20646
+ throw new CliUsageError("--password-stdin is required; the password is never accepted as a flag value.");
20647
+ const parsed = setPassportStationPasswordSchema.safeParse({
20648
+ eventId,
20649
+ password: await readPasswordFromStdin()
20650
+ });
20651
+ if (!parsed.success)
20652
+ throw new CliUsageError(parsed.error.issues[0]?.message ?? "The password is invalid.");
20653
+ operation = () => api2.event.passport.setPassportStationPassword.mutate(parsed.data);
20654
+ break;
20655
+ }
20656
+ case "station-access clear-password":
20657
+ confirm();
20658
+ operation = () => api2.event.passport.clearPassportStationPassword.mutate(event);
20659
+ break;
20660
+ case "stamps stats":
20661
+ operation = () => api2.event.passport.getPassportStationStampStats.query(event);
20662
+ break;
20663
+ case "stamps recipients": {
20664
+ allowed.push("station-id", "search", "limit", "cursor", "direction");
20665
+ const payload = parseStampRecipientsInput(flags, station());
20666
+ operation = () => api2.event.passport.getPassportStationStampRecipients.query(payload);
20667
+ break;
20668
+ }
20669
+ case "stamps recipient-counts": {
20670
+ allowed.push("station-id", "search");
20671
+ const payload = { ...station(), filters: searchFilters(flags) };
20672
+ operation = () => api2.event.passport.getPassportStationStampRecipientCounts.query(payload);
20673
+ break;
20674
+ }
20675
+ }
20676
+ return operation;
20677
+ };
20485
20678
  var runPassportCommand = async (input) => {
20486
20679
  const { flags, positionals } = input;
20487
20680
  const action = positionals.slice(1).join(" ");
@@ -20766,11 +20959,13 @@ var runPassportCommand = async (input) => {
20766
20959
  operation = () => api2.event.passport.getPassportStationTallies.query(station());
20767
20960
  break;
20768
20961
  default: {
20769
- const mediaOperation = createPassportMediaOperation(action, {
20962
+ const mediaOperation = await createStationAccessOperation(action, {
20770
20963
  eventId,
20771
20964
  flags,
20772
- allowed
20773
- });
20965
+ allowed,
20966
+ station,
20967
+ confirm
20968
+ }) ?? createPassportMediaOperation(action, { eventId, flags, allowed });
20774
20969
  if (!mediaOperation)
20775
20970
  throw new CliUsageError("Unknown passport command. Run et --help for supported commands.");
20776
20971
  operation = mediaOperation;
@@ -20789,7 +20984,7 @@ var command_manifest_default = [
20789
20984
  path: ["organization", "member", "list"],
20790
20985
  procedure: "organization.getOrganizationMembersById",
20791
20986
  operation: "query",
20792
- summary: "List an organization's members and pending invitations (paged), with each invitation's stored emailDeliveryStatus.",
20987
+ summary: "List an organization's members and pending invitations (paged; expired links included until resent or canceled), with each invitation's stored emailDeliveryStatus.",
20793
20988
  effects: [],
20794
20989
  dates: [],
20795
20990
  input: {
@@ -20868,7 +21063,7 @@ var command_manifest_default = [
20868
21063
  path: ["organization", "member", "invitation-resend"],
20869
21064
  procedure: "organization.resendOrganizationMemberInvitation",
20870
21065
  operation: "mutation",
20871
- summary: "Resend the invitation email to a pending legacy (policy v1) member; reports deliveryStatus and the stored emailDeliveryStatus.",
21066
+ summary: "Resend the invitation email to a pending legacy member invitation created before organization invitations; reports deliveryStatus and the stored emailDeliveryStatus.",
20872
21067
  effects: ["state-change", "email"],
20873
21068
  target: "memberId",
20874
21069
  dates: [],
@@ -21109,7 +21304,7 @@ var command_manifest_default = [
21109
21304
  path: ["organization", "invitation", "resend"],
21110
21305
  procedure: "organization.resendInvitation",
21111
21306
  operation: "mutation",
21112
- summary: "Replace a pending organization invitation and email it; reports deliveryStatus and the stored emailDeliveryStatus.",
21307
+ summary: "Replace a pending organization invitation (including an expired one) and email a fresh link; reports deliveryStatus and the stored emailDeliveryStatus.",
21113
21308
  effects: ["state-change", "email"],
21114
21309
  target: "invitationId",
21115
21310
  dates: [],
@@ -21373,7 +21568,7 @@ var command_manifest_default = [
21373
21568
  path: ["admin", "organization", "members"],
21374
21569
  procedure: "admin.organization.getOrganizationMembers",
21375
21570
  operation: "query",
21376
- summary: "List an organization's members as a global admin.",
21571
+ 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
21572
  effects: [],
21378
21573
  dates: [],
21379
21574
  input: {
@@ -21956,11 +22151,33 @@ var command_manifest_default = [
21956
22151
  required: ["eventId", "organizationId"]
21957
22152
  }
21958
22153
  },
22154
+ {
22155
+ path: ["event", "access", "my-assignments"],
22156
+ procedure: "access.listMyEventAssignments",
22157
+ operation: "query",
22158
+ summary: "List the current user's own event staff assignments in an organization (optionally one eventId), each with status ACTIVE, SCHEDULED, ENDED or REVOKED.",
22159
+ effects: [],
22160
+ dates: [],
22161
+ input: {
22162
+ type: "object",
22163
+ properties: {
22164
+ eventId: {
22165
+ type: "string",
22166
+ minLength: 1
22167
+ },
22168
+ organizationId: {
22169
+ type: "string",
22170
+ minLength: 1
22171
+ }
22172
+ },
22173
+ required: ["organizationId"]
22174
+ }
22175
+ },
21959
22176
  {
21960
22177
  path: ["event", "access", "list"],
21961
22178
  procedure: "access.listEventAssignments",
21962
22179
  operation: "query",
21963
- summary: "List event staff assignments and pending staff invitations, with each invitation's stored emailDeliveryStatus.",
22180
+ summary: "List event staff assignments and pending staff invitations (expired links included until resent or revoked), with each invitation's stored emailDeliveryStatus.",
21964
22181
  effects: [],
21965
22182
  dates: [],
21966
22183
  input: {
@@ -22038,7 +22255,7 @@ var command_manifest_default = [
22038
22255
  path: ["event", "access", "invitation-resend"],
22039
22256
  procedure: "access.resendEventStaffInvitation",
22040
22257
  operation: "mutation",
22041
- summary: "Replace a pending event staff invitation and email it; reports deliveryStatus and the stored emailDeliveryStatus.",
22258
+ summary: "Replace a pending event staff invitation (including an expired one) and email a fresh link; reports deliveryStatus and the stored emailDeliveryStatus.",
22042
22259
  effects: ["state-change", "email"],
22043
22260
  target: "invitationId",
22044
22261
  dates: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-labs-sg/event-tech",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Event Tech CLI for managing Event Tech resources through the Go Labs API.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",