esim-cli 2026.1202.213 → 2026.1202.215

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/index.js CHANGED
@@ -14997,7 +14997,7 @@ var catalog = [
14997
14997
  { 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"] },
14998
14998
  { 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"] },
14999
14999
  { 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"] },
15000
- { 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"] },
15000
+ { 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"] },
15001
15001
  { 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: [] },
15002
15002
  { 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: [] },
15003
15003
  { 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: [] },
@@ -15137,18 +15137,18 @@ Each submission of the built-in gold code awards 50 gold. For other codes, a ret
15137
15137
  { 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"] },
15138
15138
  { 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"] },
15139
15139
  { 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"] },
15140
- { 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"] },
15140
+ { 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"] },
15141
15141
  { 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"] },
15142
15142
  { 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"] },
15143
15143
  { 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"] },
15144
- { 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"] },
15145
- { 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"] },
15144
+ { 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"] },
15145
+ { 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"] },
15146
15146
  { 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: [] },
15147
15147
  { 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: [] },
15148
- { 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"] },
15149
- { 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"] },
15150
- { 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"] },
15151
- { 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"] },
15148
+ { 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"] },
15149
+ { 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"] },
15150
+ { 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"] },
15151
+ { 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"] },
15152
15152
  { 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"] },
15153
15153
  { 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"] },
15154
15154
  { 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"] },
@@ -34960,6 +34960,7 @@ function giftView(data) {
34960
34960
  available: preview?.available,
34961
34961
  shortfall: preview?.shortfall,
34962
34962
  eligible: preview ? preview.eligible ? "yes" : "no" : undefined,
34963
+ reason: preview?.detail,
34963
34964
  balance: moneyLines(changed.money),
34964
34965
  stock: arrow(changed.stock),
34965
34966
  requestId: output.requestId,
@@ -34978,13 +34979,21 @@ var view2 = (receipt, self, world) => {
34978
34979
  const asset = entry.kind === "money" ? { kind: "money", amount: amount(Number(entry.amount), currencyName(world, entry.asset)) } : entry;
34979
34980
  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 };
34980
34981
  };
34981
- async function equipmentOwned(ctx, id) {
34982
+ var giftBlock = {
34983
+ equipped: { code: "equipment_gift_equipped", detail: "Remove this equipment and retry on the next game day." },
34984
+ wear_cooldown: { code: "equipment_gift_wear_cooldown", detail: "This equipment was worn today. Retry on the next game day." },
34985
+ unavailable: { code: "unavailable_asset", detail: "Choose an eligible item from your equipment inventory." }
34986
+ };
34987
+ async function equipmentGiftBlock(ctx, id) {
34982
34988
  for await (const page of ctx.pages("list-my-equipment", {}, 100)) {
34983
34989
  const item = page.items.find((item) => String(item.id) === id);
34984
- if (item)
34985
- return item.equipped !== true ? 1 : 0;
34990
+ if (!item)
34991
+ continue;
34992
+ if (item.giftEligibility === "eligible")
34993
+ return;
34994
+ return giftBlock[item.giftEligibility ?? "unavailable"];
34986
34995
  }
34987
- return 0;
34996
+ return giftBlock.unavailable;
34988
34997
  }
34989
34998
  var gift = [
34990
34999
  command24({
@@ -35047,10 +35056,14 @@ var gift = [
35047
35056
  if (recipient === me)
35048
35057
  return usage2("Choose another citizen.");
35049
35058
  const world = await geography(ctx);
35050
- const input = string4(textArg(args, "asset"));
35059
+ const assetInput = string4(textArg(args, "asset"));
35060
+ const equipmentId = identifier.safeParse(assetInput).data;
35061
+ const input = equipmentId ?? assetInput;
35051
35062
  const quantity = string4(textArg(args, "quantity"));
35052
35063
  const currency = world.countries.find((country) => country.currency.toLowerCase() === input.toLowerCase());
35053
- const kind = input.toLowerCase() === "gold" || currency ? "money" : identifier.safeParse(input).success ? "equipment" : "product";
35064
+ const kind = input.toLowerCase() === "gold" || currency ? "money" : equipmentId ? "equipment" : "product";
35065
+ const replaying = Boolean(args["request-id"] && !args["dry-run"]);
35066
+ let blocked;
35054
35067
  let before;
35055
35068
  let units;
35056
35069
  let transfer;
@@ -35069,7 +35082,9 @@ var gift = [
35069
35082
  if (kind === "equipment") {
35070
35083
  if (units !== 1)
35071
35084
  return usage2("An equipment gift transfers exactly one item.");
35072
- before = await equipmentOwned(ctx, input);
35085
+ if (!replaying)
35086
+ blocked = await equipmentGiftBlock(ctx, input);
35087
+ before = blocked ? 0 : 1;
35073
35088
  transfer = { kind, equipmentId: input };
35074
35089
  } else {
35075
35090
  const product = resolveProduct(input);
@@ -35086,22 +35101,41 @@ var gift = [
35086
35101
  const label = kind === "money" ? name : kind === "equipment" ? `equipment #${input}` : input;
35087
35102
  if (args["dry-run"]) {
35088
35103
  const short = kind === "money" ? shortfall2(amount(units, name), amount(before, name)) : shortfall2(units, before);
35089
- return { dryRun: true, preview: {
35090
- recipient: { id: recipient, name: null },
35091
- asset: sending,
35092
- available: held,
35093
- eligible: before >= units,
35094
- ...before < units ? { shortfall: short.short } : {}
35095
- }, changed: before < units ? {} : projected };
35096
- }
35097
- if (before < units && !args["request-id"]) {
35104
+ return {
35105
+ dryRun: true,
35106
+ preview: {
35107
+ recipient: { id: recipient, name: null },
35108
+ asset: sending,
35109
+ available: held,
35110
+ eligible: before >= units,
35111
+ ...before < units ? { shortfall: short.short } : {},
35112
+ ...blocked ? { reason: blocked.code, detail: blocked.detail } : {}
35113
+ },
35114
+ changed: before < units ? {} : projected
35115
+ };
35116
+ }
35117
+ if (blocked)
35118
+ return refuse3(blocked.code, blocked.detail, { asset: label }, "esim gear");
35119
+ if (before < units && !replaying) {
35098
35120
  const need = kind === "money" ? shortfall2(amount(units, name), amount(before, name)) : shortfall2(units, before);
35099
- 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");
35121
+ 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");
35100
35122
  }
35101
35123
  const note = textArg(args, "note");
35102
35124
  const replay = `esim gift send ${recipient} ${quantity} ${shellWord(input)}${note ? ` --note ${shellWord(note)}` : ""}`;
35103
- const { requestId, receipt } = await keyed2(ctx, "give-citizen-asset", { id: recipient }, { ...transfer, ...note ? { reason: note } : {} }, replay, "esim gift list");
35104
- const changed = args["request-id"] ? {} : projected;
35125
+ const { requestId, receipt } = await keyed2(ctx, "give-citizen-asset", { id: recipient }, { ...transfer, ...note ? { reason: note } : {} }, replay, "esim gift list").catch((error) => {
35126
+ if (!(error instanceof CommandError))
35127
+ throw error;
35128
+ const block = [giftBlock.equipped, giftBlock.wear_cooldown].find((block) => block.code === error.error);
35129
+ if (!block)
35130
+ throw error;
35131
+ const retry = error.details.requestId && `${replay} --request-id ${shellWord(error.details.requestId)}`;
35132
+ throw new CommandError(error.exitCode, error.error, block.detail, "", undefined, {
35133
+ ...error.details,
35134
+ context: { ...error.details.context, asset: label },
35135
+ next: [{ run: block === giftBlock.wear_cooldown && retry ? retry : "esim gear" }]
35136
+ });
35137
+ });
35138
+ const changed = replaying ? {} : projected;
35105
35139
  const gift = await ctx.call("get-my-gift", { id: string4(receipt.id) });
35106
35140
  return { requestId, gift: view2(gift, me, world), changed };
35107
35141
  }
@@ -37507,6 +37541,7 @@ function rootHelp(available) {
37507
37541
  "Start each round with: esim today",
37508
37542
  "",
37509
37543
  ...available.map(({ name, commands }) => `${name.padEnd(10)}${commands.join(" ")}`),
37544
+ ...available === standaloneGroups ? ["", "Administrator commands: esim admin --help"] : [],
37510
37545
  "",
37511
37546
  "esim docs for the game rules · battle, economy, equipment",
37512
37547
  "esim help <group> for summaries · esim <command> --help for verbs · --json for structured output"
@@ -38098,15 +38133,297 @@ async function runCommand(input, options, host = "embedded") {
38098
38133
  return { exitCode: failure.exitCode };
38099
38134
  }
38100
38135
  }
38136
+ // admin-commands.ts
38137
+ function positiveInteger(value, label, max = Number.MAX_SAFE_INTEGER) {
38138
+ const number = Number(value);
38139
+ if (value === undefined || !/^[1-9][0-9]*$/.test(value) || !Number.isSafeInteger(number) || number > max) {
38140
+ throw new CommandError(2, "invalid_arguments", `${label} must be an integer from 1 to ${max}.`, "");
38141
+ }
38142
+ return number;
38143
+ }
38144
+ function pagination(values) {
38145
+ return {
38146
+ ...values.cursor === undefined ? {} : { cursor: values.cursor },
38147
+ ...values.limit === undefined ? {} : { limit: positiveInteger(values.limit, "--limit", 100) }
38148
+ };
38149
+ }
38150
+ var resolutions = {
38151
+ fix: "accepted",
38152
+ reject: "rejected",
38153
+ duplicate: "duplicate"
38154
+ };
38155
+ function resolution(verb) {
38156
+ const status = resolutions[verb];
38157
+ const duplicate = verb === "duplicate";
38158
+ const summary = {
38159
+ fix: "Accept a verified fix. The server awards the submitter a Tester medal with 5 Gold.",
38160
+ reject: "Close a report as rejected.",
38161
+ duplicate: "Close a report as a duplicate of another report."
38162
+ }[verb];
38163
+ return {
38164
+ path: ["feedback", verb],
38165
+ usage: `esim admin feedback ${verb} <id>${duplicate ? " <original-id>" : ""} --reply <text>`,
38166
+ summary,
38167
+ positionals: duplicate ? 2 : 1,
38168
+ options: ["reply"],
38169
+ write: true,
38170
+ async run({ request }, { positionals, values, dryRun }) {
38171
+ const id = positiveInteger(positionals[0], "Feedback ID");
38172
+ const reply = values.reply?.trim();
38173
+ if (!reply || reply.includes("\x00") || Array.from(reply).length > 2000) {
38174
+ throw new CommandError(2, "invalid_arguments", "--reply must contain 1–2000 characters without NUL.", "");
38175
+ }
38176
+ const duplicateOf = duplicate ? positiveInteger(positionals[1], "Original feedback ID") : undefined;
38177
+ if (id === duplicateOf) {
38178
+ throw new CommandError(2, "invalid_arguments", "Choose a different report as the original.", "");
38179
+ }
38180
+ const body = { status, reply, ...duplicateOf === undefined ? {} : { duplicateOf } };
38181
+ const reward = status === "accepted" ? { medal: "Tester", gold: 5 } : null;
38182
+ if (dryRun) {
38183
+ const report = await request("GetAdminFeedback", { args: { id } });
38184
+ if (report.status !== "open") {
38185
+ throw new CommandError(3, "feedback_already_closed", "This feedback report is already closed.", `Run esim admin feedback show ${id} to see its final resolution.`);
38186
+ }
38187
+ return { dryRun, id, title: report.title, citizenName: report.citizenName, ...body, reward };
38188
+ }
38189
+ await request("ResolveAdminFeedback", { args: { id }, body });
38190
+ return { id, ...body, reward };
38191
+ }
38192
+ };
38193
+ }
38194
+ var coreAdminCommands = [
38195
+ {
38196
+ path: ["feedback", "list"],
38197
+ usage: "esim admin feedback list [--status <open|accepted|rejected|duplicate>] [--kind <bug|numbers|other>] [--cursor <cursor>] [--limit <1–100>]",
38198
+ summary: "List feedback from all citizens, newest first.",
38199
+ options: ["status", "kind", "cursor", "limit"],
38200
+ run({ request }, { values }) {
38201
+ return request("ListAdminFeedback", { args: {
38202
+ ...pagination(values),
38203
+ ...values.status === undefined ? {} : { status: values.status },
38204
+ ...values.kind === undefined ? {} : { kind: values.kind }
38205
+ } });
38206
+ }
38207
+ },
38208
+ {
38209
+ path: ["feedback", "show"],
38210
+ usage: "esim admin feedback show <id>",
38211
+ summary: "Read a feedback report, its submitter and any resolution.",
38212
+ positionals: 1,
38213
+ run({ request }, { positionals }) {
38214
+ return request("GetAdminFeedback", { args: { id: positiveInteger(positionals[0], "Feedback ID") } });
38215
+ }
38216
+ },
38217
+ resolution("fix"),
38218
+ resolution("reject"),
38219
+ resolution("duplicate"),
38220
+ {
38221
+ path: ["config", "show"],
38222
+ usage: "esim admin config show",
38223
+ summary: "Read world settings, pending speed and the current configuration version.",
38224
+ run: ({ request }) => request("GetWorldConfig")
38225
+ },
38226
+ {
38227
+ path: ["config", "speed"],
38228
+ usage: "esim admin config speed <1–1440> [--version <version>]",
38229
+ summary: "Schedule a speed change for the next game day. Supply the version shown by config show or --dry-run when confirming.",
38230
+ positionals: 1,
38231
+ options: ["version"],
38232
+ write: true,
38233
+ async run({ request }, { positionals, values, dryRun }) {
38234
+ const raw = positionals[0] ?? "";
38235
+ const speed = Number(raw);
38236
+ if (!/^[0-9]+(?:\.[0-9]+)?$/.test(raw) || speed < 1 || speed > 1440) {
38237
+ throw new CommandError(2, "invalid_arguments", "Speed must be a number from 1 to 1440.", "");
38238
+ }
38239
+ if (dryRun) {
38240
+ const { currentSpeed, pendingSpeed, nextDayAt, version } = await request("GetWorldConfig");
38241
+ return { dryRun, currentSpeed, pendingSpeed, requestedSpeed: speed, nextDayAt, version };
38242
+ }
38243
+ const version = values.version;
38244
+ if (!version?.trim()) {
38245
+ throw new CommandError(2, "invalid_arguments", "--version is required with --yes. Run config show or use --dry-run for the current version.", "");
38246
+ }
38247
+ return request("UpdateWorldSpeed", { args: {}, body: { speed, version } });
38248
+ }
38249
+ },
38250
+ {
38251
+ path: ["log"],
38252
+ usage: "esim admin log [--cursor <cursor>] [--limit <1–100>]",
38253
+ summary: "List recent administrator actions from the audit log.",
38254
+ options: ["cursor", "limit"],
38255
+ run: ({ request }, { values }) => request("ListModerationLog", { args: pagination(values) })
38256
+ }
38257
+ ];
38258
+
38259
+ // admin-moderation.ts
38260
+ var timedUntil = exports_iso.datetime({ offset: true });
38261
+ function invalid2(path, message) {
38262
+ throw new CommandError(2, "invalid_arguments", message, `Run esim admin ${path.join(" ")} --help.`);
38263
+ }
38264
+ function readReason(path, value, limit) {
38265
+ const reason = value?.trim();
38266
+ if (!reason || reason.includes("\x00"))
38267
+ invalid2(path, "Provide a non-empty --reason without NUL characters.");
38268
+ if (limit !== undefined && reason.length > limit)
38269
+ invalid2(path, `--reason must fit within ${limit} UTF-16 code units.`);
38270
+ return reason;
38271
+ }
38272
+ function readInteger(path, value, label, maximum) {
38273
+ const parsed = Number(value);
38274
+ if (value === undefined || !/^[1-9][0-9]*$/.test(value) || !Number.isSafeInteger(parsed) || parsed > maximum) {
38275
+ invalid2(path, `${label} must be an integer from 1 to ${maximum}.`);
38276
+ }
38277
+ return parsed;
38278
+ }
38279
+ function readUntil(path, value) {
38280
+ const until = timedUntil.safeParse(value);
38281
+ if (!until.success) {
38282
+ invalid2(path, "Provide --until as an RFC3339 timestamp with seconds and a UTC offset, such as 2026-12-31T18:00:00Z.");
38283
+ }
38284
+ return until.data;
38285
+ }
38286
+ function writeCommand(command, operation, prepare) {
38287
+ return {
38288
+ ...command,
38289
+ write: true,
38290
+ async run(ctx, args) {
38291
+ const input = prepare(args);
38292
+ const change = { command: command.path.join(" "), ...input.args, ...input.body };
38293
+ if (args.dryRun)
38294
+ return { dryRun: true, ...change };
38295
+ await ctx.request(operation, input);
38296
+ return change;
38297
+ }
38298
+ };
38299
+ }
38300
+ function accountCommand(action, summary) {
38301
+ const path = ["account", action];
38302
+ const timed = action === "ban" || action === "mute";
38303
+ return writeCommand({
38304
+ path,
38305
+ usage: `esim admin account ${action} <username>${timed ? " --until <RFC3339>" : ""} --reason <text>`,
38306
+ summary,
38307
+ positionals: 1,
38308
+ options: timed ? ["until", "reason"] : ["reason"]
38309
+ }, action === "ban" || action === "unban" ? "BanAccount" : "MuteAccount", ({ positionals, values }) => {
38310
+ const username = positionals[0]?.trim().toLowerCase();
38311
+ if (!username || !/^[a-z0-9_]{3,32}$/.test(username))
38312
+ invalid2(path, "Username must contain 3–32 letters, digits, or underscores.");
38313
+ const until = timed ? readUntil(path, values.until) : null;
38314
+ return { args: {}, body: { username, until, reason: readReason(path, values.reason) } };
38315
+ });
38316
+ }
38317
+ var deletePath = ["content", "delete"];
38318
+ var deleteContent = writeCommand({
38319
+ path: deletePath,
38320
+ usage: "esim admin content delete <article|shout> <id> --reason <text>",
38321
+ summary: "Delete an article or shout.",
38322
+ positionals: 2,
38323
+ options: ["reason"]
38324
+ }, "DeleteContent", ({ positionals, values }) => {
38325
+ const [kind, rawId] = positionals;
38326
+ if (kind !== "article" && kind !== "shout")
38327
+ invalid2(deletePath, "Content kind must be article or shout.");
38328
+ const id = readInteger(deletePath, rawId, "Content ID", Number.MAX_SAFE_INTEGER);
38329
+ return { args: {}, body: { kind, id, reason: readReason(deletePath, values.reason) } };
38330
+ });
38331
+ var reportQueues = [
38332
+ { name: "shout", label: "shout", list: "ListShoutReports", resolve: "ResolveShoutReport", supportsDeletion: true },
38333
+ { name: "article-comment", label: "article comment", list: "ListArticleCommentReports", resolve: "ResolveArticleCommentReport", supportsDeletion: true },
38334
+ { name: "citizen", label: "citizen", list: "ListCitizenReports", resolve: "ResolveCitizenReport", supportsDeletion: false },
38335
+ { name: "message", label: "private message", list: "ListMessageReports", resolve: "ResolveMessageReport", supportsDeletion: false }
38336
+ ];
38337
+ function reportCommands(queue) {
38338
+ const listPath = ["reports", queue.name, "list"];
38339
+ const resolvePath = ["reports", queue.name, "resolve"];
38340
+ const command = `esim admin reports ${queue.name}`;
38341
+ return [
38342
+ {
38343
+ path: listPath,
38344
+ usage: `${command} list [--limit <1-100>] [--cursor <cursor>]`,
38345
+ summary: `List pending ${queue.label} reports.`,
38346
+ options: ["limit", "cursor"],
38347
+ run(ctx, { values }) {
38348
+ const args = {};
38349
+ if (values.limit !== undefined)
38350
+ args.limit = readInteger(listPath, values.limit, "--limit", 100);
38351
+ if (values.cursor !== undefined)
38352
+ args.cursor = values.cursor;
38353
+ return ctx.request(queue.list, { args });
38354
+ }
38355
+ },
38356
+ writeCommand({
38357
+ path: resolvePath,
38358
+ usage: `${command} resolve <report-id>${queue.supportsDeletion ? " --action <dismiss|delete>" : ""} --reason <text>`,
38359
+ summary: queue.supportsDeletion ? `Dismiss a ${queue.label} report or delete the reported content.` : `Close a ${queue.label} report.`,
38360
+ positionals: 1,
38361
+ options: queue.supportsDeletion ? ["action", "reason"] : ["reason"]
38362
+ }, queue.resolve, ({ positionals, values }) => {
38363
+ const id = readInteger(resolvePath, positionals[0], "Report ID", Number.MAX_SAFE_INTEGER);
38364
+ const reason = readReason(resolvePath, values.reason, 500);
38365
+ if (queue.supportsDeletion) {
38366
+ const action = values.action;
38367
+ if (action !== "dismiss" && action !== "delete")
38368
+ invalid2(resolvePath, "--action must be dismiss or delete.");
38369
+ return { args: { id }, body: { action, reason } };
38370
+ }
38371
+ return { args: { id }, body: { reason } };
38372
+ })
38373
+ ];
38374
+ }
38375
+ var moderationCommands = [
38376
+ accountCommand("ban", "Ban an account until a specified time and revoke its sessions if the ban is active."),
38377
+ accountCommand("unban", "Lift an account ban."),
38378
+ accountCommand("mute", "Mute an account until a specified time."),
38379
+ accountCommand("unmute", "Lift an account mute."),
38380
+ deleteContent,
38381
+ ...reportQueues.flatMap(reportCommands)
38382
+ ];
38383
+
38384
+ // generated/admin.generated.ts
38385
+ var adminOperations = [
38386
+ { 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"] },
38387
+ { 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"] },
38388
+ { 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: [] },
38389
+ { 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: [] },
38390
+ { 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: [] },
38391
+ { 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"] },
38392
+ { 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"] },
38393
+ { 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: [] },
38394
+ { 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"] },
38395
+ { 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: [] },
38396
+ { 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"] },
38397
+ { 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: [] },
38398
+ { 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"] },
38399
+ { 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: [] },
38400
+ { 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"] },
38401
+ { 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"] },
38402
+ { 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: [] }
38403
+ ];
38404
+
38101
38405
  // login-credentials.ts
38102
38406
  var tokenSchema = string2().regex(/^esim_[A-Za-z0-9_-]+$/);
38103
38407
  var credentialSchema = object({ apiUrl: string2(), token: tokenSchema });
38408
+ function httpApiUrl(apiUrl) {
38409
+ const url = URL.canParse(apiUrl) ? new URL(apiUrl) : undefined;
38410
+ if (url && ["http:", "https:"].includes(url.protocol) && !url.username && !url.password)
38411
+ return url;
38412
+ }
38104
38413
  async function resolveCredentials(env, apiUrl, store) {
38105
38414
  if (env.ESIM_API_TOKEN)
38106
38415
  return { token: env.ESIM_API_TOKEN };
38107
38416
  if (env.ESIM_SESSION_COOKIE)
38108
38417
  return { cookie: env.ESIM_SESSION_COOKIE };
38109
- const text = await store.read();
38418
+ return readSavedCredential(apiUrl, store);
38419
+ }
38420
+ async function readSavedCredential(apiUrl, store) {
38421
+ const origin = httpApiUrl(apiUrl)?.origin;
38422
+ if (!origin)
38423
+ return;
38424
+ const text = await store.read().catch(() => {
38425
+ throw new CommandError(4, "credentials_file_error", "Could not access the local CLI credentials file.", "Check access to the credentials file and run esim login again.");
38426
+ });
38110
38427
  if (text === undefined)
38111
38428
  return;
38112
38429
  let stored;
@@ -38116,7 +38433,7 @@ async function resolveCredentials(env, apiUrl, store) {
38116
38433
  return;
38117
38434
  }
38118
38435
  const credentials = credentialSchema.safeParse(stored);
38119
- if (credentials.success && credentials.data.apiUrl === apiUrl)
38436
+ if (credentials.success && httpApiUrl(credentials.data.apiUrl)?.origin === origin)
38120
38437
  return { token: credentials.data.token };
38121
38438
  }
38122
38439
  function saveCredentials(store, credentials) {
@@ -38124,8 +38441,191 @@ function saveCredentials(store, credentials) {
38124
38441
  `);
38125
38442
  }
38126
38443
 
38444
+ // admin.ts
38445
+ var commands3 = [...coreAdminCommands, ...moderationCommands];
38446
+ var operations2 = new Map(adminOperations.map((operation) => [operation.operationId, operation]));
38447
+ var loginHint = "Run esim login for this server using an administrator account.";
38448
+ function commandUsage(command) {
38449
+ return `${command.usage}${command.write ? " (--dry-run | --yes)" : ""} [--json]`;
38450
+ }
38451
+ function groupHelp2(path, matches) {
38452
+ const name = ["esim", "admin", ...path].join(" ");
38453
+ const children = [...new Set(matches.map((command) => command.path[path.length]))];
38454
+ return [
38455
+ `Usage: ${name} <${children.join("|")}> [options]`,
38456
+ "",
38457
+ ...matches.map((command) => ` ${commandUsage(command)}
38458
+ ${command.summary}`),
38459
+ "",
38460
+ loginHint
38461
+ ].join(`
38462
+ `);
38463
+ }
38464
+ function invalid3(message, command) {
38465
+ throw new CommandError(2, "invalid_arguments", message, `Run esim admin${command ? " " + command.path.join(" ") : ""} --help.`);
38466
+ }
38467
+ function parse4(command, argv) {
38468
+ const positionals = [];
38469
+ const values = new Map;
38470
+ const flags = new Set;
38471
+ for (let index = 0;index < argv.length; index++) {
38472
+ const word = argv[index] ?? "";
38473
+ if (word === "--") {
38474
+ positionals.push(...argv.slice(index + 1));
38475
+ break;
38476
+ }
38477
+ if (!word.startsWith("-")) {
38478
+ positionals.push(word);
38479
+ continue;
38480
+ }
38481
+ if (word === "--json" || command.write && (word === "--yes" || word === "--dry-run")) {
38482
+ if (flags.has(word))
38483
+ invalid3(`Option ${word} is repeated.`, command);
38484
+ flags.add(word);
38485
+ continue;
38486
+ }
38487
+ const equals = word.indexOf("=");
38488
+ const option = equals < 0 ? word : word.slice(0, equals);
38489
+ const name = option.slice(2);
38490
+ if (!word.startsWith("--") || !command.options?.includes(name))
38491
+ invalid3(`Unknown option for ${command.path.join(" ")}.`, command);
38492
+ if (values.has(name))
38493
+ invalid3(`Option ${option} is repeated.`, command);
38494
+ const value = equals < 0 ? argv[++index] : word.slice(equals + 1);
38495
+ if (value === undefined || equals < 0 && value.startsWith("--"))
38496
+ invalid3(`Option ${option} needs a value.`, command);
38497
+ values.set(name, value);
38498
+ }
38499
+ if (positionals.length !== (command.positionals ?? 0))
38500
+ invalid3(`Usage: ${commandUsage(command)}`, command);
38501
+ const dryRun = flags.has("--dry-run");
38502
+ const confirmed = flags.has("--yes");
38503
+ if (command.write && dryRun === confirmed)
38504
+ invalid3("Choose exactly one of --dry-run and --yes.", command);
38505
+ return { positionals, values: Object.fromEntries(values), dryRun, confirmed };
38506
+ }
38507
+ function adminOrigin(baseUrl) {
38508
+ const url = httpApiUrl(baseUrl);
38509
+ const loopback = url && ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
38510
+ if (!url || !(url.protocol === "https:" || url.protocol === "http:" && loopback)) {
38511
+ throw new CommandError(2, "invalid_api_url", "Admin requires HTTPS or a loopback HTTP address.", "Check ESIM_API_URL.");
38512
+ }
38513
+ return url.origin;
38514
+ }
38515
+ function failureFor(error, operationId, input) {
38516
+ if (!(error instanceof CommandError))
38517
+ throw error;
38518
+ const readConfig = "Run esim admin config speed <speed> --dry-run to get the new version before confirming again.";
38519
+ const readFeedback = `Run esim admin feedback show ${String(input.args.id)} to check the current resolution.`;
38520
+ const conflict = error.error === "conflict" || error.error === "feedback_already_closed" || error.error === "http_409";
38521
+ if (conflict && operationId === "UpdateWorldSpeed") {
38522
+ throw new CommandError(3, "conflict", "The world configuration or game day changed. The speed update was not applied.", readConfig);
38523
+ }
38524
+ if (conflict && operationId === "ResolveAdminFeedback") {
38525
+ throw new CommandError(3, "feedback_already_closed", "This feedback report is already closed.", readFeedback);
38526
+ }
38527
+ if (error.error === "session_required" || error.error === "not_allowed_for_token") {
38528
+ throw new CommandError(3, error.error, "A current CLI device login is required for this administrator request.", loginHint);
38529
+ }
38530
+ if (error.error === "forbidden" || error.error === "http_403") {
38531
+ throw new CommandError(3, "forbidden", "The API refused this administrator request.", "Check that the signed-in account has administrator access on this server. Run esim login again if needed.");
38532
+ }
38533
+ if (error.exitCode === 4 && (operationId === "UpdateWorldSpeed" || operationId === "ResolveAdminFeedback")) {
38534
+ throw new CommandError(4, error.error, error.message, operationId === "UpdateWorldSpeed" ? "Run esim admin config show to check whether the speed change was applied." : readFeedback);
38535
+ }
38536
+ throw error;
38537
+ }
38538
+ function redact(value, secret) {
38539
+ if (!secret)
38540
+ return value;
38541
+ if (typeof value === "string")
38542
+ return value.replaceAll(secret, "[redacted]");
38543
+ if (Array.isArray(value))
38544
+ return value.map((entry) => redact(entry, secret));
38545
+ if (value !== null && typeof value === "object") {
38546
+ return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key.replaceAll(secret, "[redacted]"), redact(entry, secret)]));
38547
+ }
38548
+ return value;
38549
+ }
38550
+ async function runAdmin(argv, options, store) {
38551
+ const json = jsonRequested(argv);
38552
+ const help = flagRequested(argv, "--help");
38553
+ const words = help ? argv.filter((word) => word !== "--help" && word !== "--json") : argv;
38554
+ const command = commands3.find((entry) => entry.path.every((part, index) => part === words[index]));
38555
+ let secret = "";
38556
+ try {
38557
+ if (!command) {
38558
+ const matches = commands3.filter((entry) => words.every((word, index) => entry.path[index] === word));
38559
+ if (!matches.length)
38560
+ invalid3("Unknown administrator command.");
38561
+ options.stdout(groupHelp2(words, matches) + `
38562
+ `);
38563
+ return 0;
38564
+ }
38565
+ if (help) {
38566
+ options.stdout(`Usage: ${commandUsage(command)}
38567
+
38568
+ ${command.summary}
38569
+ `);
38570
+ return 0;
38571
+ }
38572
+ const args = parse4(command, argv.slice(command.path.length));
38573
+ const baseUrl = adminOrigin(options.env.baseUrl);
38574
+ const credentials = await readSavedCredential(baseUrl, store);
38575
+ if (!credentials) {
38576
+ throw new CommandError(3, "session_required", "A current CLI device login is required.", loginHint);
38577
+ }
38578
+ secret = credentials.token;
38579
+ const { fetch: fetch2, stdout, stderr, columns } = options;
38580
+ const transport = {
38581
+ fetch: fetch2,
38582
+ stdout,
38583
+ stderr,
38584
+ columns,
38585
+ credentials,
38586
+ env: { baseUrl, signal: options.env.signal },
38587
+ apiUrlEnvVar: "ESIM_API_URL"
38588
+ };
38589
+ const result = await command.run({
38590
+ async request(operationId, input = { args: {} }) {
38591
+ const operation = operations2.get(operationId);
38592
+ if (!operation)
38593
+ throw new CommandError(4, "operation_unavailable", "An administrator API operation is unavailable.", "Check the generated catalog.");
38594
+ if (operation.write && !args.confirmed) {
38595
+ throw new CommandError(2, "read_only", "This invocation cannot send writes.", "Confirm with --yes when ready.");
38596
+ }
38597
+ validateInput(operation, input);
38598
+ try {
38599
+ return await read(operation, input, transport);
38600
+ } catch (error) {
38601
+ failureFor(error, operationId, input);
38602
+ }
38603
+ }
38604
+ }, args);
38605
+ const safe = redact(result, secret);
38606
+ const more = command.options?.includes("cursor") ? (cursor) => [
38607
+ "esim",
38608
+ "admin",
38609
+ ...command.path,
38610
+ ...Object.entries(args.values).flatMap(([key, value]) => key !== "cursor" && value !== undefined ? [`--${key}`, String(redact(value, secret))] : []),
38611
+ "--cursor",
38612
+ cursor
38613
+ ].map(shellWord).join(" ") : undefined;
38614
+ stdout((json ? JSON.stringify(safe) : formatText(safe, more, columns) || "No results.") + `
38615
+ `);
38616
+ return 0;
38617
+ } catch (error) {
38618
+ const failure = error instanceof CommandError ? error : new CommandError(4, "unexpected_error", "The administrator command failed.", "Check the CLI and API.");
38619
+ const message = String(redact(failure.message, secret));
38620
+ const hint = String(redact(failure.error === "invalid_arguments" && command ? `Run esim admin ${command.path.join(" ")} --help.` : failure.hint, secret));
38621
+ options.stderr(formatError2({ error: failure.error, message, hint: hint || undefined }, json) + `
38622
+ `);
38623
+ return failure.exitCode;
38624
+ }
38625
+ }
38626
+
38127
38627
  // version.ts
38128
- var version2 = "2026.1202.213";
38628
+ var version2 = "2026.1202.215";
38129
38629
  var installKind = version2 === "dev" ? "source" : typeof ESIM_CLI_EXECUTABLE === "boolean" && ESIM_CLI_EXECUTABLE ? "executable" : "npm";
38130
38630
  var npmLatestUrl = "https://registry.npmjs.org/esim-cli/latest";
38131
38631
  var releaseVersion = /^\d+\.\d+\.\d+$/;
@@ -38188,8 +38688,8 @@ var identity = object({ citizen: object({ pid: string2().regex(/^[1-9][0-9]*$/),
38188
38688
  var noticeTimeout = 3000;
38189
38689
  var sleep = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
38190
38690
  function apiOrigin(apiUrl) {
38191
- const url2 = URL.canParse(apiUrl) ? new URL(apiUrl) : undefined;
38192
- if (!url2 || !["http:", "https:"].includes(url2.protocol) || url2.username || url2.password) {
38691
+ const url2 = httpApiUrl(apiUrl);
38692
+ if (!url2) {
38193
38693
  throw new CommandError(2, "invalid_api_url", "Set ESIM_API_URL to an HTTP or HTTPS URL.", "");
38194
38694
  }
38195
38695
  return url2.origin;
@@ -38257,7 +38757,7 @@ Verification code: ${userCode}
38257
38757
  if (poll.data.status === "pending")
38258
38758
  continue;
38259
38759
  const { token } = poll.data;
38260
- await saveCredentials(executable.credentials, { apiUrl: options.env.baseUrl, token });
38760
+ await saveCredentials(executable.credentials, { apiUrl: apiOrigin(options.env.baseUrl), token });
38261
38761
  const operation = operations.get("me");
38262
38762
  if (!operation)
38263
38763
  invalidResponse();
@@ -38336,7 +38836,7 @@ async function upgrade(executable, json, stdout) {
38336
38836
  `);
38337
38837
  }
38338
38838
  async function run(input, executable) {
38339
- const notice = input[0] !== "docs" && executable.interactive && executable.noticeState && !jsonRequested(input) && !input.some((arg) => arg === "upgrade" || arg === "--version") ? updateNotice({
38839
+ const notice = input[0] !== "docs" && !isAdminInvocation(input) && executable.interactive && executable.noticeState && !jsonRequested(input) && !input.some((arg) => arg === "upgrade" || arg === "--version") ? updateNotice({
38340
38840
  fetch: executable.fetch,
38341
38841
  state: executable.noticeState,
38342
38842
  now: Date.now(),
@@ -38350,6 +38850,7 @@ async function run(input, executable) {
38350
38850
  `);
38351
38851
  return exitCode;
38352
38852
  }
38853
+ var isAdminInvocation = (argv) => argv[0] === "admin" || argv[0] === "help" && argv[1] === "admin";
38353
38854
  async function runCommandLine(input, executable) {
38354
38855
  const argv = input;
38355
38856
  const [name, ...args] = argv;
@@ -38366,6 +38867,9 @@ async function runCommandLine(input, executable) {
38366
38867
  env: { baseUrl: apiUrl },
38367
38868
  apiUrlEnvVar: "ESIM_API_URL"
38368
38869
  };
38870
+ if (isAdminInvocation(argv)) {
38871
+ return runAdmin(name === "admin" ? args : ["--help", ...args.slice(1)], options, executable.credentials);
38872
+ }
38369
38873
  try {
38370
38874
  if (name === "--version" && !args.filter((arg) => arg !== "--json").length) {
38371
38875
  const version = executable.version ?? version2;