@qzsy/vinext 0.1.7
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/LICENSE +21 -0
- package/README.md +773 -0
- package/dist/build/assets-ignore.d.ts +32 -0
- package/dist/build/assets-ignore.js +48 -0
- package/dist/build/clean-output.d.ts +13 -0
- package/dist/build/clean-output.js +34 -0
- package/dist/build/client-build-config.d.ts +171 -0
- package/dist/build/client-build-config.js +270 -0
- package/dist/build/css-url-assets.d.ts +29 -0
- package/dist/build/css-url-assets.js +213 -0
- package/dist/build/google-fonts/build-url.d.ts +9 -0
- package/dist/build/google-fonts/build-url.js +28 -0
- package/dist/build/google-fonts/fallback-metrics-data.js +14029 -0
- package/dist/build/google-fonts/fallback-metrics.d.ts +12 -0
- package/dist/build/google-fonts/fallback-metrics.js +44 -0
- package/dist/build/google-fonts/find-font-files-in-css.d.ts +16 -0
- package/dist/build/google-fonts/find-font-files-in-css.js +28 -0
- package/dist/build/google-fonts/font-data.js +24983 -0
- package/dist/build/google-fonts/font-metadata.d.ts +16 -0
- package/dist/build/google-fonts/font-metadata.js +5 -0
- package/dist/build/google-fonts/get-axes.d.ts +6 -0
- package/dist/build/google-fonts/get-axes.js +37 -0
- package/dist/build/google-fonts/sort-variants.d.ts +4 -0
- package/dist/build/google-fonts/sort-variants.js +12 -0
- package/dist/build/google-fonts/validate.d.ts +27 -0
- package/dist/build/google-fonts/validate.js +54 -0
- package/dist/build/inline-css.d.ts +6 -0
- package/dist/build/inline-css.js +48 -0
- package/dist/build/layout-classification-types.d.ts +61 -0
- package/dist/build/layout-classification-types.js +1 -0
- package/dist/build/layout-classification.d.ts +59 -0
- package/dist/build/layout-classification.js +98 -0
- package/dist/build/next-client-runtime-manifests.d.ts +14 -0
- package/dist/build/next-client-runtime-manifests.js +39 -0
- package/dist/build/nitro-route-rules.d.ts +49 -0
- package/dist/build/nitro-route-rules.js +79 -0
- package/dist/build/precompress.d.ts +27 -0
- package/dist/build/precompress.js +110 -0
- package/dist/build/prerender.d.ts +209 -0
- package/dist/build/prerender.js +932 -0
- package/dist/build/report.d.ts +132 -0
- package/dist/build/report.js +504 -0
- package/dist/build/route-classification-injector.d.ts +34 -0
- package/dist/build/route-classification-injector.js +59 -0
- package/dist/build/route-classification-manifest.d.ts +52 -0
- package/dist/build/route-classification-manifest.js +143 -0
- package/dist/build/run-prerender.d.ts +61 -0
- package/dist/build/run-prerender.js +224 -0
- package/dist/build/server-manifest.d.ts +18 -0
- package/dist/build/server-manifest.js +22 -0
- package/dist/build/ssr-manifest.d.ts +18 -0
- package/dist/build/ssr-manifest.js +69 -0
- package/dist/build/standalone.d.ts +31 -0
- package/dist/build/standalone.js +203 -0
- package/dist/build/static-export.d.ts +55 -0
- package/dist/build/static-export.js +60 -0
- package/dist/cache/cache-adapters-virtual.d.ts +50 -0
- package/dist/cache/cache-adapters-virtual.js +45 -0
- package/dist/cache.d.ts +2 -0
- package/dist/cache.js +2 -0
- package/dist/check.d.ts +87 -0
- package/dist/check.js +1037 -0
- package/dist/cli-args.d.ts +33 -0
- package/dist/cli-args.js +124 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +744 -0
- package/dist/client/app-nav-failure-handler.d.ts +8 -0
- package/dist/client/app-nav-failure-handler.js +44 -0
- package/dist/client/empty-module.d.ts +1 -0
- package/dist/client/empty-module.js +1 -0
- package/dist/client/instrumentation-client-inject.d.ts +33 -0
- package/dist/client/instrumentation-client-inject.js +55 -0
- package/dist/client/instrumentation-client-state.d.ts +9 -0
- package/dist/client/instrumentation-client-state.js +17 -0
- package/dist/client/instrumentation-client.d.ts +7 -0
- package/dist/client/instrumentation-client.js +6 -0
- package/dist/client/navigation-runtime.d.ts +70 -0
- package/dist/client/navigation-runtime.js +169 -0
- package/dist/client/pages-router-link-navigation.d.ts +61 -0
- package/dist/client/pages-router-link-navigation.js +42 -0
- package/dist/client/validate-module-path.d.ts +17 -0
- package/dist/client/validate-module-path.js +24 -0
- package/dist/client/vinext-next-data.d.ts +44 -0
- package/dist/client/vinext-next-data.js +50 -0
- package/dist/client/window-next.d.ts +168 -0
- package/dist/client/window-next.js +57 -0
- package/dist/cloudflare/index.d.ts +3 -0
- package/dist/cloudflare/index.js +3 -0
- package/dist/cloudflare/src/cache/cdn-adapter.runtime.js +102 -0
- package/dist/cloudflare/src/cache/kv-data-adapter.runtime.d.ts +126 -0
- package/dist/cloudflare/src/cache/kv-data-adapter.runtime.js +435 -0
- package/dist/cloudflare/src/utils/cache-control-metadata.js +20 -0
- package/dist/cloudflare/tpr.d.ts +82 -0
- package/dist/cloudflare/tpr.js +558 -0
- package/dist/config/config-matchers.d.ts +257 -0
- package/dist/config/config-matchers.js +1046 -0
- package/dist/config/dotenv.d.ts +56 -0
- package/dist/config/dotenv.js +88 -0
- package/dist/config/next-config.d.ts +540 -0
- package/dist/config/next-config.js +1050 -0
- package/dist/config/tsconfig-paths.d.ts +21 -0
- package/dist/config/tsconfig-paths.js +157 -0
- package/dist/deploy.d.ts +190 -0
- package/dist/deploy.js +1033 -0
- package/dist/entries/app-browser-entry.d.ts +29 -0
- package/dist/entries/app-browser-entry.js +83 -0
- package/dist/entries/app-rsc-entry.d.ts +81 -0
- package/dist/entries/app-rsc-entry.js +943 -0
- package/dist/entries/app-rsc-manifest.d.ts +53 -0
- package/dist/entries/app-rsc-manifest.js +294 -0
- package/dist/entries/app-ssr-entry.d.ts +15 -0
- package/dist/entries/app-ssr-entry.js +24 -0
- package/dist/entries/pages-client-entry.d.ts +11 -0
- package/dist/entries/pages-client-entry.js +204 -0
- package/dist/entries/pages-entry-helpers.d.ts +2 -0
- package/dist/entries/pages-entry-helpers.js +2 -0
- package/dist/entries/pages-server-entry.d.ts +11 -0
- package/dist/entries/pages-server-entry.js +398 -0
- package/dist/entries/runtime-entry-module.d.ts +25 -0
- package/dist/entries/runtime-entry-module.js +46 -0
- package/dist/index.d.ts +115 -0
- package/dist/index.js +2661 -0
- package/dist/init.d.ts +69 -0
- package/dist/init.js +253 -0
- package/dist/plugins/ast-utils.d.ts +20 -0
- package/dist/plugins/ast-utils.js +78 -0
- package/dist/plugins/async-hooks-stub.d.ts +18 -0
- package/dist/plugins/async-hooks-stub.js +40 -0
- package/dist/plugins/client-reference-dedup.d.ts +35 -0
- package/dist/plugins/client-reference-dedup.js +189 -0
- package/dist/plugins/css-data-url.d.ts +6 -0
- package/dist/plugins/css-data-url.js +83 -0
- package/dist/plugins/dynamic-preload-metadata.d.ts +13 -0
- package/dist/plugins/dynamic-preload-metadata.js +413 -0
- package/dist/plugins/extensionless-dynamic-import.d.ts +6 -0
- package/dist/plugins/extensionless-dynamic-import.js +155 -0
- package/dist/plugins/fonts.d.ts +95 -0
- package/dist/plugins/fonts.js +711 -0
- package/dist/plugins/import-meta-url.d.ts +16 -0
- package/dist/plugins/import-meta-url.js +353 -0
- package/dist/plugins/instrumentation-client.d.ts +6 -0
- package/dist/plugins/instrumentation-client.js +27 -0
- package/dist/plugins/middleware-export-validation.d.ts +5 -0
- package/dist/plugins/middleware-export-validation.js +36 -0
- package/dist/plugins/middleware-server-only.d.ts +53 -0
- package/dist/plugins/middleware-server-only.js +90 -0
- package/dist/plugins/og-asset-ownership.d.ts +27 -0
- package/dist/plugins/og-asset-ownership.js +285 -0
- package/dist/plugins/og-assets.d.ts +50 -0
- package/dist/plugins/og-assets.js +229 -0
- package/dist/plugins/optimize-imports.d.ts +42 -0
- package/dist/plugins/optimize-imports.js +587 -0
- package/dist/plugins/postcss.d.ts +26 -0
- package/dist/plugins/postcss.js +96 -0
- package/dist/plugins/remove-console.d.ts +21 -0
- package/dist/plugins/remove-console.js +177 -0
- package/dist/plugins/require-context.d.ts +6 -0
- package/dist/plugins/require-context.js +185 -0
- package/dist/plugins/rsc-client-reference-loaders.d.ts +6 -0
- package/dist/plugins/rsc-client-reference-loaders.js +46 -0
- package/dist/plugins/rsc-client-shim-excludes.d.ts +6 -0
- package/dist/plugins/rsc-client-shim-excludes.js +35 -0
- package/dist/plugins/sass.d.ts +62 -0
- package/dist/plugins/sass.js +268 -0
- package/dist/plugins/server-externals-manifest.d.ts +26 -0
- package/dist/plugins/server-externals-manifest.js +81 -0
- package/dist/plugins/strip-server-exports.d.ts +21 -0
- package/dist/plugins/strip-server-exports.js +519 -0
- package/dist/plugins/typeof-window.d.ts +14 -0
- package/dist/plugins/typeof-window.js +150 -0
- package/dist/plugins/wasm-module-import.d.ts +15 -0
- package/dist/plugins/wasm-module-import.js +50 -0
- package/dist/routing/app-route-graph.d.ts +336 -0
- package/dist/routing/app-route-graph.js +1518 -0
- package/dist/routing/app-router.d.ts +30 -0
- package/dist/routing/app-router.js +59 -0
- package/dist/routing/file-matcher.d.ts +60 -0
- package/dist/routing/file-matcher.js +147 -0
- package/dist/routing/pages-router.d.ts +48 -0
- package/dist/routing/pages-router.js +163 -0
- package/dist/routing/route-matching.d.ts +27 -0
- package/dist/routing/route-matching.js +42 -0
- package/dist/routing/route-pattern.d.ts +64 -0
- package/dist/routing/route-pattern.js +165 -0
- package/dist/routing/route-trie.d.ts +67 -0
- package/dist/routing/route-trie.js +143 -0
- package/dist/routing/route-validation.d.ts +10 -0
- package/dist/routing/route-validation.js +101 -0
- package/dist/routing/utils.d.ts +117 -0
- package/dist/routing/utils.js +242 -0
- package/dist/server/accept-encoding.d.ts +29 -0
- package/dist/server/accept-encoding.js +95 -0
- package/dist/server/api-handler.d.ts +17 -0
- package/dist/server/api-handler.js +276 -0
- package/dist/server/app-action-request.d.ts +4 -0
- package/dist/server/app-action-request.js +9 -0
- package/dist/server/app-bfcache-id.d.ts +5 -0
- package/dist/server/app-bfcache-id.js +5 -0
- package/dist/server/app-bfcache-identity.d.ts +36 -0
- package/dist/server/app-bfcache-identity.js +156 -0
- package/dist/server/app-browser-action-result.d.ts +64 -0
- package/dist/server/app-browser-action-result.js +111 -0
- package/dist/server/app-browser-client-reuse-manifest.d.ts +12 -0
- package/dist/server/app-browser-client-reuse-manifest.js +101 -0
- package/dist/server/app-browser-entry.d.ts +1 -0
- package/dist/server/app-browser-entry.js +1087 -0
- package/dist/server/app-browser-error.d.ts +13 -0
- package/dist/server/app-browser-error.js +52 -0
- package/dist/server/app-browser-history-controller.d.ts +104 -0
- package/dist/server/app-browser-history-controller.js +210 -0
- package/dist/server/app-browser-hydration.d.ts +32 -0
- package/dist/server/app-browser-hydration.js +29 -0
- package/dist/server/app-browser-interception-context.d.ts +24 -0
- package/dist/server/app-browser-interception-context.js +43 -0
- package/dist/server/app-browser-mpa-navigation.d.ts +16 -0
- package/dist/server/app-browser-mpa-navigation.js +42 -0
- package/dist/server/app-browser-navigation-controller.d.ts +109 -0
- package/dist/server/app-browser-navigation-controller.js +465 -0
- package/dist/server/app-browser-popstate.d.ts +26 -0
- package/dist/server/app-browser-popstate.js +44 -0
- package/dist/server/app-browser-rsc-redirect.d.ts +38 -0
- package/dist/server/app-browser-rsc-redirect.js +64 -0
- package/dist/server/app-browser-server-action-client.d.ts +32 -0
- package/dist/server/app-browser-server-action-client.js +128 -0
- package/dist/server/app-browser-server-action-navigation.d.ts +6 -0
- package/dist/server/app-browser-server-action-navigation.js +9 -0
- package/dist/server/app-browser-state.d.ts +140 -0
- package/dist/server/app-browser-state.js +315 -0
- package/dist/server/app-browser-stream.d.ts +28 -0
- package/dist/server/app-browser-stream.js +122 -0
- package/dist/server/app-browser-visible-commit.d.ts +78 -0
- package/dist/server/app-browser-visible-commit.js +241 -0
- package/dist/server/app-client-reference-preloader.d.ts +14 -0
- package/dist/server/app-client-reference-preloader.js +44 -0
- package/dist/server/app-elements-wire.d.ts +192 -0
- package/dist/server/app-elements-wire.js +443 -0
- package/dist/server/app-elements.d.ts +9 -0
- package/dist/server/app-elements.js +18 -0
- package/dist/server/app-fallback-renderer.d.ts +89 -0
- package/dist/server/app-fallback-renderer.js +136 -0
- package/dist/server/app-history-state.d.ts +85 -0
- package/dist/server/app-history-state.js +223 -0
- package/dist/server/app-hook-warning-suppression.d.ts +6 -0
- package/dist/server/app-hook-warning-suppression.js +10 -0
- package/dist/server/app-inline-css-client.d.ts +6 -0
- package/dist/server/app-inline-css-client.js +35 -0
- package/dist/server/app-interception-context-header.d.ts +32 -0
- package/dist/server/app-interception-context-header.js +42 -0
- package/dist/server/app-layout-param-observation.d.ts +43 -0
- package/dist/server/app-layout-param-observation.js +168 -0
- package/dist/server/app-middleware.d.ts +46 -0
- package/dist/server/app-middleware.js +168 -0
- package/dist/server/app-mounted-slots-header.d.ts +35 -0
- package/dist/server/app-mounted-slots-header.js +58 -0
- package/dist/server/app-optimistic-routing.d.ts +53 -0
- package/dist/server/app-optimistic-routing.js +227 -0
- package/dist/server/app-page-boundary-render.d.ts +85 -0
- package/dist/server/app-page-boundary-render.js +305 -0
- package/dist/server/app-page-boundary.d.ts +102 -0
- package/dist/server/app-page-boundary.js +120 -0
- package/dist/server/app-page-cache-finalizer.d.ts +62 -0
- package/dist/server/app-page-cache-finalizer.js +122 -0
- package/dist/server/app-page-cache-render.d.ts +53 -0
- package/dist/server/app-page-cache-render.js +91 -0
- package/dist/server/app-page-cache.d.ts +83 -0
- package/dist/server/app-page-cache.js +272 -0
- package/dist/server/app-page-dispatch.d.ts +223 -0
- package/dist/server/app-page-dispatch.js +610 -0
- package/dist/server/app-page-element-builder.d.ts +96 -0
- package/dist/server/app-page-element-builder.js +205 -0
- package/dist/server/app-page-execution.d.ts +138 -0
- package/dist/server/app-page-execution.js +328 -0
- package/dist/server/app-page-head.d.ts +65 -0
- package/dist/server/app-page-head.js +228 -0
- package/dist/server/app-page-method.d.ts +15 -0
- package/dist/server/app-page-method.js +25 -0
- package/dist/server/app-page-params.d.ts +8 -0
- package/dist/server/app-page-params.js +39 -0
- package/dist/server/app-page-ppr-runtime.d.ts +7 -0
- package/dist/server/app-page-ppr-runtime.js +70 -0
- package/dist/server/app-page-probe.d.ts +134 -0
- package/dist/server/app-page-probe.js +276 -0
- package/dist/server/app-page-render-identity.d.ts +21 -0
- package/dist/server/app-page-render-identity.js +40 -0
- package/dist/server/app-page-render-observation.d.ts +36 -0
- package/dist/server/app-page-render-observation.js +82 -0
- package/dist/server/app-page-render.d.ts +111 -0
- package/dist/server/app-page-render.js +602 -0
- package/dist/server/app-page-request.d.ts +137 -0
- package/dist/server/app-page-request.js +216 -0
- package/dist/server/app-page-response.d.ts +68 -0
- package/dist/server/app-page-response.js +120 -0
- package/dist/server/app-page-route-wiring.d.ts +151 -0
- package/dist/server/app-page-route-wiring.js +452 -0
- package/dist/server/app-page-search-params-observation.d.ts +10 -0
- package/dist/server/app-page-search-params-observation.js +20 -0
- package/dist/server/app-page-segment-state.d.ts +9 -0
- package/dist/server/app-page-segment-state.js +80 -0
- package/dist/server/app-page-stream.d.ts +151 -0
- package/dist/server/app-page-stream.js +143 -0
- package/dist/server/app-pages-bridge.d.ts +63 -0
- package/dist/server/app-pages-bridge.js +63 -0
- package/dist/server/app-post-middleware-context.d.ts +15 -0
- package/dist/server/app-post-middleware-context.js +26 -0
- package/dist/server/app-ppr-fallback-shell-render.d.ts +18 -0
- package/dist/server/app-ppr-fallback-shell-render.js +26 -0
- package/dist/server/app-ppr-fallback-shell.d.ts +33 -0
- package/dist/server/app-ppr-fallback-shell.js +89 -0
- package/dist/server/app-prerender-endpoints.d.ts +18 -0
- package/dist/server/app-prerender-endpoints.js +94 -0
- package/dist/server/app-prerender-static-params.d.ts +30 -0
- package/dist/server/app-prerender-static-params.js +81 -0
- package/dist/server/app-render-dependency.d.ts +14 -0
- package/dist/server/app-render-dependency.js +41 -0
- package/dist/server/app-request-context.d.ts +20 -0
- package/dist/server/app-request-context.js +29 -0
- package/dist/server/app-route-handler-cache.d.ts +46 -0
- package/dist/server/app-route-handler-cache.js +78 -0
- package/dist/server/app-route-handler-dispatch.d.ts +49 -0
- package/dist/server/app-route-handler-dispatch.js +163 -0
- package/dist/server/app-route-handler-execution.d.ts +86 -0
- package/dist/server/app-route-handler-execution.js +128 -0
- package/dist/server/app-route-handler-policy.d.ts +55 -0
- package/dist/server/app-route-handler-policy.js +58 -0
- package/dist/server/app-route-handler-response.d.ts +28 -0
- package/dist/server/app-route-handler-response.js +145 -0
- package/dist/server/app-route-handler-runtime.d.ts +39 -0
- package/dist/server/app-route-handler-runtime.js +250 -0
- package/dist/server/app-route-module-loader.d.ts +91 -0
- package/dist/server/app-route-module-loader.js +83 -0
- package/dist/server/app-router-entry.d.ts +13 -0
- package/dist/server/app-router-entry.js +49 -0
- package/dist/server/app-rsc-cache-busting.d.ts +64 -0
- package/dist/server/app-rsc-cache-busting.js +206 -0
- package/dist/server/app-rsc-embedded-chunks.d.ts +8 -0
- package/dist/server/app-rsc-embedded-chunks.js +32 -0
- package/dist/server/app-rsc-error-handler.d.ts +20 -0
- package/dist/server/app-rsc-error-handler.js +28 -0
- package/dist/server/app-rsc-errors.d.ts +40 -0
- package/dist/server/app-rsc-errors.js +60 -0
- package/dist/server/app-rsc-handler.d.ts +201 -0
- package/dist/server/app-rsc-handler.js +538 -0
- package/dist/server/app-rsc-render-mode.d.ts +11 -0
- package/dist/server/app-rsc-render-mode.js +25 -0
- package/dist/server/app-rsc-request-normalization.d.ts +48 -0
- package/dist/server/app-rsc-request-normalization.js +75 -0
- package/dist/server/app-rsc-response-finalizer.d.ts +37 -0
- package/dist/server/app-rsc-response-finalizer.js +54 -0
- package/dist/server/app-rsc-route-matching.d.ts +93 -0
- package/dist/server/app-rsc-route-matching.js +134 -0
- package/dist/server/app-segment-config.d.ts +46 -0
- package/dist/server/app-segment-config.js +113 -0
- package/dist/server/app-server-action-execution.d.ts +219 -0
- package/dist/server/app-server-action-execution.js +767 -0
- package/dist/server/app-ssr-entry.d.ts +52 -0
- package/dist/server/app-ssr-entry.js +295 -0
- package/dist/server/app-ssr-error-meta.d.ts +13 -0
- package/dist/server/app-ssr-error-meta.js +48 -0
- package/dist/server/app-ssr-router-instance.d.ts +6 -0
- package/dist/server/app-ssr-router-instance.js +24 -0
- package/dist/server/app-ssr-stream.d.ts +60 -0
- package/dist/server/app-ssr-stream.js +408 -0
- package/dist/server/app-static-generation.d.ts +15 -0
- package/dist/server/app-static-generation.js +19 -0
- package/dist/server/app-visited-response-cache.d.ts +23 -0
- package/dist/server/app-visited-response-cache.js +19 -0
- package/dist/server/artifact-compatibility.d.ts +54 -0
- package/dist/server/artifact-compatibility.js +91 -0
- package/dist/server/before-interactive-head.d.ts +17 -0
- package/dist/server/before-interactive-head.js +35 -0
- package/dist/server/cache-control.d.ts +37 -0
- package/dist/server/cache-control.js +56 -0
- package/dist/server/cache-headers.d.ts +6 -0
- package/dist/server/cache-headers.js +17 -0
- package/dist/server/cache-proof.d.ts +364 -0
- package/dist/server/cache-proof.js +794 -0
- package/dist/server/client-reuse-manifest.d.ts +104 -0
- package/dist/server/client-reuse-manifest.js +209 -0
- package/dist/server/client-trace-metadata.d.ts +30 -0
- package/dist/server/client-trace-metadata.js +81 -0
- package/dist/server/cookie-utils.d.ts +12 -0
- package/dist/server/cookie-utils.js +18 -0
- package/dist/server/csp.d.ts +10 -0
- package/dist/server/csp.js +41 -0
- package/dist/server/default-global-error-module.d.ts +19 -0
- package/dist/server/default-global-error-module.js +18 -0
- package/dist/server/default-not-found-module.d.ts +19 -0
- package/dist/server/default-not-found-module.js +18 -0
- package/dist/server/defer-until-stream-consumed.d.ts +7 -0
- package/dist/server/defer-until-stream-consumed.js +34 -0
- package/dist/server/dev-error-overlay-store.d.ts +39 -0
- package/dist/server/dev-error-overlay-store.js +86 -0
- package/dist/server/dev-error-overlay.d.ts +51 -0
- package/dist/server/dev-error-overlay.js +1341 -0
- package/dist/server/dev-initial-server-error.d.ts +9 -0
- package/dist/server/dev-initial-server-error.js +26 -0
- package/dist/server/dev-lockfile.d.ts +109 -0
- package/dist/server/dev-lockfile.js +179 -0
- package/dist/server/dev-module-runner.d.ts +30 -0
- package/dist/server/dev-module-runner.js +91 -0
- package/dist/server/dev-origin-check.d.ts +62 -0
- package/dist/server/dev-origin-check.js +156 -0
- package/dist/server/dev-route-files.d.ts +6 -0
- package/dist/server/dev-route-files.js +71 -0
- package/dist/server/dev-server.d.ts +58 -0
- package/dist/server/dev-server.js +1114 -0
- package/dist/server/dev-stack-sourcemap-endpoint.d.ts +4 -0
- package/dist/server/dev-stack-sourcemap-endpoint.js +4 -0
- package/dist/server/dev-stack-sourcemap.d.ts +43 -0
- package/dist/server/dev-stack-sourcemap.js +443 -0
- package/dist/server/document-initial-head.d.ts +6 -0
- package/dist/server/document-initial-head.js +33 -0
- package/dist/server/edge-api-runtime.d.ts +4 -0
- package/dist/server/edge-api-runtime.js +6 -0
- package/dist/server/file-based-metadata.d.ts +29 -0
- package/dist/server/file-based-metadata.js +401 -0
- package/dist/server/headers.d.ts +114 -0
- package/dist/server/headers.js +136 -0
- package/dist/server/html.d.ts +28 -0
- package/dist/server/html.js +41 -0
- package/dist/server/http-error-responses.d.ts +91 -0
- package/dist/server/http-error-responses.js +105 -0
- package/dist/server/hybrid-route-priority.d.ts +22 -0
- package/dist/server/hybrid-route-priority.js +33 -0
- package/dist/server/image-optimization.d.ts +130 -0
- package/dist/server/image-optimization.js +247 -0
- package/dist/server/implicit-tags.d.ts +6 -0
- package/dist/server/implicit-tags.js +44 -0
- package/dist/server/instrumentation-runtime.d.ts +49 -0
- package/dist/server/instrumentation-runtime.js +35 -0
- package/dist/server/instrumentation.d.ts +85 -0
- package/dist/server/instrumentation.js +130 -0
- package/dist/server/isr-cache.d.ts +127 -0
- package/dist/server/isr-cache.js +282 -0
- package/dist/server/isr-decision.d.ts +79 -0
- package/dist/server/isr-decision.js +70 -0
- package/dist/server/metadata-route-build-data.d.ts +24 -0
- package/dist/server/metadata-route-build-data.js +148 -0
- package/dist/server/metadata-route-response.d.ts +16 -0
- package/dist/server/metadata-route-response.js +205 -0
- package/dist/server/metadata-routes.d.ts +139 -0
- package/dist/server/metadata-routes.js +433 -0
- package/dist/server/middleware-matcher.d.ts +14 -0
- package/dist/server/middleware-matcher.js +111 -0
- package/dist/server/middleware-request-headers.d.ts +11 -0
- package/dist/server/middleware-request-headers.js +65 -0
- package/dist/server/middleware-response-headers.d.ts +12 -0
- package/dist/server/middleware-response-headers.js +42 -0
- package/dist/server/middleware-runtime.d.ts +67 -0
- package/dist/server/middleware-runtime.js +240 -0
- package/dist/server/middleware.d.ts +62 -0
- package/dist/server/middleware.js +114 -0
- package/dist/server/navigation-planner.d.ts +308 -0
- package/dist/server/navigation-planner.js +831 -0
- package/dist/server/navigation-trace.d.ts +68 -0
- package/dist/server/navigation-trace.js +71 -0
- package/dist/server/next-error-digest.d.ts +44 -0
- package/dist/server/next-error-digest.js +40 -0
- package/dist/server/normalize-path.d.ts +38 -0
- package/dist/server/normalize-path.js +70 -0
- package/dist/server/open-redirect.d.ts +12 -0
- package/dist/server/open-redirect.js +21 -0
- package/dist/server/operation-token.d.ts +40 -0
- package/dist/server/operation-token.js +85 -0
- package/dist/server/otel-tracer-extension.d.ts +45 -0
- package/dist/server/otel-tracer-extension.js +89 -0
- package/dist/server/pages-api-route.d.ts +83 -0
- package/dist/server/pages-api-route.js +75 -0
- package/dist/server/pages-asset-tags.d.ts +78 -0
- package/dist/server/pages-asset-tags.js +126 -0
- package/dist/server/pages-body-parser-config.d.ts +59 -0
- package/dist/server/pages-body-parser-config.js +77 -0
- package/dist/server/pages-data-route.d.ts +121 -0
- package/dist/server/pages-data-route.js +157 -0
- package/dist/server/pages-default-404.d.ts +30 -0
- package/dist/server/pages-default-404.js +38 -0
- package/dist/server/pages-dev-module-url.d.ts +4 -0
- package/dist/server/pages-dev-module-url.js +15 -0
- package/dist/server/pages-document-initial-props.d.ts +77 -0
- package/dist/server/pages-document-initial-props.js +109 -0
- package/dist/server/pages-get-initial-props.d.ts +67 -0
- package/dist/server/pages-get-initial-props.js +92 -0
- package/dist/server/pages-i18n.d.ts +106 -0
- package/dist/server/pages-i18n.js +183 -0
- package/dist/server/pages-media-type.d.ts +15 -0
- package/dist/server/pages-media-type.js +24 -0
- package/dist/server/pages-node-compat.d.ts +55 -0
- package/dist/server/pages-node-compat.js +235 -0
- package/dist/server/pages-page-data.d.ts +223 -0
- package/dist/server/pages-page-data.js +484 -0
- package/dist/server/pages-page-handler.d.ts +100 -0
- package/dist/server/pages-page-handler.js +403 -0
- package/dist/server/pages-page-method.d.ts +47 -0
- package/dist/server/pages-page-method.js +17 -0
- package/dist/server/pages-page-response.d.ts +138 -0
- package/dist/server/pages-page-response.js +285 -0
- package/dist/server/pages-readiness.d.ts +36 -0
- package/dist/server/pages-readiness.js +21 -0
- package/dist/server/pages-request-pipeline.d.ts +116 -0
- package/dist/server/pages-request-pipeline.js +311 -0
- package/dist/server/pages-revalidate.d.ts +15 -0
- package/dist/server/pages-revalidate.js +19 -0
- package/dist/server/pages-serializable-props.d.ts +24 -0
- package/dist/server/pages-serializable-props.js +67 -0
- package/dist/server/pregenerated-concrete-paths.d.ts +16 -0
- package/dist/server/pregenerated-concrete-paths.js +61 -0
- package/dist/server/prerender-manifest.d.ts +33 -0
- package/dist/server/prerender-manifest.js +54 -0
- package/dist/server/prerender-route-params.d.ts +23 -0
- package/dist/server/prerender-route-params.js +113 -0
- package/dist/server/prerender-work-unit-setup.d.ts +6 -0
- package/dist/server/prerender-work-unit-setup.js +28 -0
- package/dist/server/prod-server.d.ts +148 -0
- package/dist/server/prod-server.js +1136 -0
- package/dist/server/proxy-trust.d.ts +40 -0
- package/dist/server/proxy-trust.js +68 -0
- package/dist/server/request-log.d.ts +39 -0
- package/dist/server/request-log.js +56 -0
- package/dist/server/request-pipeline.d.ts +187 -0
- package/dist/server/request-pipeline.js +447 -0
- package/dist/server/rsc-stream-hints.d.ts +10 -0
- package/dist/server/rsc-stream-hints.js +41 -0
- package/dist/server/seed-cache.d.ts +29 -0
- package/dist/server/seed-cache.js +125 -0
- package/dist/server/server-action-not-found.d.ts +21 -0
- package/dist/server/server-action-not-found.js +62 -0
- package/dist/server/server-globals.d.ts +4 -0
- package/dist/server/server-globals.js +35 -0
- package/dist/server/skip-cache-proof.d.ts +61 -0
- package/dist/server/skip-cache-proof.js +168 -0
- package/dist/server/socket-error-backstop.d.ts +34 -0
- package/dist/server/socket-error-backstop.js +200 -0
- package/dist/server/static-file-cache.d.ts +56 -0
- package/dist/server/static-file-cache.js +231 -0
- package/dist/server/static-layout-client-reuse-proof.d.ts +15 -0
- package/dist/server/static-layout-client-reuse-proof.js +33 -0
- package/dist/server/streaming-metadata.d.ts +4 -0
- package/dist/server/streaming-metadata.js +8 -0
- package/dist/server/worker-utils.d.ts +7 -0
- package/dist/server/worker-utils.js +99 -0
- package/dist/shims/amp.d.ts +19 -0
- package/dist/shims/amp.js +23 -0
- package/dist/shims/app-router-scroll-state.d.ts +15 -0
- package/dist/shims/app-router-scroll-state.js +61 -0
- package/dist/shims/app-router-scroll.d.ts +29 -0
- package/dist/shims/app-router-scroll.js +141 -0
- package/dist/shims/app.d.ts +42 -0
- package/dist/shims/app.js +48 -0
- package/dist/shims/before-interactive-context.d.ts +40 -0
- package/dist/shims/before-interactive-context.js +8 -0
- package/dist/shims/cache-for-request.d.ts +57 -0
- package/dist/shims/cache-for-request.js +72 -0
- package/dist/shims/cache-handler.d.ts +106 -0
- package/dist/shims/cache-handler.js +176 -0
- package/dist/shims/cache-request-state.d.ts +47 -0
- package/dist/shims/cache-request-state.js +126 -0
- package/dist/shims/cache-runtime.d.ts +83 -0
- package/dist/shims/cache-runtime.js +452 -0
- package/dist/shims/cache.d.ts +145 -0
- package/dist/shims/cache.js +401 -0
- package/dist/shims/cdn-cache.d.ts +125 -0
- package/dist/shims/cdn-cache.js +100 -0
- package/dist/shims/client-hook-error.d.ts +13 -0
- package/dist/shims/client-hook-error.js +17 -0
- package/dist/shims/client-locale.d.ts +14 -0
- package/dist/shims/client-locale.js +11 -0
- package/dist/shims/client-only.d.ts +1 -0
- package/dist/shims/client-only.js +1 -0
- package/dist/shims/compat-router.d.ts +16 -0
- package/dist/shims/compat-router.js +25 -0
- package/dist/shims/config.d.ts +28 -0
- package/dist/shims/config.js +21 -0
- package/dist/shims/constants.d.ts +130 -0
- package/dist/shims/constants.js +167 -0
- package/dist/shims/default-global-error.d.ts +31 -0
- package/dist/shims/default-global-error.js +179 -0
- package/dist/shims/default-not-found.d.ts +11 -0
- package/dist/shims/default-not-found.js +59 -0
- package/dist/shims/document.d.ts +92 -0
- package/dist/shims/document.js +76 -0
- package/dist/shims/dynamic-preload-chunks.d.ts +8 -0
- package/dist/shims/dynamic-preload-chunks.js +79 -0
- package/dist/shims/dynamic.d.ts +35 -0
- package/dist/shims/dynamic.js +204 -0
- package/dist/shims/error-boundary-navigation.d.ts +7 -0
- package/dist/shims/error-boundary-navigation.js +44 -0
- package/dist/shims/error-boundary.d.ts +155 -0
- package/dist/shims/error-boundary.js +342 -0
- package/dist/shims/error.d.ts +31 -0
- package/dist/shims/error.js +123 -0
- package/dist/shims/error.react-server.d.ts +9 -0
- package/dist/shims/error.react-server.js +6 -0
- package/dist/shims/fetch-cache.d.ts +136 -0
- package/dist/shims/fetch-cache.js +766 -0
- package/dist/shims/font-google-base.d.ts +83 -0
- package/dist/shims/font-google-base.js +290 -0
- package/dist/shims/font-google.d.ts +2 -0
- package/dist/shims/font-google.js +2 -0
- package/dist/shims/font-local.d.ts +50 -0
- package/dist/shims/font-local.js +195 -0
- package/dist/shims/font-utils.d.ts +56 -0
- package/dist/shims/font-utils.js +107 -0
- package/dist/shims/form.d.ts +19 -0
- package/dist/shims/form.js +236 -0
- package/dist/shims/hash-scroll.d.ts +10 -0
- package/dist/shims/hash-scroll.js +47 -0
- package/dist/shims/head-state.d.ts +16 -0
- package/dist/shims/head-state.js +43 -0
- package/dist/shims/head.d.ts +73 -0
- package/dist/shims/head.js +340 -0
- package/dist/shims/headers.d.ts +253 -0
- package/dist/shims/headers.js +754 -0
- package/dist/shims/i18n-context.d.ts +22 -0
- package/dist/shims/i18n-context.js +42 -0
- package/dist/shims/i18n-state.d.ts +14 -0
- package/dist/shims/i18n-state.js +38 -0
- package/dist/shims/image-config.d.ts +45 -0
- package/dist/shims/image-config.js +85 -0
- package/dist/shims/image.d.ts +55 -0
- package/dist/shims/image.js +582 -0
- package/dist/shims/internal/als-registry.d.ts +14 -0
- package/dist/shims/internal/als-registry.js +80 -0
- package/dist/shims/internal/api-utils.d.ts +14 -0
- package/dist/shims/internal/api-utils.js +1 -0
- package/dist/shims/internal/app-page-props-cache-key.d.ts +5 -0
- package/dist/shims/internal/app-page-props-cache-key.js +16 -0
- package/dist/shims/internal/app-route-detection.d.ts +39 -0
- package/dist/shims/internal/app-route-detection.js +62 -0
- package/dist/shims/internal/app-router-context.d.ts +31 -0
- package/dist/shims/internal/app-router-context.js +28 -0
- package/dist/shims/internal/cookie-serialize.d.ts +45 -0
- package/dist/shims/internal/cookie-serialize.js +49 -0
- package/dist/shims/internal/cookies.d.ts +2 -0
- package/dist/shims/internal/cookies.js +2 -0
- package/dist/shims/internal/hybrid-client-route-owner.d.ts +31 -0
- package/dist/shims/internal/hybrid-client-route-owner.js +143 -0
- package/dist/shims/internal/interpolate-as.d.ts +25 -0
- package/dist/shims/internal/interpolate-as.js +196 -0
- package/dist/shims/internal/link-status-registry.d.ts +43 -0
- package/dist/shims/internal/link-status-registry.js +42 -0
- package/dist/shims/internal/make-hanging-promise.d.ts +15 -0
- package/dist/shims/internal/make-hanging-promise.js +44 -0
- package/dist/shims/internal/navigation-untracked.d.ts +35 -0
- package/dist/shims/internal/navigation-untracked.js +56 -0
- package/dist/shims/internal/pages-data-fetch-dedup.d.ts +54 -0
- package/dist/shims/internal/pages-data-fetch-dedup.js +121 -0
- package/dist/shims/internal/pages-data-target.d.ts +62 -0
- package/dist/shims/internal/pages-data-target.js +98 -0
- package/dist/shims/internal/pages-data-url.d.ts +41 -0
- package/dist/shims/internal/pages-data-url.js +71 -0
- package/dist/shims/internal/pages-router-accessor.d.ts +19 -0
- package/dist/shims/internal/pages-router-accessor.js +13 -0
- package/dist/shims/internal/route-pattern-for-warning.d.ts +27 -0
- package/dist/shims/internal/route-pattern-for-warning.js +40 -0
- package/dist/shims/internal/router-context.d.ts +7 -0
- package/dist/shims/internal/router-context.js +13 -0
- package/dist/shims/internal/utils.d.ts +52 -0
- package/dist/shims/internal/utils.js +27 -0
- package/dist/shims/internal/work-unit-async-storage.d.ts +30 -0
- package/dist/shims/internal/work-unit-async-storage.js +17 -0
- package/dist/shims/layout-segment-context.d.ts +24 -0
- package/dist/shims/layout-segment-context.js +39 -0
- package/dist/shims/legacy-image.d.ts +41 -0
- package/dist/shims/legacy-image.js +49 -0
- package/dist/shims/link-prefetch.d.ts +41 -0
- package/dist/shims/link-prefetch.js +43 -0
- package/dist/shims/link.d.ts +102 -0
- package/dist/shims/link.js +687 -0
- package/dist/shims/metadata.d.ts +285 -0
- package/dist/shims/metadata.js +820 -0
- package/dist/shims/navigation-context-state.d.ts +40 -0
- package/dist/shims/navigation-context-state.js +116 -0
- package/dist/shims/navigation-errors.d.ts +55 -0
- package/dist/shims/navigation-errors.js +110 -0
- package/dist/shims/navigation-server.d.ts +3 -0
- package/dist/shims/navigation-server.js +3 -0
- package/dist/shims/navigation-state.d.ts +25 -0
- package/dist/shims/navigation-state.js +66 -0
- package/dist/shims/navigation.d.ts +286 -0
- package/dist/shims/navigation.js +1206 -0
- package/dist/shims/navigation.react-server.d.ts +14 -0
- package/dist/shims/navigation.react-server.js +32 -0
- package/dist/shims/offline.d.ts +4 -0
- package/dist/shims/offline.js +15 -0
- package/dist/shims/og.d.ts +17 -0
- package/dist/shims/og.js +48 -0
- package/dist/shims/pages-router-runtime.d.ts +12 -0
- package/dist/shims/pages-router-runtime.js +24 -0
- package/dist/shims/ppr-fallback-shell.d.ts +33 -0
- package/dist/shims/ppr-fallback-shell.js +170 -0
- package/dist/shims/readonly-url-search-params.d.ts +13 -0
- package/dist/shims/readonly-url-search-params.js +26 -0
- package/dist/shims/request-context.d.ts +58 -0
- package/dist/shims/request-context.js +45 -0
- package/dist/shims/request-state-types.d.ts +12 -0
- package/dist/shims/request-state-types.js +1 -0
- package/dist/shims/root-params.d.ts +12 -0
- package/dist/shims/root-params.js +30 -0
- package/dist/shims/router-state.d.ts +32 -0
- package/dist/shims/router-state.js +39 -0
- package/dist/shims/router.d.ts +192 -0
- package/dist/shims/router.js +1786 -0
- package/dist/shims/script-nonce-context.d.ts +11 -0
- package/dist/shims/script-nonce-context.js +23 -0
- package/dist/shims/script.d.ts +43 -0
- package/dist/shims/script.js +370 -0
- package/dist/shims/server-only.d.ts +1 -0
- package/dist/shims/server-only.js +1 -0
- package/dist/shims/server.d.ts +323 -0
- package/dist/shims/server.js +729 -0
- package/dist/shims/slot.d.ts +45 -0
- package/dist/shims/slot.js +230 -0
- package/dist/shims/thenable-params.d.ts +11 -0
- package/dist/shims/thenable-params.js +176 -0
- package/dist/shims/unified-request-context.d.ts +68 -0
- package/dist/shims/unified-request-context.js +86 -0
- package/dist/shims/unrecognized-action-error.d.ts +34 -0
- package/dist/shims/unrecognized-action-error.js +39 -0
- package/dist/shims/url-safety.d.ts +34 -0
- package/dist/shims/url-safety.js +70 -0
- package/dist/shims/url-utils.d.ts +51 -0
- package/dist/shims/url-utils.js +156 -0
- package/dist/shims/use-merged-ref.d.ts +6 -0
- package/dist/shims/use-merged-ref.js +38 -0
- package/dist/shims/web-vitals.d.ts +8 -0
- package/dist/shims/web-vitals.js +22 -0
- package/dist/typegen.d.ts +9 -0
- package/dist/typegen.js +228 -0
- package/dist/utils/asset-prefix.d.ts +96 -0
- package/dist/utils/asset-prefix.js +122 -0
- package/dist/utils/base-path.d.ts +31 -0
- package/dist/utils/base-path.js +45 -0
- package/dist/utils/built-asset-url.d.ts +4 -0
- package/dist/utils/built-asset-url.js +11 -0
- package/dist/utils/cache-control-metadata.d.ts +4 -0
- package/dist/utils/cache-control-metadata.js +12 -0
- package/dist/utils/client-build-manifest.d.ts +21 -0
- package/dist/utils/client-build-manifest.js +87 -0
- package/dist/utils/client-entry-manifest.d.ts +11 -0
- package/dist/utils/client-entry-manifest.js +29 -0
- package/dist/utils/client-runtime-metadata.d.ts +45 -0
- package/dist/utils/client-runtime-metadata.js +63 -0
- package/dist/utils/commonjs-loader.d.ts +16 -0
- package/dist/utils/commonjs-loader.js +100 -0
- package/dist/utils/compare.d.ts +4 -0
- package/dist/utils/compare.js +8 -0
- package/dist/utils/deployment-id.d.ts +8 -0
- package/dist/utils/deployment-id.js +22 -0
- package/dist/utils/dev-error-recovery-event.d.ts +4 -0
- package/dist/utils/dev-error-recovery-event.js +4 -0
- package/dist/utils/domain-locale.d.ts +26 -0
- package/dist/utils/domain-locale.js +50 -0
- package/dist/utils/encode-cache-tag.d.ts +30 -0
- package/dist/utils/encode-cache-tag.js +36 -0
- package/dist/utils/error-cause.d.ts +4 -0
- package/dist/utils/error-cause.js +95 -0
- package/dist/utils/has-trailing-comma.d.ts +24 -0
- package/dist/utils/has-trailing-comma.js +62 -0
- package/dist/utils/hash.d.ts +24 -0
- package/dist/utils/hash.js +55 -0
- package/dist/utils/html-limited-bots.d.ts +21 -0
- package/dist/utils/html-limited-bots.js +35 -0
- package/dist/utils/lazy-chunks.d.ts +59 -0
- package/dist/utils/lazy-chunks.js +112 -0
- package/dist/utils/manifest-paths.d.ts +30 -0
- package/dist/utils/manifest-paths.js +66 -0
- package/dist/utils/mdx-scan.d.ts +9 -0
- package/dist/utils/mdx-scan.js +34 -0
- package/dist/utils/navigation-signal.d.ts +4 -0
- package/dist/utils/navigation-signal.js +12 -0
- package/dist/utils/number.d.ts +4 -0
- package/dist/utils/number.js +6 -0
- package/dist/utils/parse-cookie.d.ts +13 -0
- package/dist/utils/parse-cookie.js +52 -0
- package/dist/utils/path.d.ts +22 -0
- package/dist/utils/path.js +30 -0
- package/dist/utils/prerender-output-paths.d.ts +14 -0
- package/dist/utils/prerender-output-paths.js +22 -0
- package/dist/utils/project.d.ts +76 -0
- package/dist/utils/project.js +213 -0
- package/dist/utils/promise.d.ts +4 -0
- package/dist/utils/promise.js +6 -0
- package/dist/utils/public-routes.d.ts +4 -0
- package/dist/utils/public-routes.js +48 -0
- package/dist/utils/query.d.ts +49 -0
- package/dist/utils/query.js +122 -0
- package/dist/utils/record.d.ts +4 -0
- package/dist/utils/record.js +6 -0
- package/dist/utils/regex.d.ts +4 -0
- package/dist/utils/regex.js +6 -0
- package/dist/utils/safe-json-file.d.ts +17 -0
- package/dist/utils/safe-json-file.js +23 -0
- package/dist/utils/sorted-array.d.ts +8 -0
- package/dist/utils/sorted-array.js +20 -0
- package/dist/utils/text-stream.d.ts +28 -0
- package/dist/utils/text-stream.js +64 -0
- package/dist/utils/vinext-root.d.ts +23 -0
- package/dist/utils/vinext-root.js +29 -0
- package/dist/utils/virtual-module.d.ts +5 -0
- package/dist/utils/virtual-module.js +0 -0
- package/dist/utils/vite-version.d.ts +21 -0
- package/dist/utils/vite-version.js +42 -0
- package/package.json +145 -0
|
@@ -0,0 +1,767 @@
|
|
|
1
|
+
import { splitPathSegments } from "../routing/utils.js";
|
|
2
|
+
import { addBasePathToPathname, hasBasePath, stripBasePath } from "../utils/base-path.js";
|
|
3
|
+
import { ACTION_FORWARDED_HEADER, ACTION_REDIRECT_HEADER, ACTION_REDIRECT_STATUS_HEADER, ACTION_REDIRECT_TYPE_HEADER, ACTION_REVALIDATED_HEADER } from "./headers.js";
|
|
4
|
+
import { isExternalUrl } from "../config/config-matchers.js";
|
|
5
|
+
import { internalServerErrorResponse, payloadTooLargeResponse } from "./http-error-responses.js";
|
|
6
|
+
import { validateCsrfOrigin, validateServerActionPayload } from "./request-pipeline.js";
|
|
7
|
+
import { APP_RSC_RENDER_MODE_ACTION_RERENDER_PRESERVE_UI } from "./app-rsc-render-mode.js";
|
|
8
|
+
import { headersContextFromRequest, setHeadersContext } from "../shims/headers.js";
|
|
9
|
+
import { getAndClearActionRevalidationKind } from "../shims/cache-request-state.js";
|
|
10
|
+
import { setCurrentFetchCacheMode, setCurrentFetchSoftTags, setCurrentForceDynamicFetchDefault } from "../shims/fetch-cache.js";
|
|
11
|
+
import { readStreamAsTextWithLimit } from "../utils/text-stream.js";
|
|
12
|
+
import { VINEXT_RSC_CONTENT_TYPE, VINEXT_RSC_VARY_HEADER, applyRscCompatibilityIdHeader } from "./app-rsc-cache-busting.js";
|
|
13
|
+
import { mergeMiddlewareResponseHeaders } from "./middleware-response-headers.js";
|
|
14
|
+
import { applyEdgeRuntimeHeader } from "./app-page-response.js";
|
|
15
|
+
import { getNextErrorDigest, parseNextHttpErrorDigest, parseNextRedirectDigest } from "./next-error-digest.js";
|
|
16
|
+
import { createServerActionNotFoundResponse, getServerActionNotFoundMessage, isServerActionNotFoundError } from "./server-action-not-found.js";
|
|
17
|
+
import { deferUntilStreamConsumed } from "./defer-until-stream-consumed.js";
|
|
18
|
+
import "./app-page-stream.js";
|
|
19
|
+
import { buildAppPageTags } from "./implicit-tags.js";
|
|
20
|
+
import { resolveAppPageNavigationParams } from "./app-page-element-builder.js";
|
|
21
|
+
import { resolveAppPageActionRerenderTarget } from "./app-page-request.js";
|
|
22
|
+
import { getSetCookieName } from "./cookie-utils.js";
|
|
23
|
+
//#region src/server/app-server-action-execution.ts
|
|
24
|
+
/**
|
|
25
|
+
* Matches Next.js' server action argument cap to prevent stack overflow in
|
|
26
|
+
* Function.prototype.apply when decoding hostile action payloads.
|
|
27
|
+
*/
|
|
28
|
+
const SERVER_ACTION_ARGS_LIMIT = 1e3;
|
|
29
|
+
const ACTION_DID_NOT_REVALIDATE = 0;
|
|
30
|
+
const ACTION_DID_REVALIDATE_STATIC_AND_DYNAMIC = 1;
|
|
31
|
+
const ACTION_REDIRECT_RENDER_STRIPPED_HEADERS = [
|
|
32
|
+
"accept",
|
|
33
|
+
"content-length",
|
|
34
|
+
"content-type",
|
|
35
|
+
"next-action",
|
|
36
|
+
"origin",
|
|
37
|
+
"rsc",
|
|
38
|
+
"x-action-forwarded",
|
|
39
|
+
"x-rsc-action"
|
|
40
|
+
];
|
|
41
|
+
function setActionRevalidatedHeader(headers, kind) {
|
|
42
|
+
if (kind === ACTION_DID_NOT_REVALIDATE) return;
|
|
43
|
+
headers.set(ACTION_REVALIDATED_HEADER, JSON.stringify(kind));
|
|
44
|
+
}
|
|
45
|
+
function resolveActionRevalidationKind(hasModifiedCookies) {
|
|
46
|
+
const revalidationKind = getAndClearActionRevalidationKind();
|
|
47
|
+
if (hasModifiedCookies) return ACTION_DID_REVALIDATE_STATIC_AND_DYNAMIC;
|
|
48
|
+
return revalidationKind;
|
|
49
|
+
}
|
|
50
|
+
function clearRejectedActionSideEffects(getAndClearPendingCookies) {
|
|
51
|
+
getAndClearPendingCookies();
|
|
52
|
+
getAndClearActionRevalidationKind();
|
|
53
|
+
}
|
|
54
|
+
function cloneActionRedirectHeaders(requestHeaders) {
|
|
55
|
+
const headers = new Headers(requestHeaders);
|
|
56
|
+
for (const header of ACTION_REDIRECT_RENDER_STRIPPED_HEADERS) headers.delete(header);
|
|
57
|
+
return headers;
|
|
58
|
+
}
|
|
59
|
+
function readSetCookieNameValue(setCookie) {
|
|
60
|
+
const equalsIndex = setCookie.indexOf("=");
|
|
61
|
+
if (equalsIndex <= 0) return null;
|
|
62
|
+
const name = setCookie.slice(0, equalsIndex).trim();
|
|
63
|
+
const valueEnd = setCookie.indexOf(";", equalsIndex + 1);
|
|
64
|
+
return {
|
|
65
|
+
name,
|
|
66
|
+
value: setCookie.slice(equalsIndex + 1, valueEnd === -1 ? void 0 : valueEnd)
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function isExpiredSetCookie(setCookie) {
|
|
70
|
+
return /(?:^|;\s*)max-age=0(?:;|$)/i.test(setCookie) || /(?:^|;\s*)expires=Thu,\s*0?1[\s-]+Jan[\s-]+1970/i.test(setCookie);
|
|
71
|
+
}
|
|
72
|
+
function applySetCookieMutationsToRequestCookieHeader(cookieHeader, setCookies) {
|
|
73
|
+
const cookies = /* @__PURE__ */ new Map();
|
|
74
|
+
if (cookieHeader) for (const part of cookieHeader.split(";")) {
|
|
75
|
+
const trimmed = part.trim();
|
|
76
|
+
if (!trimmed) continue;
|
|
77
|
+
const equalsIndex = trimmed.indexOf("=");
|
|
78
|
+
if (equalsIndex <= 0) continue;
|
|
79
|
+
cookies.set(trimmed.slice(0, equalsIndex), trimmed.slice(equalsIndex + 1));
|
|
80
|
+
}
|
|
81
|
+
for (const setCookie of setCookies) {
|
|
82
|
+
const entry = readSetCookieNameValue(setCookie);
|
|
83
|
+
if (!entry) continue;
|
|
84
|
+
if (isExpiredSetCookie(setCookie)) cookies.delete(entry.name);
|
|
85
|
+
else cookies.set(entry.name, entry.value);
|
|
86
|
+
}
|
|
87
|
+
return cookies.size === 0 ? null : [...cookies].map(([name, value]) => `${name}=${value}`).join("; ");
|
|
88
|
+
}
|
|
89
|
+
function createActionRedirectRenderRequest(options) {
|
|
90
|
+
const headers = cloneActionRedirectHeaders(options.request.headers);
|
|
91
|
+
const cookieHeader = applySetCookieMutationsToRequestCookieHeader(headers.get("cookie"), options.pendingCookies);
|
|
92
|
+
if (cookieHeader === null) headers.delete("cookie");
|
|
93
|
+
else headers.set("cookie", cookieHeader);
|
|
94
|
+
return new Request(options.url, {
|
|
95
|
+
headers,
|
|
96
|
+
method: "GET"
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function withoutRscBodyHeaders(headers) {
|
|
100
|
+
const nextHeaders = new Headers(headers);
|
|
101
|
+
nextHeaders.delete("Content-Type");
|
|
102
|
+
nextHeaders.delete("Vary");
|
|
103
|
+
return nextHeaders;
|
|
104
|
+
}
|
|
105
|
+
function isReadableStreamBody(body) {
|
|
106
|
+
return typeof ReadableStream !== "undefined" && body instanceof ReadableStream;
|
|
107
|
+
}
|
|
108
|
+
function createServerActionRscResponse(body, init, clearRequestContext) {
|
|
109
|
+
if (!isReadableStreamBody(body)) {
|
|
110
|
+
clearRequestContext();
|
|
111
|
+
return new Response(body, init);
|
|
112
|
+
}
|
|
113
|
+
return new Response(deferUntilStreamConsumed(body, clearRequestContext), init);
|
|
114
|
+
}
|
|
115
|
+
function isRequestBodyTooLarge(error) {
|
|
116
|
+
return error instanceof Error && error.message === "Request body too large";
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Build the error thrown when a server-action request body exceeds the
|
|
120
|
+
* configured size limit. Matches Next.js' `Body exceeded {limit} limit.`
|
|
121
|
+
* message + docs link (action-handler.ts) verbatim — including the original
|
|
122
|
+
* config string (e.g. "2mb") — so it reads identically in logs.
|
|
123
|
+
*/
|
|
124
|
+
function createBodyExceededError(limitLabel) {
|
|
125
|
+
return /* @__PURE__ */ new Error(`Body exceeded ${limitLabel} limit.\nTo configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit`);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Collapse repeated `cookies().set(name, ...)` / `cookies().delete(name)`
|
|
129
|
+
* calls down to the last value per name, matching Next.js'
|
|
130
|
+
* `MutableRequestCookiesAdapter` semantics. Next.js stores response cookies in
|
|
131
|
+
* a `ResponseCookies` Map keyed by name — multiple sets for the same cookie
|
|
132
|
+
* collapse to the final value, and emit a single Set-Cookie header.
|
|
133
|
+
*
|
|
134
|
+
* Insertion order is preserved by first occurrence (Map iteration order),
|
|
135
|
+
* which mirrors how `ResponseCookies` iterates its underlying Map. See
|
|
136
|
+
* packages/next/src/server/web/spec-extension/adapters/request-cookies.ts.
|
|
137
|
+
* Issue: https://github.com/cloudflare/vinext/issues/1481
|
|
138
|
+
*/
|
|
139
|
+
function dedupePendingCookies(cookies) {
|
|
140
|
+
if (cookies.length <= 1) return cookies.slice();
|
|
141
|
+
const byName = /* @__PURE__ */ new Map();
|
|
142
|
+
const unkeyed = [];
|
|
143
|
+
for (const cookie of cookies) {
|
|
144
|
+
const name = getSetCookieName(cookie);
|
|
145
|
+
if (name === null) {
|
|
146
|
+
unkeyed.push(cookie);
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
byName.set(name, cookie);
|
|
150
|
+
}
|
|
151
|
+
return [...unkeyed, ...byName.values()];
|
|
152
|
+
}
|
|
153
|
+
function isAppServerActionFunction(action) {
|
|
154
|
+
return typeof action === "function";
|
|
155
|
+
}
|
|
156
|
+
function normalizeError(error) {
|
|
157
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
158
|
+
}
|
|
159
|
+
function getServerActionFailureMessage(error) {
|
|
160
|
+
return error instanceof Error && error.message ? error.message : String(error);
|
|
161
|
+
}
|
|
162
|
+
function validateServerActionArgs(args) {
|
|
163
|
+
if (args.length > SERVER_ACTION_ARGS_LIMIT) throw new Error(`Server Action arguments list is too long (${args.length}). Maximum allowed is ${SERVER_ACTION_ARGS_LIMIT}.`);
|
|
164
|
+
}
|
|
165
|
+
async function readActionBodyWithLimit(request, maxBytes) {
|
|
166
|
+
if (!request.body) return "";
|
|
167
|
+
return readStreamAsTextWithLimit(request.body, maxBytes, () => {
|
|
168
|
+
throw new Error("Request body too large");
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
async function readActionFormDataWithLimit(request, maxBytes) {
|
|
172
|
+
if (!request.body) return new FormData();
|
|
173
|
+
const reader = request.body.getReader();
|
|
174
|
+
const chunks = [];
|
|
175
|
+
let totalSize = 0;
|
|
176
|
+
for (;;) {
|
|
177
|
+
const result = await reader.read();
|
|
178
|
+
if (result.done) break;
|
|
179
|
+
totalSize += result.value.byteLength;
|
|
180
|
+
if (totalSize > maxBytes) {
|
|
181
|
+
reader.cancel();
|
|
182
|
+
throw new Error("Request body too large");
|
|
183
|
+
}
|
|
184
|
+
chunks.push(result.value);
|
|
185
|
+
}
|
|
186
|
+
const combined = new Uint8Array(totalSize);
|
|
187
|
+
let offset = 0;
|
|
188
|
+
for (const chunk of chunks) {
|
|
189
|
+
combined.set(chunk, offset);
|
|
190
|
+
offset += chunk.byteLength;
|
|
191
|
+
}
|
|
192
|
+
return new Response(combined, { headers: { "Content-Type": request.headers.get("content-type") || "" } }).formData();
|
|
193
|
+
}
|
|
194
|
+
function getActionRedirect(error) {
|
|
195
|
+
const digest = getNextErrorDigest(error);
|
|
196
|
+
if (!digest) return null;
|
|
197
|
+
const redirect = parseNextRedirectDigest(digest);
|
|
198
|
+
if (!redirect) return null;
|
|
199
|
+
return {
|
|
200
|
+
status: redirect.status,
|
|
201
|
+
type: redirect.type ?? "push",
|
|
202
|
+
url: redirect.url
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Prepend the configured next.config `basePath` to a server-action redirect
|
|
207
|
+
* target before it goes on the wire.
|
|
208
|
+
*
|
|
209
|
+
* `redirect("/foo")` called from a server action mounted at `/base/...` must
|
|
210
|
+
* land the browser at `/base/foo`, mirroring how Next.js threads basePath
|
|
211
|
+
* through `addPathPrefix(getURLFromRedirectError(err), basePath)` in
|
|
212
|
+
* `app-render.tsx` for SSR redirects and in `action-handler.ts` for action
|
|
213
|
+
* redirects.
|
|
214
|
+
*
|
|
215
|
+
* Idempotent and external-aware:
|
|
216
|
+
* - Empty basePath → returned unchanged.
|
|
217
|
+
* - External URLs (`http://`, `https://`, `data:`, protocol-relative `//`)
|
|
218
|
+
* are returned unchanged because the framework does not own those routes.
|
|
219
|
+
* - Targets that already start with the configured basePath are returned
|
|
220
|
+
* unchanged so this helper can be applied at any layer without risk of
|
|
221
|
+
* double-prefixing (`/base/base/foo`).
|
|
222
|
+
*
|
|
223
|
+
* Exported for tests. Used by both the progressive (no-JS form POST) and
|
|
224
|
+
* RSC (`ACTION_REDIRECT_HEADER`) action redirect paths below.
|
|
225
|
+
*
|
|
226
|
+
* @see https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/action-handler.ts
|
|
227
|
+
*/
|
|
228
|
+
function applyActionRedirectBasePath(url, basePath) {
|
|
229
|
+
if (!basePath) return url;
|
|
230
|
+
if (isExternalUrl(url)) return url;
|
|
231
|
+
if (hasBasePath(url, basePath)) return url;
|
|
232
|
+
if (!url.startsWith("/")) return url;
|
|
233
|
+
const queryIndex = url.indexOf("?");
|
|
234
|
+
const hashIndex = url.indexOf("#");
|
|
235
|
+
const splitAt = queryIndex === -1 ? hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
|
|
236
|
+
const pathname = splitAt === -1 ? url : url.slice(0, splitAt);
|
|
237
|
+
const suffix = splitAt === -1 ? "" : url.slice(splitAt);
|
|
238
|
+
return `${addBasePathToPathname(pathname, basePath)}${suffix}`;
|
|
239
|
+
}
|
|
240
|
+
function buildServerActionPageTags(route, pathname) {
|
|
241
|
+
return buildAppPageTags(pathname, [], route.routeSegments ?? []);
|
|
242
|
+
}
|
|
243
|
+
function resolveInternalActionRedirectTarget(redirectUrl, requestUrl, basePath) {
|
|
244
|
+
if (isExternalUrl(redirectUrl)) {
|
|
245
|
+
const requestOrigin = new URL(requestUrl).origin;
|
|
246
|
+
const parsed = new URL(redirectUrl);
|
|
247
|
+
if (parsed.origin !== requestOrigin) return null;
|
|
248
|
+
if (basePath && !hasBasePath(parsed.pathname, basePath)) return null;
|
|
249
|
+
return parsed;
|
|
250
|
+
}
|
|
251
|
+
let resolvedBase = requestUrl;
|
|
252
|
+
if (!redirectUrl.startsWith("/") && !/^[a-z]+:/i.test(redirectUrl)) {
|
|
253
|
+
const parsedRequestUrl = new URL(requestUrl);
|
|
254
|
+
let pathname = parsedRequestUrl.pathname;
|
|
255
|
+
if (!pathname.endsWith("/")) pathname = pathname + "/";
|
|
256
|
+
resolvedBase = `${parsedRequestUrl.origin}${pathname}${parsedRequestUrl.search}`;
|
|
257
|
+
}
|
|
258
|
+
return new URL(redirectUrl, resolvedBase);
|
|
259
|
+
}
|
|
260
|
+
function isAncestorRouteRedirect(targetPathname, currentPathname) {
|
|
261
|
+
return targetPathname !== "/" && currentPathname.startsWith(`${targetPathname}/`);
|
|
262
|
+
}
|
|
263
|
+
function isStaleChildSiblingRouteRedirect(targetPathname, currentPathname) {
|
|
264
|
+
const targetSegments = splitPathSegments(targetPathname);
|
|
265
|
+
const currentSegments = splitPathSegments(currentPathname);
|
|
266
|
+
if (targetSegments.length === 0 || currentSegments.length <= targetSegments.length) return false;
|
|
267
|
+
let commonPrefixLength = 0;
|
|
268
|
+
const maxPrefixLength = Math.min(targetSegments.length, currentSegments.length);
|
|
269
|
+
while (commonPrefixLength < maxPrefixLength && targetSegments[commonPrefixLength] === currentSegments[commonPrefixLength]) commonPrefixLength++;
|
|
270
|
+
return commonPrefixLength > 0 && commonPrefixLength < targetSegments.length;
|
|
271
|
+
}
|
|
272
|
+
function normalizeRuntime(runtime) {
|
|
273
|
+
if (runtime === "edge" || runtime === "experimental-edge") return "edge";
|
|
274
|
+
return "nodejs";
|
|
275
|
+
}
|
|
276
|
+
function shouldUseForwardedActionRedirectStatus(options) {
|
|
277
|
+
if (options.actionWasForwarded) return true;
|
|
278
|
+
if (isAncestorRouteRedirect(options.targetPathname, options.currentPathname)) return true;
|
|
279
|
+
if (isStaleChildSiblingRouteRedirect(options.targetPathname, options.currentPathname)) return true;
|
|
280
|
+
if (!options.currentRoute || !options.resolveRouteRuntime) return false;
|
|
281
|
+
return normalizeRuntime(options.resolveRouteRuntime(options.currentRoute)) !== normalizeRuntime(options.resolveRouteRuntime(options.targetRoute));
|
|
282
|
+
}
|
|
283
|
+
function canRenderActionRedirectTarget(route) {
|
|
284
|
+
if ("routeHandler" in route && route.routeHandler) return false;
|
|
285
|
+
return route.page !== null && route.page !== void 0;
|
|
286
|
+
}
|
|
287
|
+
function getActionHttpFallbackStatus(error) {
|
|
288
|
+
const digest = getNextErrorDigest(error);
|
|
289
|
+
if (!digest) return null;
|
|
290
|
+
const httpError = parseNextHttpErrorDigest(digest);
|
|
291
|
+
if (!httpError || !Number.isInteger(httpError.status)) return null;
|
|
292
|
+
return httpError.status;
|
|
293
|
+
}
|
|
294
|
+
function createServerActionErrorResponse(error, options) {
|
|
295
|
+
options.getAndClearPendingCookies();
|
|
296
|
+
console.error("[vinext] Server action error:", error);
|
|
297
|
+
options.reportRequestError(normalizeError(error), {
|
|
298
|
+
path: options.cleanPathname,
|
|
299
|
+
method: options.request.method,
|
|
300
|
+
headers: Object.fromEntries(options.request.headers.entries())
|
|
301
|
+
}, {
|
|
302
|
+
routerKind: "App Router",
|
|
303
|
+
routePath: options.cleanPathname,
|
|
304
|
+
routeType: "action"
|
|
305
|
+
});
|
|
306
|
+
options.clearRequestContext();
|
|
307
|
+
return internalServerErrorResponse(process.env.NODE_ENV === "production" ? void 0 : "Server action failed: " + getServerActionFailureMessage(error));
|
|
308
|
+
}
|
|
309
|
+
function createActionNotFoundResponse(actionId, options) {
|
|
310
|
+
options.getAndClearPendingCookies();
|
|
311
|
+
console.warn(getServerActionNotFoundMessage(actionId));
|
|
312
|
+
options.clearRequestContext();
|
|
313
|
+
return createServerActionNotFoundResponse();
|
|
314
|
+
}
|
|
315
|
+
function isProgressiveServerActionRequest(request, contentType, actionId) {
|
|
316
|
+
return request.method.toUpperCase() === "POST" && contentType.startsWith("multipart/form-data") && !actionId;
|
|
317
|
+
}
|
|
318
|
+
async function handleProgressiveServerActionRequest(options) {
|
|
319
|
+
if (!isProgressiveServerActionRequest(options.request, options.contentType, options.actionId)) return null;
|
|
320
|
+
const csrfResponse = validateCsrfOrigin(options.request, options.allowedOrigins);
|
|
321
|
+
if (csrfResponse) return csrfResponse;
|
|
322
|
+
if (parseInt(options.request.headers.get("content-length") || "0", 10) > options.maxActionBodySize) {
|
|
323
|
+
options.clearRequestContext();
|
|
324
|
+
return payloadTooLargeResponse();
|
|
325
|
+
}
|
|
326
|
+
try {
|
|
327
|
+
let body;
|
|
328
|
+
try {
|
|
329
|
+
body = await options.readFormDataWithLimit(options.request.clone(), options.maxActionBodySize);
|
|
330
|
+
} catch (error) {
|
|
331
|
+
if (isRequestBodyTooLarge(error)) {
|
|
332
|
+
options.clearRequestContext();
|
|
333
|
+
return payloadTooLargeResponse();
|
|
334
|
+
}
|
|
335
|
+
throw error;
|
|
336
|
+
}
|
|
337
|
+
const payloadResponse = await validateServerActionPayload(body);
|
|
338
|
+
if (payloadResponse) {
|
|
339
|
+
clearRejectedActionSideEffects(options.getAndClearPendingCookies);
|
|
340
|
+
options.clearRequestContext();
|
|
341
|
+
return payloadResponse;
|
|
342
|
+
}
|
|
343
|
+
const action = await options.decodeAction(body);
|
|
344
|
+
if (!isAppServerActionFunction(action)) {
|
|
345
|
+
if (options.hasPageRoute) return createActionNotFoundResponse(null, {
|
|
346
|
+
clearRequestContext: options.clearRequestContext,
|
|
347
|
+
getAndClearPendingCookies: options.getAndClearPendingCookies
|
|
348
|
+
});
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
351
|
+
let actionRedirect = null;
|
|
352
|
+
let actionError = void 0;
|
|
353
|
+
let actionFailed = false;
|
|
354
|
+
let actionResult;
|
|
355
|
+
const previousHeadersPhase = options.setHeadersAccessPhase("action");
|
|
356
|
+
try {
|
|
357
|
+
actionResult = await action();
|
|
358
|
+
} catch (error) {
|
|
359
|
+
actionRedirect = getActionRedirect(error);
|
|
360
|
+
if (!actionRedirect) {
|
|
361
|
+
actionError = error;
|
|
362
|
+
actionFailed = true;
|
|
363
|
+
if (!(getActionHttpFallbackStatus(error) !== null || isServerActionNotFoundError(error, null))) {
|
|
364
|
+
console.error("[vinext] Server action error:", error);
|
|
365
|
+
options.reportRequestError(normalizeError(error), {
|
|
366
|
+
path: options.cleanPathname,
|
|
367
|
+
method: options.request.method,
|
|
368
|
+
headers: Object.fromEntries(options.request.headers.entries())
|
|
369
|
+
}, {
|
|
370
|
+
routerKind: "App Router",
|
|
371
|
+
routePath: options.cleanPathname,
|
|
372
|
+
routeType: "action"
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
} finally {
|
|
377
|
+
options.setHeadersAccessPhase(previousHeadersPhase);
|
|
378
|
+
}
|
|
379
|
+
if (!actionRedirect) {
|
|
380
|
+
const actionPendingCookies = dedupePendingCookies(options.getAndClearPendingCookies());
|
|
381
|
+
const actionDraftCookie = options.getDraftModeCookieHeader();
|
|
382
|
+
const revalidationKind = resolveActionRevalidationKind(actionPendingCookies.length > 0 || Boolean(actionDraftCookie));
|
|
383
|
+
if (actionFailed) return {
|
|
384
|
+
kind: "form-state",
|
|
385
|
+
formState: null,
|
|
386
|
+
actionError,
|
|
387
|
+
actionFailed,
|
|
388
|
+
pendingCookies: actionPendingCookies,
|
|
389
|
+
draftCookie: actionDraftCookie,
|
|
390
|
+
revalidationKind
|
|
391
|
+
};
|
|
392
|
+
return {
|
|
393
|
+
kind: "form-state",
|
|
394
|
+
formState: await options.decodeFormState(actionResult, body) ?? null,
|
|
395
|
+
pendingCookies: actionPendingCookies,
|
|
396
|
+
draftCookie: actionDraftCookie,
|
|
397
|
+
revalidationKind
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
const actionPendingCookies = dedupePendingCookies(options.getAndClearPendingCookies());
|
|
401
|
+
const actionDraftCookie = options.getDraftModeCookieHeader();
|
|
402
|
+
const actionRevalidationKind = resolveActionRevalidationKind(actionPendingCookies.length > 0 || Boolean(actionDraftCookie));
|
|
403
|
+
options.clearRequestContext();
|
|
404
|
+
const headers = new Headers();
|
|
405
|
+
const prefixedRedirectUrl = applyActionRedirectBasePath(actionRedirect.url, options.basePath ?? "");
|
|
406
|
+
headers.set("Location", new URL(prefixedRedirectUrl, options.request.url).toString());
|
|
407
|
+
mergeMiddlewareResponseHeaders(headers, options.middlewareHeaders);
|
|
408
|
+
for (const cookie of actionPendingCookies) headers.append("Set-Cookie", cookie);
|
|
409
|
+
if (actionDraftCookie) headers.append("Set-Cookie", actionDraftCookie);
|
|
410
|
+
setActionRevalidatedHeader(headers, actionRevalidationKind);
|
|
411
|
+
return new Response(null, {
|
|
412
|
+
status: 303,
|
|
413
|
+
headers
|
|
414
|
+
});
|
|
415
|
+
} catch (error) {
|
|
416
|
+
if (isServerActionNotFoundError(error, null)) return createActionNotFoundResponse(null, {
|
|
417
|
+
clearRequestContext: options.clearRequestContext,
|
|
418
|
+
getAndClearPendingCookies: options.getAndClearPendingCookies
|
|
419
|
+
});
|
|
420
|
+
getAndClearActionRevalidationKind();
|
|
421
|
+
options.getAndClearPendingCookies();
|
|
422
|
+
console.error("[vinext] Server action payload parsing error:", error);
|
|
423
|
+
options.reportRequestError(normalizeError(error), {
|
|
424
|
+
path: options.cleanPathname,
|
|
425
|
+
method: options.request.method,
|
|
426
|
+
headers: Object.fromEntries(options.request.headers.entries())
|
|
427
|
+
}, {
|
|
428
|
+
routerKind: "App Router",
|
|
429
|
+
routePath: options.cleanPathname,
|
|
430
|
+
routeType: "action"
|
|
431
|
+
});
|
|
432
|
+
options.clearRequestContext();
|
|
433
|
+
return internalServerErrorResponse(process.env.NODE_ENV === "production" ? void 0 : "Server action parsing failed: " + getServerActionFailureMessage(error));
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Render the response for a fetch (client-invoked) server action whose request
|
|
438
|
+
* body exceeds the configured `serverActions.bodySizeLimit`.
|
|
439
|
+
*
|
|
440
|
+
* Next.js does not return a bare 413 here: it throws the body-exceeded error
|
|
441
|
+
* before the action runs, then — for fetch actions — emits a Flight response
|
|
442
|
+
* with status 500 carrying the rejected action result, so the nearest client
|
|
443
|
+
* error boundary catches it (see action-handler.ts, the `isFetchAction` branch
|
|
444
|
+
* of the generic error path). vinext mirrors that by rendering a Flight stream
|
|
445
|
+
* with `returnValue: { ok: false }` and no page root (the action never ran, so
|
|
446
|
+
* nothing was revalidated and the page render is skipped). A bare 413 plain
|
|
447
|
+
* response would bypass the boundary and surface the wrong status/content-type.
|
|
448
|
+
*/
|
|
449
|
+
async function renderFetchActionBodyExceededResponse(options) {
|
|
450
|
+
const error = createBodyExceededError(options.maxActionBodySizeLabel);
|
|
451
|
+
console.error("[vinext] Server action error:", error);
|
|
452
|
+
options.reportRequestError(normalizeError(error), {
|
|
453
|
+
path: options.cleanPathname,
|
|
454
|
+
method: options.request.method,
|
|
455
|
+
headers: Object.fromEntries(options.request.headers.entries())
|
|
456
|
+
}, {
|
|
457
|
+
routerKind: "App Router",
|
|
458
|
+
routePath: options.cleanPathname,
|
|
459
|
+
routeType: "action"
|
|
460
|
+
});
|
|
461
|
+
getAndClearActionRevalidationKind();
|
|
462
|
+
options.getAndClearPendingCookies();
|
|
463
|
+
const returnValue = {
|
|
464
|
+
ok: false,
|
|
465
|
+
data: options.sanitizeErrorForClient(error)
|
|
466
|
+
};
|
|
467
|
+
const temporaryReferences = options.createTemporaryReferenceSet();
|
|
468
|
+
const onRenderError = options.createRscOnErrorHandler(options.request, options.cleanPathname, options.cleanPathname);
|
|
469
|
+
const rscStream = await options.renderToReadableStream({ returnValue }, {
|
|
470
|
+
temporaryReferences,
|
|
471
|
+
onError: onRenderError
|
|
472
|
+
});
|
|
473
|
+
const headers = new Headers({
|
|
474
|
+
"Content-Type": VINEXT_RSC_CONTENT_TYPE,
|
|
475
|
+
Vary: VINEXT_RSC_VARY_HEADER
|
|
476
|
+
});
|
|
477
|
+
applyEdgeRuntimeHeader(headers, options.isEdgeRuntime);
|
|
478
|
+
mergeMiddlewareResponseHeaders(headers, options.middlewareHeaders);
|
|
479
|
+
applyRscCompatibilityIdHeader(headers);
|
|
480
|
+
return createServerActionRscResponse(rscStream, {
|
|
481
|
+
status: 500,
|
|
482
|
+
headers
|
|
483
|
+
}, options.clearRequestContext);
|
|
484
|
+
}
|
|
485
|
+
async function handleServerActionRscRequest(options) {
|
|
486
|
+
if (options.request.method.toUpperCase() !== "POST" || !options.actionId) return null;
|
|
487
|
+
const csrfResponse = validateCsrfOrigin(options.request, options.allowedOrigins);
|
|
488
|
+
if (csrfResponse) return csrfResponse;
|
|
489
|
+
if (parseInt(options.request.headers.get("content-length") || "0", 10) > options.maxActionBodySize) {
|
|
490
|
+
if (options.request.body) options.request.body.cancel().catch(() => {});
|
|
491
|
+
return renderFetchActionBodyExceededResponse(options);
|
|
492
|
+
}
|
|
493
|
+
try {
|
|
494
|
+
let action;
|
|
495
|
+
if (options.contentType.startsWith("multipart/form-data")) {
|
|
496
|
+
let loadedAction;
|
|
497
|
+
try {
|
|
498
|
+
loadedAction = await options.loadServerAction(options.actionId);
|
|
499
|
+
} catch (error) {
|
|
500
|
+
if (isServerActionNotFoundError(error, options.actionId)) return createActionNotFoundResponse(options.actionId, {
|
|
501
|
+
clearRequestContext: options.clearRequestContext,
|
|
502
|
+
getAndClearPendingCookies: options.getAndClearPendingCookies
|
|
503
|
+
});
|
|
504
|
+
throw error;
|
|
505
|
+
}
|
|
506
|
+
if (!isAppServerActionFunction(loadedAction)) return createActionNotFoundResponse(options.actionId, {
|
|
507
|
+
clearRequestContext: options.clearRequestContext,
|
|
508
|
+
getAndClearPendingCookies: options.getAndClearPendingCookies
|
|
509
|
+
});
|
|
510
|
+
action = loadedAction;
|
|
511
|
+
}
|
|
512
|
+
let body;
|
|
513
|
+
try {
|
|
514
|
+
body = options.contentType.startsWith("multipart/form-data") ? await options.readFormDataWithLimit(options.request, options.maxActionBodySize) : await options.readBodyWithLimit(options.request, options.maxActionBodySize);
|
|
515
|
+
} catch (error) {
|
|
516
|
+
if (isRequestBodyTooLarge(error)) return renderFetchActionBodyExceededResponse(options);
|
|
517
|
+
throw error;
|
|
518
|
+
}
|
|
519
|
+
const payloadResponse = await validateServerActionPayload(body);
|
|
520
|
+
if (payloadResponse) {
|
|
521
|
+
clearRejectedActionSideEffects(options.getAndClearPendingCookies);
|
|
522
|
+
options.clearRequestContext();
|
|
523
|
+
return payloadResponse;
|
|
524
|
+
}
|
|
525
|
+
if (action === void 0) {
|
|
526
|
+
let loadedAction;
|
|
527
|
+
try {
|
|
528
|
+
loadedAction = await options.loadServerAction(options.actionId);
|
|
529
|
+
} catch (error) {
|
|
530
|
+
if (isServerActionNotFoundError(error, options.actionId)) return createActionNotFoundResponse(options.actionId, {
|
|
531
|
+
clearRequestContext: options.clearRequestContext,
|
|
532
|
+
getAndClearPendingCookies: options.getAndClearPendingCookies
|
|
533
|
+
});
|
|
534
|
+
throw error;
|
|
535
|
+
}
|
|
536
|
+
if (!isAppServerActionFunction(loadedAction)) return createActionNotFoundResponse(options.actionId, {
|
|
537
|
+
clearRequestContext: options.clearRequestContext,
|
|
538
|
+
getAndClearPendingCookies: options.getAndClearPendingCookies
|
|
539
|
+
});
|
|
540
|
+
action = loadedAction;
|
|
541
|
+
}
|
|
542
|
+
const temporaryReferences = options.createTemporaryReferenceSet();
|
|
543
|
+
const args = await options.decodeReply(body, { temporaryReferences });
|
|
544
|
+
let returnValue;
|
|
545
|
+
let actionRedirect = null;
|
|
546
|
+
let actionStatus = 200;
|
|
547
|
+
const actionWasForwarded = Boolean(options.request.headers.get(ACTION_FORWARDED_HEADER));
|
|
548
|
+
const previousHeadersPhase = options.setHeadersAccessPhase("action");
|
|
549
|
+
try {
|
|
550
|
+
try {
|
|
551
|
+
validateServerActionArgs(args);
|
|
552
|
+
returnValue = {
|
|
553
|
+
ok: true,
|
|
554
|
+
data: await action.apply(null, args)
|
|
555
|
+
};
|
|
556
|
+
} catch (error) {
|
|
557
|
+
actionRedirect = getActionRedirect(error);
|
|
558
|
+
if (actionRedirect) returnValue = {
|
|
559
|
+
ok: true,
|
|
560
|
+
data: void 0
|
|
561
|
+
};
|
|
562
|
+
else {
|
|
563
|
+
const httpFallbackStatus = getActionHttpFallbackStatus(error);
|
|
564
|
+
if (httpFallbackStatus !== null) {
|
|
565
|
+
actionStatus = httpFallbackStatus;
|
|
566
|
+
returnValue = {
|
|
567
|
+
ok: false,
|
|
568
|
+
data: error
|
|
569
|
+
};
|
|
570
|
+
} else {
|
|
571
|
+
console.error("[vinext] Server action error:", error);
|
|
572
|
+
returnValue = {
|
|
573
|
+
ok: false,
|
|
574
|
+
data: options.sanitizeErrorForClient(error)
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
} finally {
|
|
580
|
+
options.setHeadersAccessPhase(previousHeadersPhase);
|
|
581
|
+
}
|
|
582
|
+
if (actionRedirect) {
|
|
583
|
+
const actionPendingCookies = dedupePendingCookies(options.getAndClearPendingCookies());
|
|
584
|
+
const actionDraftCookie = options.getDraftModeCookieHeader();
|
|
585
|
+
const actionRevalidationKind = resolveActionRevalidationKind(actionPendingCookies.length > 0 || Boolean(actionDraftCookie));
|
|
586
|
+
const redirectHeaders = new Headers({
|
|
587
|
+
"Content-Type": VINEXT_RSC_CONTENT_TYPE,
|
|
588
|
+
Vary: VINEXT_RSC_VARY_HEADER
|
|
589
|
+
});
|
|
590
|
+
applyEdgeRuntimeHeader(redirectHeaders, options.isEdgeRuntime);
|
|
591
|
+
mergeMiddlewareResponseHeaders(redirectHeaders, options.middlewareHeaders);
|
|
592
|
+
applyRscCompatibilityIdHeader(redirectHeaders);
|
|
593
|
+
const actionRedirectUrl = applyActionRedirectBasePath(actionRedirect.url, options.basePath ?? "");
|
|
594
|
+
redirectHeaders.set(ACTION_REDIRECT_HEADER, actionRedirectUrl);
|
|
595
|
+
redirectHeaders.set(ACTION_REDIRECT_TYPE_HEADER, actionRedirect.type);
|
|
596
|
+
redirectHeaders.set(ACTION_REDIRECT_STATUS_HEADER, String(actionRedirect.status));
|
|
597
|
+
for (const cookie of actionPendingCookies) redirectHeaders.append("Set-Cookie", cookie);
|
|
598
|
+
if (actionDraftCookie) redirectHeaders.append("Set-Cookie", actionDraftCookie);
|
|
599
|
+
setActionRevalidatedHeader(redirectHeaders, actionRevalidationKind);
|
|
600
|
+
const redirectTarget = resolveInternalActionRedirectTarget(actionRedirectUrl, options.request.url, options.basePath ?? "");
|
|
601
|
+
if (!redirectTarget) {
|
|
602
|
+
options.clearRequestContext();
|
|
603
|
+
return new Response(null, {
|
|
604
|
+
status: 303,
|
|
605
|
+
headers: withoutRscBodyHeaders(redirectHeaders)
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
const targetPathname = stripBasePath(redirectTarget.pathname, options.basePath ?? "");
|
|
609
|
+
const targetMatch = options.matchRoute(targetPathname);
|
|
610
|
+
if (targetMatch) await options.ensureRouteLoaded?.(targetMatch.route);
|
|
611
|
+
if (!targetMatch || !canRenderActionRedirectTarget(targetMatch.route)) {
|
|
612
|
+
options.clearRequestContext();
|
|
613
|
+
return new Response(null, {
|
|
614
|
+
status: 303,
|
|
615
|
+
headers: withoutRscBodyHeaders(redirectHeaders)
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
const currentMatch = options.matchRoute(options.cleanPathname);
|
|
619
|
+
if (currentMatch) await options.ensureRouteLoaded?.(currentMatch.route);
|
|
620
|
+
const redirectRenderRequest = createActionRedirectRenderRequest({
|
|
621
|
+
pendingCookies: [...actionPendingCookies, ...actionDraftCookie ? [actionDraftCookie] : []],
|
|
622
|
+
request: options.request,
|
|
623
|
+
url: redirectTarget
|
|
624
|
+
});
|
|
625
|
+
setHeadersContext(headersContextFromRequest(redirectRenderRequest));
|
|
626
|
+
const redirectNavigationParams = resolveAppPageNavigationParams(targetMatch.route, targetMatch.params, targetPathname, null);
|
|
627
|
+
options.setNavigationContext({
|
|
628
|
+
pathname: targetPathname,
|
|
629
|
+
searchParams: redirectTarget.searchParams,
|
|
630
|
+
params: redirectNavigationParams
|
|
631
|
+
});
|
|
632
|
+
setCurrentFetchCacheMode(options.resolveRouteFetchCacheMode?.(targetMatch.route) ?? null);
|
|
633
|
+
setCurrentForceDynamicFetchDefault(options.resolveRouteDynamicConfig?.(targetMatch.route) === "force-dynamic");
|
|
634
|
+
setCurrentFetchSoftTags(buildServerActionPageTags(targetMatch.route, targetPathname));
|
|
635
|
+
const element = options.buildPageElement({
|
|
636
|
+
cleanPathname: targetPathname,
|
|
637
|
+
interceptOpts: void 0,
|
|
638
|
+
isRscRequest: true,
|
|
639
|
+
mountedSlotsHeader: null,
|
|
640
|
+
params: targetMatch.params,
|
|
641
|
+
request: redirectRenderRequest,
|
|
642
|
+
route: targetMatch.route,
|
|
643
|
+
searchParams: redirectTarget.searchParams,
|
|
644
|
+
renderMode: APP_RSC_RENDER_MODE_ACTION_RERENDER_PRESERVE_UI
|
|
645
|
+
});
|
|
646
|
+
const onRenderError = options.createRscOnErrorHandler(redirectRenderRequest, targetPathname, targetMatch.route.pattern);
|
|
647
|
+
return createServerActionRscResponse(await options.renderToReadableStream({
|
|
648
|
+
root: element,
|
|
649
|
+
returnValue
|
|
650
|
+
}, {
|
|
651
|
+
temporaryReferences,
|
|
652
|
+
onError: onRenderError
|
|
653
|
+
}), {
|
|
654
|
+
status: shouldUseForwardedActionRedirectStatus({
|
|
655
|
+
actionWasForwarded,
|
|
656
|
+
currentPathname: options.cleanPathname,
|
|
657
|
+
currentRoute: currentMatch?.route ?? null,
|
|
658
|
+
resolveRouteRuntime: options.resolveRouteRuntime,
|
|
659
|
+
targetPathname,
|
|
660
|
+
targetRoute: targetMatch.route
|
|
661
|
+
}) ? 200 : 303,
|
|
662
|
+
headers: redirectHeaders
|
|
663
|
+
}, options.clearRequestContext);
|
|
664
|
+
}
|
|
665
|
+
const actionPendingCookies = dedupePendingCookies(options.getAndClearPendingCookies());
|
|
666
|
+
const actionDraftCookie = options.getDraftModeCookieHeader();
|
|
667
|
+
const actionRevalidationKind = resolveActionRevalidationKind(actionPendingCookies.length > 0 || Boolean(actionDraftCookie));
|
|
668
|
+
if (actionWasForwarded || actionStatus === 200 && actionRevalidationKind === ACTION_DID_NOT_REVALIDATE) {
|
|
669
|
+
const onRenderError = options.createRscOnErrorHandler(options.request, options.cleanPathname, options.cleanPathname);
|
|
670
|
+
const rscStream = await options.renderToReadableStream({ returnValue }, {
|
|
671
|
+
temporaryReferences,
|
|
672
|
+
onError: onRenderError
|
|
673
|
+
});
|
|
674
|
+
const actionHeaders = new Headers({
|
|
675
|
+
"Content-Type": VINEXT_RSC_CONTENT_TYPE,
|
|
676
|
+
Vary: VINEXT_RSC_VARY_HEADER
|
|
677
|
+
});
|
|
678
|
+
applyEdgeRuntimeHeader(actionHeaders, options.isEdgeRuntime);
|
|
679
|
+
mergeMiddlewareResponseHeaders(actionHeaders, options.middlewareHeaders);
|
|
680
|
+
applyRscCompatibilityIdHeader(actionHeaders);
|
|
681
|
+
for (const cookie of actionPendingCookies) actionHeaders.append("Set-Cookie", cookie);
|
|
682
|
+
if (actionDraftCookie) actionHeaders.append("Set-Cookie", actionDraftCookie);
|
|
683
|
+
setActionRevalidatedHeader(actionHeaders, actionRevalidationKind);
|
|
684
|
+
return createServerActionRscResponse(rscStream, {
|
|
685
|
+
status: options.middlewareStatus ?? actionStatus,
|
|
686
|
+
headers: actionHeaders
|
|
687
|
+
}, options.clearRequestContext);
|
|
688
|
+
}
|
|
689
|
+
const match = options.matchRoute(options.cleanPathname);
|
|
690
|
+
let element;
|
|
691
|
+
let errorPattern = match ? match.route.pattern : options.cleanPathname;
|
|
692
|
+
if (match) {
|
|
693
|
+
const { route: actionRoute, params: actionParams } = match;
|
|
694
|
+
const actionRerenderTarget = await resolveAppPageActionRerenderTarget({
|
|
695
|
+
cleanPathname: options.cleanPathname,
|
|
696
|
+
currentParams: actionParams,
|
|
697
|
+
currentRoute: actionRoute,
|
|
698
|
+
findIntercept: options.findIntercept,
|
|
699
|
+
getRouteParamNames: options.getRouteParamNames,
|
|
700
|
+
getSourceRoute: options.getSourceRoute,
|
|
701
|
+
isRscRequest: options.isRscRequest,
|
|
702
|
+
toInterceptOpts: options.toInterceptOpts
|
|
703
|
+
});
|
|
704
|
+
const resolvedActionNavigationParams = resolveAppPageNavigationParams(actionRerenderTarget.route, actionRerenderTarget.navigationParams, options.cleanPathname, actionRerenderTarget.interceptOpts);
|
|
705
|
+
options.setNavigationContext({
|
|
706
|
+
pathname: options.cleanPathname,
|
|
707
|
+
searchParams: options.searchParams,
|
|
708
|
+
params: resolvedActionNavigationParams
|
|
709
|
+
});
|
|
710
|
+
await options.ensureRouteLoaded?.(actionRerenderTarget.route);
|
|
711
|
+
setCurrentFetchCacheMode(options.resolveRouteFetchCacheMode?.(actionRerenderTarget.route) ?? null);
|
|
712
|
+
setCurrentForceDynamicFetchDefault(options.resolveRouteDynamicConfig?.(actionRerenderTarget.route) === "force-dynamic");
|
|
713
|
+
setCurrentFetchSoftTags(buildServerActionPageTags(actionRerenderTarget.route, options.cleanPathname));
|
|
714
|
+
element = options.buildPageElement({
|
|
715
|
+
cleanPathname: options.cleanPathname,
|
|
716
|
+
interceptOpts: actionRerenderTarget.interceptOpts,
|
|
717
|
+
isRscRequest: options.isRscRequest,
|
|
718
|
+
mountedSlotsHeader: options.mountedSlotsHeader,
|
|
719
|
+
params: actionRerenderTarget.params,
|
|
720
|
+
request: options.request,
|
|
721
|
+
route: actionRerenderTarget.route,
|
|
722
|
+
searchParams: options.searchParams,
|
|
723
|
+
renderMode: APP_RSC_RENDER_MODE_ACTION_RERENDER_PRESERVE_UI
|
|
724
|
+
});
|
|
725
|
+
errorPattern = actionRerenderTarget.route.pattern;
|
|
726
|
+
} else {
|
|
727
|
+
const actionRouteId = options.createPayloadRouteId(options.cleanPathname, null);
|
|
728
|
+
element = options.createNotFoundElement(actionRouteId);
|
|
729
|
+
}
|
|
730
|
+
const onRenderError = options.createRscOnErrorHandler(options.request, options.cleanPathname, errorPattern);
|
|
731
|
+
const rscStream = await options.renderToReadableStream({
|
|
732
|
+
root: element,
|
|
733
|
+
returnValue
|
|
734
|
+
}, {
|
|
735
|
+
temporaryReferences,
|
|
736
|
+
onError: onRenderError
|
|
737
|
+
});
|
|
738
|
+
const actionHeaders = new Headers({
|
|
739
|
+
"Content-Type": VINEXT_RSC_CONTENT_TYPE,
|
|
740
|
+
Vary: VINEXT_RSC_VARY_HEADER
|
|
741
|
+
});
|
|
742
|
+
applyEdgeRuntimeHeader(actionHeaders, options.isEdgeRuntime);
|
|
743
|
+
mergeMiddlewareResponseHeaders(actionHeaders, options.middlewareHeaders);
|
|
744
|
+
applyRscCompatibilityIdHeader(actionHeaders);
|
|
745
|
+
setActionRevalidatedHeader(actionHeaders, actionRevalidationKind);
|
|
746
|
+
const actionResponse = createServerActionRscResponse(rscStream, {
|
|
747
|
+
status: options.middlewareStatus ?? actionStatus,
|
|
748
|
+
headers: actionHeaders
|
|
749
|
+
}, options.clearRequestContext);
|
|
750
|
+
if (actionPendingCookies.length > 0 || actionDraftCookie) {
|
|
751
|
+
for (const cookie of actionPendingCookies) actionResponse.headers.append("Set-Cookie", cookie);
|
|
752
|
+
if (actionDraftCookie) actionResponse.headers.append("Set-Cookie", actionDraftCookie);
|
|
753
|
+
}
|
|
754
|
+
return actionResponse;
|
|
755
|
+
} catch (error) {
|
|
756
|
+
getAndClearActionRevalidationKind();
|
|
757
|
+
return createServerActionErrorResponse(error, {
|
|
758
|
+
cleanPathname: options.cleanPathname,
|
|
759
|
+
clearRequestContext: options.clearRequestContext,
|
|
760
|
+
getAndClearPendingCookies: options.getAndClearPendingCookies,
|
|
761
|
+
reportRequestError: options.reportRequestError,
|
|
762
|
+
request: options.request
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
//#endregion
|
|
767
|
+
export { applyActionRedirectBasePath, handleProgressiveServerActionRequest, handleServerActionRscRequest, isProgressiveServerActionRequest, readActionBodyWithLimit, readActionFormDataWithLimit };
|