From 273efac4d78d35729242614dda85efbc8e85321e Mon Sep 17 00:00:00 2001 From: Kristof Siket Date: Mon, 29 Jun 2026 15:52:29 +0200 Subject: [PATCH] chore(cli): read custom-domain appId instead of deprecated computeServiceId MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The management API now returns `appId` on the custom-domain response and has deprecated `computeServiceId` (an equal-valued alias). Bump the SDK to 1.46.0 (which exposes `appId`) and point the CLI at the new field: - normalizeDomainRecord / toAppDomainSummary read `domain.appId` - the CLI's own DomainRecord / AppDomainSummary field is renamed `computeServiceId` → `appId` (note: this renames the field in `--json` output for `app domain add/show/retry`; the value is unchanged) The CLI no longer consumes the deprecated API field. tsc 0; full CLI suite 555 passing; biome clean. Co-Authored-By: Claude Opus 4.8 --- packages/cli/package.json | 2 +- packages/cli/src/controllers/app.ts | 2 +- packages/cli/src/lib/app/app-provider.ts | 10 +++++----- packages/cli/src/types/app.ts | 2 +- packages/cli/tests/app-controller.test.ts | 4 ++-- packages/cli/tests/app-presenter.test.ts | 2 +- packages/cli/tests/app-provider.test.ts | 4 ++-- pnpm-lock.yaml | 16 ++++++++-------- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index d314e53..3623423 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -46,7 +46,7 @@ "@clack/prompts": "^1.5.0", "@prisma/compute-sdk": "0.31.0", "@prisma/credentials-store": "^7.8.0", - "@prisma/management-api-sdk": "^1.44.0", + "@prisma/management-api-sdk": "^1.46.0", "better-result": "^2.9.2", "colorette": "^2.0.20", "commander": "^14.0.3", diff --git a/packages/cli/src/controllers/app.ts b/packages/cli/src/controllers/app.ts index 4e06bdb..e6ec0b6 100644 --- a/packages/cli/src/controllers/app.ts +++ b/packages/cli/src/controllers/app.ts @@ -2288,7 +2288,7 @@ function toAppDomainSummary(domain: DomainRecord): AppDomainSummary { type: domain.type, url: domain.url, hostname: domain.hostname, - computeServiceId: domain.computeServiceId, + appId: domain.appId, status: domain.status, foundryStatus: domain.foundryStatus, failureReason: domain.failureReason, diff --git a/packages/cli/src/lib/app/app-provider.ts b/packages/cli/src/lib/app/app-provider.ts index d88c0dc..f22a46d 100644 --- a/packages/cli/src/lib/app/app-provider.ts +++ b/packages/cli/src/lib/app/app-provider.ts @@ -106,7 +106,7 @@ export interface DomainRecord { type: "custom-domain"; url: string; hostname: string; - computeServiceId: string; + appId: string; status: DomainStatus; foundryStatus: string; failureReason: string | null; @@ -791,7 +791,7 @@ interface RawDomainRecord { type: "custom-domain"; url: string; hostname: string; - computeServiceId: string; + appId: string; status: DomainStatus; foundryStatus: string; failureReason: string | null; @@ -926,12 +926,12 @@ async function listComputeServices( async function listComputeServiceDomains( client: ManagementApiClient, - computeServiceId: string, + appId: string, signal?: AbortSignal, ): Promise { const result = await client.GET("/v1/apps/{appId}/domains", { params: { - path: { appId: computeServiceId }, + path: { appId: appId }, }, signal, }); @@ -953,7 +953,7 @@ function normalizeDomainRecord(domain: RawDomainRecord): DomainRecord { type: domain.type, url: domain.url, hostname: domain.hostname, - computeServiceId: domain.computeServiceId, + appId: domain.appId, status: domain.status, foundryStatus: domain.foundryStatus, failureReason: domain.failureReason, diff --git a/packages/cli/src/types/app.ts b/packages/cli/src/types/app.ts index 85ca095..d0905b9 100644 --- a/packages/cli/src/types/app.ts +++ b/packages/cli/src/types/app.ts @@ -191,7 +191,7 @@ export interface AppDomainSummary { type: "custom-domain"; url: string; hostname: string; - computeServiceId: string; + appId: string; status: AppDomainStatus; foundryStatus: string; failureReason: string | null; diff --git a/packages/cli/tests/app-controller.test.ts b/packages/cli/tests/app-controller.test.ts index 17d5472..613adaa 100644 --- a/packages/cli/tests/app-controller.test.ts +++ b/packages/cli/tests/app-controller.test.ts @@ -91,7 +91,7 @@ function createDomain( overrides: Partial<{ id: string; hostname: string; - computeServiceId: string; + appId: string; status: | "pending_dns" | "verifying" @@ -116,7 +116,7 @@ function createDomain( type: "custom-domain" as const, url: `https://api.prisma.io/v1/domains/${overrides.id ?? "dom_123"}`, hostname, - computeServiceId: overrides.computeServiceId ?? "app_1", + appId: overrides.appId ?? "app_1", status: overrides.status ?? "pending_dns", foundryStatus: overrides.status ?? "pending_dns", failureReason: overrides.failureReason ?? null, diff --git a/packages/cli/tests/app-presenter.test.ts b/packages/cli/tests/app-presenter.test.ts index 1e5a5fa..8875835 100644 --- a/packages/cli/tests/app-presenter.test.ts +++ b/packages/cli/tests/app-presenter.test.ts @@ -25,7 +25,7 @@ function createDomain( type: "custom-domain", url: "https://api.prisma.io/v1/domains/dom_123", hostname: "shop.acme.com", - computeServiceId: "app_1", + appId: "app_1", status: "pending_dns", foundryStatus: "pending", failureReason: null, diff --git a/packages/cli/tests/app-provider.test.ts b/packages/cli/tests/app-provider.test.ts index 9ddee79..d7ec0be 100644 --- a/packages/cli/tests/app-provider.test.ts +++ b/packages/cli/tests/app-provider.test.ts @@ -375,7 +375,7 @@ describe("preview app provider", () => { type: "custom-domain", url: "https://api.prisma.io/v1/domains/dom_123", hostname: "shop.acme.com", - computeServiceId: "app_1", + appId: "app_1", status: "active", foundryStatus: "active", failureReason: null, @@ -465,7 +465,7 @@ describe("preview app provider", () => { type: "custom-domain", url: "https://api.prisma.io/v1/domains/dom_123", hostname: "other.acme.com", - computeServiceId: "app_1", + appId: "app_1", status: "active", foundryStatus: "active", failureReason: null, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 17d30b6..66aba11 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,13 +25,13 @@ importers: version: 1.5.0 '@prisma/compute-sdk': specifier: 0.31.0 - version: 0.31.0(@prisma/management-api-sdk@1.44.0)(rollup@4.62.2) + version: 0.31.0(@prisma/management-api-sdk@1.46.0)(rollup@4.62.2) '@prisma/credentials-store': specifier: ^7.8.0 version: 7.8.0 '@prisma/management-api-sdk': - specifier: ^1.44.0 - version: 1.44.0 + specifier: ^1.46.0 + version: 1.46.0 better-result: specifier: ^2.9.2 version: 2.9.2 @@ -560,8 +560,8 @@ packages: '@prisma/credentials-store@7.8.0': resolution: {integrity: sha512-T9yp5uYSowV2ZRkBeCZrqWFP4REUlxd5WEYgOFJDjZBRRV+zx3VFCBf0zJI7Z3/PYFF9o3+ZzLwokQ9nY5EbqA==} - '@prisma/management-api-sdk@1.44.0': - resolution: {integrity: sha512-t15C1GjCiFLMk2vglU6syc8oO/1uhWcVHp9vljBw7oaMt3m7kpe82z7fgEZinDTnMCmfprxefXKcv1hILSOQsg==} + '@prisma/management-api-sdk@1.46.0': + resolution: {integrity: sha512-a7VrApSeCa6wM0TsY3aGUCHOMH0I7dT1VTvVDUAXohgytJir7a45SbArkhK6uaiyOg+nlzeeM+fyWMU4PTHm7Q==} '@quansync/fs@1.0.0': resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==} @@ -1937,9 +1937,9 @@ snapshots: '@oxc-project/types@0.127.0': {} - '@prisma/compute-sdk@0.31.0(@prisma/management-api-sdk@1.44.0)(rollup@4.62.2)': + '@prisma/compute-sdk@0.31.0(@prisma/management-api-sdk@1.46.0)(rollup@4.62.2)': dependencies: - '@prisma/management-api-sdk': 1.44.0 + '@prisma/management-api-sdk': 1.46.0 '@vercel/nft': 1.10.2(rollup@4.62.2) better-result: 2.9.2 jiti: 2.7.0 @@ -1961,7 +1961,7 @@ snapshots: dependencies: xdg-app-paths: 8.3.0 - '@prisma/management-api-sdk@1.44.0': + '@prisma/management-api-sdk@1.46.0': dependencies: openapi-fetch: 0.14.0