@go-labs-sg/event-tech 1.21.0 → 1.22.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
@@ -155,6 +155,9 @@ et passport redemption create --event-id <id> --participant-id <id> --prize-id <
155
155
  et passport redemption create --event-id <id> --participant-id <id> --prize-id <id> --award-station-id <id> --request-id "$(uuidgen)"
156
156
  et passport station upsert --event-id <id> --station-json '{"name":"Ring toss","collection":{"collectionMode":"STAFF_SCAN","stampValue":3,"category":"GAME"}}'
157
157
  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"]}}}'
158
+ et passport station upsert --event-id <id> --station-json '{"name":"Food counter","collection":{"collectionMode":"STAFF_SCAN","category":"FOOD","menuItems":[{"name":"Laksa","stock":40},{"name":"Teh","stock":null}]}}'
159
+ et passport collect --event-id <id> --station-id <id> --profile-code <participant-code> --item Laksa
160
+ et passport menu-stock --event-id <id>
158
161
  et passport station upsert --event-id <id> --station-json '{"name":"Food counter","collection":{"collectionMode":"STAFF_TALLY","tallyItems":["Laksa","Teh"],"tallyEarnsStamp":true}}'
159
162
  et passport tally record --event-id <id> --station-id <id> --profile-code <participant-code> --item Laksa --quantity 2
160
163
  et passport tally list --event-id <id> --station-id <id>
@@ -358,6 +361,8 @@ returns per-item totals; `tally list` returns a station's tallies; `export`
358
361
  includes `tallies` and `tallySummary`. Plain `collect`, `claim` and rotating QR routes reject tally stations; only a manager stamp correction can add or remove the
359
362
  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.
360
363
 
364
+ Food and drink served as stamps use `STAFF_SCAN` on a `FOOD` or `DRINK` station. Its optional `collection.menuItems` is 1 to 30 `{name,stock}` entries; names are trimmed, max 60 characters, and unique ignoring case. Stock is 0 to 2147483647 or `null` for unlimited. Omit `menuItems` to preserve the current menu and use `null` to clear it. Crew pass `--item <name>` to `collect`; each newly created stamp consumes one unit, with no quantity option. A duplicate stamp returns the existing stamp without consuming stock. Manager `stamp correct --stamped true --item <name>` can set the item for an initial stamp; corrections cannot change an active stamp's item. Revoking restores its consumed unit and restoring the stamp consumes it again. `menu-stock` reads the signed-in guest's remaining quantities; stamp rows include `item` (null when no menu item was selected). These rules do not change repeatable `STAFF_TALLY` tallies or their independent `--quantity` recording workflow.
365
+
361
366
  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.
362
367
 
363
368
  Staff roster: with `loginMethods.staffId` on, guests sign in with a Staff ID and,
@@ -439,6 +439,7 @@ Run `et <command> --help` for the full input JSON Schema.
439
439
  - `event.passport.joinPassport`: participant-only
440
440
  - `event.passport.getMyPassport`: hand-written
441
441
  - `event.passport.getMyPassportPrizeStock`: participant-only
442
+ - `event.passport.getMyPassportMenuStock`: hand-written
442
443
  - `event.passport.getMyPassportCode`: participant-only
443
444
  - `event.passport.getPassportParticipantDetail`: hand-written
444
445
  - `event.passport.getPassportOverview`: hand-written
package/dist/index.js CHANGED
@@ -19067,6 +19067,7 @@ Usage:
19067
19067
  et lucky-draw participants list --event-id <id> [--page <n>] [--per-page <n>]
19068
19068
  et passport overview --event-id <id>
19069
19069
  et passport mine --event-id <id>
19070
+ et passport menu-stock --event-id <id> (your remaining FOOD/DRINK STAFF_SCAN menu stock)
19070
19071
  et passport login-options --event-id <id>
19071
19072
  et passport queue-status --event-id <id> (what guests see: enabled, staleMinutes and the crew-set waits in stations, plus defaultStatus and defaultStationIds for visible stations crew set none for, which read "< 10 mins"; overview gives each station's queueStatus and queueStatusDefault)
19072
19073
  et passport bingo enable --event-id <id> (host: creates the hidden Bingo station and the HumanBingo)
@@ -19097,11 +19098,11 @@ Usage:
19097
19098
  et passport station print-revoke --event-id <id> --station-id <id> --expected-printed-qr-version <n> --allow-state-change --target <same-event-id>
19098
19099
  et passport station start-qr --event-id <id> --station-id <id>
19099
19100
  et passport station qr-status --event-id <id> --session-id <id>
19100
- et passport collect --event-id <id> --station-id <id> --profile-code <code> [--points <n>]
19101
+ et passport collect --event-id <id> --station-id <id> --profile-code <code> [--points <n>] [--item <menu-item>]
19101
19102
  et passport claim --event-id <id> --code <code>
19102
19103
  et passport participant search --event-id <id> [--query <text>]
19103
19104
  et passport participant detail --event-id <id> --participant-id <id>
19104
- 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>
19105
+ et passport stamp correct --event-id <id> --station-id <id> --participant-id <id> --stamped <true|false> --reason <text> [--points <n>] [--item <menu-item>] --allow-state-change --target <same-event-id>
19105
19106
  et passport prize upsert --event-id <id> --prize-json <json> (stampCost: stamps per unit, default 0; imageKey: omit keeps the photo, null clears it)
19106
19107
  et passport prize image-set --event-id <id> --prize-id <id> --file <path> --content-type <image-mime>
19107
19108
  et passport prize image-clear --event-id <id> --prize-id <id>
@@ -19125,6 +19126,7 @@ Event Passport:
19125
19126
  Uses the same typed procedures and event permissions as the web app.
19126
19127
  Station collection modes: SELF_SCAN, STAFF_SCAN, STAFF_SCORE, STAFF_TALLY.
19127
19128
  STAFF_TALLY needs collection.tallyItems (1-30 unique names) and optional tallyEarnsStamp (default false).
19129
+ FOOD/DRINK STAFF_SCAN may set collection.menuItems to 1-30 {name,stock} entries; names are unique ignoring case and surrounding whitespace, max 60 chars. stock is 0..2147483647 or null for unlimited; omit menuItems to preserve, null to clear. --item selects one menu item on a staff stamp; each new stamp uses one unit.
19128
19130
  Include collection.maxPoints only for STAFF_SCORE; zero is a valid score.
19129
19131
  collection.category groups stations for guests: GAME, FOOD, DRINK or BINGO. Omit it to keep the stored one.
19130
19132
  Omit collection on an existing station to preserve its current mode.
@@ -19847,6 +19849,31 @@ var PASSPORT_REDEMPTION_QUANTITY_MAX = 20;
19847
19849
  var PASSPORT_TALLY_ITEMS_MAX = 30;
19848
19850
  var PASSPORT_TALLY_ITEM_NAME_MAX = 60;
19849
19851
  var PASSPORT_TALLY_QUANTITY_MAX = 20;
19852
+ var PASSPORT_MENU_STOCK_MAX = 2147483647;
19853
+ var passportMenuItemsSchema = array(object({
19854
+ name: string2().trim().min(1).max(PASSPORT_TALLY_ITEM_NAME_MAX),
19855
+ stock: number2().int().min(0).max(PASSPORT_MENU_STOCK_MAX).nullable()
19856
+ })).min(1).max(PASSPORT_TALLY_ITEMS_MAX).superRefine((items, context) => {
19857
+ const names = new Set;
19858
+ items.forEach((item, index) => {
19859
+ const name = item.name.toLocaleLowerCase();
19860
+ if (names.has(name))
19861
+ context.addIssue({
19862
+ code: "custom",
19863
+ path: [index, "name"],
19864
+ message: "Menu item names must be unique."
19865
+ });
19866
+ names.add(name);
19867
+ });
19868
+ });
19869
+ var validateMenuCollection = (config, context) => {
19870
+ if (config.menuItems && (config.collectionMode !== "STAFF_SCAN" || config.prizeDeskAward))
19871
+ context.addIssue({
19872
+ code: "custom",
19873
+ path: ["menuItems"],
19874
+ message: "Menu items require staff-scan collection without prize-desk awards."
19875
+ });
19876
+ };
19850
19877
  var stampValueSchema = number2().int().min(0).max(PASSPORT_STAMP_VALUE_MAX);
19851
19878
  var PASSPORT_STATION_CATEGORIES = [
19852
19879
  "GAME",
@@ -19979,9 +20006,11 @@ var passportStationConfigSchema = object({
19979
20006
  category: passportStationCategorySchema.optional(),
19980
20007
  tallyItems: passportTallyItemsSchema.optional(),
19981
20008
  tallyEarnsStamp: boolean2().optional(),
20009
+ menuItems: passportMenuItemsSchema.optional(),
19982
20010
  prizeDeskAward: boolean2().optional(),
19983
20011
  info: passportStationInfoSchema.optional().catch(undefined)
19984
20012
  }).superRefine((config, context) => {
20013
+ validateMenuCollection(config, context);
19985
20014
  const tally = config.collectionMode === "STAFF_TALLY";
19986
20015
  if (tally && !config.tallyItems) {
19987
20016
  context.addIssue({
@@ -20038,6 +20067,7 @@ var passportStationCollectionSchema = discriminatedUnion("collectionMode", [
20038
20067
  }).strict(),
20039
20068
  object({
20040
20069
  collectionMode: literal("STAFF_SCAN"),
20070
+ menuItems: passportMenuItemsSchema.nullable().optional(),
20041
20071
  stampValue: stampValueSchema.optional(),
20042
20072
  category: passportStationCategorySchema.optional(),
20043
20073
  prizeDeskAward: boolean2().optional(),
@@ -20071,7 +20101,8 @@ var passportPrintQrMutationSchema = passportStationIdSchema.extend({
20071
20101
  });
20072
20102
  var collectPassportStampByStaffSchema = passportStationIdSchema.extend({
20073
20103
  profileCode: string2().min(1).max(2048),
20074
- points: pointsSchema.optional()
20104
+ points: pointsSchema.optional(),
20105
+ item: string2().trim().min(1).max(PASSPORT_TALLY_ITEM_NAME_MAX).optional()
20075
20106
  });
20076
20107
  var recordPassportTallySchema = passportStationIdSchema.extend({
20077
20108
  profileCode: string2().min(1).max(2048),
@@ -20086,7 +20117,8 @@ var correctPassportStampSchema = passportStationIdSchema.extend({
20086
20117
  participantId: string2().min(1),
20087
20118
  stamped: boolean2(),
20088
20119
  reason: string2().trim().min(1).max(500),
20089
- points: pointsSchema.optional()
20120
+ points: pointsSchema.optional(),
20121
+ item: string2().trim().min(1).max(PASSPORT_TALLY_ITEM_NAME_MAX).optional()
20090
20122
  });
20091
20123
  var beginPassportAccountLinkSchema = discriminatedUnion("method", [
20092
20124
  passportEventIdSchema.extend({
@@ -20811,6 +20843,45 @@ var parseStaffTallyCollection = (item, extras) => {
20811
20843
  ...extras
20812
20844
  };
20813
20845
  };
20846
+ var parseStaffScanCollection = (item, extras) => {
20847
+ keys(item, [
20848
+ "collectionMode",
20849
+ "stampValue",
20850
+ "category",
20851
+ "prizeDeskAward",
20852
+ "menuItems",
20853
+ "info"
20854
+ ], "collection");
20855
+ if (item.collectionMode !== "STAFF_SCAN" && item.menuItems !== undefined)
20856
+ throw new CliUsageError("Only STAFF_SCAN stations can configure menuItems.");
20857
+ if (item.prizeDeskAward !== undefined && typeof item.prizeDeskAward !== "boolean")
20858
+ throw new CliUsageError("prizeDeskAward must be true or false.");
20859
+ return {
20860
+ collectionMode: item.collectionMode,
20861
+ ...item.menuItems === undefined ? {} : {
20862
+ menuItems: item.menuItems === null ? null : parseStaffScanMenuItems(item.menuItems)
20863
+ },
20864
+ ...extras,
20865
+ ...item.prizeDeskAward === undefined ? {} : { prizeDeskAward: item.prizeDeskAward }
20866
+ };
20867
+ };
20868
+ var parseStaffScanMenuItems = (value) => {
20869
+ if (!Array.isArray(value))
20870
+ throw new CliUsageError("menuItems must be an array of menu item objects.");
20871
+ if (value.length < 1 || value.length > 30)
20872
+ throw new CliUsageError("menuItems must have 1 to 30 items.");
20873
+ const menuItems = value.map((raw, index) => {
20874
+ const item = object2(raw, `menuItems[${index}]`);
20875
+ keys(item, ["name", "stock"], `menuItems[${index}]`);
20876
+ return {
20877
+ name: text(item.name, `menuItems[${index}].name`, 60),
20878
+ stock: item.stock === null ? null : integer2(item.stock, `menuItems[${index}].stock`)
20879
+ };
20880
+ });
20881
+ if (new Set(menuItems.map(({ name }) => name.trim().toLocaleLowerCase())).size !== menuItems.length)
20882
+ throw new CliUsageError("menuItems names must be unique ignoring case and surrounding whitespace.");
20883
+ return menuItems;
20884
+ };
20814
20885
  var parsePassportCollection = (raw) => {
20815
20886
  const item = object2(raw, "collection");
20816
20887
  const stampValue = item.stampValue === undefined ? {} : { stampValue: integer2(item.stampValue, "stampValue", 0, 1000) };
@@ -20834,16 +20905,11 @@ var parsePassportCollection = (raw) => {
20834
20905
  });
20835
20906
  }
20836
20907
  if (item.collectionMode === "SELF_SCAN" || item.collectionMode === "STAFF_SCAN") {
20837
- keys(item, ["collectionMode", "stampValue", "category", "prizeDeskAward", "info"], "collection");
20838
- if (item.prizeDeskAward !== undefined && typeof item.prizeDeskAward !== "boolean")
20839
- throw new CliUsageError("prizeDeskAward must be true or false.");
20840
- return {
20841
- collectionMode: item.collectionMode,
20908
+ return parseStaffScanCollection(item, {
20842
20909
  ...stampValue,
20843
20910
  ...category,
20844
- ...item.prizeDeskAward === undefined ? {} : { prizeDeskAward: item.prizeDeskAward },
20845
20911
  ...info
20846
- };
20912
+ });
20847
20913
  }
20848
20914
  throw new CliUsageError("collectionMode must be SELF_SCAN, STAFF_SCAN, STAFF_SCORE or STAFF_TALLY.");
20849
20915
  };
@@ -21110,6 +21176,9 @@ var runPassportCommand = async (input) => {
21110
21176
  case "mine":
21111
21177
  operation = () => api2.event.passport.getMyPassport.query(event);
21112
21178
  break;
21179
+ case "menu-stock":
21180
+ operation = () => api2.event.passport.getMyPassportMenuStock.query(event);
21181
+ break;
21113
21182
  case "bingo enable":
21114
21183
  operation = () => api2.event.passport.enablePassportBingo.mutate(event);
21115
21184
  break;
@@ -21207,12 +21276,14 @@ var runPassportCommand = async (input) => {
21207
21276
  break;
21208
21277
  }
21209
21278
  case "collect": {
21210
- allowed.push("station-id", "profile-code", "points");
21279
+ allowed.push("station-id", "profile-code", "points", "item");
21211
21280
  const points = flag(flags, "points", false);
21281
+ const item = flag(flags, "item", false);
21212
21282
  const payload = {
21213
21283
  ...station(),
21214
21284
  profileCode: requiredFlag(flags, "profile-code"),
21215
- ...optionalEntry("points", points, (raw) => integer2(raw, "--points"))
21285
+ ...optionalEntry("points", points, (raw) => integer2(raw, "--points")),
21286
+ ...optionalEntry("item", item, (raw) => text(raw, "--item", 60))
21216
21287
  };
21217
21288
  operation = () => api2.event.passport.collectPassportStampByStaff.mutate(payload);
21218
21289
  break;
@@ -21224,15 +21295,17 @@ var runPassportCommand = async (input) => {
21224
21295
  break;
21225
21296
  }
21226
21297
  case "stamp correct": {
21227
- allowed.push("station-id", "participant-id", "stamped", "reason", "points");
21298
+ allowed.push("station-id", "participant-id", "stamped", "reason", "points", "item");
21228
21299
  confirm();
21229
21300
  const points = flag(flags, "points", false);
21301
+ const item = flag(flags, "item", false);
21230
21302
  const payload = {
21231
21303
  ...station(),
21232
21304
  participantId: requiredFlag(flags, "participant-id"),
21233
21305
  stamped: boolean4(requiredFlag(flags, "stamped"), "--stamped"),
21234
21306
  reason: requiredFlag(flags, "reason"),
21235
- ...optionalEntry("points", points, (raw) => integer2(raw, "--points"))
21307
+ ...optionalEntry("points", points, (raw) => integer2(raw, "--points")),
21308
+ ...optionalEntry("item", item, (raw) => text(raw, "--item", 60))
21236
21309
  };
21237
21310
  operation = () => api2.event.passport.correctPassportStamp.mutate(payload);
21238
21311
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-labs-sg/event-tech",
3
- "version": "1.21.0",
3
+ "version": "1.22.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",