diff --git a/admin/client/contract.ts b/admin/client/contract.ts index dd0c09b7..09271663 100644 --- a/admin/client/contract.ts +++ b/admin/client/contract.ts @@ -416,6 +416,26 @@ export const definition = { }), }, }, + getDeployment: { + method: "GET", + path: "/clusters/:clusterId/service/:serviceName/deployments/:deploymentId", + headers: z.object({ + authorization: z.string(), + }), + body: z.undefined(), + responses: { + 401: z.undefined(), + 404: z.undefined(), + 200: z.object({ + id: z.string(), + status: z.enum(["uploading", "active", "inactive", "failed"]), + clusterId: z.string(), + service: z.string(), + provider: z.string(), + createdAt: z.date(), + }), + }, + }, getDeployments: { method: "GET", path: "/clusters/:clusterId/service/:serviceName/deployments", diff --git a/cli/src/contract.ts b/cli/src/contract.ts index 856f3272..09271663 100644 --- a/cli/src/contract.ts +++ b/cli/src/contract.ts @@ -416,6 +416,26 @@ export const definition = { }), }, }, + getDeployment: { + method: "GET", + path: "/clusters/:clusterId/service/:serviceName/deployments/:deploymentId", + headers: z.object({ + authorization: z.string(), + }), + body: z.undefined(), + responses: { + 401: z.undefined(), + 404: z.undefined(), + 200: z.object({ + id: z.string(), + status: z.enum(["uploading", "active", "inactive", "failed"]), + clusterId: z.string(), + service: z.string(), + provider: z.string(), + createdAt: z.date(), + }), + }, + }, getDeployments: { method: "GET", path: "/clusters/:clusterId/service/:serviceName/deployments", @@ -423,22 +443,14 @@ export const definition = { authorization: z.string(), }), query: z.object({ - status: z - .enum(["uploading", "active", "inactive", "failed", "cancelled"]) - .optional(), + status: z.enum(["uploading", "active", "inactive", "failed"]).optional(), limit: z.coerce.number().min(1).max(100).default(10), }), responses: { 200: z.array( z.object({ id: z.string(), - status: z.enum([ - "uploading", - "active", - "inactive", - "failed", - "cancelled", - ]), + status: z.enum(["uploading", "active", "inactive", "failed"]), clusterId: z.string(), service: z.string(), provider: z.string(), diff --git a/ts-core/src/contract.ts b/ts-core/src/contract.ts index 856f3272..09271663 100644 --- a/ts-core/src/contract.ts +++ b/ts-core/src/contract.ts @@ -416,6 +416,26 @@ export const definition = { }), }, }, + getDeployment: { + method: "GET", + path: "/clusters/:clusterId/service/:serviceName/deployments/:deploymentId", + headers: z.object({ + authorization: z.string(), + }), + body: z.undefined(), + responses: { + 401: z.undefined(), + 404: z.undefined(), + 200: z.object({ + id: z.string(), + status: z.enum(["uploading", "active", "inactive", "failed"]), + clusterId: z.string(), + service: z.string(), + provider: z.string(), + createdAt: z.date(), + }), + }, + }, getDeployments: { method: "GET", path: "/clusters/:clusterId/service/:serviceName/deployments", @@ -423,22 +443,14 @@ export const definition = { authorization: z.string(), }), query: z.object({ - status: z - .enum(["uploading", "active", "inactive", "failed", "cancelled"]) - .optional(), + status: z.enum(["uploading", "active", "inactive", "failed"]).optional(), limit: z.coerce.number().min(1).max(100).default(10), }), responses: { 200: z.array( z.object({ id: z.string(), - status: z.enum([ - "uploading", - "active", - "inactive", - "failed", - "cancelled", - ]), + status: z.enum(["uploading", "active", "inactive", "failed"]), clusterId: z.string(), service: z.string(), provider: z.string(),