From 9c028ccf099e5dc0e83f374831096b0e1a19716b Mon Sep 17 00:00:00 2001 From: Natalie Rose Date: Thu, 3 Sep 2026 09:28:42 +1000 Subject: [PATCH] Add tags for all requests --- index.ts | 2 +- src/spec.ts | 4 + src/spec/chunks.ts | 14 ++ src/spec/paths/alliance.ts | 11 +- src/spec/paths/body.ts | 21 ++- src/spec/paths/buildings/archaeology.ts | 9 + .../paths/buildings/blackholegenerator.ts | 4 + src/spec/paths/buildings/capitol.ts | 2 + src/spec/paths/buildings/development.ts | 4 + .../paths/buildings/distributioncenter.ts | 4 + src/spec/paths/buildings/embassy.ts | 19 ++ src/spec/paths/buildings/energyreserve.ts | 2 + src/spec/paths/buildings/entertainment.ts | 3 + src/spec/paths/buildings/essentiavein.ts | 2 + src/spec/paths/buildings/foodreserve.ts | 2 + src/spec/paths/buildings/geneticslab.ts | 4 + src/spec/paths/buildings/intelligence.ts | 9 + src/spec/paths/buildings/libraryofjith.ts | 2 + src/spec/paths/buildings/mercenariesguild.ts | 9 + src/spec/paths/buildings/miningministry.ts | 7 + src/spec/paths/buildings/missioncommand.ts | 4 + src/spec/paths/buildings/network19.ts | 3 + src/spec/paths/buildings/observatory.ts | 4 + src/spec/paths/buildings/oracleofanid.ts | 3 + src/spec/paths/buildings/orestorage.ts | 2 + src/spec/paths/buildings/park.ts | 3 + src/spec/paths/buildings/planetarycommand.ts | 4 + src/spec/paths/buildings/security.ts | 5 + src/spec/paths/buildings/shipyard.ts | 7 + src/spec/paths/buildings/spaceport.ts | 20 +++ src/spec/paths/buildings/spacestationlab.ts | 3 + .../paths/buildings/subspacesupplydepot.ts | 6 + .../paths/buildings/templeofthedrajilites.ts | 3 + src/spec/paths/buildings/thedillonforge.ts | 4 + src/spec/paths/buildings/themepark.ts | 2 + src/spec/paths/buildings/trade.ts | 26 +++ src/spec/paths/buildings/transporter.ts | 14 ++ src/spec/paths/buildings/wasteexchanger.ts | 3 + src/spec/paths/buildings/wasterecycling.ts | 3 + src/spec/paths/buildings/waterstorage.ts | 2 + src/spec/paths/captcha.ts | 4 +- src/spec/paths/empire.ts | 38 ++++ src/spec/paths/inbox.ts | 19 +- src/spec/paths/map.ts | 18 +- src/spec/paths/modules/artmuseum.ts | 2 + src/spec/paths/modules/culinaryinstitute.ts | 2 + src/spec/paths/modules/ibs.ts | 2 + src/spec/paths/modules/operahouse.ts | 2 + src/spec/paths/modules/parliament.ts | 10 ++ src/spec/paths/modules/policestation.ts | 9 + src/spec/paths/modules/stationcommand.ts | 4 + src/spec/paths/modules/warehouse.ts | 2 + src/spec/paths/stats.ts | 17 +- src/spec/tags.ts | 166 ++++++++++++++++++ 54 files changed, 543 insertions(+), 7 deletions(-) create mode 100644 src/spec/tags.ts diff --git a/index.ts b/index.ts index 48b7997..ed4c362 100644 --- a/index.ts +++ b/index.ts @@ -3,5 +3,5 @@ import { spec } from './src/spec'; import 'swagger-ui/dist/swagger-ui.css'; document.addEventListener('DOMContentLoaded', () => { - SwaggerUI({ dom_id: '#main', spec }); + SwaggerUI({ dom_id: '#main', spec, docExpansion: 'none' }); }); diff --git a/src/spec.ts b/src/spec.ts index 005b297..e2e6d9d 100644 --- a/src/spec.ts +++ b/src/spec.ts @@ -1,5 +1,8 @@ import { paths } from './spec/paths.ts'; import { components } from './spec/components.ts'; +import { tags, assertAllTagsDeclared } from './spec/tags.ts'; + +assertAllTagsDeclared(paths); export const spec = { openapi: '3.1.0', @@ -20,6 +23,7 @@ wondering how to get this working on your own server please contact \`natalie@om servers: [{ url: 'https://lacuna.allosaurus-chromatic.ts.net' }], + tags, paths, components, }; diff --git a/src/spec/chunks.ts b/src/spec/chunks.ts index e7f3228..768c44b 100644 --- a/src/spec/chunks.ts +++ b/src/spec/chunks.ts @@ -3,6 +3,13 @@ // API spec to try to write and understand. Ultimately a full JSON file is output at the end but we use these functions // to simplify generation of that result. +/** Takes the output of buildingBase() (which includes a `v2/` prefix) and produces a word string ie "planetarycommand" */ +export const tags = (base: string) => { + const list = base.split('/'); + const tag = list[list.length - 1].toLowerCase(); + return { tags: [tag] }; +}; + export const security = () => { return { security: [{ tokenHttpAuthentication: [] }] }; }; @@ -112,6 +119,7 @@ export const buildingCommonMethods = (base: string) => { return { [`${base}/build`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -128,6 +136,7 @@ export const buildingCommonMethods = (base: string) => { [`${base}/upgrade`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: queueResultSchema('Adds the requested upgrade to the build queue.'), @@ -136,6 +145,7 @@ export const buildingCommonMethods = (base: string) => { [`${base}/downgrade`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: buildingViewResultSchema( @@ -146,6 +156,7 @@ export const buildingCommonMethods = (base: string) => { [`${base}/demolish`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -164,6 +175,7 @@ export const buildingCommonMethods = (base: string) => { [`${base}/repair`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: buildingViewResultSchema( @@ -174,6 +186,7 @@ export const buildingCommonMethods = (base: string) => { [`${base}/get_stats_for_level`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -242,6 +255,7 @@ export const buildingView = ( return { [`${base}/view`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/alliance.ts b/src/spec/paths/alliance.ts index 896a7d8..0b92aeb 100644 --- a/src/spec/paths/alliance.ts +++ b/src/spec/paths/alliance.ts @@ -1,4 +1,11 @@ -import { requestBodySchema, response200, response500, security, statusSchema } from '../chunks.ts'; +import { + requestBodySchema, + response200, + response500, + security, + statusSchema, + tags, +} from '../chunks.ts'; // NOTE: alliance *management* (create, invite, leave, stash, propositions/voting) lives on the // Embassy building, not this module — see src/spec/paths/buildings/embassy.ts. This module only @@ -6,6 +13,7 @@ import { requestBodySchema, response200, response500, security, statusSchema } f export const alliance = { '/v2/alliance/view_profile': { post: { + ...tags('alliance'), ...security(), ...requestBodySchema({ @@ -71,6 +79,7 @@ export const alliance = { '/v2/alliance/find': { post: { + ...tags('alliance'), ...security(), ...requestBodySchema({ diff --git a/src/spec/paths/body.ts b/src/spec/paths/body.ts index d447b2b..b1a48c1 100644 --- a/src/spec/paths/body.ts +++ b/src/spec/paths/body.ts @@ -1,8 +1,16 @@ -import { requestBodySchema, response200, response500, security, statusSchema } from '../chunks.ts'; +import { + requestBodySchema, + response200, + response500, + security, + statusSchema, + tags, +} from '../chunks.ts'; export const body = { '/v2/body/get_status': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ @@ -31,6 +39,7 @@ export const body = { '/v2/body/get_body_status': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ @@ -55,6 +64,7 @@ export const body = { '/v2/body/get_buildings': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ @@ -87,6 +97,7 @@ export const body = { '/v2/body/get_buildings_resources': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ @@ -119,6 +130,7 @@ export const body = { '/v2/body/repair_list': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ @@ -154,6 +166,7 @@ export const body = { '/v2/body/rearrange_buildings': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ @@ -211,6 +224,7 @@ export const body = { '/v2/body/get_buildable': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ @@ -292,6 +306,7 @@ export const body = { '/v2/body/get_buildable_locations': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ @@ -329,6 +344,7 @@ export const body = { '/v2/body/rename': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ @@ -349,6 +365,7 @@ export const body = { '/v2/body/abandon': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ @@ -369,6 +386,7 @@ export const body = { '/v2/body/view_laws': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ @@ -410,6 +428,7 @@ export const body = { '/v2/body/set_colony_notes': { post: { + ...tags('body'), ...security(), ...requestBodySchema({ diff --git a/src/spec/paths/buildings/archaeology.ts b/src/spec/paths/buildings/archaeology.ts index afb3abc..efb2d66 100644 --- a/src/spec/paths/buildings/archaeology.ts +++ b/src/spec/paths/buildings/archaeology.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Archaeology'); @@ -46,6 +47,7 @@ export const archaeology = { [`${base}/search_for_glyph`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -75,6 +77,7 @@ export const archaeology = { [`${base}/subsidize_search`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -96,6 +99,7 @@ export const archaeology = { [`${base}/get_glyph_summary`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -126,6 +130,7 @@ export const archaeology = { [`${base}/assemble_glyphs`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -155,6 +160,7 @@ export const archaeology = { [`${base}/get_ores_available_for_processing`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -180,6 +186,7 @@ export const archaeology = { [`${base}/view_excavators`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -225,6 +232,7 @@ export const archaeology = { [`${base}/abandon_excavator`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -244,6 +252,7 @@ export const archaeology = { [`${base}/mass_abandon_excavator`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { diff --git a/src/spec/paths/buildings/blackholegenerator.ts b/src/spec/paths/buildings/blackholegenerator.ts index 5739c2c..a924172 100644 --- a/src/spec/paths/buildings/blackholegenerator.ts +++ b/src/spec/paths/buildings/blackholegenerator.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('BlackHoleGenerator'); @@ -98,6 +99,7 @@ export const blackHoleGenerator = { [`${base}/generate_singularity`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -160,6 +162,7 @@ export const blackHoleGenerator = { [`${base}/get_actions_for`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -224,6 +227,7 @@ export const blackHoleGenerator = { [`${base}/subsidize_cooldown`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { diff --git a/src/spec/paths/buildings/capitol.ts b/src/spec/paths/buildings/capitol.ts index 581b919..03f556a 100644 --- a/src/spec/paths/buildings/capitol.ts +++ b/src/spec/paths/buildings/capitol.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Capitol'); @@ -17,6 +18,7 @@ export const capitol = { [`${base}/rename_empire`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/development.ts b/src/spec/paths/buildings/development.ts index e6f25ea..0041068 100644 --- a/src/spec/paths/buildings/development.ts +++ b/src/spec/paths/buildings/development.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Development'); @@ -68,6 +69,7 @@ export const development = { [`${base}/subsidize_build_queue`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -83,6 +85,7 @@ export const development = { [`${base}/subsidize_one_build`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -112,6 +115,7 @@ export const development = { [`${base}/cancel_build`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/distributioncenter.ts b/src/spec/paths/buildings/distributioncenter.ts index 6d104ae..18edb1b 100644 --- a/src/spec/paths/buildings/distributioncenter.ts +++ b/src/spec/paths/buildings/distributioncenter.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('DistributionCenter'); @@ -52,6 +53,7 @@ export const distributionCenter = { [`${base}/reserve`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -89,6 +91,7 @@ export const distributionCenter = { [`${base}/release_reserve`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -104,6 +107,7 @@ export const distributionCenter = { [`${base}/get_stored_resources`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { diff --git a/src/spec/paths/buildings/embassy.ts b/src/spec/paths/buildings/embassy.ts index 7c8ecc8..6d85122 100644 --- a/src/spec/paths/buildings/embassy.ts +++ b/src/spec/paths/buildings/embassy.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Embassy'); @@ -61,6 +62,7 @@ export const embassy = { [`${base}/create_alliance`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -83,6 +85,7 @@ export const embassy = { [`${base}/get_alliance_status`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -98,6 +101,7 @@ export const embassy = { [`${base}/dissolve_alliance`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -112,6 +116,7 @@ export const embassy = { [`${base}/update_alliance`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -141,6 +146,7 @@ export const embassy = { [`${base}/send_invite`]: { post: { + ...tags(base), ...security(), ...optionalMessageRequestBody(['invitee_id'], { invitee_id: { type: 'integer' } }), responses: { @@ -156,6 +162,7 @@ export const embassy = { [`${base}/withdraw_invite`]: { post: { + ...tags(base), ...security(), ...optionalMessageRequestBody(['invite_id'], { invite_id: { type: 'integer' } }), responses: { @@ -171,6 +178,7 @@ export const embassy = { [`${base}/get_pending_invites`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -199,6 +207,7 @@ export const embassy = { [`${base}/accept_invite`]: { post: { + ...tags(base), ...security(), ...optionalMessageRequestBody(['invite_id'], { invite_id: { type: 'integer' } }), responses: { @@ -214,6 +223,7 @@ export const embassy = { [`${base}/reject_invite`]: { post: { + ...tags(base), ...security(), ...optionalMessageRequestBody(['invite_id'], { invite_id: { type: 'integer' } }), responses: { @@ -229,6 +239,7 @@ export const embassy = { [`${base}/get_my_invites`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -257,6 +268,7 @@ export const embassy = { [`${base}/leave_alliance`]: { post: { + ...tags(base), ...security(), ...optionalMessageRequestBody(), responses: { @@ -272,6 +284,7 @@ export const embassy = { [`${base}/expel_member`]: { post: { + ...tags(base), ...security(), ...optionalMessageRequestBody(['empire_id'], { empire_id: { type: 'integer' } }), responses: { @@ -287,6 +300,7 @@ export const embassy = { [`${base}/assign_alliance_leader`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -306,6 +320,7 @@ export const embassy = { [`${base}/view_stash`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -335,6 +350,7 @@ export const embassy = { [`${base}/donate_to_stash`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -362,6 +378,7 @@ export const embassy = { [`${base}/exchange_with_stash`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -389,6 +406,7 @@ export const embassy = { [`${base}/view_propositions`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -431,6 +449,7 @@ export const embassy = { [`${base}/cast_vote`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/energyreserve.ts b/src/spec/paths/buildings/energyreserve.ts index 41ad886..ad7a057 100644 --- a/src/spec/paths/buildings/energyreserve.ts +++ b/src/spec/paths/buildings/energyreserve.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('EnergyReserve'); @@ -17,6 +18,7 @@ export const energyReserve = { [`${base}/dump`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/entertainment.ts b/src/spec/paths/buildings/entertainment.ts index 53005e4..0f1fae6 100644 --- a/src/spec/paths/buildings/entertainment.ts +++ b/src/spec/paths/buildings/entertainment.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Entertainment'); @@ -23,6 +24,7 @@ export const entertainment = { [`${base}/get_lottery_voting_options`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -51,6 +53,7 @@ export const entertainment = { [`${base}/duck_quack`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { diff --git a/src/spec/paths/buildings/essentiavein.ts b/src/spec/paths/buildings/essentiavein.ts index cf660ce..243f1ec 100644 --- a/src/spec/paths/buildings/essentiavein.ts +++ b/src/spec/paths/buildings/essentiavein.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('EssentiaVein'); @@ -22,6 +23,7 @@ export const essentiaVein = { [`${base}/drain`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/foodreserve.ts b/src/spec/paths/buildings/foodreserve.ts index f247431..ad6e43f 100644 --- a/src/spec/paths/buildings/foodreserve.ts +++ b/src/spec/paths/buildings/foodreserve.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('FoodReserve'); @@ -23,6 +24,7 @@ export const foodReserve = { [`${base}/dump`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/geneticslab.ts b/src/spec/paths/buildings/geneticslab.ts index cfe2c8c..395c726 100644 --- a/src/spec/paths/buildings/geneticslab.ts +++ b/src/spec/paths/buildings/geneticslab.ts @@ -8,6 +8,7 @@ import { security, speciesSchema, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('GeneticsLab'); @@ -77,6 +78,7 @@ export const geneticsLab = { [`${base}/prepare_experiment`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: experimentResultSchema( @@ -87,6 +89,7 @@ export const geneticsLab = { [`${base}/run_experiment`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -125,6 +128,7 @@ export const geneticsLab = { [`${base}/rename_species`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/intelligence.ts b/src/spec/paths/buildings/intelligence.ts index 5a7d792..3efa136 100644 --- a/src/spec/paths/buildings/intelligence.ts +++ b/src/spec/paths/buildings/intelligence.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Intelligence'); @@ -126,6 +127,7 @@ export const intelligence = { [`${base}/train_spy`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -156,6 +158,7 @@ export const intelligence = { [`${base}/view_spies`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -182,6 +185,7 @@ export const intelligence = { [`${base}/view_all_spies`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -201,6 +205,7 @@ export const intelligence = { [`${base}/subsidize_training`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -222,6 +227,7 @@ export const intelligence = { [`${base}/burn_spy`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -241,6 +247,7 @@ export const intelligence = { [`${base}/name_spy`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -264,6 +271,7 @@ export const intelligence = { [`${base}/name_spies`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -296,6 +304,7 @@ export const intelligence = { [`${base}/assign_spy`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/libraryofjith.ts b/src/spec/paths/buildings/libraryofjith.ts index d143742..879df00 100644 --- a/src/spec/paths/buildings/libraryofjith.ts +++ b/src/spec/paths/buildings/libraryofjith.ts @@ -8,6 +8,7 @@ import { security, speciesSchema, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('LibraryOfJith'); @@ -18,6 +19,7 @@ export const libraryOfJith = { [`${base}/research_species`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/mercenariesguild.ts b/src/spec/paths/buildings/mercenariesguild.ts index 0dfc3a3..3181fb0 100644 --- a/src/spec/paths/buildings/mercenariesguild.ts +++ b/src/spec/paths/buildings/mercenariesguild.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('MercenariesGuild'); @@ -47,6 +48,7 @@ export const mercenariesGuild = { [`${base}/add_to_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -76,6 +78,7 @@ export const mercenariesGuild = { [`${base}/get_spies`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -105,6 +108,7 @@ export const mercenariesGuild = { [`${base}/withdraw_from_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -123,6 +127,7 @@ export const mercenariesGuild = { [`${base}/accept_from_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -141,6 +146,7 @@ export const mercenariesGuild = { [`${base}/view_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -171,6 +177,7 @@ export const mercenariesGuild = { [`${base}/view_my_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -201,6 +208,7 @@ export const mercenariesGuild = { [`${base}/get_trade_ships`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -246,6 +254,7 @@ export const mercenariesGuild = { [`${base}/report_abuse`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/miningministry.ts b/src/spec/paths/buildings/miningministry.ts index 4521043..15e2117 100644 --- a/src/spec/paths/buildings/miningministry.ts +++ b/src/spec/paths/buildings/miningministry.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('MiningMinistry'); @@ -50,6 +51,7 @@ export const miningMinistry = { [`${base}/view_platforms`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -98,6 +100,7 @@ export const miningMinistry = { [`${base}/view_ships`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -132,6 +135,7 @@ export const miningMinistry = { [`${base}/add_cargo_ship_to_fleet`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -151,6 +155,7 @@ export const miningMinistry = { [`${base}/remove_cargo_ship_from_fleet`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -169,6 +174,7 @@ export const miningMinistry = { [`${base}/abandon_platform`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -188,6 +194,7 @@ export const miningMinistry = { [`${base}/mass_abandon_platform`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { diff --git a/src/spec/paths/buildings/missioncommand.ts b/src/spec/paths/buildings/missioncommand.ts index 68c2456..a727a4f 100644 --- a/src/spec/paths/buildings/missioncommand.ts +++ b/src/spec/paths/buildings/missioncommand.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('MissionCommand'); @@ -27,6 +28,7 @@ export const missionCommand = { [`${base}/get_missions`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -75,6 +77,7 @@ export const missionCommand = { [`${base}/complete_mission`]: { post: { + ...tags(base), ...security(), ...missionIdRequestBody('The unique id of the mission to complete.'), responses: { @@ -89,6 +92,7 @@ export const missionCommand = { [`${base}/skip_mission`]: { post: { + ...tags(base), ...security(), ...missionIdRequestBody( "The unique id of the mission to skip. Won't appear again for this empire for 30 days." diff --git a/src/spec/paths/buildings/network19.ts b/src/spec/paths/buildings/network19.ts index 40d1ff9..a2b0b54 100644 --- a/src/spec/paths/buildings/network19.ts +++ b/src/spec/paths/buildings/network19.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Network19'); @@ -24,6 +25,7 @@ export const network19 = { [`${base}/restrict_coverage`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -50,6 +52,7 @@ export const network19 = { [`${base}/view_news`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/observatory.ts b/src/spec/paths/buildings/observatory.ts index b3a56f1..c7d3bb8 100644 --- a/src/spec/paths/buildings/observatory.ts +++ b/src/spec/paths/buildings/observatory.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Observatory'); @@ -79,6 +80,7 @@ export const observatory = { [`${base}/get_probed_stars`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -111,6 +113,7 @@ export const observatory = { [`${base}/abandon_probe`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -136,6 +139,7 @@ export const observatory = { [`${base}/abandon_all_probes`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { diff --git a/src/spec/paths/buildings/oracleofanid.ts b/src/spec/paths/buildings/oracleofanid.ts index 12c17cc..85e1653 100644 --- a/src/spec/paths/buildings/oracleofanid.ts +++ b/src/spec/paths/buildings/oracleofanid.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('OracleOfAnid'); @@ -30,6 +31,7 @@ export const oracleOfAnid = { [`${base}/get_star`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -52,6 +54,7 @@ export const oracleOfAnid = { [`${base}/get_probed_stars`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/orestorage.ts b/src/spec/paths/buildings/orestorage.ts index 77dac65..0e8b17b 100644 --- a/src/spec/paths/buildings/orestorage.ts +++ b/src/spec/paths/buildings/orestorage.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('OreStorage'); @@ -23,6 +24,7 @@ export const oreStorage = { [`${base}/dump`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/park.ts b/src/spec/paths/buildings/park.ts index 40a53e8..7f56173 100644 --- a/src/spec/paths/buildings/park.ts +++ b/src/spec/paths/buildings/park.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Park'); @@ -54,6 +55,7 @@ export const park = { [`${base}/throw_a_party`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: viewResultSchema( @@ -64,6 +66,7 @@ export const park = { [`${base}/subsidize_party`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: viewResultSchema( diff --git a/src/spec/paths/buildings/planetarycommand.ts b/src/spec/paths/buildings/planetarycommand.ts index 24659f1..2103b0b 100644 --- a/src/spec/paths/buildings/planetarycommand.ts +++ b/src/spec/paths/buildings/planetarycommand.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('PlanetaryCommand'); @@ -40,6 +41,7 @@ export const planetaryCommand = { [`${base}/view_plans`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -69,6 +71,7 @@ export const planetaryCommand = { [`${base}/view_incoming_supply_chains`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -109,6 +112,7 @@ export const planetaryCommand = { [`${base}/subsidize_pod_cooldown`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { diff --git a/src/spec/paths/buildings/security.ts b/src/spec/paths/buildings/security.ts index 2f29ff5..b8435a8 100644 --- a/src/spec/paths/buildings/security.ts +++ b/src/spec/paths/buildings/security.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Security'); @@ -29,6 +30,7 @@ export const security_ = { [`${base}/view_prisoners`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -74,6 +76,7 @@ export const security_ = { [`${base}/execute_prisoner`]: { post: { + ...tags(base), ...security(), ...prisonerIdRequestBody, responses: { @@ -88,6 +91,7 @@ export const security_ = { [`${base}/release_prisoner`]: { post: { + ...tags(base), ...security(), ...prisonerIdRequestBody, responses: { @@ -103,6 +107,7 @@ export const security_ = { [`${base}/view_foreign_spies`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/shipyard.ts b/src/spec/paths/buildings/shipyard.ts index 69877e1..7ef6922 100644 --- a/src/spec/paths/buildings/shipyard.ts +++ b/src/spec/paths/buildings/shipyard.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Shipyard'); @@ -46,6 +47,7 @@ export const shipyard = { [`${base}/view_build_queue`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -67,6 +69,7 @@ export const shipyard = { [`${base}/subsidize_build_queue`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -81,6 +84,7 @@ export const shipyard = { [`${base}/subsidize_ship`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -99,6 +103,7 @@ export const shipyard = { [`${base}/get_buildable`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -168,6 +173,7 @@ export const shipyard = { [`${base}/build_ship`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -187,6 +193,7 @@ export const shipyard = { [`${base}/build_ships`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/spaceport.ts b/src/spec/paths/buildings/spaceport.ts index c2adab1..371b2a6 100644 --- a/src/spec/paths/buildings/spaceport.ts +++ b/src/spec/paths/buildings/spaceport.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('SpacePort'); @@ -96,6 +97,7 @@ export const spacePort = { [`${base}/view_all_ships`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -153,6 +155,7 @@ export const spacePort = { [`${base}/view_foreign_ships`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -182,6 +185,7 @@ export const spacePort = { [`${base}/get_fleet_for`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -223,6 +227,7 @@ export const spacePort = { [`${base}/get_ships_for`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -279,6 +284,7 @@ export const spacePort = { [`${base}/send_ship`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -298,6 +304,7 @@ export const spacePort = { [`${base}/send_ship_types`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -373,6 +380,7 @@ export const spacePort = { [`${base}/send_fleet`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -403,6 +411,7 @@ export const spacePort = { [`${base}/recall_ship`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -425,6 +434,7 @@ export const spacePort = { [`${base}/recall_all`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -443,6 +453,7 @@ export const spacePort = { [`${base}/name_ship`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -466,6 +477,7 @@ export const spacePort = { [`${base}/scuttle_ship`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -485,6 +497,7 @@ export const spacePort = { [`${base}/mass_scuttle_ship`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -507,6 +520,7 @@ export const spacePort = { [`${base}/view_ships_travelling`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -536,6 +550,7 @@ export const spacePort = { [`${base}/view_ships_orbiting`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -565,6 +580,7 @@ export const spacePort = { [`${base}/prepare_send_spies`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -607,6 +623,7 @@ export const spacePort = { [`${base}/send_spies`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -644,6 +661,7 @@ export const spacePort = { [`${base}/prepare_fetch_spies`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -688,6 +706,7 @@ export const spacePort = { [`${base}/fetch_spies`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -719,6 +738,7 @@ export const spacePort = { [`${base}/view_battle_logs`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/spacestationlab.ts b/src/spec/paths/buildings/spacestationlab.ts index 1ecc654..7d68ef0 100644 --- a/src/spec/paths/buildings/spacestationlab.ts +++ b/src/spec/paths/buildings/spacestationlab.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; // Accessible via /ssla, /sslb, /sslc, and /ssld — all four lab components must be built, but the @@ -60,6 +61,7 @@ export const spaceStationLab = { [`${base}/make_plan`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -87,6 +89,7 @@ export const spaceStationLab = { [`${base}/subsidize_plan`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { diff --git a/src/spec/paths/buildings/subspacesupplydepot.ts b/src/spec/paths/buildings/subspacesupplydepot.ts index d735696..b2c32ed 100644 --- a/src/spec/paths/buildings/subspacesupplydepot.ts +++ b/src/spec/paths/buildings/subspacesupplydepot.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('SubspaceSupplyDepot'); @@ -50,6 +51,7 @@ export const subspaceSupplyDepot = { [`${base}/transmit_food`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: workResultSchema('Converts 3600 seconds into 3600 food.'), @@ -58,6 +60,7 @@ export const subspaceSupplyDepot = { [`${base}/transmit_energy`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: workResultSchema('Converts 3600 seconds into 3600 energy.'), @@ -66,6 +69,7 @@ export const subspaceSupplyDepot = { [`${base}/transmit_ore`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: workResultSchema('Converts 3600 seconds into 3600 ore.'), @@ -74,6 +78,7 @@ export const subspaceSupplyDepot = { [`${base}/transmit_water`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: workResultSchema('Converts 3600 seconds into 3600 water.'), @@ -82,6 +87,7 @@ export const subspaceSupplyDepot = { [`${base}/complete_build_queue`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: workResultSchema("Trades seconds for the planet's build queue time."), diff --git a/src/spec/paths/buildings/templeofthedrajilites.ts b/src/spec/paths/buildings/templeofthedrajilites.ts index 9d18af1..450d35b 100644 --- a/src/spec/paths/buildings/templeofthedrajilites.ts +++ b/src/spec/paths/buildings/templeofthedrajilites.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('TempleOfTheDrajilites'); @@ -17,6 +18,7 @@ export const templeOfTheDrajilites = { [`${base}/list_planets`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -49,6 +51,7 @@ export const templeOfTheDrajilites = { [`${base}/view_planet`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/thedillonforge.ts b/src/spec/paths/buildings/thedillonforge.ts index 291196c..8de8ed6 100644 --- a/src/spec/paths/buildings/thedillonforge.ts +++ b/src/spec/paths/buildings/thedillonforge.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('TheDillonForge'); @@ -60,6 +61,7 @@ export const theDillonForge = { [`${base}/make_plan`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -93,6 +95,7 @@ export const theDillonForge = { [`${base}/split_plan`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -131,6 +134,7 @@ export const theDillonForge = { [`${base}/subsidize`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { diff --git a/src/spec/paths/buildings/themepark.ts b/src/spec/paths/buildings/themepark.ts index 1cc6ec3..3d383f1 100644 --- a/src/spec/paths/buildings/themepark.ts +++ b/src/spec/paths/buildings/themepark.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('ThemePark'); @@ -26,6 +27,7 @@ export const themePark = { [`${base}/operate`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/trade.ts b/src/spec/paths/buildings/trade.ts index 22deaad..6dfff8d 100644 --- a/src/spec/paths/buildings/trade.ts +++ b/src/spec/paths/buildings/trade.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Trade'); @@ -60,6 +61,7 @@ export const trade = { [`${base}/add_to_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -89,6 +91,7 @@ export const trade = { [`${base}/view_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -122,6 +125,7 @@ export const trade = { [`${base}/view_my_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -151,6 +155,7 @@ export const trade = { [`${base}/accept_from_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -169,6 +174,7 @@ export const trade = { [`${base}/withdraw_from_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -188,6 +194,7 @@ export const trade = { [`${base}/push_items`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -235,6 +242,7 @@ export const trade = { [`${base}/get_stored_resources`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -253,6 +261,7 @@ export const trade = { [`${base}/get_trade_ships`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -288,6 +297,7 @@ export const trade = { [`${base}/get_ships`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -318,6 +328,7 @@ export const trade = { [`${base}/get_waste_ships`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -348,6 +359,7 @@ export const trade = { [`${base}/get_supply_ships`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -378,6 +390,7 @@ export const trade = { [`${base}/view_supply_chains`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -409,6 +422,7 @@ export const trade = { [`${base}/create_supply_chain`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -433,6 +447,7 @@ export const trade = { [`${base}/update_supply_chain`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -457,6 +472,7 @@ export const trade = { [`${base}/delete_supply_chain`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -476,6 +492,7 @@ export const trade = { [`${base}/add_supply_ship_to_fleet`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -495,6 +512,7 @@ export const trade = { [`${base}/remove_supply_ship_from_fleet`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -514,6 +532,7 @@ export const trade = { [`${base}/view_waste_chains`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -542,6 +561,7 @@ export const trade = { [`${base}/update_waste_chain`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -565,6 +585,7 @@ export const trade = { [`${base}/add_waste_ship_to_fleet`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -584,6 +605,7 @@ export const trade = { [`${base}/remove_waste_ship_from_fleet`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -603,6 +625,7 @@ export const trade = { [`${base}/get_prisoners`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -632,6 +655,7 @@ export const trade = { [`${base}/get_plan_summary`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -661,6 +685,7 @@ export const trade = { [`${base}/get_glyph_summary`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -685,6 +710,7 @@ export const trade = { [`${base}/report_abuse`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/transporter.ts b/src/spec/paths/buildings/transporter.ts index 9049ccc..628cbca 100644 --- a/src/spec/paths/buildings/transporter.ts +++ b/src/spec/paths/buildings/transporter.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Transporter'); @@ -75,6 +76,7 @@ export const transporter = { [`${base}/add_to_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -110,6 +112,7 @@ export const transporter = { [`${base}/get_ships`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -141,6 +144,7 @@ export const transporter = { [`${base}/get_prisoners`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -171,6 +175,7 @@ export const transporter = { [`${base}/get_plan_summary`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -204,6 +209,7 @@ export const transporter = { [`${base}/get_glyph_summary`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -229,6 +235,7 @@ export const transporter = { [`${base}/withdraw_from_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -248,6 +255,7 @@ export const transporter = { [`${base}/accept_from_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -266,6 +274,7 @@ export const transporter = { [`${base}/view_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -297,6 +306,7 @@ export const transporter = { [`${base}/view_my_market`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -324,6 +334,7 @@ export const transporter = { [`${base}/get_stored_resources`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -343,6 +354,7 @@ export const transporter = { [`${base}/push_items`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -370,6 +382,7 @@ export const transporter = { [`${base}/trade_one_for_one`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -397,6 +410,7 @@ export const transporter = { [`${base}/report_abuse`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/wasteexchanger.ts b/src/spec/paths/buildings/wasteexchanger.ts index 416b87b..906821f 100644 --- a/src/spec/paths/buildings/wasteexchanger.ts +++ b/src/spec/paths/buildings/wasteexchanger.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('WasteExchanger'); @@ -59,6 +60,7 @@ export const wasteExchanger = { [`${base}/recycle`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -84,6 +86,7 @@ export const wasteExchanger = { [`${base}/subsidize_recycling`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/wasterecycling.ts b/src/spec/paths/buildings/wasterecycling.ts index 9aa03bd..1339470 100644 --- a/src/spec/paths/buildings/wasterecycling.ts +++ b/src/spec/paths/buildings/wasterecycling.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('WasteRecycling'); @@ -59,6 +60,7 @@ export const wasteRecycling = { [`${base}/recycle`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -84,6 +86,7 @@ export const wasteRecycling = { [`${base}/subsidize_recycling`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/buildings/waterstorage.ts b/src/spec/paths/buildings/waterstorage.ts index ccbbf0b..8eafe05 100644 --- a/src/spec/paths/buildings/waterstorage.ts +++ b/src/spec/paths/buildings/waterstorage.ts @@ -7,6 +7,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('WaterStorage'); @@ -17,6 +18,7 @@ export const waterStorage = { [`${base}/dump`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/captcha.ts b/src/spec/paths/captcha.ts index 4144696..6d5f0da 100644 --- a/src/spec/paths/captcha.ts +++ b/src/spec/paths/captcha.ts @@ -1,10 +1,11 @@ -import { requestBodySchema, response200, response500, security } from '../chunks.ts'; +import { requestBodySchema, response200, response500, security, tags } from '../chunks.ts'; // This is the standalone Captcha module (`/captcha`). Distinct from `/v2/empire/fetch_captcha`, // which is a separate, unauthenticated captcha flow used specifically for account creation. export const captcha = { '/v2/captcha/fetch': { post: { + ...tags('captcha'), ...security(), responses: { @@ -23,6 +24,7 @@ export const captcha = { '/v2/captcha/solve': { post: { + ...tags('captcha'), ...security(), ...requestBodySchema({ diff --git a/src/spec/paths/empire.ts b/src/spec/paths/empire.ts index ec0e464..e997665 100644 --- a/src/spec/paths/empire.ts +++ b/src/spec/paths/empire.ts @@ -1,4 +1,5 @@ import { + tags, requestBodySchema, response200, response500, @@ -43,6 +44,7 @@ const viewBoostsSchema = { export const empire = { '/v2/empire/is_name_available': { post: { + ...tags('empire'), responses: { ...response200( 'Returns a 1 if the name is available, or throws an exception if it is not. Throws 1000.', @@ -63,6 +65,7 @@ export const empire = { '/v2/empire/logout': { post: { + ...tags('empire'), ...security(), responses: { @@ -74,6 +77,7 @@ export const empire = { '/v2/empire/login': { post: { + ...tags('empire'), responses: { ...response200( 'Confirms the password matches the empire and returns a session id alongside the empire and server status. A session survives up to 2 hours of inactivity, so there is no need to log in again while an existing session is still valid. Throws 1004 and 1005.', @@ -113,6 +117,7 @@ export const empire = { '/v2/empire/fetch_captcha': { post: { + ...tags('empire'), responses: { ...response200( "Retrieves a captcha that is required in order to call the create method. Display the resulting captcha in your creation form and then call create with the user's response.", @@ -129,6 +134,7 @@ export const empire = { '/v2/empire/create': { post: { + ...tags('empire'), responses: { ...response200( 'Creates a new empire and returns its empire_id. The empire is not playable yet — either call update_species and then found, or skip the species step and call found directly. Throws 1000, 1001, 1002, and 1014. On a 1014 the error data carries fresh captcha information that must be used for the next attempt, since a captcha cannot be used more than once.', @@ -187,6 +193,7 @@ export const empire = { '/v2/empire/found': { post: { + ...tags('empire'), responses: { ...response200( 'Sets up an empire on its new home world. Once this method is called, the species can no longer be modified. The returned welcome_message_id identifies an inbox message that starts the tutorial, so the user can be prompted to read it right away.', @@ -224,6 +231,7 @@ export const empire = { '/v2/empire/get_invite_friend_url': { post: { + ...tags('empire'), ...security(), responses: { @@ -242,6 +250,7 @@ export const empire = { '/v2/empire/invite_friend': { post: { + ...tags('empire'), ...security(), responses: { @@ -288,6 +297,7 @@ export const empire = { '/v2/empire/get_status': { post: { + ...tags('empire'), ...security(), responses: { @@ -309,6 +319,7 @@ export const empire = { '/v2/empire/view_profile': { post: { + ...tags('empire'), ...security(), responses: { @@ -382,6 +393,7 @@ export const empire = { '/v2/empire/edit_profile': { post: { + ...tags('empire'), ...security(), responses: { @@ -597,6 +609,7 @@ export const empire = { '/v2/empire/view_public_profile': { post: { + ...tags('empire'), ...security(), responses: { @@ -758,6 +771,7 @@ export const empire = { '/v2/empire/send_password_reset_message': { post: { + ...tags('empire'), responses: { ...response200( 'Starts a password recovery process by sending an email with a recovery key. Identify the empire by exactly one of empire_id, empire_name, or email.', @@ -796,6 +810,7 @@ export const empire = { '/v2/empire/reset_password': { post: { + ...tags('empire'), responses: { ...response200( 'Change the empire password that has been forgotten. Returns the same response as `login` if successful.', @@ -838,6 +853,7 @@ export const empire = { '/v2/empire/change_password': { post: { + ...tags('empire'), ...security(), responses: { @@ -869,6 +885,7 @@ export const empire = { '/v2/empire/find': { post: { + ...tags('empire'), ...security(), responses: { @@ -909,6 +926,7 @@ export const empire = { '/v2/empire/set_status_message': { post: { + ...tags('empire'), ...security(), responses: { @@ -935,6 +953,7 @@ export const empire = { '/v2/empire/view_boosts': { post: { + ...tags('empire'), ...security(), responses: { @@ -953,6 +972,7 @@ export const empire = { '/v2/empire/boost_storage': { post: { + ...tags('empire'), ...security(), responses: { @@ -984,6 +1004,7 @@ export const empire = { '/v2/empire/boost_food': { post: { + ...tags('empire'), ...security(), responses: { @@ -1015,6 +1036,7 @@ export const empire = { '/v2/empire/boost_water': { post: { + ...tags('empire'), ...security(), responses: { @@ -1046,6 +1068,7 @@ export const empire = { '/v2/empire/boost_energy': { post: { + ...tags('empire'), ...security(), responses: { @@ -1077,6 +1100,7 @@ export const empire = { '/v2/empire/boost_ore': { post: { + ...tags('empire'), ...security(), responses: { @@ -1108,6 +1132,7 @@ export const empire = { '/v2/empire/boost_happiness': { post: { + ...tags('empire'), ...security(), responses: { @@ -1139,6 +1164,7 @@ export const empire = { '/v2/empire/boost_building': { post: { + ...tags('empire'), ...security(), responses: { @@ -1170,6 +1196,7 @@ export const empire = { '/v2/empire/boost_spy_training': { post: { + ...tags('empire'), ...security(), responses: { @@ -1201,6 +1228,7 @@ export const empire = { '/v2/empire/enable_self_destruct': { post: { + ...tags('empire'), ...security(), responses: { @@ -1215,6 +1243,7 @@ export const empire = { '/v2/empire/disable_self_destruct': { post: { + ...tags('empire'), ...security(), responses: { @@ -1230,6 +1259,7 @@ export const empire = { '/v2/empire/redeem_essentia_code': { post: { + ...tags('empire'), ...security(), responses: { @@ -1259,6 +1289,7 @@ export const empire = { '/v2/empire/update_species': { post: { + ...tags('empire'), ...security(), responses: { @@ -1289,6 +1320,7 @@ export const empire = { '/v2/empire/redefine_species_limits': { post: { + ...tags('empire'), responses: { ...response200( 'Returns the extra limits placed upon an empire that wants to redefine its species, including the essentia cost, the settable orbit range, the minimum growth affinity, and whether a redefinition is currently allowed at all.', @@ -1313,6 +1345,7 @@ export const empire = { '/v2/empire/redefine_species': { post: { + ...tags('empire'), ...security(), responses: { @@ -1339,6 +1372,7 @@ export const empire = { '/v2/empire/view_species_stats': { post: { + ...tags('empire'), ...security(), responses: { @@ -1357,6 +1391,7 @@ export const empire = { '/v2/empire/get_species_templates': { post: { + ...tags('empire'), responses: { ...response200( 'Returns the list of species templates that can be used to help the user populate the form for update_species.', @@ -1369,6 +1404,7 @@ export const empire = { '/v2/empire/view_authorized_sitters': { post: { + ...tags('empire'), ...security(), responses: { @@ -1398,6 +1434,7 @@ export const empire = { '/v2/empire/authorize_sitters': { post: { + ...tags('empire'), ...security(), responses: { @@ -1465,6 +1502,7 @@ export const empire = { '/v2/empire/deauthorize_sitters': { post: { + ...tags('empire'), ...security(), responses: { diff --git a/src/spec/paths/inbox.ts b/src/spec/paths/inbox.ts index 48a66f2..c7d54ee 100644 --- a/src/spec/paths/inbox.ts +++ b/src/spec/paths/inbox.ts @@ -1,4 +1,11 @@ -import { requestBodySchema, response200, response500, security, statusSchema } from '../chunks.ts'; +import { + requestBodySchema, + response200, + response500, + security, + statusSchema, + tags, +} from '../chunks.ts'; const MESSAGE_TAGS = [ 'Tutorial', @@ -77,6 +84,7 @@ const viewInboxResponses = (description: string) => ({ export const inbox = { '/v2/inbox/view_inbox': { post: { + ...tags('inbox'), ...security(), ...viewInboxRequestBody, responses: viewInboxResponses( @@ -87,6 +95,7 @@ export const inbox = { '/v2/inbox/view_archived': { post: { + ...tags('inbox'), ...security(), ...viewInboxRequestBody, responses: viewInboxResponses('Same as view_inbox, but shows archived messages.'), @@ -95,6 +104,7 @@ export const inbox = { '/v2/inbox/view_trashed': { post: { + ...tags('inbox'), ...security(), ...viewInboxRequestBody, responses: viewInboxResponses('Same as view_inbox, but shows trashed messages.'), @@ -103,6 +113,7 @@ export const inbox = { '/v2/inbox/view_sent': { post: { + ...tags('inbox'), ...security(), ...viewInboxRequestBody, responses: viewInboxResponses('Same as view_inbox, but shows sent messages.'), @@ -111,6 +122,7 @@ export const inbox = { '/v2/inbox/view_unread': { post: { + ...tags('inbox'), ...security(), ...viewInboxRequestBody, responses: viewInboxResponses('Same as view_inbox, but shows only unread messages.'), @@ -119,6 +131,7 @@ export const inbox = { '/v2/inbox/read_message': { post: { + ...tags('inbox'), ...security(), ...requestBodySchema({ @@ -221,6 +234,7 @@ export const inbox = { '/v2/inbox/archive_messages': { post: { + ...tags('inbox'), ...security(), ...requestBodySchema({ @@ -249,6 +263,7 @@ export const inbox = { '/v2/inbox/trash_messages': { post: { + ...tags('inbox'), ...security(), ...requestBodySchema({ @@ -276,6 +291,7 @@ export const inbox = { '/v2/inbox/trash_messages_where': { post: { + ...tags('inbox'), ...security(), ...requestBodySchema({ @@ -324,6 +340,7 @@ export const inbox = { '/v2/inbox/send_message': { post: { + ...tags('inbox'), ...security(), ...requestBodySchema({ diff --git a/src/spec/paths/map.ts b/src/spec/paths/map.ts index 26c5e28..3ed9770 100644 --- a/src/spec/paths/map.ts +++ b/src/spec/paths/map.ts @@ -1,4 +1,11 @@ -import { requestBodySchema, response200, response500, security, statusSchema } from '../chunks.ts'; +import { + requestBodySchema, + response200, + response500, + security, + statusSchema, + tags, +} from '../chunks.ts'; const empireSnippetSchema = { type: 'object', @@ -71,6 +78,7 @@ const starDetailResponses = (description: string) => ({ export const map = { '/v2/map/get_star_map': { post: { + ...tags('map'), ...security(), ...requestBodySchema({ @@ -141,6 +149,7 @@ export const map = { '/v2/map/get_stars': { post: { + ...tags('map'), ...security(), ...requestBodySchema({ @@ -173,6 +182,7 @@ export const map = { '/v2/map/check_star_for_incoming_probe': { post: { + ...tags('map'), ...security(), ...requestBodySchema({ @@ -201,6 +211,7 @@ export const map = { '/v2/map/get_star': { post: { + ...tags('map'), ...security(), ...requestBodySchema({ type: 'object', @@ -213,6 +224,7 @@ export const map = { '/v2/map/get_star_by_name': { post: { + ...tags('map'), ...security(), ...requestBodySchema({ type: 'object', @@ -227,6 +239,7 @@ export const map = { '/v2/map/get_star_by_xy': { post: { + ...tags('map'), ...security(), ...requestBodySchema({ type: 'object', @@ -239,6 +252,7 @@ export const map = { '/v2/map/search_stars': { post: { + ...tags('map'), ...security(), ...requestBodySchema({ @@ -278,6 +292,7 @@ export const map = { '/v2/map/probe_summary_fissures': { post: { + ...tags('map'), ...security(), ...requestBodySchema({ @@ -312,6 +327,7 @@ export const map = { '/v2/map/view_laws': { post: { + ...tags('map'), ...security(), ...requestBodySchema({ diff --git a/src/spec/paths/modules/artmuseum.ts b/src/spec/paths/modules/artmuseum.ts index c059750..510aa00 100644 --- a/src/spec/paths/modules/artmuseum.ts +++ b/src/spec/paths/modules/artmuseum.ts @@ -5,6 +5,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('ArtMuseum'); @@ -14,6 +15,7 @@ const base = buildingBase('ArtMuseum'); export const artMuseum = { [`${base}/view`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/modules/culinaryinstitute.ts b/src/spec/paths/modules/culinaryinstitute.ts index 770c308..93bdf70 100644 --- a/src/spec/paths/modules/culinaryinstitute.ts +++ b/src/spec/paths/modules/culinaryinstitute.ts @@ -5,6 +5,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('CulinaryInstitute'); @@ -14,6 +15,7 @@ const base = buildingBase('CulinaryInstitute'); export const culinaryInstitute = { [`${base}/view`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/modules/ibs.ts b/src/spec/paths/modules/ibs.ts index 3648473..ac2ac1c 100644 --- a/src/spec/paths/modules/ibs.ts +++ b/src/spec/paths/modules/ibs.ts @@ -5,6 +5,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('IBS'); @@ -14,6 +15,7 @@ const base = buildingBase('IBS'); export const ibs = { [`${base}/view`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/modules/operahouse.ts b/src/spec/paths/modules/operahouse.ts index 7d0e054..a4a16ae 100644 --- a/src/spec/paths/modules/operahouse.ts +++ b/src/spec/paths/modules/operahouse.ts @@ -5,6 +5,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('OperaHouse'); @@ -14,6 +15,7 @@ const base = buildingBase('OperaHouse'); export const operaHouse = { [`${base}/view`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/modules/parliament.ts b/src/spec/paths/modules/parliament.ts index 6d36694..cf8a280 100644 --- a/src/spec/paths/modules/parliament.ts +++ b/src/spec/paths/modules/parliament.ts @@ -5,6 +5,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Parliament'); @@ -58,6 +59,7 @@ const proposeMethod = ( ) => ({ [`${base}/${name}`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -76,6 +78,7 @@ const proposeMethod = ( export const parliament = { [`${base}/view`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -106,6 +109,7 @@ export const parliament = { [`${base}/view_laws`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -144,6 +148,7 @@ export const parliament = { [`${base}/view_propositions`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -162,6 +167,7 @@ export const parliament = { [`${base}/view_taxes_collected`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -198,6 +204,7 @@ export const parliament = { [`${base}/get_stars_in_jurisdiction`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -239,6 +246,7 @@ export const parliament = { [`${base}/get_bodies_for_star_in_jurisdiction`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -270,6 +278,7 @@ export const parliament = { [`${base}/get_mining_platforms_for_asteroid_in_jurisdiction`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -314,6 +323,7 @@ export const parliament = { [`${base}/cast_vote`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/modules/policestation.ts b/src/spec/paths/modules/policestation.ts index 2762a7c..5002712 100644 --- a/src/spec/paths/modules/policestation.ts +++ b/src/spec/paths/modules/policestation.ts @@ -5,6 +5,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('PoliceStation'); @@ -60,6 +61,7 @@ const shipSchema = { export const policeStation = { [`${base}/view`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -90,6 +92,7 @@ export const policeStation = { [`${base}/view_prisoners`]: { post: { + ...tags(base), ...security(), ...pagedRequestBody(), responses: { @@ -124,6 +127,7 @@ export const policeStation = { [`${base}/execute_prisoner`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -142,6 +146,7 @@ export const policeStation = { [`${base}/release_prisoner`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', @@ -161,6 +166,7 @@ export const policeStation = { [`${base}/view_foreign_spies`]: { post: { + ...tags(base), ...security(), ...pagedRequestBody(), responses: { @@ -197,6 +203,7 @@ export const policeStation = { [`${base}/view_foreign_ships`]: { post: { + ...tags(base), ...security(), ...pagedRequestBody(), responses: { @@ -219,6 +226,7 @@ export const policeStation = { [`${base}/view_ships_travelling`]: { post: { + ...tags(base), ...security(), ...pagedRequestBody(), responses: { @@ -268,6 +276,7 @@ export const policeStation = { [`${base}/view_ships_orbiting`]: { post: { + ...tags(base), ...security(), ...pagedRequestBody(), responses: { diff --git a/src/spec/paths/modules/stationcommand.ts b/src/spec/paths/modules/stationcommand.ts index e4e9b69..f007510 100644 --- a/src/spec/paths/modules/stationcommand.ts +++ b/src/spec/paths/modules/stationcommand.ts @@ -5,6 +5,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('StationCommand'); @@ -24,6 +25,7 @@ const planetSchema = { $ref: '#/components/schemas/planet_status' }; export const stationCommand = { [`${base}/view`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -62,6 +64,7 @@ export const stationCommand = { [`${base}/view_plans`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { @@ -95,6 +98,7 @@ export const stationCommand = { [`${base}/view_incoming_supply_chains`]: { post: { + ...tags(base), ...security(), ...buildingIdRequestBody, responses: { diff --git a/src/spec/paths/modules/warehouse.ts b/src/spec/paths/modules/warehouse.ts index 176eac3..2bec01b 100644 --- a/src/spec/paths/modules/warehouse.ts +++ b/src/spec/paths/modules/warehouse.ts @@ -5,6 +5,7 @@ import { response500, security, statusSchema, + tags, } from '../../chunks.ts'; const base = buildingBase('Warehouse'); @@ -14,6 +15,7 @@ const base = buildingBase('Warehouse'); export const warehouse = { [`${base}/view`]: { post: { + ...tags(base), ...security(), ...requestBodySchema({ type: 'object', diff --git a/src/spec/paths/stats.ts b/src/spec/paths/stats.ts index 9bf2e21..a000f3f 100644 --- a/src/spec/paths/stats.ts +++ b/src/spec/paths/stats.ts @@ -1,4 +1,11 @@ -import { requestBodySchema, response200, response500, security, statusSchema } from '../chunks.ts'; +import { + requestBodySchema, + response200, + response500, + security, + statusSchema, + tags, +} from '../chunks.ts'; const ALLIANCE_SORT_BY = [ 'average_empire_size_rank', @@ -154,6 +161,7 @@ const medalWinnerSchema = { export const stats = { '/v2/stats/credits': { post: { + ...tags('stats'), ...security(), responses: { @@ -175,6 +183,7 @@ export const stats = { '/v2/stats/alliance_rank': { post: { + ...tags('stats'), ...security(), ...requestBodySchema({ @@ -207,6 +216,7 @@ export const stats = { '/v2/stats/find_alliance_rank': { post: { + ...tags('stats'), ...security(), ...requestBodySchema({ @@ -255,6 +265,7 @@ export const stats = { '/v2/stats/empire_rank': { post: { + ...tags('stats'), ...security(), ...requestBodySchema({ @@ -287,6 +298,7 @@ export const stats = { '/v2/stats/find_empire_rank': { post: { + ...tags('stats'), ...security(), ...requestBodySchema({ @@ -335,6 +347,7 @@ export const stats = { '/v2/stats/colony_rank': { post: { + ...tags('stats'), ...security(), ...requestBodySchema({ @@ -364,6 +377,7 @@ export const stats = { '/v2/stats/spy_rank': { post: { + ...tags('stats'), ...security(), ...requestBodySchema({ @@ -393,6 +407,7 @@ export const stats = { '/v2/stats/weekly_medal_winners': { post: { + ...tags('stats'), ...security(), responses: { diff --git a/src/spec/tags.ts b/src/spec/tags.ts new file mode 100644 index 0000000..e62523f --- /dev/null +++ b/src/spec/tags.ts @@ -0,0 +1,166 @@ +export const tags = [ + { name: 'algae' }, + { name: 'algaepond' }, + { name: 'alliance' }, + { name: 'amalgusmeadow' }, + { name: 'apple' }, + { name: 'archaeology' }, + { name: 'artmuseum' }, + { name: 'atmosphericevaporator' }, + { name: 'beach' }, + { name: 'bean' }, + { name: 'beeldeban' }, + { name: 'beeldebannest' }, + { name: 'blackholegenerator' }, + { name: 'body' }, + { name: 'bread' }, + { name: 'burger' }, + { name: 'capitol' }, + { name: 'captcha' }, + { name: 'cheese' }, + { name: 'chip' }, + { name: 'cider' }, + { name: 'citadelofknope' }, + { name: 'cloakinglab' }, + { name: 'corn' }, + { name: 'cornmeal' }, + { name: 'crashedshipsite' }, + { name: 'crater' }, + { name: 'culinaryinstitute' }, + { name: 'dairy' }, + { name: 'denton' }, + { name: 'dentonbrambles' }, + { name: 'deployedbleeder' }, + { name: 'development' }, + { name: 'distributioncenter' }, + { name: 'embassy' }, + { name: 'empire' }, + { name: 'energyreserve' }, + { name: 'entertainment' }, + { name: 'espionage' }, + { name: 'essentiavein' }, + { name: 'fission' }, + { name: 'fissure' }, + { name: 'foodreserve' }, + { name: 'fusion' }, + { name: 'gasgiantlab' }, + { name: 'gasgiantplatform' }, + { name: 'geneticslab' }, + { name: 'geo' }, + { name: 'geothermalvent' }, + { name: 'gratchsgauntlet' }, + { name: 'greatballofjunk' }, + { name: 'grove' }, + { name: 'hallsofvrbansk' }, + { name: 'hydrocarbon' }, + { name: 'ibs' }, + { name: 'inbox' }, + { name: 'intelligence' }, + { name: 'inteltraining' }, + { name: 'interdimensionalrift' }, + { name: 'junkhengesculpture' }, + { name: 'kalavianruins' }, + { name: 'kasternskeep' }, + { name: 'lagoon' }, + { name: 'lake' }, + { name: 'lapis' }, + { name: 'lapisforest' }, + { name: 'libraryofjith' }, + { name: 'lostcityoftyleon' }, + { name: 'luxuryhousing' }, + { name: 'malcud' }, + { name: 'malcudfield' }, + { name: 'map' }, + { name: 'massadshenge' }, + { name: 'mayhemtraining' }, + { name: 'mercenariesguild' }, + { name: 'metaljunkarches' }, + { name: 'mine' }, + { name: 'miningministry' }, + { name: 'missioncommand' }, + { name: 'munitionslab' }, + { name: 'naturalspring' }, + { name: 'network19' }, + { name: 'observatory' }, + { name: 'operahouse' }, + { name: 'oracleofanid' }, + { name: 'orerefinery' }, + { name: 'orestorage' }, + { name: 'oversight' }, + { name: 'pancake' }, + { name: 'pantheonofhagness' }, + { name: 'park' }, + { name: 'parliament' }, + { name: 'pie' }, + { name: 'pilottraining' }, + { name: 'planetarycommand' }, + { name: 'policestation' }, + { name: 'politicstraining' }, + { name: 'potato' }, + { name: 'propulsion' }, + { name: 'pyramidjunksculpture' }, + { name: 'ravine' }, + { name: 'rockyoutcrop' }, + { name: 'sand' }, + { name: 'saw' }, + { name: 'security' }, + { name: 'shake' }, + { name: 'shipyard' }, + { name: 'singularity' }, + { name: 'soup' }, + { name: 'spacejunkpark' }, + { name: 'spaceport' }, + { name: 'spacestationlab' }, + { name: 'stationcommand' }, + { name: 'stats' }, + { name: 'stockpile' }, + { name: 'subspacesupplydepot' }, + { name: 'supplypod' }, + { name: 'syrup' }, + { name: 'templeofthedrajilites' }, + { name: 'terraforminglab' }, + { name: 'terraformingplatform' }, + { name: 'thedillonforge' }, + { name: 'thefttraining' }, + { name: 'themepark' }, + { name: 'trade' }, + { name: 'transporter' }, + { name: 'university' }, + { name: 'volcano' }, + { name: 'warehouse' }, + { name: 'wastedigester' }, + { name: 'wasteenergy' }, + { name: 'wasteexchanger' }, + { name: 'wasterecycling' }, + { name: 'wastesequestration' }, + { name: 'wastetreatment' }, + { name: 'waterproduction' }, + { name: 'waterpurification' }, + { name: 'waterreclamation' }, + { name: 'waterstorage' }, + { name: 'wheat' }, +]; + +// Every Operation object should carry a tag from the list above (see chunks.ts's tags() helper). +// This isn't an OpenAPI validity requirement, but an untracked tag is almost always a paths file +// that forgot to add its new resource here — so we fail the build rather than silently miss it. +export const assertAllTagsDeclared = ( + paths: Record> +) => { + const declared = new Set(tags.map((tag) => tag.name)); + const missing = new Set(); + + for (const pathItem of Object.values(paths)) { + for (const operation of Object.values(pathItem)) { + for (const tag of operation.tags ?? []) { + if (!declared.has(tag)) missing.add(tag); + } + } + } + + if (missing.size > 0) { + throw new Error( + `Operation tag(s) not declared in src/spec/tags.ts: ${[...missing].sort().join(', ')}` + ); + } +}; -- 2.51.2