@demiurgejs/core 0.2.0-beta.1 → 0.2.0-beta.2

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.
Files changed (107) hide show
  1. package/README.md +2 -0
  2. package/dist/adapter/testing.d.ts +33 -0
  3. package/dist/adapter/testing.d.ts.map +1 -0
  4. package/dist/adapter/testing.js +251 -0
  5. package/dist/adapter/testing.js.map +1 -0
  6. package/dist/browser/file-router.d.ts.map +1 -1
  7. package/dist/chunks/document-shell-D1xo6cEA.js +35 -0
  8. package/dist/chunks/document-shell-D1xo6cEA.js.map +1 -0
  9. package/dist/chunks/image-codec-BGTx_t5K.js +141 -0
  10. package/dist/chunks/image-codec-BGTx_t5K.js.map +1 -0
  11. package/dist/chunks/images-B9MqcjSA.js +339 -0
  12. package/dist/chunks/images-B9MqcjSA.js.map +1 -0
  13. package/dist/chunks/request-metadata-D5NrT8ks.js +642 -0
  14. package/dist/chunks/request-metadata-D5NrT8ks.js.map +1 -0
  15. package/dist/chunks/streaming-BQ1bykDo.js +469 -0
  16. package/dist/chunks/streaming-BQ1bykDo.js.map +1 -0
  17. package/dist/chunks/{testing-DBjVCN5v.js → testing-B_iMFYz_.js} +768 -761
  18. package/dist/chunks/testing-B_iMFYz_.js.map +1 -0
  19. package/dist/cli.d.ts.map +1 -1
  20. package/dist/cli.js +63 -54
  21. package/dist/cli.js.map +1 -1
  22. package/dist/document/deferred-scripts.d.ts +11 -0
  23. package/dist/document/deferred-scripts.d.ts.map +1 -0
  24. package/dist/document/index.d.ts +3 -1
  25. package/dist/document/index.d.ts.map +1 -1
  26. package/dist/document/render.d.ts.map +1 -1
  27. package/dist/document/scripts.d.ts +12 -1
  28. package/dist/document/scripts.d.ts.map +1 -1
  29. package/dist/edge/assets.d.ts +14 -0
  30. package/dist/edge/assets.d.ts.map +1 -0
  31. package/dist/edge/index.d.ts +19 -0
  32. package/dist/edge/index.d.ts.map +1 -0
  33. package/dist/edge/index.js +286 -0
  34. package/dist/edge/index.js.map +1 -0
  35. package/dist/edge/stores.d.ts +8 -0
  36. package/dist/edge/stores.d.ts.map +1 -0
  37. package/dist/edge/streaming.d.ts +7 -0
  38. package/dist/edge/streaming.d.ts.map +1 -0
  39. package/dist/index.d.ts +5 -5
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +423 -420
  42. package/dist/index.js.map +1 -1
  43. package/dist/internal/testing.js +9 -9
  44. package/dist/kv/index.d.ts +3 -0
  45. package/dist/kv/index.d.ts.map +1 -0
  46. package/dist/kv/index.js +103 -0
  47. package/dist/kv/index.js.map +1 -0
  48. package/dist/kv/store.d.ts +28 -0
  49. package/dist/kv/store.d.ts.map +1 -0
  50. package/dist/node/font.d.ts +5 -0
  51. package/dist/node/font.d.ts.map +1 -0
  52. package/dist/node/image.d.ts +15 -0
  53. package/dist/node/image.d.ts.map +1 -0
  54. package/dist/node/index.d.ts +4 -0
  55. package/dist/node/index.d.ts.map +1 -1
  56. package/dist/node/index.js +25 -23
  57. package/dist/node/index.js.map +1 -1
  58. package/dist/node/streaming.d.ts.map +1 -1
  59. package/dist/platform/analytics.d.ts +58 -5
  60. package/dist/platform/analytics.d.ts.map +1 -1
  61. package/dist/platform/font-assets.d.ts +19 -0
  62. package/dist/platform/font-assets.d.ts.map +1 -0
  63. package/dist/platform/fonts.d.ts +14 -4
  64. package/dist/platform/fonts.d.ts.map +1 -1
  65. package/dist/platform/image-codec.d.ts +15 -0
  66. package/dist/platform/image-codec.d.ts.map +1 -0
  67. package/dist/platform/image-url.d.ts +17 -0
  68. package/dist/platform/image-url.d.ts.map +1 -0
  69. package/dist/platform/image.d.ts +8 -0
  70. package/dist/platform/image.d.ts.map +1 -0
  71. package/dist/platform/images.d.ts +15 -0
  72. package/dist/platform/images.d.ts.map +1 -1
  73. package/dist/platform/index.d.ts +8 -5
  74. package/dist/platform/index.d.ts.map +1 -1
  75. package/dist/redis/index.d.ts +3 -0
  76. package/dist/redis/index.d.ts.map +1 -0
  77. package/dist/redis/index.js +171 -0
  78. package/dist/redis/index.js.map +1 -0
  79. package/dist/redis/store.d.ts +8 -0
  80. package/dist/redis/store.d.ts.map +1 -0
  81. package/dist/security/index.d.ts +1 -1
  82. package/dist/security/index.d.ts.map +1 -1
  83. package/dist/security/policy.d.ts +2 -27
  84. package/dist/security/policy.d.ts.map +1 -1
  85. package/dist/security/types.d.ts +10 -3
  86. package/dist/security/types.d.ts.map +1 -1
  87. package/dist/security/verification.d.ts.map +1 -1
  88. package/dist/server/document-shell.d.ts +12 -0
  89. package/dist/server/document-shell.d.ts.map +1 -0
  90. package/dist/static/images.d.ts +13 -0
  91. package/dist/static/images.d.ts.map +1 -0
  92. package/dist/static/index.d.ts +8 -0
  93. package/dist/static/index.d.ts.map +1 -1
  94. package/dist/static/index.js +421 -313
  95. package/dist/static/index.js.map +1 -1
  96. package/dist/static/vercel.d.ts +3 -0
  97. package/dist/static/vercel.d.ts.map +1 -1
  98. package/dist/vite/index.js +412 -387
  99. package/dist/vite/index.js.map +1 -1
  100. package/dist/vite/plugin.d.ts +7 -0
  101. package/dist/vite/plugin.d.ts.map +1 -1
  102. package/package.json +34 -3
  103. package/dist/chunks/request-metadata-DwEO1EAS.js +0 -477
  104. package/dist/chunks/request-metadata-DwEO1EAS.js.map +0 -1
  105. package/dist/chunks/streaming-Ci6vf3BB.js +0 -353
  106. package/dist/chunks/streaming-Ci6vf3BB.js.map +0 -1
  107. package/dist/chunks/testing-DBjVCN5v.js.map +0 -1
@@ -0,0 +1,286 @@
1
+ import { a as p, c as w, b as E, d as y, s as b } from "../chunks/request-metadata-D5NrT8ks.js";
2
+ import { c as S } from "../chunks/testing-B_iMFYz_.js";
3
+ import { renderToReadableStream as R } from "react-dom/server";
4
+ import "react";
5
+ import "react/jsx-runtime";
6
+ import { i as v, I as L, R as A } from "../chunks/static-files-DUjHw-4H.js";
7
+ import { c as T } from "../chunks/document-shell-D1xo6cEA.js";
8
+ const x = {
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([
27
+ "/demiurge-manifest.json",
28
+ "/index.html"
29
+ ]);
30
+ function C(e) {
31
+ const t = e.immutable ?? v, r = H(e.prefix), i = /* @__PURE__ */ new Map();
32
+ for (const [o, n] of Object.entries(e.assets)) {
33
+ const a = m(o);
34
+ if (P.has(a))
35
+ continue;
36
+ const s = I(n.body);
37
+ i.set(a, {
38
+ body: s,
39
+ cacheControl: n.immutable ?? t(h(a)) ? L : A,
40
+ contentType: n.contentType ?? M(a),
41
+ etag: j(s)
42
+ });
43
+ }
44
+ return async function(n) {
45
+ if (n.method !== "GET" && n.method !== "HEAD")
46
+ return null;
47
+ const a = D(r, new URL(n.url).pathname), s = a === null ? void 0 : i.get(a);
48
+ if (!s)
49
+ return null;
50
+ const c = new Headers({
51
+ "cache-control": s.cacheControl,
52
+ "content-length": String(s.body.byteLength),
53
+ "content-type": s.contentType,
54
+ "cross-origin-resource-policy": "same-origin",
55
+ etag: s.etag,
56
+ "x-content-type-options": "nosniff"
57
+ });
58
+ return O(n, s.etag) ? (c.delete("content-length"), c.delete("content-type"), new Response(null, { headers: c, status: 304 })) : n.method === "HEAD" ? new Response(null, { headers: c }) : new Response(s.body, { headers: c });
59
+ };
60
+ }
61
+ function j(e) {
62
+ let t = 2166136261;
63
+ for (const r of e)
64
+ t = Math.imul(t ^ r, 16777619) >>> 0;
65
+ return `W/"${e.byteLength.toString(16)}-${t.toString(16)}"`;
66
+ }
67
+ function O(e, t) {
68
+ const r = e.headers.get("if-none-match");
69
+ return r === null ? !1 : r.trim() === "*" || r.split(",").some(
70
+ (i) => f(i) === f(t)
71
+ );
72
+ }
73
+ function f(e) {
74
+ return e.trim().replace(/^W\//i, "");
75
+ }
76
+ function D(e, t) {
77
+ let r;
78
+ try {
79
+ r = decodeURIComponent(t);
80
+ } catch {
81
+ return null;
82
+ }
83
+ if (e) {
84
+ if (!r.startsWith(e))
85
+ return null;
86
+ r = r.slice(e.length - 1);
87
+ }
88
+ return m(r);
89
+ }
90
+ function m(e) {
91
+ return e.startsWith("/") ? e : `/${e}`;
92
+ }
93
+ function H(e) {
94
+ return !e || e === "/" ? "" : `/${e.replace(/^\/|\/$/g, "")}/`;
95
+ }
96
+ function I(e) {
97
+ if (typeof e == "string")
98
+ return new TextEncoder().encode(e);
99
+ const t = ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e), r = new Uint8Array(t.byteLength);
100
+ return r.set(t), r;
101
+ }
102
+ function h(e) {
103
+ return e.slice(e.lastIndexOf("/") + 1);
104
+ }
105
+ function M(e) {
106
+ const t = h(e), r = t.lastIndexOf("."), i = r === -1 ? "" : t.slice(r).toLowerCase();
107
+ return x[i] ?? "application/octet-stream";
108
+ }
109
+ function N(e, t = {}) {
110
+ return e.render.mode === "streaming" ? U(e, t) : p(e, t);
111
+ }
112
+ async function U(e, t = {}) {
113
+ if (t.signal?.aborted)
114
+ throw t.signal.reason;
115
+ const r = w(e, t), i = E(e, r), o = new AbortController();
116
+ let n = !1;
117
+ const a = () => {
118
+ o.abort(
119
+ t.signal?.reason ?? new Error("Demiurge streaming response was cancelled.")
120
+ );
121
+ };
122
+ t.signal?.addEventListener("abort", a, { once: !0 });
123
+ let s;
124
+ try {
125
+ s = await R(i, {
126
+ nonce: t.nonce,
127
+ onError(l) {
128
+ n && !o.signal.aborted && t.onStreamError?.(l);
129
+ },
130
+ signal: o.signal
131
+ });
132
+ } catch (l) {
133
+ throw t.signal?.removeEventListener("abort", a), l;
134
+ }
135
+ s.allReady.catch(u);
136
+ let c;
137
+ try {
138
+ c = await T(e, {
139
+ ...t,
140
+ scripts: r.scripts()
141
+ });
142
+ } catch (l) {
143
+ throw t.signal?.removeEventListener("abort", a), a(), await s.cancel().catch(u), l;
144
+ }
145
+ return r.flushHead(), n = !0, new Response(_(s, c, a), {
146
+ headers: { "content-type": "text/html; charset=utf-8" }
147
+ });
148
+ }
149
+ function _(e, t, r) {
150
+ const i = new TextEncoder(), o = e.getReader();
151
+ return new ReadableStream({
152
+ async cancel(n) {
153
+ r(), await o.cancel(n).catch(u);
154
+ },
155
+ async pull(n) {
156
+ let a;
157
+ try {
158
+ a = await o.read();
159
+ } catch (s) {
160
+ n.error(s);
161
+ return;
162
+ }
163
+ if (a.done) {
164
+ n.enqueue(i.encode(t.suffix)), n.close();
165
+ return;
166
+ }
167
+ n.enqueue(a.value);
168
+ },
169
+ start(n) {
170
+ n.enqueue(i.encode(t.prefix));
171
+ }
172
+ });
173
+ }
174
+ function u() {
175
+ }
176
+ class g extends Error {
177
+ constructor(t) {
178
+ super(t), this.name = "EdgeSharedStoreError";
179
+ }
180
+ }
181
+ const k = '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".', $ = '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.';
182
+ function q() {
183
+ const e = () => {
184
+ throw new g(k);
185
+ };
186
+ return {
187
+ acquireRefreshLease: e,
188
+ delete: e,
189
+ get: e,
190
+ invalidateTags: e,
191
+ publishRefresh: e,
192
+ releaseRefreshLease: e,
193
+ set: e
194
+ };
195
+ }
196
+ function V() {
197
+ return {
198
+ increment() {
199
+ throw new g($);
200
+ }
201
+ };
202
+ }
203
+ const B = y({
204
+ name: "edge",
205
+ capabilities: {
206
+ crossOriginIsolationHeaders: !0,
207
+ nonceInjection: !0,
208
+ streaming: !0
209
+ }
210
+ }), d = "unavailable", W = {
211
+ app: "demiurge-edge",
212
+ environment: "unavailable",
213
+ schemaVersion: 1
214
+ }, z = [
215
+ "GET",
216
+ "POST",
217
+ "PUT",
218
+ "PATCH",
219
+ "DELETE",
220
+ "OPTIONS",
221
+ "HEAD"
222
+ ];
223
+ function ne(e) {
224
+ const t = F(e.cacheStore), r = G(e.rateLimitStore);
225
+ e.rateLimitStore === d && e.routeModules && J(e.routeModules);
226
+ const i = K(e.assets), o = S({
227
+ adapter: B,
228
+ cacheStore: t,
229
+ onError: e.onError,
230
+ rateLimitStore: r,
231
+ renderPage: e.renderPage ?? N,
232
+ routeModules: e.routeModules,
233
+ routes: e.routes,
234
+ ssr: e.ssr
235
+ });
236
+ return async function(a) {
237
+ const s = e.clientIp?.(a);
238
+ return s && b(a, { clientIp: s }), await i?.(a) ?? await o(a);
239
+ };
240
+ }
241
+ function F(e) {
242
+ if (e === d)
243
+ return {
244
+ namespace: W,
245
+ store: q()
246
+ };
247
+ if (!e || typeof e.store != "object")
248
+ throw new Error(
249
+ '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.'
250
+ );
251
+ return e;
252
+ }
253
+ function G(e) {
254
+ if (e === d)
255
+ return V();
256
+ if (!e || typeof e.increment != "function")
257
+ throw new Error(
258
+ '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.'
259
+ );
260
+ return e;
261
+ }
262
+ function J(e) {
263
+ for (const [t, r] of Object.entries(e))
264
+ if (r.policy?.security?.rateLimit ?? z.map((o) => r[o]).find(
265
+ (o) => o && o.kind !== "page" && o.security?.rateLimit
266
+ ))
267
+ throw new Error(
268
+ `Demiurge edge route ${JSON.stringify(t)} declares a rate limit policy, and this handler declares rateLimitStore "unavailable". Pass a shared rate limit store, or remove the policy.`
269
+ );
270
+ }
271
+ function K(e) {
272
+ if (e)
273
+ return typeof e == "function" ? e : C(e);
274
+ }
275
+ export {
276
+ d as EDGE_SHARED_STORE_UNAVAILABLE,
277
+ g as EdgeSharedStoreError,
278
+ C as createEdgeAssetHandler,
279
+ ne as createEdgeRequestHandler,
280
+ q as createUnavailableCacheStore,
281
+ V as createUnavailableRateLimitStore,
282
+ B as edgeAdapter,
283
+ N as renderEdgePageResponse,
284
+ U as renderEdgeStreamingPageResponse
285
+ };
286
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,IAAI;AAAA,EAChC;AAAA,EACA;AACF,CAAC;AAEM,SAASC,EACdC,GACkB;AAClB,QAAMC,IAAcD,EAAQ,aAAaE,GACnCC,IAASC,EAAgBJ,EAAQ,MAAM,GACvCK,wBAAa,IAAA;AAEnB,aAAW,CAACC,GAAUC,CAAK,KAAK,OAAO,QAAQP,EAAQ,MAAM,GAAG;AAC9D,UAAM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Q;AAAA,EAAA,CACd;AAED,SAAO,eAAiCiB,GAAS;AAC/C,UAAM+D,IAAWhF,EAAQ,WAAWiB,CAAO;AAE3C,WAAI+D,KACFC,EAA6BhE,GAAS,EAAE,UAAA+D,GAAU,GAGtC,MAAMJ,IAAa3D,CAAO,KAExB,MAAM6D,EAAc7D,CAAO;AAAA,EAC7C;AACF;AAEA,SAASuD,EACPU,GAC0B;AAC1B,MAAIA,MAAWf;AACb,WAAO;AAAA,MACL,WAAWC;AAAA,MACX,OAAON,EAAA;AAAA,IAA4B;AAIvC,MAAI,CAACoB,KAAU,OAAOA,EAAO,SAAU;AACrC,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAIJ,SAAOA;AACT;AAEA,SAASR,EACPQ,GACgB;AAChB,MAAIA,MAAWf;AACb,WAAOH,EAAA;AAGT,MAAI,CAACkB,KAAU,OAAOA,EAAO,aAAc;AACzC,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAIJ,SAAOA;AACT;AAKA,SAASP,EACPQ,GACA;AACA,aAAW,CAACC,GAAMC,CAAW,KAAK,OAAO,QAAQF,CAAO;AAQtD,QAPiBE,EAAY,QAAQ,UAAU,aAC7ChB,EACG,IAAI,CAACiB,MAAWD,EAAYC,CAAM,CAAC,EACnC;AAAA,MAAK,CAACC,MACLA,KAAcA,EAAW,SAAS,UAAUA,EAAW,UAAU;AAAA,IAAA;AAIrE,YAAM,IAAI;AAAA,QACR,uBAAuB,KAAK,UAAUH,CAAI,CAAC;AAAA,MAAA;AAInD;AAEA,SAASP,EACPlD,GACA;AACA,MAAKA;AAIL,WAAO,OAAOA,KAAU,aAAaA,IAAQ5B,EAAuB4B,CAAK;AAC3E;"}
@@ -0,0 +1,8 @@
1
+ import type { CacheStore } from "../data/cache";
2
+ import type { RateLimitStore } from "../security/types";
3
+ export declare class EdgeSharedStoreError extends Error {
4
+ constructor(message: string);
5
+ }
6
+ export declare function createUnavailableCacheStore(): CacheStore;
7
+ export declare function createUnavailableRateLimitStore(): RateLimitStore;
8
+ //# sourceMappingURL=stores.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stores.d.ts","sourceRoot":"","sources":["../../src/edge/stores.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMxD,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAQD,wBAAgB,2BAA2B,IAAI,UAAU,CAcxD;AAED,wBAAgB,+BAA+B,IAAI,cAAc,CAMhE"}
@@ -0,0 +1,7 @@
1
+ import type { LoadedRouteMatch } from "../router";
2
+ import { type DocumentShell } from "../server/document-shell";
3
+ import { type SsrRenderOptions } from "../server/ssr";
4
+ export declare function renderEdgePageResponse(match: LoadedRouteMatch, options?: SsrRenderOptions): Response | Promise<Response>;
5
+ export declare function renderEdgeStreamingPageResponse(match: LoadedRouteMatch, options?: SsrRenderOptions): Promise<Response>;
6
+ export declare function withDocumentShell(body: ReadableStream<Uint8Array>, shell: DocumentShell, onCancel: () => void): ReadableStream<Uint8Array>;
7
+ //# sourceMappingURL=streaming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../src/edge/streaming.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE1E,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,gBAAqB,gCAK/B;AAKD,wBAAsB,+BAA+B,CACnD,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,QAAQ,CAAC,CA2DnB;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,EAChC,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,MAAM,IAAI,GACnB,cAAc,CAAC,UAAU,CAAC,CA+B5B"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  export { createFileRouter, hydrateFileRouter, Link } from "./browser";
2
2
  export { assertAdapterCapabilities, checkAdapterCapabilities, defineAdapter, } from "./adapter";
3
3
  export { createCache, createInvalidation, createMemoryIdempotencyStore, createMemoryCache, createMemoryCacheStore, defineTags, parseCacheDuration, query, runIdempotentMutation, serializeCacheKey, serializeCacheNamespace, serializeCacheTag, tag, } from "./data";
4
- export { defineLinks, defineMetadata, defineOgImage, defineRobots, defineScripts, defineSitemap, link, meta, modulePreload, preconnect, preload, resolveLinks, resolveMetadata, resolveScripts, renderOgImageResponse, renderOgImageSvg, renderRobots, renderSitemap, script, Script, structuredData, } from "./document";
4
+ export { defineLinks, defineMetadata, defineOgImage, defineRobots, defineScripts, defineSitemap, getScriptWorker, link, meta, modulePreload, preconnect, preload, resolveLinks, resolveMetadata, resolveScripts, renderOgImageResponse, renderOgImageSvg, renderRobots, renderSitemap, script, Script, startDeferredScripts, structuredData, } from "./document";
5
5
  export { href } from "./routing";
6
- export { analytics, defineFonts, defineInstrumentation, defineImages, font, fontPreloadLinks, isAllowedImageSource, planImageTransform, renderFontFaceCss, } from "./platform";
6
+ export { analytics, defaultFontPath, defineFonts, defineInstrumentation, defineImages, font, fontAssetFileName, fontAssetUrl, fontLinks, fontMediaType, fontPreloadLinks, fontSources, fontStylesheetUrl, Image, isAllowedImageSource, parseImageOptimizerRequest, planImageTransform, renderFontFaceCss, } from "./platform";
7
7
  export { auditScriptDependencies, createCorsHeaders, createCsrfCookie, createCsrfToken, createMemoryRateLimitStore, createSecurityAudit, createSecurityHeaders, createSecurityReportHandler, cspNonce, cspHash, EnvValidationError, checkWebSocketOrigin, defineRoutePolicy, defineEnvSchema, defineSecurityPolicy, env, enforceCsrfProtection, enforceAllowedMethods, enforceRateLimit, enforceRequestSecurity, enforceWebSocketOrigin, issueCsrfToken, mergeRoutePolicies, mergeRouteSecurityPolicies, mergeSecurityPolicies, parseCookieHeader, parseBodySize, parseRateLimitWindow, security, validateEnv, validateCorsPolicy, validateRateLimitPolicy, validateRouteModules, validateUploads, } from "./security";
8
8
  export { createRequestHandler, handleRequestWithManifest, renderPageResponse, } from "./server";
9
9
  export { action, actionInput, defineMiddleware, html, httpError, HttpError, HTTP_ERROR_STATUSES, isHttpError, json, jsonl, notFound, page, redirect, response, serverTiming, sse, stream, text, toResponse, webhook, } from "./route";
@@ -11,13 +11,13 @@ export type { Adapter, AdapterCapability, AdapterCapabilityCheck, AdapterCapabil
11
11
  export type { ActionContext, ActionIdempotency, ActionInput, ActionOptions, HttpErrorDetails, HttpErrorInit, HttpErrorStatus, } from "./route";
12
12
  export type { RequestCacheStoreOptions } from "./server";
13
13
  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
- export type { DocumentMetadataTag, LinkTag, LinkContribution, Metadata, MetadataTitle, MetaTag, OgImage, OpenGraphMetadata, ResolvedMetadata, Robots, RobotsDirective, RobotsMetadata, PreconnectOptions, PreloadOptions, ScriptContribution, ScriptProps, ScriptStrategy, ScriptTag, Sitemap, SitemapAlternate, SitemapChangeFrequency, SitemapEntry, StructuredDataTag, StructuredDataValue, } from "./document";
15
- export type { AnalyticsConsent, FontContribution, FontDefinition, FontStyle, GoogleFontOptions, Instrumentation, InstrumentationEvent, InstrumentationHandler, InstrumentationOptions, ImageFormat, ImagePolicy, ImageTransformOptions, ImageTransformPlan, ImageVariant, LocalFontOptions, PlausibleAnalytics, PlausibleAnalyticsOptions, RemoteImagePattern, ObservabilityValue, RequestSignal, ServerStartSignal, TraceSignal, WebVitalName, WebVitalSignal, } from "./platform";
14
+ 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
+ export type { AnalyticsConsent, AnalyticsIntegration, AnalyticsProvider, FontContribution, FontDefinition, FontFormat, FontStyle, GoogleFontOptions, Instrumentation, InstrumentationEvent, InstrumentationHandler, InstrumentationOptions, ImageFormat, ImageLoader, ImagePolicy, ImageProps, ImageRequestRejection, ImageRequestResult, ImageTransformOptions, ImageTransformPlan, ImageVariant, ImageVariantDescriptor, LocalFontOptions, PlausibleAnalytics, PlausibleAnalyticsOptions, SentryAnalytics, SentryAnalyticsOptions, RemoteImagePattern, ObservabilityValue, OpenTelemetryAnalytics, OpenTelemetryAnalyticsOptions, RequestSignal, ServerStartSignal, TraceSignal, WebVitalName, WebVitalSignal, } from "./platform";
16
16
  export type { InitialRouteData } from "./router";
17
17
  export type { AppHref, AppPath, LinkTarget, LinkTo, PathValue, PathVarsFor, RouteParamsFor, RouteConcretePaths, RoutePathVars, RouteRequestContexts, } from "./routing";
18
18
  export type { HydrateFileRouterOptions } from "./browser";
19
19
  export type { SsrOptions, SsrRenderOptions } from "./server";
20
20
  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, CorsPolicy, CorsRequestContext, CorsResponseOptions, CsrfCookieOptions, CsrfPolicy, CspHashAlgorithm, CspDirectiveValue, CspDirectiveReplacement, CspSource, CspSourceDirective, EnvSchema, EnvSource, EnvValidationIssue, EnvVariable, InferEnvSchema, IssuedCsrfToken, MemoryRateLimitStoreOptions, RateLimitKey, RateLimitPolicy, RateLimitResult, RateLimitStore, ReferrerPolicy, ReportingEndpointUrl, ReportingEndpoints, SecurityAudit, SecurityAuditFinding, SecurityAuditOptions, ScriptDependencyAuditOptions, SecurityReportContext, SecurityReportHandlerOptions, SecurityReportPayload, RequestSecurityPolicy, RoutePolicy, RouteModuleVerificationOptions, RouteSecurityPolicy, SecurityHeadersOptions, SecurityHeaderPolicy, SecurityPolicy, SecurityPreset, StrictTransportSecurityPolicy, TrustedTypesPolicy, UploadFilePolicy, UploadPolicy, UploadValidationIssue, UploadValidationResult, WebSocketOriginCheck, WebSocketOriginPolicy, } from "./security";
21
+ export type { ContentSecurityPolicy, CorsPolicy, CorsRequestContext, CorsResponseOptions, CsrfCookieOptions, CsrfPolicy, CspHashAlgorithm, CspDirectiveValue, CspDirectiveReplacement, CspSource, CspSourceDirective, EnvSchema, EnvSource, EnvValidationIssue, EnvVariable, InferEnvSchema, IssuedCsrfToken, MemoryRateLimitStoreOptions, RateLimitKey, RateLimitPolicy, RateLimitResult, RateLimitStore, ReferrerPolicy, ReportingEndpointUrl, ReportingEndpoints, SecurityAudit, SecurityAuditFinding, SecurityAuditOptions, ScriptDependencyAuditOptions, SecurityReportContext, SecurityReportHandlerOptions, SecurityReportPayload, RequestSecurityPolicy, RoutePolicy, RouteModuleVerificationOptions, RouteSecurityNeeds, RouteSecurityPolicy, SecurityHeadersOptions, SecurityHeaderPolicy, SecurityPolicy, SecurityPreset, StrictTransportSecurityPolicy, TrustedTypesPolicy, UploadFilePolicy, UploadPolicy, UploadValidationIssue, UploadValidationResult, WebSocketOriginCheck, WebSocketOriginPolicy, } from "./security";
22
22
  export type { PageRenderer, RequestHandler, RequestHandlerOptions, } from "./server";
23
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,4BAA4B,EAC5B,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,KAAK,EACL,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,GAAG,GACJ,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,UAAU,EACV,OAAO,EACP,YAAY,EACZ,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,MAAM,EACN,MAAM,EACN,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,SAAS,EACT,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,IAAI,EACJ,gB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cAAc,EACd,6BAA6B,EAC7B,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,YAAY,EACZ,cAAc,EACd,qBAAqB,GACtB,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,4BAA4B,EAC5B,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,KAAK,EACL,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,GAAG,GACJ,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,eAAe,EACf,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,UAAU,EACV,OAAO,EACP,YAAY,EACZ,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,MAAM,EACN,MAAM,EACN,oBAAoB,EACpB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,SAAS,EACT,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,IAAI,EACJ,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,KAAK,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,kBAAkB,EAClB,iBAAi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