import { operation, requestBodySchema, response200, response500, security, statusSchema, tags, } from '../chunks.ts'; // NOTE: alliance *management* (create, invite, leave, stash, propositions/voting) lives on the // Embassy building, not this module — see src/spec/paths/buildings/embassy.ts. This module only // exposes read-only alliance lookups. export const alliance = { '/v2/alliance/view_profile': { post: { ...tags('alliance'), ...security(), ...operation( "View an alliance's public profile.", 'Provides a list of the data that is publicly known about an alliance. Throws 1002.' ), ...requestBodySchema({ type: 'object', required: ['alliance_id'], properties: { alliance_id: { type: 'integer', description: "The id of the alliance for which you'd like to retrieve the public profile.", }, }, }), responses: { ...response200("Provides a list of the data that's publicly known about this alliance.", { type: 'object', required: ['profile', 'status'], properties: { profile: { type: 'object', required: [ 'id', 'name', 'description', 'leader_id', 'date_created', 'members', 'space_stations', 'influence', ], properties: { id: { type: 'integer' }, name: { type: 'string' }, description: { type: 'string' }, leader_id: { type: 'integer' }, date_created: { type: 'string' }, members: { type: 'array', items: { type: 'object', required: ['id', 'name'], properties: { id: { type: 'integer' }, name: { type: 'string' } }, }, }, space_stations: { type: 'array', items: { type: 'object', required: ['id', 'name', 'x', 'y'], properties: { id: { type: 'integer' }, name: { type: 'string' }, x: { type: 'number' }, y: { type: 'number' }, }, }, }, influence: { type: 'integer' }, }, }, status: statusSchema(), }, }), ...response500(), }, }, }, '/v2/alliance/find': { post: { ...tags('alliance'), ...security(), ...operation( 'Find alliances by name.', 'Finds an alliance by name. Returns a hash reference containing alliance ids and alliance names.' ), ...requestBodySchema({ type: 'object', required: ['name'], properties: { name: { type: 'string', description: "The name you're searching for. Case insensitive, and partial names work fine. Must be at least 3 characters.", }, }, }), responses: { ...response200( 'Find an alliance by name. Case insensitive, partial matches accepted. Must be at least 3 characters.', { type: 'object', required: ['alliances', 'status'], properties: { alliances: { type: 'array', items: { type: 'object', required: ['id', 'name'], properties: { id: { type: 'integer' }, name: { type: 'string' } }, }, }, status: statusSchema(), }, } ), ...response500(), }, }, }, };