@run402/functions 1.60.3 → 1.62.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 +69 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/routed-http.d.ts +61 -0
- package/dist/routed-http.d.ts.map +1 -0
- package/dist/routed-http.js +54 -0
- package/dist/routed-http.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -145,6 +145,75 @@ const items = await adminDb().from("items").select("title, slug").order("created
|
|
|
145
145
|
|
|
146
146
|
Use `adminDb()` (not `db(req)`) here — there's no incoming request to forward.
|
|
147
147
|
|
|
148
|
+
## Routed HTTP functions
|
|
149
|
+
|
|
150
|
+
Deploy-v2 web routes can map public same-origin browser paths to functions, for example `routes: { "replace": [{ "pattern": "/api/*", "target": { "type": "function", "name": "api" } }] }`. A browser request to a routed path does **not** need a Run402 API key at the public edge. Direct `/functions/v1/:name` invocation is unchanged: it remains API-key protected and API-shaped.
|
|
151
|
+
|
|
152
|
+
Routed browser traffic invokes your function with the `run402.routed_http.v1` envelope. The gateway preserves the public URL, path, raw query, duplicate-safe lower-case headers, raw cookie header, optional base64 body, and route context. The matched prefix is not stripped from `path`.
|
|
153
|
+
|
|
154
|
+
Request fields:
|
|
155
|
+
- `version`, `method`, `url`, `path`, `rawPath`, `rawQuery`
|
|
156
|
+
- `headers: Array<[string, string]>`
|
|
157
|
+
- `cookies.raw`
|
|
158
|
+
- `body: null | { encoding: "base64"; data; size }`
|
|
159
|
+
- `context.source`, `projectId`, `releaseId`, `deploymentId`, `host`, `proto`, `routePattern`, `routeKind`, `routeTarget`, `requestId`, plus optional `clientIp` and `userAgent`
|
|
160
|
+
|
|
161
|
+
Response fields:
|
|
162
|
+
- `status` from 200 through 599
|
|
163
|
+
- optional duplicate-safe `headers`
|
|
164
|
+
- optional `cookies: string[]`, preserved as separate `Set-Cookie` headers
|
|
165
|
+
- optional base64 `body`
|
|
166
|
+
|
|
167
|
+
Helpers:
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
import {
|
|
171
|
+
routedHttp,
|
|
172
|
+
type RoutedHttpRequestV1,
|
|
173
|
+
type RoutedHttpResponseV1,
|
|
174
|
+
} from "@run402/functions";
|
|
175
|
+
|
|
176
|
+
export default async function handler(
|
|
177
|
+
event: RoutedHttpRequestV1,
|
|
178
|
+
): Promise<RoutedHttpResponseV1> {
|
|
179
|
+
if (!routedHttp.isRequest(event)) {
|
|
180
|
+
return routedHttp.json({ error: "unsupported_event" }, { status: 400 });
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (event.method === "OPTIONS") {
|
|
184
|
+
return routedHttp.text("", {
|
|
185
|
+
status: 204,
|
|
186
|
+
headers: [
|
|
187
|
+
["access-control-allow-origin", "https://app.example.com"],
|
|
188
|
+
["access-control-allow-methods", "GET, POST, OPTIONS"],
|
|
189
|
+
["access-control-allow-headers", "content-type, authorization"],
|
|
190
|
+
],
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (event.method === "POST" && !event.headers.some(([k]) => k === "x-csrf-token")) {
|
|
195
|
+
return routedHttp.json({ error: "csrf_required" }, { status: 403 });
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return routedHttp.json(
|
|
199
|
+
{ ok: true, path: event.path, query: event.rawQuery },
|
|
200
|
+
{
|
|
201
|
+
headers: [["cache-control", "private, no-store"]],
|
|
202
|
+
cookies: [
|
|
203
|
+
"sid=abc; HttpOnly; Secure; SameSite=Lax; Path=/",
|
|
204
|
+
"theme=dark; Secure; SameSite=Lax; Path=/",
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
`routedHttp.text`, `routedHttp.json`, and `routedHttp.bytes` return `RoutedHttpResponseV1`. Named `text`, `json`, `bytes`, and `isRequest` exports are also available. Redirects are ordinary 3xx responses with a `Location` header. `HEAD` responses send headers without body bytes. WebSockets, `101 Switching Protocols`, streaming, and SSE are not supported in Phase 1.
|
|
212
|
+
|
|
213
|
+
Limits and defaults: request and response bodies are capped at 6 MiB. Run402 does not add wildcard CORS. Run402 does not store routed dynamic responses in a shared cache; if your function sets no `Cache-Control`, the gateway adds `Cache-Control: private, no-store` and `x-run402-cache: dynamic-bypass`.
|
|
214
|
+
|
|
215
|
+
Security notes: application auth, authorization, sessions, OAuth callbacks, CORS, and CSRF belong in your function code. For cookie-authenticated `POST`, `PUT`, `PATCH`, or `DELETE`, validate a CSRF token or an equivalent same-site defense. Do not trust spoofable forwarding headers for authorization; prefer the typed `event.context` metadata when it is present.
|
|
216
|
+
|
|
148
217
|
## Imports auto-resolved
|
|
149
218
|
|
|
150
219
|
Inside a deployed function you can `import { ... } from "@run402/functions"` directly — the gateway bundles this library plus any `--deps` you declared at deploy time. **Do not list `@run402/functions` in your `--deps`** — it's rejected. Native binary modules (`sharp`, `canvas`, native `bcrypt`, etc.) are also rejected.
|
package/dist/index.d.ts
CHANGED
|
@@ -5,4 +5,6 @@ export { email } from "./email.js";
|
|
|
5
5
|
export type { EmailSendOptions, EmailRawOptions, EmailTemplateOptions, EmailSendResult } from "./email.js";
|
|
6
6
|
export { ai } from "./ai.js";
|
|
7
7
|
export type { TranslateOptions, TranslateResult, ModerateResult } from "./ai.js";
|
|
8
|
+
export { bytes, isRequest, json, routedHttp, text } from "./routed-http.js";
|
|
9
|
+
export type { RoutedHttpHeaderList, RoutedHttpRequestV1, RoutedHttpResponseInit, RoutedHttpResponseV1, } from "./routed-http.js";
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3G,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3G,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC5E,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,4 +2,5 @@ export { db, adminDb, QueryBuilder } from "./db.js";
|
|
|
2
2
|
export { getUser } from "./auth.js";
|
|
3
3
|
export { email } from "./email.js";
|
|
4
4
|
export { ai } from "./ai.js";
|
|
5
|
+
export { bytes, isRequest, json, routedHttp, text } from "./routed-http.js";
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type RoutedHttpHeaderList = Array<[string, string]>;
|
|
2
|
+
export interface RoutedHttpRequestV1 {
|
|
3
|
+
version: "run402.routed_http.v1";
|
|
4
|
+
method: string;
|
|
5
|
+
url: string;
|
|
6
|
+
path: string;
|
|
7
|
+
rawPath: string;
|
|
8
|
+
rawQuery: string;
|
|
9
|
+
headers: RoutedHttpHeaderList;
|
|
10
|
+
cookies: {
|
|
11
|
+
raw: string | null;
|
|
12
|
+
};
|
|
13
|
+
body: null | {
|
|
14
|
+
encoding: "base64";
|
|
15
|
+
data: string;
|
|
16
|
+
size: number;
|
|
17
|
+
};
|
|
18
|
+
context: {
|
|
19
|
+
source: "route";
|
|
20
|
+
projectId: string;
|
|
21
|
+
releaseId: string | null;
|
|
22
|
+
deploymentId: string | null;
|
|
23
|
+
host: string;
|
|
24
|
+
proto: "https" | "http";
|
|
25
|
+
routePattern: string;
|
|
26
|
+
routeKind: "exact" | "prefix";
|
|
27
|
+
routeTarget: {
|
|
28
|
+
type: "function";
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
requestId: string;
|
|
32
|
+
clientIp?: string;
|
|
33
|
+
userAgent?: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface RoutedHttpResponseV1 {
|
|
37
|
+
status: number;
|
|
38
|
+
headers?: RoutedHttpHeaderList;
|
|
39
|
+
cookies?: string[];
|
|
40
|
+
body?: null | {
|
|
41
|
+
encoding: "base64";
|
|
42
|
+
data: string;
|
|
43
|
+
size: number;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface RoutedHttpResponseInit {
|
|
47
|
+
status?: number;
|
|
48
|
+
headers?: RoutedHttpHeaderList;
|
|
49
|
+
cookies?: string[];
|
|
50
|
+
}
|
|
51
|
+
export declare function text(body: string, init?: RoutedHttpResponseInit): RoutedHttpResponseV1;
|
|
52
|
+
export declare function json(value: unknown, init?: RoutedHttpResponseInit): RoutedHttpResponseV1;
|
|
53
|
+
export declare function bytes(value: Uint8Array, init?: RoutedHttpResponseInit): RoutedHttpResponseV1;
|
|
54
|
+
export declare function isRequest(event: unknown): event is RoutedHttpRequestV1;
|
|
55
|
+
export declare const routedHttp: {
|
|
56
|
+
text: typeof text;
|
|
57
|
+
json: typeof json;
|
|
58
|
+
bytes: typeof bytes;
|
|
59
|
+
isRequest: typeof isRequest;
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=routed-http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routed-http.d.ts","sourceRoot":"","sources":["../src/routed-http.ts"],"names":[],"mapp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QAAQ,EAAE,QAAQ,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,IAAI,CAClB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,sBAA2B,GAChC,oBAAoB,CAMtB;AAED,wBAAgB,IAAI,CAClB,KAAK,EAAE,OAAO,EACd,IAAI,GAAE,sBAA2B,GAChC,oBAAoB,CAMtB;AAED,wBAAgB,KAAK,CACnB,KAAK,EAAE,UAAU,EACjB,IAAI,GAAE,sBAA2B,GAChC,oBAAoB,CAEtB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAEtE;AAED,eAAO,MAAM,UAAU;;;;;CAKtB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
export function text(body, init = {}) {
|
|
3
|
+
return withBody(Buffer.from(body, "utf8"), {
|
|
4
|
+
status: init.status,
|
|
5
|
+
headers: withDefaultContentType(init.headers, "text/plain; charset=utf-8"),
|
|
6
|
+
cookies: init.cookies,
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export function json(value, init = {}) {
|
|
10
|
+
return withBody(Buffer.from(JSON.stringify(value), "utf8"), {
|
|
11
|
+
status: init.status,
|
|
12
|
+
headers: withDefaultContentType(init.headers, "application/json; charset=utf-8"),
|
|
13
|
+
cookies: init.cookies,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export function bytes(value, init = {}) {
|
|
17
|
+
return withBody(value, init);
|
|
18
|
+
}
|
|
19
|
+
export function isRequest(event) {
|
|
20
|
+
return isRecord(event) && event.version === "run402.routed_http.v1";
|
|
21
|
+
}
|
|
22
|
+
export const routedHttp = {
|
|
23
|
+
text,
|
|
24
|
+
json,
|
|
25
|
+
bytes,
|
|
26
|
+
isRequest,
|
|
27
|
+
};
|
|
28
|
+
function withBody(value, init) {
|
|
29
|
+
const bodyBytes = value instanceof Buffer ? value : Buffer.from(value);
|
|
30
|
+
const response = {
|
|
31
|
+
status: init.status ?? 200,
|
|
32
|
+
body: {
|
|
33
|
+
encoding: "base64",
|
|
34
|
+
data: bodyBytes.toString("base64"),
|
|
35
|
+
size: bodyBytes.byteLength,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
if (init.headers !== undefined)
|
|
39
|
+
response.headers = init.headers;
|
|
40
|
+
if (init.cookies !== undefined)
|
|
41
|
+
response.cookies = init.cookies;
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
function withDefaultContentType(headers, contentType) {
|
|
45
|
+
const out = headers ? [...headers] : [];
|
|
46
|
+
const hasContentType = out.some(([name]) => name.toLowerCase() === "content-type");
|
|
47
|
+
if (!hasContentType)
|
|
48
|
+
out.unshift(["content-type", contentType]);
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
function isRecord(value) {
|
|
52
|
+
return value !== null && typeof value === "object";
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=routed-http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routed-http.js","sourceRoot":"","sources":["../src/routed-http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAmDrC,MAAM,UAAU,IAAI,CAClB,IAAY,EACZ,OAA+B,EAAE;IAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;QACzC,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,sBAAsB,CAAC,IAAI,CAAC,OAAO,EAAE,2BAA2B,CAAC;QAC1E,OAAO,EAA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IAChE,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;QAAE,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAChE,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,sBAAsB,CAC7B,OAAyC,EACzC,WAAmB;IAEnB,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACxC,MAAM,cAAc,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,cAAc,CAAC,CAAC;IACnF,IAAI,CAAC,cAAc;QAAE,GAAG,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAChE,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@run402/functions",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.62.0",
|
|
4
4
|
"description": "In-function helper library for Run402 serverless functions — db, adminDb, getUser, email, ai. Auto-bundled into deployed functions; also installable for local TypeScript autocomplete.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "tsc",
|
|
21
|
-
"test": "node --experimental-test-module-mocks --test --import tsx src/db.test.ts src/auth.test.ts"
|
|
21
|
+
"test": "node --experimental-test-module-mocks --test --import tsx src/db.test.ts src/auth.test.ts src/routed-http.test.ts"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
24
|
"node": ">=18"
|