Something went wrong. Try again.
OpenAPI 3.0 compliant spec for TLE Community.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145import { operation, buildingBase, buildingCommonMethods, buildingView, requestBodySchema, response200, response500, security, statusSchema, tags,} from '../../chunks.ts';
const base = buildingBase('PlanetaryCommand');
const buildingIdRequestBody = requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' } },});
export const planetaryCommand = { ...buildingCommonMethods(base), ...buildingView(base, { next_colony_cost: { type: 'integer', description: 'Happiness required to settle the next colony.', }, food: { type: 'object', description: 'Hourly rate and stored amount, keyed by food type (algae, bean, etc).', additionalProperties: { type: 'integer' }, }, ore: { type: 'object', description: 'Hourly rate and stored amount, keyed by ore type.', additionalProperties: { type: 'integer' }, }, pod_delay: { type: 'integer', description: 'Seconds between supply pods being sent.' }, planet: { $ref: '#/components/schemas/planet_status' }, }),
[`${base}/view_plans`]: { post: { ...tags(base), ...security(), ...operation('View plans.', 'Lists all building plans this empire has collected.'), ...buildingIdRequestBody, responses: { ...response200('Lists all building plans this empire has collected.', { type: 'object', required: ['plans', 'status'], properties: { plans: { type: 'array', items: { type: 'object', properties: { quantity: { type: 'integer' }, name: { type: 'string' }, level: { type: 'integer' }, extra_build_level: { type: 'integer' }, }, }, }, status: statusSchema(), }, }), ...response500(), }, }, },
[`${base}/view_incoming_supply_chains`]: { post: { ...tags(base), ...security(), ...operation( 'View incoming supply chains.', 'Lists supply chains feeding resources into this planet.' ), ...buildingIdRequestBody, responses: { ...response200('Lists supply chains feeding resources into this planet.', { type: 'object', required: ['supply_chains', 'status'], properties: { supply_chains: { type: 'array', items: { type: 'object', properties: { id: { type: 'integer' }, from_body: { type: 'object', properties: { id: { type: 'integer' }, name: { type: 'string' }, x: { type: 'integer' }, y: { type: 'integer' }, image: { type: 'string' }, }, }, resource_hour: { type: 'integer' }, resource_type: { type: 'string' }, percent_transferred: { type: 'number' }, stalled: { type: 'integer', enum: [1, 0] }, }, }, }, status: statusSchema(), }, }), ...response500(), }, }, },
[`${base}/subsidize_pod_cooldown`]: { post: { ...tags(base), ...security(), ...operation( 'Subsidize pod cooldown.', 'Spends 2 essentia to send a supply pod immediately. Returns the building view. Throws 1011.' ), ...buildingIdRequestBody, responses: { ...response200( 'Spends 2 essentia to send a supply pod immediately. Returns the building view. Throws 1011.', { type: 'object', required: ['building', 'status'], properties: { building: { $ref: '#/components/schemas/building' }, status: statusSchema(), }, } ), ...response500(), }, }, },};