@blacklizard/inertia-express 2.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +212 -42
- package/dist/core/index.d.ts +2 -552
- package/dist/core/index.js +2 -662
- package/dist/core-PN_yVSCS.js +1741 -0
- package/dist/core-PN_yVSCS.js.map +1 -0
- package/dist/express/index.d.ts +72 -13
- package/dist/express/index.d.ts.map +1 -1
- package/dist/express/index.js +160 -39
- package/dist/express/index.js.map +1 -1
- package/dist/index-C7vBpEDY.d.ts +1326 -0
- package/dist/index-C7vBpEDY.d.ts.map +1 -0
- package/package.json +6 -2
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-PN_yVSCS.js","names":[],"sources":["../src/core/prop-descriptor.ts","../src/core/props.ts","../src/core/dot-props.ts","../src/core/partial-filter.ts","../src/core/props-resolver.ts","../src/core/broadcast.ts","../src/core/cache.ts","../src/core/errors.ts","../src/core/headers.ts","../src/core/html.ts","../src/core/page.ts","../src/core/redirects.ts","../src/core/render.ts","../src/core/versioning.ts"],"sourcesContent":["import type {\n LiveChannel, LiveChannelType, LiveListener, ScrollMetadata,\n} from './types.js';\n\n/**\n * Wrap a value in a list the way Laravel's `Arr::wrap` does: `undefined` and\n * `null` (a plain-JS caller omitting an option) become an empty list.\n */\nfunction wrapList<Item>(value: Item | readonly Item[] | null | undefined): Item[] {\n if (value === undefined || value === null) {\n return [];\n }\n\n return Array.isArray(value) ? [...value] : [value as Item];\n}\n\n/**\n * The constructor a {@link PropDescriptor} was created by.\n */\nexport type PropKind = 'optional' | 'defer' | 'always' | 'merge' | 'once' | 'scroll' | 'live';\n\n/**\n * A prop's raw source: a plain value or a (possibly async) producer.\n */\nexport type PropSource<T> = T | (() => T | Promise<T>);\n\n/**\n * Options accepted by the `scroll()` prop constructor.\n */\nexport interface ScrollOptions<T> {\n /** Key inside the resolved value that holds the scrolled items. Defaults to `'data'`. */\n wrapper?: string;\n /** Pagination metadata, or a function deriving it from the resolved value. */\n metadata: ScrollMetadata | ((resolved: T) => ScrollMetadata);\n}\n\n/**\n * A live channel as given to `live()`: a bare name (public) or an explicit\n * name and type.\n */\nexport type LiveChannelInput = string | LiveChannel;\n\n/**\n * Options accepted by `live()` and `.live()`.\n */\nexport interface LiveOptions {\n /** Event name or names that trigger a refresh of the prop. */\n on: string | string[];\n /** Channel or channels the events are broadcast on. */\n channel: LiveChannelInput | LiveChannelInput[];\n /** Minimum milliseconds between refreshes of the prop. */\n throttle?: number;\n}\n\nconst MERGE_LIVE_MESSAGE = 'Live updates are not supported on merge properties.';\n\n/** Name prefix the broadcaster adds for each channel type; never sent to the client. */\nconst CHANNEL_PREFIXES: Record<LiveChannelType, string> = {\n public: '',\n private: 'private-',\n presence: 'presence-',\n 'encrypted-private': 'private-encrypted-',\n};\n\n/**\n * Normalise one channel input into a {@link LiveChannel}: a bare string is\n * public; an object's type is validated and its type prefix stripped from the name.\n *\n * @param input Bare channel name or explicit channel.\n */\nfunction normalizeChannel(input: LiveChannelInput): LiveChannel {\n if (typeof input === 'string') {\n return { name: input, type: 'public' };\n }\n\n if (!Object.hasOwn(CHANNEL_PREFIXES, input.type)) {\n throw new TypeError(`Unknown live channel type [${String(input.type)}]. Use public, private, presence or encrypted-private.`);\n }\n\n const prefix = CHANNEL_PREFIXES[input.type];\n const name = prefix !== '' && input.name.startsWith(prefix) ? input.name.slice(prefix.length) : input.name;\n\n return { name, type: input.type };\n}\n\n/**\n * A prop wrapped with resolution and merge behaviour, ported from\n * inertia-laravel's prop classes and their `MergesProps`, `DefersProps`\n * and `ResolvesOnce` traits. The descriptor holds the wrapped value by\n * reference and never mutates it.\n */\nexport default class PropDescriptor<T = unknown> {\n readonly kind: PropKind;\n\n readonly source: PropSource<T>;\n\n ignoreFirstLoad = false;\n\n defers = false;\n\n group = 'default';\n\n merges = false;\n\n deep = false;\n\n appends = true;\n\n appendPaths: string[] = [];\n\n prependPaths: string[] = [];\n\n matchOnPaths: string[] = [];\n\n resolvesOnce = false;\n\n onceKey: string | null = null;\n\n ttlSeconds: number | null = null;\n\n expiresAtDate: Date | null = null;\n\n isFresh = false;\n\n rescues = false;\n\n isAlways = false;\n\n isScroll = false;\n\n wrapper = 'data';\n\n scrollMetadata: ScrollMetadata | ((resolved: T) => ScrollMetadata) | null = null;\n\n liveDeclarations: { events: string[]; channels: LiveChannel[] }[] = [];\n\n liveThrottle: number | null = null;\n\n /**\n * Create a descriptor around a prop source.\n *\n * @param kind The constructor that produced this descriptor.\n * @param source The plain value or producer function being wrapped.\n */\n constructor(kind: PropKind, source: PropSource<T>) {\n this.kind = kind;\n this.source = source;\n }\n\n /**\n * `true` when the prop appends at its root: the append flag is set and no\n * append/prepend paths were recorded.\n */\n get appendsAtRoot(): boolean {\n return this.appends && this.mergesAtRoot();\n }\n\n /**\n * `true` when the prop prepends at its root: the append flag is cleared and\n * no append/prepend paths were recorded.\n */\n get prependsAtRoot(): boolean {\n return !this.appends && this.mergesAtRoot();\n }\n\n /**\n * `true` once at least one live declaration was recorded.\n */\n get isLive(): boolean {\n return this.liveDeclarations.length > 0;\n }\n\n /**\n * Mark the prop for a shallow client-side merge. Throws when the prop is live.\n */\n merge(): this {\n if (this.isLive) {\n throw new Error(MERGE_LIVE_MESSAGE);\n }\n\n this.merges = true;\n\n return this;\n }\n\n /**\n * Mark the prop for a deep client-side merge.\n */\n deepMerge(): this {\n this.deep = true;\n\n return this.merge();\n }\n\n /**\n * Configure appending. A boolean sets the root append flag; a string\n * records an append path; a list records each path; a record maps each\n * path to its match-on field.\n *\n * @param path Root flag, path, list of paths, or path-to-matchOn record.\n * @param matchOn Field to dedupe on, recorded as `path.matchOn` when `path` is a string.\n */\n append(path: boolean | string | string[] | Record<string, string> = true, matchOn?: string): this {\n if (typeof path === 'boolean') {\n this.appends = path;\n } else if (typeof path === 'string') {\n this.appendPaths.push(path);\n this.recordMatchOn(path, matchOn);\n } else if (Array.isArray(path)) {\n path.forEach((entry) => this.append(entry));\n } else {\n Object.entries(path).forEach(([key, field]) => this.append(key, field));\n }\n\n return this;\n }\n\n /**\n * Configure prepending. A boolean clears (or sets) the root append flag; a\n * string records a prepend path; a list records each path; a record maps\n * each path to its match-on field.\n *\n * @param path Root flag, path, list of paths, or path-to-matchOn record.\n * @param matchOn Field to dedupe on, recorded as `path.matchOn` when `path` is a string.\n */\n prepend(path: boolean | string | string[] | Record<string, string> = true, matchOn?: string): this {\n if (typeof path === 'boolean') {\n this.appends = !path;\n } else if (typeof path === 'string') {\n this.prependPaths.push(path);\n this.recordMatchOn(path, matchOn);\n } else if (Array.isArray(path)) {\n path.forEach((entry) => this.prepend(entry));\n } else {\n Object.entries(path).forEach(([key, field]) => this.prepend(key, field));\n }\n\n return this;\n }\n\n /**\n * Replace the match-on paths the client dedupes merged items by.\n *\n * @param path A single path or a list of paths.\n */\n matchOn(path: string | string[]): this {\n this.matchOnPaths = Array.isArray(path) ? [...path] : [path];\n\n return this;\n }\n\n /**\n * Defer the prop to a follow-up request.\n *\n * @param group Load group; props sharing a group are fetched together. Defaults to `'default'`.\n */\n defer(group?: string): this {\n this.defers = true;\n this.group = group ?? 'default';\n\n return this;\n }\n\n /**\n * Toggle once-resolution, optionally setting its key and expiry.\n *\n * @param value Whether the prop resolves once. Defaults to `true`.\n * @param as Custom once key.\n * @param until TTL in seconds, or an absolute expiry date.\n */\n once(value = true, as?: string, until?: number | Date): this {\n this.resolvesOnce = value;\n\n if (as !== undefined) {\n this.as(as);\n }\n\n if (until !== undefined) {\n this.until(until);\n }\n\n return this;\n }\n\n /**\n * Set the key the client caches a once-prop under.\n *\n * @param key The once key.\n */\n as(key: string): this {\n this.onceKey = key;\n\n return this;\n }\n\n /**\n * Set the once-prop's expiry, replacing any expiry set by an earlier call.\n *\n * @param delay TTL in seconds, or an absolute expiry date.\n */\n until(delay: number | Date): this {\n if (delay instanceof Date) {\n this.expiresAtDate = delay;\n this.ttlSeconds = null;\n } else {\n this.ttlSeconds = delay;\n this.expiresAtDate = null;\n }\n\n return this;\n }\n\n /**\n * Force a once-prop to be re-resolved.\n *\n * @param value Whether to refresh. Defaults to `true`.\n */\n fresh(value = true): this {\n this.isFresh = value;\n\n return this;\n }\n\n /**\n * Opt into rescuing errors thrown while resolving the prop.\n *\n * @param value Whether to rescue. Defaults to `true`.\n */\n rescue(value = true): this {\n this.rescues = value;\n\n return this;\n }\n\n /**\n * The once-prop's expiry as a millisecond epoch, or `null` without a TTL or date.\n *\n * @param now Current time in milliseconds. Defaults to `Date.now()`.\n */\n expiresAt(now: number = Date.now()): number | null {\n if (this.expiresAtDate !== null) {\n return this.expiresAtDate.getTime();\n }\n\n if (this.ttlSeconds !== null) {\n return now + this.ttlSeconds * 1000;\n }\n\n return null;\n }\n\n /**\n * Declare events (and the channels they arrive on) that refresh the prop.\n * May be called more than once; a later throttle replaces an earlier one.\n * Throws on a merge prop or an unknown channel type.\n *\n * @param options Events, channels and optional throttle in milliseconds.\n */\n live(options: LiveOptions): this {\n if (this.merges) {\n throw new Error(MERGE_LIVE_MESSAGE);\n }\n\n const events = wrapList(options.on);\n const channels = wrapList(options.channel).map(normalizeChannel);\n\n this.liveDeclarations.push({ events, channels });\n\n if (options.throttle !== undefined) {\n this.liveThrottle = options.throttle;\n }\n\n return this;\n }\n\n /**\n * Build the channel listeners, ported from inertia-laravel's\n * `HasLiveUpdates::liveListeners()` without event-class branches. Each\n * channel gets the deduplicated events declared for it, in first-seen order.\n */\n liveListeners(): LiveListener[] {\n if (!this.liveDeclarations.some((declaration) => declaration.events.length > 0)) {\n throw new Error('A live property must listen for at least one event. Pass the event to the [on] option.');\n }\n\n const listeners = new Map<string, LiveListener>();\n\n this.liveDeclarations.forEach(({ events, channels }) => {\n events.forEach((event) => {\n if (channels.length === 0) {\n throw new Error(`Unable to resolve the channels for the [${event}] event. Pass the [channel] option.`);\n }\n\n channels.forEach((channel) => {\n const key = `${channel.type}:${channel.name}`;\n const listener = listeners.get(key) ?? { channel: { ...channel }, events: [] };\n\n if (!listener.events.includes(event)) {\n listener.events.push(event);\n }\n\n listeners.set(key, listener);\n });\n });\n });\n\n return [...listeners.values()];\n }\n\n /**\n * Resolve the source: call it when it is a function, then await the result.\n */\n async resolveSource(): Promise<T> {\n if (typeof this.source === 'function') {\n return (this.source as () => T | Promise<T>)();\n }\n\n return this.source;\n }\n\n /**\n * Scroll metadata for a resolved value: the configured object, or the\n * configured function applied to `resolved`.\n *\n * @param resolved The resolved prop value.\n */\n metadataFor(resolved: T): ScrollMetadata {\n if (this.scrollMetadata === null) {\n throw new TypeError(`Prop of kind \"${this.kind}\" has no scroll metadata.`);\n }\n\n return typeof this.scrollMetadata === 'function' ? this.scrollMetadata(resolved) : this.scrollMetadata;\n }\n\n /**\n * `true` when no append or prepend paths were recorded.\n */\n private mergesAtRoot(): boolean {\n return this.appendPaths.length === 0 && this.prependPaths.length === 0;\n }\n\n /**\n * Record `path.matchOn` as a match-on path when `matchOn` is given.\n *\n * @param path The append/prepend path.\n * @param matchOn Field to dedupe on.\n */\n private recordMatchOn(path: string, matchOn: string | undefined): void {\n if (matchOn) {\n this.matchOnPaths.push(`${path}.${matchOn}`);\n }\n }\n}\n","import PropDescriptor from './prop-descriptor.js';\n\nimport type { LiveOptions, PropSource, ScrollOptions } from './prop-descriptor.js';\n\n/**\n * Argument accepted by `append()` / `prepend()`: a root flag, a path, a list\n * of paths, or a path-to-matchOn record.\n */\ntype MergePath = boolean | string | string[] | Record<string, string>;\n\n/**\n * Prop omitted from the first load and resolved only when requested.\n */\nexport interface OptionalProp<T> {\n once: (value?: boolean, as?: string, until?: number | Date) => OptionalProp<T>;\n as: (key: string) => OptionalProp<T>;\n until: (delay: number | Date) => OptionalProp<T>;\n fresh: (value?: boolean) => OptionalProp<T>;\n live: (options: LiveOptions) => OptionalProp<T>;\n}\n\n/**\n * Prop resolved in a follow-up request after the first load.\n */\nexport interface DeferProp<T> {\n merge: () => DeferProp<T>;\n deepMerge: () => DeferProp<T>;\n append: (path?: MergePath, matchOn?: string) => DeferProp<T>;\n prepend: (path?: MergePath, matchOn?: string) => DeferProp<T>;\n matchOn: (path: string | string[]) => DeferProp<T>;\n once: (value?: boolean, as?: string, until?: number | Date) => DeferProp<T>;\n as: (key: string) => DeferProp<T>;\n until: (delay: number | Date) => DeferProp<T>;\n fresh: (value?: boolean) => DeferProp<T>;\n rescue: (value?: boolean) => DeferProp<T>;\n live: (options: LiveOptions) => DeferProp<T>;\n}\n\n/**\n * Prop the client merges into its existing value.\n */\nexport interface MergeProp<T> {\n deepMerge: () => MergeProp<T>;\n append: (path?: MergePath, matchOn?: string) => MergeProp<T>;\n prepend: (path?: MergePath, matchOn?: string) => MergeProp<T>;\n matchOn: (path: string | string[]) => MergeProp<T>;\n once: (value?: boolean, as?: string, until?: number | Date) => MergeProp<T>;\n as: (key: string) => MergeProp<T>;\n until: (delay: number | Date) => MergeProp<T>;\n fresh: (value?: boolean) => MergeProp<T>;\n}\n\n/**\n * Prop included on every response, regardless of partial filtering. Its only\n * chain method declares live updates.\n */\nexport interface AlwaysProp<T> {\n live: (options: LiveOptions) => AlwaysProp<T>;\n}\n\n/**\n * Prop the client refreshes when a realtime event arrives.\n */\nexport interface LiveProp<T> {\n live: (options: LiveOptions) => LiveProp<T>;\n}\n\n/**\n * Prop the client resolves once and caches across visits.\n */\nexport interface OnceProp<T> {\n as: (key: string) => OnceProp<T>;\n until: (delay: number | Date) => OnceProp<T>;\n fresh: (value?: boolean) => OnceProp<T>;\n live: (options: LiveOptions) => OnceProp<T>;\n}\n\n/**\n * Infinite-scroll prop carrying pagination metadata.\n */\nexport interface ScrollProp<T> {\n defer: (group?: string) => ScrollProp<T>;\n matchOn: (path: string | string[]) => ScrollProp<T>;\n}\n\n/**\n * Throw a `TypeError` unless `fn` is callable.\n *\n * @param name Constructor name, for the error message.\n * @param fn Value that must be a function.\n */\nfunction assertCallable(name: string, fn: unknown): void {\n if (typeof fn !== 'function') {\n throw new TypeError(`${name}() expects a function, received ${typeof fn}.`);\n }\n}\n\n/**\n * Throw a `TypeError` when a merge constructor received extra arguments\n * (the 2.x `merge(value, matchOn)` form), so migrating callers fail loudly\n * instead of silently losing their dedupe key.\n *\n * @param name Constructor name, for the error message.\n * @param extra Arguments passed after the value.\n */\nfunction assertNoMatchOnArgument(name: string, extra: readonly unknown[]): void {\n if (extra.length > 0) {\n throw new TypeError(`${name}() takes a single argument; use ${name}(value).matchOn(...) to dedupe merged items.`);\n }\n}\n\n/**\n * An optional prop: omitted from the first load, resolved when requested.\n *\n * @param fn Producer called (and awaited) when the prop is requested.\n */\nexport function optional<T>(fn: () => T | Promise<T>): OptionalProp<T> {\n assertCallable('optional', fn);\n const prop = new PropDescriptor<T>('optional', fn);\n prop.ignoreFirstLoad = true;\n\n return prop;\n}\n\n/**\n * A deferred prop: omitted from the first load and fetched by the client in\n * a follow-up request with the rest of its group.\n *\n * @param fn Producer called (and awaited) on the follow-up request.\n * @param group Load group; props sharing a group are fetched together.\n */\nexport function defer<T>(fn: () => T | Promise<T>, group = 'default'): DeferProp<T> {\n assertCallable('defer', fn);\n const prop = new PropDescriptor<T>('defer', fn);\n prop.ignoreFirstLoad = true;\n\n return prop.defer(group);\n}\n\n/**\n * An always prop: included on every response, even partial reloads that do\n * not request it.\n *\n * @param value Plain value or producer.\n */\nexport function always<T>(value: PropSource<T>): AlwaysProp<T> {\n const prop = new PropDescriptor<T>('always', value);\n prop.isAlways = true;\n\n return prop;\n}\n\n/**\n * A live prop: its value is resolved like an always prop's source and the\n * client refreshes it when one of the given events arrives.\n *\n * @param value Plain value or producer.\n * @param options Events, channels and optional throttle.\n */\nexport function live<T>(value: PropSource<T>, options: LiveOptions): LiveProp<T> {\n return new PropDescriptor<T>('live', value).live(options);\n}\n\n/**\n * A merge prop: the client appends it to its existing value at the root.\n * Throws a `TypeError` when given a second argument (the 2.x `matchOn`\n * form); chain `.matchOn()` instead.\n *\n * @param value Plain value or producer.\n * @param extra Rejected; present only to catch the 2.x call form.\n */\nexport function merge<T>(value: PropSource<T>, ...extra: never[]): MergeProp<T> {\n assertNoMatchOnArgument('merge', extra);\n\n return new PropDescriptor<T>('merge', value).merge();\n}\n\n/**\n * A deep-merge prop: the client recursively merges it into its existing value.\n * Throws a `TypeError` when given a second argument (the 2.x `matchOn`\n * form); chain `.matchOn()` instead.\n *\n * @param value Plain value or producer.\n * @param extra Rejected; present only to catch the 2.x call form.\n */\nexport function deepMerge<T>(value: PropSource<T>, ...extra: never[]): MergeProp<T> {\n assertNoMatchOnArgument('deepMerge', extra);\n\n return new PropDescriptor<T>('merge', value).deepMerge();\n}\n\n/**\n * A once prop: resolved once and cached by the client across visits.\n *\n * @param fn Producer called (and awaited) when the client lacks the value.\n */\nexport function once<T>(fn: () => T | Promise<T>): OnceProp<T> {\n assertCallable('once', fn);\n\n return new PropDescriptor<T>('once', fn).once();\n}\n\n/**\n * An infinite-scroll prop: merged at its wrapper key and carrying\n * pagination metadata.\n *\n * @param fn Producer called (and awaited) for each page.\n * @param options Wrapper key (default `'data'`) and pagination metadata.\n */\nexport function scroll<T>(fn: () => T | Promise<T>, options: ScrollOptions<T>): ScrollProp<T> {\n assertCallable('scroll', fn);\n\n if (options?.metadata === undefined || options.metadata === null) {\n throw new TypeError('scroll() requires options.metadata.');\n }\n\n const prop = new PropDescriptor<T>('scroll', fn).merge();\n prop.isScroll = true;\n prop.wrapper = options.wrapper ?? 'data';\n prop.scrollMetadata = options.metadata;\n\n return prop;\n}\n\n/**\n * Type guard: `true` when `value` is a {@link PropDescriptor}.\n *\n * @param value Value to test.\n */\nexport function isPropDescriptor(value: unknown): value is PropDescriptor {\n return value instanceof PropDescriptor;\n}\n","import { isPropDescriptor } from './props.js';\n\nimport type { PageProps } from './types.js';\n\ntype Container = Record<string, unknown>;\n\n/**\n * Defines `key` on `container` as an own data property, so `__proto__` never reaches the setter.\n *\n * @param container Object to write into.\n * @param key Own key to define.\n * @param value Value to store.\n */\nfunction defineOwn(container: Container, key: string, value: unknown): void {\n Object.defineProperty(container, key, {\n value, enumerable: true, writable: true, configurable: true,\n });\n}\n\n/**\n * Calls and awaits `value` when it is a bare function; returns anything else unchanged.\n *\n * @param value Prop value or closure.\n */\nasync function resolveClosure(value: unknown): Promise<unknown> {\n if (typeof value === 'function' && !isPropDescriptor(value)) {\n return await (value as () => unknown)();\n }\n\n return value;\n}\n\n/**\n * Shallow copy of `value` when it is a plain object or array, otherwise a fresh empty object.\n *\n * @param value Segment value to copy for writing.\n */\nfunction copyForWrite(value: unknown): Container {\n if (Array.isArray(value)) {\n return [...value] as unknown as Container;\n }\n\n if (value !== null && typeof value === 'object' && !isPropDescriptor(value)) {\n const proto: unknown = Object.getPrototypeOf(value);\n\n if (proto === Object.prototype || proto === null) {\n return { ...(value as Container) };\n }\n }\n\n return {};\n}\n\n/**\n * Sets `value` at the dot-notation `key` inside `result`, resolving closures along the way.\n *\n * @param result Props object being built; written in place.\n * @param key Dot-notation key.\n * @param value Already-resolved value to set.\n */\nasync function setDotted(result: PageProps, key: string, value: unknown): Promise<void> {\n const segments = key.split('.');\n const last = segments.pop() as string;\n const target = await segments.reduce<Promise<Container>>(async (parentPromise, segment) => {\n const parent = await parentPromise;\n const current = Object.hasOwn(parent, segment) ? parent[segment] : undefined;\n const next = copyForWrite(await resolveClosure(current));\n\n defineOwn(parent, segment, next);\n\n return next;\n }, Promise.resolve(result));\n\n defineOwn(target, last, value);\n}\n\n/**\n * Unpacks top-level dot-notation keys into nested objects, like `Arr::set`.\n *\n * Bare functions along the intermediate segments, and at the dotted key itself, are called and\n * awaited first. Non-object segments are replaced by fresh objects. Prop descriptors are left as\n * values for the resolver. The input and the nested objects it holds are never mutated.\n *\n * @param props Page props that may contain dotted keys.\n */\nexport async function unpackDotProps(props: PageProps): Promise<PageProps> {\n const dottedKeys = Object.keys(props).filter((key) => key.includes('.'));\n\n return dottedKeys.reduce<Promise<PageProps>>(async (resultPromise, key) => {\n const result = await resultPromise;\n const value = await resolveClosure(props[key]);\n\n delete result[key];\n await setDotted(result, key, value);\n\n return result;\n }, Promise.resolve({ ...props }));\n}\n\nexport default unpackDotProps;\n","/**\n * `true` when `path` equals `parent` or lies in its dot-notation subtree.\n *\n * @param path Dot-notation prop path to test.\n * @param parent Dot-notation path that may contain `path`.\n */\nexport function pathIsSameOrDescendant(path: string, parent: string): boolean {\n return path === parent || path.startsWith(`${parent}.`);\n}\n\n/**\n * `true` when `path` matches an `only` entry or is a descendant of one.\n *\n * @param path Dot-notation prop path to test.\n * @param only Requested partial-reload `only` paths.\n */\nexport function matchesOnly(path: string, only: string[]): boolean {\n return only.some((onlyPath) => pathIsSameOrDescendant(path, onlyPath));\n}\n\n/**\n * `true` when `path` is a strict ancestor of an `only` entry.\n *\n * @param path Dot-notation prop path to test.\n * @param only Requested partial-reload `only` paths.\n */\nexport function leadsToOnly(path: string, only: string[]): boolean {\n return only.some((onlyPath) => onlyPath.startsWith(`${path}.`));\n}\n\n/**\n * `true` when `path` equals an `except` entry, is a descendant of one, or is\n * an ancestor of one. Matching ancestors mirrors the reference Node server,\n * whose flat filter drops a top-level key whenever any `except` entry lives\n * under it; inertia-laravel keeps the ancestor and drops only the child.\n *\n * @param path Dot-notation prop path to test.\n * @param except Requested partial-reload `except` paths.\n */\nexport function matchesExcept(path: string, except: string[]): boolean {\n return except.some(\n (exceptPath) => pathIsSameOrDescendant(path, exceptPath) || pathIsSameOrDescendant(exceptPath, path),\n );\n}\n","import { unpackDotProps } from './dot-props.js';\nimport { leadsToOnly, matchesExcept, matchesOnly } from './partial-filter.js';\nimport { isPropDescriptor } from './props.js';\n\nimport type PropDescriptor from './prop-descriptor.js';\nimport type {\n InertiaRequestInfo, LiveMetadata, OnceMetadata, PageProps, PropsMetadata, RescueHandler, ScrollMetadata,\n} from './types.js';\n\n/**\n * Input to {@link resolveProps}.\n */\nexport interface ResolvePropsInput {\n /** Page props for the component being rendered. */\n props: PageProps;\n /** Already-evaluated shared props; page props win on key collision. */\n shared: PageProps;\n /** Component being rendered; a partial reload only applies when it matches. */\n component: string;\n /** Normalized Inertia request state. */\n request: InertiaRequestInfo;\n /** Hook called when a rescued prop throws. */\n onRescue?: RescueHandler;\n}\n\n/**\n * Output of {@link resolveProps}.\n */\nexport interface ResolvePropsResult {\n /** Fully resolved props tree. */\n props: PageProps;\n /** Page-level metadata; only non-empty keys are present. */\n metadata: PropsMetadata;\n}\n\ntype Node = Record<string, unknown> | unknown[];\n\n/**\n * `true` for arrays and for objects whose prototype is `Object.prototype` or `null`.\n *\n * @param value Value to test.\n */\nfunction isPlainObjectOrArray(value: unknown): value is Node {\n if (Array.isArray(value)) {\n return true;\n }\n\n if (value === null || typeof value !== 'object') {\n return false;\n }\n\n const proto = Object.getPrototypeOf(value) as unknown;\n\n return proto === Object.prototype || proto === null;\n}\n\n/**\n * Normalize a partial header list: empty entries are dropped and an empty list becomes `null`.\n *\n * @param list Parsed header list, or `null` when absent.\n */\nfunction normalizeList(list: string[] | null): string[] | null {\n const entries = (list ?? []).filter((entry) => entry !== '');\n\n return entries.length > 0 ? entries : null;\n}\n\n/**\n * Default rescue hook: log the rescued error with the prop's path.\n *\n * @param error The thrown value.\n * @param path Dot path of the rescued prop.\n */\nfunction reportRescuedError(error: unknown, path: string): void {\n console.error(`Inertia prop '${path}' failed to resolve and was rescued.`, error);\n}\n\n/**\n * Report a failure of a custom rescue hook through the default reporter:\n * the original rescued error, then the hook's own error.\n *\n * @param hookError The value the hook threw or rejected with.\n * @param error The rescued error the hook was given.\n * @param path Dot path of the rescued prop.\n */\nfunction reportHookFailure(hookError: unknown, error: unknown, path: string): void {\n reportRescuedError(error, path);\n console.error(`Inertia onRescue hook failed while reporting prop '${path}'.`, hookError);\n}\n\n/**\n * Marker returned by a settled entry that is left out of its parent node.\n */\nconst EXCLUDED: unique symbol = Symbol('excluded');\n\n/**\n * An error thrown by a rescuable descriptor, carried to the walk so the\n * rescue is recorded in insertion order.\n */\ninterface Rescued {\n /** The thrown value. */\n error: unknown;\n}\n\n/**\n * Every {@link Rescued} wrapper created by {@link rescued}.\n */\nconst rescuedMarkers = new WeakSet();\n\n/**\n * Wrap a rescued error.\n *\n * @param error The thrown value.\n */\nfunction rescued(error: unknown): Rescued {\n const marker = { error };\n rescuedMarkers.add(marker);\n\n return marker;\n}\n\n/**\n * `true` when `value` is a wrapper created by {@link rescued}.\n *\n * @param value A resolved value.\n */\nfunction isRescued(value: unknown): value is Rescued {\n return typeof value === 'object' && value !== null && rescuedMarkers.has(value);\n}\n\n/**\n * One included entry of a node, classified before any entry is awaited.\n */\ninterface Entry {\n /** Key of the entry in its parent node. */\n key: string;\n /** Dot path of the entry. */\n path: string;\n /** The prop as found in its parent node. */\n prop: unknown;\n /** Whether the entry is excluded from the initial load. */\n excluded: boolean;\n /** The started resolution, or `null` for excluded entries and plain values. */\n pending: Promise<unknown> | null;\n}\n\n/**\n * `true` when a prop must be resolved asynchronously: a descriptor, a\n * function, or a thenable. Anything else is copied as is.\n *\n * @param prop The prop as found in its parent node.\n */\nfunction needsResolution(prop: unknown): boolean {\n if (typeof prop === 'function') {\n return true;\n }\n\n if (prop === null || typeof prop !== 'object') {\n return false;\n }\n\n return isPropDescriptor(prop) || typeof (prop as { then?: unknown }).then === 'function';\n}\n\n/**\n * Swallow a rejection on a started resolution that may never be awaited\n * because an earlier sibling failed; the awaited copy still rejects.\n */\nfunction ignoreRejection(): void {}\n\n/**\n * Write a settled entry into the node being built, skipping excluded entries.\n * Object keys are written as own data properties, so `__proto__` never\n * reaches the prototype setter.\n *\n * @param result Node being built; written in place.\n * @param key Key of the entry.\n * @param outcome Settled value, or {@link EXCLUDED}.\n */\nfunction writeEntry(result: Node, key: string, outcome: unknown): void {\n if (outcome === EXCLUDED) {\n return;\n }\n\n if (Array.isArray(result)) {\n result.push(outcome);\n } else if (key === '__proto__') {\n Object.defineProperty(result, key, {\n value: outcome, enumerable: true, writable: true, configurable: true,\n });\n } else {\n // eslint-disable-next-line no-param-reassign -- result is the fresh node this walk is building\n result[key] = outcome;\n }\n}\n\n/**\n * Where a mergeable prop merges for one request: at its root (appending or\n * prepending) or at the listed child paths.\n */\ninterface MergeLayout {\n appendsAtRoot: boolean;\n prependsAtRoot: boolean;\n appendPaths: readonly string[];\n prependPaths: readonly string[];\n}\n\n/**\n * Resolves shared and page props for one response, applying partial-reload\n * filtering and initial-load exclusion and collecting page metadata. Port of\n * inertia-laravel's `PropsResolver`. Use one instance per response: the\n * instance accumulates metadata, so {@link PropsResolver.resolve} throws when\n * called a second time. The resolver only reads descriptors, never writes\n * them. Metadata maps keyed by user input (`deferredProps`, `scrollProps`,\n * `onceProps`) have a null prototype, so any key, `__proto__` included, is\n * stored as an own property.\n */\nexport default class PropsResolver {\n private readonly request: InertiaRequestInfo;\n\n private readonly component: string;\n\n private readonly onRescue: RescueHandler;\n\n private readonly isPartial: boolean;\n\n private readonly isInertia: boolean;\n\n private readonly only: string[] | null;\n\n private readonly except: string[] | null;\n\n private readonly sharedPropKeys: string[] = [];\n\n private readonly mergeProps: string[] = [];\n\n private readonly prependProps: string[] = [];\n\n private readonly deepMergeProps: string[] = [];\n\n private readonly matchPropsOn: string[] = [];\n\n private readonly deferredProps = Object.create(null) as Record<string, string[]>;\n\n private readonly rescuedProps: string[] = [];\n\n private readonly scrollProps = Object.create(null) as Record<string, ScrollMetadata & { reset: boolean }>;\n\n private readonly onceProps = Object.create(null) as Record<string, OnceMetadata>;\n\n private readonly liveProps = Object.create(null) as Record<string, LiveMetadata>;\n\n private used = false;\n\n /**\n * Create a resolver for one request and component.\n *\n * @param request Normalized Inertia request state.\n * @param component Component being rendered.\n * @param onRescue Hook called when a rescued prop throws.\n */\n constructor(request: InertiaRequestInfo, component: string, onRescue?: RescueHandler) {\n this.request = request;\n this.component = component;\n this.onRescue = onRescue ?? reportRescuedError;\n this.isPartial = request.partialComponent === component;\n this.isInertia = request.isInertia;\n this.only = normalizeList(request.partialOnly);\n this.except = normalizeList(request.partialExcept);\n }\n\n /**\n * Resolve the given shared and page props, collecting their metadata.\n *\n * @param shared Already-evaluated shared props.\n * @param props Page props; these win over shared props on collision.\n */\n async resolve(shared: PageProps, props: PageProps): Promise<ResolvePropsResult> {\n this.markUsed();\n const combined = { ...this.resolveSharedProps(shared), ...props };\n const resolved = await this.walk(await unpackDotProps(combined), '', false);\n\n return { props: resolved as PageProps, metadata: this.buildMetadata() };\n }\n\n /**\n * Resolve props for a socket broadcast payload: every prop is resolved, with\n * no partial filtering, once/defer exclusion, metadata or dotted-key\n * unpacking. Siblings resolve concurrently and keep insertion order; rescued\n * props are reported and omitted; plain objects and arrays are recursed into.\n *\n * @param props Props to resolve.\n */\n async resolveBroadcast(props: PageProps): Promise<PageProps> {\n this.markUsed();\n\n return await this.broadcastNode(props, '') as PageProps;\n }\n\n /**\n * Fail when this resolver has already been used; otherwise mark it used.\n */\n private markUsed(): void {\n if (this.used) {\n throw new Error('PropsResolver.resolve() was already called on this instance; create one resolver per response.');\n }\n\n this.used = true;\n }\n\n /**\n * Resolve one level of a broadcast payload.\n *\n * @param node Plain object or array whose entries are resolved.\n * @param prefix Dot path of the node, empty at the root.\n */\n private async broadcastNode(node: Node, prefix: string): Promise<Node> {\n const keys = Object.keys(node);\n const values = await Promise.all(keys.map(async (key) => (\n this.broadcastEntry((node as Record<string, unknown>)[key], prefix === '' ? key : `${prefix}.${key}`)\n )));\n\n const result: Node = Array.isArray(node) ? [] : {};\n\n keys.forEach((key, index) => {\n writeEntry(result, key, values[index]);\n });\n\n return result;\n }\n\n /**\n * Resolve a single broadcast entry, unwrapping one level of returned descriptor.\n *\n * @param prop The entry's raw value.\n * @param path Dot path of the entry.\n */\n private async broadcastEntry(prop: unknown, path: string): Promise<unknown> {\n let value = await this.resolveValue(prop);\n\n if (isRescued(value)) {\n return this.rescue(value.error, path);\n }\n\n if (value !== prop && this.isPropType(value)) {\n value = await this.resolveValue(value);\n\n if (isRescued(value)) {\n return this.rescue(value.error, path);\n }\n }\n\n return isPlainObjectOrArray(value) ? this.broadcastNode(value, path) : value;\n }\n\n /**\n * Record the top-level keys of shared props (the segment before the first\n * `.` for dot-notation keys), deduplicated in first-seen order.\n *\n * @param shared Already-evaluated shared props.\n */\n private resolveSharedProps(shared: PageProps): PageProps {\n Object.keys(shared).forEach((key) => {\n const [topLevel = key] = key.split('.', 1);\n\n if (!this.sharedPropKeys.includes(topLevel)) {\n this.sharedPropKeys.push(topLevel);\n }\n });\n\n return shared;\n }\n\n /**\n * Build the non-empty metadata entries for the page response, in protocol order.\n */\n private buildMetadata(): PropsMetadata {\n const entries: [keyof PropsMetadata, string[] | Record<string, unknown>][] = [\n ['sharedProps', this.sharedPropKeys],\n ['mergeProps', this.mergeProps],\n ['prependProps', this.prependProps],\n ['deepMergeProps', this.deepMergeProps],\n ['matchPropsOn', this.matchPropsOn],\n ['deferredProps', this.deferredProps],\n ['rescuedProps', this.rescuedProps],\n ['scrollProps', this.scrollProps],\n ['onceProps', this.onceProps],\n ['liveProps', this.liveProps],\n ];\n\n return Object.fromEntries(entries.filter(([, value]) => Object.keys(value).length > 0));\n }\n\n /**\n * Recursively resolve a props node, collecting metadata along the way.\n * Every included entry that needs resolving is started in insertion order\n * before any is awaited, so siblings resolve concurrently; each entry is\n * then settled in insertion order (rescue, one-level unwrap, metadata,\n * recursion), keeping output key order and metadata order deterministic.\n * Plain values are copied synchronously, so a node without closures or\n * descriptors comes back without a promise. Arrays come back as arrays\n * with excluded entries dropped, so later index-based `except`/`reset`\n * paths shift down; objects come back as fresh plain objects. When the\n * original prop was not itself a plain object or array (e.g. a closure\n * that returned one), its children bypass partial filtering.\n *\n * @param node Plain object or array to walk.\n * @param prefix Dot path of `node`, or `''` at the root.\n * @param parentWasResolved Whether an ancestor was produced by resolving a closure or descriptor.\n */\n private walk(node: Node, prefix: string, parentWasResolved: boolean): Node | Promise<Node> {\n const entries = this.startEntries(node, prefix, parentWasResolved);\n const result: Node = Array.isArray(node) ? [] : {};\n\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index] as Entry;\n const outcome = this.settleEntry(entry, parentWasResolved);\n\n if (outcome instanceof Promise) {\n return this.finishWalk(entries, index, outcome, result, parentWasResolved);\n }\n\n writeEntry(result, entry.key, outcome);\n }\n\n return result;\n }\n\n /**\n * Continue a walk asynchronously from the first entry whose outcome is pending.\n *\n * @param entries Started entries of the node.\n * @param index Index of the pending entry.\n * @param pending Outcome of the entry at `index`.\n * @param result Node being built; written in place.\n * @param parentWasResolved Whether an ancestor was produced by resolving a closure or descriptor.\n */\n private async finishWalk(\n entries: Entry[],\n index: number,\n pending: Promise<unknown>,\n result: Node,\n parentWasResolved: boolean,\n ): Promise<Node> {\n writeEntry(result, (entries[index] as Entry).key, await pending);\n\n for (let next = index + 1; next < entries.length; next += 1) {\n const entry = entries[next] as Entry;\n const outcome = this.settleEntry(entry, parentWasResolved);\n\n // eslint-disable-next-line no-await-in-loop -- entries are settled one at a time in insertion order; their sources already run concurrently\n writeEntry(result, entry.key, outcome instanceof Promise ? await outcome : outcome);\n }\n\n return result;\n }\n\n /**\n * Run the synchronous pre-resolve checks (partial filter, initial-load\n * exclusion) over a node's entries in insertion order and start resolving\n * every included entry that needs it.\n *\n * @param node Plain object or array to walk.\n * @param prefix Dot path of `node`, or `''` at the root.\n * @param parentWasResolved Whether an ancestor was produced by resolving a closure or descriptor.\n */\n private startEntries(node: Node, prefix: string, parentWasResolved: boolean): Entry[] {\n const entries: Entry[] = [];\n\n const visit = (prop: unknown, key: string): void => {\n const path = prefix === '' ? key : `${prefix}.${key}`;\n\n if (this.shouldIncludeInPartialResponse(prop, path, parentWasResolved)) {\n entries.push(this.startEntry(key, path, prop));\n }\n };\n\n if (Array.isArray(node)) {\n node.forEach((prop, index) => visit(prop, String(index)));\n } else {\n Object.keys(node).forEach((key) => visit(node[key], key));\n }\n\n return entries;\n }\n\n /**\n * Classify one included entry: excluded from the initial load, pending\n * resolution (started now), or a plain value copied as is.\n *\n * @param key Key of the entry in its parent node.\n * @param path Dot path of the entry.\n * @param prop The prop as found in its parent node.\n */\n private startEntry(key: string, path: string, prop: unknown): Entry {\n if (!this.isPartial && this.isExcludedFromInitialResponse(prop, path)) {\n return {\n key, path, prop, excluded: true, pending: null,\n };\n }\n\n if (needsResolution(prop)) {\n const pending = this.resolveValue(prop);\n pending.catch(ignoreRejection);\n\n return {\n key, path, prop, excluded: false, pending,\n };\n }\n\n return {\n key, path, prop, excluded: false, pending: null,\n };\n }\n\n /**\n * Finish one started entry in insertion order. Returns the value to write,\n * {@link EXCLUDED}, or a promise of either when the entry needs awaiting.\n *\n * @param entry The started entry.\n * @param parentWasResolved Whether an ancestor was produced by resolving a closure or descriptor.\n */\n private settleEntry(entry: Entry, parentWasResolved: boolean): unknown {\n if (entry.excluded) {\n this.collectExclusionMetadata(entry.prop as PropDescriptor, entry.path);\n\n return EXCLUDED;\n }\n\n if (entry.pending !== null) {\n return this.settleResolved(entry, entry.pending, parentWasResolved);\n }\n\n return this.include(entry.prop, entry.prop, entry.path, parentWasResolved);\n }\n\n /**\n * Await a started resolution, then apply rescue, the one-level descriptor\n * unwrap (with its own initial-load exclusion) and inclusion.\n *\n * @param entry The started entry.\n * @param pending The entry's resolution.\n * @param parentWasResolved Whether an ancestor was produced by resolving a closure or descriptor.\n */\n private async settleResolved(entry: Entry, pending: Promise<unknown>, parentWasResolved: boolean): Promise<unknown> {\n const { path } = entry;\n let current = entry.prop;\n let value = await pending;\n\n if (isRescued(value)) {\n return this.rescue(value.error, path);\n }\n\n if (value !== current && this.isPropType(value)) {\n current = value;\n\n if (!this.isPartial && this.isExcludedFromInitialResponse(current, path)) {\n this.collectExclusionMetadata(current, path);\n\n return EXCLUDED;\n }\n\n value = await this.resolveValue(current);\n\n if (isRescued(value)) {\n return this.rescue(value.error, path);\n }\n }\n\n return this.include(current, value, path, parentWasResolved);\n }\n\n /**\n * Include a resolved prop: check scroll shape, collect metadata, and walk\n * into plain objects and arrays.\n *\n * @param prop The prop that produced `value`.\n * @param value The prop's resolved value.\n * @param path Dot path of the prop.\n * @param parentWasResolved Whether an ancestor was produced by resolving a closure or descriptor.\n */\n private include(prop: unknown, value: unknown, path: string, parentWasResolved: boolean): unknown {\n this.assertScrollShape(prop, path, value);\n this.collectMetadata(prop, path, value, parentWasResolved);\n\n if (isPlainObjectOrArray(value)) {\n return this.walk(value, path, parentWasResolved || !isPlainObjectOrArray(prop));\n }\n\n return value;\n }\n\n /**\n * Determine if a prop belongs in the response: always on a full visit;\n * on a partial reload, when it bypasses filtering or its path matches the request.\n *\n * @param prop The prop being considered.\n * @param path Dot path of the prop.\n * @param parentWasResolved Whether an ancestor was produced by resolving a closure or descriptor.\n */\n private shouldIncludeInPartialResponse(prop: unknown, path: string, parentWasResolved: boolean): boolean {\n if (!this.isPartial || this.bypassesPartialFiltering(prop, parentWasResolved)) {\n return true;\n }\n\n return this.pathMatchesPartialRequest(path);\n }\n\n /**\n * Determine if a prop is resolved independently of partial filters:\n * always props, and children of already-resolved values.\n *\n * @param prop The prop being considered.\n * @param parentWasResolved Whether an ancestor was produced by resolving a closure or descriptor.\n */\n // eslint-disable-next-line class-methods-use-this\n private bypassesPartialFiltering(prop: unknown, parentWasResolved: boolean): boolean {\n return (isPropDescriptor(prop) && prop.isAlways) || parentWasResolved;\n }\n\n /**\n * Determine if the path matches the partial request using bidirectional\n * prefix matching on both the only list and the except list.\n *\n * @param path Dot path of the prop.\n */\n private pathMatchesPartialRequest(path: string): boolean {\n if (this.only !== null && !matchesOnly(path, this.only) && !leadsToOnly(path, this.only)) {\n return false;\n }\n\n if (this.except !== null && matchesExcept(path, this.except)) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Determine if a prop is excluded from the initial page response: an\n * optional or deferred descriptor, or a once-prop the client already holds.\n *\n * @param prop The prop being considered.\n * @param path Dot path of the prop.\n */\n private isExcludedFromInitialResponse(prop: unknown, path: string): prop is PropDescriptor {\n if (!isPropDescriptor(prop)) {\n return false;\n }\n\n return prop.ignoreFirstLoad\n || prop.defers\n || (this.isInertia && this.wasAlreadyLoadedByClient(prop, path));\n }\n\n /**\n * Collect the metadata of a prop excluded from the initial response\n * according to why it was excluded.\n *\n * @param prop The descriptor being excluded.\n * @param path Dot path of the prop.\n */\n private collectExclusionMetadata(prop: PropDescriptor, path: string): void {\n if (prop.isLive) {\n this.collectLiveMetadata(path, prop, false);\n }\n\n if (prop.ignoreFirstLoad) {\n this.collectIgnoredPropMetadata(prop, path);\n } else if (prop.defers) {\n this.collectDeferredExclusionMetadata(prop, path);\n } else {\n this.collectOnceMetadata(path, prop);\n }\n }\n\n /**\n * Collect the deferred, merge and once metadata of an excluded\n * first-load-ignored prop (optional, defer).\n *\n * @param prop The descriptor being excluded.\n * @param path Dot path of the prop.\n */\n private collectIgnoredPropMetadata(prop: PropDescriptor, path: string): void {\n if (prop.defers && !this.wasAlreadyLoadedByClient(prop, path)) {\n this.collectDeferredPropMetadata(path, prop);\n }\n\n if (prop.merges) {\n this.collectMergeableMetadata(path, prop, true);\n }\n\n if (prop.resolvesOnce) {\n this.collectOnceMetadata(path, prop);\n }\n }\n\n /**\n * Collect the deferred-group and merge metadata of an excluded deferred prop.\n *\n * @param prop The descriptor being excluded.\n * @param path Dot path of the prop.\n */\n private collectDeferredExclusionMetadata(prop: PropDescriptor, path: string): void {\n this.collectDeferredPropMetadata(path, prop);\n\n if (prop.merges) {\n this.collectMergeableMetadata(path, prop, true);\n }\n }\n\n /**\n * Determine if a once-prop has already been loaded by the client: it\n * resolves once, is not forced fresh, and its key (or path) is listed in\n * the client's except-once header.\n *\n * @param prop The descriptor being considered.\n * @param path Dot path of the prop.\n */\n private wasAlreadyLoadedByClient(prop: PropDescriptor, path: string): boolean {\n return prop.resolvesOnce\n && !prop.isFresh\n && this.request.exceptOnceProps.includes(prop.onceKey ?? path);\n }\n\n /**\n * Resolve a single prop value: a descriptor resolves its source, a bare\n * function is called, and the result is awaited; anything else passes\n * through. An error thrown by a rescuable descriptor comes back wrapped in\n * {@link Rescued}; any other error rejects.\n *\n * @param prop The prop to resolve.\n */\n // eslint-disable-next-line class-methods-use-this\n private async resolveValue(prop: unknown): Promise<unknown> {\n try {\n if (isPropDescriptor(prop)) {\n return await prop.resolveSource();\n }\n\n if (typeof prop === 'function') {\n return await (prop as () => unknown)();\n }\n\n return await prop;\n } catch (error) {\n if (isPropDescriptor(prop) && prop.rescues) {\n return rescued(error);\n }\n\n throw error;\n }\n }\n\n /**\n * Throw when a scroll prop did not resolve to a plain object holding its\n * wrapper key as an own property.\n *\n * @param prop The prop being included.\n * @param path Dot path of the prop.\n * @param resolved The prop's resolved value.\n */\n // eslint-disable-next-line class-methods-use-this\n private assertScrollShape(prop: unknown, path: string, resolved: unknown): void {\n if (!isPropDescriptor(prop) || !prop.isScroll) {\n return;\n }\n\n if (Array.isArray(resolved) || !isPlainObjectOrArray(resolved) || !Object.hasOwn(resolved, prop.wrapper)) {\n throw new TypeError(`Scroll prop '${path}' must resolve to an object with a '${prop.wrapper}' key`);\n }\n }\n\n /**\n * Record a rescued prop: report the error, add its path to `rescuedProps`\n * and omit it from the response.\n *\n * @param error The thrown value.\n * @param path Dot path of the prop.\n */\n private rescue(error: unknown, path: string): typeof EXCLUDED {\n this.reportRescue(error, path);\n this.rescuedProps.push(path);\n\n return EXCLUDED;\n }\n\n /**\n * Call the rescue hook with the failure contained: a synchronous throw or\n * a rejected returned thenable is logged through the default reporter and\n * never propagates or surfaces as an unhandled rejection.\n *\n * @param error The thrown value.\n * @param path Dot path of the prop.\n */\n private reportRescue(error: unknown, path: string): void {\n const hook: (error: unknown, path: string) => unknown = this.onRescue;\n\n try {\n const result = hook(error, path);\n\n if (result !== null && typeof result === 'object' && typeof (result as { then?: unknown }).then === 'function') {\n Promise.resolve(result).catch((hookError: unknown) => reportHookFailure(hookError, error, path));\n }\n } catch (hookError) {\n reportHookFailure(hookError, error, path);\n }\n }\n\n /**\n * Determine if the value is a prop type that needs further filtering or\n * metadata collection.\n *\n * @param value The resolved value.\n */\n // eslint-disable-next-line class-methods-use-this\n private isPropType(value: unknown): value is PropDescriptor {\n return isPropDescriptor(value);\n }\n\n /**\n * Collect metadata for a prop that will be included in the response.\n *\n * @param prop The prop being included.\n * @param path Dot path of the prop.\n * @param resolved The prop's resolved value.\n * @param parentWasResolved Whether an ancestor was produced by resolving a closure or descriptor.\n */\n private collectMetadata(prop: unknown, path: string, resolved: unknown, parentWasResolved: boolean): void {\n if (!isPropDescriptor(prop)) {\n return;\n }\n\n if (prop.merges) {\n this.collectMergeableMetadata(path, prop, false);\n }\n\n if (prop.isScroll) {\n this.collectScrollMetadata(path, prop, resolved);\n }\n\n if (prop.resolvesOnce) {\n this.collectOnceMetadata(path, prop);\n }\n\n if (prop.isLive) {\n this.collectLiveMetadata(path, prop, parentWasResolved);\n }\n }\n\n /**\n * Collect the listener manifest of a live prop, unless a partial request\n * filters it out. Listener errors are not rescued.\n *\n * @param path Dot path of the prop.\n * @param prop The live descriptor.\n * @param parentWasResolved Whether an ancestor was produced by resolving a closure or descriptor.\n */\n private collectLiveMetadata(path: string, prop: PropDescriptor, parentWasResolved: boolean): void {\n if (\n this.isPartial\n && !this.bypassesPartialFiltering(prop, parentWasResolved)\n && !this.isIncludedInPartialMetadata(path)\n ) {\n return;\n }\n\n this.liveProps[path] = {\n listeners: prop.liveListeners(),\n ...(prop.liveThrottle !== null ? { throttle: prop.liveThrottle } : {}),\n };\n }\n\n /**\n * Collect the deferred prop under its group.\n *\n * @param path Dot path of the prop.\n * @param prop The deferred descriptor.\n */\n private collectDeferredPropMetadata(path: string, prop: PropDescriptor): void {\n const group = this.deferredProps[prop.group] ?? [];\n group.push(path);\n this.deferredProps[prop.group] = group;\n }\n\n /**\n * Collect the merge strategy for a mergeable prop, unless the client asked\n * to reset it or a partial request filters it out.\n *\n * @param path Dot path of the prop.\n * @param prop The mergeable descriptor.\n * @param excluded Whether the prop is being excluded from this response rather than resolved.\n */\n private collectMergeableMetadata(path: string, prop: PropDescriptor, excluded: boolean): void {\n if (this.request.resetKeys?.includes(path)) {\n return;\n }\n\n if (this.isPartial && !this.isIncludedInPartialMetadata(path)) {\n return;\n }\n\n const layout = this.mergeLayoutFor(prop, excluded);\n\n if (prop.deep) {\n this.deepMergeProps.push(path);\n } else if (layout.appendsAtRoot) {\n this.mergeProps.push(path);\n } else if (layout.prependsAtRoot) {\n this.prependProps.push(path);\n } else {\n this.mergeProps.push(...layout.appendPaths.map((appendPath) => `${path}.${appendPath}`));\n this.prependProps.push(...layout.prependPaths.map((prependPath) => `${path}.${prependPath}`));\n }\n\n this.matchPropsOn.push(...prop.matchOnPaths.map((matchOn) => `${path}.${matchOn}`));\n }\n\n /**\n * The merge layout of a descriptor for this request, read without writing\n * to the descriptor. A scroll descriptor derives its layout per request:\n * a root append while it is excluded as deferred, otherwise its wrapper key\n * appended or prepended according to the client's merge intent (the\n * read-only equivalent of `ScrollProp::configureMergeIntent`).\n *\n * @param prop The mergeable descriptor.\n * @param excluded Whether the prop is being excluded from this response rather than resolved.\n */\n private mergeLayoutFor(prop: PropDescriptor, excluded: boolean): MergeLayout {\n if (!prop.isScroll) {\n return prop;\n }\n\n if (excluded) {\n return {\n appendsAtRoot: true, prependsAtRoot: false, appendPaths: [], prependPaths: [],\n };\n }\n\n const prepends = this.request.mergeIntent === 'prepend';\n\n return {\n appendsAtRoot: false,\n prependsAtRoot: false,\n appendPaths: prepends ? [] : [prop.wrapper],\n prependPaths: prepends ? [prop.wrapper] : [],\n };\n }\n\n /**\n * Determine if the path should contribute metadata during a partial request.\n *\n * @param path Dot path of the prop.\n */\n private isIncludedInPartialMetadata(path: string): boolean {\n if (this.only !== null && !matchesOnly(path, this.only)) {\n return false;\n }\n\n if (this.except !== null && matchesExcept(path, this.except)) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Collect scroll pagination metadata, flagged for reset when the client\n * asked to reset the prop.\n *\n * @param path Dot path of the prop.\n * @param prop The scroll descriptor.\n * @param resolved The prop's resolved value.\n */\n private collectScrollMetadata(path: string, prop: PropDescriptor, resolved: unknown): void {\n this.scrollProps[path] = {\n ...prop.metadataFor(resolved),\n reset: this.request.resetKeys?.includes(path) ?? false,\n };\n }\n\n /**\n * Collect once-prop metadata under its custom key (or path), unless a\n * partial request filters it out.\n *\n * @param path Dot path of the prop.\n * @param prop The once descriptor.\n */\n private collectOnceMetadata(path: string, prop: PropDescriptor): void {\n if (!prop.resolvesOnce) {\n return;\n }\n\n if (this.isPartial && !this.isIncludedInPartialMetadata(path)) {\n return;\n }\n\n this.onceProps[prop.onceKey ?? path] = { prop: path, expiresAt: prop.expiresAt() };\n }\n}\n\n/**\n * Resolve shared and page props for one response.\n *\n * @param input Props, shared props, component, request state and rescue hook.\n */\nexport async function resolveProps(input: ResolvePropsInput): Promise<ResolvePropsResult> {\n return new PropsResolver(input.request, input.component, input.onRescue).resolve(input.shared, input.props);\n}\n","import PropsResolver from './props-resolver.js';\n\nimport type { InertiaRequestInfo, PageProps, RescueHandler } from './types.js';\n\n/**\n * Request info for a broadcast: not an Inertia request, nothing partial, nothing already loaded.\n */\nconst EMPTY_REQUEST: InertiaRequestInfo = Object.freeze({\n isInertia: false,\n version: null,\n partialComponent: null,\n partialOnly: null,\n partialExcept: null,\n errorBag: null,\n resetKeys: null,\n exceptOnceProps: [],\n mergeIntent: 'append',\n isPrefetch: false,\n socketId: null,\n method: 'GET',\n url: '/',\n});\n\n/**\n * Resolve props for a socket broadcast payload. Every prop is resolved (no\n * partial filtering, no once/defer exclusion) and rescued props are omitted.\n *\n * @param props Props to resolve.\n * @param onRescue Hook called when a rescued prop throws.\n */\nexport async function resolveBroadcastProps(props: PageProps, onRescue?: RescueHandler): Promise<PageProps> {\n return new PropsResolver({ ...EMPTY_REQUEST, exceptOnceProps: [] }, '', onRescue).resolveBroadcast(props);\n}\n\n/**\n * Build the `{ __inertia: { props } }` envelope a socket server broadcasts.\n *\n * @param props Props to resolve.\n * @param onRescue Hook called when a rescued prop throws.\n */\nexport async function broadcastProps(\n props: PageProps,\n onRescue?: RescueHandler,\n): Promise<{ __inertia: { props: PageProps } }> {\n return { __inertia: { props: await resolveBroadcastProps(props, onRescue) } };\n}\n","import { createHash } from 'node:crypto';\n\nimport type { InertiaPage, PageProps } from './types.js';\n\n/**\n * Pluggable storage interface for the SSR view cache.\n *\n * Implementations live outside the core package — see\n * `createMemoryCacheStore` in `@blacklizard/inertia-express` and\n * `createRedisCacheStore` in `@blacklizard/inertia-cache-redis`.\n *\n * Values are arbitrary JSON — usually `SsrCacheEntry` (`{ head, body, ... }`).\n * The store should not interpret them.\n */\nexport interface SsrCacheStore {\n get: (key: string) => Promise<SsrCacheEntry | null>;\n set: (key: string, value: SsrCacheEntry, ttlSeconds: number) => Promise<void>;\n delete: (key: string) => Promise<void>;\n}\n\n/**\n * What we actually store per cache hit. Includes everything needed to\n * reconstruct the HTML response without re-running the SSR renderer.\n */\nexport interface SsrCacheEntry {\n head: string | string[];\n body: string;\n bodyIsFullRoot?: boolean;\n /** ISO timestamp when this entry was stored. Useful for debugging. */\n storedAt: string;\n /**\n * The page object the entry was rendered from, kept for inspection and\n * invalidation tooling. A cache hit renders the page resolved for the\n * current request, not this one, so per-request fields such as `url` and\n * once-prop expiry stay current.\n */\n page: InertiaPage;\n}\n\n/**\n * Recursively normalize a value so equal-by-value inputs serialize identically:\n * object keys are sorted, `undefined` properties are dropped, and non-finite\n * numbers collapse to `null`.\n *\n * @param value Arbitrary JSON-shaped input.\n */\nfunction canonicalize(value: unknown): unknown {\n if (value === null) {\n return null;\n }\n\n if (typeof value !== 'object') {\n if (typeof value === 'number' && !Number.isFinite(value)) {\n return null;\n }\n\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map(canonicalize);\n }\n\n const obj = value as Record<string, unknown>;\n\n return Object.fromEntries(\n Object.keys(obj)\n .sort()\n .filter((key) => obj[key] !== undefined)\n .map((key) => [key, canonicalize(obj[key])]),\n );\n}\n\n/**\n * Stable JSON encoding: keys sorted recursively, undefined dropped, NaN/Inf\n * normalized. Two equal-by-value objects always produce the same string,\n * so they hash to the same cache key.\n *\n * @param value Arbitrary JSON-shaped input.\n */\nexport function canonicalStringify(value: unknown): string {\n return JSON.stringify(canonicalize(value));\n}\n\n/**\n * Inputs to {@link computeSsrCacheKey}.\n */\nexport interface ComputeCacheKeyInput {\n /** Cache namespace, e.g. `\"inertia:ssr\"`. */\n prefix: string;\n /** Asset version. Becomes part of the key so deploys auto-invalidate. */\n version: string | null;\n /** Component name being rendered. */\n component: string;\n /** Final, fully-resolved props (post shared-merge, post closure and descriptor resolution). */\n props: PageProps;\n /** Optional extra discriminator (locale, theme, A/B bucket, etc.). */\n discriminator?: string;\n}\n\n/**\n * Build the cache key for an SSR cache entry.\n *\n * Shape: `${prefix}:${version}:${component}:${sha256(props[+discriminator])}`\n *\n * Including `version` in the key namespace means a deploy that bumps the\n * asset version atomically retires every old key — no flush, no race.\n *\n * @param input Prefix, version, component, resolved props, optional discriminator.\n */\nexport function computeSsrCacheKey(input: ComputeCacheKeyInput): string {\n const versionPart = input.version ?? '_';\n const propsHash = createHash('sha256')\n .update(canonicalStringify(input.props))\n .update(input.discriminator ?? '')\n .digest('hex')\n .slice(0, 32);\n\n return `${input.prefix}:${versionPart}:${input.component}:${propsHash}`;\n}\n","import type { PageProps } from './types.js';\n\n/**\n * Flat map of `field → first error message`, the shape the Inertia client\n * expects under `props.errors`.\n */\nexport type ValidationErrors = Record<string, string>;\n\n/**\n * Apply error-bag scoping to a flat errors object, matching the official\n * Inertia behavior. When `bag` is set, errors are namespaced under\n * `props.errors[bag]`. When `bag` is null, errors live at `props.errors`.\n *\n * @param errors Flat field-to-message map.\n * @param bag Optional error-bag name (e.g. `\"createUser\"`); null for top-level.\n */\nexport function scopeErrors(errors: ValidationErrors, bag: string | null): PageProps {\n if (bag) {\n return { errors: { [bag]: errors } };\n }\n\n return { errors };\n}\n\n/**\n * Named validation error bags, keyed by bag name. The `default` key is the\n * unnamed bag that Laravel-style validation writes to when no bag is given.\n */\nexport type ValidationErrorBags = Record<string, ValidationErrors>;\n\n/**\n * Resolve the `errors` prop from validation error bags at read time. Port of\n * inertia-laravel `Middleware::resolveValidationErrors` (3.x).\n *\n * - No bags, or an empty map: `{}`.\n * - A `default` bag and an `errorBag` sent by the client: scoped to that name,\n * `{ [errorBag]: bags.default }`.\n * - A `default` bag with no `errorBag`: the default bag flat, `bags.default`.\n * - No `default` bag: the bags map as-is, each key already a bag name.\n *\n * @param bags Error bags keyed by name, or null/undefined when none exist.\n * @param errorBag Bag name from the `X-Inertia-Error-Bag` request header, or null.\n */\nexport function resolveValidationErrors(\n bags: ValidationErrorBags | undefined | null,\n errorBag: string | null,\n): PageProps {\n if (!bags || Object.keys(bags).length === 0) {\n return {};\n }\n\n const defaultBag = bags.default;\n\n if (defaultBag !== undefined) {\n if (errorBag) {\n return { [errorBag]: defaultBag };\n }\n\n return defaultBag;\n }\n\n return bags;\n}\n","import type { InertiaRequestInfo } from './types.js';\n\n/**\n * Canonical Inertia v3 protocol header names.\n *\n * The Inertia client sends these headers on every visit. The server uses\n * them to decide between a full HTML response and a JSON page response,\n * and to scope partial reloads.\n */\nexport const INERTIA_HEADERS = {\n inertia: 'x-inertia',\n version: 'x-inertia-version',\n partialComponent: 'x-inertia-partial-component',\n partialData: 'x-inertia-partial-data',\n partialExcept: 'x-inertia-partial-except',\n errorBag: 'x-inertia-error-bag',\n reset: 'x-inertia-reset',\n location: 'x-inertia-location',\n exceptOnceProps: 'x-inertia-except-once-props',\n mergeIntent: 'x-inertia-infinite-scroll-merge-intent',\n redirect: 'x-inertia-redirect',\n socketId: 'x-socket-id',\n} as const;\n\n/**\n * Headers browsers set on speculative (prefetch) requests. A request is a\n * prefetch when any of them equals `prefetch` (case-insensitive). Mirrors\n * Laravel's `Request::prefetch()`.\n */\nexport const PREFETCH_HEADERS = ['purpose', 'sec-purpose', 'x-moz'] as const;\n\ntype HeaderRecord = Record<string, string | string[] | undefined>;\n\n/**\n * Read a header value as a single string, looking up the lowercase variant as\n * a fallback. Returns the first entry of an array value and `null` when the\n * header is absent.\n *\n * @param headers Raw header record from the HTTP layer.\n * @param name Header name to read.\n */\nfunction readHeader(headers: HeaderRecord, name: string): string | null {\n const value = headers[name] ?? headers[name.toLowerCase()];\n\n if (value === undefined || value === null) {\n return null;\n }\n\n if (Array.isArray(value)) {\n return value[0] ?? null;\n }\n\n return value;\n}\n\n/**\n * Split a comma-separated header value into a trimmed, non-empty string list.\n * Returns `null` when the input is null or yields no entries.\n *\n * @param value Raw header value, or null when absent.\n */\nfunction parseList(value: string | null): string[] | null {\n if (value === null) {\n return null;\n }\n\n const parts = value\n .split(',')\n .map((part) => part.trim())\n .filter((part) => part.length > 0);\n\n return parts.length > 0 ? parts : null;\n}\n\n/**\n * Parse a request's headers into a normalized {@link InertiaRequestInfo}.\n *\n * @param input Headers, HTTP method, and request URL. Method is uppercased in\n * the returned object; the URL is passed through unchanged.\n */\nexport function parseInertiaRequest(input: { headers: HeaderRecord; method: string; url: string }): InertiaRequestInfo {\n const { headers } = input;\n const inertia = readHeader(headers, INERTIA_HEADERS.inertia);\n const version = readHeader(headers, INERTIA_HEADERS.version);\n const partialComponent = readHeader(headers, INERTIA_HEADERS.partialComponent);\n const partialOnly = parseList(readHeader(headers, INERTIA_HEADERS.partialData));\n const partialExcept = parseList(readHeader(headers, INERTIA_HEADERS.partialExcept));\n const errorBag = readHeader(headers, INERTIA_HEADERS.errorBag);\n const resetKeys = parseList(readHeader(headers, INERTIA_HEADERS.reset));\n const exceptOnceProps = parseList(readHeader(headers, INERTIA_HEADERS.exceptOnceProps)) ?? [];\n const mergeIntent = readHeader(headers, INERTIA_HEADERS.mergeIntent) === 'prepend' ? 'prepend' : 'append';\n\n return {\n isInertia: inertia === 'true' || inertia === '1',\n version,\n partialComponent,\n partialOnly,\n partialExcept,\n errorBag,\n resetKeys,\n exceptOnceProps,\n mergeIntent,\n isPrefetch: PREFETCH_HEADERS.some((name) => readHeader(headers, name)?.toLowerCase() === 'prefetch'),\n socketId: readHeader(headers, INERTIA_HEADERS.socketId),\n method: input.method.toUpperCase(),\n url: input.url,\n };\n}\n","import type { InertiaPage } from './types.js';\n\nconst HTML_ESCAPES: Record<string, string> = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n};\n\n/**\n * Escape characters that would break out of a double-quoted HTML attribute.\n *\n * @param value Raw attribute value.\n */\nfunction escapeHtmlAttribute(value: string): string {\n return value.replace(/[&<>\"']/g, (ch) => HTML_ESCAPES[ch] ?? ch);\n}\n\n/**\n * Encode an Inertia page object for embedding inside a\n * `<script type=\"application/json\" data-page=\"...\">` tag — the Inertia v3\n * initial-page transport that the client reads via `getInitialPageFromDOM`.\n *\n * Every `<` is replaced with its JSON unicode escape so the payload cannot\n * terminate the surrounding `</script>` element or open an HTML comment. The\n * escape is transparent — JSON.parse decodes it back to `<`.\n *\n * @param page Resolved Inertia page object.\n */\nexport function encodePageScript(page: InertiaPage): string {\n return JSON.stringify(page).replace(/</g, '\\\\u003C');\n}\n\n/**\n * Inputs to {@link renderDefaultHtml}.\n */\nexport interface DefaultRootViewInput {\n page: InertiaPage;\n /** Optional `<title>` for the document. */\n title?: string;\n /** Optional <head> content (meta tags, links, etc.). */\n head?: string;\n /** ID of the SPA root element. Defaults to `app`. */\n rootId?: string;\n /** Path to the client entry script, e.g. `/assets/app.js`. */\n scriptSrc?: string;\n /**\n * Pre-rendered SSR HTML for the root element's *inner* content. When set,\n * the inner HTML of the root div is replaced with this string so the\n * client hydrates over server-rendered markup.\n */\n ssrBody?: string;\n /**\n * Pre-rendered SSR HTML representing the entire root element. When set,\n * `ssrBody`, `rootId`, and the page `<script>` tag are ignored — the\n * provided string is inserted into `<body>` as-is. Use this when your\n * SSR renderer already returns the full root element + page script (the\n * Inertia v3 SSR servers do).\n */\n ssrFull?: string;\n}\n\n/**\n * Minimal default HTML shell for use when no custom root view is provided.\n * Real apps should plug in a template engine (pug, ejs, react-dom/server,\n * etc.) and embed `encodePageScript(page)` themselves.\n *\n * The initial page object is emitted as a\n * `<script type=\"application/json\" data-page=\"...\">` tag, the Inertia v3\n * transport that the client reads on boot.\n *\n * @param input Page object plus optional title/head/rootId/scriptSrc/SSR markup\n * — see {@link DefaultRootViewInput}.\n */\nexport function renderDefaultHtml(input: DefaultRootViewInput): string {\n const rootId = input.rootId ?? 'app';\n const title = input.title ?? 'Inertia App';\n const head = input.head ?? '';\n const script = input.scriptSrc ? `<script type=\"module\" src=\"${escapeHtmlAttribute(input.scriptSrc)}\"></script>` : '';\n\n let rootMarkup: string;\n\n if (input.ssrFull) {\n rootMarkup = input.ssrFull;\n } else {\n const idAttr = escapeHtmlAttribute(rootId);\n const inner = input.ssrBody ?? '';\n const pageScript = `<script data-page=\"${idAttr}\" type=\"application/json\">${encodePageScript(input.page)}</script>`;\n rootMarkup = `<div id=\"${idAttr}\">${inner}</div>\\n ${pageScript}`;\n }\n\n return `<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>${escapeHtmlAttribute(title)}</title>\n ${head}\n </head>\n <body>\n ${rootMarkup}\n ${script}\n </body>\n</html>`;\n}\n\n/** Default user-facing messages keyed by HTTP status, used when none is given. */\nconst ERROR_STATUS_MESSAGES: Record<number, string> = {\n 400: 'Bad Request',\n 401: 'Unauthorized',\n 403: 'Forbidden',\n 404: 'Page Not Found',\n 409: 'Conflict',\n 419: 'Page Expired',\n 422: 'Unprocessable Entity',\n 429: 'Too Many Requests',\n 500: 'Server Error',\n 502: 'Bad Gateway',\n 503: 'Service Unavailable',\n 504: 'Gateway Timeout',\n};\n\n/**\n * Inputs to {@link renderErrorPage}.\n */\nexport interface ErrorPageInput {\n /** HTTP status code to surface to the user. */\n status: number;\n /** Optional message; falls back to a default for the status, then a generic line. */\n message?: string;\n}\n\n/**\n * Render a minimal, SPA-less standalone HTML error page. Used as the hard\n * fallback when no client `Error` component can be resolved (e.g. a plain\n * browser load, or an SSR/render failure on the Inertia path), so a user\n * never receives a raw JSON error or a blank page.\n *\n * @param input HTTP status plus an optional override message — see {@link ErrorPageInput}.\n */\nexport function renderErrorPage(input: ErrorPageInput): string {\n const { status } = input;\n const message = input.message ?? ERROR_STATUS_MESSAGES[status] ?? 'Something went wrong';\n const safeStatus = escapeHtmlAttribute(String(status));\n const safeMessage = escapeHtmlAttribute(message);\n\n return `<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>${safeStatus} ${safeMessage}</title>\n <style>\n body { font-family: system-ui, sans-serif; display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; background: #f8f9fa; color: #212529; }\n main { text-align: center; padding: 2rem; }\n h1 { font-size: 4rem; margin: 0; font-weight: 600; }\n p { font-size: 1.25rem; margin: 0.5rem 0 0; color: #6c757d; }\n </style>\n </head>\n <body>\n <main>\n <h1>${safeStatus}</h1>\n <p>${safeMessage}</p>\n </main>\n </body>\n</html>`;\n}\n","import type { InertiaPage, PageProps, PropsMetadata } from './types.js';\n\n/**\n * Whether flash data is worth emitting as a top-level page key. Nullish and\n * empty-object flash are dropped so the wire payload stays compact and\n * absent flash never surfaces a stray `flash: {}` to the client.\n *\n * @param flash Candidate flash value pulled from the session.\n */\nfunction hasFlashData(flash: unknown): boolean {\n if (flash === null || flash === undefined) {\n return false;\n }\n\n if (typeof flash === 'object' && !Array.isArray(flash)) {\n return Object.keys(flash).length > 0;\n }\n\n return true;\n}\n\n/**\n * Every {@link PropsMetadata} key, in protocol order. `createPage` copies only\n * these keys, so a widened metadata object cannot overwrite page fields.\n */\nconst METADATA_KEYS = [\n 'sharedProps',\n 'mergeProps',\n 'prependProps',\n 'deepMergeProps',\n 'matchPropsOn',\n 'deferredProps',\n 'rescuedProps',\n 'scrollProps',\n 'onceProps',\n 'liveProps',\n] as const satisfies readonly (keyof PropsMetadata)[];\n\n/**\n * Whether a metadata value carries anything worth emitting: a non-empty array\n * or an object with at least one key.\n *\n * @param value Candidate metadata value from {@link PropsMetadata}.\n */\nfunction hasMetadataEntries(value: unknown): boolean {\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n\n if (value !== null && typeof value === 'object') {\n return Object.keys(value).length > 0;\n }\n\n return false;\n}\n\n/**\n * Inputs to {@link createPage} — the fields of an {@link InertiaPage} plus\n * optional history flags and the v3 prop metadata produced by the resolver.\n */\nexport interface CreatePageInput<TProps extends PageProps = PageProps> {\n component: string;\n props: TProps;\n url: string;\n version: string | null;\n clearHistory?: boolean;\n encryptHistory?: boolean;\n preserveFragment?: boolean;\n metadata?: PropsMetadata;\n flash?: unknown;\n}\n\n/**\n * Build a normalized Inertia v3 page object. `clearHistory`, `encryptHistory`\n * and `preserveFragment` default to `false` and are always present. Each\n * `metadata` key is copied onto the page only when non-empty so the JSON over\n * the wire stays compact. `flash` is emitted as a top-level key only when it\n * carries data (non-nullish, and a non-empty object when object-valued) —\n * mirroring inertia-laravel's `$flash ? ['flash' => $flash] : []`.\n *\n * @param input Required page fields plus the optional v3 extras.\n */\nexport function createPage<TProps extends PageProps>(input: CreatePageInput<TProps>): InertiaPage<TProps> {\n const page: InertiaPage<TProps> = {\n component: input.component,\n props: input.props,\n url: input.url,\n version: input.version,\n clearHistory: input.clearHistory ?? false,\n encryptHistory: input.encryptHistory ?? false,\n preserveFragment: input.preserveFragment ?? false,\n };\n\n const { metadata } = input;\n\n if (metadata) {\n METADATA_KEYS.forEach((key) => {\n if (hasMetadataEntries(metadata[key])) {\n Object.assign(page, { [key]: metadata[key] });\n }\n });\n }\n\n if (hasFlashData(input.flash)) {\n page.flash = input.flash;\n }\n\n return page;\n}\n","/**\n * Status code Inertia uses for \"soft\" redirects after PUT/PATCH/DELETE so the\n * follow-up GET is forced to also be a GET on every browser.\n */\nexport const INERTIA_REDIRECT_STATUS = 303;\n\n/**\n * Status code used for the `X-Inertia-Location` external redirect\n * mechanism. The client intercepts the 409 and performs a window.location\n * navigation rather than a fetch.\n */\nexport const INERTIA_LOCATION_STATUS = 409;\n\n/**\n * Decide which status code to use for a redirect produced by an Inertia\n * request. After a non-GET/HEAD form submission (PUT, PATCH, DELETE or QUERY) the response must be 303\n * so the client's follow-up request becomes a GET.\n *\n * @param method HTTP method of the inbound request (case-insensitive).\n * @param fallback Status code to use for GET/HEAD/POST. Defaults to 302.\n */\nexport function inertiaRedirectStatus(method: string, fallback = 302): number {\n const m = method.toUpperCase();\n\n if (m === 'PUT' || m === 'PATCH' || m === 'DELETE' || m === 'QUERY') {\n return INERTIA_REDIRECT_STATUS;\n }\n\n return fallback;\n}\n","import { createPage } from './page.js';\nimport { resolveProps } from './props-resolver.js';\n\nimport type {\n InertiaPage, InertiaRequestInfo, PageProps, RenderOptions, RescueHandler, SharedPropsInput,\n} from './types.js';\n\n/**\n * Inputs to {@link buildPage}. `TReq` is the framework's request type so\n * `shared` (when a function) receives the correct argument shape.\n */\nexport interface BuildPageInput<TReq = unknown> {\n component: string;\n props: PageProps;\n request: InertiaRequestInfo;\n req: TReq;\n shared: SharedPropsInput<TReq> | undefined;\n version: string | null;\n options?: RenderOptions;\n /**\n * Read-once flash data to emit as a top-level page key. Resolved by the\n * caller (e.g. from the session); omitted from the page when nullish/empty.\n */\n flash?: unknown;\n /**\n * Called with the error and dotted path whenever a rescued prop throws.\n */\n onRescue?: RescueHandler;\n}\n\n/**\n * Resolve a `SharedPropsInput` to a plain props object. Returns `{}` for\n * undefined/null inputs or when the resolver returns nullish.\n *\n * @param shared Static props object, a (possibly async) function, or undefined.\n * @param req Request passed to the resolver when `shared` is a function.\n */\nasync function evaluateShared<TReq>(shared: SharedPropsInput<TReq> | undefined, req: TReq): Promise<PageProps> {\n if (shared === undefined || shared === null) {\n return {};\n }\n\n if (typeof shared === 'function') {\n const result = await shared(req);\n\n return result ?? {};\n }\n\n return shared;\n}\n\n/**\n * Build the final {@link InertiaPage} object given a controller's component\n * + props, the request info, and configured shared props / version.\n *\n * Returned page is suitable for either:\n * - JSON serialization on `X-Inertia` requests, or\n * - embedding into the root HTML view via a `<script>` page tag.\n *\n * @param input Component, props, parsed request, shared resolver, version,\n * optional `clearHistory` / `encryptHistory` / `preserveFragment` flags, and\n * an optional rescue handler.\n */\nexport async function buildPage<TReq>(input: BuildPageInput<TReq>): Promise<InertiaPage> {\n const sharedProps = await evaluateShared(input.shared, input.req);\n\n const resolved = await resolveProps({\n props: input.props,\n shared: sharedProps,\n component: input.component,\n request: input.request,\n onRescue: input.onRescue,\n });\n\n return createPage({\n component: input.component,\n props: resolved.props,\n url: input.request.url,\n version: input.version,\n clearHistory: input.options?.clearHistory,\n encryptHistory: input.options?.encryptHistory,\n preserveFragment: input.options?.preserveFragment,\n metadata: resolved.metadata,\n flash: input.flash,\n });\n}\n","import type { VersionResolver } from './types.js';\n\n/**\n * Resolve a version value (string, async function, or null) against a request.\n *\n * Returns `null` when no version is configured — in which case asset version\n * mismatch detection is disabled.\n *\n * @param resolver Static version string, a (possibly async) function, or undefined.\n * @param req Request passed to the resolver when it is a function.\n */\nexport async function resolveVersion<TReq>(\n resolver: VersionResolver<TReq> | undefined,\n req: TReq,\n): Promise<string | null> {\n if (resolver === undefined || resolver === null) {\n return null;\n }\n\n if (typeof resolver === 'string') {\n return resolver;\n }\n\n const result = await (resolver)(req);\n\n return result ?? null;\n}\n\n/**\n * Returns true if the client's version (`X-Inertia-Version`) does not match\n * the server's current version. Mismatches on GET requests should trigger a\n * full reload via the `X-Inertia-Location` mechanism.\n *\n * @param serverVersion Currently configured server version; `null` disables checks.\n * @param clientVersion Value of the `X-Inertia-Version` header; `null` is treated as empty.\n */\nexport function isVersionMismatch(serverVersion: string | null, clientVersion: string | null): boolean {\n if (serverVersion === null) {\n return false;\n }\n\n // A missing client header is treated as an empty version, matching the\n // official adapters: an empty client version still mismatches a non-empty\n // server version and must trigger a full reload.\n return serverVersion !== (clientVersion ?? '');\n}\n"],"mappings":";;;;;;AAQA,SAAS,SAAe,OAA0D;CAChF,IAAI,UAAU,KAAA,KAAa,UAAU,MACnC,OAAO,CAAC;CAGV,OAAO,MAAM,QAAQ,KAAK,IAAI,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I,WAAW,KAAA,KAAa,WAAW,MACrC,OAAO,CAAC;CAGV,IAAI,OAAO,WAAW,YAGpB,OAAO,MAFc,OAAO,GAAG,KAEd,CAAC;CAGpB,OAAO;AACT;;;;;;;;;;;;;AAcA,eAAsB,UAAgB,OAAmD;CACvF,MAAM,cAAc,MAAM,eAAe,MAAM,QAAQ,MAAM,GAAG;CAEhE,MAAM,WAAW,MAAM,aAAa;EAClC,OAAO,MAAM;EACb,QAAQ;EACR,WAAW,MAAM;EACjB,SAAS,MAAM;EACf,UAAU,MAAM;CAClB,CAAC;CAED,OAAO,WAAW;EAChB,WAAW,MAAM;EACjB,OAAO,SAAS;EAChB,KAAK,MAAM,QAAQ;EACnB,SAAS,MAAM;EACf,cAAc,MAAM,SAAS;EAC7B,gBAAgB,MAAM,SAAS;EAC/B,kBAAkB,MAAM,SAAS;EACjC,UAAU,SAAS;EACnB,OAAO,MAAM;CACf,CAAC;AACH;;;;;;;;;;;;AC1EA,eAAsB,eACpB,UACA,KACwB;CACxB,IAAI,aAAa,KAAA,KAAa,aAAa,MACzC,OAAO;CAGT,IAAI,OAAO,aAAa,UACtB,OAAO;CAKT,OAAO,MAFe,SAAU,GAAG,KAElB;AACnB;;;;;;;;;AAUA,SAAgB,kBAAkB,eAA8B,eAAuC;CACrG,IAAI,kBAAkB,MACpB,OAAO;CAMT,OAAO,mBAAmB,iBAAiB;AAC7C"}
|
package/dist/express/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as ComputeCacheKeyInput, A as PropDescriptor, C as live, D as scroll, E as optional, G as INERTIA_HEADERS, H as encodePageScript, N as ScrollOptions, O as LiveChannelInput, S as isPropDescriptor, T as once, V as ErrorPageInput, W as renderErrorPage, Y as ValidationErrors, _ as OptionalProp, _t as ScrollMetadata, a as INERTIA_LOCATION_STATUS, at as resolveBroadcastProps, b as deepMerge, ct as LiveChannel, dt as LiveMetadata, et as SsrCacheEntry, f as AlwaysProp, ft as OnceMetadata, g as OnceProp, gt as RescueHandler, h as MergeProp, ht as RenderOptions, it as broadcastProps, k as LiveOptions, lt as LiveChannelType, m as LiveProp, mt as PropsMetadata, nt as canonicalStringify, o as INERTIA_REDIRECT_STATUS, ot as InertiaPage, p as DeferProp, pt as PageProps, rt as computeSsrCacheKey, st as InertiaRequestInfo, tt as SsrCacheStore, ut as LiveListener, v as ScrollProp, vt as SharedPropsInput, w as merge, x as defer, y as always, yt as VersionResolver } from "../index-C7vBpEDY.js";
|
|
2
2
|
import { NextFunction, Request, Response } from "express";
|
|
3
3
|
|
|
4
4
|
//#region src/express/edge-cache.d.ts
|
|
@@ -183,16 +183,29 @@ interface InertiaMiddlewareOptions {
|
|
|
183
183
|
*/
|
|
184
184
|
edgeCache?: EdgeCachePolicy;
|
|
185
185
|
/**
|
|
186
|
-
* If true,
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
* `sharedProps` keys win on collision. Off by default.
|
|
186
|
+
* If true, surface session-stored flash data (`req.session.flash`) as the
|
|
187
|
+
* top-level `flash` page key, read-once. Gates only `flash`: the `errors`
|
|
188
|
+
* prop is shared on every page regardless of this option. Off by default.
|
|
190
189
|
*/
|
|
191
190
|
flashFromSession?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Called whenever a prop marked `.rescue()` throws during resolution. The
|
|
193
|
+
* failing prop is dropped from the page and its path is reported in
|
|
194
|
+
* `rescuedProps`; use this hook to log or report the swallowed error.
|
|
195
|
+
* Failures of the hook itself are contained: a synchronous throw or a
|
|
196
|
+
* rejected returned promise is logged with `console.error` and never
|
|
197
|
+
* propagates or surfaces as an unhandled rejection.
|
|
198
|
+
*
|
|
199
|
+
* @param error The thrown value.
|
|
200
|
+
* @param path Dotted path of the prop that failed.
|
|
201
|
+
* @param req The Express request being rendered.
|
|
202
|
+
*/
|
|
203
|
+
onRescue?: (error: unknown, path: string, req: Request) => void;
|
|
192
204
|
}
|
|
193
205
|
/**
|
|
194
206
|
* Per-response options accepted as the third argument to `res.inertia()`.
|
|
195
|
-
* Extends the core {@link RenderOptions} (clearHistory / encryptHistory
|
|
207
|
+
* Extends the core {@link RenderOptions} (clearHistory / encryptHistory /
|
|
208
|
+
* preserveFragment).
|
|
196
209
|
*/
|
|
197
210
|
interface InertiaResponseOptions extends RenderOptions {
|
|
198
211
|
/**
|
|
@@ -242,13 +255,17 @@ declare module 'express-serve-static-core' {
|
|
|
242
255
|
*/
|
|
243
256
|
inertiaLocation: InertiaLocation;
|
|
244
257
|
/**
|
|
245
|
-
*
|
|
246
|
-
* `
|
|
258
|
+
* Store validation errors for the next page render, under `bag`
|
|
259
|
+
* (default `'default'`). With a session they are written to
|
|
260
|
+
* `req.session.inertia.errors[bag]`; without one, to the same bags map on
|
|
261
|
+
* `res.locals.inertiaErrors`. A repeated bag is replaced; distinct bags
|
|
262
|
+
* accumulate. They are shared as the `errors` prop, remapped at read time
|
|
263
|
+
* by the `X-Inertia-Error-Bag` header, and cleared from the session once read.
|
|
247
264
|
*/
|
|
248
265
|
inertiaErrors: (errors: ValidationErrors, bag?: string) => void;
|
|
249
266
|
/**
|
|
250
267
|
* Stash flash data for the next request. Stored in `req.session.flash`
|
|
251
|
-
* and surfaced as the `flash`
|
|
268
|
+
* and surfaced as the top-level `flash` page key when `flashFromSession` is
|
|
252
269
|
* enabled. Replaces any flash already queued for this redirect.
|
|
253
270
|
* No-ops when no session is wired.
|
|
254
271
|
*/
|
|
@@ -272,10 +289,16 @@ declare module 'express-serve-static-core' {
|
|
|
272
289
|
* - Adds `req.flash(type?, msg?)` — a `connect-flash`-compatible API.
|
|
273
290
|
* - Adds `res.inertia(component, props, options)`.
|
|
274
291
|
* - Adds `res.inertiaLocation(url)` for external redirects.
|
|
275
|
-
* - Adds `res.inertiaErrors(errors, bag?)` to
|
|
292
|
+
* - Adds `res.inertiaErrors(errors, bag?)` to store validation errors per bag
|
|
293
|
+
* (under `req.session.inertia.errors`, else `res.locals.inertiaErrors`); they are
|
|
294
|
+
* shared as the `errors` prop on every page, remapped by `X-Inertia-Error-Bag`.
|
|
276
295
|
* - Adds `res.inertiaFlash(data)` to flash arbitrary data.
|
|
277
296
|
* - Adds `res.inertiaError(status, message?)` to render an error page.
|
|
278
|
-
* - Auto-promotes redirects after PUT/PATCH/DELETE to 303 for Inertia visits.
|
|
297
|
+
* - Auto-promotes redirects after PUT/PATCH/DELETE/QUERY to 303 for Inertia visits.
|
|
298
|
+
* - Answers redirects to a URL with a `#` fragment with 409 + `X-Inertia-Redirect`
|
|
299
|
+
* on Inertia visits (not prefetches) so the client can navigate itself.
|
|
300
|
+
* - Redirects back (to `Referer`, else `/`) when an Inertia request ends with an
|
|
301
|
+
* empty 200 and nothing written (inertia-laravel `onEmptyResponse`).
|
|
279
302
|
*
|
|
280
303
|
* Mount before your route handlers:
|
|
281
304
|
*
|
|
@@ -287,6 +310,39 @@ declare module 'express-serve-static-core' {
|
|
|
287
310
|
*/
|
|
288
311
|
declare function inertia(options?: InertiaMiddlewareOptions): (req: Request, res: Response, next: NextFunction) => void;
|
|
289
312
|
//#endregion
|
|
313
|
+
//#region src/express/empty-response.d.ts
|
|
314
|
+
/**
|
|
315
|
+
* Redirect back when an Inertia request ends with an empty 200.
|
|
316
|
+
*
|
|
317
|
+
* Mirrors inertia-laravel `Middleware::onEmptyResponse`: if the handler ends
|
|
318
|
+
* the response with status 200 and no body (nothing written, headers not yet
|
|
319
|
+
* sent), the response becomes `res.redirect(302, Referer ?? '/')`, which goes
|
|
320
|
+
* through the patched `res.redirect` and so is promoted to 303 after
|
|
321
|
+
* PUT/PATCH/DELETE/QUERY.
|
|
322
|
+
*
|
|
323
|
+
* Limitation: the guard is not observed when headers were already sent
|
|
324
|
+
* (`res.flushHeaders()`, streaming), when the handler never responds, or for
|
|
325
|
+
* HEAD requests (Express ends those without a body by design).
|
|
326
|
+
*
|
|
327
|
+
* @param req The Express request; supplies the `Referer` header.
|
|
328
|
+
* @param res The Express response whose `write` and `end` are wrapped.
|
|
329
|
+
*/
|
|
330
|
+
declare function installEmptyResponseGuard(req: Request, res: Response): void;
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region src/express/redirect-override.d.ts
|
|
333
|
+
/**
|
|
334
|
+
* Replace `res.redirect` for the current Inertia response.
|
|
335
|
+
*
|
|
336
|
+
* Mirrors inertia-laravel: a 302 after PUT/PATCH/DELETE/QUERY is promoted to
|
|
337
|
+
* 303, and a redirect whose URL contains a `#` fragment is answered with an
|
|
338
|
+
* empty 409 plus `X-Inertia-Redirect` (browsers drop fragments on XHR
|
|
339
|
+
* redirects) unless the request is a prefetch.
|
|
340
|
+
*
|
|
341
|
+
* @param req The Express request; supplies the method and `req.inertia.isPrefetch`.
|
|
342
|
+
* @param res The Express response whose `redirect` is replaced.
|
|
343
|
+
*/
|
|
344
|
+
declare function installRedirectOverride(req: Request, res: Response): void;
|
|
345
|
+
//#endregion
|
|
290
346
|
//#region src/express/memory-store.d.ts
|
|
291
347
|
/**
|
|
292
348
|
* In-process LRU + TTL cache for SSR responses.
|
|
@@ -385,11 +441,14 @@ interface RenderContext {
|
|
|
385
441
|
/**
|
|
386
442
|
* Send the Inertia version-mismatch response: 409 with `X-Inertia-Location`
|
|
387
443
|
* pointing back at the same URL so the client performs a hard reload.
|
|
444
|
+
* Mirrors `Middleware::onVersionChange` in inertia-laravel, which also sends
|
|
445
|
+
* `X-Inertia-Version` with the current server version.
|
|
388
446
|
*
|
|
389
447
|
* @param res Outgoing Express response.
|
|
390
448
|
* @param url Location to send the client to (typically the requested URL).
|
|
449
|
+
* @param version Current server version; sent as `X-Inertia-Version` when a non-null string.
|
|
391
450
|
*/
|
|
392
|
-
declare function sendVersionMismatch(res: Response, url: string): void;
|
|
451
|
+
declare function sendVersionMismatch(res: Response, url: string, version?: string | null): void;
|
|
393
452
|
/**
|
|
394
453
|
* Send an external Inertia redirect. For Inertia (XHR) requests this returns
|
|
395
454
|
* 409 + `X-Inertia-Location` so the client performs a window.location nav.
|
|
@@ -544,5 +603,5 @@ declare function viteManifestVersion(options: ViteManifestVersionOptions): () =>
|
|
|
544
603
|
*/
|
|
545
604
|
declare function viteManifestAssets(options: ViteManifestAssetsOptions): () => Promise<ViteManifestAssets>;
|
|
546
605
|
//#endregion
|
|
547
|
-
export { type AlwaysProp, type ComputeCacheKeyInput, type
|
|
606
|
+
export { type AlwaysProp, type ComputeCacheKeyInput, type DeferProp, type EdgeCacheDecision, type EdgeCachePolicy, type ErrorPageInput, INERTIA_HEADERS, INERTIA_LOCATION_STATUS, INERTIA_REDIRECT_STATUS, type InertiaCacheOptions, type InertiaMiddlewareOptions, type InertiaPage, type InertiaRequestInfo, type InertiaResponseOptions, type InertiaSsrFetcherOptions, type LiveChannel, type LiveChannelInput, type LiveChannelType, type LiveListener, type LiveMetadata, type LiveOptions, type LiveProp, type MemoryCacheStoreOptions, type MergeProp, type OnceMetadata, type OnceProp, type OptionalProp, type PageProps, type PrerenderOptions, type PrerenderRouteResult, type PrerenderSummary, PropDescriptor, type PropsMetadata, type RescueHandler, type RootViewInput, type RootViewRenderer, type ScrollMetadata, type ScrollOptions, type ScrollProp, type SharedPropsInput, type SsrCacheEntry, type SsrCacheStore, type SsrRenderer, type SsrRendererInput, type SsrResult, type ValidationErrors, type VersionResolver, type ViteManifestAssets, type ViteManifestAssetsOptions, type ViteManifestVersionOptions, always, applyEdgeCache, broadcastProps, canonicalStringify, computeSsrCacheKey, createInertiaSsrFetcher, createMemoryCacheStore, deepMerge, inertia as default, inertia, defer, encodePageScript, installEmptyResponseGuard, installRedirectOverride, isPropDescriptor, live, merge, once, optional, prerender, renderErrorPage, resolveBroadcastProps, scroll, sendInertiaLocation, sendInertiaResponse, sendVersionMismatch, viteManifestAssets, viteManifestVersion };
|
|
548
607
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/express/edge-cache.ts","../../src/express/types.ts","../../src/express/middleware.ts","../../src/express/memory-store.ts","../../src/express/prerender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OAAA,GAAU,eAAA,CAAgB,OAAA;EAjDrB;;;;;;;EA0DL,WAAA,GAAc,gBAAA,CAAiB,OAAA;EA1D1B;;AAAe;AAatB;EAmDE,QAAA,GAAW,gBAAA;;;;;;;;;;EAWX,GAAA,GAAM,WAAA;EAxDN;;;;;EA+DA,KAAA,GAAQ,mBAAA;EAxDA;;;;;EA+DR,SAAA,GAAY,eAAA;EAvD6B;;AAAY;AAMvD
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/express/edge-cache.ts","../../src/express/types.ts","../../src/express/middleware.ts","../../src/express/empty-response.ts","../../src/express/redirect-override.ts","../../src/express/memory-store.ts","../../src/express/prerender.ts","../../src/express/response.ts","../../src/express/ssr-fetcher.ts","../../src/express/vite-manifest.ts"],"mappings":";;;;;;AASA;;;UAAiB,iBAAA;EAEf;EAAA,OAAA;EAOA;EALA,MAAA;EAUI;AAAA;AAON;;EAZE,oBAAA;EAY2C;;;;EAP3C,IAAA;AAAA;;;;;KAOU,eAAA,IAAmB,KAAA;EAAS,GAAA,EAAK,OAAA;EAAS,GAAA,EAAK,QAAA;EAAU,IAAA,EAAM,WAAA;AAAA,MAAkB,iBAAA;AAAiB;AAkB9G;;;;;;;;;AAAgF;;;;AC3BhF;;ADS8G,iBAkB9F,cAAA,CAAe,QAAA,EAAU,iBAAA,SAA0B,GAAA,EAAK,QAAQ;;;;AAvChF;;;;;;KCYY,gBAAA,IAAoB,KAAA,EAAO,aAAA,cAA2B,OAAO;;;ADEnE;UCGW,aAAA;EACf,IAAA,EAAM,WAAA;EACN,GAAA,EAAK,OAAA;EACL,GAAA,EAAK,QAAA;AAAA;;;;;;;;;;;;;;UAgBU,SAAA;EACf,IAAA;EACA,IAAA;EACA,cAAA;AAAA;;;;;KAOU,WAAA,IAAe,KAAA,EAAO,gBAAA,KAAqB,OAAA,CAAQ,SAAA;ADPiB;;;AAAA,UCY/D,gBAAA;EACf,IAAA,EAAM,WAAA;EACN,GAAA,EAAK,OAAA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