@go-labs-sg/event-tech 1.20.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 +10 -2
- package/command-reference.md +2 -1
- package/dist/index.js +109 -30
- package/package.json +1 -1
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,
|
|
@@ -646,8 +651,11 @@ it with the filters.
|
|
|
646
651
|
- Draw-first claims: `claims list`, `export` and `counter claims` rows and receipts carry `itemsPending` (true until the food is recorded) and `itemsRecordedAt` (null until then; also null on food-first claims). `claims counts` returns `totalCount`, `activeCount`, `itemsPendingCount` and `voidedCount`. Voiding a claim that is still pending releases its set; a redo reuses the same prize outcome and is pending again.
|
|
647
652
|
- `counter claims` takes `scope`: `mine` (default) is the claims made by you at the site (a crew
|
|
648
653
|
device sees its own crew session's), `site` is every claim at the site whoever served it.
|
|
649
|
-
|
|
650
|
-
`
|
|
654
|
+
`status` is `all` by default; `items-pending` filters to active claims whose food is not
|
|
655
|
+
recorded before selecting the newest rows (`limit` 1–50, default 20). This is a bounded
|
|
656
|
+
recent list, not the complete pending queue. Both scopes need the same counter access,
|
|
657
|
+
so `event.operate` for the CLI:
|
|
658
|
+
`et staff-redemption counter claims --input '{"eventId":"<event-id>","siteId":"<site-id>","scope":"site","status":"items-pending"}'`.
|
|
651
659
|
|
|
652
660
|
### Retired event types
|
|
653
661
|
|
package/command-reference.md
CHANGED
|
@@ -383,7 +383,7 @@ Run `et <command> --help` for the full input JSON Schema.
|
|
|
383
383
|
- Record the food (itemIds, checked against the item rule) for a claim that was drawn first (itemsPending true, counterOrder DRAW_THEN_FOOD). siteId must be the claim's own site (claims list shows it). Writes the items, sets itemsPending false and itemsRecordedAt, and logs it; it deducts no set and makes no draw. Idempotent: the same items again return replayed true with the stored receipt. CONFLICT when different items were already recorded, when the claim is voided, or when the claim was food-first (nothing pending). Needs event.operate at that site (a manager has it). Returns status recorded, replayed and the receipt.
|
|
384
384
|
- Confirm: `--allow-state-change` `--target <input.eventId>`
|
|
385
385
|
- `et staff-redemption counter claims` → `event.staffRedemption.getStaffRedemptionCounterClaims` (query)
|
|
386
|
-
- List a site's recent claims (limit 1-50, default 20) as the counter sees them. scope mine (default) is the claims you made at the site, site is every claim at the site. Each receipt carries itemsPending and itemsRecordedAt. Needs event.operate.
|
|
386
|
+
- List a site's recent claims (limit 1-50, default 20) as the counter sees them. scope mine (default) is the claims you made at the site, site is every claim at the site. status all (default) includes every recent claim; items-pending selects active claims whose food is not recorded before applying the limit. Each receipt carries itemsPending and itemsRecordedAt. Needs event.operate.
|
|
387
387
|
|
|
388
388
|
## Procedures without a registry command
|
|
389
389
|
|
|
@@ -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
|
@@ -17350,7 +17350,7 @@ var DEPRECATED_EVENT_TYPES = [
|
|
|
17350
17350
|
var activeEventTypeSchema = _enum(EventType).exclude(DEPRECATED_EVENT_TYPES);
|
|
17351
17351
|
var ACTIVE_EVENT_TYPES = activeEventTypeSchema.options;
|
|
17352
17352
|
|
|
17353
|
-
// ../../../node_modules/.bun/@trpc+server@11.28.
|
|
17353
|
+
// ../../../node_modules/.bun/@trpc+server@11.28.3+431a08decb845963/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
|
|
17354
17354
|
function observable(subscribe) {
|
|
17355
17355
|
const self2 = {
|
|
17356
17356
|
subscribe(observer) {
|
|
@@ -17566,7 +17566,7 @@ function observableToAsyncIterable(observable, signal) {
|
|
|
17566
17566
|
return iterator;
|
|
17567
17567
|
}
|
|
17568
17568
|
|
|
17569
|
-
// ../../../node_modules/.bun/@trpc+server@11.28.
|
|
17569
|
+
// ../../../node_modules/.bun/@trpc+server@11.28.3+431a08decb845963/node_modules/@trpc/server/dist/observable-BjUZYMQq.mjs
|
|
17570
17570
|
function share(_opts) {
|
|
17571
17571
|
return (source) => {
|
|
17572
17572
|
let refCount = 0;
|
|
@@ -17688,7 +17688,7 @@ function behaviorSubject(initialValue) {
|
|
|
17688
17688
|
return obs;
|
|
17689
17689
|
}
|
|
17690
17690
|
|
|
17691
|
-
// ../../../node_modules/.bun/@trpc+client@11.28.
|
|
17691
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.3+82479501839ae062/node_modules/@trpc/client/dist/splitLink-PFsRy7Mf.mjs
|
|
17692
17692
|
function createChain(opts) {
|
|
17693
17693
|
return observable((observer) => {
|
|
17694
17694
|
function execute(index = 0, op = opts.op) {
|
|
@@ -17706,7 +17706,7 @@ function createChain(opts) {
|
|
|
17706
17706
|
});
|
|
17707
17707
|
}
|
|
17708
17708
|
|
|
17709
|
-
// ../../../node_modules/.bun/@trpc+client@11.28.
|
|
17709
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.3+82479501839ae062/node_modules/@trpc/client/dist/objectSpread2-pyA4QVO4.mjs
|
|
17710
17710
|
function _typeof(o) {
|
|
17711
17711
|
"@babel/helpers - typeof";
|
|
17712
17712
|
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o) {
|
|
@@ -17761,7 +17761,7 @@ function _objectSpread2(e) {
|
|
|
17761
17761
|
return e;
|
|
17762
17762
|
}
|
|
17763
17763
|
|
|
17764
|
-
// ../../../node_modules/.bun/@trpc+server@11.28.
|
|
17764
|
+
// ../../../node_modules/.bun/@trpc+server@11.28.3+431a08decb845963/node_modules/@trpc/server/dist/codes-BCsCCyMj.mjs
|
|
17765
17765
|
function isObject2(value) {
|
|
17766
17766
|
return !!value && !Array.isArray(value) && typeof value === "object";
|
|
17767
17767
|
}
|
|
@@ -17798,7 +17798,7 @@ var retryableRpcCodes = [
|
|
|
17798
17798
|
TRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR
|
|
17799
17799
|
];
|
|
17800
17800
|
|
|
17801
|
-
// ../../../node_modules/.bun/@trpc+server@11.28.
|
|
17801
|
+
// ../../../node_modules/.bun/@trpc+server@11.28.3+431a08decb845963/node_modules/@trpc/server/dist/getErrorShape-CVrl8_-w.mjs
|
|
17802
17802
|
var noop = () => {};
|
|
17803
17803
|
var freezeIfAvailable = (obj) => {
|
|
17804
17804
|
if (Object.freeze)
|
|
@@ -17901,7 +17901,7 @@ function _objectSpread22(e) {
|
|
|
17901
17901
|
return e;
|
|
17902
17902
|
}
|
|
17903
17903
|
|
|
17904
|
-
// ../../../node_modules/.bun/@trpc+server@11.28.
|
|
17904
|
+
// ../../../node_modules/.bun/@trpc+server@11.28.3+431a08decb845963/node_modules/@trpc/server/dist/asyncGeneratorDelegate-BRQGtkYG.mjs
|
|
17905
17905
|
function transformResultInner(response, transformer) {
|
|
17906
17906
|
if ("error" in response) {
|
|
17907
17907
|
const error = transformer.deserialize(response.error);
|
|
@@ -17997,7 +17997,7 @@ AsyncGenerator.prototype[typeof Symbol == "function" && Symbol.asyncIterator ||
|
|
|
17997
17997
|
};
|
|
17998
17998
|
var trackedSymbol = Symbol();
|
|
17999
17999
|
|
|
18000
|
-
// ../../../node_modules/.bun/@trpc+client@11.28.
|
|
18000
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.3+82479501839ae062/node_modules/@trpc/client/dist/TRPCClientError-DE6-fd1n.mjs
|
|
18001
18001
|
function isTRPCClientError(cause) {
|
|
18002
18002
|
return cause instanceof TRPCClientError;
|
|
18003
18003
|
}
|
|
@@ -18043,7 +18043,7 @@ var TRPCClientError = class TRPCClientError extends Error {
|
|
|
18043
18043
|
}
|
|
18044
18044
|
};
|
|
18045
18045
|
|
|
18046
|
-
// ../../../node_modules/.bun/@trpc+client@11.28.
|
|
18046
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.3+82479501839ae062/node_modules/@trpc/client/dist/unstable-internals.mjs
|
|
18047
18047
|
function getTransformer(transformer) {
|
|
18048
18048
|
const _transformer = transformer;
|
|
18049
18049
|
if (!_transformer)
|
|
@@ -18065,7 +18065,7 @@ function getTransformer(transformer) {
|
|
|
18065
18065
|
};
|
|
18066
18066
|
}
|
|
18067
18067
|
|
|
18068
|
-
// ../../../node_modules/.bun/@trpc+client@11.28.
|
|
18068
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.3+82479501839ae062/node_modules/@trpc/client/dist/httpUtils-CtMuyl9j.mjs
|
|
18069
18069
|
var isFunction2 = (fn) => typeof fn === "function";
|
|
18070
18070
|
function getFetch(customFetchImpl) {
|
|
18071
18071
|
if (customFetchImpl)
|
|
@@ -18218,7 +18218,7 @@ async function httpRequest(opts) {
|
|
|
18218
18218
|
};
|
|
18219
18219
|
}
|
|
18220
18220
|
|
|
18221
|
-
// ../../../node_modules/.bun/@trpc+client@11.28.
|
|
18221
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.3+82479501839ae062/node_modules/@trpc/client/dist/httpBatchLink-BkVNtNND.mjs
|
|
18222
18222
|
var throwFatalError = () => {
|
|
18223
18223
|
throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
|
|
18224
18224
|
};
|
|
@@ -18413,7 +18413,7 @@ function httpBatchLink(opts) {
|
|
|
18413
18413
|
};
|
|
18414
18414
|
}
|
|
18415
18415
|
|
|
18416
|
-
// ../../../node_modules/.bun/@trpc+client@11.28.
|
|
18416
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.3+82479501839ae062/node_modules/@trpc/client/dist/wsLink-BiIe_j6D.mjs
|
|
18417
18417
|
var resultOf = (value, ...args) => {
|
|
18418
18418
|
return typeof value === "function" ? value(...args) : value;
|
|
18419
18419
|
};
|
|
@@ -18566,7 +18566,7 @@ var WsConnection = class WsConnection {
|
|
|
18566
18566
|
};
|
|
18567
18567
|
_defineProperty(WsConnection, "connectCount", 0);
|
|
18568
18568
|
|
|
18569
|
-
// ../../../node_modules/.bun/@trpc+client@11.28.
|
|
18569
|
+
// ../../../node_modules/.bun/@trpc+client@11.28.3+82479501839ae062/node_modules/@trpc/client/dist/index.mjs
|
|
18570
18570
|
var observerKeys = [
|
|
18571
18571
|
"onStarted",
|
|
18572
18572
|
"onData",
|
|
@@ -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
|
-
|
|
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;
|
|
@@ -21596,7 +21669,8 @@ var recordStaffRedemptionClaimItemsSchema = staffRedemptionSiteIdSchema.extend({
|
|
|
21596
21669
|
var STAFF_REDEMPTION_COUNTER_CLAIM_SCOPES = ["mine", "site"];
|
|
21597
21670
|
var staffRedemptionCounterClaimsSchema = staffRedemptionSiteIdSchema.extend({
|
|
21598
21671
|
limit: number2().int().min(1).max(50).default(20),
|
|
21599
|
-
scope: _enum(STAFF_REDEMPTION_COUNTER_CLAIM_SCOPES).default("mine")
|
|
21672
|
+
scope: _enum(STAFF_REDEMPTION_COUNTER_CLAIM_SCOPES).default("mine"),
|
|
21673
|
+
status: _enum(["all", "items-pending"]).default("all")
|
|
21600
21674
|
}).strict();
|
|
21601
21675
|
var STAFF_REDEMPTION_CLAIM_STATUSES = [
|
|
21602
21676
|
"active",
|
|
@@ -26333,7 +26407,7 @@ var command_manifest_default = [
|
|
|
26333
26407
|
path: ["staff-redemption", "counter", "claims"],
|
|
26334
26408
|
procedure: "event.staffRedemption.getStaffRedemptionCounterClaims",
|
|
26335
26409
|
operation: "query",
|
|
26336
|
-
summary: "List a site's recent claims (limit 1-50, default 20) as the counter sees them. scope mine (default) is the claims you made at the site, site is every claim at the site. Each receipt carries itemsPending and itemsRecordedAt. Needs event.operate.",
|
|
26410
|
+
summary: "List a site's recent claims (limit 1-50, default 20) as the counter sees them. scope mine (default) is the claims you made at the site, site is every claim at the site. status all (default) includes every recent claim; items-pending selects active claims whose food is not recorded before applying the limit. Each receipt carries itemsPending and itemsRecordedAt. Needs event.operate.",
|
|
26337
26411
|
effects: [],
|
|
26338
26412
|
dates: [],
|
|
26339
26413
|
input: {
|
|
@@ -26359,6 +26433,11 @@ var command_manifest_default = [
|
|
|
26359
26433
|
default: "mine",
|
|
26360
26434
|
type: "string",
|
|
26361
26435
|
enum: ["mine", "site"]
|
|
26436
|
+
},
|
|
26437
|
+
status: {
|
|
26438
|
+
default: "all",
|
|
26439
|
+
type: "string",
|
|
26440
|
+
enum: ["all", "items-pending"]
|
|
26362
26441
|
}
|
|
26363
26442
|
},
|
|
26364
26443
|
required: ["eventId", "siteId"],
|