Something went wrong. Try again.
OpenAPI 3.0 compliant spec for TLE Community.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308import { operation, buildingBase, buildingCommonMethods, buildingView, requestBodySchema, response200, response500, security, statusSchema, tags,} from '../../chunks.ts';
const base = buildingBase('MercenariesGuild');
const buildingIdRequestBody = requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' } },});
const tradeEntrySchema = { type: 'object', properties: { date_offered: { type: 'string' }, id: { type: 'integer' }, ask: { type: 'integer', description: 'Amount of essentia being asked for.' }, offer: { type: 'array', items: { type: 'string' } }, body: { type: 'object', description: 'Only present on view_market. Use with get_trade_ships to determine travel time.', properties: { id: { type: 'integer' } }, required: ['id'], }, empire: { type: 'object', description: 'Only present on view_market.', properties: { id: { type: 'integer' }, name: { type: 'string' } }, required: ['id', 'name'], }, }, required: ['date_offered', 'id', 'ask', 'offer'],};
export const mercenariesGuild = { ...buildingCommonMethods(base), ...buildingView(base),
[`${base}/add_to_market`]: { post: { ...tags(base), ...security(), ...operation('Add to market.', 'Queues a trade of a spy for others to see.'), ...requestBodySchema({ type: 'object', required: ['building_id', 'spy_id', 'ask'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, spy_id: { type: 'integer', description: 'See get_spies for a list of your spies.' }, ask: { type: 'integer', minimum: 1, maximum: 99, description: 'Amount of essentia being asked for.', }, ship_id: { type: 'integer', description: 'Optional. See get_trade_ships for details.' }, }, }), responses: { ...response200('Queues a trade of a spy for others to see.', { type: 'object', required: ['trade_id', 'status'], properties: { trade_id: { type: 'integer' }, status: statusSchema() }, }), ...response500(), }, }, },
[`${base}/get_spies`]: { post: { ...tags(base), ...security(), ...operation( 'Get spies.', 'Returns a list of spies that may be traded. Used with add_to_market.' ), ...buildingIdRequestBody, responses: { ...response200('Returns a list of spies that may be traded. Used with add_to_market.', { type: 'object', required: ['spies', 'status'], properties: { spies: { type: 'array', items: { type: 'object', properties: { id: { type: 'integer' }, name: { type: 'string' }, level: { type: 'integer' }, }, required: ['id', 'name', 'level'], }, }, status: statusSchema(), }, }), ...response500(), }, }, },
[`${base}/withdraw_from_market`]: { post: { ...tags(base), ...security(), ...operation( 'Withdraw from market.', 'Removes a trade that you have offered and collects the items up for trade.' ), ...requestBodySchema({ type: 'object', required: ['building_id', 'trade_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, trade_id: { type: 'integer', description: 'The unique id of the trade.' }, }, }), responses: { ...response200( 'Removes a trade that you have offered and collects the items up for trade.', { type: 'object', required: ['status'], properties: { status: statusSchema() } } ), ...response500(), }, }, },
[`${base}/accept_from_market`]: { post: { ...tags(base), ...security(), ...operation( 'Accept from market.', 'Accepts a trade offer from the list of available trades. See view_market.' ), ...requestBodySchema({ type: 'object', required: ['building_id', 'trade_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, trade_id: { type: 'integer', description: 'The unique id of the trade.' }, }, }), responses: { ...response200( 'Accepts a trade offer from the list of available trades. See view_market.', { type: 'object', required: ['status'], properties: { status: statusSchema() } } ), ...response500(), }, }, },
[`${base}/view_market`]: { post: { ...tags(base), ...security(), ...operation('View market.', 'Displays a list of trades available at the present time.'), ...requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, page_number: { type: 'integer', description: 'Optional. Defaults to 1. 25 trades per page.', }, }, }), responses: { ...response200('Displays a list of trades available at the present time.', { type: 'object', required: ['trades', 'trade_count', 'page_number', 'status'], properties: { trades: { type: 'array', items: tradeEntrySchema }, trade_count: { type: 'integer' }, page_number: { type: 'integer' }, status: statusSchema(), }, }), ...response500(), }, }, },
[`${base}/view_my_market`]: { post: { ...tags(base), ...security(), ...operation('View my market.', 'Displays a list of trades the current user has posted.'), ...requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, page_number: { type: 'integer', description: 'Optional. Defaults to 1. 25 trades per page.', }, }, }), responses: { ...response200('Displays a list of trades the current user has posted.', { type: 'object', required: ['trades', 'trade_count', 'page_number', 'status'], properties: { trades: { type: 'array', items: tradeEntrySchema }, trade_count: { type: 'integer' }, page_number: { type: 'integer' }, status: statusSchema(), }, }), ...response500(), }, }, },
[`${base}/get_trade_ships`]: { post: { ...tags(base), ...security(), ...operation( 'Get trade ships.', 'Returns a list of the ships that could be used to do a trade.' ), ...requestBodySchema({ type: 'object', required: ['building_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, target_body_id: { type: 'integer', description: 'Optional. If included, the estimated travel time to this body is calculated.', }, }, }), responses: { ...response200('Returns a list of the ships that could be used to do a trade.', { type: 'object', required: ['ships', 'status'], properties: { ships: { type: 'array', items: { type: 'object', properties: { id: { type: 'integer' }, type: { type: 'string' }, name: { type: 'string' }, estimated_travel_time: { type: 'integer', description: 'In seconds, one way. Only present when target_body_id is provided.', }, }, required: ['id', 'type', 'name'], }, }, status: statusSchema(), }, }), ...response500(), }, }, },
[`${base}/report_abuse`]: { post: { ...tags(base), ...security(), ...operation( 'Report abuse.', 'Reports a trade that is suspected of abusing the trade system.' ), ...requestBodySchema({ type: 'object', required: ['building_id', 'trade_id'], properties: { building_id: { type: 'integer', description: 'The unique id of the building.' }, trade_id: { type: 'integer', description: 'The unique id of the trade.' }, }, }), responses: { ...response200('Reports a trade that is suspected of abusing the trade system.', { type: 'object', required: ['status'], properties: { status: statusSchema() }, }), ...response500(), }, }, },};