diff --git a/.changeset/wicked-crabs-care.md b/.changeset/wicked-crabs-care.md new file mode 100644 index 00000000..c726a0c6 --- /dev/null +++ b/.changeset/wicked-crabs-care.md @@ -0,0 +1,5 @@ +--- +'@onehop/js': patch +--- + +Added type `DeploymentRollout` and `DeploymentBuild` to types. Added `active_build` and `active_rollout` to deployment type diff --git a/src/rest/types/ignite.ts b/src/rest/types/ignite.ts index bf3d25f3..ce0beede 100644 --- a/src/rest/types/ignite.ts +++ b/src/rest/types/ignite.ts @@ -67,6 +67,15 @@ export enum ContainerState { EXITED = 'exited', } +/** + * Rollout state for deployments + */ +export enum RolloutState { + PENDING = 'pending', + FINISHED = 'finished', + FAILED = 'FAILED', +} + /** * Restart policy for deployments */ @@ -192,8 +201,67 @@ export interface Deployment { * The config for this deployment */ config: Omit; + + /** + * Current active rollout for deployment + */ + active_rollout: DeploymentRollout | null; + + /** + * Current active build for deployment + */ + active_build: DeploymentBuild | null; } +export type DeploymentBuild = { + /** + * Deployment ID for build + */ + deployment_id: Id<'deployment'>; + + /** + * Digest for image + */ + digest: string | null; + + /** + * Timestamp of when the build has finished + */ + finished_at: Timestamp | null; + + /** + * ID of the build + */ + id: Id<'build'>; +}; + +export type DeploymentRollout = { + /** + * How many containers are being recreated + */ + count: number; + + /** + * When the rollout took place + */ + created_at: Timestamp; + + /** + * The deployment ID for rollout + */ + deployment_id: Id<'deployment'>; + + /** + * The rollout ID for rollout + */ + id: Id<'rollout'>; + + /** + * The state of the rollout + */ + state: RolloutState; +}; + // This is a type not an interface so we can make a union // when future versions of deployment configs come out export type DeploymentConfig = {