diff --git a/packages/cli/src/lib/spaces/spaces.ts b/packages/cli/src/lib/spaces/spaces.ts index 5c692e331c..723dc60539 100644 --- a/packages/cli/src/lib/spaces/spaces.ts +++ b/packages/cli/src/lib/spaces/spaces.ts @@ -28,7 +28,7 @@ export function renderInfo(space: SpaceWithOutboundIps, json: boolean) { State: space.state, Shield: displayShieldState(space), 'Outbound IPs': displayNat(space.outbound_ips), - Generation: space.generation, + Generation: space.generation.name, 'Created at': space.created_at, }, ['ID', 'Team', 'Region', 'CIDR', 'Data CIDR', 'State', 'Shield', 'Outbound IPs', 'Generation', 'Created at'], diff --git a/packages/cli/src/lib/types/fir.d.ts b/packages/cli/src/lib/types/fir.d.ts index e0604bc3de..35b77f787a 100644 --- a/packages/cli/src/lib/types/fir.d.ts +++ b/packages/cli/src/lib/types/fir.d.ts @@ -2407,7 +2407,10 @@ export interface Space { * * @example "fir" */ - generation: string; + generation: { + id: string, + name: string, + } } /** * diff --git a/packages/cli/test/fixtures/spaces/fixtures.ts b/packages/cli/test/fixtures/spaces/fixtures.ts index 420691c9f1..286a367c06 100644 --- a/packages/cli/test/fixtures/spaces/fixtures.ts +++ b/packages/cli/test/fixtures/spaces/fixtures.ts @@ -21,7 +21,7 @@ export const spaces: Record = { organization: { name: 'my-org', }, - generation: 'cedar', + generation: {id: '123', name: 'cedar'}, created_at: '2016-01-06T03:23:13Z', updated_at: '2016-01-06T03:23:13Z', }, @@ -43,7 +43,7 @@ export const spaces: Record = { organization: { name: 'my-org', }, - generation: 'cedar', + generation: {id: '123', name: 'cedar'}, created_at: '2016-01-06T03:23:13Z', updated_at: '2016-01-06T03:23:13Z', }, @@ -66,7 +66,7 @@ export const spaces: Record = { organization: { name: 'my-org', }, - generation: 'cedar', + generation: {id: '123', name: 'cedar'}, created_at: '2016-01-06T03:23:13Z', updated_at: '2016-01-06T03:23:13Z', }, diff --git a/packages/cli/test/unit/commands/spaces/info.unit.test.ts b/packages/cli/test/unit/commands/spaces/info.unit.test.ts index ae5770eba9..e396759429 100644 --- a/packages/cli/test/unit/commands/spaces/info.unit.test.ts +++ b/packages/cli/test/unit/commands/spaces/info.unit.test.ts @@ -34,7 +34,7 @@ describe('spaces:info', function () { Data CIDR: ${space.data_cidr} State: ${space.state} Shield: off - Generation: ${space.generation} + Generation: ${space.generation.name} Created at: ${space.created_at} `)) }) @@ -74,7 +74,7 @@ describe('spaces:info', function () { State: ${space.state} Shield: off Outbound IPs: 123.456.789.123 - Generation: ${space.generation} + Generation: ${space.generation.name} Created at: ${space.created_at} `)) }) @@ -101,7 +101,7 @@ describe('spaces:info', function () { State: ${space.state} Shield: off Outbound IPs: disabled - Generation: ${space.generation} + Generation: ${space.generation.name} Created at: ${space.created_at} `)) }) @@ -124,7 +124,7 @@ describe('spaces:info', function () { Data CIDR: ${space.data_cidr} State: ${space.state} Shield: off - Generation: ${space.generation} + Generation: ${space.generation.name} Created at: ${space.created_at} `)) }) @@ -147,7 +147,7 @@ describe('spaces:info', function () { Data CIDR: ${shieldSpace.data_cidr} State: ${shieldSpace.state} Shield: on - Generation: ${space.generation} + Generation: ${space.generation.name} Created at: ${shieldSpace.created_at} `)) }) @@ -169,7 +169,7 @@ describe('spaces:info', function () { Data CIDR: ${space.data_cidr} State: ${space.state} Shield: off - Generation: ${space.generation} + Generation: ${space.generation.name} Created at: ${space.created_at} `)) }) diff --git a/packages/cli/test/unit/commands/spaces/wait.unit.test.ts b/packages/cli/test/unit/commands/spaces/wait.unit.test.ts index c162491b4b..bf1033f806 100644 --- a/packages/cli/test/unit/commands/spaces/wait.unit.test.ts +++ b/packages/cli/test/unit/commands/spaces/wait.unit.test.ts @@ -56,7 +56,7 @@ describe('spaces:wait', function () { State: ${allocatedSpace.state} Shield: off Outbound IPs: 123.456.789.123 - Generation: ${allocatedSpace.generation} + Generation: ${allocatedSpace.generation.name} Created at: ${allocatedSpace.created_at} `)) expect(notifySpy.called).to.be.true @@ -115,7 +115,7 @@ describe('spaces:wait', function () { Data CIDR: ${allocatedSpace.data_cidr} State: ${allocatedSpace.state} Shield: off - Generation: ${allocatedSpace.generation} + Generation: ${allocatedSpace.generation.name} Created at: ${allocatedSpace.created_at} `)) expect(notifySpy.called).to.be.true