import { operation, buildingBase, buildingCommonMethods, buildingView, requestBodySchema, response200, response500, security, statusSchema, tags, } from '../../chunks.ts'; const base = buildingBase('Security'); const buildingIdRequestBody = requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' } }, }); const prisonerIdRequestBody = 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.', }, }, }); export const security_ = { ...buildingCommonMethods(base), ...buildingView(base), [`${base}/view_prisoners`]: { post: { ...tags(base), ...security(), ...operation('View prisoners.', 'Displays a list of the spies that have been captured.'), ...requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, page_number: { type: 'integer', description: 'Defaults to 1. Each page contains 25 spies.', }, }, }), responses: { ...response200('Displays a list of the spies that have been captured.', { type: 'object', required: ['status', 'prisoners', 'captured_count'], properties: { status: statusSchema(), captured_count: { type: 'integer', description: 'Total captured spies across all pages (the pager is sized from this).', }, prisoners: { type: 'array', items: { type: 'object', required: ['id', 'name', 'level', 'task', 'sentence_expires'], properties: { id: { type: 'integer' }, name: { type: 'string' }, level: { type: 'integer' }, task: { type: 'string', enum: ['Captured', 'Prisoner Transport'] }, sentence_expires: { type: 'string' }, }, }, }, }, }), ...response500(), }, }, }, [`${base}/execute_prisoner`]: { post: { ...tags(base), ...security(), ...operation( 'Execute prisoner.', "Executes a prisoner rather than letting them serve out their sentence. Costs 10,000 times the prisoner's level in happiness from your planet." ), ...prisonerIdRequestBody, responses: { ...response200( "Executes a prisoner rather than letting them serve out their sentence. Costs 10,000 times the prisoner's level in happiness from your planet.", { type: 'object', required: ['status'], properties: { status: statusSchema() } } ), ...response500(), }, }, }, [`${base}/release_prisoner`]: { post: { ...tags(base), ...security(), ...operation('Release prisoner.', 'Releases a captured prisoner.'), ...prisonerIdRequestBody, 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 that are on your planet and have a level lower than your security ministry.' ), ...requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, page_number: { type: 'integer', description: 'Defaults to 1. Each page contains 25 spies.', }, }, }), responses: { ...response200( 'Displays a list of the spies that are on your planet and have a level lower than your security ministry.', { type: 'object', required: ['status', 'spies', 'spy_count'], properties: { status: statusSchema(), spy_count: { type: 'integer', description: 'Total foreign spies across all pages (the pager is sized from this).', }, spies: { type: 'array', items: { type: 'object', required: ['name', 'level', 'task', 'next_mission'], properties: { name: { type: 'string' }, level: { type: 'integer' }, task: { type: 'string' }, next_mission: { type: 'string' }, }, }, }, }, } ), ...response500(), }, }, }, };