diff --git a/UPSTREAM_DIFF.md b/UPSTREAM_DIFF.md index 7e7d390..2219e2d 100644 --- a/UPSTREAM_DIFF.md +++ b/UPSTREAM_DIFF.md @@ -1,44 +1,41 @@ # Upstream API Diff -> Old routes: 36 · New routes: 58 +Comparing `@photon-ai/dashboard-api` **1.2.0 → 1.6.1** (packaged for +`photon-hq/dashboard@v1.6.3`, sha `e2655b8`). + +> Old routes: 80 · New routes: 87 ## Added Routes | Route | Method | |-------|--------| -| `api.profile.spectrum-updates` | `PATCH` | -| `api.projects.:id.members` | `GET` | -| `api.projects.:id.members` | `POST` | -| `api.projects.:id.members.:memberUserId` | `DELETE` | -| `api.projects.:id.slack` | `DELETE` | -| `api.projects.:id.slack` | `GET` | -| `api.projects.:id.slack` | `PUT` | -| `api.projects.:id.slack.installations` | `GET` | -| `api.projects.:id.slack.installations.:teamId` | `DELETE` | -| `api.projects.:id.spectrum.avatar` | `DELETE` | -| `api.projects.:id.spectrum.avatar.commit` | `POST` | -| `api.projects.:id.spectrum.avatar.upload` | `POST` | -| `api.projects.:id.voice.imessage-enabled` | `PATCH` | -| `api.projects.:id.voice.settings` | `GET` | -| `api.projects.:id.voice.sip-inbound` | `DELETE` | -| `api.projects.:id.voice.sip-inbound` | `PATCH` | -| `api.projects.:id.webhooks` | `GET` | -| `api.projects.:id.webhooks` | `POST` | -| `api.projects.:id.webhooks.:webhookId` | `DELETE` | -| `api.projects.:id.whatsapp.templates` | `GET` | -| `api.projects.:id.whatsapp.templates` | `POST` | -| `api.projects.:id.whatsapp.templates.:templateId` | `DELETE` | -| `api.projects.:id.whatsapp.templates.:templateId` | `PATCH` | +| `api.profile.promotional-emails` | `PATCH` | +| `api.profile.promotional-status` | `GET` | +| `api.projects.:id.call-registry.profile` | `GET` | +| `api.projects.:id.call-registry.profile` | `PATCH` | +| `api.projects.:id.call-registry.profile` | `PUT` | +| `api.projects.:id.call-registry.registrations` | `GET` | +| `api.projects.:id.call-registry.registrations` | `POST` | ## Removed Routes -| Route | Method | -|-------|--------| -| `api.projects.:id.spectrum.avatar-upload-url` | `GET` | +_(none)_ + +## Response-shape Changes + +All route response bodies in the 1.6.x bundled `.d.ts` are exposed as +`Record` (index-signature only) rather than the concrete +per-status objects that shipped in 1.2.0. Commands that previously read +strongly-typed fields off `data` still compile (index access is permitted), +but `Array.prototype.map` callbacks lose their inferred element type, which +is the concrete typecheck fallout addressed in this PR (see +`src/commands/projects.ts` list command and `src/commands/spectrum/users.ts` +list command — both now cast `data` to a `Project[]` / `SpectrumUser[]` DTO +at the API boundary). ## Summary -- **23** added -- **1** removed -- **0** changed -- **35** unchanged +- **7** added +- **0** removed +- **0** route paths changed +- **80** unchanged paths (all with degraded response typing) diff --git a/bun.lock b/bun.lock index 748dba3..fdc61ff 100644 --- a/bun.lock +++ b/bun.lock @@ -1,5 +1,6 @@ { "lockfileVersion": 1, + "configVersion": 0, "workspaces": { "": { "name": "dashboard-cli", @@ -15,7 +16,7 @@ "update-notifier": "^7.3.1", }, "devDependencies": { - "@photon-ai/dashboard-api": "1.2.0", + "@photon-ai/dashboard-api": "1.6.1", "@types/bun": "latest", "@types/node": "^25.6.2", "@types/update-notifier": "^6.0.8", @@ -49,7 +50,7 @@ "@noble/hashes": ["@noble/hashes@2.2.0", "", {}, "sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg=="], - "@photon-ai/dashboard-api": ["@photon-ai/dashboard-api@1.2.0", "", { "peerDependencies": { "@elysiajs/eden": "^1.4.9", "elysia": "^1.4.28" } }, "sha512-ZQ4OVaGQMFVMa2/bL2OfRxMaQDABwi+tHUFQHmQOH39N7pCXC6vQ8m32+Its2FxQ5VwU+dyvqmyv0ccxCmK8hw=="], + "@photon-ai/dashboard-api": ["@photon-ai/dashboard-api@1.6.1", "", { "peerDependencies": { "@elysiajs/eden": "^1.4.9", "elysia": "^1.4.28" } }, "sha512-6wgtxR3/6PXxckhkkCWKSGaRBZviaxLrhtCid5WlD3NimPj4V8S0ODvgeF4kH5vDgmOvvr6QIDLY/dGZKl2fQg=="], "@pnpm/config.env-replace": ["@pnpm/config.env-replace@1.1.0", "", {}, "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w=="], diff --git a/package.json b/package.json index afb9a76..8ffd9db 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "prepublishOnly": "bun run typecheck && bun run build" }, "devDependencies": { - "@photon-ai/dashboard-api": "1.2.0", + "@photon-ai/dashboard-api": "1.6.1", "@types/bun": "latest", "@types/node": "^25.6.2", "@types/update-notifier": "^6.0.8", diff --git a/src/commands/projects.ts b/src/commands/projects.ts index 0722690..25a45a3 100644 --- a/src/commands/projects.ts +++ b/src/commands/projects.ts @@ -20,6 +20,7 @@ import { SessionExpiredError } from "~/lib/errors.ts"; import { confirmDestructive } from "~/lib/interactive.ts"; import { c, die, formatApiError, printJson, printTable } from "~/lib/output.ts"; import { isInteractive } from "~/lib/tty.ts"; +import type { Project } from "~/lib/types.ts"; /** Platforms accepted by `projects create` (mirrors the API's create body). */ const PLATFORMS = ["imessage", "whatsapp_business", "voice"] as const; @@ -65,7 +66,7 @@ function registerListCommand(projects: Command): void { die(`Failed to list projects: ${formatApiError(error)}`); } - const list = data ?? []; + const list = (data ?? []) as Project[]; if (opts.json) { printJson(list); return; diff --git a/src/commands/spectrum/users.ts b/src/commands/spectrum/users.ts index 8fc8ad1..d52406b 100644 --- a/src/commands/spectrum/users.ts +++ b/src/commands/spectrum/users.ts @@ -6,6 +6,7 @@ import { SessionExpiredError } from "~/lib/errors.ts"; import { confirmDestructive } from "~/lib/interactive.ts"; import { c, die, formatApiError, printJson, printTable } from "~/lib/output.ts"; import { isInteractive } from "~/lib/tty.ts"; +import type { SpectrumUser } from "~/lib/types.ts"; export function registerSpectrumUsers(spectrum: Command): void { const users = spectrum @@ -37,7 +38,7 @@ export function registerSpectrumUsers(spectrum: Command): void { if (status === 401) throw new SessionExpiredError(resolved.name); if (error) die(`Failed to list users: ${formatApiError(error)}`); - const list = data?.users ?? []; + const list = (data?.users ?? []) as SpectrumUser[]; if (opts.json) return printJson(list); if (list.length === 0) { console.log(c.dim("No Spectrum users yet.")); @@ -142,14 +143,6 @@ export function registerSpectrumUsers(spectrum: Command): void { }); } -interface SpectrumUser { - id: string; - firstName?: string | null; - lastName?: string | null; - email?: string | null; - phoneNumber?: string | null; -} - interface FilledAdd { firstName: string; lastName: string; diff --git a/src/lib/types.ts b/src/lib/types.ts index 179f417..e104af8 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -9,4 +9,26 @@ * in command logic. */ -export {}; +export interface Project { + id: string; + name: string; + location: string; + status: string; + platforms: string[]; + createdAt: string; + updatedAt: string; + isOwner?: boolean; + template?: boolean; + observability?: boolean; + slackChannelId?: string | null; + slackTeamId?: string | null; + projectSecret?: string | null; +} + +export interface SpectrumUser { + id: string; + firstName?: string | null; + lastName?: string | null; + email?: string | null; + phoneNumber?: string | null; +}