void 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-cmd-ChVKPZ-w.mjs → account-cmd-DRhmCWcm.mjs} +3 -3
- package/dist/{application-analysis-2vGZrKzg.mjs → application-analysis-HRFsZOv3.mjs} +3 -3
- package/dist/{application-routing-DnUQoOJD.mjs → application-routing-P4TggvWp.mjs} +1 -1
- package/dist/{auth-link-D4uMdOsw.mjs → auth-link-CVXP1G6G.mjs} +3 -3
- package/dist/{auth-router-62dna450.mjs → auth-router-D1pGdbvB.mjs} +2 -2
- package/dist/{better-auth-shared-CiclgPde.mjs → better-auth-shared-C958aM7W.mjs} +28 -3
- package/dist/{build-cmd-D93K_4Sa.mjs → build-cmd-DmjbuT6d.mjs} +1 -1
- package/dist/{cache-CiIzEED4.mjs → cache-2khBO1MR.mjs} +1 -1
- package/dist/{cancel-deploy-BNoGfn2e.mjs → cancel-deploy-_itbbvY3.mjs} +1 -1
- package/dist/cli/cli.mjs +27 -27
- package/dist/client-CEtr5UOR.mjs +1 -0
- package/dist/{client-Qayy9xEh.mjs → client-CoxPEhJq.mjs} +6 -2
- package/dist/{cloudflare-cmd-DiFGaLow.mjs → cloudflare-cmd-fZ6AMSWk.mjs} +1 -1
- package/dist/{cloudflare-config-Chet188_.mjs → cloudflare-config-eQunqX6A.mjs} +1 -1
- package/dist/{cloudflare-connect-BdgAQBc7.mjs → cloudflare-connect-9OZe4XVQ.mjs} +1 -1
- package/dist/{cloudflare-operations-CWA24vCh.mjs → cloudflare-operations-CrskD4_O.mjs} +4 -4
- package/dist/{cloudflare-operations-D8MoezuN.mjs → cloudflare-operations-oLvAd9Nd.mjs} +1 -1
- package/dist/{config-Bt4rw93x.mjs → config-BBlVXZCU.mjs} +1 -1
- package/dist/{config-DkA9jYF2.mjs → config-BITKQ3O6.mjs} +2 -1
- package/dist/{config-BszFVhpk.mjs → config-BgysUhnm.mjs} +1 -1
- package/dist/{config-CzsNzGVH.d.mts → config-CPxJmt4M.d.mts} +2 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-b9mJbb6X.mjs → connect-CKvmkl2R.mjs} +4 -4
- package/dist/{create-project-rnjum4_V.mjs → create-project-BiMmR5wA.mjs} +1 -1
- package/dist/{create-project-eomwm0wa.mjs → create-project-Bq0M8MtO.mjs} +1 -1
- package/dist/{db-UPWmiSk1.mjs → db-cq5RW4Vy.mjs} +17 -17
- package/dist/{delete-BeeYi1WO.mjs → delete-CY4L8fi2.mjs} +1 -1
- package/dist/deploy-B029oHlE.mjs +2 -0
- package/dist/{deploy-CwmCcTlq.mjs → deploy-D_gEojD2.mjs} +79 -42
- package/dist/{deploy-managed-static-gPDxyp3v.mjs → deploy-managed-static-BHVbB_-A.mjs} +11 -11
- package/dist/{deploy-transport-L6zzPE9T.mjs → deploy-transport-DEyOUfac.mjs} +2 -2
- package/dist/deploy.mjs +5 -4
- package/dist/{dev-inbox-CwH5VuZj.mjs → dev-inbox-CUUS6iUg.mjs} +1 -1
- package/dist/{dispatch-CiJ1Xrba.mjs → dispatch-BNLB5_Gm.mjs} +1 -1
- package/dist/{domain-3xdH9p2L.mjs → domain-BlH90Ods.mjs} +2 -2
- package/dist/{email-Du3YRnM5.mjs → email-Bkq8ZL1p.mjs} +6 -6
- package/dist/{email-cloudflare-CtD8qE13.mjs → email-cloudflare-MvJIxrwx.mjs} +5 -107
- package/dist/{env-Cnvp0pGy.mjs → env-AvuCSeCH.mjs} +2 -2
- package/dist/{gen-BvVmpZ5f.mjs → gen-BD-dfjxY.mjs} +3 -3
- package/dist/gen-CIHXh9I8.mjs +1 -0
- package/dist/{github-cmd-X2GKiLi-.mjs → github-cmd-CA-lBdkn.mjs} +1 -1
- package/dist/{handler-Drm_lyrV.d.mts → handler-BR6Tvjkp.d.mts} +8 -3
- package/dist/{handler-xmzz0U38.mjs → handler-CKeTtYID.mjs} +2 -12
- package/dist/headers-CuTEdP9C.mjs +445 -0
- package/dist/{help-EWDNxST-.mjs → help-1OCFDsRr.mjs} +9 -1
- package/dist/help-Ba8Dq5-r.mjs +1 -0
- package/dist/{inbound-DSKSHDUj.d.mts → inbound-BHt4dIlL.d.mts} +16 -5
- package/dist/{inbound-DQfekMtz.mjs → inbound-CdO-qY0w.mjs} +2 -76
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +65 -37
- package/dist/{info-jW8_d3VI.mjs → info-CJxua_db.mjs} +4 -4
- package/dist/{init-jDQ5G9QC.mjs → init-B-4CluYx.mjs} +12 -11
- package/dist/{isr-config-DhBkzCdY.mjs → isr-config-Czzb4mIq.mjs} +1 -47
- package/dist/{link-DOyxX5Xs.mjs → link-DAXOT-G_.mjs} +2 -2
- package/dist/{list-C9pTYDtl.mjs → list-BYSOo9fm.mjs} +2 -2
- package/dist/{live-CDBHyYiR.d.mts → live-0xrcVpyq.d.mts} +1 -1
- package/dist/{local-d1-CKfek6Z4.mjs → local-d1-BLgsNUj9.mjs} +1 -1
- package/dist/login-BpbYeu-n.mjs +1 -0
- package/dist/{login-koQbjzPd.mjs → login-CJopTWX4.mjs} +2 -2
- package/dist/{logs-cTU5TsRW.mjs → logs-DE0weBsR.mjs} +13 -11
- package/dist/{migrate-C62pGTfr.mjs → migrate-ChHHZBTi.mjs} +3 -3
- package/dist/migrate-HdA6Kh2p.mjs +1 -0
- package/dist/{mime-DKkO7ZtA.mjs → mime-CtP6-qAF.mjs} +143 -15
- package/dist/nitro.mjs +3 -3
- package/dist/{node-BfAt2rz8.mjs → node-CZ6lGNLn.mjs} +1 -1
- package/dist/{operator-cmd-CnAvSqJ5.mjs → operator-cmd-BUqsdk2K.mjs} +28 -10
- package/dist/operator-cmd-wBYyp8iQ.mjs +1 -0
- package/dist/pages/client.d.mts +143 -11
- package/dist/pages/client.mjs +173 -12
- package/dist/pages/index.d.mts +22 -3
- package/dist/pages/index.mjs +18 -4
- package/dist/pages/islands-plugin.d.mts +46 -2
- package/dist/pages/islands-plugin.mjs +91 -5
- package/dist/pages/prefetch.d.mts +2 -2
- package/dist/pages/prefetch.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -2
- package/dist/platform-args-C7XUw9mw.mjs +1 -0
- package/dist/{platform-args-Bv9hoLEL.mjs → platform-args-Cx1M-7bq.mjs} +18 -4
- package/dist/{platform-auth-config-CLj0EvnB.mjs → platform-auth-config-K4m_LE8b.mjs} +4 -4
- package/dist/{platform-auth-protection-DQDSxVhr.mjs → platform-auth-protection-KF5Vo-1I.mjs} +2 -2
- package/dist/{platform-auth-recovery-DD3oLerq.mjs → platform-auth-recovery-BOdFrl7R.mjs} +2 -2
- package/dist/{platform-cmd-WnOmdLzR.mjs → platform-cmd-DpCHawGF.mjs} +1 -1
- package/dist/{platform-cmd-PLNLg-2N.mjs → platform-cmd-Ds3EAV5t.mjs} +5 -4
- package/dist/{platform-domain-Bnq0vg0q.mjs → platform-domain-rWJshybd.mjs} +2 -2
- package/dist/{platform-lifecycle-BQiN9HN5.mjs → platform-lifecycle-BH34I0rh.mjs} +1 -1
- package/dist/{platform-lifecycle-BCsFg1Tl.mjs → platform-lifecycle-D9RdGub1.mjs} +66 -31
- package/dist/{platform-management-nzCDwtiN.mjs → platform-management-BRefdHGD.mjs} +21 -3
- package/dist/{platform-management-CMJR8Zi-.mjs → platform-management-BfLW0Zlo.mjs} +1 -1
- package/dist/{platform-recovery-DBNoME3I.mjs → platform-recovery-DZuZGJtt.mjs} +2 -2
- package/dist/platform-runtime-logs-CdJGnk3f.mjs +68 -0
- package/dist/{platform-setup-VEcHu0Vq.mjs → platform-setup-Vw1AaUN8.mjs} +15 -2
- package/dist/{plugin-inference-DmwjC3y2.mjs → plugin-inference-CdLbxZL_.mjs} +1 -1
- package/dist/{prefetch-L93_1Jk7.mjs → prefetch-Dx2jIbtg.mjs} +19 -1
- package/dist/{prefetch-CG0K6JPd.d.mts → prefetch-NdNeubbH.d.mts} +7 -1
- package/dist/{prepare-pfl2LIMy.mjs → prepare-BJW-f1f1.mjs} +4 -4
- package/dist/{prepare-BPsfLWaW.mjs → prepare-BMGeKL16.mjs} +1 -1
- package/dist/prepare-BdxJJCMv.mjs +1 -0
- package/dist/{project-cmd-5Izu4Pg3.mjs → project-cmd-B_bUyZ3J.mjs} +15 -15
- package/dist/{project-team-DSUyjZFh.mjs → project-team-MjT5K4rQ.mjs} +1 -1
- package/dist/{project-token-wj09YQSB.mjs → project-token-BKHGwY3k.mjs} +1 -1
- package/dist/{project-zero-trust-BMHf2YF0.mjs → project-zero-trust-Bzdd05-h.mjs} +1 -1
- package/dist/{protocol-0-lp9ZYx.mjs → protocol-COyySMki.mjs} +130 -107
- package/dist/{protocol-xdrl-In0.d.mts → protocol-CkwjASep.d.mts} +2 -2
- package/dist/{provision-CRiNnlfE.mjs → provision-BbCzpbXs.mjs} +1 -1
- package/dist/{provision-CxHIGBIZ.mjs → provision-DQF6Kw-6.mjs} +1 -1
- package/dist/{requests-DicgB5jU.mjs → requests-daJmVpjk.mjs} +1 -1
- package/dist/{rollback-DrDZOKNE.mjs → rollback-BgL0wY1J.mjs} +2 -2
- package/dist/{route-types-irZc1txT.mjs → route-types-CZc1YXjF.mjs} +40 -4
- package/dist/route-url-C_YIH_zO.d.mts +37 -0
- package/dist/routes-stub.d.mts +6 -2
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/email/testing.d.mts +1 -1
- package/dist/runtime/email/testing.mjs +3 -3
- package/dist/runtime/email.d.mts +1 -1
- package/dist/runtime/email.mjs +3 -3
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +2 -2
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/route-url.d.mts +2 -2
- package/dist/runtime/routing.d.mts +3 -3
- package/dist/runtime/routing.mjs +37 -16
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{scan-DSQtH3oS.mjs → scan-X2rDDRNa.mjs} +18 -10
- package/dist/{secret-C_QtTzJG.mjs → secret-CPq-B_vp.mjs} +2 -2
- package/dist/{static-asset-marker-NR1XS2z5.mjs → static-asset-marker-DsQKz6lt.mjs} +8 -1
- package/dist/validation-error-uAAjlsiW.mjs +82 -0
- package/dist/{version-metadata-Blf5H9BQ.mjs → version-metadata-C8hLzQkv.mjs} +1 -1
- package/dist/{wrangler-p-kLCJqF.mjs → wrangler-DESSbN8L.mjs} +2 -2
- package/dist/wrangler-DUB3MGHV.mjs +1 -0
- package/dist/{wrapper-iejSJDwL.mjs → wrapper-C9SUxoj7.mjs} +2 -2
- package/dist/{ws-DzBD-NUj.d.mts → ws-Dmjg5NH2.d.mts} +1 -1
- package/docs/guide/edge/headers.md +2 -0
- package/docs/guide/edge/rewrites.md +1 -1
- package/docs/guide/email/receiving.md +1 -1
- package/docs/guide/email/sending.md +42 -12
- package/docs/guide/pages-routing/actions-and-forms.md +21 -1
- package/docs/guide/pages-routing/islands.md +3 -3
- package/docs/guide/pages-routing/layouts.md +16 -2
- package/docs/guide/pages-routing/loaders.md +2 -2
- package/docs/guide/pages-routing/markdown.md +1 -1
- package/docs/guide/pages-routing/overview.md +103 -0
- package/docs/guide/platform/administration/connected-apps.md +4 -2
- package/docs/guide/platform/installation/credentials.md +6 -4
- package/docs/guide/platform/installation/maintenance.md +13 -0
- package/docs/guide/platform/installation/setup.md +22 -1
- package/docs/guide/ssg.md +3 -3
- package/docs/guide/type-safety.md +42 -1
- package/docs/integrations/frameworks/astro.md +17 -12
- package/docs/integrations/frameworks/overview.md +2 -2
- package/docs/reference/api/pages.md +101 -50
- package/docs/reference/api/rewrites.md +4 -1
- package/docs/reference/api/types.md +14 -10
- package/docs/reference/api.md +1 -1
- package/docs/reference/cli/platform-installation.md +4 -1
- package/docs/reference/cli/setup.md +1 -1
- package/docs/reference/config.md +10 -0
- package/package.json +8 -7
- package/schema.json +4 -0
- package/skills/void/SKILL.md +5 -0
- package/dist/client-DVtAKeUm.mjs +0 -1
- package/dist/deploy-CfU7CR-b.mjs +0 -2
- package/dist/gen-i61rdQgg.mjs +0 -1
- package/dist/headers-DEUBAM6W.mjs +0 -225
- package/dist/help-BcZDUcTw.mjs +0 -1
- package/dist/login-C0MiQrYs.mjs +0 -1
- package/dist/migrate-BG09-KOv.mjs +0 -1
- package/dist/operator-cmd-BhHXIL2G.mjs +0 -1
- package/dist/platform-args-C1kqYUen.mjs +0 -1
- package/dist/prepare-BJMmfq3W.mjs +0 -1
- package/dist/route-url-BGOiyKNz.d.mts +0 -24
- package/dist/validation-error-rDVbUJet.mjs +0 -47
- package/dist/wrangler-CPRX2d9A.mjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { a as executeComposedHandler, i as separateDeferred, n as DEFERRED, o as getHandlerComposition, t as ValidationError } from "./validation-error-uAAjlsiW.mjs";
|
|
1
2
|
import { n as isConvertedResponse } from "./response-HmNjB30w.mjs";
|
|
2
3
|
import { i as searchWithoutActionKey, n as hasActionKey } from "./action-key-XtKKbbsi.mjs";
|
|
3
|
-
import { i as separateDeferred, n as DEFERRED, t as ValidationError } from "./validation-error-rDVbUJet.mjs";
|
|
4
4
|
import { i as resolveHead, n as renderHeadToString, r as renderHtmlAttrs, t as renderBodyAttrs } from "./head-5XPcnG-j.mjs";
|
|
5
5
|
import { i as escapeScriptJson, r as serializePageData } from "./serialize-DUuYuaY3.mjs";
|
|
6
6
|
// src/pages/protocol.ts
|
|
@@ -82,9 +82,9 @@ function attachRenderErrorAssetTags(error, assetTags) {
|
|
|
82
82
|
});
|
|
83
83
|
throw error;
|
|
84
84
|
}
|
|
85
|
-
async function renderWithAssetTags(renderFn, pageObj, assetTags) {
|
|
85
|
+
async function renderWithAssetTags(renderFn, pageObj, assetTags, requestUrl) {
|
|
86
86
|
try {
|
|
87
|
-
return await renderFn(pageObj, assetTags);
|
|
87
|
+
return await renderFn(pageObj, assetTags, requestUrl);
|
|
88
88
|
} catch (error) {
|
|
89
89
|
attachRenderErrorAssetTags(error, assetTags);
|
|
90
90
|
}
|
|
@@ -107,7 +107,7 @@ function renderClientOnlyPage(pageObj, assetTags, renderFn) {
|
|
|
107
107
|
async function renderPageHtml(c, pageObj, componentId, renderMode, renderFn, getAssetTags) {
|
|
108
108
|
const assetTags = prepareAssetTags(await getAssetTags(c.req.raw, c.env, componentId));
|
|
109
109
|
return {
|
|
110
|
-
html: renderMode === "client" ? renderClientOnlyPage(pageObj, assetTags, renderFn) : await renderWithAssetTags(renderFn, pageObj, assetTags),
|
|
110
|
+
html: renderMode === "client" ? renderClientOnlyPage(pageObj, assetTags, renderFn) : await renderWithAssetTags(renderFn, pageObj, assetTags, c.req.url),
|
|
111
111
|
assetTags
|
|
112
112
|
};
|
|
113
113
|
}
|
|
@@ -133,8 +133,8 @@ async function extractProps(result) {
|
|
|
133
133
|
return result ?? {};
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
|
-
* Run a page loader. Responses from convertReturnValue
|
|
137
|
-
*
|
|
136
|
+
* Run a page loader and `render` its props. Responses from convertReturnValue
|
|
137
|
+
* (withValidator) always flow through to extractProps — they wrap plain return values
|
|
138
138
|
* (objects as 200 JSON, null/undefined as 204, strings as text/html) and must be
|
|
139
139
|
* unwrapped as page props.
|
|
140
140
|
*
|
|
@@ -142,13 +142,25 @@ async function extractProps(result) {
|
|
|
142
142
|
* 200s (file downloads, streams). JSON 200s are still extracted as props for
|
|
143
143
|
* backward compat with loaders using c.json().
|
|
144
144
|
*/
|
|
145
|
-
async function runLoader(handler, c) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
if (result
|
|
150
|
-
|
|
151
|
-
|
|
145
|
+
async function runLoader(handler, c, render) {
|
|
146
|
+
if (!handler) return render({});
|
|
147
|
+
return runPageHandler(handler, c, async (leaf) => {
|
|
148
|
+
const result = await leaf(c);
|
|
149
|
+
if (result instanceof Response && !isConvertedResponse(result)) {
|
|
150
|
+
const contentType = result.headers.get("content-type") || "";
|
|
151
|
+
if (result.status >= 300 || !contentType.includes("application/json")) return result;
|
|
152
|
+
}
|
|
153
|
+
return render(await extractProps(result));
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Per-route middleware from `defineHandler(middleware..., handler)` wraps the
|
|
158
|
+
* response `endpoint` builds from the leaf handler, as it wraps a route's
|
|
159
|
+
* response, so it sees and may edit the rendered page after `next()`.
|
|
160
|
+
*/
|
|
161
|
+
function runPageHandler(handler, c, endpoint) {
|
|
162
|
+
const composition = getHandlerComposition(handler);
|
|
163
|
+
return composition ? executeComposedHandler(c, composition.middlewares, () => endpoint(composition.leaf)) : endpoint(handler);
|
|
152
164
|
}
|
|
153
165
|
/** Flatten withValidator's { issues: [{ slot, issues: [{ message, path }] }] } into { field: message } */
|
|
154
166
|
function flattenValidationErrors(body) {
|
|
@@ -215,79 +227,75 @@ function streamDeferredResponse(initialChunk, deferredMap, c, contentType, dev,
|
|
|
215
227
|
/** Handle GET page request — run handler, return page object or SSR HTML */
|
|
216
228
|
async function handlePageGet(handler, headFn, c, componentId, renderFn, getAssetTags, configHead, options) {
|
|
217
229
|
const renderMode = options?.renderMode ?? "server";
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
for (const key of keys) resolvedProps[key] = obj[key];
|
|
230
|
+
return runLoader(handler, c, async (props) => {
|
|
231
|
+
const shared = c.get("shared") ?? {};
|
|
232
|
+
const pageHead = headFn ? headFn(c, props) : void 0;
|
|
233
|
+
const middlewareHead = c.get("headDefaults");
|
|
234
|
+
const head = resolveHead(configHead, middlewareHead, pageHead);
|
|
235
|
+
const { immediateProps, deferredMap } = separateDeferred(props);
|
|
236
|
+
const hasDeferred = Object.keys(deferredMap).length > 0;
|
|
237
|
+
const deferredKeys = {};
|
|
238
|
+
for (const [group, { keys }] of Object.entries(deferredMap)) for (const key of keys) deferredKeys[key] = group;
|
|
239
|
+
const pageObj = {
|
|
240
|
+
component: componentId,
|
|
241
|
+
props: immediateProps,
|
|
242
|
+
params: requestParams(c),
|
|
243
|
+
shared,
|
|
244
|
+
url: requestPathWithSearch(c),
|
|
245
|
+
errors: null,
|
|
246
|
+
...head && { head },
|
|
247
|
+
...hasDeferred && {
|
|
248
|
+
deferred: Object.keys(deferredMap),
|
|
249
|
+
deferredKeys
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
if (renderMode !== "island" && isPagesRequest(c)) {
|
|
253
|
+
if (c.req.header("purpose") === "prefetch" && hasDeferred) {
|
|
254
|
+
const resolvedProps = { ...immediateProps };
|
|
255
|
+
let deferredErrors;
|
|
256
|
+
await Promise.all(Object.entries(deferredMap).map(async ([group, { resolver, keys }]) => {
|
|
257
|
+
try {
|
|
258
|
+
const data = await resolver(c);
|
|
259
|
+
if (keys.length === 1) resolvedProps[keys[0]] = data ?? null;
|
|
260
|
+
else {
|
|
261
|
+
const obj = typeof data === "object" && data !== null ? data : {};
|
|
262
|
+
for (const key of keys) resolvedProps[key] = obj[key];
|
|
263
|
+
}
|
|
264
|
+
} catch (err) {
|
|
265
|
+
(deferredErrors ??= {})[group] = deferredErrorMessage(err, options?.dev === true);
|
|
266
|
+
for (const key of keys) delete resolvedProps[key];
|
|
256
267
|
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
+
}));
|
|
269
|
+
return pageJsonResponse(c, {
|
|
270
|
+
...pageObj,
|
|
271
|
+
props: resolvedProps,
|
|
272
|
+
deferred: void 0,
|
|
273
|
+
...deferredErrors && { deferredErrors }
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
if (!hasDeferred) return pageJsonResponse(c, pageObj);
|
|
277
|
+
c.header("X-VoidPages", "true");
|
|
278
|
+
const headers = new Headers(c.res.headers);
|
|
279
|
+
appendVary(headers, "X-VoidPages");
|
|
280
|
+
c.header("Vary", headers.get("Vary"));
|
|
281
|
+
return streamDeferredResponse(JSON.stringify(pageObj) + "\n", deferredMap, c, "application/x-ndjson", options?.dev === true, (group, data) => JSON.stringify({
|
|
282
|
+
__deferred: group,
|
|
283
|
+
data: data ?? null
|
|
284
|
+
}) + "\n", (group, error) => JSON.stringify({
|
|
285
|
+
__deferred: group,
|
|
286
|
+
error
|
|
287
|
+
}) + "\n");
|
|
268
288
|
}
|
|
269
|
-
|
|
270
|
-
c
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
error
|
|
280
|
-
}) + "\n");
|
|
281
|
-
}
|
|
282
|
-
const { html, assetTags } = await renderPageHtml(c, pageObj, componentId, renderMode, renderFn, getAssetTags);
|
|
283
|
-
if (!hasDeferred) return renderedResponse(c, html, "text/html; charset=utf-8", assetTags);
|
|
284
|
-
return streamDeferredResponse(html, deferredMap, c, "text/html; charset=utf-8", options?.dev === true, (group, data) => {
|
|
285
|
-
const g = safeJsonStringify(group);
|
|
286
|
-
return `\n<script>(function(d){window.__resolveDeferred?window.__resolveDeferred(${g},d):(window.__deferredQueue??=[]).push([${g},d])})(${safeJsonStringify(data)})<\/script>`;
|
|
287
|
-
}, (group, error) => {
|
|
288
|
-
const g = safeJsonStringify(group);
|
|
289
|
-
return `\n<script>(function(e){window.__rejectDeferred?window.__rejectDeferred(${g},e):(window.__deferredQueue??=[]).push([${g},0,e])})(${safeJsonStringify(error)})<\/script>`;
|
|
290
|
-
}, assetTags);
|
|
289
|
+
const { html, assetTags } = await renderPageHtml(c, pageObj, componentId, renderMode, renderFn, getAssetTags);
|
|
290
|
+
if (!hasDeferred) return renderedResponse(c, html, "text/html; charset=utf-8", assetTags);
|
|
291
|
+
return streamDeferredResponse(html, deferredMap, c, "text/html; charset=utf-8", options?.dev === true, (group, data) => {
|
|
292
|
+
const g = safeJsonStringify(group);
|
|
293
|
+
return `\n<script>(function(d){window.__resolveDeferred?window.__resolveDeferred(${g},d):(window.__deferredQueue??=[]).push([${g},d])})(${safeJsonStringify(data)})<\/script>`;
|
|
294
|
+
}, (group, error) => {
|
|
295
|
+
const g = safeJsonStringify(group);
|
|
296
|
+
return `\n<script>(function(e){window.__rejectDeferred?window.__rejectDeferred(${g},e):(window.__deferredQueue??=[]).push([${g},0,e])})(${safeJsonStringify(error)})<\/script>`;
|
|
297
|
+
}, assetTags);
|
|
298
|
+
});
|
|
291
299
|
}
|
|
292
300
|
function isSameOriginAction(request) {
|
|
293
301
|
const origin = new URL(request.url).origin;
|
|
@@ -307,9 +315,9 @@ function isSameOriginAction(request) {
|
|
|
307
315
|
async function handlePageMutation(mutationHandler, getHandler, headFn, c, componentId, renderFn, getAssetTags, configHead, options) {
|
|
308
316
|
if (!isSameOriginAction(c.req.raw)) return new Response("Cross-origin page actions are not allowed.", { status: 403 });
|
|
309
317
|
const renderMode = options?.renderMode ?? "server";
|
|
310
|
-
const shared = c.get("shared") ?? {};
|
|
311
|
-
const middlewareHead = c.get("headDefaults");
|
|
312
318
|
function buildMutationPageObj(props, errors) {
|
|
319
|
+
const shared = c.get("shared") ?? {};
|
|
320
|
+
const middlewareHead = c.get("headDefaults");
|
|
313
321
|
const pageHead = headFn ? headFn(c, props) : void 0;
|
|
314
322
|
const head = resolveHead(configHead, middlewareHead, pageHead);
|
|
315
323
|
return {
|
|
@@ -322,37 +330,52 @@ async function handlePageMutation(mutationHandler, getHandler, headFn, c, compon
|
|
|
322
330
|
...head && { head }
|
|
323
331
|
};
|
|
324
332
|
}
|
|
333
|
+
const rerenderErrors = /* @__PURE__ */ new WeakSet();
|
|
325
334
|
/** Re-run the GET loader and respond with the page, optionally carrying validation errors. */
|
|
326
335
|
async function respondWithPage(errors) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
336
|
+
try {
|
|
337
|
+
return await runLoader(getHandler, c, async (props) => {
|
|
338
|
+
const pageObj = buildMutationPageObj(stripDeferred(props), errors);
|
|
339
|
+
if (isPagesRequest(c)) return pageJsonResponse(c, pageObj);
|
|
340
|
+
const { html, assetTags } = await renderPageHtml(c, pageObj, componentId, renderMode, renderFn, getAssetTags);
|
|
341
|
+
return renderedResponse(c, html, "text/html; charset=utf-8", assetTags);
|
|
342
|
+
});
|
|
343
|
+
} catch (e) {
|
|
344
|
+
if (e instanceof Error) rerenderErrors.add(e);
|
|
345
|
+
throw e;
|
|
346
|
+
}
|
|
333
347
|
}
|
|
334
348
|
function respondWithErrors(errors) {
|
|
335
349
|
if (renderMode === "island") return Promise.resolve(Response.json({ errors }, { status: 422 }));
|
|
336
350
|
return respondWithPage(errors);
|
|
337
351
|
}
|
|
338
|
-
|
|
352
|
+
/** Respond to the action's result: a redirect, an error, or the re-rendered page. */
|
|
353
|
+
async function respondToAction(leaf) {
|
|
354
|
+
let result;
|
|
355
|
+
try {
|
|
356
|
+
result = await leaf(c);
|
|
357
|
+
} catch (e) {
|
|
358
|
+
if (e instanceof ValidationError) return respondWithErrors(e.errors);
|
|
359
|
+
throw e;
|
|
360
|
+
}
|
|
361
|
+
if (result instanceof Response) {
|
|
362
|
+
const status = result.status;
|
|
363
|
+
if (status >= 300 && status < 400) return result;
|
|
364
|
+
if (status === 400) {
|
|
365
|
+
const body = await result.clone().json().catch(() => null);
|
|
366
|
+
if (Array.isArray(body?.issues)) return respondWithErrors(flattenValidationErrors(body));
|
|
367
|
+
return result;
|
|
368
|
+
}
|
|
369
|
+
if (status !== 204) return result;
|
|
370
|
+
}
|
|
371
|
+
if (renderMode === "island") return Response.json({ success: true });
|
|
372
|
+
return respondWithPage(null);
|
|
373
|
+
}
|
|
339
374
|
try {
|
|
340
|
-
|
|
375
|
+
return await runPageHandler(mutationHandler ?? (() => void 0), c, respondToAction);
|
|
341
376
|
} catch (e) {
|
|
342
|
-
if (e instanceof ValidationError) return respondWithErrors(e.errors);
|
|
377
|
+
if (e instanceof ValidationError && !rerenderErrors.has(e) && !c.finalized) return respondWithErrors(e.errors);
|
|
343
378
|
throw e;
|
|
344
379
|
}
|
|
345
|
-
if (result instanceof Response) {
|
|
346
|
-
const status = result.status;
|
|
347
|
-
if (status >= 300 && status < 400) return result;
|
|
348
|
-
if (status === 400) {
|
|
349
|
-
const body = await result.clone().json().catch(() => null);
|
|
350
|
-
if (Array.isArray(body?.issues)) return respondWithErrors(flattenValidationErrors(body));
|
|
351
|
-
return result;
|
|
352
|
-
}
|
|
353
|
-
if (status !== 204) return result;
|
|
354
|
-
}
|
|
355
|
-
if (renderMode === "island") return Response.json({ success: true });
|
|
356
|
-
return respondWithPage(null);
|
|
357
380
|
}
|
|
358
381
|
export { safeJsonStringify as i, handlePageGet as n, handlePageMutation as r, flattenValidationErrors as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as HeadDescriptor, t as HeadConfig } from "./head-MeF_5M_3.mjs";
|
|
2
2
|
import { a as PageRenderMode, t as DevCssAsset } from "./types-agfx0alu.mjs";
|
|
3
|
-
import { n as CloudBindings, r as CloudContext } from "./handler-
|
|
3
|
+
import { n as CloudBindings, r as CloudContext } from "./handler-BR6Tvjkp.mjs";
|
|
4
4
|
/** Escape characters that are unsafe inside inline <script> tags to prevent XSS. */
|
|
5
5
|
declare function safeJsonStringify(value: unknown): string;
|
|
6
6
|
type PageObject = {
|
|
@@ -31,7 +31,7 @@ type AssetTags = {
|
|
|
31
31
|
devCss?: Array<DevCssAsset>;
|
|
32
32
|
devCssNonce?: string;
|
|
33
33
|
};
|
|
34
|
-
type RenderPage = (pageObj: PageObject, assetTags: AssetTags) => Promise<PageRenderResult>;
|
|
34
|
+
type RenderPage = (pageObj: PageObject, assetTags: AssetTags, requestUrl: string) => Promise<PageRenderResult>;
|
|
35
35
|
type GetAssetTags = (req: Request, env: CloudBindings, componentId: string) => Promise<AssetTags>;
|
|
36
36
|
/** Flatten withValidator's { issues: [{ slot, issues: [{ message, path }] }] } into { field: message } */
|
|
37
37
|
declare function flattenValidationErrors(body: unknown): Record<string, string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as join, c as resolve$2, n as dirname, o as normalize, t as basename } from "./dist-DMYe8CZJ.mjs";
|
|
2
2
|
import { i as voidWarn, r as voidLog } from "./log-D9hwSySP.mjs";
|
|
3
|
-
import { M as writeProvisionedWranglerConfig, _ as persistMaterializedWranglerConfig, s as assertNoDuplicateMembers, y as readProvisionedBindingEntry } from "./wrangler-
|
|
3
|
+
import { M as writeProvisionedWranglerConfig, _ as persistMaterializedWranglerConfig, s as assertNoDuplicateMembers, y as readProvisionedBindingEntry } from "./wrangler-DESSbN8L.mjs";
|
|
4
4
|
import { n as scanWranglerDotenvKeys } from "./dotenv-CEI8hapP.mjs";
|
|
5
5
|
import { l as resolveCloudflareOperationArgv, n as decodeCloudflareOperationResult, r as encodeCloudflareOperation } from "./cloudflare-process-DjJ638A-.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { f as isRealD1Id, p as isRealHyperdriveId } from "./provision-
|
|
1
|
+
export { f as isRealD1Id, p as isRealHyperdriveId } from "./provision-BbCzpbXs.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as readProjectConfig } from "./project-CLwxcEdq.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-Dy8svcqQ.mjs";
|
|
3
3
|
import { H as outro, L as log } from "./dist-D23AAMxT.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { r as PlatformClient } from "./client-CoxPEhJq.mjs";
|
|
5
5
|
import { f as import_picocolors, i as dim } from "./output-BCdLioKP.mjs";
|
|
6
6
|
// src/cli/requests.ts
|
|
7
7
|
async function runRequestsCommand(root, range, status) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-CLwxcEdq.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-Dy8svcqQ.mjs";
|
|
3
3
|
import { A as confirm, H as outro, K as select, L as log, O as cancel, tt as isCancel } from "./dist-D23AAMxT.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { r as PlatformClient } from "./client-CoxPEhJq.mjs";
|
|
5
5
|
import { c as formatRelativeTime, i as dim, m as printSuccess, o as formatCount, r as createSpinner } from "./output-BCdLioKP.mjs";
|
|
6
6
|
// src/cli/rollback.ts
|
|
7
7
|
async function runRollbackCommand(root, deployId, explicitPlatform) {
|
|
@@ -74,7 +74,7 @@ async function runRollbackCommand(root, deployId, explicitPlatform) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
async function runCloudflareRollback(root, deployId, restorePlatformFlag) {
|
|
77
|
-
const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-
|
|
77
|
+
const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-oLvAd9Nd.mjs");
|
|
78
78
|
const context = resolveCloudflareOperationContext(root);
|
|
79
79
|
const status = await readCloudflareWorkerStatus(context);
|
|
80
80
|
const deployedVersionIds = new Set(status.deployedVersionIds);
|
|
@@ -78,13 +78,22 @@ function generateQueueTypes(queues, queuesDir, outDir) {
|
|
|
78
78
|
return lines.join("\n");
|
|
79
79
|
}
|
|
80
80
|
// src/codegen/route-types.ts
|
|
81
|
+
/** Percent-encode a pattern's fixed segments the way `routeUrl()` serializes its pathname. */
|
|
82
|
+
function encodeRoutePattern(pattern) {
|
|
83
|
+
return pattern.split("/").map((segment) => {
|
|
84
|
+
if (segment.startsWith(":") || segment === "*") return segment;
|
|
85
|
+
const url = new URL("https://void.invalid");
|
|
86
|
+
url.pathname = `/${segment}`;
|
|
87
|
+
return url.pathname.slice(1);
|
|
88
|
+
}).join("/");
|
|
89
|
+
}
|
|
81
90
|
/**
|
|
82
91
|
* Generate .void/routes.d.ts content.
|
|
83
92
|
*
|
|
84
93
|
* Uses `typeof import(...)` so TypeScript resolves all types.
|
|
85
94
|
* The codegen generates scaffolding only — never analyzes types itself.
|
|
86
95
|
*/
|
|
87
|
-
function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
|
|
96
|
+
function generateRouteTypes(scan, routesDir, outDir, pagesDir, options = {}) {
|
|
88
97
|
const lines = [];
|
|
89
98
|
lines.push("// Auto-generated by void — do not edit");
|
|
90
99
|
lines.push("export {}");
|
|
@@ -143,18 +152,38 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
|
|
|
143
152
|
lines.push(" export type RouteDestination<P extends RoutePath = RoutePath> = P extends RoutePath");
|
|
144
153
|
lines.push(" ? { pathname: P } & RouteOptions<P>");
|
|
145
154
|
lines.push(" : never;");
|
|
146
|
-
lines.push("
|
|
155
|
+
lines.push(" type RouteUrlSegment<S extends string> = S extends `:${string}` | \"*\" ? string : S;");
|
|
156
|
+
lines.push(" type RouteSegmentsUrl<P extends string> = P extends `${infer Segment}/${infer Rest}`");
|
|
157
|
+
lines.push(" ? `${RouteUrlSegment<Segment>}/${RouteSegmentsUrl<Rest>}`");
|
|
158
|
+
lines.push(" : RouteUrlSegment<P>;");
|
|
159
|
+
lines.push(" type RoutePatternUrl<P extends string> = P extends `${infer Prefix}/*`");
|
|
160
|
+
lines.push(" ? (Prefix extends \"\" ? \"/\" : RouteSegmentsUrl<Prefix>) | `${RouteSegmentsUrl<Prefix>}/${string}`");
|
|
161
|
+
lines.push(" : RouteSegmentsUrl<P>;");
|
|
162
|
+
lines.push(" type EncodedRoutePath = EncodedRoutePathMap[keyof EncodedRoutePathMap] & string;");
|
|
163
|
+
lines.push(" type RoutePathUrl = RoutePatternUrl<RoutePath | EncodedRoutePath>;");
|
|
164
|
+
lines.push(" type TypedRoutes = RouteTypesConfig extends { typedRoutes: true } ? true : false;");
|
|
165
|
+
lines.push(" export type RouteUrl = TypedRoutes extends true");
|
|
166
|
+
lines.push(" ? RoutePathUrl | `${RoutePathUrl}${\"?\" | \"#\"}${string}`");
|
|
167
|
+
lines.push(" : string;");
|
|
168
|
+
lines.push(" export type Href = TypedRoutes extends true");
|
|
169
|
+
lines.push(" ? RouteUrl | `${\"?\" | \"#\"}${string}` | `${\"http://\" | \"https://\" | \"mailto:\" | \"tel:\"}${string}`");
|
|
170
|
+
lines.push(" : string;");
|
|
171
|
+
lines.push(" export type RouteUrlInput = Href | URL | RouteDestination;");
|
|
147
172
|
lines.push(" export function routeUrl<P extends RoutePath>(");
|
|
148
173
|
lines.push(" path: P,");
|
|
149
174
|
lines.push(" ...args: [RoutePathMap[NoInfer<P>]] extends [never]");
|
|
150
175
|
lines.push(" ? [options?: RouteOptions<P>]");
|
|
151
176
|
lines.push(" : [options: RouteOptions<P>]");
|
|
152
|
-
lines.push(" ):
|
|
177
|
+
lines.push(" ): RouteUrl;");
|
|
178
|
+
lines.push("");
|
|
179
|
+
lines.push(" export interface RouteTypesConfig {");
|
|
180
|
+
if (options.typedRoutes) lines.push(" typedRoutes: true;");
|
|
181
|
+
lines.push(" }");
|
|
153
182
|
lines.push("");
|
|
154
183
|
lines.push(" export interface RoutePathMap {");
|
|
155
184
|
const paths = /* @__PURE__ */ new Map();
|
|
156
185
|
for (const route of [
|
|
157
|
-
...scan.routes
|
|
186
|
+
...scan.routes,
|
|
158
187
|
...scan.pages.pages,
|
|
159
188
|
...scan.websockets ?? []
|
|
160
189
|
]) {
|
|
@@ -169,6 +198,13 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
|
|
|
169
198
|
}
|
|
170
199
|
lines.push(" }");
|
|
171
200
|
lines.push("");
|
|
201
|
+
lines.push(" export interface EncodedRoutePathMap {");
|
|
202
|
+
for (const pattern of paths.keys()) {
|
|
203
|
+
const encoded = encodeRoutePattern(pattern);
|
|
204
|
+
if (encoded !== pattern) lines.push(` ${JSON.stringify(pattern)}: ${JSON.stringify(encoded)};`);
|
|
205
|
+
}
|
|
206
|
+
lines.push(" }");
|
|
207
|
+
lines.push("");
|
|
172
208
|
lines.push(" /** Union of known route patterns (keys of the generated RouteMap). */");
|
|
173
209
|
lines.push(" export type RouteName = keyof RouteMap;");
|
|
174
210
|
lines.push("");
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { EncodedRoutePathMap, RoutePathMap, RouteTypesConfig } from "void/routes";
|
|
2
|
+
/** Expand complete route tokens without changing query strings or fragments. */
|
|
3
|
+
declare function interpolateRouteParams(path: string, params?: Record<string, string>, requireParams?: boolean): string;
|
|
4
|
+
/** Known page, HTTP and WebSocket route patterns. */
|
|
5
|
+
type RoutePath = keyof RoutePathMap & string;
|
|
6
|
+
type RouteUrlSegment<S extends string> = S extends `:${string}` | "*" ? string : S;
|
|
7
|
+
type RouteSegmentsUrl<P extends string> = P extends `${infer Segment}/${infer Rest}` ? `${RouteUrlSegment<Segment>}/${RouteSegmentsUrl<Rest>}` : RouteUrlSegment<P>;
|
|
8
|
+
type RoutePatternUrl<P extends string> = P extends `${infer Prefix}/*` ? (Prefix extends "" ? "/" : RouteSegmentsUrl<Prefix>) | `${RouteSegmentsUrl<Prefix>}/${string}` : RouteSegmentsUrl<P>;
|
|
9
|
+
type EncodedRoutePath = EncodedRoutePathMap[keyof EncodedRoutePathMap] & string;
|
|
10
|
+
type RoutePathUrl = RoutePatternUrl<RoutePath | EncodedRoutePath>;
|
|
11
|
+
/** Whether `routing.typedRoutes` is on in the generated route types. */
|
|
12
|
+
type TypedRoutes = RouteTypesConfig extends {
|
|
13
|
+
typedRoutes: true;
|
|
14
|
+
} ? true : false;
|
|
15
|
+
/** The URL of one of the app's routes. A plain string unless `routing.typedRoutes` is on. */
|
|
16
|
+
type RouteUrl$1 = TypedRoutes extends true ? RoutePathUrl | `${RoutePathUrl}${"?" | "#"}${string}` : string;
|
|
17
|
+
/** Anything a link can point to: a route URL, a same-page query or hash, or an external URL. */
|
|
18
|
+
type Href$1 = TypedRoutes extends true ? RouteUrl$1 | `${"?" | "#"}${string}` | `${"http://" | "https://" | "mailto:" | "tel:"}${string}` : string;
|
|
19
|
+
type RouteQueryValue = string | number | boolean | null | undefined;
|
|
20
|
+
type RouteQuery = Record<string, RouteQueryValue | ReadonlyArray<RouteQueryValue>>;
|
|
21
|
+
type RouteOptions<P extends RoutePath> = {
|
|
22
|
+
query?: RouteQuery;
|
|
23
|
+
hash?: string;
|
|
24
|
+
} & ([RoutePathMap[P]] extends [never] ? {
|
|
25
|
+
params?: never;
|
|
26
|
+
} : {
|
|
27
|
+
params: { [K in RoutePathMap[P] & string]: string | number; };
|
|
28
|
+
});
|
|
29
|
+
type RouteDestination$1<P extends RoutePath = RoutePath> = P extends RoutePath ? {
|
|
30
|
+
pathname: P;
|
|
31
|
+
} & RouteOptions<P> : never;
|
|
32
|
+
type RouteUrlInput$1 = Href$1 | URL | RouteDestination$1;
|
|
33
|
+
/** Build a relative URL from a known route pattern. */
|
|
34
|
+
declare function routeUrl<P extends RoutePath>(path: P, ...args: [RoutePathMap[NoInfer<P>]] extends [never] ? [options?: RouteOptions<P>] : [options: RouteOptions<P>]): RouteUrl$1;
|
|
35
|
+
/** @internal Convert navigation inputs to URL strings without requiring an origin. */
|
|
36
|
+
declare function toUrlString(value: RouteUrlInput$1): string;
|
|
37
|
+
export { RouteQuery as a, RouteUrlInput$1 as c, routeUrl as d, toUrlString as f, RoutePath as i, TypedRoutes as l, RouteDestination$1 as n, RouteQueryValue as o, RouteOptions as r, RouteUrl$1 as s, Href$1 as t, interpolateRouteParams as u };
|
package/dist/routes-stub.d.mts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as RouteQuery, c as RouteUrlInput, d as routeUrl, i as RoutePath, n as RouteDestination, o as RouteQueryValue, r as RouteOptions, s as RouteUrl, t as Href } from "./route-url-C_YIH_zO.mjs";
|
|
2
2
|
/** Known URL patterns and their parameter names, augmented by .void/routes.d.ts. */
|
|
3
3
|
export interface RoutePathMap {}
|
|
4
|
+
/** Percent-encoded spellings of patterns with encoded fixed segments, augmented by .void/routes.d.ts. */
|
|
5
|
+
export interface EncodedRoutePathMap {}
|
|
6
|
+
/** Route type options, augmented by .void/routes.d.ts when `routing.typedRoutes` is on. */
|
|
7
|
+
export interface RouteTypesConfig {}
|
|
4
8
|
/** Stub interface augmented by the generated .void/routes.d.ts */
|
|
5
9
|
export interface RouteMap {}
|
|
6
10
|
/** Stub interface augmented by the generated .void/routes.d.ts */
|
|
@@ -61,4 +65,4 @@ type PageActionUrl<K extends string, P> = P extends {
|
|
|
61
65
|
} ? `${K}?${keyof A & string}` : never;
|
|
62
66
|
/** Valid useForm URLs — single-action pages + "page?name" combos + default actions */
|
|
63
67
|
export type ActionUrl = { [K in keyof PageActionMap]: PageActionUrl<K & string, PageActionMap[K]>; }[keyof PageActionMap];
|
|
64
|
-
export { type RouteDestination, type RouteOptions, type RoutePath, type RouteQuery, type RouteQueryValue, type RouteUrlInput, routeUrl };
|
|
68
|
+
export { type Href, type RouteDestination, type RouteOptions, type RoutePath, type RouteQuery, type RouteQueryValue, type RouteUrl, type RouteUrlInput, routeUrl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as mysqlMigrationRunner, t as applyMySqlAuthMigrations } from "../auth-migrations-DDeifS3v.mjs";
|
|
2
|
-
import { n as resolveConnectionString, t as createVoidAuthRuntime } from "../better-auth-shared-
|
|
2
|
+
import { n as resolveConnectionString, t as createVoidAuthRuntime } from "../better-auth-shared-C958aM7W.mjs";
|
|
3
3
|
// src/runtime/better-auth-mysql.ts
|
|
4
4
|
async function applyMigrations(env, migrationSchema) {
|
|
5
5
|
const { createConnection } = await import("mysql2/promise");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as pgMigrationRunner, n as applyPgAuthMigrations } from "../auth-migrations-DDeifS3v.mjs";
|
|
2
|
-
import { n as resolveConnectionString, t as createVoidAuthRuntime } from "../better-auth-shared-
|
|
2
|
+
import { n as resolveConnectionString, t as createVoidAuthRuntime } from "../better-auth-shared-C958aM7W.mjs";
|
|
3
3
|
import { t as disablePgPassFallback } from "../pg-DoyPxa_X.mjs";
|
|
4
4
|
// src/runtime/better-auth-pg.ts
|
|
5
5
|
async function applyMigrations(env, migrationSchema) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as applySqliteAuthMigrations } from "../auth-migrations-DDeifS3v.mjs";
|
|
2
|
-
import { t as createVoidAuthRuntime } from "../better-auth-shared-
|
|
2
|
+
import { t as createVoidAuthRuntime } from "../better-auth-shared-C958aM7W.mjs";
|
|
3
3
|
// src/runtime/better-auth.ts
|
|
4
4
|
async function applyMigrations(env, migrationSchema) {
|
|
5
5
|
const database = env.DB;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as normalizeEmail, r as buildMime } from "../../mime-CtP6-qAF.mjs";
|
|
2
2
|
import { n as compileEmailPattern, t as compareEmailRoutes } from "../../email-BHY72ixO.mjs";
|
|
3
|
-
import { y as registerEmailSink } from "../../dev-inbox-
|
|
4
|
-
import { a as createMessageProxy, n as MAX_INBOUND_HEADERS, t as MAX_INBOUND_BYTES } from "../../inbound-
|
|
3
|
+
import { y as registerEmailSink } from "../../dev-inbox-CUUS6iUg.mjs";
|
|
4
|
+
import { a as createMessageProxy, n as MAX_INBOUND_HEADERS, t as MAX_INBOUND_BYTES } from "../../inbound-CdO-qY0w.mjs";
|
|
5
5
|
// src/runtime/email/testing.ts
|
|
6
6
|
/**
|
|
7
7
|
* Test harnesses for void/email.
|
package/dist/runtime/email.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
-
import { C as SendEmailOptions, S as SendEmailErrorCode, T as SendEmailResult, _ as Attachment, a as MessageProxy, b as SendEmailDelivery, c as ParsedEmail, d as defineEmail, f as enactEmailActions, g as Address, h as replyEmail, i as EmailHandlerInfo, l as ReplyEmailOptions, m as parseEmail, n as EmailEnvelope, o as ParseEmailError, p as isForwardableEmailMessage, r as EmailHandler, s as ParseEmailErrorCode, t as EmailAction, u as createMessageProxy, v as EmailDeliveryState, w as SendEmailRecipientResult, x as SendEmailError, y as NormalizedEmail } from "../inbound-
|
|
2
|
+
import { C as SendEmailOptions, S as SendEmailErrorCode, T as SendEmailResult, _ as Attachment, a as MessageProxy, b as SendEmailDelivery, c as ParsedEmail, d as defineEmail, f as enactEmailActions, g as Address, h as replyEmail, i as EmailHandlerInfo, l as ReplyEmailOptions, m as parseEmail, n as EmailEnvelope, o as ParseEmailError, p as isForwardableEmailMessage, r as EmailHandler, s as ParseEmailErrorCode, t as EmailAction, u as createMessageProxy, v as EmailDeliveryState, w as SendEmailRecipientResult, x as SendEmailError, y as NormalizedEmail } from "../inbound-BHt4dIlL.mjs";
|
|
3
3
|
type MimeErrorCode = "INVALID_FROM" | "INVALID_TO" | "MIME_ERROR";
|
|
4
4
|
export declare class MimeError extends Error {
|
|
5
5
|
code: MimeErrorCode;
|
package/dist/runtime/email.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as bytesToBase64 } from "../base64-ikl9yBy3.mjs";
|
|
2
|
-
import { a as
|
|
3
|
-
import { a as DEV_INBOX_ENV_VAR, b as serializeCapturedMessage, c as DEV_INBOX_TOKEN_ENV_VAR, d as captureMessage, h as hasActiveSink, i as DEV_INBOX_CAPTURE_URL, p as dispatchToSinks } from "../dev-inbox-
|
|
2
|
+
import { a as normalizeEmail, i as newId, n as MimeError, r as buildMime } from "../mime-CtP6-qAF.mjs";
|
|
3
|
+
import { a as DEV_INBOX_ENV_VAR, b as serializeCapturedMessage, c as DEV_INBOX_TOKEN_ENV_VAR, d as captureMessage, h as hasActiveSink, i as DEV_INBOX_CAPTURE_URL, p as dispatchToSinks } from "../dev-inbox-CUUS6iUg.mjs";
|
|
4
4
|
import { o as withTimeout, r as readBoundedJson } from "../email-protocol-DTs_TjCS.mjs";
|
|
5
|
-
import { a as createMessageProxy, c as isForwardableEmailMessage, d as readProjectSlug, f as replyEmail, i as bytesToReadableStream, l as parseEmail, o as defineEmail, p as tryGetRawRuntimeEnv, r as ParseEmailError, s as enactEmailActions, u as readEnvString } from "../inbound-
|
|
5
|
+
import { a as createMessageProxy, c as isForwardableEmailMessage, d as readProjectSlug, f as replyEmail, i as bytesToReadableStream, l as parseEmail, o as defineEmail, p as tryGetRawRuntimeEnv, r as ParseEmailError, s as enactEmailActions, u as readEnvString } from "../inbound-CdO-qY0w.mjs";
|
|
6
6
|
import { isRecord } from "@void/deploy-core";
|
|
7
7
|
// src/runtime/email.ts
|
|
8
8
|
function makeError(code, message, cause) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
-
import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, n as CloudBindings, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, w as ValidationError, y as defineScheduled } from "../handler-
|
|
2
|
+
import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, n as CloudBindings, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, w as ValidationError, y as defineScheduled } from "../handler-BR6Tvjkp.mjs";
|
|
3
3
|
export { BasicAuthOptions, CloudBindings, CloudContext, CloudContextVariables, CloudEnv, type Deferred, type HandlerInput, type InferProps, QueueBatch, QueueMessage, QueueRetryOptions, RenderAssetTags, TypedHandler, TypedQueueHandler, ValidationError, type ValidatorSlots, VoidAssetRewriteError, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled };
|
package/dist/runtime/handler.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { r as defer, t as ValidationError } from "../validation-error-
|
|
2
|
-
import { a as defineMiddleware, c as defineScheduled, i as defineHead, n as basicAuth, o as defineQueue, r as defineHandler, s as defineRender, t as VoidAssetRewriteError } from "../handler-
|
|
1
|
+
import { r as defer, t as ValidationError } from "../validation-error-uAAjlsiW.mjs";
|
|
2
|
+
import { a as defineMiddleware, c as defineScheduled, i as defineHead, n as basicAuth, o as defineQueue, r as defineHandler, s as defineRender, t as VoidAssetRewriteError } from "../handler-CKeTtYID.mjs";
|
|
3
3
|
export { ValidationError, VoidAssetRewriteError, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled };
|
package/dist/runtime/live.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
-
import { _ as __getLiveBindingName, a as LiveControlErrorCode, b as defineLiveStream, c as LiveControlOptions, d as LiveHookContext, f as LiveLimits, g as LiveSubscribeHookContext, h as LiveStreamOptions, i as LiveControlError, l as LiveControlRequest, m as LiveStream, n as LiveConnectHookContext, o as LiveControlOperation, p as LivePublishOptions, r as LiveConnectOptions, s as LiveControlOperationResult, t as LiveClientEvent, u as LiveControlResponse, v as __setLiveBindingName, y as __setLiveDev } from "../live-
|
|
2
|
+
import { _ as __getLiveBindingName, a as LiveControlErrorCode, b as defineLiveStream, c as LiveControlOptions, d as LiveHookContext, f as LiveLimits, g as LiveSubscribeHookContext, h as LiveStreamOptions, i as LiveControlError, l as LiveControlRequest, m as LiveStream, n as LiveConnectHookContext, o as LiveControlOperation, p as LivePublishOptions, r as LiveConnectOptions, s as LiveControlOperationResult, t as LiveClientEvent, u as LiveControlResponse, v as __setLiveBindingName, y as __setLiveDev } from "../live-0xrcVpyq.mjs";
|
|
3
3
|
export { LiveClientEvent, LiveConnectHookContext, LiveConnectOptions, LiveControlError, LiveControlErrorCode, LiveControlOperation, LiveControlOperationResult, LiveControlOptions, LiveControlRequest, LiveControlResponse, LiveHookContext, LiveLimits, LivePublishOptions, LiveStream, LiveStreamOptions, LiveSubscribeHookContext, __getLiveBindingName, __setLiveBindingName, __setLiveDev, defineLiveStream };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { RouteDestination, RouteOptions, RoutePath, RouteQuery, RouteQueryValue, RouteUrlInput, interpolateRouteParams, routeUrl, toUrlString };
|
|
1
|
+
import { a as RouteQuery, c as RouteUrlInput, d as routeUrl, f as toUrlString, i as RoutePath, l as TypedRoutes, n as RouteDestination, o as RouteQueryValue, r as RouteOptions, s as RouteUrl, t as Href, u as interpolateRouteParams } from "../route-url-C_YIH_zO.mjs";
|
|
2
|
+
export { Href, RouteDestination, RouteOptions, RoutePath, RouteQuery, RouteQueryValue, RouteUrl, RouteUrlInput, TypedRoutes, interpolateRouteParams, routeUrl, toUrlString };
|