Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 12 additions & 30 deletions UPSTREAM_DIFF.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,26 @@
# Upstream API Diff

> Old routes: 36 · New routes: 58
> 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)_

## Summary

- **23** added
- **1** removed
- **7** added
- **0** removed
- **0** changed
- **35** unchanged
- **80** unchanged
5 changes: 3 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 15 additions & 1 deletion src/commands/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ import { isInteractive } from "~/lib/tty.ts";
const PLATFORMS = ["imessage", "whatsapp_business", "voice"] as const;
type Platform = (typeof PLATFORMS)[number];

/**
* Local DTO for projects list/show. The published `@photon-ai/dashboard-api`
* contract erases response payloads to `any`, so we cast at the API boundary
* to recover field-level types for the fields this CLI actually reads.
*/
interface Project {
id: string;
name: string;
status: string;
location: string;
platforms: string[];
updatedAt: string;
}

export function registerProjectsCommand(program: Command): void {
const projects = program
.command("projects")
Expand Down Expand Up @@ -65,7 +79,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;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/spectrum/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,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."));
Expand Down
Loading