[econ] room storefront purchaseables

This commit is contained in:
Devin Zuczek
2026-10-03 13:57:32 -04:00
parent 41d0b0543a
commit 739176a3ed
4 changed files with 272 additions and 11 deletions
+24
View File
@@ -564,6 +564,30 @@ export const UgcPurchasableItemDto = z.object({
/** What the bulk lookup answers: the resolved items, unknown ids omitted. */
export const UgcPurchasableItemList = z.array(UgcPurchasableItemDto)
/**
* `GET /api/ugcPurchasables/v1/items/room/{roomId}` — one line of a room's shop. The same
* 10 keys as the bulk lookup's item, with `ItemType` naming the kind (0 room key, 1 room
* consumable, 3 currency purchase offer) and `ImageName` nullable, as a key or consumable
* without art is served everywhere else.
*/
export const RoomPurchasableDto = UgcPurchasableItemDto.extend({
ItemType: z
.number()
.int()
.describe('0 RoomKey, 1 RoomConsumable, 3 RoomCurrencyItem (a currency pack for tokens)'),
ItemId: z
.string()
.describe('A bare GUID — the key’s ReplicationId, the consumable’s or offer’s id'),
ImageName: z.string().nullable().describe('Null for a listing with no art'),
PurchaseCurrencyId: z
.string()
.nullable()
.describe('The room currency the line is charged in; null for tokens'),
})
/** The room’s shop — a bare array, empty for a room that sells nothing. */
export const RoomPurchasableList = z.array(RoomPurchasableDto)
/**
* `POST /api/items/purchaseInfos` JSON body — the same `{ itemType, itemId }` reference
* shape the UGC bulk lookup takes, minus the room. camelCase INSIDE the reference, which is