From bce927a01008c6c78d8fcbcb27cd0e82d151baa6 Mon Sep 17 00:00:00 2001 From: Cody Miller Date: Tue, 2 Jan 2024 12:04:23 -0500 Subject: [PATCH] refactor: move target outside of config + remove fleet group and target id in favor for data --- src/rest/types/ignite.ts | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/rest/types/ignite.ts b/src/rest/types/ignite.ts index 0e723a28..94720bcb 100644 --- a/src/rest/types/ignite.ts +++ b/src/rest/types/ignite.ts @@ -8,7 +8,7 @@ import type { Timestamp, } from '../../util/types.ts'; import type {Endpoint} from '../endpoints.ts'; -import type {TargetID} from './fleet.ts'; +import type {Node} from './fleet.ts'; /** * All regions that Hop operates in @@ -238,7 +238,7 @@ export interface Deployment { /** * The config for this deployment */ - config: Omit; + config: Omit; /** * Current active rollout for deployment @@ -291,6 +291,11 @@ export interface Deployment { * The group the deployment belongs in */ group_id: Id<'deployment_group'> | null; + + /** + * Target node for deployment, if its undefined its inferred as Hop + */ + target?: DeploymentTarget | undefined; } /** @@ -682,11 +687,6 @@ export interface DeploymentConfig { */ type: RuntimeType; - /** - * Target node for deployment, if its undefined its inferred as Hop - */ - target?: DeploymentTarget | undefined; - /** * The version of this config */ @@ -728,6 +728,11 @@ export interface DeploymentConfig { * Entrypoint for this deployment */ entrypoint?: string[]; + + /** + * Target node for deployment, if its undefined its inferred as Hop + */ + target?: DeploymentTarget | undefined; } /** @@ -754,13 +759,13 @@ export interface Image { export interface DeploymentTarget { /** - * The type of target (Hop, Fleet Node or Fleet Group) + * The type of target (Hop, Fleet Node) (fleet group coming later) */ - type: 'hop' | 'fleet_node' | 'fleet_group'; + type: 'hop' | 'fleet_node'; /** - * The ID of the target that the deployment will be deployed to + * The data of the target */ - target_id: TargetID; + data: Node | null; } /**