Something went wrong. Try again.
OpenAPI 3.0 compliant spec for TLE Community.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130import { operation, buildingBase, buildingCommonMethods, buildingView, requestBodySchema, response200, response500, retag, security, statusSchema, tags,} from '../../chunks.ts';
// The Space Station Lab is a four-tile building — /v2/ssla, /v2/sslb, /v2/sslc, and /v2/ssld, all// of which must be built. Only the north-west tile (/v2/ssla) exposes the plan-making methods// below; the other three (sslb.ts, sslc.ts, ssld.ts) are plain buildings. Every tile's operations// are retagged to `spacestationlab` so they share one Swagger UI group.const base = buildingBase('Ssla');
const buildingIdRequestBody = requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' } },});
const makePlanSchema = { type: 'object', properties: { types: { type: 'array', items: { type: 'object', properties: { type: { type: 'string' }, name: { type: 'string' }, image: { type: 'string' }, url: { type: 'string' }, }, }, }, level_costs: { type: 'array', items: { type: 'object', properties: { level: { type: 'integer' }, food: { type: 'integer' }, ore: { type: 'integer' }, water: { type: 'integer' }, energy: { type: 'integer' }, waste: { type: 'integer' }, time: { type: 'integer' }, }, }, }, subsidy_cost: { type: 'integer' }, making: { type: 'string', description: 'Only present if a plan is currently being made.' }, },};
export const ssla = retag( { ...buildingCommonMethods(base), ...buildingView(base, { make_plan: makePlanSchema }),
[`${base}/make_plan`]: { post: { ...tags(base), ...security(), ...operation('Make plan.', 'Starts the plan creation process. Returns the building view.'), ...requestBodySchema({ type: 'object', required: ['building_id', 'type', 'level'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, type: { type: 'string', description: "Key from view's make_plan > types, e.g. 'ibs'." }, level: { type: 'integer', minimum: 1, maximum: 30, description: "The plan level (1-30), from view's make_plan > level_costs.", }, }, }), responses: { ...response200('Starts the plan creation process. Returns the building view.', { type: 'object', required: ['building', 'status'], properties: { building: { $ref: '#/components/schemas/building' }, status: statusSchema(), make_plan: makePlanSchema, }, }), ...response500(), }, }, },
[`${base}/subsidize_plan`]: { post: { ...tags(base), ...security(), ...operation( 'Subsidize plan.', "Spends essentia equal to view's subsidy_cost to complete the current plan immediately. Returns the building view. Throws 1011." ), ...buildingIdRequestBody, responses: { ...response200( "Spends essentia equal to view's subsidy_cost to complete the current plan immediately. Returns the building view. Throws 1011.", { type: 'object', required: ['building', 'status'], properties: { building: { $ref: '#/components/schemas/building' }, status: statusSchema(), make_plan: makePlanSchema, }, } ), ...response500(), }, }, }, }, 'spacestationlab');