run402 1.51.0 → 1.52.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 +117 -58
- package/lib/apps.mjs +2 -4
- package/lib/deploy.mjs +17 -139
- package/lib/projects.mjs +1 -19
- package/lib/sites.mjs +17 -51
- package/package.json +1 -2
- package/sdk/dist/namespaces/allowance.d.ts +3 -0
- package/sdk/dist/namespaces/allowance.d.ts.map +1 -1
- package/sdk/dist/namespaces/allowance.js +10 -1
- package/sdk/dist/namespaces/allowance.js.map +1 -1
- package/sdk/dist/namespaces/projects.d.ts +2 -13
- package/sdk/dist/namespaces/projects.d.ts.map +1 -1
- package/sdk/dist/namespaces/projects.js +1 -34
- package/sdk/dist/namespaces/projects.js.map +1 -1
- package/sdk/dist/namespaces/projects.types.d.ts +6 -15
- package/sdk/dist/namespaces/projects.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/sites.d.ts +7 -18
- package/sdk/dist/namespaces/sites.d.ts.map +1 -1
- package/sdk/dist/namespaces/sites.js +7 -14
- package/sdk/dist/namespaces/sites.js.map +1 -1
- package/sdk/dist/namespaces/subdomains.d.ts.map +1 -1
- package/sdk/dist/namespaces/subdomains.js +4 -1
- package/sdk/dist/namespaces/subdomains.js.map +1 -1
- package/sdk/dist/node/index.d.ts +4 -5
- package/sdk/dist/node/index.d.ts.map +1 -1
- package/sdk/dist/node/index.js +4 -5
- package/sdk/dist/node/index.js.map +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# run402 CLI
|
|
2
2
|
|
|
3
|
-
Command-line interface for [Run402](https://run402.com) — provision Postgres databases, deploy static sites,
|
|
3
|
+
Command-line interface for [Run402](https://run402.com) — provision Postgres databases, deploy static sites, run Node 22 serverless functions, host content-addressed CDN assets, send email, sign on-chain. Paid autonomously with x402 USDC on Base. **Prototype tier is free on testnet.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
For the full CLI reference (every flag, every subcommand) see **<https://run402.com/llms-cli.txt>**.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
npm install -g run402
|
|
@@ -14,83 +16,128 @@ Or run without installing:
|
|
|
14
16
|
npx run402 <command>
|
|
15
17
|
```
|
|
16
18
|
|
|
17
|
-
##
|
|
19
|
+
## 30-second start
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
run402 init # one-shot: allowance + faucet + tier check
|
|
23
|
+
run402 tier set prototype # FREE on testnet (verifies x402 setup)
|
|
24
|
+
run402 projects provision --name my-app # → anon_key, service_key, project_id
|
|
25
|
+
run402 sites deploy-dir ./dist # incremental upload
|
|
26
|
+
run402 subdomains claim my-app # → https://my-app.run402.com
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
That's a real Postgres database + a deployed static site, paid for autonomously with testnet USDC.
|
|
30
|
+
|
|
31
|
+
## Output contract
|
|
32
|
+
|
|
33
|
+
Every command prints **JSON to stdout**, **JSON errors to stderr**, and exits **0 on success / 1 on failure**. Designed for shells, scripts, and agent loops — pipe everything to `jq`.
|
|
34
|
+
|
|
35
|
+
## Common commands
|
|
36
|
+
|
|
37
|
+
### Allowance
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
run402 allowance create # generate the local allowance
|
|
41
|
+
run402 allowance fund # request testnet USDC from the faucet
|
|
42
|
+
run402 allowance balance # mainnet + testnet + billing balance
|
|
43
|
+
run402 allowance export # print address (for funding)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Database
|
|
18
47
|
|
|
19
48
|
```bash
|
|
20
|
-
|
|
21
|
-
run402
|
|
49
|
+
run402 projects sql <id> "CREATE TABLE items (id serial PRIMARY KEY, …)"
|
|
50
|
+
run402 projects apply-expose <id> --file manifest.json # declare what's reachable
|
|
51
|
+
run402 projects rest <id> items "select=*&order=id.desc&limit=10"
|
|
52
|
+
run402 projects schema <id> # introspect tables + RLS
|
|
53
|
+
```
|
|
22
54
|
|
|
23
|
-
|
|
24
|
-
run402 allowance fund
|
|
55
|
+
### Static sites
|
|
25
56
|
|
|
26
|
-
|
|
27
|
-
run402 deploy
|
|
57
|
+
```bash
|
|
58
|
+
run402 sites deploy-dir ./dist # incremental upload (plan/commit transport)
|
|
59
|
+
run402 deploy --manifest app.json # one-call full stack deploy
|
|
60
|
+
run402 subdomains claim my-app # → my-app.run402.com (auto-reassigns on next deploy)
|
|
28
61
|
```
|
|
29
62
|
|
|
30
|
-
|
|
63
|
+
`deploy-dir` hashes each file client-side and only uploads bytes the gateway doesn't already have. Re-deploying an unchanged tree returns immediately with `bytes_uploaded: 0`. Progress events stream to stderr.
|
|
64
|
+
|
|
65
|
+
### Storage (paste-and-go CDN assets)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
run402 blob put ./logo.png # → AssetRef with cdn_url, sri, etag
|
|
69
|
+
run402 blob get <key> --output /tmp/logo.png
|
|
70
|
+
run402 blob diagnose <url> # exit 0 if fresh, 1 if stale
|
|
71
|
+
```
|
|
31
72
|
|
|
32
|
-
|
|
73
|
+
The returned `cdn_url` is content-addressed (`pr-<public_id>.run402.com/_blob/<key>-<8hex>.<ext>`) — paste it straight into HTML. SRI is bundled in `sri`.
|
|
33
74
|
|
|
34
|
-
|
|
75
|
+
### Functions
|
|
35
76
|
|
|
36
77
|
```bash
|
|
37
|
-
run402
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
78
|
+
run402 functions deploy <id> my-fn --file fn.ts \
|
|
79
|
+
--timeout 30 --memory 256 \
|
|
80
|
+
--schedule "*/15 * * * *" \
|
|
81
|
+
--deps "stripe,zod@^3"
|
|
82
|
+
run402 functions logs <id> my-fn --tail 100 --follow
|
|
83
|
+
run402 functions invoke <id> my-fn --body '{"hello":"world"}'
|
|
41
84
|
```
|
|
42
85
|
|
|
43
|
-
|
|
86
|
+
Functions run on Node 22 with `@run402/functions` auto-bundled. Inside the handler:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import { db, adminDb, getUser, email, ai } from "@run402/functions";
|
|
90
|
+
```
|
|
44
91
|
|
|
45
|
-
|
|
92
|
+
`db(req)` is the caller-context client (RLS applies); `adminDb()` bypasses RLS for platform-authored writes.
|
|
93
|
+
|
|
94
|
+
### Email
|
|
46
95
|
|
|
47
96
|
```bash
|
|
48
|
-
run402
|
|
49
|
-
run402
|
|
50
|
-
|
|
97
|
+
run402 email create my-app
|
|
98
|
+
run402 email send --to user@example.com --subject "Welcome" --html "<h1>Hi</h1>"
|
|
99
|
+
run402 email send --to user@example.com --template notification --var project_name="My App"
|
|
51
100
|
```
|
|
52
101
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
"name": "my-app",
|
|
59
|
-
"files": {
|
|
60
|
-
"index.html": "<html>...</html>",
|
|
61
|
-
"style.css": "body { margin: 0; }"
|
|
62
|
-
},
|
|
63
|
-
"env": {
|
|
64
|
-
"MY_VAR": "value"
|
|
65
|
-
}
|
|
66
|
-
}
|
|
102
|
+
### Image generation
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
run402 image generate "a serif logo" --aspect square --output logo.png
|
|
67
106
|
```
|
|
68
107
|
|
|
69
|
-
|
|
108
|
+
$0.03 per image via x402.
|
|
70
109
|
|
|
71
|
-
|
|
110
|
+
### On-chain (KMS contract wallets)
|
|
72
111
|
|
|
73
112
|
```bash
|
|
74
|
-
run402
|
|
75
|
-
run402
|
|
76
|
-
run402 projects rest <id> users "limit=10" # REST API query
|
|
77
|
-
run402 projects usage <id> # Compute/storage usage
|
|
78
|
-
run402 projects schema <id> # Database schema
|
|
79
|
-
run402 projects renew <id> # Extend lease (pays via x402)
|
|
80
|
-
run402 projects delete <id> # Delete project
|
|
113
|
+
run402 contracts provision-wallet --chain base-mainnet
|
|
114
|
+
run402 contracts call --wallet <id> --to 0x… --abi @abi.json --fn transfer --args '["0x…","1000000"]'
|
|
81
115
|
```
|
|
82
116
|
|
|
83
|
-
|
|
117
|
+
Private keys never leave AWS KMS. $0.04/day rental + $0.000005/call.
|
|
84
118
|
|
|
85
|
-
|
|
119
|
+
### Tier and billing
|
|
86
120
|
|
|
87
121
|
```bash
|
|
88
|
-
run402
|
|
89
|
-
run402
|
|
90
|
-
run402
|
|
122
|
+
run402 tier set prototype # free on testnet
|
|
123
|
+
run402 tier set hobby # $5 / 30 days
|
|
124
|
+
run402 billing tier-checkout hobby --email me@example.com # Stripe alternative
|
|
91
125
|
```
|
|
92
126
|
|
|
93
|
-
|
|
127
|
+
## State
|
|
128
|
+
|
|
129
|
+
Local state lives at:
|
|
130
|
+
|
|
131
|
+
- `~/.config/run402/projects.json` (`0600`) — project credentials (`anon_key`, `service_key`, `tier`, `lease_expires_at`)
|
|
132
|
+
- `~/.config/run402/allowance.json` (`0600`) — wallet for x402 signing
|
|
133
|
+
|
|
134
|
+
Override with `RUN402_CONFIG_DIR` or `RUN402_ALLOWANCE_PATH`. Override the API base with `RUN402_API_BASE`.
|
|
135
|
+
|
|
136
|
+
The CLI handles all x402 payment signing automatically — never ask the human for a private key or set up payment libraries by hand.
|
|
137
|
+
|
|
138
|
+
## Active project (sticky default)
|
|
139
|
+
|
|
140
|
+
After `provision`, the new project becomes the active one. `run402 projects use <id>` switches it. Most commands that take `<id>` default to the active project when omitted.
|
|
94
141
|
|
|
95
142
|
## Help
|
|
96
143
|
|
|
@@ -98,18 +145,30 @@ Every command supports `--help` / `-h`:
|
|
|
98
145
|
|
|
99
146
|
```bash
|
|
100
147
|
run402 --help
|
|
101
|
-
run402 allowance --help
|
|
102
|
-
run402 deploy --help
|
|
103
148
|
run402 projects --help
|
|
104
|
-
run402
|
|
149
|
+
run402 sites --help
|
|
150
|
+
run402 blob --help
|
|
151
|
+
run402 functions --help
|
|
105
152
|
```
|
|
106
153
|
|
|
107
|
-
##
|
|
154
|
+
## Full reference
|
|
155
|
+
|
|
156
|
+
The canonical, comprehensive CLI reference — every flag, every subcommand, edge cases, troubleshooting — lives at:
|
|
157
|
+
|
|
158
|
+
**<https://run402.com/llms-cli.txt>**
|
|
159
|
+
|
|
160
|
+
Same content also at [`cli/llms-cli.txt`](./llms-cli.txt) in the repo. Treat that file as authoritative; this README is a quick-orientation landing page.
|
|
161
|
+
|
|
162
|
+
## Other interfaces
|
|
163
|
+
|
|
164
|
+
`run402` is one of five surfaces:
|
|
165
|
+
|
|
166
|
+
- [`@run402/sdk`](https://www.npmjs.com/package/@run402/sdk) — typed TypeScript client (isomorphic + Node entry)
|
|
167
|
+
- [`run402-mcp`](https://www.npmjs.com/package/run402-mcp) — MCP server (Claude Desktop, Cursor, Cline, Claude Code)
|
|
168
|
+
- [`@run402/functions`](https://www.npmjs.com/package/@run402/functions) — in-function helper imported inside deployed functions
|
|
169
|
+
- OpenClaw skill — script-based skill for OpenClaw agents
|
|
108
170
|
|
|
109
|
-
|
|
110
|
-
- Project credentials stored at `~/.run402/projects.json`
|
|
111
|
-
- Network: Base Sepolia (testnet) for prototype tier (free). Base mainnet or Stripe for paid tiers (hobby/team).
|
|
112
|
-
- Payments are handled automatically — no manual signing required
|
|
171
|
+
All five release in lockstep at the same version and share `@run402/sdk` as the kernel.
|
|
113
172
|
|
|
114
173
|
## License
|
|
115
174
|
|
package/lib/apps.mjs
CHANGED
|
@@ -131,15 +131,13 @@ async function fork(versionId, name, args) {
|
|
|
131
131
|
subdomain: opts.subdomain,
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
-
// SDK persists via the Node provider's saveProject
|
|
135
|
-
//
|
|
136
|
-
// the fork response) with a follow-up updateProject for the extra fields.
|
|
134
|
+
// SDK persists keys via the Node provider's saveProject; mirror that
|
|
135
|
+
// here so we also capture site_url from the fork response.
|
|
137
136
|
if (data.project_id) {
|
|
138
137
|
saveProject(data.project_id, {
|
|
139
138
|
anon_key: data.anon_key,
|
|
140
139
|
service_key: data.service_key,
|
|
141
140
|
site_url: data.site_url || data.subdomain_url,
|
|
142
|
-
deployed_at: new Date().toISOString(),
|
|
143
141
|
});
|
|
144
142
|
}
|
|
145
143
|
console.log(JSON.stringify(data, null, 2));
|
package/lib/deploy.mjs
CHANGED
|
@@ -1,81 +1,9 @@
|
|
|
1
1
|
import { readFileSync } from "fs";
|
|
2
2
|
import { dirname, resolve } from "path";
|
|
3
|
-
import {
|
|
4
|
-
import { API, allowanceAuthHeaders, resolveProjectId } from "./config.mjs";
|
|
3
|
+
import { resolveProjectId } from "./config.mjs";
|
|
5
4
|
import { resolveFilePathsInManifest, resolveMigrationsFile } from "./manifest.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// Default Node undici headersTimeout is ~5 min; large image uploads can exceed it.
|
|
9
|
-
// We MUST pair this Agent (from the installed undici major) with undici.fetch
|
|
10
|
-
// — not globalThis.fetch — because Node's built-in fetch ships its own bundled
|
|
11
|
-
// undici whose Dispatcher interface may differ by major version, which would
|
|
12
|
-
// cause UND_ERR_INVALID_ARG ("invalid onRequestStart method") at dispatch time.
|
|
13
|
-
const deployDispatcher = new Agent({
|
|
14
|
-
headersTimeout: 600_000, // 10 min
|
|
15
|
-
bodyTimeout: 600_000,
|
|
16
|
-
connectTimeout: 30_000,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
// Retry policy for transient network errors and 5xx gateway errors.
|
|
20
|
-
// We retry on these because they tend to be load-shedding/blip-related; we do
|
|
21
|
-
// NOT retry on other 4xx/5xx (402, 400, etc.) — those are deterministic.
|
|
22
|
-
const RETRY_CAUSE_CODES = new Set([
|
|
23
|
-
"UND_ERR_HEADERS_TIMEOUT",
|
|
24
|
-
"UND_ERR_BODY_TIMEOUT",
|
|
25
|
-
"UND_ERR_SOCKET",
|
|
26
|
-
"ECONNRESET",
|
|
27
|
-
"ECONNREFUSED",
|
|
28
|
-
"ETIMEDOUT",
|
|
29
|
-
]);
|
|
30
|
-
const RETRY_HTTP_STATUSES = new Set([502, 503, 504]);
|
|
31
|
-
|
|
32
|
-
// Test-only injection seam. Tests can replace the fetch implementation used by
|
|
33
|
-
// run() without monkey-patching globalThis.fetch (which would not intercept
|
|
34
|
-
// undici.fetch anyway). Pass null/undefined to reset.
|
|
35
|
-
let _runFetchImpl = undiciFetch;
|
|
36
|
-
export function _setFetchImpl(fn) { _runFetchImpl = fn ?? undiciFetch; }
|
|
37
|
-
|
|
38
|
-
function isRetriableError(err) {
|
|
39
|
-
if (!err) return false;
|
|
40
|
-
const code = err.code || (err.cause && err.cause.code);
|
|
41
|
-
return typeof code === "string" && RETRY_CAUSE_CODES.has(code);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function sleep(ms) {
|
|
45
|
-
return new Promise((r) => setTimeout(r, ms));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Fetch with bounded retries on transient errors. Exported for testability.
|
|
50
|
-
* - 2 retries (3 total attempts)
|
|
51
|
-
* - Backoff ~1s then ~4s with small jitter
|
|
52
|
-
* - Retries on RETRY_CAUSE_CODES network errors and RETRY_HTTP_STATUSES
|
|
53
|
-
* - Silent: no stdout noise on retry (CLI is agent-first)
|
|
54
|
-
*/
|
|
55
|
-
export async function fetchWithRetry(url, init, { attempts = 3, fetchImpl = undiciFetch } = {}) {
|
|
56
|
-
for (let attempt = 1; attempt <= attempts; attempt++) {
|
|
57
|
-
try {
|
|
58
|
-
const res = await fetchImpl(url, init);
|
|
59
|
-
if (attempt < attempts && RETRY_HTTP_STATUSES.has(res.status)) {
|
|
60
|
-
// Drain body so the connection can be reused, then retry.
|
|
61
|
-
try { await res.arrayBuffer(); } catch { /* noop */ }
|
|
62
|
-
const delay = (attempt === 1 ? 1000 : 4000) + Math.floor(Math.random() * 250);
|
|
63
|
-
await sleep(delay);
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
return res;
|
|
67
|
-
} catch (err) {
|
|
68
|
-
if (attempt < attempts && isRetriableError(err)) {
|
|
69
|
-
const delay = (attempt === 1 ? 1000 : 4000) + Math.floor(Math.random() * 250);
|
|
70
|
-
await sleep(delay);
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
throw err;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// Unreachable: the loop above either returns a response or throws.
|
|
77
|
-
throw new Error("fetchWithRetry: exhausted attempts without returning");
|
|
78
|
-
}
|
|
5
|
+
import { getSdk } from "./sdk.mjs";
|
|
6
|
+
import { reportSdkError } from "./sdk-errors.mjs";
|
|
79
7
|
|
|
80
8
|
const HELP = `run402 deploy — Deploy to an existing project on Run402
|
|
81
9
|
|
|
@@ -106,13 +34,11 @@ Manifest format (JSON):
|
|
|
106
34
|
{ "file": "index.html", "data": "<html>...</html>" },
|
|
107
35
|
{ "file": "style.css", "path": "./dist/style.css" }
|
|
108
36
|
],
|
|
109
|
-
"subdomain": "my-app"
|
|
110
|
-
"inherit": true
|
|
37
|
+
"subdomain": "my-app"
|
|
111
38
|
}
|
|
112
39
|
|
|
113
40
|
project_id is required (provision first with 'run402 provision').
|
|
114
41
|
All other fields are optional.
|
|
115
|
-
inherit: copy unchanged site files from previous deployment (only upload changed files).
|
|
116
42
|
|
|
117
43
|
Migrations can be inline or read from a file:
|
|
118
44
|
"migrations": "CREATE TABLE ..." ← inline SQL
|
|
@@ -168,6 +94,8 @@ Prerequisites:
|
|
|
168
94
|
- run402 provision Provision a project first
|
|
169
95
|
|
|
170
96
|
Notes:
|
|
97
|
+
- Routes through the unified deploy primitive (POST /deploy/v2/plans);
|
|
98
|
+
bytes ride through the CAS substrate, only changed files get uploaded.
|
|
171
99
|
- Requires an active tier subscription (run402 tier set <tier>)
|
|
172
100
|
- Provision a project first with 'run402 provision', then deploy to it
|
|
173
101
|
- Use 'run402 projects list' to see all provisioned projects
|
|
@@ -185,16 +113,11 @@ async function readStdin() {
|
|
|
185
113
|
*
|
|
186
114
|
* Returns { manifest } on success, or { error } with a structured error object
|
|
187
115
|
* on any fs / parse failure. Never throws.
|
|
188
|
-
*
|
|
189
|
-
* The returned error shape (GH-44):
|
|
190
|
-
* { status: "error", message, field, path?, hint? }
|
|
191
|
-
* where `field` is one of: "manifest", "stdin", "migrations_file", "files[<i>].path".
|
|
192
116
|
*/
|
|
193
117
|
async function loadManifest(opts) {
|
|
194
118
|
let raw;
|
|
195
119
|
let baseDir = null;
|
|
196
120
|
|
|
197
|
-
// Step 1: read the manifest source.
|
|
198
121
|
if (opts.manifest) {
|
|
199
122
|
const manifestAbs = resolve(opts.manifest);
|
|
200
123
|
baseDir = dirname(manifestAbs);
|
|
@@ -222,7 +145,6 @@ async function loadManifest(opts) {
|
|
|
222
145
|
raw = await readStdin();
|
|
223
146
|
}
|
|
224
147
|
|
|
225
|
-
// Step 2: parse JSON.
|
|
226
148
|
let manifest;
|
|
227
149
|
try {
|
|
228
150
|
manifest = JSON.parse(raw);
|
|
@@ -235,8 +157,6 @@ async function loadManifest(opts) {
|
|
|
235
157
|
} };
|
|
236
158
|
}
|
|
237
159
|
|
|
238
|
-
// Step 3: resolve file paths (only when reading from a manifest file — we
|
|
239
|
-
// can't resolve relative paths without a baseDir).
|
|
240
160
|
if (opts.manifest) {
|
|
241
161
|
try {
|
|
242
162
|
resolveMigrationsFile(manifest, baseDir);
|
|
@@ -270,7 +190,7 @@ export async function run(args) {
|
|
|
270
190
|
// run402 deploy resume <op> → resume an activation_pending operation
|
|
271
191
|
// run402 deploy list → list recent deploy operations
|
|
272
192
|
// run402 deploy events <op> → fetch recorded event stream for an operation
|
|
273
|
-
// run402 deploy --manifest … → legacy bundle deploy (
|
|
193
|
+
// run402 deploy --manifest … → legacy bundle deploy (routes through v2)
|
|
274
194
|
const sub = args[0];
|
|
275
195
|
switch (sub) {
|
|
276
196
|
case "apply":
|
|
@@ -290,10 +210,6 @@ export async function run(args) {
|
|
|
290
210
|
if (args[i] === "--project" && args[i + 1]) opts.project = args[++i];
|
|
291
211
|
}
|
|
292
212
|
|
|
293
|
-
// Load + parse the manifest. Errors here (missing --manifest path, malformed
|
|
294
|
-
// JSON, or any referenced files[].path / migrations_file that doesn't exist)
|
|
295
|
-
// must be surfaced as structured JSON on stderr — never as a raw Node stack
|
|
296
|
-
// trace (GH-44). The CLI is agent-first; stack traces break JSON consumers.
|
|
297
213
|
const manifestResult = await loadManifest(opts);
|
|
298
214
|
if (manifestResult.error) {
|
|
299
215
|
console.error(JSON.stringify(manifestResult.error));
|
|
@@ -302,8 +218,7 @@ export async function run(args) {
|
|
|
302
218
|
const manifest = manifestResult.manifest;
|
|
303
219
|
|
|
304
220
|
// If both sources set project_id and they disagree, refuse to deploy rather
|
|
305
|
-
// than silently shipping to the wrong target.
|
|
306
|
-
// forced to be explicit when the two sources conflict (GH-42).
|
|
221
|
+
// than silently shipping to the wrong target.
|
|
307
222
|
if (opts.project && manifest.project_id && opts.project !== manifest.project_id) {
|
|
308
223
|
const err = {
|
|
309
224
|
status: "error",
|
|
@@ -316,58 +231,21 @@ export async function run(args) {
|
|
|
316
231
|
process.exit(1);
|
|
317
232
|
}
|
|
318
233
|
|
|
319
|
-
// --project flag fills in manifest's project_id when the manifest doesn't
|
|
320
|
-
// specify one. (When both are set they must already agree — enforced above.)
|
|
321
234
|
if (opts.project) manifest.project_id = opts.project;
|
|
322
|
-
|
|
323
|
-
// If no project_id in manifest, fall back to the active project.
|
|
324
|
-
// resolveProjectId() returns the active project id when its argument is
|
|
325
|
-
// falsy, and emits a clear error + exits non-zero when no active project
|
|
326
|
-
// is set either.
|
|
327
235
|
if (!manifest.project_id) {
|
|
328
236
|
manifest.project_id = resolveProjectId(null);
|
|
329
237
|
}
|
|
330
238
|
|
|
331
|
-
//
|
|
239
|
+
// Strip fields that aren't part of the bundleDeploy contract.
|
|
240
|
+
const projectId = manifest.project_id;
|
|
241
|
+
delete manifest.project_id;
|
|
332
242
|
delete manifest.name;
|
|
243
|
+
delete manifest.migrations_file;
|
|
333
244
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
body,
|
|
340
|
-
dispatcher: deployDispatcher,
|
|
341
|
-
}, { fetchImpl: _runFetchImpl });
|
|
342
|
-
|
|
343
|
-
// Content-type aware parsing: gateways (ALB, CloudFront, etc.) return HTML on
|
|
344
|
-
// 504/413/etc., which would otherwise crash res.json() with SyntaxError.
|
|
345
|
-
const contentType = res.headers.get("content-type") || "";
|
|
346
|
-
let result = null;
|
|
347
|
-
let parseError = null;
|
|
348
|
-
let bodyText = null;
|
|
349
|
-
if (contentType.includes("application/json")) {
|
|
350
|
-
try {
|
|
351
|
-
result = await res.json();
|
|
352
|
-
} catch (e) {
|
|
353
|
-
parseError = e;
|
|
354
|
-
try { bodyText = await res.text(); } catch { bodyText = ""; }
|
|
355
|
-
}
|
|
356
|
-
} else {
|
|
357
|
-
try { bodyText = await res.text(); } catch { bodyText = ""; }
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
if (!res.ok || parseError || result === null) {
|
|
361
|
-
const err = { status: "error", http: res.status, content_type: contentType || null };
|
|
362
|
-
if (result && typeof result === "object") {
|
|
363
|
-
Object.assign(err, result);
|
|
364
|
-
} else {
|
|
365
|
-
const preview = typeof bodyText === "string" ? bodyText.slice(0, 500) : "";
|
|
366
|
-
err.body_preview = preview;
|
|
367
|
-
if (parseError) err.parse_error = "response body was not valid JSON";
|
|
368
|
-
}
|
|
369
|
-
console.error(JSON.stringify(err));
|
|
370
|
-
process.exit(1);
|
|
245
|
+
try {
|
|
246
|
+
const result = await getSdk().apps.bundleDeploy(projectId, manifest);
|
|
247
|
+
console.log(JSON.stringify(result, null, 2));
|
|
248
|
+
} catch (err) {
|
|
249
|
+
reportSdkError(err);
|
|
371
250
|
}
|
|
372
|
-
console.log(JSON.stringify(result, null, 2));
|
|
373
251
|
}
|
package/lib/projects.mjs
CHANGED
|
@@ -136,22 +136,6 @@ async function provision(args) {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
async function rls(projectId, template, tablesJson) {
|
|
140
|
-
let tables;
|
|
141
|
-
try {
|
|
142
|
-
tables = JSON.parse(tablesJson);
|
|
143
|
-
} catch {
|
|
144
|
-
console.error(JSON.stringify({ status: "error", message: "Invalid JSON for tables argument" }));
|
|
145
|
-
process.exit(1);
|
|
146
|
-
}
|
|
147
|
-
try {
|
|
148
|
-
const data = await getSdk().projects.setupRls(projectId, { template, tables });
|
|
149
|
-
console.log(JSON.stringify(data, null, 2));
|
|
150
|
-
} catch (err) {
|
|
151
|
-
reportSdkError(err);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
139
|
async function applyExpose(projectId, args = []) {
|
|
156
140
|
const p = findProject(projectId);
|
|
157
141
|
let file = null;
|
|
@@ -193,7 +177,7 @@ async function list() {
|
|
|
193
177
|
const entries = Object.entries(store.projects);
|
|
194
178
|
if (entries.length === 0) { console.log(JSON.stringify({ status: "ok", projects: [], message: "No projects yet." })); return; }
|
|
195
179
|
const activeId = store.active_project_id;
|
|
196
|
-
console.log(JSON.stringify(entries.map(([id, p]) => ({ project_id: id, active: id === activeId, site_url: p.site_url
|
|
180
|
+
console.log(JSON.stringify(entries.map(([id, p]) => ({ project_id: id, active: id === activeId, site_url: p.site_url })), null, 2));
|
|
197
181
|
}
|
|
198
182
|
|
|
199
183
|
async function info(projectId) {
|
|
@@ -205,7 +189,6 @@ async function info(projectId) {
|
|
|
205
189
|
anon_key: data.anon_key,
|
|
206
190
|
service_key: data.service_key,
|
|
207
191
|
site_url: data.site_url || null,
|
|
208
|
-
deployed_at: data.deployed_at || null,
|
|
209
192
|
}, null, 2));
|
|
210
193
|
} catch (err) {
|
|
211
194
|
reportSdkError(err);
|
|
@@ -361,7 +344,6 @@ export async function run(sub, args) {
|
|
|
361
344
|
case "rest": { const { projectId, rest: restArgs } = resolvePositionalProject(args); await rest(projectId, restArgs[0], restArgs[1]); break; }
|
|
362
345
|
case "usage": { const { projectId } = resolvePositionalProject(args); await usage(projectId); break; }
|
|
363
346
|
case "schema": { const { projectId } = resolvePositionalProject(args); await schema(projectId); break; }
|
|
364
|
-
case "rls": { const { projectId, rest } = resolvePositionalProject(args); await rls(projectId, rest[0], rest[1]); break; }
|
|
365
347
|
case "apply-expose": { const { projectId, rest } = resolvePositionalProject(args); await applyExpose(projectId, rest); break; }
|
|
366
348
|
case "get-expose": { const { projectId } = resolvePositionalProject(args); await getExpose(projectId); break; }
|
|
367
349
|
case "delete": { const { projectId } = resolvePositionalProject(args); await deleteProject(projectId); break; }
|
package/lib/sites.mjs
CHANGED
|
@@ -11,13 +11,11 @@ const HELP = `run402 sites - Deploy and manage static sites
|
|
|
11
11
|
Usage:
|
|
12
12
|
run402 sites deploy --manifest <file> [--project <id>] [--target <target>]
|
|
13
13
|
run402 sites deploy-dir <path> --project <id> [--target <target>]
|
|
14
|
-
run402 sites status <deployment_id>
|
|
15
14
|
cat manifest.json | run402 sites deploy
|
|
16
15
|
|
|
17
16
|
Subcommands:
|
|
18
17
|
deploy Deploy a static site from a manifest JSON
|
|
19
18
|
deploy-dir Deploy a static site from a local directory (SDK walks it for you)
|
|
20
|
-
status Check the status of a deployment
|
|
21
19
|
|
|
22
20
|
Options (deploy):
|
|
23
21
|
--manifest <file> Path to manifest JSON file (or read from stdin)
|
|
@@ -48,18 +46,19 @@ Manifest format (JSON):
|
|
|
48
46
|
Examples:
|
|
49
47
|
run402 sites deploy --manifest site.json
|
|
50
48
|
run402 sites deploy-dir ./my-site --project prj_abc
|
|
51
|
-
run402 sites status dpl_abc123
|
|
52
49
|
cat site.json | run402 sites deploy
|
|
53
50
|
|
|
54
51
|
Notes:
|
|
55
|
-
- Both deploy and deploy-dir
|
|
56
|
-
bytes the gateway doesn't already have are uploaded.
|
|
57
|
-
unchanged tree make no S3 PUTs.
|
|
52
|
+
- Both deploy and deploy-dir route through the unified deploy primitive
|
|
53
|
+
(CAS-backed): only bytes the gateway doesn't already have are uploaded.
|
|
54
|
+
Re-deploys of an unchanged tree make no S3 PUTs.
|
|
55
|
+
- To check status of an in-flight deploy, use 'run402 deploy events <op>'
|
|
56
|
+
or 'run402 deploy list --project <id>'.
|
|
58
57
|
- deploy-dir walks the directory, skips .git / node_modules / .DS_Store,
|
|
59
58
|
and auto-detects binary files. Symlinks are rejected.
|
|
60
59
|
- Progress events are emitted as JSON-line objects on stderr by default
|
|
61
|
-
(one object per line
|
|
62
|
-
|
|
60
|
+
(one object per line). Final result envelope goes to stdout. Pass --quiet
|
|
61
|
+
to silence stderr.
|
|
63
62
|
- Free with active tier - requires allowance auth
|
|
64
63
|
`;
|
|
65
64
|
|
|
@@ -111,21 +110,17 @@ Options:
|
|
|
111
110
|
Behavior:
|
|
112
111
|
- Walks <path> recursively, skips .git / node_modules / .DS_Store
|
|
113
112
|
- Computes per-file SHA-256 and uploads only bytes the gateway doesn't
|
|
114
|
-
already have (
|
|
113
|
+
already have (CAS-backed unified deploy primitive)
|
|
115
114
|
- Symlinks are rejected (no following)
|
|
116
115
|
- Paths in the manifest are POSIX-style relative to <path>
|
|
117
116
|
|
|
118
117
|
Progress events:
|
|
119
118
|
By default, the CLI streams JSON-line events to stderr while the deploy
|
|
120
|
-
progresses. Each line is one JSON object terminated by \\n.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
{"phase":"poll","status":"copying","elapsed_ms":N}
|
|
126
|
-
- per Stage-2 copy poll tick
|
|
127
|
-
Stdout receives only the final result envelope. To consume both streams
|
|
128
|
-
separately: \`run402 sites deploy-dir ./dist --project p > result.json 2> events.log\`.
|
|
119
|
+
progresses. Each line is one JSON object terminated by \\n. Both the
|
|
120
|
+
unified DeployEvent shapes and legacy phase events ({"phase":...}) are
|
|
121
|
+
emitted for back-compat. Stdout receives only the final result envelope.
|
|
122
|
+
To consume both streams separately:
|
|
123
|
+
\`run402 sites deploy-dir ./dist --project p > result.json 2> events.log\`
|
|
129
124
|
|
|
130
125
|
Notes:
|
|
131
126
|
- Re-deploying an unchanged tree makes no S3 PUTs (returns immediately
|
|
@@ -145,11 +140,6 @@ async function readStdin() {
|
|
|
145
140
|
return Buffer.concat(chunks).toString("utf-8");
|
|
146
141
|
}
|
|
147
142
|
|
|
148
|
-
/**
|
|
149
|
-
* Stage manifest files to a temp directory so the SDK's deployDir can walk
|
|
150
|
-
* them. The v1.32 SDK no longer accepts inline file bytes — every deploy
|
|
151
|
-
* goes through plan/commit and reads from a directory.
|
|
152
|
-
*/
|
|
153
143
|
function stageFilesToTempDir(files) {
|
|
154
144
|
const stage = mkdtempSync(join(tmpdir(), "run402-deploy-stage-"));
|
|
155
145
|
for (const f of files) {
|
|
@@ -166,15 +156,6 @@ function stageFilesToTempDir(files) {
|
|
|
166
156
|
return stage;
|
|
167
157
|
}
|
|
168
158
|
|
|
169
|
-
/**
|
|
170
|
-
* Returns an onEvent callback that writes each event as a single-line JSON
|
|
171
|
-
* object to stderr — or a no-op when --quiet was passed. The CLI is
|
|
172
|
-
* agent-first; structured stderr lets a piping agent stream progress with
|
|
173
|
-
* `2>events.log` while keeping stdout reserved for the final result envelope.
|
|
174
|
-
*
|
|
175
|
-
* Uses `console.error` so that test harnesses intercepting console output
|
|
176
|
-
* see each event line; `console.error` appends a newline by default.
|
|
177
|
-
*/
|
|
178
159
|
function makeStderrEventWriter(quiet) {
|
|
179
160
|
if (quiet) return undefined;
|
|
180
161
|
return (event) => {
|
|
@@ -193,7 +174,7 @@ async function deploy(args) {
|
|
|
193
174
|
if (args[i] === "--inherit") {
|
|
194
175
|
console.error(JSON.stringify({
|
|
195
176
|
status: "error",
|
|
196
|
-
message: "--inherit is removed
|
|
177
|
+
message: "--inherit is removed; the SDK now uploads only changed files automatically.",
|
|
197
178
|
}));
|
|
198
179
|
process.exit(1);
|
|
199
180
|
}
|
|
@@ -204,7 +185,7 @@ async function deploy(args) {
|
|
|
204
185
|
if (opts.manifest) resolveFilePathsInManifest(manifest, dirname(resolve(opts.manifest)));
|
|
205
186
|
|
|
206
187
|
// Preserve the aggressive early exit when no allowance is configured.
|
|
207
|
-
allowanceAuthHeaders("/deploy/
|
|
188
|
+
allowanceAuthHeaders("/deploy/v2/plans");
|
|
208
189
|
|
|
209
190
|
const stage = stageFilesToTempDir(manifest.files || []);
|
|
210
191
|
try {
|
|
@@ -235,7 +216,7 @@ async function deployDir(args) {
|
|
|
235
216
|
if (args[i] === "--inherit") {
|
|
236
217
|
console.error(JSON.stringify({
|
|
237
218
|
status: "error",
|
|
238
|
-
message: "--inherit is removed
|
|
219
|
+
message: "--inherit is removed; the SDK now uploads only changed files automatically.",
|
|
239
220
|
}));
|
|
240
221
|
process.exit(1);
|
|
241
222
|
}
|
|
@@ -248,7 +229,7 @@ async function deployDir(args) {
|
|
|
248
229
|
const projectId = resolveProjectId(opts.project);
|
|
249
230
|
|
|
250
231
|
// Preserve the aggressive early exit when no allowance is configured.
|
|
251
|
-
allowanceAuthHeaders("/deploy/
|
|
232
|
+
allowanceAuthHeaders("/deploy/v2/plans");
|
|
252
233
|
|
|
253
234
|
try {
|
|
254
235
|
const data = await getSdk().sites.deployDir({
|
|
@@ -266,27 +247,12 @@ async function deployDir(args) {
|
|
|
266
247
|
}
|
|
267
248
|
}
|
|
268
249
|
|
|
269
|
-
async function status(args) {
|
|
270
|
-
let deploymentId = null;
|
|
271
|
-
for (let i = 0; i < args.length; i++) {
|
|
272
|
-
if (!args[i].startsWith("-")) { deploymentId = args[i]; break; }
|
|
273
|
-
}
|
|
274
|
-
if (!deploymentId) { console.error(JSON.stringify({ status: "error", message: "Missing deployment ID" })); process.exit(1); }
|
|
275
|
-
try {
|
|
276
|
-
const data = await getSdk().sites.getDeployment(deploymentId);
|
|
277
|
-
console.log(JSON.stringify(data, null, 2));
|
|
278
|
-
} catch (err) {
|
|
279
|
-
reportSdkError(err);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
250
|
export async function run(sub, args) {
|
|
284
251
|
if (!sub || sub === '--help' || sub === '-h') { console.log(HELP); process.exit(0); }
|
|
285
252
|
if (Array.isArray(args) && (args.includes("--help") || args.includes("-h"))) { console.log(SUB_HELP[sub] || HELP); process.exit(0); }
|
|
286
253
|
switch (sub) {
|
|
287
254
|
case "deploy": await deploy(args); break;
|
|
288
255
|
case "deploy-dir": await deployDir(args); break;
|
|
289
|
-
case "status": await status(args); break;
|
|
290
256
|
default:
|
|
291
257
|
console.error(`Unknown subcommand: ${sub}\n`);
|
|
292
258
|
console.log(HELP);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.52.0",
|
|
4
4
|
"description": "CLI for Run402 — provision Postgres databases, deploy static sites, generate images, and manage wallets via x402 and MPP micropayments.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"@x402/evm": "^2.6.0",
|
|
25
25
|
"@x402/fetch": "^2.6.0",
|
|
26
26
|
"mppx": "^0.4.7",
|
|
27
|
-
"undici": "^8.0.2",
|
|
28
27
|
"viem": "^2.47.1"
|
|
29
28
|
},
|
|
30
29
|
"engines": {
|
|
@@ -30,7 +30,10 @@ export interface AllowanceCreateResult {
|
|
|
30
30
|
}
|
|
31
31
|
export interface FaucetResult {
|
|
32
32
|
transactionHash: string;
|
|
33
|
+
/** Display-formatted amount, e.g. `"0.25"`. Computed from `amountUsdMicros`. */
|
|
33
34
|
amount: string;
|
|
35
|
+
/** Raw amount in micro-USD (1_000_000 = $1.00). */
|
|
36
|
+
amountUsdMicros: number;
|
|
34
37
|
token: string;
|
|
35
38
|
network: string;
|
|
36
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowance.d.ts","sourceRoot":"","sources":["../../src/namespaces/allowance.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"allowance.d.ts","sourceRoot":"","sources":["../../src/namespaces/allowance.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AASD,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,8EAA8E;IACxE,MAAM,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAoB9C;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,qBAAqB,CAAC;IA4B9C,kFAAkF;IAC5E,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAY/B;;;;;OAKG;IACG,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;CAkDtD"}
|
|
@@ -90,12 +90,21 @@ export class Allowance {
|
|
|
90
90
|
}
|
|
91
91
|
resolvedAddress = data.address;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
// Wire shape is snake_case (`transaction_hash`, `amount_usd_micros`);
|
|
94
|
+
// normalize to the typed camelCase surface (regression: GH-163).
|
|
95
|
+
const wire = await this.client.request("/faucet/v1", {
|
|
94
96
|
method: "POST",
|
|
95
97
|
body: { address: resolvedAddress },
|
|
96
98
|
withAuth: false,
|
|
97
99
|
context: "requesting faucet funds",
|
|
98
100
|
});
|
|
101
|
+
const result = {
|
|
102
|
+
transactionHash: wire.transaction_hash,
|
|
103
|
+
amountUsdMicros: wire.amount_usd_micros,
|
|
104
|
+
amount: (wire.amount_usd_micros / 1_000_000).toFixed(2),
|
|
105
|
+
token: wire.token,
|
|
106
|
+
network: wire.network,
|
|
107
|
+
};
|
|
99
108
|
// Best-effort update of the local allowance's funded/lastFaucet fields.
|
|
100
109
|
const reader = this.client.credentials.readAllowance;
|
|
101
110
|
const saver = this.client.credentials.saveAllowance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowance.js","sourceRoot":"","sources":["../../src/namespaces/allowance.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"allowance.js","sourceRoot":"","sources":["../../src/namespaces/allowance.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA4C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AAI,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC;QACpD,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;YACpB,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;gBACxD,IAAI,IAAI,EAAE,CAAC;oBACT,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;wBACxC,GAAG,IAAI;wBACP,MAAM,EAAE,IAAI;wBACZ,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;qBACrC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,8CAA8C;YAChD,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* `projects` namespace — project lifecycle, introspection, and admin.
|
|
3
3
|
*
|
|
4
4
|
* Covers:
|
|
5
|
-
* - remote: provision, delete, list, getUsage, getSchema,
|
|
5
|
+
* - remote: provision, delete, list, getUsage, getSchema, pin, getQuote
|
|
6
6
|
* - local: info, keys, use (require provider support for persistence methods)
|
|
7
7
|
*/
|
|
8
8
|
import type { Client } from "../kernel.js";
|
|
9
9
|
import type { ProjectKeys } from "../credentials.js";
|
|
10
|
-
import type { ListProjectsResult, PinResult, ProjectInfo, ProvisionOptions, ProvisionResult, QuoteResult,
|
|
10
|
+
import type { ListProjectsResult, PinResult, ProjectInfo, ProvisionOptions, ProvisionResult, QuoteResult, SchemaReport, UsageReport } from "./projects.types.js";
|
|
11
11
|
export declare class Projects {
|
|
12
12
|
private readonly client;
|
|
13
13
|
constructor(client: Client);
|
|
@@ -54,17 +54,6 @@ export declare class Projects {
|
|
|
54
54
|
* constraints, and RLS policies.
|
|
55
55
|
*/
|
|
56
56
|
getSchema(id: string): Promise<SchemaReport>;
|
|
57
|
-
/**
|
|
58
|
-
* Apply a row-level-security template to one or more tables.
|
|
59
|
-
*
|
|
60
|
-
* ⚠ The gateway endpoint is deprecated (sunset 2026-05-23). Prefer the
|
|
61
|
-
* manifest-based `apply_expose` flow for new code.
|
|
62
|
-
*
|
|
63
|
-
* @throws {Run402Error} with `context: "setting up RLS"` when
|
|
64
|
-
* `i_understand_this_is_unrestricted` is missing for the
|
|
65
|
-
* `public_read_write_UNRESTRICTED` template.
|
|
66
|
-
*/
|
|
67
|
-
setupRls(id: string, opts: RlsSetupOptions): Promise<RlsSetupResult>;
|
|
68
57
|
/**
|
|
69
58
|
* Pin a project so it is not garbage-collected or expired.
|
|
70
59
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/namespaces/projects.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/namespaces/projects.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAE7B,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C;;;;;;;;OAQG;IACG,SAAS,CAAC,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC;IAyBtE;;;;;;;OAOG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAcvC;;;;;;;;;;;;OAYG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA8BxD;;;OAGG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAUhD;;;OAGG;IACG,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAUlD;;;;;;;;OAQG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAWzC;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;IAOtC;;;;;OAKG;IACG,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAM5C;;;;;OAKG;IACG,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAM5C;;;;;;OAMG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAapC;;;OAGG;IACG,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAKvC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* `projects` namespace — project lifecycle, introspection, and admin.
|
|
3
3
|
*
|
|
4
4
|
* Covers:
|
|
5
|
-
* - remote: provision, delete, list, getUsage, getSchema,
|
|
5
|
+
* - remote: provision, delete, list, getUsage, getSchema, pin, getQuote
|
|
6
6
|
* - local: info, keys, use (require provider support for persistence methods)
|
|
7
7
|
*/
|
|
8
8
|
import { ProjectNotFound, Run402Error } from "../errors.js";
|
|
@@ -125,39 +125,6 @@ export class Projects {
|
|
|
125
125
|
context: "fetching schema",
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
/**
|
|
129
|
-
* Apply a row-level-security template to one or more tables.
|
|
130
|
-
*
|
|
131
|
-
* ⚠ The gateway endpoint is deprecated (sunset 2026-05-23). Prefer the
|
|
132
|
-
* manifest-based `apply_expose` flow for new code.
|
|
133
|
-
*
|
|
134
|
-
* @throws {Run402Error} with `context: "setting up RLS"` when
|
|
135
|
-
* `i_understand_this_is_unrestricted` is missing for the
|
|
136
|
-
* `public_read_write_UNRESTRICTED` template.
|
|
137
|
-
*/
|
|
138
|
-
async setupRls(id, opts) {
|
|
139
|
-
if (opts.template === "public_read_write_UNRESTRICTED" &&
|
|
140
|
-
opts.i_understand_this_is_unrestricted !== true) {
|
|
141
|
-
throw new (class extends Run402Error {
|
|
142
|
-
})("i_understand_this_is_unrestricted must be true when template is public_read_write_UNRESTRICTED", null, null, "setting up RLS");
|
|
143
|
-
}
|
|
144
|
-
const keys = await this.client.getProject(id);
|
|
145
|
-
if (!keys)
|
|
146
|
-
throw new ProjectNotFound(id, "setting up RLS");
|
|
147
|
-
const body = {
|
|
148
|
-
template: opts.template,
|
|
149
|
-
tables: opts.tables,
|
|
150
|
-
};
|
|
151
|
-
if (opts.i_understand_this_is_unrestricted !== undefined) {
|
|
152
|
-
body.i_understand_this_is_unrestricted = opts.i_understand_this_is_unrestricted;
|
|
153
|
-
}
|
|
154
|
-
return this.client.request(`/projects/v1/admin/${id}/rls`, {
|
|
155
|
-
method: "POST",
|
|
156
|
-
headers: { Authorization: `Bearer ${keys.service_key}` },
|
|
157
|
-
body,
|
|
158
|
-
context: "setting up RLS",
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
128
|
/**
|
|
162
129
|
* Pin a project so it is not garbage-collected or expired.
|
|
163
130
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/namespaces/projects.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,eAAe,EAAE,WAAW,E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,wBAAwB,CAAC,CAAC;QAEnE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC;QACxD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,4IAA4I,CAC7I,CAAC;QACJ,CAAC;QACD,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC;QACxD,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QACzB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -40,7 +40,12 @@ export interface UsageReport {
|
|
|
40
40
|
api_calls_limit: number;
|
|
41
41
|
storage_bytes: number;
|
|
42
42
|
storage_limit_bytes: number;
|
|
43
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Optional: the `/projects/v1/admin/:id/usage` endpoint does not currently
|
|
45
|
+
* include the lease expiry. Read it from `tier.status()` if you need it.
|
|
46
|
+
* `null` is reserved for unleased accounts (see GH-163).
|
|
47
|
+
*/
|
|
48
|
+
lease_expires_at?: string | null;
|
|
44
49
|
status: string;
|
|
45
50
|
}
|
|
46
51
|
export interface ColumnSchema {
|
|
@@ -78,20 +83,6 @@ export interface RlsTableSpec {
|
|
|
78
83
|
/** Column holding the owning user's id. Required when `template: "user_owns_rows"`. */
|
|
79
84
|
owner_column?: string;
|
|
80
85
|
}
|
|
81
|
-
export interface RlsSetupOptions {
|
|
82
|
-
template: RlsTemplate;
|
|
83
|
-
tables: RlsTableSpec[];
|
|
84
|
-
/**
|
|
85
|
-
* Required to be `true` when `template: "public_read_write_UNRESTRICTED"`.
|
|
86
|
-
* Acknowledges that the anon key gains INSERT/UPDATE/DELETE on the listed tables.
|
|
87
|
-
*/
|
|
88
|
-
i_understand_this_is_unrestricted?: boolean;
|
|
89
|
-
}
|
|
90
|
-
export interface RlsSetupResult {
|
|
91
|
-
status: string;
|
|
92
|
-
template: string;
|
|
93
|
-
tables: string[];
|
|
94
|
-
}
|
|
95
86
|
export interface PinResult {
|
|
96
87
|
status: string;
|
|
97
88
|
project_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.types.d.ts","sourceRoot":"","sources":["../../src/namespaces/projects.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzD,MAAM,WAAW,gBAAgB;IAC/B,+FAA+F;IAC/F,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAID,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AAID,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,I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,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAClC;AAID,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC9C,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `sites` namespace — static site deployments.
|
|
3
3
|
*
|
|
4
|
-
* As of v1.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* As of v1.34 every static-site deploy flows through the unified
|
|
5
|
+
* {@link Deploy.apply} primitive. The legacy isomorphic surface is empty
|
|
6
|
+
* here; the Node-only `deployDir` convenience lives in
|
|
7
|
+
* {@link "../node/sites-node".NodeSites}.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* `SiteFile` is preserved for `apps.bundleDeploy` callers that still pass
|
|
10
|
+
* inline file bytes; the bundle shim translates these into a v2
|
|
11
|
+
* {@link ReleaseSpec} before dispatching.
|
|
12
12
|
*/
|
|
13
13
|
import type { Client } from "../kernel.js";
|
|
14
14
|
export interface SiteFile {
|
|
@@ -26,19 +26,8 @@ export interface SiteDeployResult {
|
|
|
26
26
|
/** Bytes uploaded in this deploy (0 on a no-op redeploy). */
|
|
27
27
|
bytes_uploaded?: number;
|
|
28
28
|
}
|
|
29
|
-
export interface DeploymentInfo {
|
|
30
|
-
id: string;
|
|
31
|
-
name: string;
|
|
32
|
-
url: string;
|
|
33
|
-
project_id?: string;
|
|
34
|
-
status: string;
|
|
35
|
-
files_count: number;
|
|
36
|
-
total_size: number;
|
|
37
|
-
}
|
|
38
29
|
export declare class Sites {
|
|
39
30
|
private readonly client;
|
|
40
31
|
constructor(client: Client);
|
|
41
|
-
/** Get deployment metadata by id. Public — no project auth. */
|
|
42
|
-
getDeployment(deploymentId: string): Promise<DeploymentInfo>;
|
|
43
32
|
}
|
|
44
33
|
//# sourceMappingURL=sites.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../src/namespaces/sites.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,QAAQ;IACvB,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,
|
|
1
|
+
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../src/namespaces/sites.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,QAAQ;IACvB,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;CAC5C"}
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `sites` namespace — static site deployments.
|
|
3
3
|
*
|
|
4
|
-
* As of v1.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* As of v1.34 every static-site deploy flows through the unified
|
|
5
|
+
* {@link Deploy.apply} primitive. The legacy isomorphic surface is empty
|
|
6
|
+
* here; the Node-only `deployDir` convenience lives in
|
|
7
|
+
* {@link "../node/sites-node".NodeSites}.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* `SiteFile` is preserved for `apps.bundleDeploy` callers that still pass
|
|
10
|
+
* inline file bytes; the bundle shim translates these into a v2
|
|
11
|
+
* {@link ReleaseSpec} before dispatching.
|
|
12
12
|
*/
|
|
13
13
|
export class Sites {
|
|
14
14
|
client;
|
|
15
15
|
constructor(client) {
|
|
16
16
|
this.client = client;
|
|
17
17
|
}
|
|
18
|
-
/** Get deployment metadata by id. Public — no project auth. */
|
|
19
|
-
async getDeployment(deploymentId) {
|
|
20
|
-
return this.client.request(`/deployments/v1/${deploymentId}`, {
|
|
21
|
-
context: "fetching deployment",
|
|
22
|
-
withAuth: false,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
18
|
}
|
|
26
19
|
//# sourceMappingURL=sites.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sites.js","sourceRoot":"","sources":["../../src/namespaces/sites.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"sites.js","sourceRoot":"","sources":["../../src/namespaces/sites.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqBH,MAAM,OAAO,KAAK;IACa;IAA7B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;CAChD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subdomains.d.ts","sourceRoot":"","sources":["../../src/namespaces/subdomains.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,MAAM,WAAW,qBAAqB;IACpC,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,sDAAsD;IAChD,KAAK,CACT,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,IAAI,GAAE,qBAA0B,GAC/B,OAAO,CAAC,oBAAoB,CAAC;IAgBhC,2BAA2B;IACrB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,qBAA0B,GAAG,OAAO,CAAC,IAAI,CAAC;IAe3E,gDAAgD;IAC1C,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"subdomains.d.ts","sourceRoot":"","sources":["../../src/namespaces/subdomains.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,MAAM,WAAW,qBAAqB;IACpC,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,sDAAsD;IAChD,KAAK,CACT,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,IAAI,GAAE,qBAA0B,GAC/B,OAAO,CAAC,oBAAoB,CAAC;IAgBhC,2BAA2B;IACrB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,qBAA0B,GAAG,OAAO,CAAC,IAAI,CAAC;IAe3E,gDAAgD;IAC1C,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAe3D"}
|
|
@@ -45,10 +45,13 @@ export class Subdomains {
|
|
|
45
45
|
const project = await this.client.getProject(projectId);
|
|
46
46
|
if (!project)
|
|
47
47
|
throw new ProjectNotFound(projectId, "listing subdomains");
|
|
48
|
-
|
|
48
|
+
// Gateway responds `{ subdomains: [...] }`; unwrap so callers get the
|
|
49
|
+
// array shape the type promises (regression: GH-163).
|
|
50
|
+
const body = await this.client.request("/subdomains/v1", {
|
|
49
51
|
headers: { Authorization: `Bearer ${project.service_key}` },
|
|
50
52
|
context: "listing subdomains",
|
|
51
53
|
});
|
|
54
|
+
return body.subdomains ?? [];
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
//# sourceMappingURL=subdomains.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subdomains.js","sourceRoot":"","sources":["../../src/namespaces/subdomains.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAwB/C,MAAM,OAAO,UAAU;IACQ;IAA7B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,sDAAsD;IACtD,KAAK,CAAC,KAAK,CACT,IAAY,EACZ,YAAoB,EACpB,OAA8B,EAAE;QAEhC,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC7D,IAAI,CAAC,OAAO;gBAAE,MAAM,IAAI,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;YAC9E,OAAO,CAAC,aAAa,GAAG,UAAU,OAAO,CAAC,WAAW,EAAE,CAAC;QAC1D,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAuB,gBAAgB,EAAE;YACjE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,YAAY,EAAE;YAC3C,OAAO,EAAE,oBAAoB;SAC9B,CAAC,CAAC;IACL,CAAC;IAED,2BAA2B;IAC3B,KAAK,CAAC,MAAM,CAAC,IAAY,EAAE,OAA8B,EAAE;QACzD,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;Y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QACtD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACpC,gBAAgB,EAChB;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,OAAO,CAAC,WAAW,EAAE,EAAE;YAC3D,OAAO,EAAE,oBAAoB;SAC9B,CACF,CAAC;QACF,OAAO,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC;IAC/B,CAAC;CACF"}
|
package/sdk/dist/node/index.d.ts
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* await r.sites.deployDir({ project: project.project_id, dir: "./my-site" });
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
|
-
* `deployDir`
|
|
19
|
-
*
|
|
20
|
-
* issues no S3 PUTs.
|
|
18
|
+
* `deployDir` is a thin wrapper over `r.deploy.apply` — bytes ride through
|
|
19
|
+
* the unified CAS substrate, so only files the gateway doesn't already have
|
|
20
|
+
* are uploaded. Re-deploying an unchanged tree issues no S3 PUTs.
|
|
21
21
|
*/
|
|
22
22
|
import { Run402 } from "../index.js";
|
|
23
23
|
import { NodeSites } from "./sites-node.js";
|
|
@@ -48,8 +48,7 @@ export type NodeRun402 = Omit<Run402, "sites"> & {
|
|
|
48
48
|
* `@x402/fetch` when the allowance wallet has USDC balance.
|
|
49
49
|
*
|
|
50
50
|
* The returned instance's `sites` namespace is a {@link NodeSites}, which
|
|
51
|
-
*
|
|
52
|
-
* and `getDeployment()` methods.
|
|
51
|
+
* exposes the `deployDir({ dir })` helper.
|
|
53
52
|
*/
|
|
54
53
|
export declare function run402(opts?: NodeRun402Options): NodeRun402;
|
|
55
54
|
export { NodeSites } from "./sites-node.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,MAAM,EAAsB,MAAM,aAAa,CAAC;AAIzD,OAAO,EAAE,S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SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EACL,MAAM,EACN,WAAW,EACX,eAAe,EACf,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,MAAM,EACN,KAAK,GACN,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,MAAM,EACN,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACd,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,SAAS,EACT,WAAW,EACX,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,cAAc,GACf,MAAM,aAAa,CAAC"}
|
package/sdk/dist/node/index.js
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* await r.sites.deployDir({ project: project.project_id, dir: "./my-site" });
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
|
-
* `deployDir`
|
|
19
|
-
*
|
|
20
|
-
* issues no S3 PUTs.
|
|
18
|
+
* `deployDir` is a thin wrapper over `r.deploy.apply` — bytes ride through
|
|
19
|
+
* the unified CAS substrate, so only files the gateway doesn't already have
|
|
20
|
+
* are uploaded. Re-deploying an unchanged tree issues no S3 PUTs.
|
|
21
21
|
*/
|
|
22
22
|
import { getApiBase } from "../../core-dist/config.js";
|
|
23
23
|
import { Run402 } from "../index.js";
|
|
@@ -32,8 +32,7 @@ import { NodeSites } from "./sites-node.js";
|
|
|
32
32
|
* `@x402/fetch` when the allowance wallet has USDC balance.
|
|
33
33
|
*
|
|
34
34
|
* The returned instance's `sites` namespace is a {@link NodeSites}, which
|
|
35
|
-
*
|
|
36
|
-
* and `getDeployment()` methods.
|
|
35
|
+
* exposes the `deployDir({ dir })` helper.
|
|
37
36
|
*/
|
|
38
37
|
export function run402(opts = {}) {
|
|
39
38
|
const runOpts = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAsB,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAqB5C
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAsB,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAqB5C;;;;;;;;;GASG;AACH,MAAM,UAA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