@finesoft/front 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/{browser-kFMjlLGT.d.mts → browser-CrZcKSpr.d.mts} +4 -4
  2. package/dist/{browser-DIU6Sxl3.mjs → browser-D6If-9VF.mjs} +84 -4
  3. package/dist/browser.d.mts +7 -7
  4. package/dist/browser.mjs +5 -5
  5. package/dist/{cookies-Bpf9VayB.d.mts → cookies-BXCwZoS_.d.mts} +12 -5
  6. package/dist/{fetch-policy-BHT8RtrL.mjs → fetch-policy-Cxk7F-Cu.mjs} +2 -2
  7. package/dist/{host-guard-DDWxLpFL.mjs → host-guard-DX4e3-45.mjs} +5 -1
  8. package/dist/{http-B6CJqDyf.d.mts → http-B8r7MWao.d.mts} +2 -2
  9. package/dist/http.d.mts +1 -1
  10. package/dist/index-node.d.mts +11 -11
  11. package/dist/index-node.mjs +8 -8
  12. package/dist/index.d.mts +15 -15
  13. package/dist/index.mjs +7 -7
  14. package/dist/{native-contract-DuR25hYB.d.mts → native-contract-B_2pn5ST.d.mts} +2 -2
  15. package/dist/native-contract.d.mts +1 -1
  16. package/dist/{node-D9hB4dsz.d.mts → node-DbGzbatF.d.mts} +4 -4
  17. package/dist/node.d.mts +1 -1
  18. package/dist/node.mjs +1 -1
  19. package/dist/{path-CXT6xGPO.d.mts → path-C-b1ChKq.d.mts} +6 -1
  20. package/dist/portable.d.mts +9 -9
  21. package/dist/portable.mjs +7 -7
  22. package/dist/proxy-BkKVP3Ha.mjs +7520 -0
  23. package/dist/{react-DhwBRw01.d.mts → react-C8AnI9sx.d.mts} +2 -2
  24. package/dist/react.d.mts +2 -2
  25. package/dist/{secure-fetch-Xlht2jd7.d.mts → secure-fetch--QwYr5uJ.d.mts} +5 -1
  26. package/dist/{server-controller-proxy-BkVuVWVD.d.mts → server-controller-proxy-CFdU_nGs.d.mts} +3 -3
  27. package/dist/{session-DnB4ZC3x.d.mts → session-BR1vd3yY.d.mts} +3 -3
  28. package/dist/{src-qwx7Vw8g.mjs → src-D_Bzbr80.mjs} +35 -8
  29. package/dist/{ssr-C8xnYXoY.mjs → ssr-DqwPGqOd.mjs} +3 -3
  30. package/dist/{ssr-BEUNDvbj.d.mts → ssr-lzuGJ2ux.d.mts} +6 -9
  31. package/dist/ssr.d.mts +1 -1
  32. package/dist/ssr.mjs +2 -2
  33. package/dist/{svelte-Dr5to3SE.d.mts → svelte-CMFFDLBi.d.mts} +2 -2
  34. package/dist/svelte.d.mts +2 -2
  35. package/dist/{types-BuaZHRG7.mjs → types-DD09OkGZ.mjs} +3 -3
  36. package/dist/{vite-Cj4SPA8D.d.mts → vite-BjWtbemg.d.mts} +10 -4
  37. package/dist/vite.d.mts +2 -2
  38. package/dist/vite.mjs +218 -44
  39. package/dist/{vue-DGmzuKho.d.mts → vue-DsZIYP1c.d.mts} +2 -2
  40. package/dist/vue.d.mts +2 -2
  41. package/dist/web.d.mts +6 -6
  42. package/dist/web.mjs +4 -4
  43. package/dist/worker.d.mts +1 -1
  44. package/docs/02-routing-and-controllers.md +2 -0
  45. package/docs/04-rendering-and-hydration.md +2 -0
  46. package/docs/06-http-client.md +4 -0
  47. package/docs/09-server-and-deployment.md +13 -0
  48. package/docs/11-navigation.md +2 -0
  49. package/docs/advanced/multi-tenant-scopes.md +24 -0
  50. package/docs/pitfalls/ssr-hydration-mismatch.md +10 -0
  51. package/docs/zh/02-routing-and-controllers.md +2 -0
  52. package/docs/zh/04-rendering-and-hydration.md +2 -0
  53. package/docs/zh/09-server-and-deployment.md +13 -0
  54. package/docs/zh/pitfalls/ssr-hydration-mismatch.md +10 -0
  55. package/package.json +22 -22
  56. package/dist/proxy-1SphZ7x7.mjs +0 -436
@@ -1,4 +1,4 @@
1
- import { f as AppSnapshot, g as WebAppView, h as ViewProps } from "./session-DnB4ZC3x.mjs";
1
+ import { f as AppSnapshot, g as WebAppView, h as ViewProps } from "./session-BR1vd3yY.mjs";
2
2
  import { ComponentType, ReactNode } from "react";
3
3
  declare namespace react_d_exports {
4
4
  export { NativeView, NativeViews, Outlet, ViewProps, WebAppView, useSnapshot };
@@ -13,4 +13,4 @@ declare function Outlet({ app, views }: {
13
13
  }): ReactNode;
14
14
  //#endregion
15
15
  export { useSnapshot as a, react_d_exports as i, NativeViews as n, Outlet as r, NativeView as t };
16
- //# sourceMappingURL=react-DhwBRw01.d.mts.map
16
+ //# sourceMappingURL=react-C8AnI9sx.d.mts.map
package/dist/react.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { g as WebAppView, h as ViewProps } from "./session-DnB4ZC3x.mjs";
2
- import { a as useSnapshot, n as NativeViews, r as Outlet, t as NativeView } from "./react-DhwBRw01.mjs";
1
+ import { g as WebAppView, h as ViewProps } from "./session-BR1vd3yY.mjs";
2
+ import { a as useSnapshot, n as NativeViews, r as Outlet, t as NativeView } from "./react-C8AnI9sx.mjs";
3
3
  export { NativeView, NativeViews, Outlet, type ViewProps, type WebAppView, useSnapshot };
@@ -4,6 +4,8 @@ type DnsLookup = (hostname: string) => Promise<readonly string[]>;
4
4
  interface TargetGuardOptions {
5
5
  readonly validateDns?: boolean;
6
6
  readonly lookup?: DnsLookup;
7
+ /** Exact host-owned origins trusted without DNS checks; literal address checks still apply. */
8
+ readonly trustedOrigins?: readonly string[];
7
9
  }
8
10
  /** Shared target policy for HttpClient and secureFetch. */
9
11
  declare function enforceHostGuard(url: string, options?: TargetGuardOptions): Promise<void>;
@@ -16,6 +18,8 @@ interface SecureFetchOptions {
16
18
  validateDns?: boolean;
17
19
  /** Required when DNS validation is enabled for a hostname. */
18
20
  lookup?: DnsLookup;
21
+ /** Exact trusted origins exempt from DNS checks, not literal checks. Rechecked on redirects. */
22
+ trustedOrigins?: readonly string[];
19
23
  /** Host transport enforcing policy at connection time; preserves the injected fetch. */
20
24
  wrapFetch?: (baseFetch: typeof globalThis.fetch) => typeof globalThis.fetch;
21
25
  }
@@ -27,4 +31,4 @@ interface SecureFetchOptions {
27
31
  declare function secureFetch(baseFetch: typeof globalThis.fetch, options?: SecureFetchOptions): typeof globalThis.fetch;
28
32
  //#endregion
29
33
  export { enforceHostGuard as a, TargetGuardOptions as i, secureFetch as n, DnsLookup as r, SecureFetchOptions as t };
30
- //# sourceMappingURL=secure-fetch-Xlht2jd7.d.mts.map
34
+ //# sourceMappingURL=secure-fetch--QwYr5uJ.d.mts.map
@@ -1,5 +1,5 @@
1
- import { c as ExecutionContext } from "./path-CXT6xGPO.mjs";
2
- import { gt as PrefetchedIntent, it as SerializedNavigation, un as BasePage, yn as RouteParams } from "./session-DnB4ZC3x.mjs";
1
+ import { c as ExecutionContext } from "./path-C-b1ChKq.mjs";
2
+ import { gt as PrefetchedIntent, it as SerializedNavigation, un as BasePage, yn as RouteParams } from "./session-BR1vd3yY.mjs";
3
3
  //#region ../web/src/protocol.d.ts
4
4
  declare const FRAMEWORK_PROTOCOL_VERSION = 2;
5
5
  declare function getFrameworkBuildId(): string;
@@ -35,4 +35,4 @@ declare class ServerControllerProxy {
35
35
  }
36
36
  //#endregion
37
37
  export { WebHydration as a, decodeWireEnvelope as c, FRAMEWORK_PROTOCOL_VERSION as i, getFrameworkBuildId as l, ServerControllerProxy as n, WireDecodeResult as o, ServerControllerRequest as r, WireEnvelope as s, SERVER_CONTROLLER_PATH as t };
38
- //# sourceMappingURL=server-controller-proxy-BkVuVWVD.d.mts.map
38
+ //# sourceMappingURL=server-controller-proxy-CFdU_nGs.d.mts.map
@@ -1,5 +1,5 @@
1
- import { E as ParamSchema, F as Token, S as EventRecorder, T as InferOutput, _ as OperationPolicy, c as ExecutionContext, d as ExecutionHandle, j as Container, k as StandardSchemaV1, n as PathDescriptor, p as Invocation, s as AppDefinition, y as RuntimeHandle } from "./path-CXT6xGPO.mjs";
2
- import { t as SecureFetchOptions } from "./secure-fetch-Xlht2jd7.mjs";
1
+ import { E as ParamSchema, F as Token, S as EventRecorder, T as InferOutput, _ as OperationPolicy, c as ExecutionContext, d as ExecutionHandle, j as Container, k as StandardSchemaV1, n as PathDescriptor, p as Invocation, s as AppDefinition, y as RuntimeHandle } from "./path-C-b1ChKq.mjs";
2
+ import { t as SecureFetchOptions } from "./secure-fetch--QwYr5uJ.mjs";
3
3
  //#region ../core/src/intents/types.d.ts
4
4
  /**
5
5
  * A route/navigation target. It remains a data transfer shape only: runtime
@@ -1276,4 +1276,4 @@ declare class NavigationCommitError extends Error {
1276
1276
  }
1277
1277
  //#endregion
1278
1278
  export { createActiveLeafCodec as $, list as $n, MiddlewareResult as $t, SessionStore as A, PlatformInfo as An, isCompoundAction as At, ControllerContext as B, ConsoleLoggerFactory as Bn, NavigationPath as Bt, SessionFailure as C, Storage as Cn, ACTION_KINDS as Ct, SessionSlice as D, LocaleInfo as Dn, ExternalUrlAction as Dt, SessionRestoreResult as E, LocaleAttributes as En, CompoundAction as Et, WebRuntime as F, ReportCallback as Fn, LeafNode as Ft, controllerContext as G, InferParams as Gn, SplitColumn as Gt, SERVER_CONTROLLER as H, Logger as Hn, NavigationSnapshot as Ht, WebRuntimeOptions as I, ReportingLogger as In, NAVIGATION_NODE_KINDS as It, resolveConfiguredMessages as J, QuerySchemaMap as Jn, StackNode as Jt, MessagesLoader as K, InferQuery as Kn, SplitNode as Kt, createWebRuntime as L, ReportingLoggerFactory as Ln, NavigationError as Lt, SessionWriteResult as M, BaseController as Mn, isFlowAction as Mt, StorageUnavailableError as N, ControllerFailure as Nn, makeExternalUrlAction as Nt, SessionSnapshot as O, TextDirection as On, FlowAction as Ot, WebConfiguration as P, ControllerInput as Pn, makeFlowAction as Pt, NavigationRouterLike as Q, isMultiValueSchema as Qn, DenyResult as Qt, PageControllerDefinition as R, ReportingLoggerOptions as Rn, NavigationNode as Rt, SessionErrorContext as S, FeatureFlagsProvider as Sn, ActionHandler as St, SessionNavigation as T, resolveMessages as Tn, ActionInvocation as Tt, SERVER_REQUEST as U, LoggerFactory as Un, ResolvedDestination as Ut, PageControllerInput as V, LogFilter as Vn, NavigationPathStep as Vt, ServerRequestState as W, ExtractParamNames as Wn, SPLIT_VISIBILITIES as Wt, FullStateCodecOptions as X, ListOptions as Xn, AfterLoadGuard as Xt, DEFAULT_NAV_PARAM as Y, StripOptional as Yn, TabsNode as Yt, NavigationCodec as Z, MultiValueSchema as Zn, BeforeLoadGuard as Zt, AsyncStorage as _, RouteInput as _n, PrefetchedIntents as _t, NavigationCommitContext as a, deny as an, SerializedSplit as at, SESSION_DEFAULT_VERSION as b, DEP_KEYS as bn, Router as bt, NavigationTransactionContext as c, rewrite as cn, SerializedTabs as ct, createWebSession as d, FINESOFT_PUBLIC as dn, serializeNavigationStable as dt, NavigationContext as en, Intent as er, createFullStateCodec as et, AppSnapshot as f, PublicProjection as fn, PageRoute as ft, WebAppView as g, markPublic as gn, PrefetchedIntent as gt, ViewProps as h, isPublicMarked as hn, route as ht, BeforeNavigateResult as i, RewriteResult as in, SerializedNavigation as it, SessionStoreOptions as j, detectPlatform as jn, isExternalUrlAction as jt, SessionStateProvider as k, Translator as kn, TreeAction as kt, WebSession as l, BASE_PAGE_FIELDS as ln, deserializeNavigation as lt, ViewEntry as m, getPublicFields as mn, RouteDefinition as mt, BeforeCommitResult as n, PostLoadContext as nn, encodeNavigationTreeParam as nt, NavigationCommitError as o, next as on, SerializedSplitColumn as ot, NavigationSummary as p, PublicValueCodec as pn, RenderMode as pt, MessagesLoaderContext as q, ParamsFor as qn, SplitVisibility as qt, BeforeNavigatePolicy as r, RedirectResult as rn, SerializedLeaf as rt, NavigationContextInput as s, redirect as sn, SerializedStack as st, BeforeCommitPolicy as t, NextResult as tn, decodeNavigationTreeParam as tt, WebSessionOptions as u, BasePage as un, serializeNavigation as ut, NavigationScopedState as v, RouteIntent as vn, RouteAddOptions as vt, SessionLoadResult as w, TranslationMessages as wn, Action as wt, SessionError as x, FeatureFlags as xn, ActionDispatcher as xt, SESSION_DEFAULT_KEY as y, RouteParams as yn, RouteMatch as yt, WebAppDefinition as z, ConsoleLogger as zn, NavigationNodeKind as zt };
1279
- //# sourceMappingURL=session-DnB4ZC3x.d.mts.map
1279
+ //# sourceMappingURL=session-BR1vd3yY.d.mts.map
@@ -1,4 +1,4 @@
1
- import { i as HttpError, n as classifyUrl, r as HostGuardError } from "./host-guard-DDWxLpFL.mjs";
1
+ import { i as HttpError, n as classifyUrl, r as HostGuardError } from "./host-guard-DX4e3-45.mjs";
2
2
  import { n as ExecutionError, r as executionErrorFromHttp, t as compilePath } from "./path-CGFl2w7D.mjs";
3
3
  import { t as LruMap } from "./lru-map-BKoUAySU.mjs";
4
4
  import { t as DEP_KEYS } from "./src-Ftl_0rhu.mjs";
@@ -346,6 +346,7 @@ async function enforceHostGuard(url, options = {}) {
346
346
  }
347
347
  const verdict = classifyUrl(parsed.href);
348
348
  if (!verdict.ok) throw new HostGuardError(url, verdict.reason);
349
+ if (options.trustedOrigins?.includes(parsed.origin)) return;
349
350
  if (options.validateDns === false || parsed.hostname.includes(":") || /^[0-9.]+$/.test(parsed.hostname)) return;
350
351
  if (!options.lookup) throw new HostGuardError(url, "DNS lookup capability is required");
351
352
  let addresses;
@@ -1088,13 +1089,17 @@ function createRuntime(options) {
1088
1089
  return output;
1089
1090
  }
1090
1091
  const cacheValue = cachePolicy.key ? cachePolicy.key(validated) : validated;
1092
+ const partition = cachePolicy.partition?.(context);
1093
+ if (cachePolicy.partition && typeof partition !== "string") configuration("Cache partition must be a string");
1091
1094
  const key = encodeCacheIdentity([
1092
1095
  operation.id,
1093
1096
  invocation.identity ?? null,
1094
1097
  invocation.locale ?? null,
1098
+ partition,
1095
1099
  cacheValue
1096
1100
  ]);
1097
- const selectedCache = cachePolicy.scope === "execution" ? scopeCache : cache;
1101
+ const invocationBound = Reflect.ownKeys(context.bindings).length > 0 || invocation.fetch !== void 0;
1102
+ const selectedCache = cachePolicy.scope === "execution" || invocationBound && !cachePolicy.partition ? scopeCache : cache;
1098
1103
  const cached = selectedCache.get(key);
1099
1104
  if (cached && cached.expires > Date.now()) {
1100
1105
  complete(true);
@@ -1537,6 +1542,24 @@ var PrefetchedIntents = class PrefetchedIntents {
1537
1542
  }
1538
1543
  };
1539
1544
  //#endregion
1545
+ //#region ../web/src/hydration-digest.ts
1546
+ /** @internal A versioned DOM change detector, not a security or authenticity check. */
1547
+ function createHydrationDigest() {
1548
+ let first = 2166136261;
1549
+ let second = 2654435769;
1550
+ const update = (value) => {
1551
+ first = Math.imul(first ^ value, 16777619);
1552
+ second = Math.imul(second ^ value, 2246822507);
1553
+ };
1554
+ return {
1555
+ write(value) {
1556
+ update(value.length);
1557
+ for (let index = 0; index < value.length; index++) update(value.charCodeAt(index));
1558
+ },
1559
+ value: () => `v1:${(first >>> 0).toString(16)}:${(second >>> 0).toString(16)}`
1560
+ };
1561
+ }
1562
+ //#endregion
1540
1563
  //#region ../web/src/bootstrap/define-routes.ts
1541
1564
  /**
1542
1565
  * 构造一条强类型路由定义。
@@ -2871,6 +2894,7 @@ function createWebSession(options) {
2871
2894
  const destinations = [];
2872
2895
  const resolvedLeaves = /* @__PURE__ */ new Map();
2873
2896
  let redirect;
2897
+ let pageDenial;
2874
2898
  try {
2875
2899
  if (admission) for (const policy of beforeNavigate) {
2876
2900
  check();
@@ -2928,6 +2952,7 @@ function createWebSession(options) {
2928
2952
  url: result.rewriteUrl
2929
2953
  } : result.target);
2930
2954
  if (result.kind === "redirect") redirect ??= result;
2955
+ if (result.kind === "deny") pageDenial ??= result;
2931
2956
  destinations.push({
2932
2957
  ...result.kind === "page" && result.match?.cache ? { cache: result.match.cache } : {},
2933
2958
  ...result.kind === "page" ? {
@@ -2957,7 +2982,7 @@ function createWebSession(options) {
2957
2982
  status: redirect.status
2958
2983
  }
2959
2984
  };
2960
- if (destinations.some((dest) => dest.status !== void 0)) return { snapshot: candidate };
2985
+ if (pageDenial) return reject(pageDenial, candidate);
2961
2986
  for (const policy of beforeCommit) {
2962
2987
  check();
2963
2988
  const result = await policy({
@@ -3077,15 +3102,17 @@ function createWebSession(options) {
3077
3102
  if (closed || ownGeneration !== actions.generation) throw new ExecutionError("cancelled");
3078
3103
  if (candidate !== snapshot) {
3079
3104
  let result = candidate;
3080
- if (candidate.rejection) {
3081
- const { status, message } = candidate.rejection;
3105
+ const failed = candidate.destinations.find((entry) => entry.status !== void 0);
3106
+ if (candidate.rejection || failed) {
3107
+ const status = candidate.rejection?.status ?? failed.status;
3108
+ const page = candidate.rejection ? getErrorPage(status, candidate.rejection.message) : failed.page;
3082
3109
  const error = leaf("@finesoft/error");
3083
3110
  result = {
3084
3111
  tree: stack(error),
3085
3112
  destinations: [{
3086
3113
  ...error,
3087
3114
  resourceKey: resourceKey(error.intent, error.params),
3088
- page: getErrorPage(status, message),
3115
+ page,
3089
3116
  status
3090
3117
  }]
3091
3118
  };
@@ -3802,6 +3829,6 @@ function parseCookieString(str) {
3802
3829
  return map;
3803
3830
  }
3804
3831
  //#endregion
3805
- export { isLeafNode as $, createActiveLeafCodec as A, getTextDirection as At, findNode as B, fetchWithRedirects as Bt, runBeforeLoadGuards as C, defineModule as Ct, SERVER_REQUEST as D, SimpleTranslator as Dt, SERVER_CONTROLLER as E, implementOperation as Et, serializeNavigation as F, interpolate as Ft, push as G, ConsoleLogger as Gt, pop as H, stableStringify as Ht, serializeNavigationStable as I, resolvePluralKey as It, selectColumn as J, CompositeLoggerFactory as Jt, replaceTop as K, ConsoleLoggerFactory as Kt, collectAllLeaves as L, generateUuid as Lt, decodeNavigationTreeParam as M, makeLocaleInfo as Mt, encodeNavigationTreeParam as N, resolveLocaleFromUrl as Nt, controllerContext as O, resolveMessages as Ot, deserializeNavigation as P, englishPlural as Pt, resourceKey as Q, collectVisibleDestinations as R, detectPlatform as Rt, runAfterLoadGuards as S, defineApp as St, getWebPlan as T, implementController as Tt, popTo as U, ReportingLogger as Ut, mapNavigationLeaves as V, enforceHostGuard as Vt, popToRoot as W, ReportingLoggerFactory as Wt, setVisibility as X, list as Xt, selectTab as Y, isMultiValueSchema as Yt, visibleSplitColumns as Z, Container as Zt, SERVER_CONTROLLER_PATH as _, isFlowAction as _t, createSessionStore as a, stack as at, decodeWireEnvelope as b, provide as bt, decodeSnapshot as c, NavigationError as ct, createWebSession as d, PrefetchedIntents as dt, isSplitNode as et, SESSION_DEFAULT_KEY as f, Router as ft, loadPage as g, isExternalUrlAction as gt, StorageUnavailableError as h, isCompoundAction as ht, createWebRuntime as i, split as it, createFullStateCodec as j, isRtl as jt, DEFAULT_NAV_PARAM as k, getLocaleAttributes as kt, encodeSnapshot as l, SPLIT_VISIBILITIES as lt, SessionError as m, ACTION_KINDS as mt, definePage as n, isTabsNode as nt, collectLeafKeys as o, tabs as ot, SESSION_DEFAULT_VERSION as p, ActionDispatcher as pt, resolveActivePath as q, CompositeLogger as qt, resolveInitialNavigation as r, leaf as rt, createNavigationScopedState as s, NAVIGATION_NODE_KINDS as st, parseCookieString as t, isStackNode as tt, NavigationCommitError as u, route as ut, ServerControllerProxy as v, makeExternalUrlAction as vt, defineWebApp as w, defineOperation as wt, getFrameworkBuildId as x, createRuntime as xt, FRAMEWORK_PROTOCOL_VERSION as y, makeFlowAction as yt, findNearestStack as z, secureFetch as zt };
3832
+ export { isLeafNode as $, createActiveLeafCodec as A, getLocaleAttributes as At, findNode as B, secureFetch as Bt, runBeforeLoadGuards as C, defineApp as Ct, SERVER_REQUEST as D, implementOperation as Dt, SERVER_CONTROLLER as E, implementController as Et, serializeNavigation as F, englishPlural as Ft, push as G, ReportingLoggerFactory as Gt, pop as H, enforceHostGuard as Ht, serializeNavigationStable as I, interpolate as It, selectColumn as J, CompositeLogger as Jt, replaceTop as K, ConsoleLogger as Kt, collectAllLeaves as L, resolvePluralKey as Lt, decodeNavigationTreeParam as M, isRtl as Mt, encodeNavigationTreeParam as N, makeLocaleInfo as Nt, controllerContext as O, SimpleTranslator as Ot, deserializeNavigation as P, resolveLocaleFromUrl as Pt, resourceKey as Q, Container as Qt, collectVisibleDestinations as R, generateUuid as Rt, runAfterLoadGuards as S, createRuntime as St, getWebPlan as T, defineOperation as Tt, popTo as U, stableStringify as Ut, mapNavigationLeaves as V, fetchWithRedirects as Vt, popToRoot as W, ReportingLogger as Wt, setVisibility as X, isMultiValueSchema as Xt, selectTab as Y, CompositeLoggerFactory as Yt, visibleSplitColumns as Z, list as Zt, SERVER_CONTROLLER_PATH as _, isExternalUrlAction as _t, createSessionStore as a, stack as at, decodeWireEnvelope as b, makeFlowAction as bt, decodeSnapshot as c, NavigationError as ct, createWebSession as d, createHydrationDigest as dt, isSplitNode as et, SESSION_DEFAULT_KEY as f, PrefetchedIntents as ft, loadPage as g, isCompoundAction as gt, StorageUnavailableError as h, ACTION_KINDS as ht, createWebRuntime as i, split as it, createFullStateCodec as j, getTextDirection as jt, DEFAULT_NAV_PARAM as k, resolveMessages as kt, encodeSnapshot as l, SPLIT_VISIBILITIES as lt, SessionError as m, ActionDispatcher as mt, definePage as n, isTabsNode as nt, collectLeafKeys as o, tabs as ot, SESSION_DEFAULT_VERSION as p, Router as pt, resolveActivePath as q, ConsoleLoggerFactory as qt, resolveInitialNavigation as r, leaf as rt, createNavigationScopedState as s, NAVIGATION_NODE_KINDS as st, parseCookieString as t, isStackNode as tt, NavigationCommitError as u, route as ut, ServerControllerProxy as v, isFlowAction as vt, defineWebApp as w, defineModule as wt, getFrameworkBuildId as x, provide as xt, FRAMEWORK_PROTOCOL_VERSION as y, makeExternalUrlAction as yt, findNearestStack as z, detectPlatform as zt };
3806
3833
 
3807
- //# sourceMappingURL=src-qwx7Vw8g.mjs.map
3834
+ //# sourceMappingURL=src-D_Bzbr80.mjs.map
@@ -1,8 +1,8 @@
1
- import { D as SERVER_REQUEST, E as SERVER_CONTROLLER, F as serializeNavigation, P as deserializeNavigation, T as getWebPlan, at as stack, d as createWebSession, i as createWebRuntime, r as resolveInitialNavigation, rt as leaf, t as parseCookieString, x as getFrameworkBuildId } from "./src-qwx7Vw8g.mjs";
1
+ import { D as SERVER_REQUEST, E as SERVER_CONTROLLER, F as serializeNavigation, P as deserializeNavigation, T as getWebPlan, at as stack, d as createWebSession, i as createWebRuntime, r as resolveInitialNavigation, rt as leaf, t as parseCookieString, x as getFrameworkBuildId } from "./src-D_Bzbr80.mjs";
2
2
  import { n as ExecutionError } from "./path-CGFl2w7D.mjs";
3
3
  import { i as getPublicFields, n as BASE_PAGE_FIELDS, s as BaseController, t as resolveConfiguredMessages } from "./messages-CAt2QdGr.mjs";
4
4
  import "./src-Ftl_0rhu.mjs";
5
- import "./proxy-1SphZ7x7.mjs";
5
+ import "./proxy-BkKVP3Ha.mjs";
6
6
  //#region ../ssr/src/server-data.ts
7
7
  const MATERIALIZED = Symbol("materialized-public-data");
8
8
  /** Copy declared public data now; never keep request-backed objects/getters in a response. */
@@ -354,4 +354,4 @@ var BaseServerController = class extends BaseController {
354
354
  //#endregion
355
355
  export { serializeServerData as a, materializeServerData as i, createServerContext as n, createSSRRender as r, BaseServerController as t };
356
356
 
357
- //# sourceMappingURL=ssr-C8xnYXoY.mjs.map
357
+ //# sourceMappingURL=ssr-DqwPGqOd.mjs.map
@@ -1,8 +1,8 @@
1
- import { E as ParamSchema, c as ExecutionContext, j as Container } from "./path-CXT6xGPO.mjs";
2
- import { B as ControllerContext, En as LocaleAttributes, H as SERVER_CONTROLLER, Jn as QuerySchemaMap, Mn as BaseController, P as WebConfiguration, Pn as ControllerInput, W as ServerRequestState, en as NavigationContext, g as WebAppView, mt as RouteDefinition, vn as RouteIntent, z as WebAppDefinition } from "./session-DnB4ZC3x.mjs";
3
- import { t as SecureFetchOptions } from "./secure-fetch-Xlht2jd7.mjs";
4
- import { a as WebHydration, r as ServerControllerRequest } from "./server-controller-proxy-BkVuVWVD.mjs";
5
- import { r as HttpHandler } from "./http-B6CJqDyf.mjs";
1
+ import { E as ParamSchema, c as ExecutionContext, j as Container } from "./path-C-b1ChKq.mjs";
2
+ import { B as ControllerContext, En as LocaleAttributes, H as SERVER_CONTROLLER, Jn as QuerySchemaMap, Mn as BaseController, P as WebConfiguration, Pn as ControllerInput, W as ServerRequestState, en as NavigationContext, g as WebAppView, mt as RouteDefinition, vn as RouteIntent, z as WebAppDefinition } from "./session-BR1vd3yY.mjs";
3
+ import { t as SecureFetchOptions } from "./secure-fetch--QwYr5uJ.mjs";
4
+ import { a as WebHydration, r as ServerControllerRequest } from "./server-controller-proxy-CFdU_nGs.mjs";
5
+ import { r as HttpHandler } from "./http-B8r7MWao.mjs";
6
6
  //#region ../ssr/src/render.d.ts
7
7
  interface SSRContext {
8
8
  identity?: string;
@@ -56,9 +56,6 @@ declare function createSSRRender<Definition extends WebAppDefinition>(config: SS
56
56
  };
57
57
  //#endregion
58
58
  //#region ../ssr/src/inject.d.ts
59
- /**
60
- * injectSSRContent — 将 SSR 渲染结果注入 HTML 模板
61
- */
62
59
  /** SSR HTML 模板占位符常量 */
63
60
  declare const SSR_PLACEHOLDERS: {
64
61
  readonly HEAD: "<!--ssr-head-->";
@@ -207,4 +204,4 @@ interface SSRHandler extends HttpHandler {
207
204
  declare function createSSRHandler<TData = unknown>(options: SSRHandlerOptions<TData>): SSRHandler;
208
205
  //#endregion
209
206
  export { createSSRRender as C, SSRRenderResult as E, SSRRenderConfig as S, SSRContext as T, serializeServerData as _, SSRRequestContext as a, injectCSRShell as b, matchRenderModeOverride as c, ServerControllerContext as d, ServerControllerInput as f, materializeServerData as g, SerializeServerDataOptions as h, SSRModule as i, BaseServerController as l, createServerContext as m, SSRHandler as n, SSRResponseResult as o, ServerContextOptions as p, SSRHandlerOptions as r, createSSRHandler as s, SSRCache as t, CookieOptions as u, InjectSSROptions as v, SSRAppResult as w, injectSSRContent as x, SSR_PLACEHOLDERS as y };
210
- //# sourceMappingURL=ssr-BEUNDvbj.d.mts.map
207
+ //# sourceMappingURL=ssr-lzuGJ2ux.d.mts.map
package/dist/ssr.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { C as createSSRRender, E as SSRRenderResult, S as SSRRenderConfig, T as SSRContext, _ as serializeServerData, a as SSRRequestContext, b as injectCSRShell, c as matchRenderModeOverride, d as ServerControllerContext, f as ServerControllerInput, g as materializeServerData, h as SerializeServerDataOptions, i as SSRModule, l as BaseServerController, m as createServerContext, n as SSRHandler, o as SSRResponseResult, p as ServerContextOptions, r as SSRHandlerOptions, s as createSSRHandler, t as SSRCache, u as CookieOptions, v as InjectSSROptions, w as SSRAppResult, x as injectSSRContent, y as SSR_PLACEHOLDERS } from "./ssr-BEUNDvbj.mjs";
1
+ import { C as createSSRRender, E as SSRRenderResult, S as SSRRenderConfig, T as SSRContext, _ as serializeServerData, a as SSRRequestContext, b as injectCSRShell, c as matchRenderModeOverride, d as ServerControllerContext, f as ServerControllerInput, g as materializeServerData, h as SerializeServerDataOptions, i as SSRModule, l as BaseServerController, m as createServerContext, n as SSRHandler, o as SSRResponseResult, p as ServerContextOptions, r as SSRHandlerOptions, s as createSSRHandler, t as SSRCache, u as CookieOptions, v as InjectSSROptions, w as SSRAppResult, x as injectSSRContent, y as SSR_PLACEHOLDERS } from "./ssr-lzuGJ2ux.mjs";
2
2
  import { a as registerProxyRoutes, n as ProxyRouteConfig, r as ProxyRouter, t as ProxyAuthConfig } from "./proxy-2dSWO-Xw.mjs";
3
3
  export { BaseServerController, type CookieOptions, type InjectSSROptions, type ProxyAuthConfig, type ProxyRouteConfig, type ProxyRouter, type SSRAppResult, SSRCache, type SSRContext, SSRHandler, SSRHandlerOptions, SSRModule, type SSRRenderConfig, type SSRRenderResult, SSRRequestContext, SSRResponseResult, SSR_PLACEHOLDERS, type SerializeServerDataOptions, type ServerContextOptions, type ServerControllerContext, type ServerControllerInput, createSSRHandler, createSSRRender, createServerContext, injectCSRShell, injectSSRContent, matchRenderModeOverride, materializeServerData, registerProxyRoutes, serializeServerData };
package/dist/ssr.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { a as serializeServerData, i as materializeServerData, n as createServerContext, r as createSSRRender, t as BaseServerController } from "./ssr-C8xnYXoY.mjs";
2
- import { c as injectSSRContent, i as matchRenderModeOverride, n as registerProxyRoutes, o as SSR_PLACEHOLDERS, r as createSSRHandler, s as injectCSRShell } from "./proxy-1SphZ7x7.mjs";
1
+ import { a as serializeServerData, i as materializeServerData, n as createServerContext, r as createSSRRender, t as BaseServerController } from "./ssr-DqwPGqOd.mjs";
2
+ import { c as injectSSRContent, i as matchRenderModeOverride, n as registerProxyRoutes, o as SSR_PLACEHOLDERS, r as createSSRHandler, s as injectCSRShell } from "./proxy-BkKVP3Ha.mjs";
3
3
  export { BaseServerController, SSR_PLACEHOLDERS, createSSRHandler, createSSRRender, createServerContext, injectCSRShell, injectSSRContent, matchRenderModeOverride, materializeServerData, registerProxyRoutes, serializeServerData };
@@ -1,4 +1,4 @@
1
- import { g as WebAppView, h as ViewProps } from "./session-DnB4ZC3x.mjs";
1
+ import { g as WebAppView, h as ViewProps } from "./session-BR1vd3yY.mjs";
2
2
  import Outlet from "./Outlet.svelte";
3
3
  import { Component } from "svelte";
4
4
  declare namespace svelte_d_exports {
@@ -13,4 +13,4 @@ declare function useSnapshot(app: WebAppView): {
13
13
  };
14
14
  //#endregion
15
15
  export { useSnapshot as a, svelte_d_exports as i, NativeViews as n, Outlet as r, NativeView as t };
16
- //# sourceMappingURL=svelte-Dr5to3SE.d.mts.map
16
+ //# sourceMappingURL=svelte-CMFFDLBi.d.mts.map
package/dist/svelte.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { g as WebAppView, h as ViewProps } from "./session-DnB4ZC3x.mjs";
2
- import { a as useSnapshot, n as NativeViews, r as Outlet, t as NativeView } from "./svelte-Dr5to3SE.mjs";
1
+ import { g as WebAppView, h as ViewProps } from "./session-BR1vd3yY.mjs";
2
+ import { a as useSnapshot, n as NativeViews, r as Outlet, t as NativeView } from "./svelte-CMFFDLBi.mjs";
3
3
  export { NativeView, NativeViews, Outlet, type ViewProps, type WebAppView, useSnapshot };
@@ -1,5 +1,5 @@
1
- import { Yt as isMultiValueSchema, zt as secureFetch } from "./src-qwx7Vw8g.mjs";
2
- import { i as HttpError } from "./host-guard-DDWxLpFL.mjs";
1
+ import { Bt as secureFetch, Xt as isMultiValueSchema } from "./src-D_Bzbr80.mjs";
2
+ import { i as HttpError } from "./host-guard-DX4e3-45.mjs";
3
3
  //#region ../core/src/schema/standard.ts
4
4
  /** 工厂:从一个 validate 函数构造实现了 ~standard 的 codec */
5
5
  function makeSchema(validate) {
@@ -399,4 +399,4 @@ function deny(status = 403, message = "Forbidden") {
399
399
  //#endregion
400
400
  export { bool as C, str as D, oneOf as E, uuid as O, withDefault as S, num as T, mapEach as _, safeErrorPage as a, HttpClient as b, ConsoleEventRecorder as c, getBaseUrl as d, removeHost as f, isSome as g, isNone as h, rewrite as i, makeSchema as k, CompositeEventRecorder as l, removeScheme as m, next as n, WithFieldsRecorder as o, removeQueryParams as p, redirect as r, VoidEventRecorder as s, deny as t, buildUrl as u, pipe as v, int as w, optional as x, pipeAsync as y };
401
401
 
402
- //# sourceMappingURL=types-BuaZHRG7.mjs.map
402
+ //# sourceMappingURL=types-DD09OkGZ.mjs.map
@@ -76,6 +76,8 @@ interface AdapterContext {
76
76
  interface GenerateSSREntryOptions {
77
77
  /** Host capability for protected outbound requests. */
78
78
  dnsPolicy?: "node" | "hostname";
79
+ /** Explicit trusted origins for hosts without connection-time DNS enforcement. */
80
+ trustedOrigins?: readonly string[];
79
81
  /** 平台特定的导入语句(如 `import { handle } from "hono/vercel";`) */
80
82
  platformImport: string;
81
83
  /** 平台特定的导出语句(如 `export default handle(app);`) */
@@ -138,7 +140,7 @@ interface FinesoftFrontViteOptions {
138
140
  /**
139
141
  * 声明式代理路由配置。
140
142
  * 框架统一执行路径校验(SSRF 防护)、Host 限制、错误处理、响应头控制。
141
- * 代理路由在 setup 之前注册,优先级高于自定义路由。
143
+ * 代理路由在 setup 之后注册,受 setup 中先注册的鉴权中间件保护。
142
144
  */
143
145
  proxies?: ProxyRouteConfig[];
144
146
  /**
@@ -250,7 +252,11 @@ declare function finesoftFrontViteConfig(options?: FinesoftFrontViteOptions): {
250
252
  declare function autoAdapter(): Adapter;
251
253
  //#endregion
252
254
  //#region ../server/src/adapters/cloudflare.d.ts
253
- declare function cloudflareAdapter(): Adapter;
255
+ interface CloudflareAdapterOptions {
256
+ /** Trusted API origins; other hostnames fail closed because this host supplies no DNS policy. */
257
+ trustedOrigins?: readonly string[];
258
+ }
259
+ declare function cloudflareAdapter(options?: CloudflareAdapterOptions): Adapter;
254
260
  //#endregion
255
261
  //#region ../server/src/adapters/netlify.d.ts
256
262
  declare function netlifyAdapter(): Adapter;
@@ -273,5 +279,5 @@ declare function vercelAdapter(): Adapter;
273
279
  //#region ../server/src/adapters/resolve.d.ts
274
280
  declare function resolveAdapter(value: string | Adapter): Adapter;
275
281
  //#endregion
276
- export { netlifyAdapter as a, FinesoftFrontViteOptions as c, AdapterContext as d, nodeAdapter as i, finesoftFrontViteConfig as l, vercelAdapter as n, cloudflareAdapter as o, staticAdapter as r, autoAdapter as s, resolveAdapter as t, Adapter as u };
277
- //# sourceMappingURL=vite-Cj4SPA8D.d.mts.map
282
+ export { netlifyAdapter as a, autoAdapter as c, Adapter as d, AdapterContext as f, nodeAdapter as i, FinesoftFrontViteOptions as l, vercelAdapter as n, CloudflareAdapterOptions as o, staticAdapter as r, cloudflareAdapter as s, resolveAdapter as t, finesoftFrontViteConfig as u };
283
+ //# sourceMappingURL=vite-BjWtbemg.d.mts.map
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { i as generateProxyCode, n as ProxyRouteConfig, t as ProxyAuthConfig } from "./proxy-2dSWO-Xw.mjs";
2
- import { a as netlifyAdapter, c as FinesoftFrontViteOptions, d as AdapterContext, i as nodeAdapter, l as finesoftFrontViteConfig, n as vercelAdapter, o as cloudflareAdapter, r as staticAdapter, s as autoAdapter, t as resolveAdapter, u as Adapter } from "./vite-Cj4SPA8D.mjs";
2
+ import { a as netlifyAdapter, c as autoAdapter, d as Adapter, f as AdapterContext, i as nodeAdapter, l as FinesoftFrontViteOptions, n as vercelAdapter, o as CloudflareAdapterOptions, r as staticAdapter, s as cloudflareAdapter, t as resolveAdapter, u as finesoftFrontViteConfig } from "./vite-BjWtbemg.mjs";
3
3
  import { n as ControllerTypeResult, r as generateControllerTypes, t as ControllerTypeOptions } from "./controller-types-CgmJ6-le.mjs";
4
- export { type Adapter, type AdapterContext, type ControllerTypeOptions, type ControllerTypeResult, type FinesoftFrontViteOptions, type ProxyAuthConfig, type ProxyRouteConfig, autoAdapter, cloudflareAdapter, finesoftFrontViteConfig, generateControllerTypes, generateProxyCode, netlifyAdapter, nodeAdapter, resolveAdapter, staticAdapter, vercelAdapter };
4
+ export { type Adapter, type AdapterContext, type CloudflareAdapterOptions, type ControllerTypeOptions, type ControllerTypeResult, type FinesoftFrontViteOptions, type ProxyAuthConfig, type ProxyRouteConfig, autoAdapter, cloudflareAdapter, finesoftFrontViteConfig, generateControllerTypes, generateProxyCode, netlifyAdapter, nodeAdapter, resolveAdapter, staticAdapter, vercelAdapter };