robodev 0.2.2 → 0.3.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/package.json +1 -1
- package/template/README.md +2 -0
- package/template/api/me.ts +14 -0
- package/template/package.json +3 -2
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -12,6 +12,8 @@ It reads `VITE_API_URL` from `.env` (written by `robodev create` / `robodev link
|
|
|
12
12
|
|
|
13
13
|
Docs: https://robodev.povio.dev/docs
|
|
14
14
|
|
|
15
|
+
`GET /me` (`api/me.ts`) requires a Robodev Auth Bearer token. Planet and rocket routes stay public. Optional browser helper: `@robodev-ai/client`. Auth how-to: https://robodev.povio.dev/docs/auth
|
|
16
|
+
|
|
15
17
|
Add tables in `database.ts` and routes as `api/<name>.ts`, then:
|
|
16
18
|
|
|
17
19
|
```bash
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** GET /me — current project user (Robodev Auth required). */
|
|
2
|
+
import { defineApi, z } from "@robodev-ai/sdk";
|
|
3
|
+
|
|
4
|
+
export const get = defineApi({
|
|
5
|
+
auth: "required",
|
|
6
|
+
response: z.object({
|
|
7
|
+
user: z.object({
|
|
8
|
+
id: z.string(),
|
|
9
|
+
email: z.string(),
|
|
10
|
+
name: z.string().nullable().optional(),
|
|
11
|
+
}),
|
|
12
|
+
}),
|
|
13
|
+
handler: async ({ user }) => ({ user }),
|
|
14
|
+
});
|
package/template/package.json
CHANGED
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"react": "^18.3.1",
|
|
12
12
|
"react-dom": "^18.3.1",
|
|
13
|
-
"@robodev-ai/sdk": "^0.
|
|
13
|
+
"@robodev-ai/sdk": "^0.3.0",
|
|
14
|
+
"@robodev-ai/client": "^0.1.0"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
17
|
"@types/react": "^18.3.24",
|
|
17
18
|
"@types/react-dom": "^18.3.7",
|
|
18
19
|
"@vitejs/plugin-react": "^4.7.0",
|
|
19
|
-
"robodev": "^0.
|
|
20
|
+
"robodev": "^0.3.0",
|
|
20
21
|
"typescript": "^5.9.2",
|
|
21
22
|
"vite": "^6.3.5"
|
|
22
23
|
}
|