@photon-ai/dashboard-api 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -0
- package/dist/index.d.ts +3097 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @photon-ai/dashboard-api
|
|
2
|
+
|
|
3
|
+
Public API type contract for the [Photon Dashboard](https://photon.codes).
|
|
4
|
+
|
|
5
|
+
This package exposes **only the type surface** of the public API — there's no
|
|
6
|
+
runtime code. Use it with [`@elysiajs/eden`](https://elysiajs.com/eden) to get
|
|
7
|
+
end-to-end type-safe HTTP calls in a CLI, SDK, or third-party client.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
Install the types package plus its two peer deps (this package ships only
|
|
12
|
+
type declarations — no runtime code):
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
bun add -d @photon-ai/dashboard-api elysia @elysiajs/eden
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Published automatically on each dashboard release; the version tracks the
|
|
19
|
+
release tag (dashboard `v1.2.0` -> `@photon-ai/dashboard-api@1.2.0`).
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { treaty } from "@elysiajs/eden";
|
|
25
|
+
import type { PublicApp } from "@photon-ai/dashboard-api";
|
|
26
|
+
|
|
27
|
+
const api = treaty<PublicApp>("https://api.photon.codes");
|
|
28
|
+
|
|
29
|
+
const { data, error } = await api.api.projects.get();
|
|
30
|
+
// ^? typed
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## What's exposed
|
|
34
|
+
|
|
35
|
+
Only public, end-user-facing routes. Admin and internal routes live behind a
|
|
36
|
+
separate `App` type and are never bundled here.
|
|
37
|
+
|
|
38
|
+
## Versioning
|
|
39
|
+
|
|
40
|
+
The major version of this package tracks the public API contract. Breaking
|
|
41
|
+
changes to public routes bump the major; additive routes bump the minor.
|
|
42
|
+
|
|
43
|
+
`elysia` and `@elysiajs/eden` are declared as peer dependencies — pin them to
|
|
44
|
+
the same version range as the dashboard server (currently `^1.4`).
|