esim-cli 2026.1202.212 → 2026.1202.214

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/dist/esim.js CHANGED
@@ -15001,7 +15001,7 @@ var catalog = [
15001
15001
  { operationId: "GetMyWorkShift", name: "get-my-work-shift", method: "GET", path: "/api/work-shifts", spec: "business.yaml", write: false, retry: "unsafe", description: "Read the citizen's current game day and today's normal work settlement.", parameters: [], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["currentDay", "energy"], properties: { currentDay: { type: "integer" }, energy: { type: "integer" }, settlement: { type: "object", additionalProperties: false, required: ["day", "currency", "grossSalary", "netSalary", "incomeTax", "xpGained", "economySkillGained", "workStreak", "hardWorkerMedals", "hardWorkerProgress", "hardWorkerGoal", "product", "quality", "unitsProduced", "baseProductivity", "totalProductivity", "modifiers"], properties: { day: { type: "integer" }, currency: { type: "string", pattern: "^cur:[0-9]+$" }, grossSalary: { type: "integer", format: "int64" }, netSalary: { type: "integer", format: "int64" }, incomeTax: { type: "integer", format: "int64" }, xpGained: { type: "integer" }, economySkillGained: { type: "number", format: "double" }, workStreak: { type: "integer" }, hardWorkerMedals: { type: "integer" }, hardWorkerProgress: { type: "integer" }, hardWorkerGoal: { type: "integer" }, product: { type: "string", enum: ["food", "weapon", "minerals", "small_drink", "large_drink", "snack", "meal", "pistol", "rifle", "ticket_economy", "ticket_business", "knife", "house", "mansion", "boat", "yacht", "defense_system", "hospital", "iron", "grain", "oil", "stone", "wood"] }, quality: { type: "integer" }, unitsProduced: { type: "integer", format: "int64" }, baseProductivity: { type: ["number", "null"], format: "double" }, totalProductivity: { type: ["number", "null"], format: "double" }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { type: "string", enum: ["workersMultiplier", "companyBonus", "rawRegionPenalty", "capitalPenalty", "employerEquipmentBonus"] }, value: { type: "number", format: "double" } } } } } } } } } }, responseFields: ["currentDay", "energy", "settlement"] },
15002
15002
  { operationId: "RecordWorkShift", name: "record-work-shift", method: "POST", path: "/api/work-shifts", spec: "business.yaml", write: true, retry: "natural", description: "Record today’s company shift with an empty object.", parameters: [{ name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", additionalProperties: false } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["day", "energy"], properties: { settlement: { type: "object", additionalProperties: false, required: ["day", "currency", "grossSalary", "netSalary", "incomeTax", "xpGained", "economySkillGained", "workStreak", "hardWorkerMedals", "hardWorkerProgress", "hardWorkerGoal", "product", "quality", "unitsProduced", "baseProductivity", "totalProductivity", "modifiers"], properties: { day: { type: "integer" }, currency: { type: "string", pattern: "^cur:[0-9]+$" }, grossSalary: { type: "integer", format: "int64" }, netSalary: { type: "integer", format: "int64" }, incomeTax: { type: "integer", format: "int64" }, xpGained: { type: "integer" }, economySkillGained: { type: "number", format: "double" }, workStreak: { type: "integer" }, hardWorkerMedals: { type: "integer" }, hardWorkerProgress: { type: "integer" }, hardWorkerGoal: { type: "integer" }, product: { type: "string", enum: ["food", "weapon", "minerals", "small_drink", "large_drink", "snack", "meal", "pistol", "rifle", "ticket_economy", "ticket_business", "knife", "house", "mansion", "boat", "yacht", "defense_system", "hospital", "iron", "grain", "oil", "stone", "wood"] }, quality: { type: "integer" }, unitsProduced: { type: "integer", format: "int64" }, baseProductivity: { type: ["number", "null"], format: "double" }, totalProductivity: { type: ["number", "null"], format: "double" }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { type: "string", enum: ["workersMultiplier", "companyBonus", "rawRegionPenalty", "capitalPenalty", "employerEquipmentBonus"] }, value: { type: "number", format: "double" } } } } } }, day: { type: "integer", format: "int64", minimum: 1 }, energy: { type: "integer", format: "int64", minimum: 0, maximum: 100 } } } } }, responseFields: ["settlement", "day", "energy"] },
15003
15003
  { operationId: "GetMyIndustryWarehouse", name: "get-my-industry-warehouse", method: "GET", path: "/api/industry/warehouses/me", spec: "business.yaml", write: false, retry: "unsafe", description: "Citizen session required. Read the citizen's private industry inventory, production lines and housing.", parameters: [], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["raw", "products", "lines", "house", "restDay"], properties: { raw: { type: "object", additionalProperties: { type: "integer", format: "int64", minimum: 0 } }, products: { type: "object", description: "Counts indexed by product and quality, e.g. food:2.", additionalProperties: { type: "integer", format: "int64", minimum: 0 } }, lines: { type: "object", additionalProperties: { type: "integer", format: "int64", minimum: 1, maximum: 5 } }, house: { type: "integer", format: "int64", minimum: 0, maximum: 10 }, restDay: { type: ["integer", "null"], minimum: 1 } } } } }, responseFields: ["raw", "products", "lines", "house", "restDay"] },
15004
- { operationId: "UseIndustryProduct", name: "use-industry-product", method: "POST", path: "/api/industry/product-uses", spec: "business.yaml", write: true, retry: "unsafe", description: "Citizen session required. TICKET_ECONOMY and TICKET_BUSINESS use only land. Economy travel costs 40 health and business travel costs zero. Each successful trip grants 5 XP. SMALL_DRINK and LARGE_DRINK require quality 0 and a target.", parameters: [{ name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["item"], properties: { item: { type: "string", enum: ["TICKET_ECONOMY", "TICKET_BUSINESS", "SMALL_DRINK", "LARGE_DRINK"] }, quality: { type: "integer", format: "int64", minimum: 0, maximum: 5 }, land: { type: "integer", format: "int64", minimum: 0 }, target: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." } } } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["equipmentDrop"], properties: { equipmentDrop: { "x-go-type": "gearapi.Equipment", "x-go-type-import": { name: "gearapi", path: "open-esim/api/equipment/apigen" }, anyOf: [{ type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } }, { type: "null" }] } } } }, "204": { kind: "empty" } }, responseFields: ["equipmentDrop"] },
15004
+ { operationId: "UseIndustryProduct", name: "use-industry-product", method: "POST", path: "/api/industry/product-uses", spec: "business.yaml", write: true, retry: "unsafe", description: "Citizen session required. TICKET_ECONOMY and TICKET_BUSINESS use only land. Economy travel costs 40 health and business travel costs zero. Each successful trip grants 5 XP. SMALL_DRINK and LARGE_DRINK require quality 0 and a target.", parameters: [{ name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["item"], properties: { item: { type: "string", enum: ["TICKET_ECONOMY", "TICKET_BUSINESS", "SMALL_DRINK", "LARGE_DRINK"] }, quality: { type: "integer", format: "int64", minimum: 0, maximum: 5 }, land: { type: "integer", format: "int64", minimum: 0 }, target: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." } } } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["equipmentDrop"], properties: { equipmentDrop: { "x-go-type": "gearapi.Equipment", "x-go-type-import": { name: "gearapi", path: "open-esim/api/equipment/apigen" }, anyOf: [{ type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, giftEligibility: { type: "string", description: "Owner-only gift status. An unworn item is eligible if it has never been worn or was last worn on a prior game date.", enum: ["eligible", "equipped", "wear_cooldown"], "x-enum-varnames": ["EquipmentGiftEligibilityEligible", "EquipmentGiftEligibilityEquipped", "EquipmentGiftEligibilityWearCooldown"] }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } }, { type: "null" }] } } } }, "204": { kind: "empty" } }, responseFields: ["equipmentDrop"] },
15005
15005
  { operationId: "listPartyRankings", name: "list-party-rankings", method: "GET", path: "/api/party-rankings", spec: "civic.yaml", write: false, retry: "unsafe", description: "Rank parties by the selected metric in descending order, then by ascending ID.", parameters: [{ name: "nation", in: "query", schema: { type: "integer", minimum: 0 } }, { name: "statisticType", in: "query", schema: { type: "string", enum: ["PRESTIGE", "MEMBERS", "CONGRESS", "PRESIDENTS", "LAWS_ACCEPTED"], default: "MEMBERS" } }, { name: "q", in: "query", description: "Case-insensitive substring of the party name, matched like citizen search.", schema: { type: "string", minLength: 1, maxLength: 100 } }, { name: "order", in: "query", description: "Ranking direction (default desc). asc returns the exact reverse; rank stays the descending rank.", schema: { type: "string", enum: ["asc", "desc"] } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "array", items: { type: "object", required: ["id", "name", "nation", "value", "rank"], properties: { id: { type: "integer", format: "int64" }, name: { type: "string" }, nation: { type: "integer" }, value: { type: "integer" }, rank: { type: "integer" }, avatarVersion: { type: "string" } } } } } }, responseFields: [] },
15006
15006
  { operationId: "listCoalitionRankings", name: "list-coalition-rankings", method: "GET", path: "/api/coalition-rankings", spec: "civic.yaml", write: false, retry: "unsafe", description: "listCoalitionRankings", parameters: [], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "array", items: { type: "object", required: ["id", "name", "memberCount", "regionCount", "citizenCount", "battlePoints"], properties: { id: { type: "integer", format: "int64" }, name: { type: "string" }, memberCount: { type: "integer", format: "int64" }, regionCount: { type: "integer", format: "int64" }, citizenCount: { type: "integer", format: "int64" }, battlePoints: { type: "integer", format: "int64" }, president: { type: "object", required: ["id", "name", "nation", "level"], properties: { id: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, name: { type: "string" }, nation: { type: "integer" }, level: { type: "integer" }, avatarVersion: { type: "string" } } } } } } } }, responseFields: [] },
15007
15007
  { operationId: "listCoalitions", name: "list-coalitions", method: "GET", path: "/api/coalitions", spec: "civic.yaml", write: false, retry: "unsafe", description: "listCoalitions", parameters: [], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "array", items: { type: "object", required: ["id", "name", "leader", "members"], properties: { id: { type: "integer", format: "int64" }, name: { type: "string" }, leader: { type: "integer" }, secretary: { type: "integer" }, description: { type: "string" }, members: { type: "array", items: { type: "integer" } }, battle: { type: "integer", format: "int64" }, side: { type: "string" }, bonusBps: { type: "integer", format: "int64", description: "Damage bonus for the current order in basis points" } } } } } }, responseFields: [] },
@@ -15141,18 +15141,18 @@ Each submission of the built-in gold code awards 50 gold. For other codes, a ret
15141
15141
  { operationId: "GetMyGarage", name: "get-my-garage", method: "GET", path: "/api/me/garage", spec: "garage.yaml", write: false, retry: "unsafe", description: "GetMyGarage", parameters: [], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", required: ["platinumCoins", "owned", "selected"], properties: { platinumCoins: { type: "integer", format: "int64", minimum: 0 }, owned: { type: "array", items: { type: "string" } }, selected: { type: "object", required: ["car", "neon"], properties: { car: { type: "string" }, neon: { type: "string" } } } } } } }, responseFields: ["platinumCoins", "owned", "selected"] },
15142
15142
  { operationId: "PurchaseGarageItem", name: "purchase-garage-item", method: "POST", path: "/api/me/garage/purchases", spec: "garage.yaml", write: true, retry: "key", description: "PurchaseGarageItem", parameters: [{ name: "Origin", in: "header", required: true, schema: { type: "string" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["item", "requestId"], properties: { item: { type: "string" }, requestId: { type: "string", minLength: 1, maxLength: 128 } } } }, requestKey: "requestId", requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", required: ["item", "paid", "balanceAfter"], properties: { item: { type: "string" }, paid: { type: "integer", format: "int64", minimum: 1 }, balanceAfter: { type: "integer", format: "int64", minimum: 0 } } } } }, responseFields: ["item", "paid", "balanceAfter"] },
15143
15143
  { operationId: "SetMyGarageSelection", name: "set-my-garage-selection", method: "PUT", path: "/api/me/garage/selection", spec: "garage.yaml", write: true, retry: "natural", description: "SetMyGarageSelection", parameters: [{ name: "Origin", in: "header", required: true, schema: { type: "string" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["kind", "item"], properties: { kind: { type: "string", enum: ["car", "neon"] }, item: { type: "string" } } } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", required: ["platinumCoins", "owned", "selected"], properties: { platinumCoins: { type: "integer", format: "int64", minimum: 0 }, owned: { type: "array", items: { type: "string" } }, selected: { type: "object", required: ["car", "neon"], properties: { car: { type: "string" }, neon: { type: "string" } } } } } } }, responseFields: ["platinumCoins", "owned", "selected"] },
15144
- { operationId: "ListEquippedItems", name: "list-equipped-items", method: "GET", path: "/api/equipment", spec: "gear.yaml", write: false, retry: "unsafe", description: "Public. List publicly visible worn equipment by ID.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor from the previous page. Reuse the same filters.", schema: { type: "string" } }, { name: "limit", in: "query", description: "Maximum number of results.", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }, { name: "owner", in: "query", description: "Filter by public owner ID.", schema: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } }, nextCursor: { type: ["string", "null"] }, recycleAvailableAt: { type: "string", format: "date-time", description: "Next permitted recycling time, included for the signed-in owner's first page when a recycling record exists." }, total: { type: "integer", format: "int64", minimum: 0, description: "In the signed-in owner's listing, the number of items matching every filter before pagination." }, recyclableQualities: { type: "array", description: "Qualities available in this citizen's recycler, independent of browsing filters.", items: { type: "integer" } }, rules: { type: "object", additionalProperties: false, description: "Fees and limits for owner equipment operations.", required: ["merge", "descriptionFee", "descriptionMaxLength"], properties: { merge: { type: "array", description: "Fee for merging three unworn items of a quality into one item a quality higher.", items: { type: "object", additionalProperties: false, required: ["quality", "fee"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of the three materials." }, fee: { type: "integer", format: "int64", description: "Gold fee in monetary units." } } } }, descriptionFee: { type: "integer", format: "int64", description: "Gold fee in monetary units for changing a description. Saving the same text is free." }, descriptionMaxLength: { type: "integer", description: "Maximum UTF-16 code units in a single-line description." } } } } } } }, responseFields: ["items", "nextCursor", "recycleAvailableAt", "total", "recyclableQualities", "rules"] },
15144
+ { operationId: "ListEquippedItems", name: "list-equipped-items", method: "GET", path: "/api/equipment", spec: "gear.yaml", write: false, retry: "unsafe", description: "Public. List publicly visible worn equipment by ID.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor from the previous page. Reuse the same filters.", schema: { type: "string" } }, { name: "limit", in: "query", description: "Maximum number of results.", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }, { name: "owner", in: "query", description: "Filter by public owner ID.", schema: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, giftEligibility: { type: "string", description: "Owner-only gift status. An unworn item is eligible if it has never been worn or was last worn on a prior game date.", enum: ["eligible", "equipped", "wear_cooldown"], "x-enum-varnames": ["EquipmentGiftEligibilityEligible", "EquipmentGiftEligibilityEquipped", "EquipmentGiftEligibilityWearCooldown"] }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } }, nextCursor: { type: ["string", "null"] }, recycleAvailableAt: { type: "string", format: "date-time", description: "Next permitted recycling time, included for the signed-in owner's first page when a recycling record exists." }, total: { type: "integer", format: "int64", minimum: 0, description: "In the signed-in owner's listing, the number of items matching every filter before pagination." }, recyclableQualities: { type: "array", description: "Qualities available in this citizen's recycler, independent of browsing filters.", items: { type: "integer" } }, rules: { type: "object", additionalProperties: false, description: "Fees and limits for owner equipment operations.", required: ["merge", "descriptionFee", "descriptionMaxLength"], properties: { merge: { type: "array", description: "Fee for merging three unworn items of a quality into one item a quality higher.", items: { type: "object", additionalProperties: false, required: ["quality", "fee"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of the three materials." }, fee: { type: "integer", format: "int64", description: "Gold fee in monetary units." } } } }, descriptionFee: { type: "integer", format: "int64", description: "Gold fee in monetary units for changing a description. Saving the same text is free." }, descriptionMaxLength: { type: "integer", description: "Maximum UTF-16 code units in a single-line description." } } } } } } }, responseFields: ["items", "nextCursor", "recycleAvailableAt", "total", "recyclableQualities", "rules"] },
15145
15145
  { operationId: "GetEquipment", name: "get-equipment", method: "GET", path: "/api/equipment/{id}", spec: "gear.yaml", write: false, retry: "unsafe", description: "Public. Return the current details of a single equipment item by ID.", parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "slot", "quality", "modifiers", "status", "origin"], properties: { origin: { type: "object", additionalProperties: false, required: ["kind", "createdAt"], properties: { kind: { type: "string", enum: ["unknown", "merge", "split", "battleDrop", "travelDrop", "itemVendor", "tutorialReward", "tournamentReward", "promoReward", "banditReward", "diceReward", "inviteReward", "other"] }, createdAt: { type: "string", format: "date-time" }, citizenId: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, citizenName: { type: "string", description: "Name recorded at creation, when available." }, reference: { type: "string", description: "Related object identifier. Its meaning depends on kind." } } }, id: { type: "integer", format: "int64", minimum: 1 }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, name: { type: "string" }, description: { type: "string" }, set: { type: "string" }, status: { type: "string", enum: ["equipped", "stored", "auction", "contract"] }, inYourStorage: { description: "Present and true only when the item is stored and belongs to the authenticated viewer.", type: "boolean" }, owner: { type: "object", additionalProperties: false, description: "Current citizen owner. Present only while the item is equipped.", required: ["id", "name"], properties: { id: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, name: { type: "string" } } }, auctionId: { allOf: [{ type: "integer", format: "int64", minimum: 1 }, { description: "Public listing ID when the item is in auction escrow." }] } } } } }, responseFields: ["origin", "id", "slot", "quality", "modifiers", "name", "description", "set", "status", "inYourStorage", "owner", "auctionId"] },
15146
15146
  { operationId: "GetAuctionEquipment", name: "get-auction-equipment", method: "GET", path: "/api/equipment/auctions/{auctionId}", spec: "gear.yaml", write: false, retry: "unsafe", description: "Public equipment details captured for the listing. Older closed listings may only have an ID, slot and quality.", parameters: [{ name: "auctionId", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "slot", "quality"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, name: { type: "string" }, set: { type: "string" }, mergedBy: { type: "string", description: "Name recorded when the equipment was merged." }, modifiers: { type: "array", description: "Original order, including repeated and historical kinds.", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { type: "string" }, value: { type: "integer", description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } } } } } }, responseFields: ["id", "slot", "quality", "name", "set", "mergedBy", "modifiers"] },
15147
15147
  { operationId: "GetLatestEquipmentAuction", name: "get-latest-equipment-auction", method: "GET", path: "/api/equipment/latest-auctions/{id}", spec: "gear.yaml", write: false, retry: "unsafe", description: "Public. Return the latest public equipment listing snapshot, including closed listings.", parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", required: ["auctionId", "equipment"], properties: { auctionId: { type: "integer", format: "int64", minimum: 1 }, equipment: { type: "object", additionalProperties: false, required: ["id", "slot", "quality"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, name: { type: "string" }, set: { type: "string" }, mergedBy: { type: "string", description: "Name recorded when the equipment was merged." }, modifiers: { type: "array", description: "Original order, including repeated and historical kinds.", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { type: "string" }, value: { type: "integer", description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } } } } } } } }, responseFields: ["auctionId", "equipment"] },
15148
- { operationId: "ListMyEquipment", name: "list-my-equipment", method: "GET", path: "/api/equipment/me", spec: "gear.yaml", write: false, retry: "unsafe", description: "Citizen session required. List equipment owned by the signed-in citizen. Filters combine and sorting happens across all pages. The recycler includes only unworn equipment with a recycle reward.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor from the previous page. Reuse the same filters.", schema: { type: "string" } }, { name: "limit", in: "query", description: "Maximum number of results.", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }, { name: "page", in: "query", description: "Zero-based page. Defaults to quality descending when sort is omitted. Use instead of cursor.", schema: { type: "integer", minimum: 0, maximum: 2147483646 } }, { name: "recycler", in: "query", description: "Browse the equipment recycler.", schema: { type: "boolean" } }, { name: "slot", in: "query", description: "Only equipment for this slot.", schema: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } }, { name: "quality", in: "query", description: "Only equipment of this quality.", schema: { type: "integer", minimum: 1, maximum: 8 } }, { name: "equipped", in: "query", description: "true lists worn equipment only; false lists unworn equipment only.", schema: { type: "boolean" } }, { name: "stat", in: "query", description: "Only equipment containing every supplied modifier kind.", schema: { type: "array", items: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] } } }, { name: "sort", in: "query", description: "Sort key. Cursor listings default to id. The id sort defaults to asc. Quality and modifier kinds default to desc and break ties by id ascending. Modifier sorting sums repeated modifiers on one item and uses zero for absent modifiers.", schema: { type: "string", enum: ["id", "quality", "baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"], "x-enum-varnames": ["Id", "Quality", "SortByBaseHit", "SortByStrength", "SortByMissChanceReduction", "SortByDamagePercent", "SortByCriticalChance", "SortByMaxDamagePercent", "SortByAvoidEnergyChance", "SortByMorningDamagePercent", "SortByNoonDamagePercent", "SortByEveningDamagePercent", "SortByNightDamagePercent", "SortBySaveWeaponChance", "SortByFindWeaponChance", "SortByEconomySkillHundredths", "SortByFreeFlightChance", "SortByIronProductionPercent", "SortByWoodProductionPercent", "SortByGrainProductionPercent", "SortByOilProductionPercent", "SortByDiamondProductionPercent", "SortByFoodProductionPercent", "SortByWeaponProductionPercent", "SortByTicketProductionPercent", "SortByImprovedSplitChance", "SortBySaveAmmunitionChance", "SortByRestorationChance", "SortByBonusMergeChance", "SortByOtherParametersPercent", "SortByMergePriceReduction", "SortByHitMinBonus", "SortByHitMaxBonus", "SortByAccuracy", "SortByEndurance", "SortByGuard", "SortByAgility", "SortByImpact"] } }, { name: "order", in: "query", description: "Sort direction. Defaults to the sort key's direction.", schema: { type: "string", enum: ["asc", "desc"] } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } }, nextCursor: { type: ["string", "null"] }, recycleAvailableAt: { type: "string", format: "date-time", description: "Next permitted recycling time, included for the signed-in owner's first page when a recycling record exists." }, total: { type: "integer", format: "int64", minimum: 0, description: "In the signed-in owner's listing, the number of items matching every filter before pagination." }, recyclableQualities: { type: "array", description: "Qualities available in this citizen's recycler, independent of browsing filters.", items: { type: "integer" } }, rules: { type: "object", additionalProperties: false, description: "Fees and limits for owner equipment operations.", required: ["merge", "descriptionFee", "descriptionMaxLength"], properties: { merge: { type: "array", description: "Fee for merging three unworn items of a quality into one item a quality higher.", items: { type: "object", additionalProperties: false, required: ["quality", "fee"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of the three materials." }, fee: { type: "integer", format: "int64", description: "Gold fee in monetary units." } } } }, descriptionFee: { type: "integer", format: "int64", description: "Gold fee in monetary units for changing a description. Saving the same text is free." }, descriptionMaxLength: { type: "integer", description: "Maximum UTF-16 code units in a single-line description." } } } } } } }, responseFields: ["items", "nextCursor", "recycleAvailableAt", "total", "recyclableQualities", "rules"] },
15149
- { operationId: "WearEquipment", name: "wear-equipment", method: "POST", path: "/api/equipment/{id}/wear", spec: "gear.yaml", write: true, retry: "unsafe", description: "Citizen session required. Wear owned equipment, replacing the item currently worn in the same slot.", parameters: [{ name: "id", in: "path", required: true, description: "Resource ID.", schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", additionalProperties: false } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } } }, responseFields: ["id", "owner", "slot", "quality", "equipped", "description", "name", "set", "modifiers", "recycleReward", "split", "upgrades"] },
15148
+ { operationId: "ListMyEquipment", name: "list-my-equipment", method: "GET", path: "/api/equipment/me", spec: "gear.yaml", write: false, retry: "unsafe", description: "Citizen session required. List equipment owned by the signed-in citizen. Filters combine and sorting happens across all pages. The recycler includes only unworn equipment with a recycle reward. Each item includes its gift eligibility as of the current game date.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor from the previous page. Reuse the same filters.", schema: { type: "string" } }, { name: "limit", in: "query", description: "Maximum number of results.", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }, { name: "page", in: "query", description: "Zero-based page. Defaults to quality descending when sort is omitted. Use instead of cursor.", schema: { type: "integer", minimum: 0, maximum: 2147483646 } }, { name: "recycler", in: "query", description: "Browse the equipment recycler.", schema: { type: "boolean" } }, { name: "slot", in: "query", description: "Only equipment for this slot.", schema: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } }, { name: "quality", in: "query", description: "Only equipment of this quality.", schema: { type: "integer", minimum: 1, maximum: 8 } }, { name: "equipped", in: "query", description: "true lists worn equipment only; false lists unworn equipment only.", schema: { type: "boolean" } }, { name: "stat", in: "query", description: "Only equipment containing every supplied modifier kind.", schema: { type: "array", items: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] } } }, { name: "sort", in: "query", description: "Sort key. Cursor listings default to id. The id sort defaults to asc. Quality and modifier kinds default to desc and break ties by id ascending. Modifier sorting sums repeated modifiers on one item and uses zero for absent modifiers.", schema: { type: "string", enum: ["id", "quality", "baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"], "x-enum-varnames": ["Id", "Quality", "SortByBaseHit", "SortByStrength", "SortByMissChanceReduction", "SortByDamagePercent", "SortByCriticalChance", "SortByMaxDamagePercent", "SortByAvoidEnergyChance", "SortByMorningDamagePercent", "SortByNoonDamagePercent", "SortByEveningDamagePercent", "SortByNightDamagePercent", "SortBySaveWeaponChance", "SortByFindWeaponChance", "SortByEconomySkillHundredths", "SortByFreeFlightChance", "SortByIronProductionPercent", "SortByWoodProductionPercent", "SortByGrainProductionPercent", "SortByOilProductionPercent", "SortByDiamondProductionPercent", "SortByFoodProductionPercent", "SortByWeaponProductionPercent", "SortByTicketProductionPercent", "SortByImprovedSplitChance", "SortBySaveAmmunitionChance", "SortByRestorationChance", "SortByBonusMergeChance", "SortByOtherParametersPercent", "SortByMergePriceReduction", "SortByHitMinBonus", "SortByHitMaxBonus", "SortByAccuracy", "SortByEndurance", "SortByGuard", "SortByAgility", "SortByImpact"] } }, { name: "order", in: "query", description: "Sort direction. Defaults to the sort key's direction.", schema: { type: "string", enum: ["asc", "desc"] } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, giftEligibility: { type: "string", description: "Owner-only gift status. An unworn item is eligible if it has never been worn or was last worn on a prior game date.", enum: ["eligible", "equipped", "wear_cooldown"], "x-enum-varnames": ["EquipmentGiftEligibilityEligible", "EquipmentGiftEligibilityEquipped", "EquipmentGiftEligibilityWearCooldown"] }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } }, nextCursor: { type: ["string", "null"] }, recycleAvailableAt: { type: "string", format: "date-time", description: "Next permitted recycling time, included for the signed-in owner's first page when a recycling record exists." }, total: { type: "integer", format: "int64", minimum: 0, description: "In the signed-in owner's listing, the number of items matching every filter before pagination." }, recyclableQualities: { type: "array", description: "Qualities available in this citizen's recycler, independent of browsing filters.", items: { type: "integer" } }, rules: { type: "object", additionalProperties: false, description: "Fees and limits for owner equipment operations.", required: ["merge", "descriptionFee", "descriptionMaxLength"], properties: { merge: { type: "array", description: "Fee for merging three unworn items of a quality into one item a quality higher.", items: { type: "object", additionalProperties: false, required: ["quality", "fee"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of the three materials." }, fee: { type: "integer", format: "int64", description: "Gold fee in monetary units." } } } }, descriptionFee: { type: "integer", format: "int64", description: "Gold fee in monetary units for changing a description. Saving the same text is free." }, descriptionMaxLength: { type: "integer", description: "Maximum UTF-16 code units in a single-line description." } } } } } } }, responseFields: ["items", "nextCursor", "recycleAvailableAt", "total", "recyclableQualities", "rules"] },
15149
+ { operationId: "WearEquipment", name: "wear-equipment", method: "POST", path: "/api/equipment/{id}/wear", spec: "gear.yaml", write: true, retry: "unsafe", description: "Citizen session required. Wear owned equipment, replacing the item currently worn in the same slot.", parameters: [{ name: "id", in: "path", required: true, description: "Resource ID.", schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", additionalProperties: false } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, giftEligibility: { type: "string", description: "Owner-only gift status. An unworn item is eligible if it has never been worn or was last worn on a prior game date.", enum: ["eligible", "equipped", "wear_cooldown"], "x-enum-varnames": ["EquipmentGiftEligibilityEligible", "EquipmentGiftEligibilityEquipped", "EquipmentGiftEligibilityWearCooldown"] }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } } }, responseFields: ["id", "owner", "slot", "quality", "equipped", "giftEligibility", "description", "name", "set", "modifiers", "recycleReward", "split", "upgrades"] },
15150
15150
  { operationId: "UnwearEquipment", name: "unwear-equipment", method: "DELETE", path: "/api/equipment/{id}/wear", spec: "gear.yaml", write: true, retry: "natural", description: "Citizen session required. Remove an owned item from its slot.", parameters: [{ name: "id", in: "path", required: true, description: "Resource ID.", schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], requiresCredentials: true, responses: { "204": { kind: "empty" } }, responseFields: [] },
15151
15151
  { operationId: "GetMyEquipmentStats", name: "get-my-equipment-stats", method: "GET", path: "/api/equipment/me/stats", spec: "gear.yaml", write: false, retry: "unsafe", description: "Citizen session required. Read current equipment bonuses. Probability fields use basis points; base combat chances are excluded.", parameters: [], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } }, description: "Sum of equipped modifiers by kind. Chance fields are capped at 10000 basis points." } } }, responseFields: [] },
15152
- { operationId: "MergeEquipment", name: "merge-equipment", method: "POST", path: "/api/equipment/merges", spec: "gear.yaml", write: true, retry: "natural", description: "Citizen session required. Consume three unworn items of the same quality and the merge fee. Create an item one quality higher. Each material contributes a 25% chance for its set. The Q1 through Q7 fees in monetary units are 30, 100, 300, 900, 2700, 8100, and 20000.", parameters: [{ name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["itemIds"], properties: { itemIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 }, minItems: 3, maxItems: 3, uniqueItems: true, description: "Each material has an equal chance to determine the result slot." } } } }, requiresCredentials: true, responses: { "201": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } } }, responseFields: ["id", "owner", "slot", "quality", "equipped", "description", "name", "set", "modifiers", "recycleReward", "split", "upgrades"] },
15153
- { operationId: "SplitEquipment", name: "split-equipment", method: "POST", path: "/api/equipment/{id}/split", spec: "gear.yaml", write: true, retry: "natural", description: "Citizen session required. Split an unworn Q2–Q8 item into two items one quality lower. The first keeps the original slot. The second draws a candidate slot.", parameters: [{ name: "id", in: "path", required: true, description: "Resource ID.", schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", additionalProperties: false } }, requiresCredentials: true, responses: { "201": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } }, minItems: 2, maxItems: 2 } } } } }, responseFields: ["items"] },
15154
- { operationId: "UpgradeEquipmentParameter", name: "upgrade-equipment-parameter", method: "POST", path: "/api/equipment/{id}/parameter-upgrades", spec: "gear.yaml", write: true, retry: "unsafe", description: "Improve one modifier of owned equipment.", parameters: [{ name: "id", in: "path", required: true, description: "Resource ID.", schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", required: ["index"], additionalProperties: false, properties: { index: { type: "integer", minimum: 0, description: "Zero-based modifier position." } } } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } } }, responseFields: ["id", "owner", "slot", "quality", "equipped", "description", "name", "set", "modifiers", "recycleReward", "split", "upgrades"] },
15155
- { operationId: "EditEquipmentDescription", name: "edit-equipment-description", method: "POST", path: "/api/equipment/{id}/description", spec: "gear.yaml", write: true, retry: "natural", description: "Set or clear the public description for owned equipment. The single-line input may contain up to 75 UTF-16 code units.", parameters: [{ name: "id", in: "path", required: true, description: "Resource ID.", schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", required: ["description"], additionalProperties: false, properties: { description: { type: "string" } } } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } } }, responseFields: ["id", "owner", "slot", "quality", "equipped", "description", "name", "set", "modifiers", "recycleReward", "split", "upgrades"] },
15152
+ { operationId: "MergeEquipment", name: "merge-equipment", method: "POST", path: "/api/equipment/merges", spec: "gear.yaml", write: true, retry: "natural", description: "Citizen session required. Consume three unworn items of the same quality and the merge fee. Create an item one quality higher. Each material contributes a 25% chance for its set. The Q1 through Q7 fees in monetary units are 30, 100, 300, 900, 2700, 8100, and 20000.", parameters: [{ name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["itemIds"], properties: { itemIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 }, minItems: 3, maxItems: 3, uniqueItems: true, description: "Each material has an equal chance to determine the result slot." } } } }, requiresCredentials: true, responses: { "201": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, giftEligibility: { type: "string", description: "Owner-only gift status. An unworn item is eligible if it has never been worn or was last worn on a prior game date.", enum: ["eligible", "equipped", "wear_cooldown"], "x-enum-varnames": ["EquipmentGiftEligibilityEligible", "EquipmentGiftEligibilityEquipped", "EquipmentGiftEligibilityWearCooldown"] }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } } }, responseFields: ["id", "owner", "slot", "quality", "equipped", "giftEligibility", "description", "name", "set", "modifiers", "recycleReward", "split", "upgrades"] },
15153
+ { operationId: "SplitEquipment", name: "split-equipment", method: "POST", path: "/api/equipment/{id}/split", spec: "gear.yaml", write: true, retry: "natural", description: "Citizen session required. Split an unworn Q2–Q8 item into two items one quality lower. The first keeps the original slot. The second draws a candidate slot.", parameters: [{ name: "id", in: "path", required: true, description: "Resource ID.", schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", additionalProperties: false } }, requiresCredentials: true, responses: { "201": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, giftEligibility: { type: "string", description: "Owner-only gift status. An unworn item is eligible if it has never been worn or was last worn on a prior game date.", enum: ["eligible", "equipped", "wear_cooldown"], "x-enum-varnames": ["EquipmentGiftEligibilityEligible", "EquipmentGiftEligibilityEquipped", "EquipmentGiftEligibilityWearCooldown"] }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } }, minItems: 2, maxItems: 2 } } } } }, responseFields: ["items"] },
15154
+ { operationId: "UpgradeEquipmentParameter", name: "upgrade-equipment-parameter", method: "POST", path: "/api/equipment/{id}/parameter-upgrades", spec: "gear.yaml", write: true, retry: "unsafe", description: "Improve one modifier of owned equipment.", parameters: [{ name: "id", in: "path", required: true, description: "Resource ID.", schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", required: ["index"], additionalProperties: false, properties: { index: { type: "integer", minimum: 0, description: "Zero-based modifier position." } } } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, giftEligibility: { type: "string", description: "Owner-only gift status. An unworn item is eligible if it has never been worn or was last worn on a prior game date.", enum: ["eligible", "equipped", "wear_cooldown"], "x-enum-varnames": ["EquipmentGiftEligibilityEligible", "EquipmentGiftEligibilityEquipped", "EquipmentGiftEligibilityWearCooldown"] }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } } }, responseFields: ["id", "owner", "slot", "quality", "equipped", "giftEligibility", "description", "name", "set", "modifiers", "recycleReward", "split", "upgrades"] },
15155
+ { operationId: "EditEquipmentDescription", name: "edit-equipment-description", method: "POST", path: "/api/equipment/{id}/description", spec: "gear.yaml", write: true, retry: "natural", description: "Set or clear the public description for owned equipment. The single-line input may contain up to 75 UTF-16 code units.", parameters: [{ name: "id", in: "path", required: true, description: "Resource ID.", schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", required: ["description"], additionalProperties: false, properties: { description: { type: "string" } } } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "owner", "slot", "quality", "equipped", "modifiers"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, owner: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, slot: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] }, quality: { type: "integer", minimum: 1, maximum: 8 }, equipped: { type: "boolean" }, giftEligibility: { type: "string", description: "Owner-only gift status. An unworn item is eligible if it has never been worn or was last worn on a prior game date.", enum: ["eligible", "equipped", "wear_cooldown"], "x-enum-varnames": ["EquipmentGiftEligibilityEligible", "EquipmentGiftEligibilityEquipped", "EquipmentGiftEligibilityWearCooldown"] }, description: { type: "string" }, name: { type: "string", description: "Catalog name for the slot, quality and set, such as Binoculars." }, set: { type: "string", description: "Named equipment set, when the item belongs to one." }, modifiers: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "value"], properties: { kind: { description: "For missChanceReduction, subtract the modifier value in basis points from the base miss chance.", type: "string", enum: ["baseHit", "strength", "missChanceReduction", "damagePercent", "criticalChance", "maxDamagePercent", "avoidEnergyChance", "morningDamagePercent", "noonDamagePercent", "eveningDamagePercent", "nightDamagePercent", "saveWeaponChance", "findWeaponChance", "economySkillHundredths", "freeFlightChance", "ironProductionPercent", "woodProductionPercent", "grainProductionPercent", "oilProductionPercent", "diamondProductionPercent", "foodProductionPercent", "weaponProductionPercent", "ticketProductionPercent", "improvedSplitChance", "saveAmmunitionChance", "restorationChance", "bonusMergeChance", "otherParametersPercent", "mergePriceReduction", "hitMinBonus", "hitMaxBonus", "accuracy", "endurance", "guard", "agility", "impact"] }, value: { type: "integer", minimum: 0, description: "Percentages use basis points. Economic skill uses hundredths of a point." } } } }, recycleReward: { type: "object", additionalProperties: false, description: "What recycling this item awards. Present only in the owner's listing, for unworn items whose quality can be recycled.", required: ["reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["QuoteMedipackIII", "QuoteMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 } } }, split: { type: "object", additionalProperties: false, description: "Owner listing only, for a splittable Q2–Q8 item. The first result keeps the original slot and basic modifiers. The second rolls new modifiers in a candidate slot.", required: ["quality", "slots"], properties: { quality: { type: "integer", minimum: 1, maximum: 7, description: "Quality of both resulting items." }, slots: { type: "array", description: "Slots the second item can land in.", items: { type: "string", enum: ["head", "body", "legs", "offHand", "footwear", "accessory", "charm", "eye"] } } } }, upgrades: { type: "array", description: "Owner listing only. One entry per modifier that can be upgraded at all, by its zero-based position in modifiers. An upgrade adds 1 to the value and is allowed while value is below cap.", items: { type: "object", additionalProperties: false, required: ["index", "cap", "fee"], properties: { index: { type: "integer", minimum: 0 }, cap: { type: "integer", minimum: 1, description: "The modifier can be upgraded while its value is below this, in the modifier's units." }, fee: { type: "integer", format: "int64", description: "Gold fee per upgrade, in monetary units." } } } } } } } }, responseFields: ["id", "owner", "slot", "quality", "equipped", "giftEligibility", "description", "name", "set", "modifiers", "recycleReward", "split", "upgrades"] },
15156
15156
  { operationId: "RecycleEquipment", name: "recycle-equipment", method: "POST", path: "/api/equipment/{id}/recycle", spec: "gear.yaml", write: true, retry: "natural", description: "Citizen session required. Consume an unworn item and award a medical item. The response includes the next allowed recycle time.", parameters: [{ name: "id", in: "path", required: true, description: "Resource ID.", schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", additionalProperties: false } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["availableAt", "reward", "quantity"], properties: { reward: { type: "string", enum: ["medipack_iii", "medkit"], "x-enum-varnames": ["MedipackIII", "RecycleMedkit"] }, quantity: { type: "integer", format: "int64", minimum: 1, maximum: 2 }, availableAt: { type: "string", format: "date-time" } } } } }, responseFields: ["reward", "quantity", "availableAt"] },
15157
15157
  { operationId: "GetMyPotions", name: "get-my-potions", method: "GET", path: "/api/potions/me", spec: "gear.yaml", write: false, retry: "unsafe", description: "Citizen session required. Read all personal potion stacks and the active effect, or null when no effect is active.", parameters: [], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "activeEffect"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["kind", "quality", "quantity"], properties: { kind: { type: "string", enum: ["jinxed", "finesse", "bloody_mess", "lucky"] }, quality: { type: "integer", minimum: 1, maximum: 6 }, quantity: { type: "integer", format: "int64", minimum: 1 } } } }, activeEffect: { oneOf: [{ type: "object", additionalProperties: false, required: ["kind", "quality", "expiresAt"], properties: { kind: { type: "string", enum: ["jinxed", "finesse", "bloody_mess", "lucky"] }, quality: { type: "integer", minimum: 1, maximum: 6 }, expiresAt: { type: "string", format: "date-time" } } }, { type: "null" }] } } } } }, responseFields: ["items", "activeEffect"] },
15158
15158
  { operationId: "PurchasePotion", name: "purchase-potion", method: "POST", path: "/api/potions/purchases", spec: "gear.yaml", write: true, retry: "unsafe", description: "Citizen session required. Buy one Q1 potion for 300 monetary units.", parameters: [{ name: "Origin", in: "header", required: true, description: "The same origin as the site hosting the API.", schema: { type: "string", format: "uri" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["kind"], properties: { kind: { type: "string", enum: ["jinxed", "finesse", "bloody_mess"] } } } }, requiresCredentials: true, responses: { "201": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["kind", "quality", "quantity"], properties: { kind: { type: "string", enum: ["jinxed", "finesse", "bloody_mess", "lucky"] }, quality: { type: "integer", minimum: 1, maximum: 6 }, quantity: { type: "integer", format: "int64", minimum: 1 } } } } }, responseFields: ["kind", "quality", "quantity"] },
@@ -34964,6 +34964,7 @@ function giftView(data) {
34964
34964
  available: preview?.available,
34965
34965
  shortfall: preview?.shortfall,
34966
34966
  eligible: preview ? preview.eligible ? "yes" : "no" : undefined,
34967
+ reason: preview?.detail,
34967
34968
  balance: moneyLines(changed.money),
34968
34969
  stock: arrow(changed.stock),
34969
34970
  requestId: output.requestId,
@@ -34982,13 +34983,21 @@ var view2 = (receipt, self, world) => {
34982
34983
  const asset = entry.kind === "money" ? { kind: "money", amount: amount(Number(entry.amount), currencyName(world, entry.asset)) } : entry;
34983
34984
  return { id: receipt.id, direction: sent ? "sent" : "received", peer: identityRef(summary) ?? { id, name: null }, country: countryRef(world, summary?.nation), asset, note: receipt.reason, createdAt: receipt.createdAt };
34984
34985
  };
34985
- async function equipmentOwned(ctx, id) {
34986
+ var giftBlock = {
34987
+ equipped: { code: "equipment_gift_equipped", detail: "Remove this equipment and retry on the next game day." },
34988
+ wear_cooldown: { code: "equipment_gift_wear_cooldown", detail: "This equipment was worn today. Retry on the next game day." },
34989
+ unavailable: { code: "unavailable_asset", detail: "Choose an eligible item from your equipment inventory." }
34990
+ };
34991
+ async function equipmentGiftBlock(ctx, id) {
34986
34992
  for await (const page of ctx.pages("list-my-equipment", {}, 100)) {
34987
34993
  const item = page.items.find((item) => String(item.id) === id);
34988
- if (item)
34989
- return item.equipped !== true ? 1 : 0;
34994
+ if (!item)
34995
+ continue;
34996
+ if (item.giftEligibility === "eligible")
34997
+ return;
34998
+ return giftBlock[item.giftEligibility ?? "unavailable"];
34990
34999
  }
34991
- return 0;
35000
+ return giftBlock.unavailable;
34992
35001
  }
34993
35002
  var gift = [
34994
35003
  command24({
@@ -35051,10 +35060,14 @@ var gift = [
35051
35060
  if (recipient === me)
35052
35061
  return usage2("Choose another citizen.");
35053
35062
  const world = await geography(ctx);
35054
- const input = string4(textArg(args, "asset"));
35063
+ const assetInput = string4(textArg(args, "asset"));
35064
+ const equipmentId = identifier.safeParse(assetInput).data;
35065
+ const input = equipmentId ?? assetInput;
35055
35066
  const quantity = string4(textArg(args, "quantity"));
35056
35067
  const currency = world.countries.find((country) => country.currency.toLowerCase() === input.toLowerCase());
35057
- const kind = input.toLowerCase() === "gold" || currency ? "money" : identifier.safeParse(input).success ? "equipment" : "product";
35068
+ const kind = input.toLowerCase() === "gold" || currency ? "money" : equipmentId ? "equipment" : "product";
35069
+ const replaying = Boolean(args["request-id"] && !args["dry-run"]);
35070
+ let blocked;
35058
35071
  let before;
35059
35072
  let units;
35060
35073
  let transfer;
@@ -35073,7 +35086,9 @@ var gift = [
35073
35086
  if (kind === "equipment") {
35074
35087
  if (units !== 1)
35075
35088
  return usage2("An equipment gift transfers exactly one item.");
35076
- before = await equipmentOwned(ctx, input);
35089
+ if (!replaying)
35090
+ blocked = await equipmentGiftBlock(ctx, input);
35091
+ before = blocked ? 0 : 1;
35077
35092
  transfer = { kind, equipmentId: input };
35078
35093
  } else {
35079
35094
  const product = resolveProduct(input);
@@ -35090,22 +35105,41 @@ var gift = [
35090
35105
  const label = kind === "money" ? name : kind === "equipment" ? `equipment #${input}` : input;
35091
35106
  if (args["dry-run"]) {
35092
35107
  const short = kind === "money" ? shortfall2(amount(units, name), amount(before, name)) : shortfall2(units, before);
35093
- return { dryRun: true, preview: {
35094
- recipient: { id: recipient, name: null },
35095
- asset: sending,
35096
- available: held,
35097
- eligible: before >= units,
35098
- ...before < units ? { shortfall: short.short } : {}
35099
- }, changed: before < units ? {} : projected };
35100
- }
35101
- if (before < units && !args["request-id"]) {
35108
+ return {
35109
+ dryRun: true,
35110
+ preview: {
35111
+ recipient: { id: recipient, name: null },
35112
+ asset: sending,
35113
+ available: held,
35114
+ eligible: before >= units,
35115
+ ...before < units ? { shortfall: short.short } : {},
35116
+ ...blocked ? { reason: blocked.code, detail: blocked.detail } : {}
35117
+ },
35118
+ changed: before < units ? {} : projected
35119
+ };
35120
+ }
35121
+ if (blocked)
35122
+ return refuse3(blocked.code, blocked.detail, { asset: label }, "esim gear");
35123
+ if (before < units && !replaying) {
35102
35124
  const need = kind === "money" ? shortfall2(amount(units, name), amount(before, name)) : shortfall2(units, before);
35103
- return refuse3("unavailable_asset", kind === "equipment" ? `Equipment #${input} is not among your unequipped equipment.` : kind === "money" ? `Giving ${amount(units, name).value} ${name}: ${shortText(name, amount(units, name), amount(before, name))}.` : `Giving ${units} ${label}: need ${units}, have ${before}, short ${units - before}.`, { asset: label, ...kind === "equipment" ? {} : need }, kind === "money" ? name === "GOLD" ? "esim today" : `esim exchange list ${name}` : kind === "equipment" ? "esim gear" : "esim inventory");
35125
+ return refuse3("unavailable_asset", kind === "money" ? `Giving ${amount(units, name).value} ${name}: ${shortText(name, amount(units, name), amount(before, name))}.` : `Giving ${units} ${label}: need ${units}, have ${before}, short ${units - before}.`, { asset: label, ...need }, kind === "money" ? name === "GOLD" ? "esim today" : `esim exchange list ${name}` : "esim inventory");
35104
35126
  }
35105
35127
  const note = textArg(args, "note");
35106
35128
  const replay = `esim gift send ${recipient} ${quantity} ${shellWord(input)}${note ? ` --note ${shellWord(note)}` : ""}`;
35107
- const { requestId, receipt } = await keyed2(ctx, "give-citizen-asset", { id: recipient }, { ...transfer, ...note ? { reason: note } : {} }, replay, "esim gift list");
35108
- const changed = args["request-id"] ? {} : projected;
35129
+ const { requestId, receipt } = await keyed2(ctx, "give-citizen-asset", { id: recipient }, { ...transfer, ...note ? { reason: note } : {} }, replay, "esim gift list").catch((error) => {
35130
+ if (!(error instanceof CommandError))
35131
+ throw error;
35132
+ const block = [giftBlock.equipped, giftBlock.wear_cooldown].find((block) => block.code === error.error);
35133
+ if (!block)
35134
+ throw error;
35135
+ const retry = error.details.requestId && `${replay} --request-id ${shellWord(error.details.requestId)}`;
35136
+ throw new CommandError(error.exitCode, error.error, block.detail, "", undefined, {
35137
+ ...error.details,
35138
+ context: { ...error.details.context, asset: label },
35139
+ next: [{ run: block === giftBlock.wear_cooldown && retry ? retry : "esim gear" }]
35140
+ });
35141
+ });
35142
+ const changed = replaying ? {} : projected;
35109
35143
  const gift = await ctx.call("get-my-gift", { id: string4(receipt.id) });
35110
35144
  return { requestId, gift: view2(gift, me, world), changed };
35111
35145
  }
@@ -37511,6 +37545,7 @@ function rootHelp(available) {
37511
37545
  "Start each round with: esim today",
37512
37546
  "",
37513
37547
  ...available.map(({ name, commands }) => `${name.padEnd(10)}${commands.join(" ")}`),
37548
+ ...available === standaloneGroups ? ["", "Administrator commands: esim admin --help"] : [],
37514
37549
  "",
37515
37550
  "esim docs for the game rules · battle, economy, equipment",
37516
37551
  "esim help <group> for summaries · esim <command> --help for verbs · --json for structured output"
@@ -38092,6 +38127,451 @@ async function runCommand(input, options, host = "embedded") {
38092
38127
  return { exitCode: failure.exitCode };
38093
38128
  }
38094
38129
  }
38130
+ // admin-commands.ts
38131
+ function positiveInteger(value, label, max = Number.MAX_SAFE_INTEGER) {
38132
+ const number = Number(value);
38133
+ if (value === undefined || !/^[1-9][0-9]*$/.test(value) || !Number.isSafeInteger(number) || number > max) {
38134
+ throw new CommandError(2, "invalid_arguments", `${label} must be an integer from 1 to ${max}.`, "");
38135
+ }
38136
+ return number;
38137
+ }
38138
+ function pagination(values) {
38139
+ return {
38140
+ ...values.cursor === undefined ? {} : { cursor: values.cursor },
38141
+ ...values.limit === undefined ? {} : { limit: positiveInteger(values.limit, "--limit", 100) }
38142
+ };
38143
+ }
38144
+ var resolutions = {
38145
+ fix: "accepted",
38146
+ reject: "rejected",
38147
+ duplicate: "duplicate"
38148
+ };
38149
+ function resolution(verb) {
38150
+ const status = resolutions[verb];
38151
+ const duplicate = verb === "duplicate";
38152
+ const summary = {
38153
+ fix: "Accept a verified fix. The server awards the submitter a Tester medal with 5 Gold.",
38154
+ reject: "Close a report as rejected.",
38155
+ duplicate: "Close a report as a duplicate of another report."
38156
+ }[verb];
38157
+ return {
38158
+ path: ["feedback", verb],
38159
+ usage: `esim admin feedback ${verb} <id>${duplicate ? " <original-id>" : ""} --reply <text>`,
38160
+ summary,
38161
+ positionals: duplicate ? 2 : 1,
38162
+ options: ["reply"],
38163
+ write: true,
38164
+ async run({ request }, { positionals, values, dryRun }) {
38165
+ const id = positiveInteger(positionals[0], "Feedback ID");
38166
+ const reply = values.reply?.trim();
38167
+ if (!reply || reply.includes("\x00") || Array.from(reply).length > 2000) {
38168
+ throw new CommandError(2, "invalid_arguments", "--reply must contain 1–2000 characters without NUL.", "");
38169
+ }
38170
+ const duplicateOf = duplicate ? positiveInteger(positionals[1], "Original feedback ID") : undefined;
38171
+ if (id === duplicateOf) {
38172
+ throw new CommandError(2, "invalid_arguments", "Choose a different report as the original.", "");
38173
+ }
38174
+ const body = { status, reply, ...duplicateOf === undefined ? {} : { duplicateOf } };
38175
+ const reward = status === "accepted" ? { medal: "Tester", gold: 5 } : null;
38176
+ if (dryRun) {
38177
+ const report = await request("GetAdminFeedback", { args: { id } });
38178
+ if (report.status !== "open") {
38179
+ throw new CommandError(3, "feedback_already_closed", "This feedback report is already closed.", `Run esim admin feedback show ${id} to see its final resolution.`);
38180
+ }
38181
+ return { dryRun, id, title: report.title, citizenName: report.citizenName, ...body, reward };
38182
+ }
38183
+ await request("ResolveAdminFeedback", { args: { id }, body });
38184
+ return { id, ...body, reward };
38185
+ }
38186
+ };
38187
+ }
38188
+ var coreAdminCommands = [
38189
+ {
38190
+ path: ["feedback", "list"],
38191
+ usage: "esim admin feedback list [--status <open|accepted|rejected|duplicate>] [--kind <bug|numbers|other>] [--cursor <cursor>] [--limit <1–100>]",
38192
+ summary: "List feedback from all citizens, newest first.",
38193
+ options: ["status", "kind", "cursor", "limit"],
38194
+ run({ request }, { values }) {
38195
+ return request("ListAdminFeedback", { args: {
38196
+ ...pagination(values),
38197
+ ...values.status === undefined ? {} : { status: values.status },
38198
+ ...values.kind === undefined ? {} : { kind: values.kind }
38199
+ } });
38200
+ }
38201
+ },
38202
+ {
38203
+ path: ["feedback", "show"],
38204
+ usage: "esim admin feedback show <id>",
38205
+ summary: "Read a feedback report, its submitter and any resolution.",
38206
+ positionals: 1,
38207
+ run({ request }, { positionals }) {
38208
+ return request("GetAdminFeedback", { args: { id: positiveInteger(positionals[0], "Feedback ID") } });
38209
+ }
38210
+ },
38211
+ resolution("fix"),
38212
+ resolution("reject"),
38213
+ resolution("duplicate"),
38214
+ {
38215
+ path: ["config", "show"],
38216
+ usage: "esim admin config show",
38217
+ summary: "Read world settings, pending speed and the current configuration version.",
38218
+ run: ({ request }) => request("GetWorldConfig")
38219
+ },
38220
+ {
38221
+ path: ["config", "speed"],
38222
+ usage: "esim admin config speed <1–1440> [--version <version>]",
38223
+ summary: "Schedule a speed change for the next game day. Supply the version shown by config show or --dry-run when confirming.",
38224
+ positionals: 1,
38225
+ options: ["version"],
38226
+ write: true,
38227
+ async run({ request }, { positionals, values, dryRun }) {
38228
+ const raw = positionals[0] ?? "";
38229
+ const speed = Number(raw);
38230
+ if (!/^[0-9]+(?:\.[0-9]+)?$/.test(raw) || speed < 1 || speed > 1440) {
38231
+ throw new CommandError(2, "invalid_arguments", "Speed must be a number from 1 to 1440.", "");
38232
+ }
38233
+ if (dryRun) {
38234
+ const { currentSpeed, pendingSpeed, nextDayAt, version } = await request("GetWorldConfig");
38235
+ return { dryRun, currentSpeed, pendingSpeed, requestedSpeed: speed, nextDayAt, version };
38236
+ }
38237
+ const version = values.version;
38238
+ if (!version?.trim()) {
38239
+ throw new CommandError(2, "invalid_arguments", "--version is required with --yes. Run config show or use --dry-run for the current version.", "");
38240
+ }
38241
+ return request("UpdateWorldSpeed", { args: {}, body: { speed, version } });
38242
+ }
38243
+ },
38244
+ {
38245
+ path: ["log"],
38246
+ usage: "esim admin log [--cursor <cursor>] [--limit <1–100>]",
38247
+ summary: "List recent administrator actions from the audit log.",
38248
+ options: ["cursor", "limit"],
38249
+ run: ({ request }, { values }) => request("ListModerationLog", { args: pagination(values) })
38250
+ }
38251
+ ];
38252
+
38253
+ // admin-moderation.ts
38254
+ var timedUntil = exports_iso.datetime({ offset: true });
38255
+ function invalid2(path, message) {
38256
+ throw new CommandError(2, "invalid_arguments", message, `Run esim admin ${path.join(" ")} --help.`);
38257
+ }
38258
+ function readReason(path, value, limit) {
38259
+ const reason = value?.trim();
38260
+ if (!reason || reason.includes("\x00"))
38261
+ invalid2(path, "Provide a non-empty --reason without NUL characters.");
38262
+ if (limit !== undefined && reason.length > limit)
38263
+ invalid2(path, `--reason must fit within ${limit} UTF-16 code units.`);
38264
+ return reason;
38265
+ }
38266
+ function readInteger(path, value, label, maximum) {
38267
+ const parsed = Number(value);
38268
+ if (value === undefined || !/^[1-9][0-9]*$/.test(value) || !Number.isSafeInteger(parsed) || parsed > maximum) {
38269
+ invalid2(path, `${label} must be an integer from 1 to ${maximum}.`);
38270
+ }
38271
+ return parsed;
38272
+ }
38273
+ function readUntil(path, value) {
38274
+ const until = timedUntil.safeParse(value);
38275
+ if (!until.success) {
38276
+ invalid2(path, "Provide --until as an RFC3339 timestamp with seconds and a UTC offset, such as 2026-12-31T18:00:00Z.");
38277
+ }
38278
+ return until.data;
38279
+ }
38280
+ function writeCommand(command, operation, prepare) {
38281
+ return {
38282
+ ...command,
38283
+ write: true,
38284
+ async run(ctx, args) {
38285
+ const input = prepare(args);
38286
+ const change = { command: command.path.join(" "), ...input.args, ...input.body };
38287
+ if (args.dryRun)
38288
+ return { dryRun: true, ...change };
38289
+ await ctx.request(operation, input);
38290
+ return change;
38291
+ }
38292
+ };
38293
+ }
38294
+ function accountCommand(action, summary) {
38295
+ const path = ["account", action];
38296
+ const timed = action === "ban" || action === "mute";
38297
+ return writeCommand({
38298
+ path,
38299
+ usage: `esim admin account ${action} <username>${timed ? " --until <RFC3339>" : ""} --reason <text>`,
38300
+ summary,
38301
+ positionals: 1,
38302
+ options: timed ? ["until", "reason"] : ["reason"]
38303
+ }, action === "ban" || action === "unban" ? "BanAccount" : "MuteAccount", ({ positionals, values }) => {
38304
+ const username = positionals[0]?.trim().toLowerCase();
38305
+ if (!username || !/^[a-z0-9_]{3,32}$/.test(username))
38306
+ invalid2(path, "Username must contain 3–32 letters, digits, or underscores.");
38307
+ const until = timed ? readUntil(path, values.until) : null;
38308
+ return { args: {}, body: { username, until, reason: readReason(path, values.reason) } };
38309
+ });
38310
+ }
38311
+ var deletePath = ["content", "delete"];
38312
+ var deleteContent = writeCommand({
38313
+ path: deletePath,
38314
+ usage: "esim admin content delete <article|shout> <id> --reason <text>",
38315
+ summary: "Delete an article or shout.",
38316
+ positionals: 2,
38317
+ options: ["reason"]
38318
+ }, "DeleteContent", ({ positionals, values }) => {
38319
+ const [kind, rawId] = positionals;
38320
+ if (kind !== "article" && kind !== "shout")
38321
+ invalid2(deletePath, "Content kind must be article or shout.");
38322
+ const id = readInteger(deletePath, rawId, "Content ID", Number.MAX_SAFE_INTEGER);
38323
+ return { args: {}, body: { kind, id, reason: readReason(deletePath, values.reason) } };
38324
+ });
38325
+ var reportQueues = [
38326
+ { name: "shout", label: "shout", list: "ListShoutReports", resolve: "ResolveShoutReport", supportsDeletion: true },
38327
+ { name: "article-comment", label: "article comment", list: "ListArticleCommentReports", resolve: "ResolveArticleCommentReport", supportsDeletion: true },
38328
+ { name: "citizen", label: "citizen", list: "ListCitizenReports", resolve: "ResolveCitizenReport", supportsDeletion: false },
38329
+ { name: "message", label: "private message", list: "ListMessageReports", resolve: "ResolveMessageReport", supportsDeletion: false }
38330
+ ];
38331
+ function reportCommands(queue) {
38332
+ const listPath = ["reports", queue.name, "list"];
38333
+ const resolvePath = ["reports", queue.name, "resolve"];
38334
+ const command = `esim admin reports ${queue.name}`;
38335
+ return [
38336
+ {
38337
+ path: listPath,
38338
+ usage: `${command} list [--limit <1-100>] [--cursor <cursor>]`,
38339
+ summary: `List pending ${queue.label} reports.`,
38340
+ options: ["limit", "cursor"],
38341
+ run(ctx, { values }) {
38342
+ const args = {};
38343
+ if (values.limit !== undefined)
38344
+ args.limit = readInteger(listPath, values.limit, "--limit", 100);
38345
+ if (values.cursor !== undefined)
38346
+ args.cursor = values.cursor;
38347
+ return ctx.request(queue.list, { args });
38348
+ }
38349
+ },
38350
+ writeCommand({
38351
+ path: resolvePath,
38352
+ usage: `${command} resolve <report-id>${queue.supportsDeletion ? " --action <dismiss|delete>" : ""} --reason <text>`,
38353
+ summary: queue.supportsDeletion ? `Dismiss a ${queue.label} report or delete the reported content.` : `Close a ${queue.label} report.`,
38354
+ positionals: 1,
38355
+ options: queue.supportsDeletion ? ["action", "reason"] : ["reason"]
38356
+ }, queue.resolve, ({ positionals, values }) => {
38357
+ const id = readInteger(resolvePath, positionals[0], "Report ID", Number.MAX_SAFE_INTEGER);
38358
+ const reason = readReason(resolvePath, values.reason, 500);
38359
+ if (queue.supportsDeletion) {
38360
+ const action = values.action;
38361
+ if (action !== "dismiss" && action !== "delete")
38362
+ invalid2(resolvePath, "--action must be dismiss or delete.");
38363
+ return { args: { id }, body: { action, reason } };
38364
+ }
38365
+ return { args: { id }, body: { reason } };
38366
+ })
38367
+ ];
38368
+ }
38369
+ var moderationCommands = [
38370
+ accountCommand("ban", "Ban an account until a specified time and revoke its sessions if the ban is active."),
38371
+ accountCommand("unban", "Lift an account ban."),
38372
+ accountCommand("mute", "Mute an account until a specified time."),
38373
+ accountCommand("unmute", "Lift an account mute."),
38374
+ deleteContent,
38375
+ ...reportQueues.flatMap(reportCommands)
38376
+ ];
38377
+
38378
+ // generated/admin.generated.ts
38379
+ var adminOperations = [
38380
+ { operationId: "GetWorldConfig", name: "get-world-config", method: "GET", path: "/api/admin/world-config", spec: "admin.yaml", write: false, retry: "unsafe", description: "GetWorldConfig", parameters: [], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["countries", "resources", "seed", "manual", "currentSpeed", "pendingSpeed", "nextDayAt", "version", "townBanners"], properties: { countries: { type: "array", items: { type: "object", additionalProperties: false, required: ["sourceId", "name"], properties: { sourceId: { type: "integer" }, name: { type: "string" } } } }, resources: { type: "string", enum: ["original", "random"] }, seed: { type: ["string", "null"], pattern: "^-?[0-9]+$" }, manual: { type: "boolean" }, currentSpeed: { type: "number", format: "double", minimum: 1, maximum: 1440 }, pendingSpeed: { type: ["number", "null"], format: "double", minimum: 1, maximum: 1440 }, nextDayAt: { type: "string", format: "date-time" }, version: { type: "string", minLength: 1, description: "Opaque version required when saving a speed change." }, townBanners: { type: "object", additionalProperties: false, properties: { server: { type: "object", additionalProperties: false, required: ["title", "url"], properties: { title: { type: "string" }, url: { type: "string", format: "uri" } } }, foodRegeneration: { type: "object", additionalProperties: false, required: ["nextAt"], properties: { nextAt: { type: "string", format: "date-time" } } } } } } } } }, responseFields: ["countries", "resources", "seed", "manual", "currentSpeed", "pendingSpeed", "nextDayAt", "version", "townBanners"] },
38381
+ { operationId: "UpdateWorldSpeed", name: "update-world-speed", method: "POST", path: "/api/admin/world-config/speed", spec: "admin.yaml", write: true, retry: "unsafe", description: "UpdateWorldSpeed", parameters: [], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["speed", "version"], properties: { speed: { type: "number", format: "double", minimum: 1, maximum: 1440 }, version: { type: "string", minLength: 1 } } } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["countries", "resources", "seed", "manual", "currentSpeed", "pendingSpeed", "nextDayAt", "version", "townBanners"], properties: { countries: { type: "array", items: { type: "object", additionalProperties: false, required: ["sourceId", "name"], properties: { sourceId: { type: "integer" }, name: { type: "string" } } } }, resources: { type: "string", enum: ["original", "random"] }, seed: { type: ["string", "null"], pattern: "^-?[0-9]+$" }, manual: { type: "boolean" }, currentSpeed: { type: "number", format: "double", minimum: 1, maximum: 1440 }, pendingSpeed: { type: ["number", "null"], format: "double", minimum: 1, maximum: 1440 }, nextDayAt: { type: "string", format: "date-time" }, version: { type: "string", minLength: 1, description: "Opaque version required when saving a speed change." }, townBanners: { type: "object", additionalProperties: false, properties: { server: { type: "object", additionalProperties: false, required: ["title", "url"], properties: { title: { type: "string" }, url: { type: "string", format: "uri" } } }, foodRegeneration: { type: "object", additionalProperties: false, required: ["nextAt"], properties: { nextAt: { type: "string", format: "date-time" } } } } } } } } }, responseFields: ["countries", "resources", "seed", "manual", "currentSpeed", "pendingSpeed", "nextDayAt", "version", "townBanners"] },
38382
+ { operationId: "BanAccount", name: "ban-account", method: "POST", path: "/api/admin/ban", spec: "admin.yaml", write: true, retry: "unsafe", description: "BanAccount", parameters: [], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["username", "until", "reason"], properties: { username: { type: "string" }, until: { type: ["string", "null"], format: "date-time" }, reason: { type: "string", minLength: 1 } } } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false } } }, responseFields: [] },
38383
+ { operationId: "MuteAccount", name: "mute-account", method: "POST", path: "/api/admin/mute", spec: "admin.yaml", write: true, retry: "unsafe", description: "MuteAccount", parameters: [], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["username", "until", "reason"], properties: { username: { type: "string" }, until: { type: ["string", "null"], format: "date-time" }, reason: { type: "string", minLength: 1 } } } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false } } }, responseFields: [] },
38384
+ { operationId: "DeleteContent", name: "delete-content", method: "POST", path: "/api/admin/delete", spec: "admin.yaml", write: true, retry: "unsafe", description: "DeleteContent", parameters: [], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["kind", "id", "reason"], properties: { kind: { type: "string", enum: ["article", "shout"] }, id: { type: "integer", format: "int64", minimum: 1 }, reason: { type: "string", minLength: 1 } } } }, requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false } } }, responseFields: [] },
38385
+ { operationId: "ListModerationLog", name: "list-moderation-log", method: "GET", path: "/api/admin/log", spec: "admin.yaml", write: false, retry: "unsafe", description: "ListModerationLog", parameters: [{ name: "cursor", in: "query", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "occurredAt", "adminId", "targetAccount", "action", "ref", "reason"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, occurredAt: { type: "string", format: "date-time" }, adminId: { type: "integer", format: "int64", minimum: 1 }, targetAccount: { type: ["integer", "null"], format: "int64" }, action: { type: "string" }, ref: { type: ["string", "null"] }, reason: { type: "string" } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
38386
+ { operationId: "ListShoutReports", name: "list-shout-reports", method: "GET", path: "/api/admin/shout-reports", spec: "admin.yaml", write: false, retry: "unsafe", description: "管理员分页读取待处理喊话举报", parameters: [{ name: "cursor", in: "query", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100 } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "shoutId", "reason", "createdAt"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, shoutId: { type: "integer", format: "int64", minimum: 1 }, commentId: { type: "integer", format: "int64", minimum: 1 }, reason: { type: "string" }, createdAt: { type: "string", format: "date-time" } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
38387
+ { operationId: "ResolveShoutReport", name: "resolve-shout-report", method: "POST", path: "/api/admin/shout-reports/{id}/resolve", spec: "admin.yaml", write: true, retry: "unsafe", description: "管理员处置待处理喊话举报", parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, schema: { type: "string" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["action", "reason"], properties: { action: { type: "string", enum: ["dismiss", "delete"] }, reason: { type: "string", minLength: 1, maxLength: 500 } } } }, requiresCredentials: true, responses: { "204": { kind: "empty" } }, responseFields: [] },
38388
+ { operationId: "ListArticleCommentReports", name: "list-article-comment-reports", method: "GET", path: "/api/admin/article-comment-reports", spec: "admin.yaml", write: false, retry: "unsafe", description: "管理员分页读取待处理文章评论举报", parameters: [{ name: "cursor", in: "query", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100 } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "articleId", "commentId", "reason", "createdAt"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, articleId: { type: "integer", format: "int64", minimum: 1 }, commentId: { type: "integer", format: "int64", minimum: 1 }, reason: { type: "string" }, createdAt: { type: "string", format: "date-time" } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
38389
+ { operationId: "ResolveArticleCommentReport", name: "resolve-article-comment-report", method: "POST", path: "/api/admin/article-comment-reports/{id}/resolve", spec: "admin.yaml", write: true, retry: "unsafe", description: "管理员处置待处理文章评论举报", parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, schema: { type: "string" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["action", "reason"], properties: { action: { type: "string", enum: ["dismiss", "delete"] }, reason: { type: "string", minLength: 1, maxLength: 500 } } } }, requiresCredentials: true, responses: { "204": { kind: "empty" } }, responseFields: [] },
38390
+ { operationId: "ListCitizenReports", name: "list-citizen-reports", method: "GET", path: "/api/admin/citizen-reports", spec: "admin.yaml", write: false, retry: "unsafe", description: "管理员分页读取待处理公民档案举报", parameters: [{ name: "cursor", in: "query", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100 } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "citizenId", "category", "reason", "createdAt"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, citizenId: { type: "integer", format: "int64", minimum: 1 }, category: { type: "string" }, reason: { type: "string" }, createdAt: { type: "string", format: "date-time" } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
38391
+ { operationId: "ResolveCitizenReport", name: "resolve-citizen-report", method: "POST", path: "/api/admin/citizen-reports/{id}/resolve", spec: "admin.yaml", write: true, retry: "unsafe", description: "管理员处置待处理公民档案举报", parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, schema: { type: "string" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["reason"], properties: { reason: { type: "string", maxLength: 500 } } } }, requiresCredentials: true, responses: { "204": { kind: "empty" } }, responseFields: [] },
38392
+ { operationId: "ListMessageReports", name: "list-message-reports", method: "GET", path: "/api/admin/message-reports", spec: "admin.yaml", write: false, retry: "unsafe", description: "管理员分页读取待处理私信举报", parameters: [{ name: "cursor", in: "query", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100 } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "sender", "body", "sentAt", "reason", "createdAt"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, sender: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, body: { type: "string" }, sentAt: { type: "string", format: "date-time" }, reason: { type: "string" }, createdAt: { type: "string", format: "date-time" } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
38393
+ { operationId: "ResolveMessageReport", name: "resolve-message-report", method: "POST", path: "/api/admin/message-reports/{id}/resolve", spec: "admin.yaml", write: true, retry: "unsafe", description: "管理员处置待处理私信举报", parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, schema: { type: "string" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["reason"], properties: { reason: { type: "string", maxLength: 500 } } } }, requiresCredentials: true, responses: { "204": { kind: "empty" } }, responseFields: [] },
38394
+ { operationId: "ListAdminFeedback", name: "list-admin-feedback", method: "GET", path: "/api/admin/feedback", spec: "feedback.yaml", write: false, retry: "unsafe", description: "Requires an administrator session. Lists feedback from all citizens, newest first.", parameters: [{ name: "status", in: "query", schema: { type: "string", enum: ["open", "accepted", "rejected", "duplicate"] } }, { name: "kind", in: "query", schema: { type: "string", enum: ["bug", "numbers", "other"], description: "bug is a program error, numbers a value or rule that looks miscalculated, other anything else." } }, { name: "cursor", in: "query", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", required: ["items", "nextCursor"], properties: { items: { type: "array", items: { allOf: [{ type: "object", required: ["id", "kind", "title", "status", "createdAt"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, kind: { type: "string", enum: ["bug", "numbers", "other"], description: "bug is a program error, numbers a value or rule that looks miscalculated, other anything else." }, title: { type: "string" }, status: { type: "string", enum: ["open", "accepted", "rejected", "duplicate"] }, createdAt: { type: "string", format: "date-time" }, resolvedAt: { type: "string", format: "date-time" } } }, { type: "object", required: ["citizenId", "citizenName"], properties: { citizenId: { type: "integer", format: "int64", minimum: 1 }, citizenName: { type: "string" } } }] } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
38395
+ { operationId: "GetAdminFeedback", name: "get-admin-feedback", method: "GET", path: "/api/admin/feedback/{id}", spec: "feedback.yaml", write: false, retry: "unsafe", description: "Requires an administrator session. Reads a feedback report and identifies its submitter.", parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { allOf: [{ allOf: [{ type: "object", required: ["id", "kind", "title", "status", "createdAt"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, kind: { type: "string", enum: ["bug", "numbers", "other"], description: "bug is a program error, numbers a value or rule that looks miscalculated, other anything else." }, title: { type: "string" }, status: { type: "string", enum: ["open", "accepted", "rejected", "duplicate"] }, createdAt: { type: "string", format: "date-time" }, resolvedAt: { type: "string", format: "date-time" } } }, { type: "object", required: ["body", "gameDay", "source"], properties: { body: { type: "string" }, context: { type: "string" }, gameDay: { type: "integer", minimum: 1 }, source: { type: "string", enum: ["web", "cli"] }, reply: { type: "string", description: "The resolution reply once the report is closed." }, duplicateOf: { type: "integer", format: "int64", minimum: 1, description: "The earlier report this one duplicates." } } }] }, { type: "object", required: ["citizenId", "citizenName"], properties: { citizenId: { type: "integer", format: "int64", minimum: 1 }, citizenName: { type: "string" } } }] } } }, responseFields: ["id", "kind", "title", "status", "createdAt", "resolvedAt", "body", "context", "gameDay", "source", "reply", "duplicateOf", "citizenId", "citizenName"] },
38396
+ { operationId: "ResolveAdminFeedback", name: "resolve-admin-feedback", method: "POST", path: "/api/admin/feedback/{id}/resolve", spec: "feedback.yaml", write: true, retry: "unsafe", description: "Requires an administrator session and a same-origin JSON request. Closes an open report and records the review in the audit log.", parameters: [{ name: "id", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["status", "reply"], properties: { status: { type: "string", enum: ["accepted", "rejected", "duplicate"], "x-enum-varnames": ["ResolveAccepted", "ResolveRejected", "ResolveDuplicate"], description: "Use accepted after verifying that the fix is available to players." }, reply: { type: "string", minLength: 1, maxLength: 2000 }, duplicateOf: { type: "integer", format: "int64", minimum: 1, description: "Required only for duplicate." } } } }, requiresCredentials: true, responses: { "204": { kind: "empty" } }, responseFields: [] }
38397
+ ];
38398
+
38399
+ // admin.ts
38400
+ var commands3 = [...coreAdminCommands, ...moderationCommands];
38401
+ var operations2 = new Map(adminOperations.map((operation) => [operation.operationId, operation]));
38402
+ function commandUsage(command) {
38403
+ return `${command.usage}${command.write ? " (--dry-run | --yes)" : ""} [--json]`;
38404
+ }
38405
+ function groupHelp2(path, matches) {
38406
+ const name = ["esim", "admin", ...path].join(" ");
38407
+ const children = [...new Set(matches.map((command) => command.path[path.length]))];
38408
+ return [
38409
+ `Usage: ${name} <${children.join("|")}> [options]`,
38410
+ "",
38411
+ ...matches.map((command) => ` ${commandUsage(command)}
38412
+ ${command.summary}`),
38413
+ "",
38414
+ "Set ESIM_SESSION_COOKIE to a current administrator session before running a command."
38415
+ ].join(`
38416
+ `);
38417
+ }
38418
+ function invalid3(message, command) {
38419
+ throw new CommandError(2, "invalid_arguments", message, `Run esim admin${command ? " " + command.path.join(" ") : ""} --help.`);
38420
+ }
38421
+ function parse4(command, argv) {
38422
+ const positionals = [];
38423
+ const values = new Map;
38424
+ const flags = new Set;
38425
+ for (let index = 0;index < argv.length; index++) {
38426
+ const word = argv[index] ?? "";
38427
+ if (word === "--") {
38428
+ positionals.push(...argv.slice(index + 1));
38429
+ break;
38430
+ }
38431
+ if (!word.startsWith("-")) {
38432
+ positionals.push(word);
38433
+ continue;
38434
+ }
38435
+ if (word === "--json" || command.write && (word === "--yes" || word === "--dry-run")) {
38436
+ if (flags.has(word))
38437
+ invalid3(`Option ${word} is repeated.`, command);
38438
+ flags.add(word);
38439
+ continue;
38440
+ }
38441
+ const equals = word.indexOf("=");
38442
+ const option = equals < 0 ? word : word.slice(0, equals);
38443
+ const name = option.slice(2);
38444
+ if (!word.startsWith("--") || !command.options?.includes(name))
38445
+ invalid3(`Unknown option for ${command.path.join(" ")}.`, command);
38446
+ if (values.has(name))
38447
+ invalid3(`Option ${option} is repeated.`, command);
38448
+ const value = equals < 0 ? argv[++index] : word.slice(equals + 1);
38449
+ if (value === undefined || equals < 0 && value.startsWith("--"))
38450
+ invalid3(`Option ${option} needs a value.`, command);
38451
+ values.set(name, value);
38452
+ }
38453
+ if (positionals.length !== (command.positionals ?? 0))
38454
+ invalid3(`Usage: ${commandUsage(command)}`, command);
38455
+ const dryRun = flags.has("--dry-run");
38456
+ const confirmed = flags.has("--yes");
38457
+ if (command.write && dryRun === confirmed)
38458
+ invalid3("Choose exactly one of --dry-run and --yes.", command);
38459
+ return { positionals, values: Object.fromEntries(values), dryRun, confirmed };
38460
+ }
38461
+ function adminOrigin(baseUrl) {
38462
+ const url = URL.canParse(baseUrl) ? new URL(baseUrl) : undefined;
38463
+ const loopback = url && ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
38464
+ if (!url || url.username || url.password || !(url.protocol === "https:" || url.protocol === "http:" && loopback)) {
38465
+ throw new CommandError(2, "invalid_api_url", "Admin requires HTTPS or a loopback HTTP address.", "Check ESIM_API_URL.");
38466
+ }
38467
+ return url.origin;
38468
+ }
38469
+ function failureFor(error, operationId, input) {
38470
+ if (!(error instanceof CommandError))
38471
+ throw error;
38472
+ const readConfig = "Run esim admin config speed <speed> --dry-run to get the new version before confirming again.";
38473
+ const readFeedback = `Run esim admin feedback show ${String(input.args.id)} to check the current resolution.`;
38474
+ const conflict = error.error === "conflict" || error.error === "feedback_already_closed" || error.error === "http_409";
38475
+ if (conflict && operationId === "UpdateWorldSpeed") {
38476
+ throw new CommandError(3, "conflict", "The world configuration or game day changed. The speed update was not applied.", readConfig);
38477
+ }
38478
+ if (conflict && operationId === "ResolveAdminFeedback") {
38479
+ throw new CommandError(3, "feedback_already_closed", "This feedback report is already closed.", readFeedback);
38480
+ }
38481
+ if (error.error === "forbidden" || error.error === "http_403") {
38482
+ throw new CommandError(3, "forbidden", "The API refused this administrator request.", "Check that ESIM_SESSION_COOKIE belongs to an administrator on this server.");
38483
+ }
38484
+ if (error.exitCode === 4 && (operationId === "UpdateWorldSpeed" || operationId === "ResolveAdminFeedback")) {
38485
+ throw new CommandError(4, error.error, error.message, operationId === "UpdateWorldSpeed" ? "Run esim admin config show to check whether the speed change was applied." : readFeedback);
38486
+ }
38487
+ throw error;
38488
+ }
38489
+ function redact(value, secret) {
38490
+ if (!secret)
38491
+ return value;
38492
+ if (typeof value === "string")
38493
+ return value.replaceAll(secret, "[redacted]");
38494
+ if (Array.isArray(value))
38495
+ return value.map((entry) => redact(entry, secret));
38496
+ if (value !== null && typeof value === "object") {
38497
+ return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key.replaceAll(secret, "[redacted]"), redact(entry, secret)]));
38498
+ }
38499
+ return value;
38500
+ }
38501
+ async function runAdmin(argv, options, cookie) {
38502
+ const json = jsonRequested(argv);
38503
+ const help = flagRequested(argv, "--help");
38504
+ const words = help ? argv.filter((word) => word !== "--help" && word !== "--json") : argv;
38505
+ const command = commands3.find((entry) => entry.path.every((part, index) => part === words[index]));
38506
+ const secret = cookie?.slice("citizen=".length) ?? "";
38507
+ try {
38508
+ if (!command) {
38509
+ const matches = commands3.filter((entry) => words.every((word, index) => entry.path[index] === word));
38510
+ if (!matches.length)
38511
+ invalid3("Unknown administrator command.");
38512
+ options.stdout(groupHelp2(words, matches) + `
38513
+ `);
38514
+ return 0;
38515
+ }
38516
+ if (help) {
38517
+ options.stdout(`Usage: ${commandUsage(command)}
38518
+
38519
+ ${command.summary}
38520
+ `);
38521
+ return 0;
38522
+ }
38523
+ const args = parse4(command, argv.slice(command.path.length));
38524
+ if (!cookie) {
38525
+ throw new CommandError(3, "session_required", "A current administrator session is required.", "Set ESIM_SESSION_COOKIE to your citizen session cookie.");
38526
+ }
38527
+ const { fetch: fetch2, stdout, stderr, columns } = options;
38528
+ const transport = {
38529
+ fetch: fetch2,
38530
+ stdout,
38531
+ stderr,
38532
+ columns,
38533
+ credentials: { cookie },
38534
+ env: { baseUrl: adminOrigin(options.env.baseUrl), signal: options.env.signal },
38535
+ apiUrlEnvVar: "ESIM_API_URL"
38536
+ };
38537
+ const result = await command.run({
38538
+ async request(operationId, input = { args: {} }) {
38539
+ const operation = operations2.get(operationId);
38540
+ if (!operation)
38541
+ throw new CommandError(4, "operation_unavailable", "An administrator API operation is unavailable.", "Check the generated catalog.");
38542
+ if (operation.write && !args.confirmed) {
38543
+ throw new CommandError(2, "read_only", "This invocation cannot send writes.", "Confirm with --yes when ready.");
38544
+ }
38545
+ validateInput(operation, input);
38546
+ try {
38547
+ return await read(operation, input, transport);
38548
+ } catch (error) {
38549
+ failureFor(error, operationId, input);
38550
+ }
38551
+ }
38552
+ }, args);
38553
+ const safe = redact(result, secret);
38554
+ const more = command.options?.includes("cursor") ? (cursor) => [
38555
+ "esim",
38556
+ "admin",
38557
+ ...command.path,
38558
+ ...Object.entries(args.values).flatMap(([key, value]) => key !== "cursor" && value !== undefined ? [`--${key}`, String(redact(value, secret))] : []),
38559
+ "--cursor",
38560
+ cursor
38561
+ ].map(shellWord).join(" ") : undefined;
38562
+ stdout((json ? JSON.stringify(safe) : formatText(safe, more, columns) || "No results.") + `
38563
+ `);
38564
+ return 0;
38565
+ } catch (error) {
38566
+ const failure = error instanceof CommandError ? error : new CommandError(4, "unexpected_error", "The administrator command failed.", "Check the CLI and API.");
38567
+ const message = String(redact(failure.message, secret));
38568
+ const hint = String(redact(failure.error === "invalid_arguments" && command ? `Run esim admin ${command.path.join(" ")} --help.` : failure.hint, secret));
38569
+ options.stderr(formatError2({ error: failure.error, message, hint: hint || undefined }, json) + `
38570
+ `);
38571
+ return failure.exitCode;
38572
+ }
38573
+ }
38574
+
38095
38575
  // login-credentials.ts
38096
38576
  var tokenSchema = string2().regex(/^esim_[A-Za-z0-9_-]+$/);
38097
38577
  var credentialSchema = object({ apiUrl: string2(), token: tokenSchema });
@@ -38119,7 +38599,7 @@ function saveCredentials(store, credentials) {
38119
38599
  }
38120
38600
 
38121
38601
  // version.ts
38122
- var version2 = "2026.1202.212";
38602
+ var version2 = "2026.1202.214";
38123
38603
  var installKind = version2 === "dev" ? "source" : typeof ESIM_CLI_EXECUTABLE === "boolean" && ESIM_CLI_EXECUTABLE ? "executable" : "npm";
38124
38604
  var npmLatestUrl = "https://registry.npmjs.org/esim-cli/latest";
38125
38605
  var releaseUrl = (release) => `https://github.com/CorrectRoadH/open-esim/releases/download/cli-v${release}`;
@@ -38331,7 +38811,7 @@ async function upgrade(executable, json, stdout) {
38331
38811
  `);
38332
38812
  }
38333
38813
  async function run(input, executable) {
38334
- const notice = input[0] !== "docs" && executable.interactive && executable.noticeState && !jsonRequested(input) && !input.some((arg) => arg === "upgrade" || arg === "--version") ? updateNotice({
38814
+ const notice = input[0] !== "docs" && !isAdminInvocation(input) && executable.interactive && executable.noticeState && !jsonRequested(input) && !input.some((arg) => arg === "upgrade" || arg === "--version") ? updateNotice({
38335
38815
  fetch: executable.fetch,
38336
38816
  state: executable.noticeState,
38337
38817
  now: Date.now(),
@@ -38345,6 +38825,7 @@ async function run(input, executable) {
38345
38825
  `);
38346
38826
  return exitCode;
38347
38827
  }
38828
+ var isAdminInvocation = (argv) => argv[0] === "admin" || argv[0] === "help" && argv[1] === "admin";
38348
38829
  async function runCommandLine(input, executable) {
38349
38830
  const argv = input;
38350
38831
  const [name, ...args] = argv;
@@ -38361,6 +38842,9 @@ async function runCommandLine(input, executable) {
38361
38842
  env: { baseUrl: apiUrl },
38362
38843
  apiUrlEnvVar: "ESIM_API_URL"
38363
38844
  };
38845
+ if (isAdminInvocation(argv)) {
38846
+ return runAdmin(name === "admin" ? args : ["--help", ...args.slice(1)], options, executable.env.ESIM_SESSION_COOKIE);
38847
+ }
38364
38848
  try {
38365
38849
  if (name === "--version" && !args.filter((arg) => arg !== "--json").length) {
38366
38850
  const version = executable.version ?? version2;