@analogjs/router 2.6.4 → 2.7.0-beta.1
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/fesm2022/analogjs-router-server.mjs +460 -11
- package/fesm2022/analogjs-router-server.mjs.map +1 -1
- package/fesm2022/analogjs-router.mjs +130 -2
- package/fesm2022/analogjs-router.mjs.map +1 -1
- package/package.json +2 -2
- package/types/analogjs-router-server.d.ts +216 -2
- package/types/analogjs-router.d.ts +147 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analogjs-router.mjs","sources":["../../../../packages/router/src/lib/meta-tags.ts","../../../../packages/router/src/lib/endpoints.ts","../../../../packages/router/src/lib/inject-route-endpoint-url.ts","../../../../packages/router/src/lib/route-config.ts","../../../../packages/router/src/lib/markdown-helpers.ts","../../../../packages/router/src/lib/constants.ts","../../../../packages/router/src/lib/routes.ts","../../../../packages/router/src/lib/define-route.ts","../../../../packages/router/src/lib/cookie-interceptor.ts","../../../../packages/router/src/lib/provide-file-router.ts","../../../../packages/router/src/lib/inject-load.ts","../../../../packages/router/src/lib/get-load-resolver.ts","../../../../packages/router/src/lib/cache-key.ts","../../../../packages/router/src/lib/request-context.ts","../../../../packages/router/src/lib/form-action.directive.ts","../../../../packages/router/src/lib/debug/routes.ts","../../../../packages/router/src/lib/debug/index.ts","../../../../packages/router/src/lib/server.component.ts","../../../../packages/router/src/analogjs-router.ts"],"sourcesContent":["import { inject } from '@angular/core';\nimport { Meta, MetaDefinition as NgMetaTag } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, NavigationEnd, Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\n\nexport const ROUTE_META_TAGS_KEY = Symbol(\n '@analogjs/router Route Meta Tags Key',\n);\n\nconst CHARSET_KEY = 'charset';\nconst HTTP_EQUIV_KEY = 'httpEquiv';\n// httpEquiv selector key needs to be in kebab case format\nconst HTTP_EQUIV_SELECTOR_KEY = 'http-equiv';\nconst NAME_KEY = 'name';\nconst PROPERTY_KEY = 'property';\nconst CONTENT_KEY = 'content';\nconst ITEMPROP_KEY = 'itemprop';\n\nexport type MetaTag =\n | (CharsetMetaTag & ExcludeRestMetaTagKeys<typeof CHARSET_KEY>)\n | (HttpEquivMetaTag & ExcludeRestMetaTagKeys<typeof HTTP_EQUIV_KEY>)\n | (NameMetaTag & ExcludeRestMetaTagKeys<typeof NAME_KEY>)\n | (PropertyMetaTag & ExcludeRestMetaTagKeys<typeof PROPERTY_KEY>)\n | (ItempropMetaTag & ExcludeRestMetaTagKeys<typeof ITEMPROP_KEY>);\n\ntype CharsetMetaTag = { [CHARSET_KEY]: string };\ntype HttpEquivMetaTag = { [HTTP_EQUIV_KEY]: string; [CONTENT_KEY]: string };\ntype NameMetaTag = { [NAME_KEY]: string; [CONTENT_KEY]: string };\ntype PropertyMetaTag = { [PROPERTY_KEY]: string; [CONTENT_KEY]: string };\ntype ItempropMetaTag = { [ITEMPROP_KEY]: string; [CONTENT_KEY]: string };\n\ntype MetaTagKey =\n | typeof CHARSET_KEY\n | typeof HTTP_EQUIV_KEY\n | typeof NAME_KEY\n | typeof PROPERTY_KEY\n | typeof ITEMPROP_KEY;\ntype ExcludeRestMetaTagKeys<Key extends MetaTagKey> = {\n [K in Exclude<MetaTagKey, Key>]?: never;\n};\n\ntype MetaTagSelector =\n | typeof CHARSET_KEY\n | `${\n | typeof HTTP_EQUIV_SELECTOR_KEY\n | typeof NAME_KEY\n | typeof PROPERTY_KEY\n | typeof ITEMPROP_KEY}=\"${string}\"`;\ntype MetaTagMap = Record<MetaTagSelector, MetaTag>;\n\nexport function updateMetaTagsOnRouteChange(): void {\n const router = inject(Router);\n const metaService = inject(Meta);\n\n router.events\n .pipe(filter((event) => event instanceof NavigationEnd))\n .subscribe(() => {\n const metaTagMap = getMetaTagMap(router.routerState.snapshot.root);\n\n for (const metaTagSelector in metaTagMap) {\n const metaTag = metaTagMap[\n metaTagSelector as MetaTagSelector\n ] as NgMetaTag;\n metaService.updateTag(metaTag, metaTagSelector);\n }\n });\n}\n\nfunction getMetaTagMap(route: ActivatedRouteSnapshot): MetaTagMap {\n const metaTagMap = {} as MetaTagMap;\n let currentRoute: ActivatedRouteSnapshot | null = route;\n\n while (currentRoute) {\n const metaTags: MetaTag[] = currentRoute.data[ROUTE_META_TAGS_KEY] ?? [];\n for (const metaTag of metaTags) {\n metaTagMap[getMetaTagSelector(metaTag)] = metaTag;\n }\n\n currentRoute = currentRoute.firstChild;\n }\n\n return metaTagMap;\n}\n\nfunction getMetaTagSelector(metaTag: MetaTag): MetaTagSelector {\n if (metaTag.name) {\n return `${NAME_KEY}=\"${metaTag.name}\"`;\n }\n\n if (metaTag.property) {\n return `${PROPERTY_KEY}=\"${metaTag.property}\"`;\n }\n\n if (metaTag.httpEquiv) {\n return `${HTTP_EQUIV_SELECTOR_KEY}=\"${metaTag.httpEquiv}\"`;\n }\n\n if (metaTag.itemprop) {\n return `${ITEMPROP_KEY}=\"${metaTag.itemprop}\"`;\n }\n\n return CHARSET_KEY;\n}\n","export const ANALOG_META_KEY = Symbol(\n '@analogjs/router Analog Route Metadata Key',\n);\n\n/**\n * This variable reference is replaced with a glob of all route endpoints.\n */\nexport let ANALOG_PAGE_ENDPOINTS: any = {};\n","import type { ActivatedRouteSnapshot, Route } from '@angular/router';\nimport { injectBaseURL, injectAPIPrefix } from '@analogjs/router/tokens';\n\nimport { ANALOG_META_KEY } from './endpoints';\n\nexport function injectRouteEndpointURL(route: ActivatedRouteSnapshot) {\n const routeConfig = route.routeConfig as Route & {\n [ANALOG_META_KEY]: { endpoint: string; endpointKey: string };\n };\n\n const apiPrefix = injectAPIPrefix();\n const baseUrl = injectBaseURL();\n const { queryParams, fragment: hash, params, parent } = route;\n const segment = parent?.url.map((segment) => segment.path).join('/') || '';\n const url = new URL(\n '',\n import.meta.env['VITE_ANALOG_PUBLIC_BASE_URL'] ||\n baseUrl ||\n (typeof window !== 'undefined' && window.location.origin\n ? window.location.origin\n : ''),\n );\n url.pathname = `${\n url.pathname.endsWith('/') ? url.pathname : url.pathname + '/'\n }${apiPrefix}/_analog${routeConfig[ANALOG_META_KEY].endpoint}`;\n url.search = `${new URLSearchParams(queryParams).toString()}`;\n url.hash = hash ?? '';\n\n Object.keys(params).forEach((param) => {\n url.pathname = url.pathname.replace(`[${param}]`, params[param]);\n });\n url.pathname = url.pathname.replace('**', segment);\n\n return url;\n}\n","import { inject } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport type { Route } from '@angular/router';\nimport { firstValueFrom } from 'rxjs';\n\nimport { RedirectRouteMeta, RouteConfig, RouteMeta } from './models';\nimport { ROUTE_META_TAGS_KEY } from './meta-tags';\nimport { ANALOG_PAGE_ENDPOINTS, ANALOG_META_KEY } from './endpoints';\nimport { injectRouteEndpointURL } from './inject-route-endpoint-url';\n\nexport function toRouteConfig(routeMeta: RouteMeta | undefined): RouteConfig {\n if (routeMeta && isRedirectRouteMeta(routeMeta)) {\n return routeMeta;\n }\n\n let { meta, ...routeConfig } = routeMeta ?? {};\n\n if (Array.isArray(meta)) {\n routeConfig.data = { ...routeConfig.data, [ROUTE_META_TAGS_KEY]: meta };\n } else if (typeof meta === 'function') {\n routeConfig.resolve = {\n ...routeConfig.resolve,\n [ROUTE_META_TAGS_KEY]: meta,\n };\n }\n\n if (!routeConfig) {\n routeConfig = {};\n }\n\n routeConfig.runGuardsAndResolvers =\n routeConfig.runGuardsAndResolvers ?? 'paramsOrQueryParamsChange';\n routeConfig.resolve = {\n ...routeConfig.resolve,\n load: async (route) => {\n const routeConfig = route.routeConfig as Route & {\n [ANALOG_META_KEY]: { endpoint: string; endpointKey: string };\n };\n\n if (ANALOG_PAGE_ENDPOINTS[routeConfig[ANALOG_META_KEY].endpointKey]) {\n const http = inject(HttpClient);\n const url = injectRouteEndpointURL(route);\n\n if (\n !!import.meta.env['VITE_ANALOG_PUBLIC_BASE_URL'] &&\n (globalThis as any).$fetch\n ) {\n return (globalThis as any).$fetch(url.pathname);\n }\n\n return firstValueFrom(http.get(`${url.href}`));\n }\n\n return {};\n },\n };\n\n return routeConfig;\n}\n\nfunction isRedirectRouteMeta(\n routeMeta: RouteMeta,\n): routeMeta is RedirectRouteMeta {\n return !!routeMeta.redirectTo;\n}\n","import { inject } from '@angular/core';\nimport { RouteExport } from './models';\n\ndeclare const Zone: any;\ntype RenderResult = string | { content: string };\ntype ContentRendererLike = {\n render: (content: string) => Promise<RenderResult>;\n};\n\n// The Zone is currently enabled by default, so we wouldn't need this check.\n// However, leaving this open space will be useful if zone.js becomes optional\n// in the future. This means we won't have to modify the current code, and it will\n// continue to work seamlessly.\nconst isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.root;\n\nexport function toMarkdownModule(\n markdownFileFactory: () => Promise<string>,\n): () => Promise<RouteExport> {\n return async () => {\n const createLoader = () =>\n Promise.all([import('@analogjs/content'), markdownFileFactory()]);\n\n const [\n { parseRawContentFile, MarkdownRouteComponent, ContentRenderer },\n markdownFile,\n ]: [typeof import('@analogjs/content'), string] = await (isNgZoneEnabled\n ? // We are not able to use `runOutsideAngular` because we are not inside\n // an injection context to retrieve the `NgZone` instance.\n // The `Zone.root.run` is required when the code is running in the\n // browser since asynchronous tasks being scheduled in the current context\n // are a reason for unnecessary change detection cycles.\n Zone.root.run(createLoader)\n : createLoader());\n\n const { content, attributes } = parseRawContentFile(markdownFile);\n const { title, meta } = attributes;\n\n return {\n default: MarkdownRouteComponent,\n routeMeta: {\n data: { _analogContent: content },\n title,\n meta,\n resolve: {\n renderedAnalogContent: async () => {\n const contentRenderer = inject<any>(\n ContentRenderer as any,\n ) as ContentRendererLike;\n const rendered = await contentRenderer.render(content);\n return typeof rendered === 'string'\n ? rendered\n : (rendered as any).content;\n },\n },\n },\n };\n };\n}\n","export const ENDPOINT_EXTENSION = '.server.ts';\nexport const APP_DIR = 'src/app';\n","import { UrlSegment } from '@angular/router';\nimport type { Route } from '@angular/router';\nimport type { UrlMatcher } from '@angular/router';\n\nimport type { RouteExport, RouteMeta } from './models';\nimport { toRouteConfig } from './route-config';\nimport { toMarkdownModule } from './markdown-helpers';\nimport { ENDPOINT_EXTENSION } from './constants';\nimport { ANALOG_META_KEY } from './endpoints';\n\n/**\n * This variable reference is replaced with a glob of all page routes.\n */\nexport let ANALOG_ROUTE_FILES = {};\n\n/**\n * This variable reference is replaced with a glob of all content routes.\n */\nexport let ANALOG_CONTENT_ROUTE_FILES = {};\n\nexport type Files = Record<string, () => Promise<RouteExport | string>>;\n\ntype RawRoute = {\n filename: string | null;\n rawSegment: string;\n ancestorRawSegments: string[];\n segment: string;\n level: number;\n children: RawRoute[];\n};\n\ntype RawRouteMap = Record<string, RawRoute>;\n\ntype RawRouteByLevelMap = Record<number, RawRouteMap>;\n\n/**\n * A function used to parse list of files and create configuration of routes.\n *\n * @param files\n * @returns Array of routes\n */\nexport function createRoutes(files: Files, debug = false): Route[] {\n const filenames = Object.keys(files);\n\n if (filenames.length === 0) {\n return [];\n }\n\n // map filenames to raw routes and group them by level\n const rawRoutesByLevelMap = filenames.reduce((acc, filename) => {\n const rawPath = toRawPath(filename);\n const rawSegments = rawPath.split('/');\n // nesting level starts at 0\n // rawPath: /products => level: 0\n // rawPath: /products/:id => level: 1\n const level = rawSegments.length - 1;\n const rawSegment = rawSegments[level];\n const ancestorRawSegments = rawSegments.slice(0, level);\n\n return {\n ...acc,\n [level]: {\n ...acc[level],\n [rawPath]: {\n filename,\n rawSegment,\n ancestorRawSegments,\n segment: toSegment(rawSegment),\n level,\n children: [],\n },\n },\n };\n }, {} as RawRouteByLevelMap);\n\n const allLevels = Object.keys(rawRoutesByLevelMap).map(Number);\n const maxLevel = Math.max(...allLevels);\n\n // add each raw route to its parent's children array\n for (let level = maxLevel; level > 0; level--) {\n const rawRoutesMap = rawRoutesByLevelMap[level];\n const rawPaths = Object.keys(rawRoutesMap);\n\n for (const rawPath of rawPaths) {\n const rawRoute = rawRoutesMap[rawPath];\n const parentRawPath = rawRoute.ancestorRawSegments.join('/');\n const parentRawSegmentIndex = rawRoute.ancestorRawSegments.length - 1;\n const parentRawSegment =\n rawRoute.ancestorRawSegments[parentRawSegmentIndex];\n\n // create the parent level and/or raw route if it does not exist\n // parent route won't exist for nested routes that don't have a layout route\n rawRoutesByLevelMap[level - 1] ||= {};\n rawRoutesByLevelMap[level - 1][parentRawPath] ||= {\n filename: null,\n rawSegment: parentRawSegment,\n ancestorRawSegments: rawRoute.ancestorRawSegments.slice(\n 0,\n parentRawSegmentIndex,\n ),\n segment: toSegment(parentRawSegment),\n level: level - 1,\n children: [],\n };\n\n rawRoutesByLevelMap[level - 1][parentRawPath].children.push(rawRoute);\n }\n }\n\n // only take raw routes from the root level\n // since they already contain nested routes as their children\n const rootRawRoutesMap = rawRoutesByLevelMap[0];\n const rawRoutes = Object.keys(rootRawRoutesMap).map(\n (segment) => rootRawRoutesMap[segment],\n );\n sortRawRoutes(rawRoutes);\n\n return toRoutes(rawRoutes, files, debug);\n}\n\nfunction toRawPath(filename: string): string {\n return (\n filename\n .replace(\n // convert to relative path and remove file extension\n /^(?:[a-zA-Z]:[\\\\/])?(.*?)[\\\\/](?:routes|pages)[\\\\/]|(?:[\\\\/](?:app[\\\\/](?:routes|pages)|src[\\\\/]content)[\\\\/])|(\\.page\\.(js|ts|analog|ag)$)|(\\.(ts|md|analog|ag)$)/g,\n '',\n )\n // [[...slug]] => placeholder (named empty) which is stripped by toSegment\n .replace(/\\[\\[\\.\\.\\.([^\\]]+)\\]\\]/g, '(opt-$1)')\n .replace(/\\[\\.{3}.+\\]/, '**') // [...not-found] => **\n .replace(/\\[([^\\]]+)\\]/g, ':$1')\n ); // [id] => :id\n}\n\nfunction toSegment(rawSegment: string): string {\n return rawSegment\n .replace(/index|\\(.*?\\)/g, '') // replace named empty segments\n .replace(/\\.|\\/+/g, '/') // replace dots with slashes and remove redundant slashes\n .replace(/^\\/+|\\/+$/g, ''); // remove trailing slashes\n}\n\nfunction createOptionalCatchAllMatcher(paramName: string): UrlMatcher {\n return (segments) => {\n if (segments.length === 0) {\n return null;\n }\n const joined = segments.map((s) => s.path).join('/');\n return {\n consumed: segments,\n posParams: { [paramName]: new UrlSegment(joined, {}) },\n };\n };\n}\n\nfunction toRoutes(rawRoutes: RawRoute[], files: Files, debug = false): Route[] {\n const routes: Route[] = [];\n\n for (const rawRoute of rawRoutes) {\n const children: Route[] | undefined =\n rawRoute.children.length > 0\n ? toRoutes(rawRoute.children, files, debug)\n : undefined;\n let module: (() => Promise<RouteExport>) | undefined = undefined;\n let analogMeta: { endpoint: string; endpointKey: string } | undefined =\n undefined;\n\n if (rawRoute.filename) {\n const isMarkdownFile = rawRoute.filename.endsWith('.md');\n\n if (!debug) {\n module = isMarkdownFile\n ? toMarkdownModule(files[rawRoute.filename] as () => Promise<string>)\n : (files[rawRoute.filename] as () => Promise<RouteExport>);\n }\n\n const endpointKey = rawRoute.filename.replace(\n /\\.page\\.(ts|analog|ag)$/,\n ENDPOINT_EXTENSION,\n );\n\n // get endpoint path\n const rawEndpoint = rawRoute.filename\n .replace(/\\.page\\.(ts|analog|ag)$/, '')\n .replace(/\\[\\[\\.\\.\\..+\\]\\]/, '**')\n .replace(/\\[\\.{3}.+\\]/, '**') // [...not-found] => **\n .replace(/^(.*?)\\/pages/, '/pages');\n\n // replace periods, remove (index) paths\n const endpoint = (rawEndpoint || '')\n .replace(/\\./g, '/')\n .replace(/\\/\\((.*?)\\)$/, '/-$1-');\n\n analogMeta = {\n endpoint,\n endpointKey,\n };\n }\n\n // Detect Next.js-style optional catch-all at this node: [[...param]]\n const optCatchAllMatch = rawRoute.filename?.match(/\\[\\[\\.\\.\\.([^\\]]+)\\]\\]/);\n const optCatchAllParam = optCatchAllMatch ? optCatchAllMatch[1] : null;\n\n type DebugRoute = Route & {\n filename?: string | null | undefined;\n isLayout?: boolean;\n };\n\n const route: Route & { meta?: typeof analogMeta } & DebugRoute = module\n ? {\n path: rawRoute.segment,\n loadChildren: () =>\n module!().then((m) => {\n if (import.meta.env.DEV) {\n const hasModuleDefault = !!m.default;\n const hasRedirect = !!m.routeMeta?.redirectTo;\n\n if (!hasModuleDefault && !hasRedirect) {\n console.warn(\n `[Analog] Missing default export at ${rawRoute.filename}`,\n );\n }\n }\n\n const baseChild = {\n path: '',\n component: m.default,\n ...toRouteConfig(m.routeMeta as RouteMeta | undefined),\n children,\n [ANALOG_META_KEY]: analogMeta,\n };\n\n // Base route first so static matches win, then optional catch-all matcher\n return [\n {\n ...baseChild,\n },\n ...(optCatchAllParam\n ? [\n {\n matcher:\n createOptionalCatchAllMatcher(optCatchAllParam),\n component: m.default,\n ...toRouteConfig(m.routeMeta as RouteMeta | undefined),\n [ANALOG_META_KEY]: analogMeta,\n },\n ]\n : []),\n ];\n }),\n }\n : {\n path: rawRoute.segment,\n ...(debug\n ? {\n filename: rawRoute.filename ? rawRoute.filename : undefined,\n isLayout: children && children.length > 0 ? true : false,\n }\n : {}),\n children,\n };\n\n routes.push(route);\n }\n\n return routes;\n}\n\nfunction sortRawRoutes(rawRoutes: RawRoute[]): void {\n rawRoutes.sort((a, b) => {\n let segmentA = deprioritizeSegment(a.segment);\n let segmentB = deprioritizeSegment(b.segment);\n\n // prioritize routes with fewer children\n if (a.children.length > b.children.length) {\n segmentA = `~${segmentA}`;\n } else if (a.children.length < b.children.length) {\n segmentB = `~${segmentB}`;\n }\n\n return segmentA > segmentB ? 1 : -1;\n });\n\n for (const rawRoute of rawRoutes) {\n sortRawRoutes(rawRoute.children);\n }\n}\n\nfunction deprioritizeSegment(segment: string): string {\n // deprioritize param and wildcard segments\n return segment.replace(':', '~~').replace('**', '~~~~');\n}\n\nexport const routes: Route[] = createRoutes({\n ...ANALOG_ROUTE_FILES,\n ...ANALOG_CONTENT_ROUTE_FILES,\n});\n","import { inject } from '@angular/core';\nimport { Route as NgRoute, Router } from '@angular/router';\nimport { ActivatedRoute } from '@angular/router';\n\ntype RouteOmitted =\n | 'component'\n | 'loadComponent'\n | 'loadChildren'\n | 'path'\n | 'pathMatch';\n\ntype RestrictedRoute = Omit<NgRoute, RouteOmitted>;\n\n/**\n * @deprecated Use `RouteMeta` type instead.\n * For more info see: https://github.com/analogjs/analog/issues/223\n *\n * Defines additional route config metadata. This\n * object is merged into the route config with\n * the predefined file-based route.\n *\n * @usageNotes\n *\n * ```\n * import { Component } from '@angular/core';\n * import { defineRouteMeta } from '@analogjs/router';\n *\n * export const routeMeta = defineRouteMeta({\n * title: 'Welcome'\n * });\n *\n * @Component({\n * template: `Home`,\n * standalone: true,\n * })\n * export default class HomeComponent {}\n * ```\n *\n * @param route\n * @returns\n */\nexport const defineRouteMeta = (route: RestrictedRoute) => {\n return route;\n};\n\n/**\n * Returns the instance of Angular Router\n *\n * @returns The router\n */\nexport const injectRouter = () => {\n return inject(Router);\n};\n\n/**\n * Returns the instance of the Activate Route for the component\n *\n * @returns The activated route\n */\nexport const injectActivatedRoute = () => {\n return inject(ActivatedRoute);\n};\n","import { isPlatformServer } from '@angular/common';\nimport { HttpHandlerFn, HttpHeaders, HttpRequest } from '@angular/common/http';\nimport { PLATFORM_ID, inject } from '@angular/core';\nimport { injectRequest } from '@analogjs/router/tokens';\n\nexport function cookieInterceptor(\n req: HttpRequest<unknown>,\n next: HttpHandlerFn,\n location = inject(PLATFORM_ID),\n serverRequest = injectRequest(),\n) {\n if (isPlatformServer(location) && req.url.includes('/_analog/')) {\n let headers = new HttpHeaders();\n const cookies = serverRequest?.headers.cookie;\n headers = headers.set('cookie', cookies ?? '');\n\n const cookiedRequest = req.clone({\n headers,\n });\n\n return next(cookiedRequest);\n } else {\n return next(req);\n }\n}\n","import {\n ENVIRONMENT_INITIALIZER,\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport { provideRouter, RouterFeatures, ROUTES, Routes } from '@angular/router';\nimport { API_PREFIX } from '@analogjs/router/tokens';\nimport { ɵHTTP_ROOT_INTERCEPTOR_FNS as HTTP_ROOT_INTERCEPTOR_FNS } from '@angular/common/http';\n\nimport { routes } from './routes';\nimport { updateMetaTagsOnRouteChange } from './meta-tags';\nimport { cookieInterceptor } from './cookie-interceptor';\n\ndeclare const ANALOG_API_PREFIX: string;\n\n/**\n * Sets up providers for the Angular router, and registers\n * file-based routes. Additional features can be provided\n * to further configure the behavior of the router.\n *\n * @param features\n * @returns Providers and features to configure the router with routes\n */\nexport function provideFileRouter(\n ...features: RouterFeatures[]\n): EnvironmentProviders {\n const extraRoutesFeature = features.filter((feat) => feat.ɵkind >= 100);\n const routerFeatures = features.filter((feat) => feat.ɵkind < 100);\n\n return makeEnvironmentProviders([\n extraRoutesFeature.map((erf) => erf.ɵproviders),\n provideRouter(routes, ...routerFeatures),\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: () => updateMetaTagsOnRouteChange(),\n },\n {\n provide: HTTP_ROOT_INTERCEPTOR_FNS,\n multi: true,\n useValue: cookieInterceptor,\n },\n {\n provide: API_PREFIX,\n useFactory() {\n return typeof ANALOG_API_PREFIX !== 'undefined'\n ? ANALOG_API_PREFIX\n : 'api';\n },\n },\n ]);\n}\n\n/**\n * Provides extra custom routes in addition to the routes\n * discovered from the filesystem-based routing. These routes are\n * inserted before the filesystem-based routes, and take priority in\n * route matching.\n */\nexport function withExtraRoutes(routes: Routes): RouterFeatures {\n return {\n ɵkind: 100 as number,\n ɵproviders: [{ provide: ROUTES, useValue: routes, multi: true }],\n };\n}\n","import { Injector, inject } from '@angular/core';\nimport { ActivatedRoute, Data } from '@angular/router';\nimport { Observable, map } from 'rxjs';\n\nimport { PageServerLoad } from './route-types';\n\nexport function injectLoad<\n T extends (pageServerLoad: PageServerLoad) => Promise<any>,\n>(options?: { injector?: Injector }): Observable<Awaited<ReturnType<T>>> {\n const injector = options?.injector ?? inject(Injector);\n const route = injector.get(ActivatedRoute);\n\n return route.data.pipe(\n map<Data, Awaited<ReturnType<T>>>((data) => data['load']),\n );\n}\n","import { ActivatedRouteSnapshot } from '@angular/router';\n\n/**\n * Get server load resolver data for the route\n *\n * @param route Provides the route to get server load resolver\n * @returns Returns server load resolver data for the route\n */\nexport async function getLoadResolver<T>(\n route: ActivatedRouteSnapshot,\n): Promise<T> {\n return route.routeConfig?.resolve?.['load']?.(route);\n}\n","import { HttpParams, HttpRequest } from '@angular/common/http';\nimport { StateKey, makeStateKey } from '@angular/core';\n\nfunction sortAndConcatParams(params: HttpParams | URLSearchParams): string {\n return [...params.keys()]\n .sort()\n .map((k) => `${k}=${params.getAll(k)}`)\n .join('&');\n}\n\nexport function makeCacheKey(\n request: HttpRequest<any>,\n mappedRequestUrl: string,\n): StateKey<unknown> {\n // make the params encoded same as a url so it's easy to identify\n const { params, method, responseType } = request;\n const encodedParams = sortAndConcatParams(params);\n\n let serializedBody = request.serializeBody();\n if (serializedBody instanceof URLSearchParams) {\n serializedBody = sortAndConcatParams(serializedBody);\n } else if (typeof serializedBody !== 'string') {\n serializedBody = '';\n }\n\n const key = [\n method,\n responseType,\n mappedRequestUrl,\n serializedBody,\n encodedParams,\n ].join('|');\n\n const hash = generateHash(key);\n\n return makeStateKey(hash);\n}\n\nfunction generateHash(str: string) {\n let hash = 0;\n for (let i = 0, len = str.length; i < len; i++) {\n let chr = str.charCodeAt(i);\n hash = (hash << 5) - hash + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return `${hash}`;\n}\n","import { TransferState, inject, makeStateKey } from '@angular/core';\nimport {\n HttpHandlerFn,\n HttpHeaders,\n HttpRequest,\n HttpResponse,\n} from '@angular/common/http';\n\nimport { from, of } from 'rxjs';\n\nimport { injectBaseURL, injectAPIPrefix } from '@analogjs/router/tokens';\n\nimport { makeCacheKey } from './cache-key';\n\n/**\n * Interceptor that is server-aware when making HttpClient requests.\n * Server-side requests use the full URL\n * Prerendering uses the internal Nitro $fetch function, along with state transfer\n * Client-side requests use the window.location.origin\n *\n * @param req HttpRequest<unknown>\n * @param next HttpHandlerFn\n * @returns\n */\nexport function requestContextInterceptor(\n req: HttpRequest<unknown>,\n next: HttpHandlerFn,\n) {\n const apiPrefix = injectAPIPrefix();\n const baseUrl = injectBaseURL();\n const transferState = inject(TransferState);\n\n // during prerendering with Nitro\n if (\n typeof global !== 'undefined' &&\n global.$fetch &&\n baseUrl &&\n (req.url.startsWith('/') ||\n req.url.startsWith(baseUrl) ||\n req.url.startsWith(`/${apiPrefix}`))\n ) {\n const requestUrl = new URL(req.url, baseUrl);\n const cacheKey = makeCacheKey(req, new URL(requestUrl).pathname);\n const storeKey = makeStateKey<unknown>(`analog_${cacheKey}`);\n const fetchUrl = requestUrl.pathname;\n\n const responseType =\n req.responseType === 'arraybuffer' ? 'arrayBuffer' : req.responseType;\n\n return from(\n global.$fetch\n .raw(fetchUrl, {\n method: req.method as any,\n body: req.body ? req.body : undefined,\n params: requestUrl.searchParams,\n responseType,\n headers: req.headers.keys().reduce((hdrs, current) => {\n return {\n ...hdrs,\n [current]: req.headers.get(current),\n };\n }, {}),\n })\n .then((res) => {\n const cacheResponse = {\n body: res._data,\n headers: new HttpHeaders(res.headers),\n status: 200,\n statusText: 'OK',\n url: fetchUrl,\n };\n const transferResponse = new HttpResponse(cacheResponse);\n\n transferState.set(storeKey, cacheResponse);\n return transferResponse;\n }),\n );\n }\n\n // on the client\n if (\n !import.meta.env.SSR &&\n (req.url.startsWith('/') || req.url.includes('/_analog/'))\n ) {\n // /_analog/ requests are full URLs\n const requestUrl = req.url.includes('/_analog/')\n ? req.url\n : `${window.location.origin}${req.url}`;\n const cacheKey = makeCacheKey(req, new URL(requestUrl).pathname);\n const storeKey = makeStateKey<unknown>(`analog_${cacheKey}`);\n const cacheRestoreResponse = transferState.get(storeKey, null);\n\n if (cacheRestoreResponse) {\n transferState.remove(storeKey);\n return of(new HttpResponse(cacheRestoreResponse));\n }\n\n return next(\n req.clone({\n url: requestUrl,\n }),\n );\n }\n\n // on the server\n if (baseUrl && (req.url.startsWith('/') || req.url.startsWith(baseUrl))) {\n const requestUrl =\n req.url.startsWith(baseUrl) && !req.url.startsWith('/')\n ? req.url\n : `${baseUrl}${req.url}`;\n\n return next(\n req.clone({\n url: requestUrl,\n }),\n );\n }\n\n return next(req);\n}\n","import { Directive, inject, input, output } from '@angular/core';\nimport { ActivatedRoute, Params, Router } from '@angular/router';\n\nimport { injectRouteEndpointURL } from './inject-route-endpoint-url';\n\n@Directive({\n selector: 'form[action],form[method]',\n host: {\n '(submit)': `submitted($event)`,\n },\n standalone: true,\n})\nexport class FormAction {\n action = input<string>('');\n onSuccess = output<unknown>();\n onError = output<unknown>();\n state = output<\n 'submitting' | 'error' | 'redirect' | 'success' | 'navigate'\n >();\n private router = inject(Router);\n private route = inject(ActivatedRoute);\n private path = this._getPath();\n\n submitted($event: any) {\n $event.preventDefault();\n\n this.state.emit('submitting');\n const body = new FormData($event.target);\n\n if ($event.target.method.toUpperCase() === 'GET') {\n this._handleGet(body, this.router.url);\n } else {\n this._handlePost(body, this.path, $event);\n }\n }\n\n private _handleGet(body: FormData, path: string) {\n const params: Params = {};\n body.forEach((formVal, formKey) => (params[formKey] = formVal));\n\n this.state.emit('navigate');\n const url = path.split('?')[0];\n this.router.navigate([url], {\n queryParams: params,\n onSameUrlNavigation: 'reload',\n });\n }\n\n private _handlePost(\n body: FormData,\n path: string,\n $event: { target: HTMLFormElement } & Event,\n ) {\n fetch(path, {\n method: $event.target.method,\n body,\n })\n .then((res) => {\n if (res.ok) {\n if (res.redirected) {\n const redirectUrl = new URL(res.url).pathname;\n this.state.emit('redirect');\n this.router.navigate([redirectUrl]);\n } else if (this._isJSON(res.headers.get('Content-type'))) {\n res.json().then((result) => {\n this.onSuccess.emit(result);\n this.state.emit('success');\n });\n } else {\n res.text().then((result) => {\n this.onSuccess.emit(result);\n this.state.emit('success');\n });\n }\n } else {\n if (res.headers.get('X-Analog-Errors')) {\n res.json().then((errors: unknown) => {\n this.onError.emit(errors);\n this.state.emit('error');\n });\n } else {\n this.state.emit('error');\n }\n }\n })\n .catch((_) => {\n this.state.emit('error');\n });\n }\n\n private _getPath() {\n if (this.route) {\n return injectRouteEndpointURL(this.route.snapshot).pathname;\n }\n\n return `/api/_analog/pages${window.location.pathname}`;\n }\n\n private _isJSON(contentType: string | null): boolean {\n const mime = contentType ? contentType.split(';') : [];\n const essence = mime[0];\n\n return essence === 'application/json';\n }\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport { Route } from '@angular/router';\n\nimport {\n ANALOG_CONTENT_ROUTE_FILES,\n ANALOG_ROUTE_FILES,\n createRoutes,\n} from '../routes';\n\nexport const DEBUG_ROUTES = new InjectionToken(\n '@analogjs/router debug routes',\n {\n providedIn: 'root',\n factory() {\n const debugRoutes = createRoutes(\n {\n ...ANALOG_ROUTE_FILES,\n ...ANALOG_CONTENT_ROUTE_FILES,\n },\n true,\n );\n\n return debugRoutes as (Route & DebugRoute)[];\n },\n },\n);\n\nexport type DebugRoute = {\n path: string;\n filename: string;\n isLayout: boolean;\n children?: DebugRoute[];\n};\n\nexport function injectDebugRoutes() {\n return inject(DEBUG_ROUTES);\n}\n","import { ROUTES } from '@angular/router';\n\n/**\n * Provides routes that provide additional\n * pages for displaying and debugging\n * routes.\n */\nexport function withDebugRoutes() {\n const routes = [\n {\n path: '__analog/routes',\n loadComponent: () => import('./debug.page'),\n },\n ];\n\n return {\n ɵkind: 101 as number,\n ɵproviders: [{ provide: ROUTES, useValue: routes, multi: true }],\n };\n}\n","import {\n HttpClient,\n HttpHeaders,\n HttpRequest,\n HttpResponse,\n} from '@angular/common/http';\nimport {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n input,\n makeStateKey,\n output,\n signal,\n TransferState,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ActivatedRoute } from '@angular/router';\nimport { injectBaseURL } from '@analogjs/router/tokens';\nimport { catchError, map, of, throwError } from 'rxjs';\n\nimport { makeCacheKey } from './cache-key';\n\ntype ServerProps = Record<string, any>;\ntype ServerOutputs = Record<string, any>;\n\n/**\n * @description\n * Component that defines the bridge between the client and server-only\n * components. The component passes the component ID and props to the server\n * and retrieves the rendered HTML and outputs from the server-only component.\n *\n * Status: experimental\n */\n@Component({\n selector: 'server-only,ServerOnly,Server',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: ` <div [innerHTML]=\"content()\"></div> `,\n})\nexport class ServerOnly {\n component = input.required<string>();\n props = input<ServerProps>();\n outputs = output<ServerOutputs>();\n private http = inject(HttpClient);\n private sanitizer = inject(DomSanitizer);\n protected content = signal<SafeHtml>('');\n private route = inject(ActivatedRoute, { optional: true });\n private baseURL = injectBaseURL();\n private transferState = inject(TransferState);\n\n constructor() {\n effect(() => {\n const routeComponentId: string | undefined =\n this.route?.snapshot.data['component'];\n const props = this.props() || {};\n const componentId = routeComponentId || this.component();\n\n const headers = new HttpHeaders(\n new Headers({\n 'Content-type': 'application/json',\n 'X-Analog-Component': componentId,\n }),\n );\n\n const componentUrl = this.getComponentUrl(componentId);\n const httpRequest = new HttpRequest('POST', componentUrl, props, {\n headers,\n });\n const cacheKey = makeCacheKey(\n httpRequest,\n new URL(componentUrl).pathname,\n );\n const storeKey = makeStateKey<{ html: string; outputs: ServerOutputs }>(\n cacheKey,\n );\n const componentState = this.transferState.get<{\n html: string;\n outputs: ServerOutputs;\n } | null>(storeKey, null);\n\n if (componentState) {\n this.updateContent(componentState);\n this.transferState.remove(storeKey);\n } else {\n this.http\n .request(httpRequest)\n .pipe(\n map((response) => {\n if (response instanceof HttpResponse) {\n if (import.meta.env.SSR) {\n this.transferState.set(storeKey, response.body);\n }\n\n return response.body as {\n html: string;\n outputs: ServerOutputs;\n };\n }\n return throwError(\n () => ({}) as { html: string; outputs: ServerOutputs },\n );\n }),\n catchError((error: unknown) => {\n console.log(error);\n return of({\n html: '',\n outputs: {} as ServerOutputs,\n });\n }),\n )\n .subscribe((content) =>\n this.updateContent(\n content as { html: string; outputs: ServerOutputs },\n ),\n );\n }\n });\n }\n\n updateContent(content: { html: string; outputs: ServerOutputs }) {\n this.content.set(this.sanitizer.bypassSecurityTrustHtml(content.html));\n this.outputs.emit(content.outputs);\n }\n\n getComponentUrl(componentId: string) {\n let baseURL = this.baseURL;\n\n if (!baseURL && typeof window !== 'undefined') {\n baseURL = window.location.origin;\n }\n\n return `${baseURL}/_analog/components/${componentId}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["HTTP_ROOT_INTERCEPTOR_FNS"],"mappings":";;;;;;;;;;AAKO,MAAM,mBAAmB,GAAG,MAAM,CACvC,sCAAsC,CACvC;AAED,MAAM,WAAW,GAAG,SAAS;AAC7B,MAAM,cAAc,GAAG,WAAW;AAClC;AACA,MAAM,uBAAuB,GAAG,YAAY;AAC5C,MAAM,QAAQ,GAAG,MAAM;AACvB,MAAM,YAAY,GAAG,UAAU;AAC/B,MAAM,WAAW,GAAG,SAAS;AAC7B,MAAM,YAAY,GAAG,UAAU;SAkCf,2BAA2B,GAAA;AACzC,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC7B,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC;AAEhC,IAAA,MAAM,CAAC;AACJ,SAAA,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,YAAY,aAAa,CAAC;SACtD,SAAS,CAAC,MAAK;AACd,QAAA,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;AAElE,QAAA,KAAK,MAAM,eAAe,IAAI,UAAU,EAAE;AACxC,YAAA,MAAM,OAAO,GAAG,UAAU,CACxB,eAAkC,CACtB;AACd,YAAA,WAAW,CAAC,SAAS,CAAC,OAAO,EAAE,eAAe,CAAC;QACjD;AACF,IAAA,CAAC,CAAC;AACN;AAEA,SAAS,aAAa,CAAC,KAA6B,EAAA;IAClD,MAAM,UAAU,GAAG,EAAgB;IACnC,IAAI,YAAY,GAAkC,KAAK;IAEvD,OAAO,YAAY,EAAE;QACnB,MAAM,QAAQ,GAAc,YAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC,IA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A,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,iYAFX,CAAA,qCAAA,CAAuC,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEtC,UAAU,EAAA,UAAA,EAAA,CAAA;kBALtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,+BAA+B;oBACzC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE,CAAA,qCAAA,CAAuC;AAClD,iBAAA;;;ACvCD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"analogjs-router.mjs","sources":["../../../../packages/router/src/lib/meta-tags.ts","../../../../packages/router/src/lib/endpoints.ts","../../../../packages/router/src/lib/inject-route-endpoint-url.ts","../../../../packages/router/src/lib/route-config.ts","../../../../packages/router/src/lib/markdown-helpers.ts","../../../../packages/router/src/lib/constants.ts","../../../../packages/router/src/lib/routes.ts","../../../../packages/router/src/lib/define-route.ts","../../../../packages/router/src/lib/cookie-interceptor.ts","../../../../packages/router/src/lib/provide-file-router.ts","../../../../packages/router/src/lib/inject-load.ts","../../../../packages/router/src/lib/get-load-resolver.ts","../../../../packages/router/src/lib/cache-key.ts","../../../../packages/router/src/lib/request-context.ts","../../../../packages/router/src/lib/form-action.directive.ts","../../../../packages/router/src/lib/debug/routes.ts","../../../../packages/router/src/lib/debug/index.ts","../../../../packages/router/src/lib/server.component.ts","../../../../packages/router/src/lib/server-fn/dispatcher.ts","../../../../packages/router/src/lib/server-fn/inject-server-fn.ts","../../../../packages/router/src/lib/server-fn/server-fn-ref.ts","../../../../packages/router/src/analogjs-router.ts"],"sourcesContent":["import { inject } from '@angular/core';\nimport { Meta, MetaDefinition as NgMetaTag } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, NavigationEnd, Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\n\nexport const ROUTE_META_TAGS_KEY = Symbol(\n '@analogjs/router Route Meta Tags Key',\n);\n\nconst CHARSET_KEY = 'charset';\nconst HTTP_EQUIV_KEY = 'httpEquiv';\n// httpEquiv selector key needs to be in kebab case format\nconst HTTP_EQUIV_SELECTOR_KEY = 'http-equiv';\nconst NAME_KEY = 'name';\nconst PROPERTY_KEY = 'property';\nconst CONTENT_KEY = 'content';\nconst ITEMPROP_KEY = 'itemprop';\n\nexport type MetaTag =\n | (CharsetMetaTag & ExcludeRestMetaTagKeys<typeof CHARSET_KEY>)\n | (HttpEquivMetaTag & ExcludeRestMetaTagKeys<typeof HTTP_EQUIV_KEY>)\n | (NameMetaTag & ExcludeRestMetaTagKeys<typeof NAME_KEY>)\n | (PropertyMetaTag & ExcludeRestMetaTagKeys<typeof PROPERTY_KEY>)\n | (ItempropMetaTag & ExcludeRestMetaTagKeys<typeof ITEMPROP_KEY>);\n\ntype CharsetMetaTag = { [CHARSET_KEY]: string };\ntype HttpEquivMetaTag = { [HTTP_EQUIV_KEY]: string; [CONTENT_KEY]: string };\ntype NameMetaTag = { [NAME_KEY]: string; [CONTENT_KEY]: string };\ntype PropertyMetaTag = { [PROPERTY_KEY]: string; [CONTENT_KEY]: string };\ntype ItempropMetaTag = { [ITEMPROP_KEY]: string; [CONTENT_KEY]: string };\n\ntype MetaTagKey =\n | typeof CHARSET_KEY\n | typeof HTTP_EQUIV_KEY\n | typeof NAME_KEY\n | typeof PROPERTY_KEY\n | typeof ITEMPROP_KEY;\ntype ExcludeRestMetaTagKeys<Key extends MetaTagKey> = {\n [K in Exclude<MetaTagKey, Key>]?: never;\n};\n\ntype MetaTagSelector =\n | typeof CHARSET_KEY\n | `${\n | typeof HTTP_EQUIV_SELECTOR_KEY\n | typeof NAME_KEY\n | typeof PROPERTY_KEY\n | typeof ITEMPROP_KEY}=\"${string}\"`;\ntype MetaTagMap = Record<MetaTagSelector, MetaTag>;\n\nexport function updateMetaTagsOnRouteChange(): void {\n const router = inject(Router);\n const metaService = inject(Meta);\n\n router.events\n .pipe(filter((event) => event instanceof NavigationEnd))\n .subscribe(() => {\n const metaTagMap = getMetaTagMap(router.routerState.snapshot.root);\n\n for (const metaTagSelector in metaTagMap) {\n const metaTag = metaTagMap[\n metaTagSelector as MetaTagSelector\n ] as NgMetaTag;\n metaService.updateTag(metaTag, metaTagSelector);\n }\n });\n}\n\nfunction getMetaTagMap(route: ActivatedRouteSnapshot): MetaTagMap {\n const metaTagMap = {} as MetaTagMap;\n let currentRoute: ActivatedRouteSnapshot | null = route;\n\n while (currentRoute) {\n const metaTags: MetaTag[] = currentRoute.data[ROUTE_META_TAGS_KEY] ?? [];\n for (const metaTag of metaTags) {\n metaTagMap[getMetaTagSelector(metaTag)] = metaTag;\n }\n\n currentRoute = currentRoute.firstChild;\n }\n\n return metaTagMap;\n}\n\nfunction getMetaTagSelector(metaTag: MetaTag): MetaTagSelector {\n if (metaTag.name) {\n return `${NAME_KEY}=\"${metaTag.name}\"`;\n }\n\n if (metaTag.property) {\n return `${PROPERTY_KEY}=\"${metaTag.property}\"`;\n }\n\n if (metaTag.httpEquiv) {\n return `${HTTP_EQUIV_SELECTOR_KEY}=\"${metaTag.httpEquiv}\"`;\n }\n\n if (metaTag.itemprop) {\n return `${ITEMPROP_KEY}=\"${metaTag.itemprop}\"`;\n }\n\n return CHARSET_KEY;\n}\n","export const ANALOG_META_KEY = Symbol(\n '@analogjs/router Analog Route Metadata Key',\n);\n\n/**\n * This variable reference is replaced with a glob of all route endpoints.\n */\nexport let ANALOG_PAGE_ENDPOINTS: any = {};\n","import type { ActivatedRouteSnapshot, Route } from '@angular/router';\nimport { injectBaseURL, injectAPIPrefix } from '@analogjs/router/tokens';\n\nimport { ANALOG_META_KEY } from './endpoints';\n\nexport function injectRouteEndpointURL(route: ActivatedRouteSnapshot) {\n const routeConfig = route.routeConfig as Route & {\n [ANALOG_META_KEY]: { endpoint: string; endpointKey: string };\n };\n\n const apiPrefix = injectAPIPrefix();\n const baseUrl = injectBaseURL();\n const { queryParams, fragment: hash, params, parent } = route;\n const segment = parent?.url.map((segment) => segment.path).join('/') || '';\n const url = new URL(\n '',\n import.meta.env['VITE_ANALOG_PUBLIC_BASE_URL'] ||\n baseUrl ||\n (typeof window !== 'undefined' && window.location.origin\n ? window.location.origin\n : ''),\n );\n url.pathname = `${\n url.pathname.endsWith('/') ? url.pathname : url.pathname + '/'\n }${apiPrefix}/_analog${routeConfig[ANALOG_META_KEY].endpoint}`;\n url.search = `${new URLSearchParams(queryParams).toString()}`;\n url.hash = hash ?? '';\n\n Object.keys(params).forEach((param) => {\n url.pathname = url.pathname.replace(`[${param}]`, params[param]);\n });\n url.pathname = url.pathname.replace('**', segment);\n\n return url;\n}\n","import { inject } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport type { Route } from '@angular/router';\nimport { firstValueFrom } from 'rxjs';\n\nimport { RedirectRouteMeta, RouteConfig, RouteMeta } from './models';\nimport { ROUTE_META_TAGS_KEY } from './meta-tags';\nimport { ANALOG_PAGE_ENDPOINTS, ANALOG_META_KEY } from './endpoints';\nimport { injectRouteEndpointURL } from './inject-route-endpoint-url';\n\nexport function toRouteConfig(routeMeta: RouteMeta | undefined): RouteConfig {\n if (routeMeta && isRedirectRouteMeta(routeMeta)) {\n return routeMeta;\n }\n\n let { meta, ...routeConfig } = routeMeta ?? {};\n\n if (Array.isArray(meta)) {\n routeConfig.data = { ...routeConfig.data, [ROUTE_META_TAGS_KEY]: meta };\n } else if (typeof meta === 'function') {\n routeConfig.resolve = {\n ...routeConfig.resolve,\n [ROUTE_META_TAGS_KEY]: meta,\n };\n }\n\n if (!routeConfig) {\n routeConfig = {};\n }\n\n routeConfig.runGuardsAndResolvers =\n routeConfig.runGuardsAndResolvers ?? 'paramsOrQueryParamsChange';\n routeConfig.resolve = {\n ...routeConfig.resolve,\n load: async (route) => {\n const routeConfig = route.routeConfig as Route & {\n [ANALOG_META_KEY]: { endpoint: string; endpointKey: string };\n };\n\n if (ANALOG_PAGE_ENDPOINTS[routeConfig[ANALOG_META_KEY].endpointKey]) {\n const http = inject(HttpClient);\n const url = injectRouteEndpointURL(route);\n\n if (\n !!import.meta.env['VITE_ANALOG_PUBLIC_BASE_URL'] &&\n (globalThis as any).$fetch\n ) {\n return (globalThis as any).$fetch(url.pathname);\n }\n\n return firstValueFrom(http.get(`${url.href}`));\n }\n\n return {};\n },\n };\n\n return routeConfig;\n}\n\nfunction isRedirectRouteMeta(\n routeMeta: RouteMeta,\n): routeMeta is RedirectRouteMeta {\n return !!routeMeta.redirectTo;\n}\n","import { inject } from '@angular/core';\nimport { RouteExport } from './models';\n\ndeclare const Zone: any;\ntype RenderResult = string | { content: string };\ntype ContentRendererLike = {\n render: (content: string) => Promise<RenderResult>;\n};\n\n// The Zone is currently enabled by default, so we wouldn't need this check.\n// However, leaving this open space will be useful if zone.js becomes optional\n// in the future. This means we won't have to modify the current code, and it will\n// continue to work seamlessly.\nconst isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.root;\n\nexport function toMarkdownModule(\n markdownFileFactory: () => Promise<string>,\n): () => Promise<RouteExport> {\n return async () => {\n const createLoader = () =>\n Promise.all([import('@analogjs/content'), markdownFileFactory()]);\n\n const [\n { parseRawContentFile, MarkdownRouteComponent, ContentRenderer },\n markdownFile,\n ]: [typeof import('@analogjs/content'), string] = await (isNgZoneEnabled\n ? // We are not able to use `runOutsideAngular` because we are not inside\n // an injection context to retrieve the `NgZone` instance.\n // The `Zone.root.run` is required when the code is running in the\n // browser since asynchronous tasks being scheduled in the current context\n // are a reason for unnecessary change detection cycles.\n Zone.root.run(createLoader)\n : createLoader());\n\n const { content, attributes } = parseRawContentFile(markdownFile);\n const { title, meta } = attributes;\n\n return {\n default: MarkdownRouteComponent,\n routeMeta: {\n data: { _analogContent: content },\n title,\n meta,\n resolve: {\n renderedAnalogContent: async () => {\n const contentRenderer = inject<any>(\n ContentRenderer as any,\n ) as ContentRendererLike;\n const rendered = await contentRenderer.render(content);\n return typeof rendered === 'string'\n ? rendered\n : (rendered as any).content;\n },\n },\n },\n };\n };\n}\n","export const ENDPOINT_EXTENSION = '.server.ts';\nexport const APP_DIR = 'src/app';\n","import { UrlSegment } from '@angular/router';\nimport type { Route } from '@angular/router';\nimport type { UrlMatcher } from '@angular/router';\n\nimport type { RouteExport, RouteMeta } from './models';\nimport { toRouteConfig } from './route-config';\nimport { toMarkdownModule } from './markdown-helpers';\nimport { ENDPOINT_EXTENSION } from './constants';\nimport { ANALOG_META_KEY } from './endpoints';\n\n/**\n * This variable reference is replaced with a glob of all page routes.\n */\nexport let ANALOG_ROUTE_FILES = {};\n\n/**\n * This variable reference is replaced with a glob of all content routes.\n */\nexport let ANALOG_CONTENT_ROUTE_FILES = {};\n\nexport type Files = Record<string, () => Promise<RouteExport | string>>;\n\ntype RawRoute = {\n filename: string | null;\n rawSegment: string;\n ancestorRawSegments: string[];\n segment: string;\n level: number;\n children: RawRoute[];\n};\n\ntype RawRouteMap = Record<string, RawRoute>;\n\ntype RawRouteByLevelMap = Record<number, RawRouteMap>;\n\n/**\n * A function used to parse list of files and create configuration of routes.\n *\n * @param files\n * @returns Array of routes\n */\nexport function createRoutes(files: Files, debug = false): Route[] {\n const filenames = Object.keys(files);\n\n if (filenames.length === 0) {\n return [];\n }\n\n // map filenames to raw routes and group them by level\n const rawRoutesByLevelMap = filenames.reduce((acc, filename) => {\n const rawPath = toRawPath(filename);\n const rawSegments = rawPath.split('/');\n // nesting level starts at 0\n // rawPath: /products => level: 0\n // rawPath: /products/:id => level: 1\n const level = rawSegments.length - 1;\n const rawSegment = rawSegments[level];\n const ancestorRawSegments = rawSegments.slice(0, level);\n\n return {\n ...acc,\n [level]: {\n ...acc[level],\n [rawPath]: {\n filename,\n rawSegment,\n ancestorRawSegments,\n segment: toSegment(rawSegment),\n level,\n children: [],\n },\n },\n };\n }, {} as RawRouteByLevelMap);\n\n const allLevels = Object.keys(rawRoutesByLevelMap).map(Number);\n const maxLevel = Math.max(...allLevels);\n\n // add each raw route to its parent's children array\n for (let level = maxLevel; level > 0; level--) {\n const rawRoutesMap = rawRoutesByLevelMap[level];\n const rawPaths = Object.keys(rawRoutesMap);\n\n for (const rawPath of rawPaths) {\n const rawRoute = rawRoutesMap[rawPath];\n const parentRawPath = rawRoute.ancestorRawSegments.join('/');\n const parentRawSegmentIndex = rawRoute.ancestorRawSegments.length - 1;\n const parentRawSegment =\n rawRoute.ancestorRawSegments[parentRawSegmentIndex];\n\n // create the parent level and/or raw route if it does not exist\n // parent route won't exist for nested routes that don't have a layout route\n rawRoutesByLevelMap[level - 1] ||= {};\n rawRoutesByLevelMap[level - 1][parentRawPath] ||= {\n filename: null,\n rawSegment: parentRawSegment,\n ancestorRawSegments: rawRoute.ancestorRawSegments.slice(\n 0,\n parentRawSegmentIndex,\n ),\n segment: toSegment(parentRawSegment),\n level: level - 1,\n children: [],\n };\n\n rawRoutesByLevelMap[level - 1][parentRawPath].children.push(rawRoute);\n }\n }\n\n // only take raw routes from the root level\n // since they already contain nested routes as their children\n const rootRawRoutesMap = rawRoutesByLevelMap[0];\n const rawRoutes = Object.keys(rootRawRoutesMap).map(\n (segment) => rootRawRoutesMap[segment],\n );\n sortRawRoutes(rawRoutes);\n\n return toRoutes(rawRoutes, files, debug);\n}\n\nfunction toRawPath(filename: string): string {\n return (\n filename\n .replace(\n // convert to relative path and remove file extension\n /^(?:[a-zA-Z]:[\\\\/])?(.*?)[\\\\/](?:routes|pages)[\\\\/]|(?:[\\\\/](?:app[\\\\/](?:routes|pages)|src[\\\\/]content)[\\\\/])|(\\.page\\.(js|ts|analog|ag)$)|(\\.(ts|md|analog|ag)$)/g,\n '',\n )\n // [[...slug]] => placeholder (named empty) which is stripped by toSegment\n .replace(/\\[\\[\\.\\.\\.([^\\]]+)\\]\\]/g, '(opt-$1)')\n .replace(/\\[\\.{3}.+\\]/, '**') // [...not-found] => **\n .replace(/\\[([^\\]]+)\\]/g, ':$1')\n ); // [id] => :id\n}\n\nfunction toSegment(rawSegment: string): string {\n return rawSegment\n .replace(/index|\\(.*?\\)/g, '') // replace named empty segments\n .replace(/\\.|\\/+/g, '/') // replace dots with slashes and remove redundant slashes\n .replace(/^\\/+|\\/+$/g, ''); // remove trailing slashes\n}\n\nfunction createOptionalCatchAllMatcher(paramName: string): UrlMatcher {\n return (segments) => {\n if (segments.length === 0) {\n return null;\n }\n const joined = segments.map((s) => s.path).join('/');\n return {\n consumed: segments,\n posParams: { [paramName]: new UrlSegment(joined, {}) },\n };\n };\n}\n\nfunction toRoutes(rawRoutes: RawRoute[], files: Files, debug = false): Route[] {\n const routes: Route[] = [];\n\n for (const rawRoute of rawRoutes) {\n const children: Route[] | undefined =\n rawRoute.children.length > 0\n ? toRoutes(rawRoute.children, files, debug)\n : undefined;\n let module: (() => Promise<RouteExport>) | undefined = undefined;\n let analogMeta: { endpoint: string; endpointKey: string } | undefined =\n undefined;\n\n if (rawRoute.filename) {\n const isMarkdownFile = rawRoute.filename.endsWith('.md');\n\n if (!debug) {\n module = isMarkdownFile\n ? toMarkdownModule(files[rawRoute.filename] as () => Promise<string>)\n : (files[rawRoute.filename] as () => Promise<RouteExport>);\n }\n\n const endpointKey = rawRoute.filename.replace(\n /\\.page\\.(ts|analog|ag)$/,\n ENDPOINT_EXTENSION,\n );\n\n // get endpoint path\n const rawEndpoint = rawRoute.filename\n .replace(/\\.page\\.(ts|analog|ag)$/, '')\n .replace(/\\[\\[\\.\\.\\..+\\]\\]/, '**')\n .replace(/\\[\\.{3}.+\\]/, '**') // [...not-found] => **\n .replace(/^(.*?)\\/pages/, '/pages');\n\n // replace periods, remove (index) paths\n const endpoint = (rawEndpoint || '')\n .replace(/\\./g, '/')\n .replace(/\\/\\((.*?)\\)$/, '/-$1-');\n\n analogMeta = {\n endpoint,\n endpointKey,\n };\n }\n\n // Detect Next.js-style optional catch-all at this node: [[...param]]\n const optCatchAllMatch = rawRoute.filename?.match(/\\[\\[\\.\\.\\.([^\\]]+)\\]\\]/);\n const optCatchAllParam = optCatchAllMatch ? optCatchAllMatch[1] : null;\n\n type DebugRoute = Route & {\n filename?: string | null | undefined;\n isLayout?: boolean;\n };\n\n const route: Route & { meta?: typeof analogMeta } & DebugRoute = module\n ? {\n path: rawRoute.segment,\n loadChildren: () =>\n module!().then((m) => {\n if (import.meta.env.DEV) {\n const hasModuleDefault = !!m.default;\n const hasRedirect = !!m.routeMeta?.redirectTo;\n\n if (!hasModuleDefault && !hasRedirect) {\n console.warn(\n `[Analog] Missing default export at ${rawRoute.filename}`,\n );\n }\n }\n\n const baseChild = {\n path: '',\n component: m.default,\n ...toRouteConfig(m.routeMeta as RouteMeta | undefined),\n children,\n [ANALOG_META_KEY]: analogMeta,\n };\n\n // Base route first so static matches win, then optional catch-all matcher\n return [\n {\n ...baseChild,\n },\n ...(optCatchAllParam\n ? [\n {\n matcher:\n createOptionalCatchAllMatcher(optCatchAllParam),\n component: m.default,\n ...toRouteConfig(m.routeMeta as RouteMeta | undefined),\n [ANALOG_META_KEY]: analogMeta,\n },\n ]\n : []),\n ];\n }),\n }\n : {\n path: rawRoute.segment,\n ...(debug\n ? {\n filename: rawRoute.filename ? rawRoute.filename : undefined,\n isLayout: children && children.length > 0 ? true : false,\n }\n : {}),\n children,\n };\n\n routes.push(route);\n }\n\n return routes;\n}\n\nfunction sortRawRoutes(rawRoutes: RawRoute[]): void {\n rawRoutes.sort((a, b) => {\n let segmentA = deprioritizeSegment(a.segment);\n let segmentB = deprioritizeSegment(b.segment);\n\n // prioritize routes with fewer children\n if (a.children.length > b.children.length) {\n segmentA = `~${segmentA}`;\n } else if (a.children.length < b.children.length) {\n segmentB = `~${segmentB}`;\n }\n\n return segmentA > segmentB ? 1 : -1;\n });\n\n for (const rawRoute of rawRoutes) {\n sortRawRoutes(rawRoute.children);\n }\n}\n\nfunction deprioritizeSegment(segment: string): string {\n // deprioritize param and wildcard segments\n return segment.replace(':', '~~').replace('**', '~~~~');\n}\n\nexport const routes: Route[] = createRoutes({\n ...ANALOG_ROUTE_FILES,\n ...ANALOG_CONTENT_ROUTE_FILES,\n});\n","import { inject } from '@angular/core';\nimport { Route as NgRoute, Router } from '@angular/router';\nimport { ActivatedRoute } from '@angular/router';\n\ntype RouteOmitted =\n | 'component'\n | 'loadComponent'\n | 'loadChildren'\n | 'path'\n | 'pathMatch';\n\ntype RestrictedRoute = Omit<NgRoute, RouteOmitted>;\n\n/**\n * @deprecated Use `RouteMeta` type instead.\n * For more info see: https://github.com/analogjs/analog/issues/223\n *\n * Defines additional route config metadata. This\n * object is merged into the route config with\n * the predefined file-based route.\n *\n * @usageNotes\n *\n * ```\n * import { Component } from '@angular/core';\n * import { defineRouteMeta } from '@analogjs/router';\n *\n * export const routeMeta = defineRouteMeta({\n * title: 'Welcome'\n * });\n *\n * @Component({\n * template: `Home`,\n * standalone: true,\n * })\n * export default class HomeComponent {}\n * ```\n *\n * @param route\n * @returns\n */\nexport const defineRouteMeta = (route: RestrictedRoute) => {\n return route;\n};\n\n/**\n * Returns the instance of Angular Router\n *\n * @returns The router\n */\nexport const injectRouter = () => {\n return inject(Router);\n};\n\n/**\n * Returns the instance of the Activate Route for the component\n *\n * @returns The activated route\n */\nexport const injectActivatedRoute = () => {\n return inject(ActivatedRoute);\n};\n","import { isPlatformServer } from '@angular/common';\nimport { HttpHandlerFn, HttpHeaders, HttpRequest } from '@angular/common/http';\nimport { PLATFORM_ID, inject } from '@angular/core';\nimport { injectRequest } from '@analogjs/router/tokens';\n\nexport function cookieInterceptor(\n req: HttpRequest<unknown>,\n next: HttpHandlerFn,\n location = inject(PLATFORM_ID),\n serverRequest = injectRequest(),\n) {\n if (isPlatformServer(location) && req.url.includes('/_analog/')) {\n let headers = new HttpHeaders();\n const cookies = serverRequest?.headers.cookie;\n headers = headers.set('cookie', cookies ?? '');\n\n const cookiedRequest = req.clone({\n headers,\n });\n\n return next(cookiedRequest);\n } else {\n return next(req);\n }\n}\n","import {\n ENVIRONMENT_INITIALIZER,\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport { provideRouter, RouterFeatures, ROUTES, Routes } from '@angular/router';\nimport { API_PREFIX } from '@analogjs/router/tokens';\nimport { ɵHTTP_ROOT_INTERCEPTOR_FNS as HTTP_ROOT_INTERCEPTOR_FNS } from '@angular/common/http';\n\nimport { routes } from './routes';\nimport { updateMetaTagsOnRouteChange } from './meta-tags';\nimport { cookieInterceptor } from './cookie-interceptor';\n\ndeclare const ANALOG_API_PREFIX: string;\n\n/**\n * Sets up providers for the Angular router, and registers\n * file-based routes. Additional features can be provided\n * to further configure the behavior of the router.\n *\n * @param features\n * @returns Providers and features to configure the router with routes\n */\nexport function provideFileRouter(\n ...features: RouterFeatures[]\n): EnvironmentProviders {\n const extraRoutesFeature = features.filter((feat) => feat.ɵkind >= 100);\n const routerFeatures = features.filter((feat) => feat.ɵkind < 100);\n\n return makeEnvironmentProviders([\n extraRoutesFeature.map((erf) => erf.ɵproviders),\n provideRouter(routes, ...routerFeatures),\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: () => updateMetaTagsOnRouteChange(),\n },\n {\n provide: HTTP_ROOT_INTERCEPTOR_FNS,\n multi: true,\n useValue: cookieInterceptor,\n },\n {\n provide: API_PREFIX,\n useFactory() {\n return typeof ANALOG_API_PREFIX !== 'undefined'\n ? ANALOG_API_PREFIX\n : 'api';\n },\n },\n ]);\n}\n\n/**\n * Provides extra custom routes in addition to the routes\n * discovered from the filesystem-based routing. These routes are\n * inserted before the filesystem-based routes, and take priority in\n * route matching.\n */\nexport function withExtraRoutes(routes: Routes): RouterFeatures {\n return {\n ɵkind: 100 as number,\n ɵproviders: [{ provide: ROUTES, useValue: routes, multi: true }],\n };\n}\n","import { Injector, inject } from '@angular/core';\nimport { ActivatedRoute, Data } from '@angular/router';\nimport { Observable, map } from 'rxjs';\n\nimport { PageServerLoad } from './route-types';\n\nexport function injectLoad<\n T extends (pageServerLoad: PageServerLoad) => Promise<any>,\n>(options?: { injector?: Injector }): Observable<Awaited<ReturnType<T>>> {\n const injector = options?.injector ?? inject(Injector);\n const route = injector.get(ActivatedRoute);\n\n return route.data.pipe(\n map<Data, Awaited<ReturnType<T>>>((data) => data['load']),\n );\n}\n","import { ActivatedRouteSnapshot } from '@angular/router';\n\n/**\n * Get server load resolver data for the route\n *\n * @param route Provides the route to get server load resolver\n * @returns Returns server load resolver data for the route\n */\nexport async function getLoadResolver<T>(\n route: ActivatedRouteSnapshot,\n): Promise<T> {\n return route.routeConfig?.resolve?.['load']?.(route);\n}\n","import { HttpParams, HttpRequest } from '@angular/common/http';\nimport { StateKey, makeStateKey } from '@angular/core';\n\nfunction sortAndConcatParams(params: HttpParams | URLSearchParams): string {\n return [...params.keys()]\n .sort()\n .map((k) => `${k}=${params.getAll(k)}`)\n .join('&');\n}\n\nexport function makeCacheKey(\n request: HttpRequest<any>,\n mappedRequestUrl: string,\n): StateKey<unknown> {\n // make the params encoded same as a url so it's easy to identify\n const { params, method, responseType } = request;\n const encodedParams = sortAndConcatParams(params);\n\n let serializedBody = request.serializeBody();\n if (serializedBody instanceof URLSearchParams) {\n serializedBody = sortAndConcatParams(serializedBody);\n } else if (typeof serializedBody !== 'string') {\n serializedBody = '';\n }\n\n const key = [\n method,\n responseType,\n mappedRequestUrl,\n serializedBody,\n encodedParams,\n ].join('|');\n\n const hash = generateHash(key);\n\n return makeStateKey(hash);\n}\n\nfunction generateHash(str: string) {\n let hash = 0;\n for (let i = 0, len = str.length; i < len; i++) {\n let chr = str.charCodeAt(i);\n hash = (hash << 5) - hash + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return `${hash}`;\n}\n","import { TransferState, inject, makeStateKey } from '@angular/core';\nimport {\n HttpHandlerFn,\n HttpHeaders,\n HttpRequest,\n HttpResponse,\n} from '@angular/common/http';\n\nimport { from, of } from 'rxjs';\n\nimport { injectBaseURL, injectAPIPrefix } from '@analogjs/router/tokens';\n\nimport { makeCacheKey } from './cache-key';\n\n/**\n * Interceptor that is server-aware when making HttpClient requests.\n * Server-side requests use the full URL\n * Prerendering uses the internal Nitro $fetch function, along with state transfer\n * Client-side requests use the window.location.origin\n *\n * @param req HttpRequest<unknown>\n * @param next HttpHandlerFn\n * @returns\n */\nexport function requestContextInterceptor(\n req: HttpRequest<unknown>,\n next: HttpHandlerFn,\n) {\n const apiPrefix = injectAPIPrefix();\n const baseUrl = injectBaseURL();\n const transferState = inject(TransferState);\n\n // during prerendering with Nitro\n if (\n typeof global !== 'undefined' &&\n global.$fetch &&\n baseUrl &&\n (req.url.startsWith('/') ||\n req.url.startsWith(baseUrl) ||\n req.url.startsWith(`/${apiPrefix}`))\n ) {\n const requestUrl = new URL(req.url, baseUrl);\n const cacheKey = makeCacheKey(req, new URL(requestUrl).pathname);\n const storeKey = makeStateKey<unknown>(`analog_${cacheKey}`);\n const fetchUrl = requestUrl.pathname;\n\n const responseType =\n req.responseType === 'arraybuffer' ? 'arrayBuffer' : req.responseType;\n\n return from(\n global.$fetch\n .raw(fetchUrl, {\n method: req.method as any,\n body: req.body ? req.body : undefined,\n params: requestUrl.searchParams,\n responseType,\n headers: req.headers.keys().reduce((hdrs, current) => {\n return {\n ...hdrs,\n [current]: req.headers.get(current),\n };\n }, {}),\n })\n .then((res) => {\n const cacheResponse = {\n body: res._data,\n headers: new HttpHeaders(res.headers),\n status: 200,\n statusText: 'OK',\n url: fetchUrl,\n };\n const transferResponse = new HttpResponse(cacheResponse);\n\n transferState.set(storeKey, cacheResponse);\n return transferResponse;\n }),\n );\n }\n\n // on the client\n if (\n !import.meta.env.SSR &&\n (req.url.startsWith('/') || req.url.includes('/_analog/'))\n ) {\n // /_analog/ requests are full URLs\n const requestUrl = req.url.includes('/_analog/')\n ? req.url\n : `${window.location.origin}${req.url}`;\n const cacheKey = makeCacheKey(req, new URL(requestUrl).pathname);\n const storeKey = makeStateKey<unknown>(`analog_${cacheKey}`);\n const cacheRestoreResponse = transferState.get(storeKey, null);\n\n if (cacheRestoreResponse) {\n transferState.remove(storeKey);\n return of(new HttpResponse(cacheRestoreResponse));\n }\n\n return next(\n req.clone({\n url: requestUrl,\n }),\n );\n }\n\n // on the server\n if (baseUrl && (req.url.startsWith('/') || req.url.startsWith(baseUrl))) {\n const requestUrl =\n req.url.startsWith(baseUrl) && !req.url.startsWith('/')\n ? req.url\n : `${baseUrl}${req.url}`;\n\n return next(\n req.clone({\n url: requestUrl,\n }),\n );\n }\n\n return next(req);\n}\n","import { Directive, inject, input, output } from '@angular/core';\nimport { ActivatedRoute, Params, Router } from '@angular/router';\n\nimport { injectRouteEndpointURL } from './inject-route-endpoint-url';\n\n@Directive({\n selector: 'form[action],form[method]',\n host: {\n '(submit)': `submitted($event)`,\n },\n standalone: true,\n})\nexport class FormAction {\n action = input<string>('');\n onSuccess = output<unknown>();\n onError = output<unknown>();\n state = output<\n 'submitting' | 'error' | 'redirect' | 'success' | 'navigate'\n >();\n private router = inject(Router);\n private route = inject(ActivatedRoute);\n private path = this._getPath();\n\n submitted($event: any) {\n $event.preventDefault();\n\n this.state.emit('submitting');\n const body = new FormData($event.target);\n\n if ($event.target.method.toUpperCase() === 'GET') {\n this._handleGet(body, this.router.url);\n } else {\n this._handlePost(body, this.path, $event);\n }\n }\n\n private _handleGet(body: FormData, path: string) {\n const params: Params = {};\n body.forEach((formVal, formKey) => (params[formKey] = formVal));\n\n this.state.emit('navigate');\n const url = path.split('?')[0];\n this.router.navigate([url], {\n queryParams: params,\n onSameUrlNavigation: 'reload',\n });\n }\n\n private _handlePost(\n body: FormData,\n path: string,\n $event: { target: HTMLFormElement } & Event,\n ) {\n fetch(path, {\n method: $event.target.method,\n body,\n })\n .then((res) => {\n if (res.ok) {\n if (res.redirected) {\n const redirectUrl = new URL(res.url).pathname;\n this.state.emit('redirect');\n this.router.navigate([redirectUrl]);\n } else if (this._isJSON(res.headers.get('Content-type'))) {\n res.json().then((result) => {\n this.onSuccess.emit(result);\n this.state.emit('success');\n });\n } else {\n res.text().then((result) => {\n this.onSuccess.emit(result);\n this.state.emit('success');\n });\n }\n } else {\n if (res.headers.get('X-Analog-Errors')) {\n res.json().then((errors: unknown) => {\n this.onError.emit(errors);\n this.state.emit('error');\n });\n } else {\n this.state.emit('error');\n }\n }\n })\n .catch((_) => {\n this.state.emit('error');\n });\n }\n\n private _getPath() {\n if (this.route) {\n return injectRouteEndpointURL(this.route.snapshot).pathname;\n }\n\n return `/api/_analog/pages${window.location.pathname}`;\n }\n\n private _isJSON(contentType: string | null): boolean {\n const mime = contentType ? contentType.split(';') : [];\n const essence = mime[0];\n\n return essence === 'application/json';\n }\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport { Route } from '@angular/router';\n\nimport {\n ANALOG_CONTENT_ROUTE_FILES,\n ANALOG_ROUTE_FILES,\n createRoutes,\n} from '../routes';\n\nexport const DEBUG_ROUTES = new InjectionToken(\n '@analogjs/router debug routes',\n {\n providedIn: 'root',\n factory() {\n const debugRoutes = createRoutes(\n {\n ...ANALOG_ROUTE_FILES,\n ...ANALOG_CONTENT_ROUTE_FILES,\n },\n true,\n );\n\n return debugRoutes as (Route & DebugRoute)[];\n },\n },\n);\n\nexport type DebugRoute = {\n path: string;\n filename: string;\n isLayout: boolean;\n children?: DebugRoute[];\n};\n\nexport function injectDebugRoutes() {\n return inject(DEBUG_ROUTES);\n}\n","import { ROUTES } from '@angular/router';\n\n/**\n * Provides routes that provide additional\n * pages for displaying and debugging\n * routes.\n */\nexport function withDebugRoutes() {\n const routes = [\n {\n path: '__analog/routes',\n loadComponent: () => import('./debug.page'),\n },\n ];\n\n return {\n ɵkind: 101 as number,\n ɵproviders: [{ provide: ROUTES, useValue: routes, multi: true }],\n };\n}\n","import {\n HttpClient,\n HttpHeaders,\n HttpRequest,\n HttpResponse,\n} from '@angular/common/http';\nimport {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n input,\n makeStateKey,\n output,\n signal,\n TransferState,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ActivatedRoute } from '@angular/router';\nimport { injectBaseURL } from '@analogjs/router/tokens';\nimport { catchError, map, of, throwError } from 'rxjs';\n\nimport { makeCacheKey } from './cache-key';\n\ntype ServerProps = Record<string, any>;\ntype ServerOutputs = Record<string, any>;\n\n/**\n * @description\n * Component that defines the bridge between the client and server-only\n * components. The component passes the component ID and props to the server\n * and retrieves the rendered HTML and outputs from the server-only component.\n *\n * Status: experimental\n */\n@Component({\n selector: 'server-only,ServerOnly,Server',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: ` <div [innerHTML]=\"content()\"></div> `,\n})\nexport class ServerOnly {\n component = input.required<string>();\n props = input<ServerProps>();\n outputs = output<ServerOutputs>();\n private http = inject(HttpClient);\n private sanitizer = inject(DomSanitizer);\n protected content = signal<SafeHtml>('');\n private route = inject(ActivatedRoute, { optional: true });\n private baseURL = injectBaseURL();\n private transferState = inject(TransferState);\n\n constructor() {\n effect(() => {\n const routeComponentId: string | undefined =\n this.route?.snapshot.data['component'];\n const props = this.props() || {};\n const componentId = routeComponentId || this.component();\n\n const headers = new HttpHeaders(\n new Headers({\n 'Content-type': 'application/json',\n 'X-Analog-Component': componentId,\n }),\n );\n\n const componentUrl = this.getComponentUrl(componentId);\n const httpRequest = new HttpRequest('POST', componentUrl, props, {\n headers,\n });\n const cacheKey = makeCacheKey(\n httpRequest,\n new URL(componentUrl).pathname,\n );\n const storeKey = makeStateKey<{ html: string; outputs: ServerOutputs }>(\n cacheKey,\n );\n const componentState = this.transferState.get<{\n html: string;\n outputs: ServerOutputs;\n } | null>(storeKey, null);\n\n if (componentState) {\n this.updateContent(componentState);\n this.transferState.remove(storeKey);\n } else {\n this.http\n .request(httpRequest)\n .pipe(\n map((response) => {\n if (response instanceof HttpResponse) {\n if (import.meta.env.SSR) {\n this.transferState.set(storeKey, response.body);\n }\n\n return response.body as {\n html: string;\n outputs: ServerOutputs;\n };\n }\n return throwError(\n () => ({}) as { html: string; outputs: ServerOutputs },\n );\n }),\n catchError((error: unknown) => {\n console.log(error);\n return of({\n html: '',\n outputs: {} as ServerOutputs,\n });\n }),\n )\n .subscribe((content) =>\n this.updateContent(\n content as { html: string; outputs: ServerOutputs },\n ),\n );\n }\n });\n }\n\n updateContent(content: { html: string; outputs: ServerOutputs }) {\n this.content.set(this.sanitizer.bypassSecurityTrustHtml(content.html));\n this.outputs.emit(content.outputs);\n }\n\n getComponentUrl(componentId: string) {\n let baseURL = this.baseURL;\n\n if (!baseURL && typeof window !== 'undefined') {\n baseURL = window.location.origin;\n }\n\n return `${baseURL}/_analog/components/${componentId}`;\n }\n}\n","import { InjectionToken, type Injector } from '@angular/core';\n\nimport type { ServerFn } from './types';\n\n/**\n * In-process transport for a server function call.\n *\n * Provided on the server by `provideServerContext`, so during SSR a server\n * function runs in the same process — and the same request injector — as the\n * render instead of making an HTTP request back into the app. Absent in the\n * browser, where `ServerFnClient` falls back to `HttpClient`.\n *\n * `injector` is the **app environment injector** — `ServerFnClient` is\n * `providedIn: 'root'`, and SSR bootstraps a fresh application per request, so\n * its injector is both per-request and the right scope for a handler to resolve\n * from. It is passed rather than captured from the token because\n * `provideServerContext` is applied as *platform* providers, which sit above\n * the app's `providedIn: 'root'` services.\n *\n * Deliberately not a component's node injector: a handler resolves app-level\n * services, and making that depend on which component happened to call it would\n * be surprising and unportable.\n */\nexport type ServerFnDispatcher = <In, Out>(\n fn: ServerFn<In, Out>,\n input: In,\n injector: Injector,\n) => Promise<Out>;\n\nexport const SERVER_FN_DISPATCHER = new InjectionToken<ServerFnDispatcher>(\n '@analogjs/router Server Function Dispatcher',\n);\n","import {\n Injectable,\n Injector,\n assertInInjectionContext,\n inject,\n makeStateKey,\n resource,\n TransferState,\n type ResourceRef,\n} from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { firstValueFrom } from 'rxjs';\n\nimport type { ServerFn } from './types';\nimport { SERVER_FN_DISPATCHER } from './dispatcher';\n\n/**\n * Client transport for server functions. In the browser it goes through Angular\n * `HttpClient`, so client `HttpInterceptorFn`s apply. During SSR the dispatcher\n * token is provided, and the call short-circuits the HTTP round-trip: the\n * handler runs in-process in the current request injector. Lives in the client\n * entry (client-safe).\n */\n@Injectable({ providedIn: 'root' })\nexport class ServerFnClient {\n private readonly http = inject(HttpClient);\n private readonly transferState = inject(TransferState);\n private readonly injector = inject(Injector);\n private readonly dispatcher = inject(SERVER_FN_DISPATCHER, {\n optional: true,\n });\n\n /** True while rendering on the server (the in-process dispatcher is provided). */\n get isServer(): boolean {\n return !!this.dispatcher;\n }\n\n async call<In, Out>(fn: ServerFn<In, Out>, input: In): Promise<Out> {\n if (this.dispatcher) {\n return this.dispatcher(fn, input, this.injector);\n }\n\n const request$ =\n fn.method === 'GET'\n ? this.http.get<Out>(fn.url)\n : this.http.post<Out>(fn.url, input ?? {});\n return firstValueFrom(request$);\n }\n\n /** Key a read's value for TransferState hydration (fn id + input). */\n stateKey<Out>(fn: ServerFn<unknown, Out>, input: unknown) {\n return makeStateKey<Out>(`__analog_fn_${fn.id}_${stableInput(input)}`);\n }\n\n readSeed<Out>(fn: ServerFn<unknown, Out>, input: unknown): Out | undefined {\n const key = this.stateKey(fn, input);\n if (this.transferState.hasKey(key)) {\n const value = this.transferState.get(key, undefined as unknown as Out);\n this.transferState.remove(key); // single-use\n return value;\n }\n return undefined;\n }\n\n writeSeed<Out>(fn: ServerFn<unknown, Out>, input: unknown, value: Out): void {\n this.transferState.set(this.stateKey(fn, input), value);\n }\n}\n\n/** No-op provider hook; ServerFnClient is `providedIn: 'root'`. */\nexport function provideServerFnClient() {\n return [] as const;\n}\n\n// Stable sentinel for the input-less read: `resource()` treats an `undefined`\n// params value as \"idle, don't load\", so an input-less read must yield a\n// defined-but-ignored params. It is never sent — the call uses `undefined`.\nconst NO_INPUT = Symbol('analog.serverFn.noInput');\n\n/**\n * Reactive read of a server function as an Angular `resource()`.\n *\n * `args` is optional: omit it for an input-less read (the resource loads once);\n * provide it for an input-bearing read (returning `undefined` from `args` leaves\n * the resource idle until inputs are ready, the standard resource pattern). For\n * imperative calls (mutations, event handlers) use `injectServerFnMutation`.\n */\nexport function injectServerFn<Out>(\n fn: ServerFn<void, Out>,\n): ResourceRef<Out | undefined>;\nexport function injectServerFn<In, Out>(\n fn: ServerFn<In, Out>,\n args: () => In | undefined,\n): ResourceRef<Out | undefined>;\nexport function injectServerFn<In, Out>(\n fn: ServerFn<In, Out>,\n args?: () => In | undefined,\n): ResourceRef<Out | undefined> {\n assertInInjectionContext(injectServerFn);\n const client = inject(ServerFnClient);\n\n return resource<Out | undefined, unknown>({\n params: () => (args ? args() : NO_INPUT),\n loader: async ({ params }) => {\n const input = (params === NO_INPUT ? undefined : params) as In;\n // Hydrate from the SSR seed on first client render; else fetch and (on\n // the server) seed for the client.\n const seeded = client.readSeed(fn as ServerFn<unknown, Out>, input);\n if (seeded !== undefined) return seeded;\n const value = await client.call(fn, input);\n if (client.isServer) {\n client.writeSeed(fn as ServerFn<unknown, Out>, input, value);\n }\n return value;\n },\n });\n}\n\n/**\n * Imperative binding of a server function: returns a callable that dispatches\n * the call through `HttpClient` (so client interceptors apply) and resolves the\n * result. Use for mutations and event-driven calls; use `injectServerFn` for\n * reactive reads.\n */\nexport function injectServerFnMutation<In, Out>(\n fn: ServerFn<In, Out>,\n): (input: In) => Promise<Out> {\n assertInInjectionContext(injectServerFnMutation);\n const client = inject(ServerFnClient);\n return (input: In) => client.call(fn, input);\n}\n\nfunction stableInput(input: unknown): string {\n if (input === undefined || input === null) return '_';\n return JSON.stringify(input);\n}\n","import type { ServerFn, ServerFnMethod } from './types';\n\nexport interface ServerFnRefConfig {\n id?: string;\n method?: ServerFnMethod;\n /**\n * Only its presence matters here: when `method` is omitted, a config with an\n * `input` schema defaults to `POST`, otherwise `GET`. The schema itself is\n * never used to build the ref — validation happens server-side.\n */\n input?: unknown;\n}\n\n/**\n * Builds a server-function reference: the client-safe `{ __serverFn, id, url,\n * method }` metadata that `injectServerFn`/`ServerFnClient` dispatch through.\n *\n * Shared by both sides so they produce identical refs: the server `serverFn`\n * wraps this with registration + the handler, and the client build's scrub\n * transform emits a call to this factory in place of the server module so the\n * browser bundle carries only the ref, never the handler or its server imports.\n *\n * The returned value is callable-typed but throws if invoked directly — it is\n * always dispatched via `injectServerFn`/`ServerFnClient`, never called.\n */\nexport function createServerFnRef<In, Out>(\n config: ServerFnRefConfig,\n): ServerFn<In, Out> {\n if (!config.id) {\n throw new Error(\n '[analog] serverFn is missing its build-derived id. Server functions require the Analog build transform (@analogjs/platform / @analogjs/vite-plugin-nitro); a raw import without it is not supported.',\n );\n }\n const method: ServerFnMethod =\n config.method ?? (config.input ? 'POST' : 'GET');\n const url = `/_analog/fn/${config.id}`;\n\n const ref = (() => {\n throw new Error(\n `serverFn \"${config.id}\" must be called via injectServerFn/ServerFnClient`,\n );\n }) as unknown as ServerFn<In, Out>;\n\n return Object.assign(ref, {\n __serverFn: true as const,\n id: config.id,\n url,\n method,\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["HTTP_ROOT_INTERCEPTOR_FNS"],"mappings":";;;;;;;;;;AAKO,MAAM,mBAAmB,GAAG,MAAM,CACvC,sCAAsC,CACvC;AAED,MAAM,WAAW,GAAG,SAAS;AAC7B,MAAM,cAAc,GAAG,WAAW;AAClC;AACA,MAAM,uBAAuB,GAAG,YAAY;AAC5C,MAAM,QAAQ,GAAG,MAAM;AACvB,MAAM,YAAY,GAAG,UAAU;AAC/B,MAAM,WAAW,GAAG,SAAS;AAC7B,MAAM,YAAY,GAAG,UAAU;SAkCf,2BAA2B,GAAA;AACzC,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC7B,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC;AAEhC,IAAA,MAAM,CAAC;AACJ,SAAA,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,YAAY,aAAa,CAAC;SACtD,SAAS,CAAC,MAAK;AACd,QAAA,MAAM,UAAU,GAAG,aAAa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AG;QACH,MAAM;AACP,KAAA,CAAC;AACJ;;ACjDA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@analogjs/router",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0-beta.1",
|
|
4
4
|
"description": "Filesystem-based routing for Angular",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Roberts <robertsbt@gmail.com>",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/sponsors/brandonroberts"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@analogjs/content": "^2.
|
|
27
|
+
"@analogjs/content": "^2.7.0-beta.1",
|
|
28
28
|
"@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|
|
29
29
|
"@angular/router": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0"
|
|
30
30
|
},
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { StaticProvider, ApplicationConfig, Type, Provider } from '@angular/core';
|
|
1
|
+
import { StaticProvider, ApplicationConfig, Type, Provider, Injector, InjectionToken } from '@angular/core';
|
|
2
2
|
import { ServerRequest, ServerResponse, ServerContext } from '@analogjs/router/tokens';
|
|
3
|
+
import { ServerFnHandler, ServerFn, StandardSchemaV1, ServerFnConfig, ServerFnContext, ServerFnDef } from '@analogjs/router';
|
|
4
|
+
export { ServerFn, ServerFnConfig, ServerFnContext, ServerFnHandler, ServerFnMethod, StandardSchemaV1 } from '@analogjs/router';
|
|
5
|
+
import * as h3 from 'h3';
|
|
6
|
+
import { H3Event } from 'h3';
|
|
3
7
|
|
|
4
8
|
declare function provideServerContext({ req, res, }: {
|
|
5
9
|
req: ServerRequest;
|
|
@@ -25,4 +29,214 @@ declare function renderServerComponent(url: string, serverContext: ServerContext
|
|
|
25
29
|
*/
|
|
26
30
|
declare function render(rootComponent: Type<unknown>, config: ApplicationConfig, platformProviders?: Provider[]): (url: string, document: string, serverContext: ServerContext) => Promise<string | Response>;
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Define a server function. Authored in a `*.server.ts` module.
|
|
34
|
+
*
|
|
35
|
+
* Three call shapes, chosen for ergonomics — they all normalize to the same
|
|
36
|
+
* `(config, handler)` form and the build transform derives the route id for each:
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* serverFn(() => inject(Svc).list()); // input-less GET
|
|
40
|
+
* serverFn(schema, (input) => …); // schema ⇒ POST + input
|
|
41
|
+
* serverFn({ method: 'POST' }, () => …); // explicit config
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* On the server the function self-registers and its handler runs via
|
|
45
|
+
* `dispatchServerFn`. On the client the build transform replaces the body with a
|
|
46
|
+
* proxy that calls `/_analog/fn/<id>`; the reference still carries
|
|
47
|
+
* `id`/`url`/`method` so `injectServerFn`/`ServerFnClient` can dispatch.
|
|
48
|
+
*/
|
|
49
|
+
declare function serverFn<Out>(handler: ServerFnHandler<void, Out>): ServerFn<void, Out>;
|
|
50
|
+
declare function serverFn<In, Out>(input: StandardSchemaV1<In>, handler: ServerFnHandler<In, Out>): ServerFn<In, Out>;
|
|
51
|
+
declare function serverFn<In, Out>(config: ServerFnConfig<In>, handler: ServerFnHandler<In, Out>): ServerFn<In, Out>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Builds the parent injector the server-function dispatch endpoint runs handlers
|
|
55
|
+
* against, over HTTP.
|
|
56
|
+
*
|
|
57
|
+
* A plain `Injector.create({ providers })` resolves explicitly-listed providers
|
|
58
|
+
* but not tree-shakeable `providedIn: 'root'` services — those attach to a
|
|
59
|
+
* *bootstrapped* application's root injector, which `Injector.create` is not.
|
|
60
|
+
* So the in-process SSR leg (whose parent is the app's own bootstrapped
|
|
61
|
+
* injector) resolved `root` services while the HTTP leg did not — the same
|
|
62
|
+
* handler could work while rendering and fail when called from the browser.
|
|
63
|
+
*
|
|
64
|
+
* Bootstrapping a real application on the server platform closes that gap: the
|
|
65
|
+
* returned `appRef.injector` is a root environment injector, so both listed
|
|
66
|
+
* providers and `providedIn: 'root'` services resolve, matching SSR.
|
|
67
|
+
*
|
|
68
|
+
* The generated endpoint passes the app's own server `ApplicationConfig` (the
|
|
69
|
+
* one `main.server.ts` renders with), so a handler sees exactly the DI the app
|
|
70
|
+
* configured — services, tokens, and interceptors alike — with no second
|
|
71
|
+
* provider list to keep in sync. No root component is bootstrapped
|
|
72
|
+
* (`createApplication`, not `bootstrapApplication`), so nothing renders, no
|
|
73
|
+
* change detection runs, and the router registers but never navigates. It is a
|
|
74
|
+
* DI container with the app's providers, built once and reused for the process,
|
|
75
|
+
* with only `REQUEST`/`RESPONSE` rebuilt per call in the child.
|
|
76
|
+
*
|
|
77
|
+
* A bare provider array is also accepted (direct callers and tests without an
|
|
78
|
+
* app config); it is wrapped with `provideServerRendering` so the server tokens
|
|
79
|
+
* resolve the same way.
|
|
80
|
+
*/
|
|
81
|
+
declare function createServerFnAppInjector(configOrProviders?: ApplicationConfig | StaticProvider[]): Promise<Injector>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The h3 request/response layer for the server-function dispatch route.
|
|
85
|
+
*
|
|
86
|
+
* `createServerFnAppInjector` bootstraps the parent injector once; this wraps
|
|
87
|
+
* that in the `/_analog/fn/:id` handler the Nitro build registers. Kept as a
|
|
88
|
+
* runtime function (rather than inlined into the generated module) so the
|
|
89
|
+
* transport behaviour — body decoding, the malformed-body contract, and header
|
|
90
|
+
* propagation — is unit-tested directly instead of by matching generated source.
|
|
91
|
+
*
|
|
92
|
+
* `appInjector` may be a promise: the generated module bootstraps the app at
|
|
93
|
+
* import time and passes the pending injector, which is awaited on first request
|
|
94
|
+
* and resolved instantly thereafter.
|
|
95
|
+
*/
|
|
96
|
+
declare function createServerFnEventHandler(appInjector: Injector | Promise<Injector>): h3.EventHandler<h3.EventHandlerRequest, Promise<unknown>>;
|
|
97
|
+
/**
|
|
98
|
+
* Decode a server-function request, dispatch it, and write the result to the
|
|
99
|
+
* h3 response. Same-origin, method, content-type, validation, and interceptors
|
|
100
|
+
* are enforced inside `dispatchServerFn`; this owns only the h3 I/O around it.
|
|
101
|
+
*/
|
|
102
|
+
declare function handleServerFnRequest(event: H3Event, appInjector: Injector | Promise<Injector>): Promise<unknown>;
|
|
103
|
+
|
|
104
|
+
interface DispatchResult {
|
|
105
|
+
status: number;
|
|
106
|
+
body: unknown;
|
|
107
|
+
/**
|
|
108
|
+
* Headers from a returned `Response` (`fail`/`redirect`): Location, … The
|
|
109
|
+
* value is an array when the header legitimately repeats, which is why
|
|
110
|
+
* `Set-Cookie` is read separately below — collapsing several cookies into one
|
|
111
|
+
* comma-joined value corrupts them.
|
|
112
|
+
*/
|
|
113
|
+
headers?: Record<string, string | string[]>;
|
|
114
|
+
}
|
|
115
|
+
interface DispatchServerFnOptions {
|
|
116
|
+
/**
|
|
117
|
+
* The app's environment injector. The per-request injector is created as its
|
|
118
|
+
* child, so handlers resolve app services (and `providedIn: 'root'` services,
|
|
119
|
+
* when this is the app's bootstrapped injector) and registered interceptors
|
|
120
|
+
* without re-listing them per request.
|
|
121
|
+
*/
|
|
122
|
+
parent?: Injector;
|
|
123
|
+
/** Extra per-request providers, for direct callers without an app injector. */
|
|
124
|
+
providers?: StaticProvider[];
|
|
125
|
+
/** Request HTTP method; enforced against the function's configured method. */
|
|
126
|
+
method?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Origins permitted beyond same-origin, merged with any registered through DI
|
|
129
|
+
* (`provideServerFns(withAllowedOrigins([...]))`). The transport is
|
|
130
|
+
* same-origin by default (cross-origin browser calls are rejected with 403);
|
|
131
|
+
* `'*'` disables the check entirely. Only consulted for HTTP-transport calls
|
|
132
|
+
* (those that pass `method`).
|
|
133
|
+
*/
|
|
134
|
+
allowedOrigins?: string[];
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Server-side dispatch for a server function call.
|
|
138
|
+
*
|
|
139
|
+
* 1. reject cross-origin browser calls (403), unless allow-listed — HTTP
|
|
140
|
+
* transport only (in-process callers omit `method` and are exempt)
|
|
141
|
+
* 2. look up the function by id
|
|
142
|
+
* 3. enforce the configured HTTP method (405 on mismatch)
|
|
143
|
+
* 4. require a JSON body on input-bearing calls (415 otherwise)
|
|
144
|
+
* 5. validate `input` against the Standard-Schema (4xx on failure)
|
|
145
|
+
* 6. build a per-request injector (REQUEST/RESPONSE + app providers)
|
|
146
|
+
* 7. run the interceptor chain, then the handler, re-entering
|
|
147
|
+
* `runInInjectionContext` at every hop so `inject()` works even after an
|
|
148
|
+
* interceptor `await`s before calling `next`
|
|
149
|
+
* 8. a `Response` returned by an interceptor/handler (`fail`/`redirect`)
|
|
150
|
+
* short-circuits with its status AND headers
|
|
151
|
+
*
|
|
152
|
+
* `options.method` is the request's HTTP method; when provided it is enforced
|
|
153
|
+
* against the function's configured method AND it turns on the same-origin
|
|
154
|
+
* guard. Transports (the generated Nitro handler) always pass it; trusted
|
|
155
|
+
* in-process callers may omit it, which also exempts them from the origin guard.
|
|
156
|
+
*/
|
|
157
|
+
declare function dispatchServerFn(id: string, rawInput: unknown, event: Pick<H3Event, 'node'>, options?: DispatchServerFnOptions): Promise<DispatchResult>;
|
|
158
|
+
|
|
159
|
+
/** Context threaded through the interceptor chain and handed to the handler. */
|
|
160
|
+
interface ServerFnInterceptorContext {
|
|
161
|
+
readonly input: unknown;
|
|
162
|
+
readonly context: ServerFnContext;
|
|
163
|
+
/** Return a new context with additional typed fields merged in. */
|
|
164
|
+
with(patch: Partial<ServerFnContext> & Record<string, unknown>): ServerFnInterceptorContext;
|
|
165
|
+
}
|
|
166
|
+
type ServerFnNext = (ctx: ServerFnInterceptorContext) => Promise<unknown>;
|
|
167
|
+
/** Functional interceptor, modeled on `HttpInterceptorFn`. */
|
|
168
|
+
type ServerFnInterceptorFn = (ctx: ServerFnInterceptorContext, next: ServerFnNext) => Promise<unknown> | unknown;
|
|
169
|
+
declare const SERVER_FN_INTERCEPTORS: InjectionToken<ServerFnInterceptorFn[]>;
|
|
170
|
+
interface ServerFnsFeature {
|
|
171
|
+
providers: Provider[];
|
|
172
|
+
}
|
|
173
|
+
/** `withServerFnInterceptors([...])` — registers the chain (DI, ordered). */
|
|
174
|
+
declare function withServerFnInterceptors(interceptors: ServerFnInterceptorFn[]): ServerFnsFeature;
|
|
175
|
+
/** `provideServerFns(withServerFnInterceptors(...))` — mirrors provideHttpClient. */
|
|
176
|
+
declare function provideServerFns(...features: ServerFnsFeature[]): Provider[];
|
|
177
|
+
/**
|
|
178
|
+
* Run the interceptor chain, then the handler, threading the context.
|
|
179
|
+
*
|
|
180
|
+
* `runInCtx` re-establishes the DI injection context around each interceptor
|
|
181
|
+
* and the handler individually. This is what keeps `inject()` working in a
|
|
182
|
+
* handler even when an upstream interceptor `await`s before calling `next`
|
|
183
|
+
* (which would otherwise resume outside Angular's synchronous injection
|
|
184
|
+
* context). It defaults to a pass-through for non-DI callers/tests.
|
|
185
|
+
*/
|
|
186
|
+
declare function runInterceptors(interceptors: ServerFnInterceptorFn[], input: unknown, handler: (input: unknown, context: ServerFnContext) => Promise<unknown> | unknown, runInCtx?: <T>(fn: () => T) => T): Promise<unknown>;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Same-origin enforcement for the server-function HTTP transport.
|
|
190
|
+
*
|
|
191
|
+
* Server functions are same-origin RPC: a client proxy only ever calls the
|
|
192
|
+
* relative `/_analog/fn/:id` URL of its own app. A cross-origin page must not be
|
|
193
|
+
* able to invoke them against a logged-in user (a CSRF-shaped attack), so the
|
|
194
|
+
* transport rejects browser requests whose origin is not the app's own — out of
|
|
195
|
+
* the box, with no per-app configuration.
|
|
196
|
+
*
|
|
197
|
+
* The signals used (`Sec-Fetch-Site`, `Origin`) are added by the browser and
|
|
198
|
+
* cannot be forged by a cross-origin page's `fetch`. Non-browser callers (curl,
|
|
199
|
+
* server-to-server, SSR in-process) send neither, so they are unaffected: the
|
|
200
|
+
* guard blocks the cross-origin browser attack it is meant to, and nothing else.
|
|
201
|
+
*/
|
|
202
|
+
|
|
203
|
+
/** Node/h3 header bag shape (`IncomingHttpHeaders`). */
|
|
204
|
+
type HeaderBag = Record<string, string | string[] | undefined>;
|
|
205
|
+
/**
|
|
206
|
+
* Origins permitted beyond the app's own, registered through DI:
|
|
207
|
+
* `provideServerFns(withAllowedOrigins([...]))`. Empty by default — the
|
|
208
|
+
* transport is same-origin unless an app opts out explicitly.
|
|
209
|
+
*/
|
|
210
|
+
declare const SERVER_FN_ALLOWED_ORIGINS: InjectionToken<string[]>;
|
|
211
|
+
/**
|
|
212
|
+
* `withAllowedOrigins([...])` — permit cross-origin browser calls from the
|
|
213
|
+
* listed origins, or pass `'*'` to disable the same-origin guard entirely.
|
|
214
|
+
* Server functions are frequently cookie-authenticated, so this is an explicit
|
|
215
|
+
* opt-out of CSRF protection: allow-list the exact origins you control.
|
|
216
|
+
*/
|
|
217
|
+
declare function withAllowedOrigins(origins: string[]): ServerFnsFeature;
|
|
218
|
+
/**
|
|
219
|
+
* Whether an HTTP request to a server function may proceed.
|
|
220
|
+
*
|
|
221
|
+
* Allowed when the request is same-origin, carries no browser-origin signal at
|
|
222
|
+
* all (a non-browser client, or a same-origin GET that omits `Origin`), or its
|
|
223
|
+
* `Origin` is listed in `allowedOrigins`. Passing `'*'` in `allowedOrigins`
|
|
224
|
+
* disables the check — the explicit opt-in to cross-origin access.
|
|
225
|
+
*
|
|
226
|
+
* `Sec-Fetch-Site` is the authoritative signal when present: `same-origin` and
|
|
227
|
+
* `none` (a direct navigation, not a cross-site fetch) pass; `same-site` and
|
|
228
|
+
* `cross-site` require an explicit `allowedOrigins` entry. When the header is
|
|
229
|
+
* absent (older browsers, some proxies) the `Origin` host is compared to the
|
|
230
|
+
* request host as a fallback.
|
|
231
|
+
*/
|
|
232
|
+
declare function isServerFnOriginAllowed(headers: HeaderBag, allowedOrigins?: readonly string[]): boolean;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Server-side registry of server functions, keyed by id. A `.server.ts` module
|
|
236
|
+
* populates it as a side effect of `serverFn(...)` running at import time; the
|
|
237
|
+
* Nitro dispatch route imports those modules to fill it, then looks up by id.
|
|
238
|
+
*/
|
|
239
|
+
declare const serverFnRegistry: Map<string, ServerFnDef>;
|
|
240
|
+
|
|
241
|
+
export { SERVER_FN_ALLOWED_ORIGINS, SERVER_FN_INTERCEPTORS, createServerFnAppInjector, createServerFnEventHandler, dispatchServerFn, handleServerFnRequest, injectStaticOutputs, injectStaticProps, isServerFnOriginAllowed, provideServerContext, provideServerFns, render, renderServerComponent, runInterceptors, serverComponentRequest, serverFn, serverFnRegistry, withAllowedOrigins, withServerFnInterceptors };
|
|
242
|
+
export type { DispatchResult, DispatchServerFnOptions, HeaderBag, ServerFnInterceptorContext, ServerFnInterceptorFn, ServerFnNext, ServerFnsFeature };
|