@demiurgejs/core 0.2.0-beta.3 → 0.2.0-beta.4
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 +13 -11
- package/bin/demiurge.mjs +30 -12
- package/dist/browser/file-router.d.ts +388 -5
- package/dist/browser/file-router.d.ts.map +1 -1
- package/dist/browser/focus.d.ts +20 -0
- package/dist/browser/focus.d.ts.map +1 -0
- package/dist/browser/index.d.ts +7 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/mutation-action.d.ts +81 -0
- package/dist/browser/mutation-action.d.ts.map +1 -0
- package/dist/chunks/document-shell-CpJnFtSC.js +36 -0
- package/dist/chunks/document-shell-CpJnFtSC.js.map +1 -0
- package/dist/chunks/env-startup-DOBYWlZD.js +257 -0
- package/dist/chunks/env-startup-DOBYWlZD.js.map +1 -0
- package/dist/chunks/{image-codec-Di53WpcH.js → image-codec-BmzWnH6W.js} +2 -2
- package/dist/chunks/{image-codec-Di53WpcH.js.map → image-codec-BmzWnH6W.js.map} +1 -1
- package/dist/chunks/{images-Edar3eU1.js → images-BQ80950B.js} +99 -91
- package/dist/chunks/images-BQ80950B.js.map +1 -0
- package/dist/chunks/index-BVk9zWbe.js +832 -0
- package/dist/chunks/index-BVk9zWbe.js.map +1 -0
- package/dist/chunks/manifest-vO6c0G0W.js +19 -0
- package/dist/chunks/manifest-vO6c0G0W.js.map +1 -0
- package/dist/chunks/plugin-BQgMiHxa.js +1827 -0
- package/dist/chunks/plugin-BQgMiHxa.js.map +1 -0
- package/dist/chunks/session-store-ChModVcq.js +92 -0
- package/dist/chunks/session-store-ChModVcq.js.map +1 -0
- package/dist/chunks/static-files-ehaD1kE7.js +51 -0
- package/dist/chunks/static-files-ehaD1kE7.js.map +1 -0
- package/dist/chunks/{streaming-D0fGAuiO.js → streaming-BEbPN7Uk.js} +163 -163
- package/dist/chunks/streaming-BEbPN7Uk.js.map +1 -0
- package/dist/chunks/testing-DueXbMo4.js +4167 -0
- package/dist/chunks/testing-DueXbMo4.js.map +1 -0
- package/dist/chunks/vite-DO70kZA6.js +259 -0
- package/dist/chunks/vite-DO70kZA6.js.map +1 -0
- package/dist/cli.d.ts +17 -25
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +159 -124
- package/dist/cli.js.map +1 -1
- package/dist/config/define.d.ts +3 -0
- package/dist/config/define.d.ts.map +1 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +78 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/load.d.ts +12 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/types.d.ts +64 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/validate.d.ts +9 -0
- package/dist/config/validate.d.ts.map +1 -0
- package/dist/config/vite.d.ts +12 -0
- package/dist/config/vite.d.ts.map +1 -0
- package/dist/data/cache.d.ts +2 -0
- package/dist/data/cache.d.ts.map +1 -1
- package/dist/data/idempotency.d.ts.map +1 -1
- package/dist/deployment/testing.d.ts +25 -0
- package/dist/deployment/testing.d.ts.map +1 -0
- package/dist/deployment/testing.js +171 -0
- package/dist/deployment/testing.js.map +1 -0
- package/dist/document/hydration.d.ts +9 -0
- package/dist/document/hydration.d.ts.map +1 -1
- package/dist/document/index.d.ts +4 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/metadata.d.ts +8 -0
- package/dist/document/metadata.d.ts.map +1 -1
- package/dist/document/navigation.d.ts +28 -0
- package/dist/document/navigation.d.ts.map +1 -0
- package/dist/document/render.d.ts +3 -1
- package/dist/document/render.d.ts.map +1 -1
- package/dist/document/seo.d.ts.map +1 -1
- package/dist/edge/assets.d.ts.map +1 -1
- package/dist/edge/index.js +55 -73
- package/dist/edge/index.js.map +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1860 -691
- package/dist/index.js.map +1 -1
- package/dist/internal/testing.js +12 -12
- package/dist/kv/index.d.ts +2 -0
- package/dist/kv/index.d.ts.map +1 -1
- package/dist/kv/index.js +170 -73
- package/dist/kv/index.js.map +1 -1
- package/dist/kv/session-store.d.ts +20 -0
- package/dist/kv/session-store.d.ts.map +1 -0
- package/dist/manifest.d.ts +10 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/node/image.d.ts.map +1 -1
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +251 -178
- package/dist/node/index.js.map +1 -1
- package/dist/node/serve.d.ts +47 -0
- package/dist/node/serve.d.ts.map +1 -0
- package/dist/node/static.d.ts.map +1 -1
- package/dist/platform/fonts.d.ts.map +1 -1
- package/dist/platform/image-url.d.ts.map +1 -1
- package/dist/platform/url.d.ts +19 -0
- package/dist/platform/url.d.ts.map +1 -0
- package/dist/platform/web-vitals.d.ts.map +1 -1
- package/dist/redis/index.d.ts +2 -0
- package/dist/redis/index.d.ts.map +1 -1
- package/dist/redis/index.js +186 -69
- package/dist/redis/index.js.map +1 -1
- package/dist/redis/session-store.d.ts +9 -0
- package/dist/redis/session-store.d.ts.map +1 -0
- package/dist/route/index.d.ts +2 -2
- package/dist/route/index.d.ts.map +1 -1
- package/dist/route/mutation.d.ts +97 -0
- package/dist/route/mutation.d.ts.map +1 -0
- package/dist/route/types.d.ts +6 -1
- package/dist/route/types.d.ts.map +1 -1
- package/dist/router/manifest.d.ts +8 -0
- package/dist/router/manifest.d.ts.map +1 -1
- package/dist/router/navigation-data.d.ts +9 -1
- package/dist/router/navigation-data.d.ts.map +1 -1
- package/dist/routing/generate.d.ts +3 -0
- package/dist/routing/generate.d.ts.map +1 -1
- package/dist/routing/index.d.ts +3 -1
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/locale.d.ts +43 -0
- package/dist/routing/locale.d.ts.map +1 -0
- package/dist/routing/types.d.ts +12 -0
- package/dist/routing/types.d.ts.map +1 -1
- package/dist/security/cookie-session.d.ts +43 -0
- package/dist/security/cookie-session.d.ts.map +1 -0
- package/dist/security/csrf.d.ts +1 -1
- package/dist/security/csrf.d.ts.map +1 -1
- package/dist/security/env-startup.d.ts +15 -0
- package/dist/security/env-startup.d.ts.map +1 -0
- package/dist/security/env.d.ts +25 -6
- package/dist/security/env.d.ts.map +1 -1
- package/dist/security/index.d.ts +9 -1
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/report.d.ts.map +1 -1
- package/dist/security/session-manager.d.ts +32 -0
- package/dist/security/session-manager.d.ts.map +1 -0
- package/dist/security/session-store.d.ts +51 -0
- package/dist/security/session-store.d.ts.map +1 -0
- package/dist/security/testing.d.ts +10 -0
- package/dist/security/testing.d.ts.map +1 -0
- package/dist/security/testing.js +145 -0
- package/dist/security/testing.js.map +1 -0
- package/dist/security/types.d.ts +1 -0
- package/dist/security/types.d.ts.map +1 -1
- package/dist/server/document-shell.d.ts.map +1 -1
- package/dist/server/errors.d.ts +1 -0
- package/dist/server/errors.d.ts.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/not-found.d.ts +1 -0
- package/dist/server/not-found.d.ts.map +1 -1
- package/dist/server/render-tree.d.ts.map +1 -1
- package/dist/server/request-handler.d.ts +4 -0
- package/dist/server/request-handler.d.ts.map +1 -1
- package/dist/server/request-metadata.d.ts +1 -0
- package/dist/server/request-metadata.d.ts.map +1 -1
- package/dist/server/ssr.d.ts +2 -0
- package/dist/server/ssr.d.ts.map +1 -1
- package/dist/static/index.d.ts +2 -0
- package/dist/static/index.d.ts.map +1 -1
- package/dist/static/index.js +380 -363
- package/dist/static/index.js.map +1 -1
- package/dist/static/preview.d.ts.map +1 -1
- package/dist/static/vercel.d.ts +11 -2
- package/dist/static/vercel.d.ts.map +1 -1
- package/dist/static-files.d.ts +12 -0
- package/dist/static-files.d.ts.map +1 -1
- package/dist/type-guards.d.ts +19 -0
- package/dist/type-guards.d.ts.map +1 -0
- package/dist/vite/env-boundary.d.ts +14 -0
- package/dist/vite/env-boundary.d.ts.map +1 -0
- package/dist/vite/index.d.ts +5 -3
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +22 -1560
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/plugin.d.ts +6 -1
- package/dist/vite/plugin.d.ts.map +1 -1
- package/dist/vite/policy-verification.d.ts.map +1 -1
- package/package.json +19 -6
- package/dist/chunks/document-shell-WoM8yZlR.js +0 -35
- package/dist/chunks/document-shell-WoM8yZlR.js.map +0 -1
- package/dist/chunks/images-Edar3eU1.js.map +0 -1
- package/dist/chunks/request-metadata-DaIYq4Ea.js +0 -677
- package/dist/chunks/request-metadata-DaIYq4Ea.js.map +0 -1
- package/dist/chunks/static-files-DUjHw-4H.js +0 -11
- package/dist/chunks/static-files-DUjHw-4H.js.map +0 -1
- package/dist/chunks/streaming-D0fGAuiO.js.map +0 -1
- package/dist/chunks/testing-CRflAw4X.js +0 -3475
- package/dist/chunks/testing-CRflAw4X.js.map +0 -1
- package/dist/route/action.d.ts +0 -33
- package/dist/route/action.d.ts.map +0 -1
package/dist/edge/index.js
CHANGED
|
@@ -1,53 +1,35 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { c as
|
|
1
|
+
import { a as E, c as p, b as y, d as w, s as S } from "../chunks/index-BVk9zWbe.js";
|
|
2
|
+
import { c as b } from "../chunks/testing-DueXbMo4.js";
|
|
3
3
|
import { renderToReadableStream as R } from "react-dom/server";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
|
-
import { i as
|
|
7
|
-
import { c as
|
|
8
|
-
const
|
|
9
|
-
".avif": "image/avif",
|
|
10
|
-
".css": "text/css; charset=utf-8",
|
|
11
|
-
".gif": "image/gif",
|
|
12
|
-
".html": "text/html; charset=utf-8",
|
|
13
|
-
".ico": "image/x-icon",
|
|
14
|
-
".jpeg": "image/jpeg",
|
|
15
|
-
".jpg": "image/jpeg",
|
|
16
|
-
".js": "text/javascript; charset=utf-8",
|
|
17
|
-
".json": "application/json; charset=utf-8",
|
|
18
|
-
".mjs": "text/javascript; charset=utf-8",
|
|
19
|
-
".png": "image/png",
|
|
20
|
-
".svg": "image/svg+xml",
|
|
21
|
-
".txt": "text/plain; charset=utf-8",
|
|
22
|
-
".webmanifest": "application/manifest+json",
|
|
23
|
-
".webp": "image/webp",
|
|
24
|
-
".woff": "font/woff",
|
|
25
|
-
".woff2": "font/woff2"
|
|
26
|
-
}, P = /* @__PURE__ */ new Set([
|
|
6
|
+
import { i as L, I as v, R as A, c as T } from "../chunks/static-files-ehaD1kE7.js";
|
|
7
|
+
import { c as P } from "../chunks/document-shell-CpJnFtSC.js";
|
|
8
|
+
const C = /* @__PURE__ */ new Set([
|
|
27
9
|
"/demiurge-manifest.json",
|
|
28
10
|
"/index.html"
|
|
29
11
|
]);
|
|
30
|
-
function
|
|
31
|
-
const t = e.immutable ??
|
|
12
|
+
function O(e) {
|
|
13
|
+
const t = e.immutable ?? L, r = M(e.prefix), c = /* @__PURE__ */ new Map();
|
|
32
14
|
for (const [o, n] of Object.entries(e.assets)) {
|
|
33
|
-
const a =
|
|
34
|
-
if (
|
|
15
|
+
const a = h(o);
|
|
16
|
+
if (C.has(a))
|
|
35
17
|
continue;
|
|
36
|
-
const s =
|
|
37
|
-
|
|
18
|
+
const s = x(n.body);
|
|
19
|
+
c.set(a, {
|
|
38
20
|
body: s,
|
|
39
|
-
cacheControl: n.immutable ?? t(
|
|
40
|
-
contentType: n.contentType ??
|
|
41
|
-
etag:
|
|
21
|
+
cacheControl: n.immutable ?? t(m(a)) ? v : A,
|
|
22
|
+
contentType: n.contentType ?? N(a),
|
|
23
|
+
etag: D(s)
|
|
42
24
|
});
|
|
43
25
|
}
|
|
44
26
|
return async function(n) {
|
|
45
27
|
if (n.method !== "GET" && n.method !== "HEAD")
|
|
46
28
|
return null;
|
|
47
|
-
const a =
|
|
29
|
+
const a = I(r, new URL(n.url).pathname), s = a === null ? void 0 : c.get(a);
|
|
48
30
|
if (!s)
|
|
49
31
|
return null;
|
|
50
|
-
const
|
|
32
|
+
const i = new Headers({
|
|
51
33
|
"cache-control": s.cacheControl,
|
|
52
34
|
"content-length": String(s.body.byteLength),
|
|
53
35
|
"content-type": s.contentType,
|
|
@@ -55,25 +37,25 @@ function C(e) {
|
|
|
55
37
|
etag: s.etag,
|
|
56
38
|
"x-content-type-options": "nosniff"
|
|
57
39
|
});
|
|
58
|
-
return
|
|
40
|
+
return H(n, s.etag) ? (i.delete("content-length"), i.delete("content-type"), new Response(null, { headers: i, status: 304 })) : n.method === "HEAD" ? new Response(null, { headers: i }) : new Response(s.body, { headers: i });
|
|
59
41
|
};
|
|
60
42
|
}
|
|
61
|
-
function
|
|
43
|
+
function D(e) {
|
|
62
44
|
let t = 2166136261;
|
|
63
45
|
for (const r of e)
|
|
64
46
|
t = Math.imul(t ^ r, 16777619) >>> 0;
|
|
65
47
|
return `W/"${e.byteLength.toString(16)}-${t.toString(16)}"`;
|
|
66
48
|
}
|
|
67
|
-
function
|
|
49
|
+
function H(e, t) {
|
|
68
50
|
const r = e.headers.get("if-none-match");
|
|
69
51
|
return r === null ? !1 : r.trim() === "*" || r.split(",").some(
|
|
70
|
-
(
|
|
52
|
+
(c) => f(c) === f(t)
|
|
71
53
|
);
|
|
72
54
|
}
|
|
73
55
|
function f(e) {
|
|
74
56
|
return e.trim().replace(/^W\//i, "");
|
|
75
57
|
}
|
|
76
|
-
function
|
|
58
|
+
function I(e, t) {
|
|
77
59
|
let r;
|
|
78
60
|
try {
|
|
79
61
|
r = decodeURIComponent(t);
|
|
@@ -85,34 +67,34 @@ function D(e, t) {
|
|
|
85
67
|
return null;
|
|
86
68
|
r = r.slice(e.length - 1);
|
|
87
69
|
}
|
|
88
|
-
return
|
|
70
|
+
return h(r);
|
|
89
71
|
}
|
|
90
|
-
function
|
|
72
|
+
function h(e) {
|
|
91
73
|
return e.startsWith("/") ? e : `/${e}`;
|
|
92
74
|
}
|
|
93
|
-
function
|
|
75
|
+
function M(e) {
|
|
94
76
|
return !e || e === "/" ? "" : `/${e.replace(/^\/|\/$/g, "")}/`;
|
|
95
77
|
}
|
|
96
|
-
function
|
|
78
|
+
function x(e) {
|
|
97
79
|
if (typeof e == "string")
|
|
98
80
|
return new TextEncoder().encode(e);
|
|
99
81
|
const t = ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e), r = new Uint8Array(t.byteLength);
|
|
100
82
|
return r.set(t), r;
|
|
101
83
|
}
|
|
102
|
-
function
|
|
84
|
+
function m(e) {
|
|
103
85
|
return e.slice(e.lastIndexOf("/") + 1);
|
|
104
86
|
}
|
|
105
|
-
function
|
|
106
|
-
const t =
|
|
107
|
-
return
|
|
87
|
+
function N(e) {
|
|
88
|
+
const t = m(e), r = t.lastIndexOf("."), c = r === -1 ? "" : t.slice(r);
|
|
89
|
+
return T(c);
|
|
108
90
|
}
|
|
109
|
-
function
|
|
110
|
-
return e.render.mode === "streaming" ?
|
|
91
|
+
function U(e, t = {}) {
|
|
92
|
+
return e.render.mode === "streaming" ? _(e, t) : E(e, t);
|
|
111
93
|
}
|
|
112
|
-
async function
|
|
94
|
+
async function _(e, t = {}) {
|
|
113
95
|
if (t.signal?.aborted)
|
|
114
96
|
throw t.signal.reason;
|
|
115
|
-
const r =
|
|
97
|
+
const r = p(e, t), c = y(e, r), o = new AbortController();
|
|
116
98
|
let n = !1;
|
|
117
99
|
const a = () => {
|
|
118
100
|
o.abort(
|
|
@@ -122,7 +104,7 @@ async function U(e, t = {}) {
|
|
|
122
104
|
t.signal?.addEventListener("abort", a, { once: !0 });
|
|
123
105
|
let s;
|
|
124
106
|
try {
|
|
125
|
-
s = await R(
|
|
107
|
+
s = await R(c, {
|
|
126
108
|
nonce: t.nonce,
|
|
127
109
|
onError(l) {
|
|
128
110
|
n && !o.signal.aborted && t.onStreamError?.(l);
|
|
@@ -133,21 +115,21 @@ async function U(e, t = {}) {
|
|
|
133
115
|
throw t.signal?.removeEventListener("abort", a), l;
|
|
134
116
|
}
|
|
135
117
|
s.allReady.catch(u);
|
|
136
|
-
let
|
|
118
|
+
let i;
|
|
137
119
|
try {
|
|
138
|
-
|
|
120
|
+
i = await P(e, {
|
|
139
121
|
...t,
|
|
140
122
|
scripts: r.scripts()
|
|
141
123
|
});
|
|
142
124
|
} catch (l) {
|
|
143
125
|
throw t.signal?.removeEventListener("abort", a), a(), await s.cancel().catch(u), l;
|
|
144
126
|
}
|
|
145
|
-
return r.flushHead(), n = !0, new Response(
|
|
127
|
+
return r.flushHead(), n = !0, new Response(j(s, i, a), {
|
|
146
128
|
headers: { "content-type": "text/html; charset=utf-8" }
|
|
147
129
|
});
|
|
148
130
|
}
|
|
149
|
-
function
|
|
150
|
-
const
|
|
131
|
+
function j(e, t, r) {
|
|
132
|
+
const c = new TextEncoder(), o = e.getReader();
|
|
151
133
|
return new ReadableStream({
|
|
152
134
|
async cancel(n) {
|
|
153
135
|
r(), await o.cancel(n).catch(u);
|
|
@@ -161,13 +143,13 @@ function _(e, t, r) {
|
|
|
161
143
|
return;
|
|
162
144
|
}
|
|
163
145
|
if (a.done) {
|
|
164
|
-
n.enqueue(
|
|
146
|
+
n.enqueue(c.encode(t.suffix)), n.close();
|
|
165
147
|
return;
|
|
166
148
|
}
|
|
167
149
|
n.enqueue(a.value);
|
|
168
150
|
},
|
|
169
151
|
start(n) {
|
|
170
|
-
n.enqueue(
|
|
152
|
+
n.enqueue(c.encode(t.prefix));
|
|
171
153
|
}
|
|
172
154
|
});
|
|
173
155
|
}
|
|
@@ -200,18 +182,18 @@ function V() {
|
|
|
200
182
|
}
|
|
201
183
|
};
|
|
202
184
|
}
|
|
203
|
-
const B =
|
|
185
|
+
const B = w({
|
|
204
186
|
name: "edge",
|
|
205
187
|
capabilities: {
|
|
206
188
|
crossOriginIsolationHeaders: !0,
|
|
207
189
|
nonceInjection: !0,
|
|
208
190
|
streaming: !0
|
|
209
191
|
}
|
|
210
|
-
}), d = "unavailable",
|
|
192
|
+
}), d = "unavailable", F = {
|
|
211
193
|
app: "demiurge-edge",
|
|
212
194
|
environment: "unavailable",
|
|
213
195
|
schemaVersion: 1
|
|
214
|
-
},
|
|
196
|
+
}, W = [
|
|
215
197
|
"GET",
|
|
216
198
|
"POST",
|
|
217
199
|
"PUT",
|
|
@@ -221,27 +203,27 @@ const B = y({
|
|
|
221
203
|
"HEAD"
|
|
222
204
|
];
|
|
223
205
|
function ne(e) {
|
|
224
|
-
const t =
|
|
206
|
+
const t = z(e.cacheStore), r = G(e.rateLimitStore);
|
|
225
207
|
e.rateLimitStore === d && e.routeModules && J(e.routeModules);
|
|
226
|
-
const
|
|
208
|
+
const c = K(e.assets), o = b({
|
|
227
209
|
adapter: B,
|
|
228
210
|
cacheStore: t,
|
|
229
211
|
onError: e.onError,
|
|
230
212
|
rateLimitStore: r,
|
|
231
|
-
renderPage: e.renderPage ??
|
|
213
|
+
renderPage: e.renderPage ?? U,
|
|
232
214
|
routeModules: e.routeModules,
|
|
233
215
|
routes: e.routes,
|
|
234
216
|
ssr: e.ssr
|
|
235
217
|
});
|
|
236
218
|
return async function(a) {
|
|
237
219
|
const s = e.clientIp?.(a);
|
|
238
|
-
return s &&
|
|
220
|
+
return s && S(a, { clientIp: s }), await c?.(a) ?? await o(a);
|
|
239
221
|
};
|
|
240
222
|
}
|
|
241
|
-
function
|
|
223
|
+
function z(e) {
|
|
242
224
|
if (e === d)
|
|
243
225
|
return {
|
|
244
|
-
namespace:
|
|
226
|
+
namespace: F,
|
|
245
227
|
store: q()
|
|
246
228
|
};
|
|
247
229
|
if (!e || typeof e.store != "object")
|
|
@@ -261,7 +243,7 @@ function G(e) {
|
|
|
261
243
|
}
|
|
262
244
|
function J(e) {
|
|
263
245
|
for (const [t, r] of Object.entries(e))
|
|
264
|
-
if (r.policy?.security?.rateLimit ??
|
|
246
|
+
if (r.policy?.security?.rateLimit ?? W.map((o) => r[o]).find(
|
|
265
247
|
(o) => o && o.kind !== "page" && o.security?.rateLimit
|
|
266
248
|
))
|
|
267
249
|
throw new Error(
|
|
@@ -270,17 +252,17 @@ function J(e) {
|
|
|
270
252
|
}
|
|
271
253
|
function K(e) {
|
|
272
254
|
if (e)
|
|
273
|
-
return typeof e == "function" ? e :
|
|
255
|
+
return typeof e == "function" ? e : O(e);
|
|
274
256
|
}
|
|
275
257
|
export {
|
|
276
258
|
d as EDGE_SHARED_STORE_UNAVAILABLE,
|
|
277
259
|
g as EdgeSharedStoreError,
|
|
278
|
-
|
|
260
|
+
O as createEdgeAssetHandler,
|
|
279
261
|
ne as createEdgeRequestHandler,
|
|
280
262
|
q as createUnavailableCacheStore,
|
|
281
263
|
V as createUnavailableRateLimitStore,
|
|
282
264
|
B as edgeAdapter,
|
|
283
|
-
|
|
284
|
-
|
|
265
|
+
U as renderEdgePageResponse,
|
|
266
|
+
_ as renderEdgeStreamingPageResponse
|
|
285
267
|
};
|
|
286
268
|
//# sourceMappingURL=index.js.map
|
package/dist/edge/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/edge/assets.ts","../../src/edge/streaming.ts","../../src/edge/stores.ts","../../src/edge/index.ts"],"sourcesContent":["import {\n IMMUTABLE_FILE_CACHE_CONTROL,\n isContentHashedFileName,\n REVALIDATED_FILE_CACHE_CONTROL,\n} from \"../static-files\";\n\n// An edge isolate has no persistent filesystem at request time, so the Node\n// root-directory boundary does not exist here. The boundary is the map\n// itself. A request can only reach a pathname the map declares, which makes\n// traversal, symbolic links, and null bytes unreachable rather than rejected.\nexport type EdgeAsset = {\n body: ArrayBuffer | ArrayBufferView | string;\n contentType?: string;\n immutable?: boolean;\n};\n\nexport type EdgeAssetMap = Readonly<Record<string, EdgeAsset>>;\n\nexport type EdgeAssetHandler = (request: Request) => Promise<Response | null>;\n\nexport type EdgeAssetHandlerOptions = {\n assets: EdgeAssetMap;\n immutable?: (fileName: string) => boolean;\n prefix?: string;\n};\n\ntype ResolvedAsset = {\n body: Uint8Array<ArrayBuffer>;\n cacheControl: string;\n contentType: string;\n etag: string;\n};\n\nconst contentTypes: Record<string, string> = {\n \".avif\": \"image/avif\",\n \".css\": \"text/css; charset=utf-8\",\n \".gif\": \"image/gif\",\n \".html\": \"text/html; charset=utf-8\",\n \".ico\": \"image/x-icon\",\n \".jpeg\": \"image/jpeg\",\n \".jpg\": \"image/jpeg\",\n \".js\": \"text/javascript; charset=utf-8\",\n \".json\": \"application/json; charset=utf-8\",\n \".mjs\": \"text/javascript; charset=utf-8\",\n \".png\": \"image/png\",\n \".svg\": \"image/svg+xml\",\n \".txt\": \"text/plain; charset=utf-8\",\n \".webmanifest\": \"application/manifest+json\",\n \".webp\": \"image/webp\",\n \".woff\": \"font/woff\",\n \".woff2\": \"font/woff2\",\n};\n\n// The framework build output is never a public asset. The route pipeline owns\n// the shell document and applies the policy headers, and the manifest\n// describes the deployment rather than serving it.\nconst excludedPathnames = new Set([\n \"/demiurge-manifest.json\",\n \"/index.html\",\n]);\n\nexport function createEdgeAssetHandler(\n options: EdgeAssetHandlerOptions,\n): EdgeAssetHandler {\n const isImmutable = options.immutable ?? isContentHashedFileName;\n const prefix = normalizePrefix(options.prefix);\n const assets = new Map<string, ResolvedAsset>();\n\n for (const [pathname, asset] of Object.entries(options.assets)) {\n const normalized = normalizePathname(pathname);\n\n if (excludedPathnames.has(normalized)) {\n continue;\n }\n\n const body = toBytes(asset.body);\n assets.set(normalized, {\n body,\n cacheControl: (asset.immutable ?? isImmutable(fileNameOf(normalized)))\n ? IMMUTABLE_FILE_CACHE_CONTROL\n : REVALIDATED_FILE_CACHE_CONTROL,\n contentType: asset.contentType ?? contentTypeOf(normalized),\n etag: createEtag(body),\n });\n }\n\n return async function handleEdgeAsset(request) {\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n return null;\n }\n\n const pathname = resolvePathname(prefix, new URL(request.url).pathname);\n const asset = pathname === null ? undefined : assets.get(pathname);\n\n if (!asset) {\n return null;\n }\n\n const headers = new Headers({\n \"cache-control\": asset.cacheControl,\n \"content-length\": String(asset.body.byteLength),\n \"content-type\": asset.contentType,\n \"cross-origin-resource-policy\": \"same-origin\",\n etag: asset.etag,\n \"x-content-type-options\": \"nosniff\",\n });\n\n if (isNotModified(request, asset.etag)) {\n headers.delete(\"content-length\");\n headers.delete(\"content-type\");\n\n return new Response(null, { headers, status: 304 });\n }\n\n if (request.method === \"HEAD\") {\n return new Response(null, { headers });\n }\n\n return new Response(asset.body, { headers });\n };\n}\n\n// A bundled asset has no modification time, so the validator comes from the\n// bytes. FNV-1a over the body with the byte length keeps the value stable\n// across isolates and across deployments of the same build.\nfunction createEtag(body: Uint8Array) {\n let hash = 0x811c9dc5;\n\n for (const byte of body) {\n hash = Math.imul(hash ^ byte, 0x01000193) >>> 0;\n }\n\n return `W/\"${body.byteLength.toString(16)}-${hash.toString(16)}\"`;\n}\n\nfunction isNotModified(request: Request, etag: string) {\n const ifNoneMatch = request.headers.get(\"if-none-match\");\n\n if (ifNoneMatch === null) {\n return false;\n }\n\n return ifNoneMatch.trim() === \"*\" || ifNoneMatch.split(\",\").some(\n (candidate) => weakEtagValue(candidate) === weakEtagValue(etag),\n );\n}\n\nfunction weakEtagValue(value: string) {\n return value.trim().replace(/^W\\//i, \"\");\n}\n\nfunction resolvePathname(prefix: string, pathname: string) {\n let decoded: string;\n\n try {\n decoded = decodeURIComponent(pathname);\n } catch {\n return null;\n }\n\n if (prefix) {\n if (!decoded.startsWith(prefix)) {\n return null;\n }\n\n decoded = decoded.slice(prefix.length - 1);\n }\n\n return normalizePathname(decoded);\n}\n\nfunction normalizePathname(pathname: string) {\n return pathname.startsWith(\"/\") ? pathname : `/${pathname}`;\n}\n\nfunction normalizePrefix(prefix: string | undefined) {\n if (!prefix || prefix === \"/\") {\n return \"\";\n }\n\n return `/${prefix.replace(/^\\/|\\/$/g, \"\")}/`;\n}\n\n// The handler owns its copy of every body. A caller that reuses the buffer it\n// passed in cannot change what a later request receives.\nfunction toBytes(body: EdgeAsset[\"body\"]): Uint8Array<ArrayBuffer> {\n if (typeof body === \"string\") {\n return new TextEncoder().encode(body);\n }\n\n const view = ArrayBuffer.isView(body)\n ? new Uint8Array(body.buffer, body.byteOffset, body.byteLength)\n : new Uint8Array(body);\n const bytes = new Uint8Array(view.byteLength);\n bytes.set(view);\n\n return bytes;\n}\n\nfunction fileNameOf(pathname: string) {\n return pathname.slice(pathname.lastIndexOf(\"/\") + 1);\n}\n\nfunction contentTypeOf(pathname: string) {\n const fileName = fileNameOf(pathname);\n const dot = fileName.lastIndexOf(\".\");\n const extension = dot === -1 ? \"\" : fileName.slice(dot).toLowerCase();\n\n return contentTypes[extension] ?? \"application/octet-stream\";\n}\n","import { renderToReadableStream } from \"react-dom/server\";\nimport type { LoadedRouteMatch } from \"../router\";\nimport {\n createDocumentShell,\n type DocumentShell,\n} from \"../server/document-shell\";\nimport {\n createPageRenderTree,\n createPageScriptContext,\n} from \"../server/render-tree\";\nimport { renderPageResponse, type SsrRenderOptions } from \"../server/ssr\";\n\nexport function renderEdgePageResponse(\n match: LoadedRouteMatch,\n options: SsrRenderOptions = {},\n) {\n return match.render.mode === \"streaming\"\n ? renderEdgeStreamingPageResponse(match, options)\n : renderPageResponse(match, options);\n}\n\n// An edge runtime has no Node stream. React renders into a Web\n// ReadableStream, and the document shell is added around it with a second\n// Web stream. Nothing in this path touches a Node built-in.\nexport async function renderEdgeStreamingPageResponse(\n match: LoadedRouteMatch,\n options: SsrRenderOptions = {},\n): Promise<Response> {\n if (options.signal?.aborted) {\n throw options.signal.reason;\n }\n\n const scripts = createPageScriptContext(match, options);\n const content = createPageRenderTree(match, scripts);\n const renderAbort = new AbortController();\n let committed = false;\n const abortRender = () => {\n renderAbort.abort(\n options.signal?.reason ??\n new Error(\"Demiurge streaming response was cancelled.\"),\n );\n };\n\n options.signal?.addEventListener(\"abort\", abortRender, { once: true });\n\n let stream: Awaited<ReturnType<typeof renderToReadableStream>>;\n\n try {\n stream = await renderToReadableStream(content, {\n nonce: options.nonce,\n onError(error) {\n if (committed && !renderAbort.signal.aborted) {\n options.onStreamError?.(error);\n }\n },\n signal: renderAbort.signal,\n });\n } catch (error) {\n options.signal?.removeEventListener(\"abort\", abortRender);\n throw error;\n }\n\n // A cancelled render rejects this promise, and nothing else awaits it. An\n // unhandled rejection would fault the isolate instead of the response.\n stream.allReady.catch(ignoreRejection);\n\n let shell: DocumentShell;\n\n try {\n shell = await createDocumentShell(match, {\n ...options,\n scripts: scripts.scripts(),\n });\n } catch (error) {\n options.signal?.removeEventListener(\"abort\", abortRender);\n abortRender();\n await stream.cancel().catch(ignoreRejection);\n throw error;\n }\n\n scripts.flushHead();\n committed = true;\n\n return new Response(withDocumentShell(stream, shell, abortRender), {\n headers: { \"content-type\": \"text/html; charset=utf-8\" },\n });\n}\n\nexport function withDocumentShell(\n body: ReadableStream<Uint8Array>,\n shell: DocumentShell,\n onCancel: () => void,\n): ReadableStream<Uint8Array> {\n const encoder = new TextEncoder();\n const reader = body.getReader();\n\n return new ReadableStream<Uint8Array>({\n async cancel(reason) {\n onCancel();\n await reader.cancel(reason).catch(ignoreRejection);\n },\n async pull(controller) {\n let chunk: ReadableStreamReadResult<Uint8Array>;\n\n try {\n chunk = await reader.read();\n } catch (error) {\n controller.error(error);\n return;\n }\n\n if (chunk.done) {\n controller.enqueue(encoder.encode(shell.suffix));\n controller.close();\n return;\n }\n\n controller.enqueue(chunk.value);\n },\n start(controller) {\n controller.enqueue(encoder.encode(shell.prefix));\n },\n });\n}\n\n// A cancelled render rejects more than one promise, and none of them is a\n// request failure. The rejection is absorbed rather than logged.\nfunction ignoreRejection() {}\n","import type { CacheStore } from \"../data/cache\";\nimport type { RateLimitStore } from \"../security/types\";\n\n// An edge deployment runs many isolates, and an isolate keeps its memory to\n// itself. An in-memory store therefore counts one client in several buckets\n// and caches one value several times. That reads as a working store and is not\n// one. These stores refuse the operation instead.\nexport class EdgeSharedStoreError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"EdgeSharedStoreError\";\n }\n}\n\nconst cacheStoreMessage =\n 'Demiurge edge deployments have no shared cache store. This handler declares cacheStore \"unavailable\", so a \"build\", \"private\", or \"public\" cache scope cannot run. Pass a shared CacheStore, or keep the cache scope at \"request\".';\n\nconst rateLimitStoreMessage =\n 'Demiurge edge deployments have no shared rate limit store. This handler declares rateLimitStore \"unavailable\", so a rate limit policy cannot be enforced. Pass a shared RateLimitStore, or remove the rate limit policy.';\n\nexport function createUnavailableCacheStore(): CacheStore {\n const refuse = (): never => {\n throw new EdgeSharedStoreError(cacheStoreMessage);\n };\n\n return {\n acquireRefreshLease: refuse,\n delete: refuse,\n get: refuse,\n invalidateTags: refuse,\n publishRefresh: refuse,\n releaseRefreshLease: refuse,\n set: refuse,\n };\n}\n\nexport function createUnavailableRateLimitStore(): RateLimitStore {\n return {\n increment() {\n throw new EdgeSharedStoreError(rateLimitStoreMessage);\n },\n };\n}\n","import { defineAdapter } from \"../adapter\";\nimport type { HttpMethod, RouteModule } from \"../route\";\nimport { setRequestConnectionMetadata } from \"../server/request-metadata\";\nimport {\n createRequestHandler,\n type RequestCacheStoreOptions,\n type RequestHandler,\n type RequestHandlerOptions,\n} from \"../server\";\nimport type { RateLimitStore } from \"../security\";\nimport { createEdgeAssetHandler } from \"./assets\";\nimport type { EdgeAssetHandler, EdgeAssetHandlerOptions } from \"./assets\";\nimport { renderEdgePageResponse } from \"./streaming\";\nimport {\n createUnavailableCacheStore,\n createUnavailableRateLimitStore,\n} from \"./stores\";\n\nexport { createEdgeAssetHandler } from \"./assets\";\nexport {\n renderEdgePageResponse,\n renderEdgeStreamingPageResponse,\n} from \"./streaming\";\nexport {\n createUnavailableCacheStore,\n createUnavailableRateLimitStore,\n EdgeSharedStoreError,\n} from \"./stores\";\nexport type {\n EdgeAsset,\n EdgeAssetHandler,\n EdgeAssetHandlerOptions,\n EdgeAssetMap,\n} from \"./assets\";\n\n// The edge adapter declares only what a Web-platform runtime proves through\n// the shared adapter contract. Streaming uses a Web ReadableStream, and the\n// two header capabilities travel on the Response the handler returns.\n// Background lifetime stays false because an isolate has no shutdown to wait\n// on, and a host waitUntil call is best effort. Shared cache stays false\n// because no shared store backend ships yet. Static output belongs to the\n// static adapter.\nexport const edgeAdapter = defineAdapter({\n name: \"edge\",\n capabilities: {\n crossOriginIsolationHeaders: true,\n nonceInjection: true,\n streaming: true,\n },\n});\n\nexport const EDGE_SHARED_STORE_UNAVAILABLE = \"unavailable\";\n\nexport type EdgeCacheStoreOption =\n | RequestCacheStoreOptions\n | typeof EDGE_SHARED_STORE_UNAVAILABLE;\n\nexport type EdgeRateLimitStoreOption =\n | RateLimitStore\n | typeof EDGE_SHARED_STORE_UNAVAILABLE;\n\nexport type EdgeRequestHandlerOptions =\n & Omit<RequestHandlerOptions, \"adapter\" | \"cacheStore\" | \"rateLimitStore\">\n & {\n assets?: EdgeAssetHandler | EdgeAssetHandlerOptions;\n // Both store options are required. An omitted store is the silent\n // per-isolate default this adapter exists to prevent, so construction\n // refuses it and names the option to set.\n cacheStore: EdgeCacheStoreOption;\n // An edge host reports the client address in a header it owns, and the\n // framework does not guess which one. A rate limit keyed on \"ip\" needs\n // this function to read that header.\n clientIp?: (request: Request) => string | undefined | null;\n rateLimitStore: EdgeRateLimitStoreOption;\n };\n\nconst unavailableCacheNamespace = {\n app: \"demiurge-edge\",\n environment: \"unavailable\",\n schemaVersion: 1,\n} as const;\n\nconst httpMethods = [\n \"GET\",\n \"POST\",\n \"PUT\",\n \"PATCH\",\n \"DELETE\",\n \"OPTIONS\",\n \"HEAD\",\n] as const satisfies readonly HttpMethod[];\n\nexport function createEdgeRequestHandler(\n options: EdgeRequestHandlerOptions,\n): RequestHandler {\n const cacheStore = resolveCacheStore(options.cacheStore);\n const rateLimitStore = resolveRateLimitStore(options.rateLimitStore);\n\n if (\n options.rateLimitStore === EDGE_SHARED_STORE_UNAVAILABLE &&\n options.routeModules\n ) {\n assertNoRateLimitPolicies(options.routeModules);\n }\n\n const serveAsset = toEdgeAssetHandler(options.assets);\n const handleRequest = createRequestHandler({\n adapter: edgeAdapter,\n cacheStore,\n onError: options.onError,\n rateLimitStore,\n renderPage: options.renderPage ?? renderEdgePageResponse,\n routeModules: options.routeModules,\n routes: options.routes,\n ssr: options.ssr,\n });\n\n return async function handleEdgeRequest(request) {\n const clientIp = options.clientIp?.(request);\n\n if (clientIp) {\n setRequestConnectionMetadata(request, { clientIp });\n }\n\n const asset = await serveAsset?.(request);\n\n return asset ?? await handleRequest(request);\n };\n}\n\nfunction resolveCacheStore(\n option: EdgeCacheStoreOption | undefined,\n): RequestCacheStoreOptions {\n if (option === EDGE_SHARED_STORE_UNAVAILABLE) {\n return {\n namespace: unavailableCacheNamespace,\n store: createUnavailableCacheStore(),\n };\n }\n\n if (!option || typeof option.store !== \"object\") {\n throw new Error(\n 'Demiurge edge cacheStore is required. Pass a shared cache store, or pass \"unavailable\" to make a shared cache scope fail instead of caching per isolate.',\n );\n }\n\n return option;\n}\n\nfunction resolveRateLimitStore(\n option: EdgeRateLimitStoreOption | undefined,\n): RateLimitStore {\n if (option === EDGE_SHARED_STORE_UNAVAILABLE) {\n return createUnavailableRateLimitStore();\n }\n\n if (!option || typeof option.increment !== \"function\") {\n throw new Error(\n 'Demiurge edge rateLimitStore is required. Pass a shared rate limit store, or pass \"unavailable\" to make a rate limit policy fail instead of counting per isolate.',\n );\n }\n\n return option;\n}\n\n// A rate limit policy is visible before the first request when the caller\n// hands over the route modules. Reporting it at construction beats a 500 on\n// the request the policy was meant to protect.\nfunction assertNoRateLimitPolicies(\n modules: Readonly<Record<string, RouteModule>>,\n) {\n for (const [file, routeModule] of Object.entries(modules)) {\n const declared = routeModule.policy?.security?.rateLimit ??\n httpMethods\n .map((method) => routeModule[method])\n .find((capability) =>\n capability && capability.kind !== \"page\" && capability.security?.rateLimit\n );\n\n if (declared) {\n throw new Error(\n `Demiurge edge route ${JSON.stringify(file)} declares a rate limit policy, and this handler declares rateLimitStore \"unavailable\". Pass a shared rate limit store, or remove the policy.`,\n );\n }\n }\n}\n\nfunction toEdgeAssetHandler(\n value: EdgeAssetHandler | EdgeAssetHandlerOptions | undefined,\n) {\n if (!value) {\n return undefined;\n }\n\n return typeof value === \"function\" ? value : createEdgeAssetHandler(value);\n}\n"],"names":["contentTypes","excludedPathnames","createEdgeAssetHandler","options","isImmutable","isContentHashedFileName","prefix","normalizePrefix","assets","pathname","asset","normalized","normalizePathname","body","toBytes","fileNameOf","IMMUTABLE_FILE_CACHE_CONTROL","REVALIDATED_FILE_CACHE_CONTROL","contentTypeOf","createEtag","request","resolvePathname","headers","isNotModified","hash","byte","etag","ifNoneMatch","candidate","weakEtagValue","value","decoded","view","bytes","fileName","dot","extension","renderEdgePageResponse","match","renderEdgeStreamingPageResponse","renderPageResponse","scripts","createPageScriptContext","content","createPageRenderTree","renderAbort","committed","abortRender","stream","renderToReadableStream","error","ignoreRejection","shell","createDocumentShell","withDocumentShell","onCancel","encoder","reader","reason","controller","chunk","EdgeSharedStoreError","message","cacheStoreMessage","rateLimitStoreMessage","createUnavailableCacheStore","refuse","createUnavailableRateLimitStore","edgeAdapter","defineAdapter","EDGE_SHARED_STORE_UNAVAILABLE","unavailableCacheNamespace","httpMethods","createEdgeRequestHandler","cacheStore","resolveCacheStore","rateLimitStore","resolveRateLimitStore","assertNoRateLimitPolicies","serveAsset","toEdgeAssetHandler","handleRequest","createRequestHandler","clientIp","setRequestConnectionMetadata","option","modules","file","routeModule","method","capability"],"mappings":";;;;;;;AAiCA,MAAMA,IAAuC;AAAA,EAC3C,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AACZ,GAKMC,wBAAwB,IA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AOA,KAAU,aAAaA,IAAQ5B,EAAuB4B,CAAK;AAC3E;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/edge/assets.ts","../../src/edge/streaming.ts","../../src/edge/stores.ts","../../src/edge/index.ts"],"sourcesContent":["import {\n contentTypeForExtension,\n IMMUTABLE_FILE_CACHE_CONTROL,\n isContentHashedFileName,\n REVALIDATED_FILE_CACHE_CONTROL,\n} from \"../static-files\";\n\n// An edge isolate has no persistent filesystem at request time, so the Node\n// root-directory boundary does not exist here. The boundary is the map\n// itself. A request can only reach a pathname the map declares, which makes\n// traversal, symbolic links, and null bytes unreachable rather than rejected.\nexport type EdgeAsset = {\n body: ArrayBuffer | ArrayBufferView | string;\n contentType?: string;\n immutable?: boolean;\n};\n\nexport type EdgeAssetMap = Readonly<Record<string, EdgeAsset>>;\n\nexport type EdgeAssetHandler = (request: Request) => Promise<Response | null>;\n\nexport type EdgeAssetHandlerOptions = {\n assets: EdgeAssetMap;\n immutable?: (fileName: string) => boolean;\n prefix?: string;\n};\n\ntype ResolvedAsset = {\n body: Uint8Array<ArrayBuffer>;\n cacheControl: string;\n contentType: string;\n etag: string;\n};\n\n// The framework build output is never a public asset. The route pipeline owns\n// the shell document and applies the policy headers, and the manifest\n// describes the deployment rather than serving it.\nconst excludedPathnames = new Set([\n \"/demiurge-manifest.json\",\n \"/index.html\",\n]);\n\nexport function createEdgeAssetHandler(\n options: EdgeAssetHandlerOptions,\n): EdgeAssetHandler {\n const isImmutable = options.immutable ?? isContentHashedFileName;\n const prefix = normalizePrefix(options.prefix);\n const assets = new Map<string, ResolvedAsset>();\n\n for (const [pathname, asset] of Object.entries(options.assets)) {\n const normalized = normalizePathname(pathname);\n\n if (excludedPathnames.has(normalized)) {\n continue;\n }\n\n const body = toBytes(asset.body);\n assets.set(normalized, {\n body,\n cacheControl: (asset.immutable ?? isImmutable(fileNameOf(normalized)))\n ? IMMUTABLE_FILE_CACHE_CONTROL\n : REVALIDATED_FILE_CACHE_CONTROL,\n contentType: asset.contentType ?? contentTypeOf(normalized),\n etag: createEtag(body),\n });\n }\n\n return async function handleEdgeAsset(request) {\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n return null;\n }\n\n const pathname = resolvePathname(prefix, new URL(request.url).pathname);\n const asset = pathname === null ? undefined : assets.get(pathname);\n\n if (!asset) {\n return null;\n }\n\n const headers = new Headers({\n \"cache-control\": asset.cacheControl,\n \"content-length\": String(asset.body.byteLength),\n \"content-type\": asset.contentType,\n \"cross-origin-resource-policy\": \"same-origin\",\n etag: asset.etag,\n \"x-content-type-options\": \"nosniff\",\n });\n\n if (isNotModified(request, asset.etag)) {\n headers.delete(\"content-length\");\n headers.delete(\"content-type\");\n\n return new Response(null, { headers, status: 304 });\n }\n\n if (request.method === \"HEAD\") {\n return new Response(null, { headers });\n }\n\n return new Response(asset.body, { headers });\n };\n}\n\n// A bundled asset has no modification time, so the validator comes from the\n// bytes. FNV-1a over the body with the byte length keeps the value stable\n// across isolates and across deployments of the same build.\nfunction createEtag(body: Uint8Array) {\n let hash = 0x811c9dc5;\n\n for (const byte of body) {\n hash = Math.imul(hash ^ byte, 0x01000193) >>> 0;\n }\n\n return `W/\"${body.byteLength.toString(16)}-${hash.toString(16)}\"`;\n}\n\nfunction isNotModified(request: Request, etag: string) {\n const ifNoneMatch = request.headers.get(\"if-none-match\");\n\n if (ifNoneMatch === null) {\n return false;\n }\n\n return ifNoneMatch.trim() === \"*\" || ifNoneMatch.split(\",\").some(\n (candidate) => weakEtagValue(candidate) === weakEtagValue(etag),\n );\n}\n\nfunction weakEtagValue(value: string) {\n return value.trim().replace(/^W\\//i, \"\");\n}\n\nfunction resolvePathname(prefix: string, pathname: string) {\n let decoded: string;\n\n try {\n decoded = decodeURIComponent(pathname);\n } catch {\n return null;\n }\n\n if (prefix) {\n if (!decoded.startsWith(prefix)) {\n return null;\n }\n\n decoded = decoded.slice(prefix.length - 1);\n }\n\n return normalizePathname(decoded);\n}\n\nfunction normalizePathname(pathname: string) {\n return pathname.startsWith(\"/\") ? pathname : `/${pathname}`;\n}\n\nfunction normalizePrefix(prefix: string | undefined) {\n if (!prefix || prefix === \"/\") {\n return \"\";\n }\n\n return `/${prefix.replace(/^\\/|\\/$/g, \"\")}/`;\n}\n\n// The handler owns its copy of every body. A caller that reuses the buffer it\n// passed in cannot change what a later request receives.\nfunction toBytes(body: EdgeAsset[\"body\"]): Uint8Array<ArrayBuffer> {\n if (typeof body === \"string\") {\n return new TextEncoder().encode(body);\n }\n\n const view = ArrayBuffer.isView(body)\n ? new Uint8Array(body.buffer, body.byteOffset, body.byteLength)\n : new Uint8Array(body);\n const bytes = new Uint8Array(view.byteLength);\n bytes.set(view);\n\n return bytes;\n}\n\nfunction fileNameOf(pathname: string) {\n return pathname.slice(pathname.lastIndexOf(\"/\") + 1);\n}\n\nfunction contentTypeOf(pathname: string) {\n const fileName = fileNameOf(pathname);\n const dot = fileName.lastIndexOf(\".\");\n const extension = dot === -1 ? \"\" : fileName.slice(dot);\n\n return contentTypeForExtension(extension);\n}\n","import { renderToReadableStream } from \"react-dom/server\";\nimport type { LoadedRouteMatch } from \"../router\";\nimport {\n createDocumentShell,\n type DocumentShell,\n} from \"../server/document-shell\";\nimport {\n createPageRenderTree,\n createPageScriptContext,\n} from \"../server/render-tree\";\nimport { renderPageResponse, type SsrRenderOptions } from \"../server/ssr\";\n\nexport function renderEdgePageResponse(\n match: LoadedRouteMatch,\n options: SsrRenderOptions = {},\n) {\n return match.render.mode === \"streaming\"\n ? renderEdgeStreamingPageResponse(match, options)\n : renderPageResponse(match, options);\n}\n\n// An edge runtime has no Node stream. React renders into a Web\n// ReadableStream, and the document shell is added around it with a second\n// Web stream. Nothing in this path touches a Node built-in.\nexport async function renderEdgeStreamingPageResponse(\n match: LoadedRouteMatch,\n options: SsrRenderOptions = {},\n): Promise<Response> {\n if (options.signal?.aborted) {\n throw options.signal.reason;\n }\n\n const scripts = createPageScriptContext(match, options);\n const content = createPageRenderTree(match, scripts);\n const renderAbort = new AbortController();\n let committed = false;\n const abortRender = () => {\n renderAbort.abort(\n options.signal?.reason ??\n new Error(\"Demiurge streaming response was cancelled.\"),\n );\n };\n\n options.signal?.addEventListener(\"abort\", abortRender, { once: true });\n\n let stream: Awaited<ReturnType<typeof renderToReadableStream>>;\n\n try {\n stream = await renderToReadableStream(content, {\n nonce: options.nonce,\n onError(error) {\n if (committed && !renderAbort.signal.aborted) {\n options.onStreamError?.(error);\n }\n },\n signal: renderAbort.signal,\n });\n } catch (error) {\n options.signal?.removeEventListener(\"abort\", abortRender);\n throw error;\n }\n\n // A cancelled render rejects this promise, and nothing else awaits it. An\n // unhandled rejection would fault the isolate instead of the response.\n stream.allReady.catch(ignoreRejection);\n\n let shell: DocumentShell;\n\n try {\n shell = await createDocumentShell(match, {\n ...options,\n scripts: scripts.scripts(),\n });\n } catch (error) {\n options.signal?.removeEventListener(\"abort\", abortRender);\n abortRender();\n await stream.cancel().catch(ignoreRejection);\n throw error;\n }\n\n scripts.flushHead();\n committed = true;\n\n return new Response(withDocumentShell(stream, shell, abortRender), {\n headers: { \"content-type\": \"text/html; charset=utf-8\" },\n });\n}\n\nexport function withDocumentShell(\n body: ReadableStream<Uint8Array>,\n shell: DocumentShell,\n onCancel: () => void,\n): ReadableStream<Uint8Array> {\n const encoder = new TextEncoder();\n const reader = body.getReader();\n\n return new ReadableStream<Uint8Array>({\n async cancel(reason) {\n onCancel();\n await reader.cancel(reason).catch(ignoreRejection);\n },\n async pull(controller) {\n let chunk: ReadableStreamReadResult<Uint8Array>;\n\n try {\n chunk = await reader.read();\n } catch (error) {\n controller.error(error);\n return;\n }\n\n if (chunk.done) {\n controller.enqueue(encoder.encode(shell.suffix));\n controller.close();\n return;\n }\n\n controller.enqueue(chunk.value);\n },\n start(controller) {\n controller.enqueue(encoder.encode(shell.prefix));\n },\n });\n}\n\n// A cancelled render rejects more than one promise, and none of them is a\n// request failure. The rejection is absorbed rather than logged.\nfunction ignoreRejection() {}\n","import type { CacheStore } from \"../data/cache\";\nimport type { RateLimitStore } from \"../security/types\";\n\n// An edge deployment runs many isolates, and an isolate keeps its memory to\n// itself. An in-memory store therefore counts one client in several buckets\n// and caches one value several times. That reads as a working store and is not\n// one. These stores refuse the operation instead.\nexport class EdgeSharedStoreError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"EdgeSharedStoreError\";\n }\n}\n\nconst cacheStoreMessage =\n 'Demiurge edge deployments have no shared cache store. This handler declares cacheStore \"unavailable\", so a \"build\", \"private\", or \"public\" cache scope cannot run. Pass a shared CacheStore, or keep the cache scope at \"request\".';\n\nconst rateLimitStoreMessage =\n 'Demiurge edge deployments have no shared rate limit store. This handler declares rateLimitStore \"unavailable\", so a rate limit policy cannot be enforced. Pass a shared RateLimitStore, or remove the rate limit policy.';\n\nexport function createUnavailableCacheStore(): CacheStore {\n const refuse = (): never => {\n throw new EdgeSharedStoreError(cacheStoreMessage);\n };\n\n return {\n acquireRefreshLease: refuse,\n delete: refuse,\n get: refuse,\n invalidateTags: refuse,\n publishRefresh: refuse,\n releaseRefreshLease: refuse,\n set: refuse,\n };\n}\n\nexport function createUnavailableRateLimitStore(): RateLimitStore {\n return {\n increment() {\n throw new EdgeSharedStoreError(rateLimitStoreMessage);\n },\n };\n}\n","import { defineAdapter } from \"../adapter\";\nimport type { HttpMethod, RouteModule } from \"../route\";\nimport { setRequestConnectionMetadata } from \"../server/request-metadata\";\nimport {\n createRequestHandler,\n type RequestCacheStoreOptions,\n type RequestHandler,\n type RequestHandlerOptions,\n} from \"../server\";\nimport type { RateLimitStore } from \"../security\";\nimport { createEdgeAssetHandler } from \"./assets\";\nimport type { EdgeAssetHandler, EdgeAssetHandlerOptions } from \"./assets\";\nimport { renderEdgePageResponse } from \"./streaming\";\nimport {\n createUnavailableCacheStore,\n createUnavailableRateLimitStore,\n} from \"./stores\";\n\nexport { createEdgeAssetHandler } from \"./assets\";\nexport {\n renderEdgePageResponse,\n renderEdgeStreamingPageResponse,\n} from \"./streaming\";\nexport {\n createUnavailableCacheStore,\n createUnavailableRateLimitStore,\n EdgeSharedStoreError,\n} from \"./stores\";\nexport type {\n EdgeAsset,\n EdgeAssetHandler,\n EdgeAssetHandlerOptions,\n EdgeAssetMap,\n} from \"./assets\";\n\n// The edge adapter declares only what a Web-platform runtime proves through\n// the shared adapter contract. Streaming uses a Web ReadableStream, and the\n// two header capabilities travel on the Response the handler returns.\n// Background lifetime stays false because an isolate has no shutdown to wait\n// on, and a host waitUntil call is best effort. Shared cache stays false\n// because no shared store backend ships yet. Static output belongs to the\n// static adapter.\nexport const edgeAdapter = defineAdapter({\n name: \"edge\",\n capabilities: {\n crossOriginIsolationHeaders: true,\n nonceInjection: true,\n streaming: true,\n },\n});\n\nexport const EDGE_SHARED_STORE_UNAVAILABLE = \"unavailable\";\n\nexport type EdgeCacheStoreOption =\n | RequestCacheStoreOptions\n | typeof EDGE_SHARED_STORE_UNAVAILABLE;\n\nexport type EdgeRateLimitStoreOption =\n | RateLimitStore\n | typeof EDGE_SHARED_STORE_UNAVAILABLE;\n\nexport type EdgeRequestHandlerOptions =\n & Omit<RequestHandlerOptions, \"adapter\" | \"cacheStore\" | \"rateLimitStore\">\n & {\n assets?: EdgeAssetHandler | EdgeAssetHandlerOptions;\n // Both store options are required. An omitted store is the silent\n // per-isolate default this adapter exists to prevent, so construction\n // refuses it and names the option to set.\n cacheStore: EdgeCacheStoreOption;\n // An edge host reports the client address in a header it owns, and the\n // framework does not guess which one. A rate limit keyed on \"ip\" needs\n // this function to read that header.\n clientIp?: (request: Request) => string | undefined | null;\n rateLimitStore: EdgeRateLimitStoreOption;\n };\n\nconst unavailableCacheNamespace = {\n app: \"demiurge-edge\",\n environment: \"unavailable\",\n schemaVersion: 1,\n} as const;\n\nconst httpMethods = [\n \"GET\",\n \"POST\",\n \"PUT\",\n \"PATCH\",\n \"DELETE\",\n \"OPTIONS\",\n \"HEAD\",\n] as const satisfies readonly HttpMethod[];\n\nexport function createEdgeRequestHandler(\n options: EdgeRequestHandlerOptions,\n): RequestHandler {\n const cacheStore = resolveCacheStore(options.cacheStore);\n const rateLimitStore = resolveRateLimitStore(options.rateLimitStore);\n\n if (\n options.rateLimitStore === EDGE_SHARED_STORE_UNAVAILABLE &&\n options.routeModules\n ) {\n assertNoRateLimitPolicies(options.routeModules);\n }\n\n const serveAsset = toEdgeAssetHandler(options.assets);\n const handleRequest = createRequestHandler({\n adapter: edgeAdapter,\n cacheStore,\n onError: options.onError,\n rateLimitStore,\n renderPage: options.renderPage ?? renderEdgePageResponse,\n routeModules: options.routeModules,\n routes: options.routes,\n ssr: options.ssr,\n });\n\n return async function handleEdgeRequest(request) {\n const clientIp = options.clientIp?.(request);\n\n if (clientIp) {\n setRequestConnectionMetadata(request, { clientIp });\n }\n\n const asset = await serveAsset?.(request);\n\n return asset ?? await handleRequest(request);\n };\n}\n\nfunction resolveCacheStore(\n option: EdgeCacheStoreOption | undefined,\n): RequestCacheStoreOptions {\n if (option === EDGE_SHARED_STORE_UNAVAILABLE) {\n return {\n namespace: unavailableCacheNamespace,\n store: createUnavailableCacheStore(),\n };\n }\n\n if (!option || typeof option.store !== \"object\") {\n throw new Error(\n 'Demiurge edge cacheStore is required. Pass a shared cache store, or pass \"unavailable\" to make a shared cache scope fail instead of caching per isolate.',\n );\n }\n\n return option;\n}\n\nfunction resolveRateLimitStore(\n option: EdgeRateLimitStoreOption | undefined,\n): RateLimitStore {\n if (option === EDGE_SHARED_STORE_UNAVAILABLE) {\n return createUnavailableRateLimitStore();\n }\n\n if (!option || typeof option.increment !== \"function\") {\n throw new Error(\n 'Demiurge edge rateLimitStore is required. Pass a shared rate limit store, or pass \"unavailable\" to make a rate limit policy fail instead of counting per isolate.',\n );\n }\n\n return option;\n}\n\n// A rate limit policy is visible before the first request when the caller\n// hands over the route modules. Reporting it at construction beats a 500 on\n// the request the policy was meant to protect.\nfunction assertNoRateLimitPolicies(\n modules: Readonly<Record<string, RouteModule>>,\n) {\n for (const [file, routeModule] of Object.entries(modules)) {\n const declared = routeModule.policy?.security?.rateLimit ??\n httpMethods\n .map((method) => routeModule[method])\n .find((capability) =>\n capability && capability.kind !== \"page\" && capability.security?.rateLimit\n );\n\n if (declared) {\n throw new Error(\n `Demiurge edge route ${JSON.stringify(file)} declares a rate limit policy, and this handler declares rateLimitStore \"unavailable\". Pass a shared rate limit store, or remove the policy.`,\n );\n }\n }\n}\n\nfunction toEdgeAssetHandler(\n value: EdgeAssetHandler | EdgeAssetHandlerOptions | undefined,\n) {\n if (!value) {\n return undefined;\n }\n\n return typeof value === \"function\" ? value : createEdgeAssetHandler(value);\n}\n"],"names":["excludedPathnames","createEdgeAssetHandler","options","isImmutable","isContentHashedFileName","prefix","normalizePrefix","assets","pathname","asset","normalized","normalizePathname","body","toBytes","fileNameOf","IMMUTABLE_FILE_CACHE_CONTROL","REVALIDATED_FILE_CACHE_CONTROL","contentTypeOf","createEtag","request","resolvePathname","headers","isNotModified","hash","byte","etag","ifNoneMatch","candidate","weakEtagValue","value","decoded","view","bytes","fileName","dot","extension","contentTypeForExtension","renderEdgePageResponse","match","renderEdgeStreamingPageResponse","renderPageResponse","scripts","createPageScriptContext","content","createPageRenderTree","renderAbort","committed","abortRender","stream","renderToReadableStream","error","ignoreRejection","shell","createDocumentShell","withDocumentShell","onCancel","encoder","reader","reason","controller","chunk","EdgeSharedStoreError","message","cacheStoreMessage","rateLimitStoreMessage","createUnavailableCacheStore","refuse","createUnavailableRateLimitStore","edgeAdapter","defineAdapter","EDGE_SHARED_STORE_UNAVAILABLE","unavailableCacheNamespace","httpMethods","createEdgeRequestHandler","cacheStore","resolveCacheStore","rateLimitStore","resolveRateLimitStore","assertNoRateLimitPolicies","serveAsset","toEdgeAssetHandler","handleRequest","createRequestHandler","clientIp","setRequestConnectionMetadata","option","modules","file","routeModule","method","capability"],"mappings":";;;;;;;AAqCA,MAAMA,wBAAwB,IAAI;AAAA,EAChC;AAAA,EACA;AACF,CAAC;AAEM,SAASC,EACdC,GACkB;AAClB,QAAMC,IAAcD,EAA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|
1
|
-
export { createFileRouter, hydrateFileRouter, Link } from "./browser";
|
|
1
|
+
export { createFileRouter, createMutationAction, Form, hydrateFileRouter, Link, MutationSubmit, RouteFocusBoundary, useRouteFocusBoundary, useNavigation, useFormNavigation, useMutationAction, } from "./browser";
|
|
2
|
+
export type { FormProps, LinkProps, MutationAction, MutationActionOptions, MutationFormAction, MutationNavigationState, MutationResult, MutationSubmitProps, MutationValidation, } from "./browser";
|
|
3
|
+
export { contentTypeForExtension, DEFAULT_CONTENT_TYPE, isContentHashedFileName, } from "./static-files";
|
|
2
4
|
export { assertAdapterCapabilities, checkAdapterCapabilities, defineAdapter, } from "./adapter";
|
|
3
5
|
export { cacheNotFound, CacheNotFoundError, createCache, createInvalidation, createMemoryIdempotencyStore, createMemoryCache, createMemoryCacheStore, defineTags, isCacheNotFoundError, parseCacheDuration, query, runIdempotentMutation, serializeCacheKey, serializeCacheNamespace, serializeCacheTag, tag, } from "./data";
|
|
4
|
-
export { createFrameworkScriptUrl, defineLinks, defineMetadata, defineOgImage, defineRobots, defineScripts, defineSitemap, FRAMEWORK_TRUSTED_TYPES_POLICY, getScriptWorker, link, meta, modulePreload, preconnect, preload, resolveLinks, resolveMetadata, resolveScripts, renderOgImageResponse, renderOgImageSvg, renderRobots, renderSitemap, script, Script, startDeferredScripts, structuredData, } from "./document";
|
|
5
|
-
export { href } from "./routing";
|
|
6
|
+
export { createFrameworkScriptUrl, applyLocalizedMetadata, defineLinks, defineMetadata, defineOgImage, defineRobots, defineScripts, defineSitemap, FRAMEWORK_TRUSTED_TYPES_POLICY, getScriptWorker, link, meta, modulePreload, preconnect, preload, resolveLinks, resolveMetadata, resolveScripts, renderOgImageResponse, renderOgImageSvg, renderRobots, renderSitemap, script, Script, startDeferredScripts, structuredData, } from "./document";
|
|
7
|
+
export { applicationPathname, defineLocales, href, localeDirection, localizeHref, resolveLocale } from "./routing";
|
|
6
8
|
export { analytics, COLLECTED_WEB_VITAL_NAMES, collectWebVitals, defaultFontPath, defineFonts, defineInstrumentation, defineImages, defineWebVitals, font, fontAssetFileName, fontAssetUrl, fontLinks, fontMediaType, fontPreloadLinks, fontSources, fontStylesheetUrl, Image, isAllowedImageSource, parseImageOptimizerRequest, parseWebVitalsBeacon, planImageTransform, readWebVitalsBeacon, renderFontFaceCss, sendWebVitalsBeacon, WEB_VITAL_NAMES, WEB_VITAL_THRESHOLDS, WebVitals, webVitalRating, webVitalsPolicy, } from "./platform";
|
|
7
|
-
export { auditScriptDependencies, createCorsHeaders, createCsrfCookie, createCsrfToken, createMemoryRateLimitStore, createSecureCookie, createSecurityAudit, createSecurityHeaders, createSecurityReportHandler, cspNonce, cspHash, EnvValidationError, applyFetchMetadataVary, checkFetchMetadata, checkWebSocketOrigin, defineRoutePolicy, defineEnvSchema, defineSecurityPolicy, env, enforceCsrfProtection, enforceAllowedMethods, enforceFetchMetadataPolicy, enforceRateLimit, enforceRequestSecurity, enforceWebSocketOrigin, issueCsrfToken, mergeRoutePolicies, mergeRouteSecurityPolicies, mergeSecurityPolicies, parseCookieHeader, parseBodySize, parseRateLimitWindow, readSecureCookie, secureCookieName, security, validateEnv, validateCorsPolicy, validateRateLimitPolicy, validateSecureCookie, validateRouteModules, validateUploads, } from "./security";
|
|
8
|
-
export { createRequestHandler, handleRequestWithManifest, renderPageResponse, } from "./server";
|
|
9
|
-
export {
|
|
9
|
+
export { auditScriptDependencies, createCorsHeaders, createCsrfCookie, createCsrfToken, createEncryptedCookieSession, createMemoryRateLimitStore, createMemorySessionStore, createSecureCookie, createSignedCookieSession, createSecurityAudit, createSecurityHeaders, createSecurityReportHandler, createSessionManager, cspNonce, cspHash, EnvValidationError, applyFetchMetadataVary, checkFetchMetadata, checkWebSocketOrigin, defineRoutePolicy, defineEnvSchema, defineSecurityPolicy, deserializeEnvSchema, env, enforceCsrfProtection, enforceAllowedMethods, enforceFetchMetadataPolicy, enforceRateLimit, enforceRequestSecurity, enforceWebSocketOrigin, issueCsrfToken, mergeRoutePolicies, mergeRouteSecurityPolicies, mergeSecurityPolicies, parseCookieHeader, parseBodySize, parseRateLimitWindow, readEnv, readSecureCookie, secureCookieName, serializeEnvSchema, serializeSessionNamespace, security, SessionStoreConflictError, SessionStoreUnavailableError, unstable_resetEnvironment, unstable_startEnvironment, validateEnv, validateCorsPolicy, validateRateLimitPolicy, validateSecureCookie, validateRouteModules, validateUploads, } from "./security";
|
|
10
|
+
export { createRequestHandler, getRequestClientAddress, handleRequestWithManifest, renderPageResponse, } from "./server";
|
|
11
|
+
export { mutation, mutationInput, MUTATION_REQUEST_HEADER, MUTATION_REQUEST_VALUE, MUTATION_RESPONSE_MEDIA_TYPE, defineMiddleware, MutationValidationError, html, httpError, HttpError, HTTP_ERROR_STATUSES, isHttpError, json, jsonl, notFound, page, redirect, response, serverTiming, sse, stream, text, toResponse, webhook, } from "./route";
|
|
10
12
|
export type { Adapter, AdapterCapability, AdapterCapabilityCheck, AdapterCapabilityMap, AdapterDefinition, } from "./adapter";
|
|
11
|
-
export type {
|
|
13
|
+
export type { MutationContext, MutationCapability, MutationIdempotency, MutationInput, MutationMethod, MutationMethodsOf, MutationOptions, MutationRevalidation, MutationRevalidationDeclaration, MutationValidationIssue, HttpErrorDetails, HttpErrorInit, HttpErrorStatus, } from "./route";
|
|
12
14
|
export type { RequestCacheStoreOptions } from "./server";
|
|
13
15
|
export type { Cache, CacheDuration, CacheKey, CacheKeyPart, CacheRequest, CacheScope, CacheNamespace, CacheStore, CacheStoreEntry, CacheTag, CreateCacheOptions, Invalidation, InvalidationResult, IdempotencyRequest, IdempotencyResult, IdempotencyStore, Query, QueryDefinition, MemoryCacheOptions, MemoryCacheStoreOptions, MemoryIdempotencyStoreOptions, } from "./data";
|
|
14
16
|
export type { DeferredScriptStrategy, DocumentMetadataTag, LinkTag, LinkContribution, Metadata, MetadataTitle, MetaTag, OgImage, OpenGraphMetadata, ResolvedMetadata, Robots, RobotsDirective, RobotsMetadata, PreconnectOptions, PreloadOptions, ScriptContribution, ScriptCspNeeds, ScriptProps, ScriptStrategy, ScriptTag, Sitemap, SitemapAlternate, SitemapChangeFrequency, SitemapEntry, StructuredDataTag, StructuredDataValue, } from "./document";
|
|
15
17
|
export type { AnalyticsConsent, AnalyticsIntegration, AnalyticsProvider, CollectWebVitalsOptions, FontContribution, FontDefinition, FontFormat, FontStyle, GoogleFontOptions, Instrumentation, InstrumentationEvent, InstrumentationHandler, InstrumentationOptions, ImageFormat, ImageLoader, ImagePolicy, ImageProps, ImageRequestRejection, ImageRequestResult, ImageTransformOptions, ImageTransformPlan, ImageVariant, ImageVariantDescriptor, LocalFontOptions, PlausibleAnalytics, PlausibleAnalyticsOptions, ReadWebVitalsBeaconOptions, SentryAnalytics, SentryAnalyticsOptions, RemoteImagePattern, ObservabilityValue, OpenTelemetryAnalytics, OpenTelemetryAnalyticsOptions, RequestSignal, ServerStartSignal, TraceSignal, WebVitalName, WebVitalNavigationType, WebVitalRating, WebVitalReport, WebVitalSignal, WebVitalsBeacon, WebVitalsBeaconRejection, WebVitalsBeaconResult, WebVitalsIntegration, WebVitalsOptions, WebVitalsProps, WebVitalsTransport, } from "./platform";
|
|
16
18
|
export type { InitialRouteData } from "./router";
|
|
17
|
-
export type { AppHref, AppPath, LinkTarget, LinkTo, PathValue, PathVarsFor, RouteParamsFor, RouteConcretePaths, RoutePathVars, RouteRequestContexts, } from "./routing";
|
|
18
|
-
export type { HydrateFileRouterOptions } from "./browser";
|
|
19
|
+
export type { AppLocale, AppHref, AppPath, LinkTarget, LinkTo, MutationDataFor, MutationFieldsFor, MutationMethodFor, MutationRoute, PathValue, PathVarsFor, RouteParamsFor, RouteConcretePaths, RoutePathVars, RouteRequestContexts, RouteMutationMethods, LocaleConfiguration, LocaleResolution, LocaleResolver, LocaleResolverInput, LocaleSource, RouteLocales, } from "./routing";
|
|
20
|
+
export type { FileRouterOptions, HydrateFileRouterOptions, NavigationAccessibility, NavigationCommit, NavigationScrollContext, NavigationScrollOption, RouteFocusBoundaryElement, RouteFocusBoundaryProps, } from "./browser";
|
|
19
21
|
export type { SsrOptions, SsrRenderOptions } from "./server";
|
|
20
22
|
export type { HtmlCapability, HttpMethod, HttpRouteContext, JsonCapability, JsonLinesCapability, JsonLinesSource, LayoutProps, MaybePromise, NotFoundCapability, NotFoundProps, PageDataContext, PageDataFunction, PageCapability, PageOptions, PageRenderMode, PageRenderOptions, PathVars, RawResponseCapability, RedirectCapability, ResponseOptions, ResponseCapability, RouteCapability, RouteContext, RouteErrorProps, RouteImporter, RouteDefaultComponent, RouteMiddleware, RouteMiddlewareNext, MiddlewareContextContribution, MiddlewareContextOf, RouteRequestContextFor, RequestContext, RouteModule, RouteProps, RouteValue, ServerSentEvent, ServerSentEventSource, ServerSentEventsCapability, ServerTimingInput, ServerTimingMetric, StaticPath, StaticPathsContext, StaticPathsFunction, StreamCapability, StreamChunk, StreamSource, TextCapability, WebhookHmacAlgorithm, WebhookHmacContext, WebhookHmacEncoding, WebhookHmacOptions, } from "./route";
|
|
21
|
-
export type { ContentSecurityPolicy, CookieIssue, CookieIssueCode, CookieSameSite, CookieScope, CorsPolicy, CorsRequestContext, CorsResponseOptions, CsrfCookieOptions, CsrfPolicy, CspHashAlgorithm, CspDirectiveValue, CspDirectiveReplacement, CspSource, CspSourceDirective, EnvSchema, EnvSource, EnvValidationIssue, EnvVariable, FetchMetadataCheck, FetchMetadataDestination, FetchMetadataEnforcement, FetchMetadataPolicy, FetchMetadataPolicyOptions, FetchMetadataReason, InferEnvSchema, IssuedCsrfToken, MemoryRateLimitStoreOptions, RateLimitKey, RateLimitPolicy, RateLimitResult, RateLimitStore, ReferrerPolicy, ReportingEndpointUrl, ReportingEndpoints, SecurityAudit, SecurityAuditFinding, SecurityAuditOptions, ScriptDependencyAuditOptions, SecurityReportContext, SecurityReportHandlerOptions, SecurityReportPayload, RequestSecurityPolicy, RoutePolicy, RouteModuleVerificationOptions, RouteSecurityNeeds, RouteSecurityPolicy, SecureCookieDeclaration, SecureCookieDefinition, SecurityHeadersOptions, SecurityHeaderPolicy, SecurityPolicy, SecurityPreset, StrictTransportSecurityPolicy, TrustedTypesPolicy, UploadFilePolicy, UploadPolicy, UploadValidationIssue, UploadValidationResult, WebSocketOriginCheck, WebSocketOriginPolicy, } from "./security";
|
|
23
|
+
export type { ContentSecurityPolicy, CookieSession, CookieSessionCreateOptions, CookieSessionManager, CookieSessionOptions, CookieIssue, CookieIssueCode, CookieSameSite, CookieScope, CorsPolicy, CorsRequestContext, CorsResponseOptions, CsrfCookieOptions, CsrfPolicy, CspHashAlgorithm, CspDirectiveValue, CspDirectiveReplacement, CspSource, CspSourceDirective, EnvSchema, EnvSchemaDescriptor, EnvSource, EnvStartupOptions, EnvStartupResult, EnvValidationIssue, EnvVariable, EnvVariableDescriptor, EnvVariableKind, FetchMetadataCheck, FetchMetadataDestination, FetchMetadataEnforcement, FetchMetadataPolicy, FetchMetadataPolicyOptions, FetchMetadataReason, InferEnvSchema, IssuedCsrfToken, MemoryRateLimitStoreOptions, MemorySessionStoreOptions, RateLimitKey, RateLimitPolicy, RateLimitResult, RateLimitStore, ReferrerPolicy, ReportingEndpointUrl, ReportingEndpoints, SecurityAudit, SecurityAuditFinding, SecurityAuditOptions, ScriptDependencyAuditOptions, SecurityReportContext, SecurityReportHandlerOptions, SecurityReportPayload, RequestSecurityPolicy, RoutePolicy, RouteModuleVerificationOptions, RouteSecurityNeeds, RouteSecurityPolicy, SecureCookieDeclaration, SecureCookieDefinition, SessionData, SessionCookieDefinition, SessionCookieKey, ServerSession, SessionManager, SessionManagerOptions, SessionNamespace, SessionPrimitive, SessionRecord, SessionStore, SessionStoreCandidate, SessionStoreWriteResult, SecurityHeadersOptions, SecurityHeaderPolicy, SecurityPolicy, SecurityPreset, StrictTransportSecurityPolicy, TrustedTypesPolicy, UploadFilePolicy, UploadPolicy, UploadValidationIssue, UploadValidationResult, WebSocketOriginCheck, WebSocketOriginPolicy, } from "./security";
|
|
22
24
|
export type { PageRenderer, RequestHandler, RequestHandlerOptions, } from "./server";
|
|
23
25
|
//# 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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,IAAI,EACJ,iBAAiB,EACjB,IAAI,EACJ,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,SAAS,EACT,SAAS,EACT,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,4BAA4B,EAC5B,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,EACL,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,GAAG,GACJ,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,8BAA8B,EAC9B,eAAe,EACf,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,UAAU,EACV,OAAO,EACP,YAAY,EACZ,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,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