run402 2.10.0 → 2.11.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/cli.mjs +24 -0
- package/lib/cache.mjs +264 -0
- package/lib/dev.mjs +137 -0
- package/lib/doctor.mjs +188 -0
- package/lib/init-astro.mjs +277 -0
- package/lib/init.mjs +14 -0
- package/lib/logs.mjs +168 -0
- package/package.json +1 -1
- package/sdk/dist/index.d.ts +3 -0
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +3 -0
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/namespaces/cache.d.ts +100 -0
- package/sdk/dist/namespaces/cache.d.ts.map +1 -0
- package/sdk/dist/namespaces/cache.js +104 -0
- package/sdk/dist/namespaces/cache.js.map +1 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* run402 init astro — scaffold a deployable Astro project for Run402.
|
|
3
|
+
*
|
|
4
|
+
* Capability `astro-ssr-runtime` (Run402 v1.52). Creates a minimal
|
|
5
|
+
* working Astro project pre-wired with:
|
|
6
|
+
*
|
|
7
|
+
* - `@run402/astro` preset (one-line astro.config.mjs)
|
|
8
|
+
* - package.json with `dev`/`deploy` scripts pointing at `run402 dev`/`run402 deploy`
|
|
9
|
+
* - Sample `src/pages/index.astro` and `src/pages/[slug].astro` (DB-backed dynamic page)
|
|
10
|
+
* - `.env.example` listing the env vars Run402 functions need
|
|
11
|
+
*
|
|
12
|
+
* Refuses to overwrite a non-empty directory unless `--force` is passed.
|
|
13
|
+
*
|
|
14
|
+
* @see https://docs.run402.com/astro
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { existsSync, mkdirSync, readdirSync, writeFileSync } from "node:fs";
|
|
18
|
+
import { resolve } from "node:path";
|
|
19
|
+
import { fail } from "./sdk-errors.mjs";
|
|
20
|
+
|
|
21
|
+
const HELP = `run402 init astro — Scaffold a deployable Astro project
|
|
22
|
+
|
|
23
|
+
Usage:
|
|
24
|
+
run402 init astro [<dir>] [--force] [--json]
|
|
25
|
+
|
|
26
|
+
Arguments:
|
|
27
|
+
<dir> Target directory (default: current directory)
|
|
28
|
+
|
|
29
|
+
Options:
|
|
30
|
+
--force Overwrite a non-empty directory
|
|
31
|
+
--json Emit a structured JSON summary on stdout
|
|
32
|
+
|
|
33
|
+
The scaffolded project includes:
|
|
34
|
+
- package.json (with 'dev' / 'deploy' scripts)
|
|
35
|
+
- astro.config.mjs (one-line @run402/astro preset)
|
|
36
|
+
- src/pages/index.astro (hello page)
|
|
37
|
+
- src/pages/[slug].astro (DB-backed dynamic page template)
|
|
38
|
+
- .env.example (RUN402_PROJECT_ID + RUN402_SERVICE_KEY placeholders)
|
|
39
|
+
|
|
40
|
+
After scaffolding:
|
|
41
|
+
cd <dir>
|
|
42
|
+
npm install
|
|
43
|
+
run402 dev # local dev with Run402 context
|
|
44
|
+
run402 deploy # build + deploy to your Run402 project
|
|
45
|
+
|
|
46
|
+
If you don't have a Run402 project yet:
|
|
47
|
+
run402 projects provision # create one first
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
export async function runInitAstro(args = []) {
|
|
51
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
52
|
+
console.log(HELP);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const force = args.includes("--force");
|
|
56
|
+
const json = args.includes("--json");
|
|
57
|
+
const positionals = args.filter((a) => !a.startsWith("--"));
|
|
58
|
+
const targetDir = resolve(positionals[0] ?? ".");
|
|
59
|
+
|
|
60
|
+
// Refuse non-empty dirs without --force.
|
|
61
|
+
if (existsSync(targetDir)) {
|
|
62
|
+
const entries = readdirSync(targetDir).filter((e) => !e.startsWith("."));
|
|
63
|
+
if (entries.length > 0 && !force) {
|
|
64
|
+
fail({
|
|
65
|
+
code: "BAD_USAGE",
|
|
66
|
+
message: `Target directory ${targetDir} is not empty.`,
|
|
67
|
+
hint: "Pass --force to overwrite, or scaffold into a fresh directory.",
|
|
68
|
+
details: { entries: entries.slice(0, 10) },
|
|
69
|
+
});
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
mkdirSync(targetDir, { recursive: true });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Write files. All paths relative to targetDir.
|
|
77
|
+
const files = [
|
|
78
|
+
{
|
|
79
|
+
path: "package.json",
|
|
80
|
+
content: JSON.stringify(
|
|
81
|
+
{
|
|
82
|
+
name: "my-run402-astro-app",
|
|
83
|
+
version: "0.0.1",
|
|
84
|
+
private: true,
|
|
85
|
+
type: "module",
|
|
86
|
+
scripts: {
|
|
87
|
+
dev: "run402 dev",
|
|
88
|
+
deploy: "run402 deploy",
|
|
89
|
+
build: "astro build",
|
|
90
|
+
preview: "astro preview",
|
|
91
|
+
},
|
|
92
|
+
dependencies: {
|
|
93
|
+
astro: "^5.0.0",
|
|
94
|
+
"@run402/astro": "^1.0.0",
|
|
95
|
+
"@run402/functions": "^2.5.0",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
null,
|
|
99
|
+
2,
|
|
100
|
+
) + "\n",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
path: "astro.config.mjs",
|
|
104
|
+
content: `// Run402 Astro preset. One config line gets you:
|
|
105
|
+
// - SSR on Lambda with SnapStart
|
|
106
|
+
// - ISR cache with cache.invalidate() admin-edit visibility
|
|
107
|
+
// - AsyncLocalStorage context so db()/getUser()/cache.* work natively
|
|
108
|
+
// - Build-time detectors for unsupported Astro features
|
|
109
|
+
import run402 from "@run402/astro";
|
|
110
|
+
export default run402();
|
|
111
|
+
`,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
path: ".env.example",
|
|
115
|
+
content: `# Run402 project credentials. Copy to .env.local for 'run402 dev'.
|
|
116
|
+
# In production, these are injected automatically.
|
|
117
|
+
RUN402_PROJECT_ID=prj_...
|
|
118
|
+
RUN402_SERVICE_KEY=...
|
|
119
|
+
`,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
path: ".gitignore",
|
|
123
|
+
content: `# build artifacts
|
|
124
|
+
dist/
|
|
125
|
+
node_modules/
|
|
126
|
+
.run402/
|
|
127
|
+
|
|
128
|
+
# local env
|
|
129
|
+
.env
|
|
130
|
+
.env.local
|
|
131
|
+
`,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
path: "src/pages/index.astro",
|
|
135
|
+
content: `---
|
|
136
|
+
import Layout from "../layouts/Layout.astro";
|
|
137
|
+
---
|
|
138
|
+
<Layout title="Welcome">
|
|
139
|
+
<main>
|
|
140
|
+
<h1>Hello, Run402 + Astro</h1>
|
|
141
|
+
<p>Edit this file at <code>src/pages/index.astro</code>.</p>
|
|
142
|
+
<p>
|
|
143
|
+
The dynamic page at <code>/[slug]</code> shows the DB-backed pattern.
|
|
144
|
+
Try visiting <a href="/the-guys">/the-guys</a> after you create a
|
|
145
|
+
pages row.
|
|
146
|
+
</p>
|
|
147
|
+
</main>
|
|
148
|
+
</Layout>
|
|
149
|
+
`,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
path: "src/pages/[slug].astro",
|
|
153
|
+
content: `---
|
|
154
|
+
// Dynamic page. Fetches a row from your project's 'pages' table at
|
|
155
|
+
// SSR time. The first request renders + caches; subsequent requests
|
|
156
|
+
// HIT the cache. When an admin edits the row, call cache.invalidate()
|
|
157
|
+
// from your save handler for sub-second freshness.
|
|
158
|
+
import { db, getUser, cache } from "@run402/functions";
|
|
159
|
+
import Layout from "../layouts/Layout.astro";
|
|
160
|
+
|
|
161
|
+
const { slug } = Astro.params;
|
|
162
|
+
const page = await db()
|
|
163
|
+
.from("pages")
|
|
164
|
+
.select("title, html, og_image")
|
|
165
|
+
.eq("slug", slug)
|
|
166
|
+
.maybeSingle();
|
|
167
|
+
|
|
168
|
+
if (!page) {
|
|
169
|
+
return new Response("Not Found", { status: 404 });
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Set s-maxage to opt into the SSR cache layer. Without this, the
|
|
173
|
+
// response bypasses cache entirely (R402_CACHE_REASON: no_s_maxage).
|
|
174
|
+
Astro.response.headers.set(
|
|
175
|
+
"Cache-Control",
|
|
176
|
+
"public, s-maxage=60, stale-while-revalidate=300",
|
|
177
|
+
);
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
<Layout title={page.title} ogImage={page.og_image} canonical={Astro.url.href}>
|
|
181
|
+
<article set:html={page.html} />
|
|
182
|
+
</Layout>
|
|
183
|
+
`,
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
path: "src/layouts/Layout.astro",
|
|
187
|
+
content: `---
|
|
188
|
+
interface Props {
|
|
189
|
+
title: string;
|
|
190
|
+
ogImage?: string | null;
|
|
191
|
+
canonical?: string;
|
|
192
|
+
}
|
|
193
|
+
const { title, ogImage, canonical } = Astro.props;
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
<!doctype html>
|
|
197
|
+
<html lang="en">
|
|
198
|
+
<head>
|
|
199
|
+
<meta charset="utf-8" />
|
|
200
|
+
<meta name="viewport" content="width=device-width" />
|
|
201
|
+
<title>{title}</title>
|
|
202
|
+
{ogImage ? <meta property="og:image" content={ogImage} /> : null}
|
|
203
|
+
{canonical ? <link rel="canonical" href={canonical} /> : null}
|
|
204
|
+
</head>
|
|
205
|
+
<body>
|
|
206
|
+
<slot />
|
|
207
|
+
</body>
|
|
208
|
+
</html>
|
|
209
|
+
`,
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
path: "src/pages/api/save-page.ts",
|
|
213
|
+
content: `// Admin save endpoint. Demonstrates the full CMS flow:
|
|
214
|
+
// 1. Auth check (cache layer bypasses entirely when Authorization header is present).
|
|
215
|
+
// 2. DB update.
|
|
216
|
+
// 3. cache.invalidate() so the public URL re-renders fresh on next visit.
|
|
217
|
+
import type { APIRoute } from "astro";
|
|
218
|
+
import { db, getUser, cache } from "@run402/functions";
|
|
219
|
+
|
|
220
|
+
export const POST: APIRoute = async ({ request }) => {
|
|
221
|
+
const user = await getUser();
|
|
222
|
+
if (!user) return new Response("Unauthorized", { status: 401 });
|
|
223
|
+
|
|
224
|
+
const body = (await request.json()) as { slug: string; title: string; html: string };
|
|
225
|
+
if (!body?.slug) return new Response("Missing slug", { status: 400 });
|
|
226
|
+
|
|
227
|
+
await db()
|
|
228
|
+
.from("pages")
|
|
229
|
+
.upsert({ slug: body.slug, title: body.title, html: body.html });
|
|
230
|
+
|
|
231
|
+
// Invalidate the cached page so the next public request re-renders.
|
|
232
|
+
await cache.invalidate(\`/\${body.slug}\`);
|
|
233
|
+
|
|
234
|
+
return new Response(JSON.stringify({ ok: true, slug: body.slug }), {
|
|
235
|
+
status: 200,
|
|
236
|
+
headers: { "content-type": "application/json" },
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
`,
|
|
240
|
+
},
|
|
241
|
+
];
|
|
242
|
+
|
|
243
|
+
for (const file of files) {
|
|
244
|
+
const fullPath = resolve(targetDir, file.path);
|
|
245
|
+
mkdirSync(resolve(fullPath, ".."), { recursive: true });
|
|
246
|
+
writeFileSync(fullPath, file.content, "utf-8");
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (json) {
|
|
250
|
+
console.log(
|
|
251
|
+
JSON.stringify(
|
|
252
|
+
{
|
|
253
|
+
status: "ok",
|
|
254
|
+
dir: targetDir,
|
|
255
|
+
files_created: files.map((f) => f.path),
|
|
256
|
+
next_steps: [
|
|
257
|
+
`cd ${positionals[0] ?? "."}`,
|
|
258
|
+
"npm install",
|
|
259
|
+
"run402 deploy",
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
null,
|
|
263
|
+
2,
|
|
264
|
+
),
|
|
265
|
+
);
|
|
266
|
+
} else {
|
|
267
|
+
console.log(`Scaffolded Astro project at ${targetDir}`);
|
|
268
|
+
console.log("");
|
|
269
|
+
console.log("Files created:");
|
|
270
|
+
for (const f of files) console.log(` - ${f.path}`);
|
|
271
|
+
console.log("");
|
|
272
|
+
console.log("Next steps:");
|
|
273
|
+
if (positionals[0]) console.log(` cd ${positionals[0]}`);
|
|
274
|
+
console.log(" npm install");
|
|
275
|
+
console.log(" run402 deploy");
|
|
276
|
+
}
|
|
277
|
+
}
|
package/lib/init.mjs
CHANGED
|
@@ -45,7 +45,21 @@ function errorMessage(err) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export async function run(args = []) {
|
|
48
|
+
// Capability `astro-ssr-runtime` (v1.52): scaffold an Astro project.
|
|
49
|
+
// Sub-routes when first positional is 'astro'. Handle BEFORE the
|
|
50
|
+
// outer --help check so `run402 init astro --help` shows the astro
|
|
51
|
+
// scaffolder's help, not the rail-setup help. The rest of init's
|
|
52
|
+
// payment-rail setup is intentionally orthogonal — agents typically
|
|
53
|
+
// run `run402 init astro <dir>` to scaffold AND `run402 init` once
|
|
54
|
+
// to set up allowance / tier.
|
|
55
|
+
if (args[0] === "astro") {
|
|
56
|
+
const { runInitAstro } = await import("./init-astro.mjs");
|
|
57
|
+
await runInitAstro(args.slice(1));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
48
61
|
if (args.includes("--help") || args.includes("-h")) { console.log(HELP); process.exit(0); }
|
|
62
|
+
|
|
49
63
|
const jsonMode = args.includes("--json");
|
|
50
64
|
const isMpp = args[0] === "mpp";
|
|
51
65
|
const requestedRail = isMpp ? "mpp" : "x402";
|
package/lib/logs.mjs
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* run402 logs — Top-level shortcut for fetching function logs by request id.
|
|
3
|
+
*
|
|
4
|
+
* Capability `astro-ssr-runtime` (Run402 v1.52). When an SSR response
|
|
5
|
+
* returns 5xx, the response includes `x-run402-request-id: req_...` and
|
|
6
|
+
* `x-run402-error-code: R402_SSR_RUNTIME_ERROR`. The agent (or user)
|
|
7
|
+
* copies the request id and runs:
|
|
8
|
+
*
|
|
9
|
+
* run402 logs --request-id req_...
|
|
10
|
+
*
|
|
11
|
+
* Resolves project + function from env (RUN402_PROJECT_ID + --function)
|
|
12
|
+
* OR explicit flags. For multi-function projects, you can omit --function
|
|
13
|
+
* and the command scans every function in the project.
|
|
14
|
+
*
|
|
15
|
+
* Delegates to `run402 functions logs` for single-function lookups.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { getSdk } from "./sdk.mjs";
|
|
19
|
+
import { reportSdkError, fail } from "./sdk-errors.mjs";
|
|
20
|
+
|
|
21
|
+
const HELP = `run402 logs — Fetch function logs by request id
|
|
22
|
+
|
|
23
|
+
Usage:
|
|
24
|
+
run402 logs --request-id <req_id> [--function <name>] [--project <id>] [--json] [--tail <n>]
|
|
25
|
+
|
|
26
|
+
Required:
|
|
27
|
+
--request-id <req_id> The req_... id (from x-run402-request-id header)
|
|
28
|
+
|
|
29
|
+
Optional:
|
|
30
|
+
--function <name> Limit to one function (default: scan all functions in the project)
|
|
31
|
+
--project <id> Project id (default: \$RUN402_PROJECT_ID)
|
|
32
|
+
--tail <n> Max entries per function (default 100)
|
|
33
|
+
--json Machine-readable output
|
|
34
|
+
|
|
35
|
+
Examples:
|
|
36
|
+
run402 logs --request-id req_abc123
|
|
37
|
+
run402 logs --request-id req_abc123 --function ssr
|
|
38
|
+
run402 logs --request-id req_abc123 --project prj_xyz --json
|
|
39
|
+
|
|
40
|
+
Tip: the request id appears in:
|
|
41
|
+
- The 'x-run402-request-id' response header on every SSR response
|
|
42
|
+
- The 'requestId' field of any R402_SSR_RUNTIME_ERROR envelope
|
|
43
|
+
- The 'request_id' field in deploy / cache invalidate result envelopes
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
export async function run(sub, args = []) {
|
|
47
|
+
const all = [sub, ...args].filter(Boolean);
|
|
48
|
+
if (!all.length || all.includes("--help") || all.includes("-h")) {
|
|
49
|
+
console.log(HELP);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const json = all.includes("--json");
|
|
54
|
+
const requestId = pickFlagValue(all, "--request-id");
|
|
55
|
+
const fnName = pickFlagValue(all, "--function");
|
|
56
|
+
const projectIdArg = pickFlagValue(all, "--project");
|
|
57
|
+
const tailArg = pickFlagValue(all, "--tail");
|
|
58
|
+
|
|
59
|
+
if (!requestId) {
|
|
60
|
+
fail({
|
|
61
|
+
code: "BAD_USAGE",
|
|
62
|
+
message: "Missing --request-id <req_id>.",
|
|
63
|
+
hint: "Pass the request id from the 'x-run402-request-id' response header.",
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (!requestId.startsWith("req_")) {
|
|
67
|
+
fail({
|
|
68
|
+
code: "BAD_USAGE",
|
|
69
|
+
message: `--request-id must look like 'req_...' (got: ${requestId})`,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const projectId = projectIdArg ?? process.env.RUN402_PROJECT_ID;
|
|
74
|
+
if (!projectId) {
|
|
75
|
+
fail({
|
|
76
|
+
code: "BAD_USAGE",
|
|
77
|
+
message: "Missing project id.",
|
|
78
|
+
hint: "Pass --project <id> or set RUN402_PROJECT_ID env var.",
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const tail = tailArg ? parseInt(tailArg, 10) : 100;
|
|
83
|
+
if (Number.isNaN(tail) || tail < 1 || tail > 5000) {
|
|
84
|
+
fail({
|
|
85
|
+
code: "BAD_USAGE",
|
|
86
|
+
message: `--tail must be an integer between 1 and 5000 (got: ${tailArg})`,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const sdk = getSdk();
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
let fnNames;
|
|
94
|
+
if (fnName) {
|
|
95
|
+
fnNames = [fnName];
|
|
96
|
+
} else {
|
|
97
|
+
// Scan every function in the project.
|
|
98
|
+
const list = await sdk.functions.list(projectId);
|
|
99
|
+
fnNames = (list?.functions ?? []).map((f) => f.name);
|
|
100
|
+
if (fnNames.length === 0) {
|
|
101
|
+
if (json) console.log(JSON.stringify({ ok: true, entries: [], scanned: [] }));
|
|
102
|
+
else console.log("No functions in project " + projectId);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Query each function in parallel; aggregate entries.
|
|
108
|
+
const results = await Promise.allSettled(
|
|
109
|
+
fnNames.map((name) =>
|
|
110
|
+
sdk.functions
|
|
111
|
+
.logs(projectId, name, { requestId, tail })
|
|
112
|
+
.then((entries) => ({ name, entries: entries ?? [] })),
|
|
113
|
+
),
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
const allEntries = [];
|
|
117
|
+
const scanned = [];
|
|
118
|
+
const errors = [];
|
|
119
|
+
for (const r of results) {
|
|
120
|
+
if (r.status === "fulfilled") {
|
|
121
|
+
scanned.push(r.value.name);
|
|
122
|
+
for (const e of r.value.entries) {
|
|
123
|
+
allEntries.push({ function: r.value.name, ...e });
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
errors.push({ name: "?", error: r.reason?.message ?? String(r.reason) });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Sort by timestamp ascending.
|
|
131
|
+
allEntries.sort((a, b) => (a.ts ?? 0) - (b.ts ?? 0));
|
|
132
|
+
|
|
133
|
+
if (json) {
|
|
134
|
+
console.log(
|
|
135
|
+
JSON.stringify(
|
|
136
|
+
{
|
|
137
|
+
ok: errors.length === 0,
|
|
138
|
+
request_id: requestId,
|
|
139
|
+
project_id: projectId,
|
|
140
|
+
scanned,
|
|
141
|
+
entries: allEntries,
|
|
142
|
+
...(errors.length > 0 && { errors }),
|
|
143
|
+
},
|
|
144
|
+
null,
|
|
145
|
+
2,
|
|
146
|
+
),
|
|
147
|
+
);
|
|
148
|
+
} else {
|
|
149
|
+
if (allEntries.length === 0) {
|
|
150
|
+
console.log(`No log entries found for ${requestId} across ${scanned.length} function(s).`);
|
|
151
|
+
} else {
|
|
152
|
+
for (const e of allEntries) {
|
|
153
|
+
const t = e.ts ? new Date(e.ts).toISOString() : "";
|
|
154
|
+
console.log(`[${t}] [${e.function}] ${e.message ?? ""}`);
|
|
155
|
+
}
|
|
156
|
+
console.log(`\n${allEntries.length} entries across ${scanned.length} function(s) for ${requestId}.`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
} catch (err) {
|
|
160
|
+
reportSdkError(err);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function pickFlagValue(args, flag) {
|
|
165
|
+
const idx = args.indexOf(flag);
|
|
166
|
+
if (idx === -1) return undefined;
|
|
167
|
+
return args[idx + 1];
|
|
168
|
+
}
|
package/package.json
CHANGED
package/sdk/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { Projects } from "./namespaces/projects.js";
|
|
|
10
10
|
import { Assets } from "./namespaces/assets.js";
|
|
11
11
|
import { Functions } from "./namespaces/functions.js";
|
|
12
12
|
import { Secrets } from "./namespaces/secrets.js";
|
|
13
|
+
import { Cache } from "./namespaces/cache.js";
|
|
13
14
|
import { Subdomains } from "./namespaces/subdomains.js";
|
|
14
15
|
import { Domains } from "./namespaces/domains.js";
|
|
15
16
|
import { Sites } from "./namespaces/sites.js";
|
|
@@ -47,6 +48,7 @@ export declare class Run402 {
|
|
|
47
48
|
readonly assets: Assets;
|
|
48
49
|
readonly functions: Functions;
|
|
49
50
|
readonly secrets: Secrets;
|
|
51
|
+
readonly cache: Cache;
|
|
50
52
|
readonly subdomains: Subdomains;
|
|
51
53
|
readonly domains: Domains;
|
|
52
54
|
readonly sites: Sites;
|
|
@@ -145,6 +147,7 @@ export type * from "./namespaces/allowance.js";
|
|
|
145
147
|
export type * from "./namespaces/apps.js";
|
|
146
148
|
export type * from "./namespaces/auth.js";
|
|
147
149
|
export type * from "./namespaces/billing.js";
|
|
150
|
+
export type * from "./namespaces/cache.js";
|
|
148
151
|
export type * from "./namespaces/assets.types.js";
|
|
149
152
|
export type * from "./namespaces/ci.types.js";
|
|
150
153
|
export type * from "./namespaces/contracts.js";
|
package/sdk/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,EAAE,EA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mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,sBAAsB,CAAC"}
|
package/sdk/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { Projects } from "./namespaces/projects.js";
|
|
|
10
10
|
import { Assets } from "./namespaces/assets.js";
|
|
11
11
|
import { Functions } from "./namespaces/functions.js";
|
|
12
12
|
import { Secrets } from "./namespaces/secrets.js";
|
|
13
|
+
import { Cache } from "./namespaces/cache.js";
|
|
13
14
|
import { Subdomains } from "./namespaces/subdomains.js";
|
|
14
15
|
import { Domains } from "./namespaces/domains.js";
|
|
15
16
|
import { Sites } from "./namespaces/sites.js";
|
|
@@ -34,6 +35,7 @@ export class Run402 {
|
|
|
34
35
|
assets;
|
|
35
36
|
functions;
|
|
36
37
|
secrets;
|
|
38
|
+
cache;
|
|
37
39
|
subdomains;
|
|
38
40
|
domains;
|
|
39
41
|
sites;
|
|
@@ -85,6 +87,7 @@ export class Run402 {
|
|
|
85
87
|
this.assets = new Assets(client);
|
|
86
88
|
this.functions = new Functions(client);
|
|
87
89
|
this.secrets = new Secrets(client);
|
|
90
|
+
this.cache = new Cache(client);
|
|
88
91
|
this.subdomains = new Subdomains(client);
|
|
89
92
|
this.domains = new Domains(client);
|
|
90
93
|
this.sites = new Sites(client);
|
package/sdk/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAkC,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AA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100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cache` namespace — SSR origin cache inspection and invalidation.
|
|
3
|
+
*
|
|
4
|
+
* Capability `ssr-isr-cache` (Run402 v1.52). Used by AI coding agents
|
|
5
|
+
* and CLI tooling to invalidate cached SSR responses after admin
|
|
6
|
+
* content edits, OR to inspect what's currently cached.
|
|
7
|
+
*
|
|
8
|
+
* All operations are project-scoped: the SDK reads the active project
|
|
9
|
+
* from the credentials provider, and the gateway enforces host
|
|
10
|
+
* ownership (cross-project hosts throw
|
|
11
|
+
* `R402_CACHE_INVALIDATION_HOST_FORBIDDEN`).
|
|
12
|
+
*
|
|
13
|
+
* @see https://docs.run402.com/cache/concepts
|
|
14
|
+
*/
|
|
15
|
+
import type { Client } from "../kernel.js";
|
|
16
|
+
export interface CacheInvalidateResult {
|
|
17
|
+
/** Number of cache rows DELETEd by this call. */
|
|
18
|
+
deleted: number;
|
|
19
|
+
/** Post-increment generation for the affected (project, host). Used
|
|
20
|
+
* by the generation guard to prevent in-flight MISS renders from
|
|
21
|
+
* overwriting after invalidation. */
|
|
22
|
+
generation: string;
|
|
23
|
+
/** The host the invalidation targeted. Empty string for bulk calls
|
|
24
|
+
* that span multiple hosts. */
|
|
25
|
+
host: string;
|
|
26
|
+
/** Path targeted (single-URL form only). */
|
|
27
|
+
path?: string;
|
|
28
|
+
/** Per-host results for bulk invalidation. */
|
|
29
|
+
results?: Array<{
|
|
30
|
+
host: string;
|
|
31
|
+
deleted: number;
|
|
32
|
+
generation: string;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
export interface CacheInspectOptions {
|
|
36
|
+
/** Inspect a non-default-locale row. */
|
|
37
|
+
locale?: string;
|
|
38
|
+
/** Inspect a non-active-release row. */
|
|
39
|
+
releaseId?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface CacheInspectResult {
|
|
42
|
+
/** `HIT` when a fresh row exists; `MISS` when no fresh row.
|
|
43
|
+
* NEVER `BYPASS` — inspect doesn't issue a request. */
|
|
44
|
+
status: "HIT" | "MISS";
|
|
45
|
+
url?: string;
|
|
46
|
+
host?: string;
|
|
47
|
+
path?: string;
|
|
48
|
+
search?: string;
|
|
49
|
+
method?: string;
|
|
50
|
+
locale?: string;
|
|
51
|
+
releaseId?: string;
|
|
52
|
+
cachedAt?: string;
|
|
53
|
+
expiresAt?: string;
|
|
54
|
+
writtenUnderGeneration?: string;
|
|
55
|
+
contentSha256?: string;
|
|
56
|
+
headers?: Record<string, string | string[]>;
|
|
57
|
+
}
|
|
58
|
+
export interface CacheInvalidatePrefixOptions {
|
|
59
|
+
host: string;
|
|
60
|
+
prefix: string;
|
|
61
|
+
}
|
|
62
|
+
export interface CacheInvalidateAllOptions {
|
|
63
|
+
host: string;
|
|
64
|
+
}
|
|
65
|
+
export declare class Cache {
|
|
66
|
+
private readonly client;
|
|
67
|
+
constructor(client: Client);
|
|
68
|
+
/**
|
|
69
|
+
* Invalidate a single cached SSR response.
|
|
70
|
+
*
|
|
71
|
+
* @param url - Absolute URL (e.g., `https://eagles.kychon.com/the-guys`).
|
|
72
|
+
* The host MUST be owned by the SDK's active project;
|
|
73
|
+
* cross-project calls throw `R402_CACHE_INVALIDATION_HOST_FORBIDDEN`.
|
|
74
|
+
*/
|
|
75
|
+
invalidate(url: string | URL): Promise<CacheInvalidateResult>;
|
|
76
|
+
/**
|
|
77
|
+
* Invalidate all cache rows under a path prefix on the given host.
|
|
78
|
+
*/
|
|
79
|
+
invalidatePrefix(opts: CacheInvalidatePrefixOptions): Promise<CacheInvalidateResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Invalidate ALL cache rows for the given host. Use for catastrophic
|
|
82
|
+
* content changes (nav restructure, layout-wide update, etc.) where
|
|
83
|
+
* targeted invalidation would be impractical.
|
|
84
|
+
*/
|
|
85
|
+
invalidateAll(opts: CacheInvalidateAllOptions): Promise<CacheInvalidateResult>;
|
|
86
|
+
/**
|
|
87
|
+
* Bulk-invalidate many absolute URLs in a single round-trip. Groups
|
|
88
|
+
* by host and issues one transaction per host.
|
|
89
|
+
*/
|
|
90
|
+
invalidateMany(urls: Array<string | URL>): Promise<CacheInvalidateResult>;
|
|
91
|
+
/**
|
|
92
|
+
* Inspect the cache row state for a URL. Returns `{ status: 'HIT' | 'MISS', ... }`.
|
|
93
|
+
* Does NOT issue a request to the URL.
|
|
94
|
+
*
|
|
95
|
+
* @param url - Absolute URL.
|
|
96
|
+
* @param options - Optional `--locale` / `--release-id` overrides.
|
|
97
|
+
*/
|
|
98
|
+
inspect(url: string | URL, options?: CacheInspectOptions): Promise<CacheInspectResult>;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/namespaces/cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB;;0CAEsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB;oCACgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxE;AAED,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;4DACwD;IACxD,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IAC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