Something went wrong. Try again.
OpenAPI 3.0 compliant spec for TLE Community.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339import { operation, buildingBase, requestBodySchema, response200, response500, security, statusSchema, tags,} from '../../chunks.ts';
const base = buildingBase('PoliceStation');
const buildingIdRequestBody = requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' } },});
const pagedRequestBody = (extraRequired: string[] = [], extraProperties: object = {}) => requestBodySchema({ type: 'object', required: ['building_id', ...extraRequired], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, page_number: { type: 'integer', description: 'Defaults to 1. Each page contains 25 results.', }, ...extraProperties, }, });
const shipSchema = { type: 'object', properties: { id: { type: 'integer' }, name: { type: 'string' }, type: { type: 'string' }, type_human: { type: 'string' }, date_arrives: { type: 'string' }, date_arrived: { type: 'string' }, from: { type: 'object', description: "Only included if the ship's stealth is low enough relative to the Police Station's level.", properties: { id: { type: 'integer' }, name: { type: 'string' }, empire: { type: 'object', properties: { id: { type: 'integer' }, name: { type: 'string' } }, }, }, }, },};
// PoliceStation.pod: "captured spies are detained at the Police Station." Its .pod header refers// to it as extending Buildings, but per Modules.pod, PoliceStation is a module and does not// inherit build/upgrade/downgrade/demolish/repair.export const policeStation = { [`${base}/view`]: { post: { ...tags(base), ...security(), ...operation( "Retrieve this module's properties.", 'Retrieves the properties of this module.' ), ...buildingIdRequestBody, responses: { ...response200('Retrieves the properties of this module.', { type: 'object', required: ['building', 'status'], properties: { building: { type: 'object', properties: { id: { type: 'integer' }, name: { type: 'string' }, image: { type: 'string' }, level: { type: 'integer' }, x: { type: 'integer' }, y: { type: 'integer' }, efficiency: { type: 'integer' }, }, required: ['id', 'name', 'image', 'level', 'x', 'y', 'efficiency'], }, status: statusSchema(), }, }), ...response500(), }, }, },
[`${base}/view_prisoners`]: { post: { ...tags(base), ...security(), ...operation('View prisoners.', 'Displays a list of the spies that have been captured.'), ...pagedRequestBody(), responses: { ...response200('Displays a list of the spies that have been captured.', { type: 'object', required: ['prisoners', 'status', 'captured_count'], properties: { captured_count: { type: 'integer', description: 'Total captured spies across all pages (the pager is sized from this).', }, prisoners: { type: 'array', items: { type: 'object', properties: { id: { type: 'integer' }, name: { type: 'string' }, level: { type: 'integer' }, task: { type: 'string', enum: ['Captured', 'Prisoner Transport'] }, sentence_expires: { type: 'string' }, }, }, }, status: statusSchema(), }, }), ...response500(), }, }, },
[`${base}/execute_prisoner`]: { post: { ...tags(base), ...security(), ...operation( 'Execute prisoner.', 'Executes a captured prisoner rather than letting them serve their sentence.' ), ...requestBodySchema({ type: 'object', required: ['building_id', 'prisoner_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, prisoner_id: { type: 'integer', description: 'The unique id of a captured prisoner. See view_prisoners.', }, }, }), responses: { ...response200( 'Executes a captured prisoner rather than letting them serve their sentence.', { type: 'object', required: ['status'], properties: { status: statusSchema() } } ), ...response500(), }, }, },
[`${base}/release_prisoner`]: { post: { ...tags(base), ...security(), ...operation('Release prisoner.', 'Releases a captured prisoner.'), ...requestBodySchema({ type: 'object', required: ['building_id', 'prisoner_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, prisoner_id: { type: 'integer', description: 'The unique id of a captured prisoner. See view_prisoners.', }, }, }), responses: { ...response200('Releases a captured prisoner.', { type: 'object', required: ['status'], properties: { status: statusSchema() }, }), ...response500(), }, }, },
[`${base}/view_foreign_spies`]: { post: { ...tags(base), ...security(), ...operation( 'View foreign spies.', 'Displays a list of the spies on your planet with a level lower than your Police Station.' ), ...pagedRequestBody(), responses: { ...response200( 'Displays a list of the spies on your planet with a level lower than your Police Station.', { type: 'object', required: ['spies', 'status', 'spy_count'], properties: { spy_count: { type: 'integer', description: 'Total foreign spies across all pages (the pager is sized from this).', }, spies: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, level: { type: 'integer' }, task: { type: 'string' }, next_mission: { type: 'string' }, }, }, }, status: statusSchema(), }, } ), ...response500(), }, }, },
[`${base}/view_foreign_ships`]: { post: { ...tags(base), ...security(), ...operation( 'View foreign ships.', "Shows incoming foreign ships filtered by the ship's stealth vs the Police Station's level (525 * level >= stealth to be visible at all; the `from` block requires 675 * level >= stealth)." ), ...pagedRequestBody(), responses: { ...response200( "Shows incoming foreign ships filtered by the ship's stealth vs the Police Station's level (525 * level >= stealth to be visible at all; the `from` block requires 675 * level >= stealth).", { type: 'object', required: ['ships', 'number_of_ships', 'status'], properties: { ships: { type: 'array', items: shipSchema }, number_of_ships: { type: 'integer' }, status: statusSchema(), }, } ), ...response500(), }, }, },
[`${base}/view_ships_travelling`]: { post: { ...tags(base), ...security(), ...operation( 'View ships travelling.', 'Returns a list of ships travelling to or from this planet, regardless of destination space port.' ), ...pagedRequestBody(), responses: { ...response200( 'Returns a list of ships travelling to or from this planet, regardless of destination space port.', { type: 'object', required: ['ships_travelling', 'number_of_ships_travelling', 'status'], properties: { ships_travelling: { type: 'array', items: { type: 'object', properties: { id: { type: 'integer' }, type: { type: 'string' }, type_human: { type: 'string' }, date_arrives: { type: 'string' }, from: { type: 'object', properties: { id: { type: 'integer' }, type: { type: 'string' }, name: { type: 'string' }, }, }, to: { type: 'object', properties: { id: { type: 'integer' }, type: { type: 'string' }, name: { type: 'string' }, }, }, }, }, }, number_of_ships_travelling: { type: 'integer' }, status: statusSchema(), }, } ), ...response500(), }, }, },
[`${base}/view_ships_orbiting`]: { post: { ...tags(base), ...security(), ...operation( 'View ships orbiting.', "Shows foreign ships orbiting this planet, filtered by the ship's stealth vs the Police Station's level (525 * level >= stealth to be visible at all; the `from` block requires 675 * level >= stealth)." ), ...pagedRequestBody(), responses: { ...response200( "Shows foreign ships orbiting this planet, filtered by the ship's stealth vs the Police Station's level (525 * level >= stealth to be visible at all; the `from` block requires 675 * level >= stealth).", { type: 'object', required: ['ships', 'number_of_ships', 'status'], properties: { ships: { type: 'array', items: shipSchema }, number_of_ships: { type: 'integer' }, status: statusSchema(), }, } ), ...response500(), }, }, },};