diff --git a/.scripts/generate-api.ts b/.scripts/generate-api.ts index 49e419b..f0af917 100644 --- a/.scripts/generate-api.ts +++ b/.scripts/generate-api.ts @@ -10,7 +10,6 @@ const output = await openapiTS(url, { supportArrayLength: true, alphabetize: true, immutableTypes: true, - defaultNonNullable: true, transform(schemaObject) { if ("format" in schemaObject && schemaObject.format === "date-time") { return "Date"; diff --git a/api/openapi.ts b/api/openapi.ts index 0876ebf..ed8bbb7 100644 --- a/api/openapi.ts +++ b/api/openapi.ts @@ -248,12 +248,12 @@ export interface operations { /** Format: uuid */ readonly containerRegistry?: string; /** @default true */ - readonly enabled: boolean; + readonly enabled?: boolean; readonly env?: readonly ({ readonly name: string; readonly value: string; })[]; - readonly healthchecks?: { + readonly healthChecks?: { readonly liveness?: { readonly failureThreshold?: number; readonly headers?: readonly ({ @@ -325,9 +325,8 @@ export interface operations { })[]; readonly name: string; /** @default 80 */ - readonly port: number; - /** @default null */ - readonly region: string | null; + readonly port?: number; + readonly region?: string; readonly repositories?: { readonly dataset: string; readonly mountPath?: string; @@ -362,7 +361,7 @@ export interface operations { }; readonly instanceType: string; /** @default 1 */ - readonly replicas: number; + readonly replicas?: number; }; }) | ({ @@ -372,7 +371,7 @@ export interface operations { /** Format: uuid */ readonly containerRegistry?: string; /** @default true */ - readonly enabled: boolean; + readonly enabled?: boolean; readonly env?: readonly ({ readonly name: string; readonly value: string; @@ -444,8 +443,7 @@ export interface operations { }; readonly image: string; readonly name: string; - /** @default null */ - readonly region: string | null; + readonly region?: string; }); /** @description The ID of the deployment the spec belongs to */ readonly deploymentId: string; @@ -466,7 +464,7 @@ export interface operations { * @description The last version hash for the deployment * @default null */ - readonly latestSpecHash: string | null; + readonly latestSpecHash?: string | null; /** @description The name of the deployment */ readonly name: string; /** @description The ID of the project the deployment belongs to */ @@ -498,12 +496,12 @@ export interface operations { /** Format: uuid */ readonly containerRegistry?: string; /** @default true */ - readonly enabled: boolean; + readonly enabled?: boolean; readonly env?: readonly ({ readonly name: string; readonly value: string; })[]; - readonly healthchecks?: { + readonly healthChecks?: { readonly liveness?: { readonly failureThreshold?: number; readonly headers?: readonly ({ @@ -575,9 +573,8 @@ export interface operations { })[]; readonly name: string; /** @default 80 */ - readonly port: number; - /** @default null */ - readonly region: string | null; + readonly port?: number; + readonly region?: string; readonly repositories?: { readonly dataset: string; readonly mountPath?: string; @@ -612,7 +609,7 @@ export interface operations { }; readonly instanceType: string; /** @default 1 */ - readonly replicas: number; + readonly replicas?: number; }; }) | ({ @@ -622,7 +619,7 @@ export interface operations { /** Format: uuid */ readonly containerRegistry?: string; /** @default true */ - readonly enabled: boolean; + readonly enabled?: boolean; readonly env?: readonly ({ readonly name: string; readonly value: string; @@ -694,14 +691,13 @@ export interface operations { }; readonly image: string; readonly name: string; - /** @default null */ - readonly region: string | null; + readonly region?: string; }); /** * @description The ID of the deployment to update. * @default null */ - readonly deploymentId: string | null; + readonly deploymentId?: string | null; /** @description The project ID to deploy resources under. */ readonly projectId: string; }; @@ -756,12 +752,12 @@ export interface operations { /** Format: uuid */ readonly containerRegistry?: string; /** @default true */ - readonly enabled: boolean; + readonly enabled?: boolean; readonly env?: readonly ({ readonly name: string; readonly value: string; })[]; - readonly healthchecks?: { + readonly healthChecks?: { readonly liveness?: { readonly failureThreshold?: number; readonly headers?: readonly ({ @@ -833,9 +829,8 @@ export interface operations { })[]; readonly name: string; /** @default 80 */ - readonly port: number; - /** @default null */ - readonly region: string | null; + readonly port?: number; + readonly region?: string; readonly repositories?: { readonly dataset: string; readonly mountPath?: string; @@ -870,7 +865,7 @@ export interface operations { }; readonly instanceType: string; /** @default 1 */ - readonly replicas: number; + readonly replicas?: number; }; }) | ({ @@ -880,7 +875,7 @@ export interface operations { /** Format: uuid */ readonly containerRegistry?: string; /** @default true */ - readonly enabled: boolean; + readonly enabled?: boolean; readonly env?: readonly ({ readonly name: string; readonly value: string; @@ -952,8 +947,7 @@ export interface operations { }; readonly image: string; readonly name: string; - /** @default null */ - readonly region: string | null; + readonly region?: string; }); /** @description The ID of the deployment the spec belongs to */ readonly deploymentId: string; @@ -974,7 +968,7 @@ export interface operations { * @description The last version hash for the deployment * @default null */ - readonly latestSpecHash: string | null; + readonly latestSpecHash?: string | null; /** @description The name of the deployment */ readonly name: string; /** @description The ID of the project the deployment belongs to */ @@ -1035,7 +1029,7 @@ export interface operations { * @description The amount of replicas that are available but not ready * @default 0 */ - readonly availableReplicas: number; + readonly availableReplicas?: number; readonly id: string; /** @description The deployment run instances */ readonly instances: readonly ({ @@ -1049,14 +1043,14 @@ export interface operations { * @description The date the instance was finished * @default null */ - readonly dtFinished: Date; + readonly dtFinished?: Date; /** @description The time series state history of the deployment instance */ readonly history: readonly ({ /** * @description The state message from the instance at the point in time * @default null */ - readonly message: string | null; + readonly message?: string | null; /** @description The state of the instance at the point in time */ readonly state: string; /** @@ -1075,18 +1069,18 @@ export interface operations { * @description The latest state message for the instance * @default null */ - readonly stateMessage: string | null; + readonly stateMessage?: string | null; })[]; /** * @description The amount of replicas that are ready * @default 0 */ - readonly readyReplicas: number; + readonly readyReplicas?: number; /** * @description The desired amount of replicas for the deployment run * @default 0 */ - readonly replicas: number; + readonly replicas?: number; })[]; }; }; @@ -1145,12 +1139,12 @@ export interface operations { * @description The date the project was deleted * @default null */ - readonly dtDeleted: Date; + readonly dtDeleted?: Date; /** * @description The ID of the GitHub App installation if this is is a GitHub-connected project. * @default null */ - readonly githubAppInstallationId: number | null; + readonly githubAppInstallationId?: number | null; /** @description The ID of the project */ readonly handle: string; /** @description The name of the project */ @@ -1159,17 +1153,17 @@ export interface operations { * @description The name of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoName: string | null; + readonly repoName?: string | null; /** * @description The node ID of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoNodeId: string | null; + readonly repoNodeId?: string | null; /** * @description The URL of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoUrl: string | null; + readonly repoUrl?: string | null; })[]; /** @description The cursor required to fetch the next page of results. i.e. `?after=nextPage`. This is `null` when there is no next page. */ readonly nextPage: string | null; @@ -1207,12 +1201,12 @@ export interface operations { * @description The date the project was deleted * @default null */ - readonly dtDeleted: Date; + readonly dtDeleted?: Date; /** * @description The ID of the GitHub App installation if this is is a GitHub-connected project. * @default null */ - readonly githubAppInstallationId: number | null; + readonly githubAppInstallationId?: number | null; /** @description The ID of the project */ readonly handle: string; /** @description The name of the project */ @@ -1221,17 +1215,17 @@ export interface operations { * @description The name of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoName: string | null; + readonly repoName?: string | null; /** * @description The node ID of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoNodeId: string | null; + readonly repoNodeId?: string | null; /** * @description The URL of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoUrl: string | null; + readonly repoUrl?: string | null; }; }; }; @@ -1264,12 +1258,12 @@ export interface operations { * @description The date the project was deleted * @default null */ - readonly dtDeleted: Date; + readonly dtDeleted?: Date; /** * @description The ID of the GitHub App installation if this is is a GitHub-connected project. * @default null */ - readonly githubAppInstallationId: number | null; + readonly githubAppInstallationId?: number | null; /** @description The ID of the project */ readonly handle: string; /** @description The name of the project */ @@ -1278,17 +1272,17 @@ export interface operations { * @description The name of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoName: string | null; + readonly repoName?: string | null; /** * @description The node ID of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoNodeId: string | null; + readonly repoNodeId?: string | null; /** * @description The URL of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoUrl: string | null; + readonly repoUrl?: string | null; }; }; }; @@ -1329,12 +1323,12 @@ export interface operations { * @description The date the project was deleted * @default null */ - readonly dtDeleted: Date; + readonly dtDeleted?: Date; /** * @description The ID of the GitHub App installation if this is is a GitHub-connected project. * @default null */ - readonly githubAppInstallationId: number | null; + readonly githubAppInstallationId?: number | null; /** @description The ID of the project */ readonly handle: string; /** @description The name of the project */ @@ -1343,17 +1337,17 @@ export interface operations { * @description The name of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoName: string | null; + readonly repoName?: string | null; /** * @description The node ID of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoNodeId: string | null; + readonly repoNodeId?: string | null; /** * @description The URL of the GitHub repository if this is is a GitHub-connected project. * @default null */ - readonly repoUrl: string | null; + readonly repoUrl?: string | null; }; }; }; @@ -1399,12 +1393,12 @@ export interface operations { /** Format: uuid */ readonly containerRegistry?: string; /** @default true */ - readonly enabled: boolean; + readonly enabled?: boolean; readonly env?: readonly ({ readonly name: string; readonly value: string; })[]; - readonly healthchecks?: { + readonly healthChecks?: { readonly liveness?: { readonly failureThreshold?: number; readonly headers?: readonly ({ @@ -1476,9 +1470,8 @@ export interface operations { })[]; readonly name: string; /** @default 80 */ - readonly port: number; - /** @default null */ - readonly region: string | null; + readonly port?: number; + readonly region?: string; readonly repositories?: { readonly dataset: string; readonly mountPath?: string; @@ -1513,7 +1506,7 @@ export interface operations { }; readonly instanceType: string; /** @default 1 */ - readonly replicas: number; + readonly replicas?: number; }; }) | ({ @@ -1523,7 +1516,7 @@ export interface operations { /** Format: uuid */ readonly containerRegistry?: string; /** @default true */ - readonly enabled: boolean; + readonly enabled?: boolean; readonly env?: readonly ({ readonly name: string; readonly value: string; @@ -1595,8 +1588,7 @@ export interface operations { }; readonly image: string; readonly name: string; - /** @default null */ - readonly region: string | null; + readonly region?: string; }); /** @description The ID of the deployment the spec belongs to */ readonly deploymentId: string; @@ -1617,7 +1609,7 @@ export interface operations { * @description The last version hash for the deployment * @default null */ - readonly latestSpecHash: string | null; + readonly latestSpecHash?: string | null; /** @description The name of the deployment */ readonly name: string; /** @description The ID of the project the deployment belongs to */ diff --git a/commands/up/mod.ts b/commands/up/mod.ts index 77f5647..6e1a490 100644 --- a/commands/up/mod.ts +++ b/commands/up/mod.ts @@ -107,8 +107,10 @@ export async function* runUp( logger.info({ projectId: project.handle, config: configFile }); const upsert = await loading( - // @ts-expect-error: it'll be ok - deployments.upsert({ projectId: handle, config: configFile }), + deployments.upsert({ + projectId: project.handle, + config: configFile, + }), { text: "Deploying", enabled: !flags.json }, );