@madewithremy/admin 0.1.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 +71 -0
- package/dist/index.d.ts +5050 -0
- package/dist/index.js +1674 -0
- package/dist/index.js.map +1 -0
- package/dist/prod.js +5261 -0
- package/package.json +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @madewithremy/admin
|
|
2
|
+
|
|
3
|
+
Admin SDK + CLI for managing production Remy apps: request logs, analytics, releases, users, secrets, database, files, email (including custom sending/receiving domains), scheduled jobs, and more. Every operation wraps the same management API the dashboard uses, so anything answerable in the console is answerable here — from the terminal or from code.
|
|
4
|
+
|
|
5
|
+
One surface, two skins: every CLI command (`remy-admin <group> <sub>`) is also a typed client method (`admin.<group>.<sub>()`). Both are thin layers over the same ops core.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @madewithremy/admin # CLI on PATH
|
|
11
|
+
npm install @madewithremy/admin # import layer in a project
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## CLI
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
remy-admin --help # all command groups
|
|
18
|
+
remy-admin <group> --help # per-group commands, flags, examples
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
All output is JSON (one value, compact when piped, pretty on a TTY). Unknown flags are rejected rather than ignored. Exit codes: 0 success, 10 any error (`releases wait` additionally uses 1–4 for build outcomes).
|
|
22
|
+
|
|
23
|
+
Configuration is read from the environment and the workspace — there are no config commands:
|
|
24
|
+
|
|
25
|
+
| Source | Meaning |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `MINDSTUDIO_API_KEY` | Org-scoped `sk_` API key (required) |
|
|
28
|
+
| `API_BASE_URL` | API origin (default `https://api.mindstudio.ai`) |
|
|
29
|
+
| `WORKSPACE_DIR` | Workspace root (default `/home/vercel-sandbox/workspace`) |
|
|
30
|
+
| `${WORKSPACE_DIR}/mindstudio.json` | `appId` — which app the CLI manages |
|
|
31
|
+
|
|
32
|
+
## Import layer
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// Lazy, environment-configured (same resolution as the CLI):
|
|
36
|
+
import admin from '@madewithremy/admin';
|
|
37
|
+
const { jobs } = await admin.cron.list({});
|
|
38
|
+
|
|
39
|
+
// Explicit — one client is bound to one app:
|
|
40
|
+
import { createAdminClient, AdminApiError } from '@madewithremy/admin';
|
|
41
|
+
const client = createAdminClient({ apiKey: 'sk_…', appId: 'app_…' });
|
|
42
|
+
|
|
43
|
+
const { releases } = await client.releases.list({ limit: 5 });
|
|
44
|
+
const { url } = await client.files.put({
|
|
45
|
+
content: buffer,
|
|
46
|
+
store: 'assets',
|
|
47
|
+
access: 'public',
|
|
48
|
+
filename: 'hero.jpg',
|
|
49
|
+
});
|
|
50
|
+
const domains = await client.email.listDomains('sending'); // typed per direction
|
|
51
|
+
const other = client.forApp('app_other'); // sibling client, same credentials
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
await client.requests.get('req_missing');
|
|
55
|
+
} catch (err) {
|
|
56
|
+
if (err instanceof AdminApiError) console.log(err.status, err.body);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Every response is fully typed (the shapes are hand-transcribed from the platform API). Failures throw `AdminApiError` (method/path/status/body) or `AdminTimeoutError`. Long-running composites take an `onProgress` callback (`releases.waitForCommit`, `dataSources.addDocument` / `waitForIngest`, `files.put`). The SSE/NDJSON streaming paths (`methods invoke --stream`, `jewels export --file`) are CLI-only.
|
|
61
|
+
|
|
62
|
+
## Development
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm install
|
|
66
|
+
npm run typecheck
|
|
67
|
+
npm run build # tsup → dist/index.js (+ d.ts) and dist/prod.js (bin)
|
|
68
|
+
node dist/prod.js --help
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Layout: `src/ops/` is the pure core (one module per group: `(ctx, params) → typed result`, no printing/exiting), `src/commands/` the CLI skins (spec + Args→params + output), `src/client.ts` the import layer binding a context over the ops, `src/types/` the response types. See `CLAUDE.md` for the conventions.
|