Something went wrong. Try again.
OpenAPI 3.0 compliant spec for TLE Community.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167import { operation, buildingBase, buildingCommonMethods, buildingView, requestBodySchema, response200, response500, security, statusSchema, tags,} from '../../chunks.ts';
const base = buildingBase('TheDillonForge');
const buildingIdRequestBody = requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' } },});
const tasksSchema = { type: 'object', properties: { current_task: { type: 'string' }, seconds_remaining: { type: 'integer' }, can: { type: 'integer', enum: [1, 0] }, working: { type: 'string' }, subsidy_cost: { type: 'integer' }, make_plan: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, max_level: { type: 'integer' }, class: { type: 'string' }, reset_sec_per_level: { type: 'integer' }, }, }, }, split_plan: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, class: { type: 'string' }, level: { type: 'integer' }, extra_build_level: { type: 'integer' }, fail_chance: { type: 'integer' }, reset_seconds: { type: 'integer' }, }, }, }, },};
export const theDillonForge = { ...buildingCommonMethods(base), ...buildingView(base, { tasks: tasksSchema }),
[`${base}/make_plan`]: { post: { ...tags(base), ...security(), ...operation('Make plan.', 'Starts making a plan. Returns the building view.'), ...requestBodySchema({ type: 'object', required: ['building_id', 'plan_class', 'level'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, plan_class: { type: 'string', description: "The plan's class, as returned by view's tasks > make_plan.", }, level: { type: 'integer', description: 'The level to build the plan at. Cannot exceed the level of The Dillon Forge. Requires at least 2x level 1+0 plans of the specified class on the colony to build a level x+0 plan.', }, }, }), responses: { ...response200('Starts making a plan. Returns the building view.', { type: 'object', required: ['building', 'status'], properties: { building: { $ref: '#/components/schemas/building' }, status: statusSchema(), }, }), ...response500(), }, }, },
[`${base}/split_plan`]: { post: { ...tags(base), ...security(), ...operation( 'Split plan.', 'Splits a plan into its constituent glyphs. Returns the building view.' ), ...requestBodySchema({ type: 'object', required: ['building_id', 'plan_class', 'level', 'quantity'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, plan_class: { type: 'string', description: "The plan's class, as returned by view's tasks > split_plan.", }, level: { type: 'integer', description: 'The level of the plan to split.' }, extra_build_level: { type: 'integer', description: "The plan's extra build levels, if any.", }, quantity: { type: 'integer', description: 'Number of plans to feed into the forge. Time does not scale linearly — more plans is more efficient.', }, }, }), responses: { ...response200('Splits a plan into its constituent glyphs. Returns the building view.', { type: 'object', required: ['building', 'status'], properties: { building: { $ref: '#/components/schemas/building' }, status: statusSchema(), }, }), ...response500(), }, }, },
[`${base}/subsidize`]: { post: { ...tags(base), ...security(), ...operation( 'Subsidize the current forge task.', 'Spends essentia to complete the current task immediately (2e, unless splitting multiple plans). Returns the building view. Throws 1011.' ), ...buildingIdRequestBody, responses: { ...response200( 'Spends essentia to complete the current task immediately (2e, unless splitting multiple plans). Returns the building view. Throws 1011.', { type: 'object', required: ['building', 'status'], properties: { building: { $ref: '#/components/schemas/building' }, status: statusSchema(), }, } ), ...response500(), }, }, },};