diff --git a/src/spec/paths/empire.ts b/src/spec/paths/empire.ts index 6d1c4a6..0bcc533 100644 --- a/src/spec/paths/empire.ts +++ b/src/spec/paths/empire.ts @@ -25,6 +25,21 @@ const profileMedalsSchema = { }, }; +const viewBoostsSchema = { + type: 'object', + properties: { + spy_training: { type: 'string' }, + ore: { type: 'string' }, + water: { type: 'string' }, + storage: { type: 'string' }, + food: { type: 'string' }, + happiness: { type: 'string' }, + building: { type: 'string' }, + energy: { type: 'string' }, + }, + required: ['spy_training', 'ore', 'water', 'storage', 'food', 'happiness', 'building', 'energy'], +}; + export const empire = { '/v2/empire/is_name_available': { post: { @@ -927,32 +942,7 @@ export const empire = { 'Shows the dates at which boosts have expired or will expire. Boosts are subsidies applied to various resources using essentia.', { type: 'object', - properties: { - boosts: { - type: 'object', - properties: { - spy_training: { type: 'string' }, - ore: { type: 'string' }, - water: { type: 'string' }, - storage: { type: 'string' }, - food: { type: 'string' }, - happiness: { type: 'string' }, - building: { type: 'string' }, - energy: { type: 'string' }, - }, - required: [ - 'spy_training', - 'ore', - 'water', - 'storage', - 'food', - 'happiness', - 'building', - 'energy', - ], - }, - status: statusSchema(), - }, + properties: { boosts: viewBoostsSchema, status: statusSchema() }, required: ['boosts', 'status'], } ), @@ -970,8 +960,8 @@ export const empire = { 'Spends 5 essentia, and boosts storage (all 5 types) on all planets for 7 days. If a boost is already underway, calling again will add 7 more days. Throws 1011.', { type: 'object', - properties: { storage_boost: { type: 'string' }, status: statusSchema() }, - required: ['storage_boost', 'status'], + properties: { boosts: viewBoostsSchema, status: statusSchema() }, + required: ['boosts', 'status'], } ), ...response500(), @@ -1001,8 +991,8 @@ export const empire = { 'Spends 5 essentia, and boosts food production on all planets for 7 days. If a boost is already underway, calling again will add 7 more days. Throws 1011.', { type: 'object', - properties: { food_boost: { type: 'string' }, status: statusSchema() }, - required: ['food_boost', 'status'], + properties: { boosts: viewBoostsSchema, status: statusSchema() }, + required: ['boosts', 'status'], } ), ...response500(), @@ -1032,8 +1022,8 @@ export const empire = { 'Spends 5 essentia, and boosts water production on all planets for 7 days. If a boost is already underway, calling again will add 7 more days. Throws 1011.', { type: 'object', - properties: { water_boost: { type: 'string' }, status: statusSchema() }, - required: ['water_boost', 'status'], + properties: { boosts: viewBoostsSchema, status: statusSchema() }, + required: ['boosts', 'status'], } ), ...response500(), @@ -1063,8 +1053,8 @@ export const empire = { 'Spends 5 essentia, and boosts energy production on all planets for 7 days. If a boost is already underway, calling again will add 7 more days. Throws 1011.', { type: 'object', - properties: { energy_boost: { type: 'string' }, status: statusSchema() }, - required: ['energy_boost', 'status'], + properties: { boosts: viewBoostsSchema, status: statusSchema() }, + required: ['boosts', 'status'], } ), ...response500(), @@ -1094,8 +1084,8 @@ export const empire = { 'Spends 5 essentia, and boosts ore production on all planets for 7 days. If a boost is already underway, calling again will add 7 more days. Throws 1011.', { type: 'object', - properties: { ore_boost: { type: 'string' }, status: statusSchema() }, - required: ['ore_boost', 'status'], + properties: { boosts: viewBoostsSchema, status: statusSchema() }, + required: ['boosts', 'status'], } ), ...response500(), @@ -1125,8 +1115,8 @@ export const empire = { 'Spends 5 essentia, and boosts happiness production on all planets for 7 days. If a boost is already underway, calling again will add 7 more days. Throws 1011.', { type: 'object', - properties: { happiness_boost: { type: 'string' }, status: statusSchema() }, - required: ['happiness_boost', 'status'], + properties: { boosts: viewBoostsSchema, status: statusSchema() }, + required: ['boosts', 'status'], } ), ...response500(), @@ -1156,8 +1146,8 @@ export const empire = { 'Spends 5 essentia, and boosts build queues on all planets for 7 days. If a boost is already underway, calling again will add 7 more days. It will not boost builds already under way, only new builds added to a build queue. Throws 1011.', { type: 'object', - properties: { building_boost: { type: 'string' }, status: statusSchema() }, - required: ['building_boost', 'status'], + properties: { boosts: viewBoostsSchema, status: statusSchema() }, + required: ['boosts', 'status'], } ), ...response500(), @@ -1187,8 +1177,8 @@ export const empire = { 'Spends 5 essentia, and boosts spy training speed on all planets by 50% for 7 days. If a boost is already underway, calling again will add 7 more days. Unlike the other boosts, this one also boosts spies already in specialist training. Throws 1011.', { type: 'object', - properties: { spy_training_boost: { type: 'string' }, status: statusSchema() }, - required: ['spy_training_boost', 'status'], + properties: { boosts: viewBoostsSchema, status: statusSchema() }, + required: ['boosts', 'status'], } ), ...response500(),