@redocly/redoc-reef 0.134.0-next.1 → 0.134.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/client/app/utils/loadAndNavigate.js +1 -1
  3. package/dist/client/providers/hooks.js +1 -1
  4. package/dist/client/templates/asyncapi-docs/helpers.d.ts +3 -13
  5. package/dist/compiled/svgo/svgo-node.js +55 -49
  6. package/dist/constants/common.d.ts +1 -0
  7. package/dist/constants/common.js +1 -1
  8. package/dist/markdoc/tags/index.d.ts +30 -0
  9. package/dist/markdoc/types.d.ts +2 -2
  10. package/dist/server/api-routes/run-api-routes-worker.js +1 -1
  11. package/dist/server/config/env-config.d.ts +6 -0
  12. package/dist/server/config/env-schema.d.ts +149 -2
  13. package/dist/server/config/env-schema.js +1 -1
  14. package/dist/server/config/env-schemas/feature-flags.d.ts +12 -0
  15. package/dist/server/config/env-schemas/feature-flags.js +1 -1
  16. package/dist/server/constants/feedback.d.ts +2 -0
  17. package/dist/server/constants/feedback.js +1 -1
  18. package/dist/server/plugins/markdown/attribute-resolvers/resolve-link.js +1 -1
  19. package/dist/server/plugins/markdown/search/create-render-tag-fn.d.ts +4 -0
  20. package/dist/server/plugins/markdown/search/create-render-tag-fn.js +1 -0
  21. package/dist/server/plugins/markdown/search/get-ai-search-documents.js +7 -8
  22. package/dist/server/plugins/markdown/search/join-section-content.d.ts +3 -0
  23. package/dist/server/plugins/markdown/search/join-section-content.js +2 -0
  24. package/dist/server/plugins/markdown/search/nodes/heading-node.d.ts +1 -7
  25. package/dist/server/plugins/markdown/search/nodes/section-node.d.ts +2 -14
  26. package/dist/server/plugins/markdown/search/nodes/section-node.js +1 -1
  27. package/dist/server/plugins/markdown/search/nodes/tag-node.d.ts +1 -7
  28. package/dist/server/plugins/markdown/search/walk-sections.d.ts +3 -1
  29. package/dist/server/plugins/markdown/search/walk-sections.js +1 -1
  30. package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.d.ts +2 -2
  31. package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.js +30 -30
  32. package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.js +3 -1
  33. package/dist/server/store.d.ts +2 -34
  34. package/dist/server/types/plugins/common.d.ts +5 -0
  35. package/dist/server/types/plugins/markdown.d.ts +3 -0
  36. package/dist/server/utils/is-api-download-link.d.ts +2 -0
  37. package/dist/server/utils/is-api-download-link.js +1 -0
  38. package/dist/server/utils/llmstxt/agent-feedback-llms-footer.d.ts +3 -0
  39. package/dist/server/utils/llmstxt/agent-feedback-llms-footer.js +2 -0
  40. package/dist/server/utils/shared-data.js +1 -1
  41. package/dist/server/web-server/routes/auth.js +1 -1
  42. package/dist/server/web-server/routes/feedback.d.ts +16 -0
  43. package/dist/server/web-server/routes/feedback.js +1 -1
  44. package/dist/server/web-server/utils/feedback-ip.d.ts +2 -0
  45. package/dist/server/web-server/utils/feedback-ip.js +1 -0
  46. package/dist/server/web-server/utils/get-client-ip.d.ts +1 -0
  47. package/dist/server/web-server/utils/get-client-ip.js +1 -1
  48. package/dist/utils/auth/is-auth-route-path.js +1 -0
  49. package/package.json +7 -7
  50. package/dist/client/utils/auth/is-auth-route-path.js +0 -1
  51. /package/dist/{client/utils → utils}/auth/is-auth-route-path.d.ts +0 -0
@@ -1,4 +1,5 @@
1
1
  import { type RedoclyConfig, type UiAccessibleConfig } from '@redocly/config';
2
+ export declare const AUTH_SEGMENT = "_auth";
2
3
  export declare const OPENAPI_DOCS_TEMPLATE_ID = "openapi_docs";
3
4
  export declare const ASYNC_API_DOCS_TEMPLATE_ID = "asyncapi_docs";
4
5
  export declare const GRAPHQL_TEMPLATE_ID = "graphql_docs";
@@ -1 +1 @@
1
- const E="openapi_docs",n="asyncapi_docs",A="graphql_docs",T="/_spec-gql",i="markdoc",O="tags",p="*",L={"*":"read"},C=["openid","email"],R=1440*60,I="anonymous",l="authenticated",S="**",d="Reunite",N="translations.yaml",u="redocly.yaml",P="@redocly/theme",D="@theme",h="/app-data.json",g="/eject-component";var o;(function(t){t.BUILD="build",t.DEVELOP="develop",t.PREPARE="prepare"})(o||(o={}));var e;(function(t){t.RATING="rating",t.SENTIMENT="sentiment",t.COMMENT="comment",t.MOOD="mood",t.PROBLEM="problem",t.SCALE="scale"})(e||(e={}));const a="entityKey",_="entityId",c="entityRelationId",x={CORS_PROXY:"/_api/cors",INFO:"/_info",EJECT_COMPONENT:"/eject-component/:componentName",SHARED_PAGE_DATA:"/page-data/shared/*",PAGE_DATA:"/page-data/*",APP_DATA:"/app-data.json",AUTHORIZATION:"/authorize",OIDC_CALLBACK:"/_auth/oidc",SAML_CALLBACK:"/_auth/saml2",REDOCLY_CALLBACK:"/_auth/redocly",REPLAY_OAUTH2_CALLBACK:"/_auth/replay-oauth2",REDOCLY_LOGIN_CALLBACK:"/_auth/redocly/redocly-login",REDOCLY_TOKEN_LOGIN:"/_auth/redocly-token-login",SEARCH:"/_search",SEARCH_FACETS:"/_search-facets",SEMANTIC_SEARCH:"/_semantic-search",LOGOUT:"/logout",POST_LOGOUT:"/post-logout",LOGIN:"/login",IDP_LOGIN:"/_auth/idp-login",INVITE:"/invite/:code",RESOLVE_ROUTE_BY_PATH:"/resolve-route-by-path",RESOLVE_ROUTES_BY_PATHS:"/resolve-routes-by-paths",RESOLVE_ROUTE_BY_SLUG:"/resolve-route-by-slug",GET_ROUTES_BY_LINE:"/get-routes-by-line",FEEDBACK:"/feedback",TELEMETRY:"/_events",OTEL_TRACES:"/_otel/v1/traces",HEALTH:"/_health",ASK_AI:"/_ask-ai",CATALOG_ENTITIES:`/catalog-entities/:${_}?`,CATALOG_ENTITIES_RELATIONS:`/catalog-entities-relations/:${c}?`,BFF_CATALOG_ENTITIES:`/bff/catalog-entities/:${a}?`,BFF_CATALOG_RELATED_ENTITIES:`/bff/catalog-related-entities/:${a}`,BFF_CATALOG_REVISIONS:"/bff/catalog-revisions",MCP_OAUTH_AUTHORIZATION_SERVER:"/.well-known/oauth-authorization-server",MCP_OAUTH_PROTECTED_RESOURCE:"/.well-known/oauth-protected-resource",MCP_DYNAMIC_CLIENT_REGISTRATION:"/_mcp/register",MCP_AUTHORIZATION:"/_mcp/oauth2/auth",MCP_TOKEN_PORTAL:"/_mcp/oauth2/token-portal",MCP_CALLBACK:"/_mcp/oauth/callback",SCORECARDS:"/scorecards"};var r;(function(t){t.AI_SEARCH="aiSearch"})(r||(r={}));const m="/login",U="/invite",M={AUTH0_PASS:"/auth/auth0-pass"},b={NotExist:"ENOENT"},G="default_locale",H="sidebar-",F="PUBLIC_",y="branch.",v=["BROKEN_LINK","MARKDOC","RESOLVE"],B=["logo","navbar","products","footer","sidebar","scripts","links","feedback","search","aiAssistant","colorMode","palette","navigation","codeSnippet","markdown","openapi","graphql","analytics","userMenu","versionPicker","breadcrumbs","catalog","entitiesCatalog","scorecard","scorecards","scorecardClassic","mcp","banner"],s="redocly_category",k="redocly_product",f="redocly_version",K="redocly_teams",Y=s,V={asyncapi:"asyncapi",apiFunctions:"apiFunctions",reactPages:"reactPages",catalog:"catalog",catalogClassic:"catalogClassic",lint:"lint",scorecard:"scorecard",scorecards:"scorecards",l10n:"l10n",openapi:"openapi",graphql:"graphql",markdown:"markdown",devOnboarding:"devOnboarding",seo:"seo",redirects:"redirects",customPlugins:"customPlugins",themeEjecting:"themeEjecting",products:"products",breadcrumbs:"breadcrumbs",mockServer:"mockServer",sso:"sso",rbac:"rbac",analytics:"analytics",removeAttribution:"removeAttribution",advancedSearch:"advancedSearch",soap:"soap",ssoDirect:"ssoDirect",codeWalkthrough:"codeWalkthrough",aiSearchLimit:"aiSearchLimit",kvStorageLimit:"kvStorageLimit",mcp:"mcp",banner:"banner"};export{n as ASYNC_API_DOCS_TEMPLATE_ID,y as BRANCH_ENV_PREFIX,_ as CATALOG_ENTITY_ID,a as CATALOG_ENTITY_KEY,c as CATALOG_ENTITY_RELATION_ID,u as CONFIG_FILE_NAME,i as CUSTOM_MARKDOC_OPTIONS_PATH,O as CUSTOM_MARKDOC_TAGS_PATH,I as DEFAULT_ANONYMOUS_VISITOR_TEAM,l as DEFAULT_AUTHENTICATED_TEAM,R as DEFAULT_COOKIE_EXPIRATION,G as DEFAULT_LOCALE_PLACEHOLDER,S as DEFAULT_RBAC_SCOPE,d as DEFAULT_SSO_IDP_TITLE,P as DEFAULT_THEME_NAME,m as DEV_LOGIN_SLUG,g as EJECT_COMPONENT_URL,M as ExternalRoutes,V as FEATURE,e as FEEDBACK_TYPES,b as FsErrors,h as GLOBAL_DATA_URL,T as GRAPHQL_SPEC_SLUG,A as GRAPHQL_TEMPLATE_ID,U as INVITE_SLUG,v as MARKDOC_ERROR_TYPES,E as OPENAPI_DOCS_TEMPLATE_ID,F as PUBLIC_ENV_PREFIX,L as PUBLIC_RBAC_SCOPE_ITEM,p as RBAC_ALL_OTHER_TEAMS,C as REQUIRED_OIDC_SCOPES,r as RbacFeatures,s as SEARCH_CATEGORY_FIELD,Y as SEARCH_GROUP_FACET_FIELD,k as SEARCH_PRODUCT_FIELD,K as SEARCH_RBAC_FIELD,f as SEARCH_VERSION_FIELD,H as SIDEBAR_PREFIX,x as ServerRoutes,N as TRANSLATIONS_FILE_NAME,B as UI_ACCESSIBLE_CONFIG_PROPS,D as USER_THEME_ALIAS,o as cliCommandNames};
1
+ const t="_auth",n="openapi_docs",A="asyncapi_docs",T="graphql_docs",i="/_spec-gql",p="markdoc",O="tags",L="*",C={"*":"read"},R=["openid","email"],I=1440*60,l="anonymous",S="authenticated",d="**",N="Reunite",P="translations.yaml",u="redocly.yaml",D="@redocly/theme",x="@theme",g="/app-data.json",U="/eject-component";var e;(function(o){o.BUILD="build",o.DEVELOP="develop",o.PREPARE="prepare"})(e||(e={}));var r;(function(o){o.RATING="rating",o.SENTIMENT="sentiment",o.COMMENT="comment",o.MOOD="mood",o.PROBLEM="problem",o.SCALE="scale"})(r||(r={}));const a="entityKey",c="entityId",s="entityRelationId",m={CORS_PROXY:"/_api/cors",INFO:"/_info",EJECT_COMPONENT:"/eject-component/:componentName",SHARED_PAGE_DATA:"/page-data/shared/*",PAGE_DATA:"/page-data/*",APP_DATA:"/app-data.json",AUTHORIZATION:"/authorize",OIDC_CALLBACK:`/${t}/oidc`,SAML_CALLBACK:`/${t}/saml2`,REDOCLY_CALLBACK:`/${t}/redocly`,REPLAY_OAUTH2_CALLBACK:`/${t}/replay-oauth2`,REDOCLY_LOGIN_CALLBACK:`/${t}/redocly/redocly-login`,REDOCLY_TOKEN_LOGIN:`/${t}/redocly-token-login`,SEARCH:"/_search",SEARCH_FACETS:"/_search-facets",SEMANTIC_SEARCH:"/_semantic-search",LOGOUT:"/logout",POST_LOGOUT:"/post-logout",LOGIN:"/login",IDP_LOGIN:`/${t}/idp-login`,INVITE:"/invite/:code",RESOLVE_ROUTE_BY_PATH:"/resolve-route-by-path",RESOLVE_ROUTES_BY_PATHS:"/resolve-routes-by-paths",RESOLVE_ROUTE_BY_SLUG:"/resolve-route-by-slug",GET_ROUTES_BY_LINE:"/get-routes-by-line",FEEDBACK:"/feedback",TELEMETRY:"/_events",OTEL_TRACES:"/_otel/v1/traces",HEALTH:"/_health",ASK_AI:"/_ask-ai",CATALOG_ENTITIES:`/catalog-entities/:${c}?`,CATALOG_ENTITIES_RELATIONS:`/catalog-entities-relations/:${s}?`,BFF_CATALOG_ENTITIES:`/bff/catalog-entities/:${a}?`,BFF_CATALOG_RELATED_ENTITIES:`/bff/catalog-related-entities/:${a}`,BFF_CATALOG_REVISIONS:"/bff/catalog-revisions",MCP_OAUTH_AUTHORIZATION_SERVER:"/.well-known/oauth-authorization-server",MCP_OAUTH_PROTECTED_RESOURCE:"/.well-known/oauth-protected-resource",MCP_DYNAMIC_CLIENT_REGISTRATION:"/_mcp/register",MCP_AUTHORIZATION:"/_mcp/oauth2/auth",MCP_TOKEN_PORTAL:"/_mcp/oauth2/token-portal",MCP_CALLBACK:"/_mcp/oauth/callback",SCORECARDS:"/scorecards"};var _;(function(o){o.AI_SEARCH="aiSearch"})(_||(_={}));const h="/login",M="/invite",G={AUTH0_PASS:"/auth/auth0-pass"},H={NotExist:"ENOENT"},b="default_locale",F="sidebar-",y="PUBLIC_",v="branch.",B=["BROKEN_LINK","MARKDOC","RESOLVE"],k=["logo","navbar","products","footer","sidebar","scripts","links","feedback","search","aiAssistant","colorMode","palette","navigation","codeSnippet","markdown","openapi","graphql","analytics","userMenu","versionPicker","breadcrumbs","catalog","entitiesCatalog","scorecard","scorecards","scorecardClassic","mcp","banner"],E="redocly_category",f="redocly_product",K="redocly_version",Y="redocly_teams",V=E,$={asyncapi:"asyncapi",apiFunctions:"apiFunctions",reactPages:"reactPages",catalog:"catalog",catalogClassic:"catalogClassic",lint:"lint",scorecard:"scorecard",scorecards:"scorecards",l10n:"l10n",openapi:"openapi",graphql:"graphql",markdown:"markdown",devOnboarding:"devOnboarding",seo:"seo",redirects:"redirects",customPlugins:"customPlugins",themeEjecting:"themeEjecting",products:"products",breadcrumbs:"breadcrumbs",mockServer:"mockServer",sso:"sso",rbac:"rbac",analytics:"analytics",removeAttribution:"removeAttribution",advancedSearch:"advancedSearch",soap:"soap",ssoDirect:"ssoDirect",codeWalkthrough:"codeWalkthrough",aiSearchLimit:"aiSearchLimit",kvStorageLimit:"kvStorageLimit",mcp:"mcp",banner:"banner"};export{A as ASYNC_API_DOCS_TEMPLATE_ID,t as AUTH_SEGMENT,v as BRANCH_ENV_PREFIX,c as CATALOG_ENTITY_ID,a as CATALOG_ENTITY_KEY,s as CATALOG_ENTITY_RELATION_ID,u as CONFIG_FILE_NAME,p as CUSTOM_MARKDOC_OPTIONS_PATH,O as CUSTOM_MARKDOC_TAGS_PATH,l as DEFAULT_ANONYMOUS_VISITOR_TEAM,S as DEFAULT_AUTHENTICATED_TEAM,I as DEFAULT_COOKIE_EXPIRATION,b as DEFAULT_LOCALE_PLACEHOLDER,d as DEFAULT_RBAC_SCOPE,N as DEFAULT_SSO_IDP_TITLE,D as DEFAULT_THEME_NAME,h as DEV_LOGIN_SLUG,U as EJECT_COMPONENT_URL,G as ExternalRoutes,$ as FEATURE,r as FEEDBACK_TYPES,H as FsErrors,g as GLOBAL_DATA_URL,i as GRAPHQL_SPEC_SLUG,T as GRAPHQL_TEMPLATE_ID,M as INVITE_SLUG,B as MARKDOC_ERROR_TYPES,n as OPENAPI_DOCS_TEMPLATE_ID,y as PUBLIC_ENV_PREFIX,C as PUBLIC_RBAC_SCOPE_ITEM,L as RBAC_ALL_OTHER_TEAMS,R as REQUIRED_OIDC_SCOPES,_ as RbacFeatures,E as SEARCH_CATEGORY_FIELD,V as SEARCH_GROUP_FACET_FIELD,f as SEARCH_PRODUCT_FIELD,Y as SEARCH_RBAC_FIELD,K as SEARCH_VERSION_FIELD,F as SIDEBAR_PREFIX,m as ServerRoutes,P as TRANSLATIONS_FILE_NAME,k as UI_ACCESSIBLE_CONFIG_PROPS,x as USER_THEME_ALIAS,e as cliCommandNames};
@@ -6,21 +6,51 @@ import { openApiResponseSample } from './openapi-response-sample.js';
6
6
  import { jsonExample } from './json-example.js';
7
7
  declare const _default: {
8
8
  [jsonSchema.tagName]: import("@markdoc/markdoc").Schema & {
9
+ attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
10
+ resolver?: string;
11
+ }>;
12
+ renderForLlms?: import("@redocly/theme/markdoc/tags/types").RenderForLlmsFn;
13
+ } & {
9
14
  dynamicComponentLib?: string;
10
15
  };
11
16
  [openApiCodeSample.tagName]: import("@markdoc/markdoc").Schema & {
17
+ attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
18
+ resolver?: string;
19
+ }>;
20
+ renderForLlms?: import("@redocly/theme/markdoc/tags/types").RenderForLlmsFn;
21
+ } & {
12
22
  dynamicComponentLib?: string;
13
23
  };
14
24
  [openApiExample.tagName]: import("@markdoc/markdoc").Schema & {
25
+ attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
26
+ resolver?: string;
27
+ }>;
28
+ renderForLlms?: import("@redocly/theme/markdoc/tags/types").RenderForLlmsFn;
29
+ } & {
15
30
  dynamicComponentLib?: string;
16
31
  };
17
32
  [replayOpenApi.tagName]: import("@markdoc/markdoc").Schema & {
33
+ attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
34
+ resolver?: string;
35
+ }>;
36
+ renderForLlms?: import("@redocly/theme/markdoc/tags/types").RenderForLlmsFn;
37
+ } & {
18
38
  dynamicComponentLib?: string;
19
39
  };
20
40
  [openApiResponseSample.tagName]: import("@markdoc/markdoc").Schema & {
41
+ attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
42
+ resolver?: string;
43
+ }>;
44
+ renderForLlms?: import("@redocly/theme/markdoc/tags/types").RenderForLlmsFn;
45
+ } & {
21
46
  dynamicComponentLib?: string;
22
47
  };
23
48
  [jsonExample.tagName]: import("@markdoc/markdoc").Schema & {
49
+ attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
50
+ resolver?: string;
51
+ }>;
52
+ renderForLlms?: import("@redocly/theme/markdoc/tags/types").RenderForLlmsFn;
53
+ } & {
24
54
  dynamicComponentLib?: string;
25
55
  };
26
56
  };
@@ -1,6 +1,6 @@
1
- import type { Schema } from '@markdoc/markdoc';
1
+ import type { MarkdocTagSchema } from '@redocly/theme/markdoc/tags/types';
2
2
  export type CustomMarkdocTag = {
3
- schema: Schema & {
3
+ schema: MarkdocTagSchema & {
4
4
  dynamicComponentLib?: string;
5
5
  };
6
6
  tagName: string;
@@ -1 +1 @@
1
- import*as p from"workerpool";import{withPathPrefix as f}from"@redocly/theme/core/utils";import{envConfig as u}from"../config/env-config.js";import{telemetry as a}from"../telemetry/index.js";import{TimeoutExceededError as E}from"./errors/timeout-exceeded.js";import{serializeRequest as _}from"./helpers/serialize-request.js";import{apiRoutesWorkers as A,API_ROUTES_WORKER_KEY as T}from"../workers/api-routes-worker-pool.js";import{API_FUNCTIONS_REQUEST_HANDLER_ID as d}from"../plugins/api-functions/index.js";const g=1e4,h=15;async function U(e,r,t){a.initialize();const s=r.get("auth"),i=await t.resolveRouteStaticData(e)||{},n=f(e.slug);try{const{status:o,headers:l,body:c}=await A.exec(T,[{serverOutDir:t.serverOutDir,slug:n,requestHandlerId:e.requestHandlerId,maxResponseSizeMB:h,ctxData:{user:{teams:s.teams,email:s.claims.email,claims:s.claims,idpAccessToken:s.idpAccessToken,idpId:s.claims.idpId,isAuthenticated:s.isAuthenticated},config:t.config,outdir:t.outdir,baseUrl:new URL(r.req.url).origin},staticData:{...i,props:{...i.props,routeSlug:n,outdir:t.outdir}},req:await _(r.req.raw),sqldRemoteDatabaseUrl:u.SQLD_REMOTE_DATABASE_URL,sqldRemoteDatabaseAuthToken:u.SQLD_REMOTE_DATABASE_AUTH_TOKEN}],{timeout:g});R({requestHandlerId:e.requestHandlerId,body:c,headers:l,status:o,ctx:r});const m=c.data?Buffer.from(c.data):null;return new Response(m,{status:o,headers:l})}catch(o){throw M({requestHandlerId:e.requestHandlerId,error:o}),o instanceof p.Promise.TimeoutError?new E("Timeout exceeded"):o}}function R({requestHandlerId:e,body:r,headers:t,status:s,ctx:i}){e.startsWith(d)?a.sendApiFunctionCalledMessage([{object:"api_function",error:null,handler:e,body:r,headers:t,status:s}]):a.sendMockServerCalledMessage([{object:"mock_server",error:null,handler:e,body:r,headers:{"user-agent":i.req.header("user-agent")??""},status:s}])}function M({requestHandlerId:e,error:r}){const t={handler:e,message:r?.message??null,stack:r?.stack??null};e.startsWith(d)?a.sendApiFunctionErrorMessage([{object:"api_function",...t}]):a.sendMockServerErrorMessage([{object:"mock_server",...t}])}export{U as runApiRoutesWorker,M as sendTelemetryErrorMessage};
1
+ import*as p from"workerpool";import{withPathPrefix as f}from"@redocly/theme/core/utils";import{envConfig as l}from"../config/env-config.js";import{telemetry as a}from"../telemetry/index.js";import{TimeoutExceededError as E}from"./errors/timeout-exceeded.js";import{serializeRequest as _}from"./helpers/serialize-request.js";import{apiRoutesWorkers as A,API_ROUTES_WORKER_KEY as T}from"../workers/api-routes-worker-pool.js";import{API_FUNCTIONS_REQUEST_HANDLER_ID as u}from"../plugins/api-functions/index.js";const g=1e4,h=15;async function U(e,r,t){a.initialize();const s=r.get("auth"),i=await t.resolveRouteStaticData(e)||{},n=f(e.slug);try{const{status:o,headers:d,body:c}=await A.exec(T,[{serverOutDir:t.serverOutDir,slug:n,requestHandlerId:e.requestHandlerId,maxResponseSizeMB:h,ctxData:{user:{teams:s.teams,email:s.claims.email,claims:s.claims,idpAccessToken:s.idpAccessToken,idpId:s.claims.idpId,isAuthenticated:s.isAuthenticated},config:t.config,outdir:t.outdir,baseUrl:new URL(r.req.url).origin},staticData:{...i,props:{...i.props,routeSlug:n,outdir:t.outdir}},req:await _(r.req.raw),sqldRemoteDatabaseUrl:l.SQLD_REMOTE_DATABASE_URL,sqldRemoteDatabaseAuthToken:l.SQLD_REMOTE_DATABASE_AUTH_TOKEN}],{timeout:g});R({requestHandlerId:e.requestHandlerId,status:o,ctx:r});const m=c.data?Buffer.from(c.data):null;return new Response(m,{status:o,headers:d})}catch(o){throw M({requestHandlerId:e.requestHandlerId,error:o}),o instanceof p.Promise.TimeoutError?new E("Timeout exceeded"):o}}function R({requestHandlerId:e,status:r,ctx:t}){e.startsWith(u)?a.sendApiFunctionCalledMessage([{object:"api_function",error:null,handler:e,status:r}]):a.sendMockServerCalledMessage([{object:"mock_server",error:null,handler:e,headers:{"user-agent":t.req.header("user-agent")??null},status:r}])}function M({requestHandlerId:e,error:r}){const t={handler:e,message:r?.message??null,stack:r?.stack??null};e.startsWith(u)?a.sendApiFunctionErrorMessage([{object:"api_function",...t}]):a.sendMockServerErrorMessage([{object:"mock_server",...t}])}export{U as runApiRoutesWorker,M as sendTelemetryErrorMessage};
@@ -57,6 +57,9 @@ declare function loadEnvConfig(): {
57
57
  REDOCLY_EXP_DISABLE_MD_VALIDATION?: boolean | undefined;
58
58
  ENABLE_SOURCE_MAPS?: boolean | undefined;
59
59
  PLAN_GATES?: string | undefined;
60
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: boolean | undefined;
61
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
62
+ REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
60
63
  SEARCH_DEV_REINIT?: string | undefined;
61
64
  TYPESENSE_API_URL?: string | undefined;
62
65
  TYPESENSE_API_KEY?: string | undefined;
@@ -133,6 +136,9 @@ export declare const envConfig: {
133
136
  REDOCLY_EXP_DISABLE_MD_VALIDATION?: boolean | undefined;
134
137
  ENABLE_SOURCE_MAPS?: boolean | undefined;
135
138
  PLAN_GATES?: string | undefined;
139
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: boolean | undefined;
140
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
141
+ REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
136
142
  SEARCH_DEV_REINIT?: string | undefined;
137
143
  TYPESENSE_API_URL?: string | undefined;
138
144
  TYPESENSE_API_KEY?: string | undefined;
@@ -1,5 +1,5 @@
1
- import type { z } from 'zod';
2
- export declare const envSchema: z.ZodObject<{
1
+ import { z } from 'zod';
2
+ export declare const envSchema: z.ZodEffects<z.ZodObject<{
3
3
  NODE_ENV: z.ZodOptional<z.ZodEnum<["development", "production"]>>;
4
4
  REDOCLY_ENV: z.ZodDefault<z.ZodEnum<["production", "preview", "development"]>>;
5
5
  REDOCLY_EXECUTION_MODE: z.ZodDefault<z.ZodEnum<["build", "develop", "runtime"]>>;
@@ -54,6 +54,9 @@ export declare const envSchema: z.ZodObject<{
54
54
  REDOCLY_EXP_DISABLE_MD_VALIDATION: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "true" | "false" | undefined>;
55
55
  ENABLE_SOURCE_MAPS: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "true" | "false" | undefined>;
56
56
  PLAN_GATES: z.ZodOptional<z.ZodString>;
57
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "true" | "false" | undefined>;
58
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL: z.ZodOptional<z.ZodString>;
59
+ REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT: z.ZodOptional<z.ZodString>;
57
60
  } & {
58
61
  SEARCH_DEV_REINIT: z.ZodOptional<z.ZodString>;
59
62
  SEARCH_DEV_DEBUG: z.ZodEffects<z.ZodDefault<z.ZodEnum<["true", "false"]>>, boolean, "true" | "false" | undefined>;
@@ -128,6 +131,9 @@ export declare const envSchema: z.ZodObject<{
128
131
  REDOCLY_EXP_DISABLE_MD_VALIDATION?: boolean | undefined;
129
132
  ENABLE_SOURCE_MAPS?: boolean | undefined;
130
133
  PLAN_GATES?: string | undefined;
134
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: boolean | undefined;
135
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
136
+ REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
131
137
  SEARCH_DEV_REINIT?: string | undefined;
132
138
  TYPESENSE_API_URL?: string | undefined;
133
139
  TYPESENSE_API_KEY?: string | undefined;
@@ -193,6 +199,147 @@ export declare const envSchema: z.ZodObject<{
193
199
  REDOCLY_EXP_DISABLE_MD_VALIDATION?: "true" | "false" | undefined;
194
200
  ENABLE_SOURCE_MAPS?: "true" | "false" | undefined;
195
201
  PLAN_GATES?: string | undefined;
202
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: "true" | "false" | undefined;
203
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
204
+ REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
205
+ SEARCH_DEV_REINIT?: string | undefined;
206
+ SEARCH_DEV_DEBUG?: "true" | "false" | undefined;
207
+ TYPESENSE_API_URL?: string | undefined;
208
+ TYPESENSE_API_KEY?: string | undefined;
209
+ MAIN_API_URL?: string | undefined;
210
+ SERVER_EDITOR_APP_URL?: string | undefined;
211
+ REDOCLY_PUBLIC_URL?: string | undefined;
212
+ REDOCLY_DIAGRAM_MICROSERVICE_URL?: string | undefined;
213
+ REDOCLY_CORS_ORIGINS?: string | undefined;
214
+ SQLD_REMOTE_DATABASE_URL?: string | undefined;
215
+ SQLD_REMOTE_DATABASE_AUTH_TOKEN?: string | undefined;
216
+ FORCE_CATALOG_CACHE_REVALIDATE?: "true" | "false" | undefined;
217
+ SCORECARDS_POLLING_INTERVAL_MS?: string | undefined;
218
+ OTEL_TRACES_URL?: string | undefined;
219
+ REQUEST_ID?: string | undefined;
220
+ SITE_URL?: string | undefined;
221
+ }>, {
222
+ REDOCLY_EXECUTION_MODE: "build" | "develop" | "runtime";
223
+ REDOCLY_ENV: "development" | "production" | "preview";
224
+ SEARCH_DEV_DEBUG: boolean;
225
+ NODE_ENV?: "development" | "production" | undefined;
226
+ REDOCLY_INTERNAL_DEV?: boolean | undefined;
227
+ CI?: boolean | undefined;
228
+ PORT?: number | undefined;
229
+ REDOCLY_LOG_FORMAT?: string | undefined;
230
+ REDOCLY_LOG_LEVEL?: string | undefined;
231
+ TERM?: string | undefined;
232
+ INSPECT_MODE?: string | undefined;
233
+ REDOCLY_PREFIX_PATHS?: string | undefined;
234
+ REDOCLY_CONTENT_DIR?: string | undefined;
235
+ REDOCLY_PORTAL_VERSION?: string | undefined;
236
+ REDOCLY_TELEMETRY?: string | undefined;
237
+ REDOCLY_TELEMETRY_ENDPOINT?: string | undefined;
238
+ TELEMETRY_DEV_DEBUG?: boolean | undefined;
239
+ WEB_SERVER_IDLE_TIMEOUT?: string | undefined;
240
+ REDOCLY_PROBLEMS_OUTPUT_FILE?: string | undefined;
241
+ REDOCLY_METADATA_OUTPUT_FOLDER?: string | undefined;
242
+ ORGANIZATION_ID?: string | undefined;
243
+ ORGANIZATION_SLUG?: string | undefined;
244
+ ORG_SLUG?: string | undefined;
245
+ PROJECT_ID?: string | undefined;
246
+ PROJECT_SLUG?: string | undefined;
247
+ PROJECT_URL?: string | undefined;
248
+ PROJECT_BUILD_ID?: string | undefined;
249
+ PUBLIC_REDOCLY_BRANCH_NAME?: string | undefined;
250
+ JWT_SECRET_KEY?: string | undefined;
251
+ AUTH_URL?: string | undefined;
252
+ BH_API_URL?: string | undefined;
253
+ ENTITLEMENTS_JWKS_CDN_URL?: string | undefined;
254
+ OAUTH_CLIENT_ID?: string | undefined;
255
+ OAUTH_CLIENT_SECRET?: string | undefined;
256
+ OIDC_CLIENT_ID?: string | undefined;
257
+ OIDC_CLIENT_SECRET?: string | undefined;
258
+ OIDC_ISSUER_URL?: string | undefined;
259
+ LOCALHOST_LOGIN?: boolean | undefined;
260
+ REDOCLY_OAUTH_USE_INTROSPECT?: string | undefined;
261
+ REDOCLY_ENFORCE_LOGIN?: boolean | undefined;
262
+ REDOCLY_ENFORCE_RESIDENCY?: string | undefined;
263
+ REDOCLY_SSR_RENDER_MODE?: "main" | "worker" | undefined;
264
+ REDOCLY_SSR_WORKERS_MIN?: number | undefined;
265
+ REDOCLY_SSR_WORKERS_MAX?: number | undefined;
266
+ NEW_CATALOG_ENABLED?: boolean | undefined;
267
+ NEW_SCORECARDS_ENABLED?: boolean | undefined;
268
+ ENABLE_COMMENTS?: string | undefined;
269
+ REDOCLY_EXP_DISABLE_MD_VALIDATION?: boolean | undefined;
270
+ ENABLE_SOURCE_MAPS?: boolean | undefined;
271
+ PLAN_GATES?: string | undefined;
272
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: boolean | undefined;
273
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
274
+ REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
275
+ SEARCH_DEV_REINIT?: string | undefined;
276
+ TYPESENSE_API_URL?: string | undefined;
277
+ TYPESENSE_API_KEY?: string | undefined;
278
+ MAIN_API_URL?: string | undefined;
279
+ SERVER_EDITOR_APP_URL?: string | undefined;
280
+ REDOCLY_PUBLIC_URL?: string | undefined;
281
+ REDOCLY_DIAGRAM_MICROSERVICE_URL?: string | undefined;
282
+ REDOCLY_CORS_ORIGINS?: string | undefined;
283
+ SQLD_REMOTE_DATABASE_URL?: string | undefined;
284
+ SQLD_REMOTE_DATABASE_AUTH_TOKEN?: string | undefined;
285
+ FORCE_CATALOG_CACHE_REVALIDATE?: boolean | undefined;
286
+ SCORECARDS_POLLING_INTERVAL_MS?: string | undefined;
287
+ OTEL_TRACES_URL?: string | undefined;
288
+ REQUEST_ID?: string | undefined;
289
+ SITE_URL?: string | undefined;
290
+ }, {
291
+ REDOCLY_EXECUTION_MODE?: "build" | "develop" | "runtime" | undefined;
292
+ NODE_ENV?: "development" | "production" | undefined;
293
+ REDOCLY_ENV?: "development" | "production" | "preview" | undefined;
294
+ REDOCLY_INTERNAL_DEV?: "true" | "false" | undefined;
295
+ CI?: "1" | "true" | "false" | undefined;
296
+ PORT?: number | undefined;
297
+ REDOCLY_LOG_FORMAT?: string | undefined;
298
+ REDOCLY_LOG_LEVEL?: string | undefined;
299
+ TERM?: string | undefined;
300
+ INSPECT_MODE?: string | undefined;
301
+ REDOCLY_PREFIX_PATHS?: string | undefined;
302
+ REDOCLY_CONTENT_DIR?: string | undefined;
303
+ REDOCLY_PORTAL_VERSION?: string | undefined;
304
+ REDOCLY_TELEMETRY?: string | undefined;
305
+ REDOCLY_TELEMETRY_ENDPOINT?: string | undefined;
306
+ TELEMETRY_DEV_DEBUG?: "true" | "false" | undefined;
307
+ WEB_SERVER_IDLE_TIMEOUT?: string | undefined;
308
+ REDOCLY_PROBLEMS_OUTPUT_FILE?: string | undefined;
309
+ REDOCLY_METADATA_OUTPUT_FOLDER?: string | undefined;
310
+ ORGANIZATION_ID?: string | undefined;
311
+ ORGANIZATION_SLUG?: string | undefined;
312
+ ORG_SLUG?: string | undefined;
313
+ PROJECT_ID?: string | undefined;
314
+ PROJECT_SLUG?: string | undefined;
315
+ PROJECT_URL?: string | undefined;
316
+ PROJECT_BUILD_ID?: string | undefined;
317
+ PUBLIC_REDOCLY_BRANCH_NAME?: string | undefined;
318
+ JWT_SECRET_KEY?: string | undefined;
319
+ AUTH_URL?: string | undefined;
320
+ BH_API_URL?: string | undefined;
321
+ ENTITLEMENTS_JWKS_CDN_URL?: string | undefined;
322
+ OAUTH_CLIENT_ID?: string | undefined;
323
+ OAUTH_CLIENT_SECRET?: string | undefined;
324
+ OIDC_CLIENT_ID?: string | undefined;
325
+ OIDC_CLIENT_SECRET?: string | undefined;
326
+ OIDC_ISSUER_URL?: string | undefined;
327
+ LOCALHOST_LOGIN?: "true" | "false" | undefined;
328
+ REDOCLY_OAUTH_USE_INTROSPECT?: string | undefined;
329
+ REDOCLY_ENFORCE_LOGIN?: "true" | "false" | undefined;
330
+ REDOCLY_ENFORCE_RESIDENCY?: string | undefined;
331
+ REDOCLY_SSR_RENDER_MODE?: "main" | "worker" | undefined;
332
+ REDOCLY_SSR_WORKERS_MIN?: number | undefined;
333
+ REDOCLY_SSR_WORKERS_MAX?: number | undefined;
334
+ NEW_CATALOG_ENABLED?: "true" | "false" | undefined;
335
+ NEW_SCORECARDS_ENABLED?: "true" | "false" | undefined;
336
+ ENABLE_COMMENTS?: string | undefined;
337
+ REDOCLY_EXP_DISABLE_MD_VALIDATION?: "true" | "false" | undefined;
338
+ ENABLE_SOURCE_MAPS?: "true" | "false" | undefined;
339
+ PLAN_GATES?: string | undefined;
340
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: "true" | "false" | undefined;
341
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
342
+ REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
196
343
  SEARCH_DEV_REINIT?: string | undefined;
197
344
  SEARCH_DEV_DEBUG?: "true" | "false" | undefined;
198
345
  TYPESENSE_API_URL?: string | undefined;
@@ -1 +1 @@
1
- import{environmentDetectionSchema as e}from"./env-schemas/environment-detection.js";import{serverConfigSchema as m}from"./env-schemas/server-config.js";import{organizationProjectSchema as r}from"./env-schemas/organization-project.js";import{authSchema as o}from"./env-schemas/auth.js";import{ssrSchema as t}from"./env-schemas/ssr.js";import{featureFlagsSchema as a}from"./env-schemas/feature-flags.js";import{searchSchema as c}from"./env-schemas/search.js";import{apiUrlsSchema as i}from"./env-schemas/api-urls.js";import{databaseSchema as g}from"./env-schemas/database.js";import{catalogSchema as h}from"./env-schemas/catalog.js";import{scorecardsSchema as p}from"./env-schemas/scorecards.js";import{telemetrySchema as f}from"./env-schemas/telemetry.js";import{siteSchema as S}from"./env-schemas/site.js";const F=e.merge(m).merge(r).merge(o).merge(t).merge(a).merge(c).merge(i).merge(g).merge(h).merge(p).merge(f).merge(S).strip();export{F as envSchema};
1
+ import{z as r}from"zod";import{environmentDetectionSchema as o}from"./env-schemas/environment-detection.js";import{serverConfigSchema as t}from"./env-schemas/server-config.js";import{organizationProjectSchema as a}from"./env-schemas/organization-project.js";import{authSchema as i}from"./env-schemas/auth.js";import{ssrSchema as E}from"./env-schemas/ssr.js";import{featureFlagsSchema as c}from"./env-schemas/feature-flags.js";import{searchSchema as s}from"./env-schemas/search.js";import{apiUrlsSchema as _}from"./env-schemas/api-urls.js";import{databaseSchema as S}from"./env-schemas/database.js";import{catalogSchema as h}from"./env-schemas/catalog.js";import{scorecardsSchema as p}from"./env-schemas/scorecards.js";import{telemetrySchema as f}from"./env-schemas/telemetry.js";import{siteSchema as T}from"./env-schemas/site.js";const g=o.merge(t).merge(a).merge(i).merge(E).merge(c).merge(s).merge(_).merge(S).merge(h).merge(p).merge(f).merge(T).strip(),M=g.superRefine((e,m)=>{e.REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED===!0&&!e.REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?.trim()&&m.addIssue({code:r.ZodIssueCode.custom,path:["REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT"],message:"REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT is required when REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED=true"})});export{M as envSchema};
@@ -9,6 +9,12 @@ export declare const featureFlagsSchema: z.ZodObject<{
9
9
  REDOCLY_EXP_DISABLE_MD_VALIDATION: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "true" | "false" | undefined>;
10
10
  ENABLE_SOURCE_MAPS: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "true" | "false" | undefined>;
11
11
  PLAN_GATES: z.ZodOptional<z.ZodString>;
12
+ /** Experimental: append agent feedback instructions to llms.txt Markdown chunks. */
13
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "true" | "false" | undefined>;
14
+ /** Optional POST URL for the agent feedback footer; defaults to `{seo.siteUrl|REDOCLY_PUBLIC_URL}/api/agent-feedback`, or `/api/agent-feedback` on the same origin. */
15
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL: z.ZodOptional<z.ZodString>;
16
+ /** (Optional) API endpoint for the agent feedback endpoint;**/
17
+ REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT: z.ZodOptional<z.ZodString>;
12
18
  }, "strip", z.ZodTypeAny, {
13
19
  NEW_CATALOG_ENABLED?: boolean | undefined;
14
20
  NEW_SCORECARDS_ENABLED?: boolean | undefined;
@@ -16,6 +22,9 @@ export declare const featureFlagsSchema: z.ZodObject<{
16
22
  REDOCLY_EXP_DISABLE_MD_VALIDATION?: boolean | undefined;
17
23
  ENABLE_SOURCE_MAPS?: boolean | undefined;
18
24
  PLAN_GATES?: string | undefined;
25
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: boolean | undefined;
26
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
27
+ REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
19
28
  }, {
20
29
  NEW_CATALOG_ENABLED?: "true" | "false" | undefined;
21
30
  NEW_SCORECARDS_ENABLED?: "true" | "false" | undefined;
@@ -23,5 +32,8 @@ export declare const featureFlagsSchema: z.ZodObject<{
23
32
  REDOCLY_EXP_DISABLE_MD_VALIDATION?: "true" | "false" | undefined;
24
33
  ENABLE_SOURCE_MAPS?: "true" | "false" | undefined;
25
34
  PLAN_GATES?: string | undefined;
35
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: "true" | "false" | undefined;
36
+ REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
37
+ REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
26
38
  }>;
27
39
  //# sourceMappingURL=feature-flags.d.ts.map
@@ -1 +1 @@
1
- import{z as o}from"zod";import{envBooleanStringOptional as E}from"../../utils/envs/env-boolean-string.js";const _=o.object({NEW_CATALOG_ENABLED:E(),NEW_SCORECARDS_ENABLED:E(),ENABLE_COMMENTS:o.string().optional(),REDOCLY_EXP_DISABLE_MD_VALIDATION:E(),ENABLE_SOURCE_MAPS:E(),PLAN_GATES:o.string().optional()});export{_ as featureFlagsSchema};
1
+ import{z as E}from"zod";import{envBooleanStringOptional as _}from"../../utils/envs/env-boolean-string.js";const o=E.object({NEW_CATALOG_ENABLED:_(),NEW_SCORECARDS_ENABLED:_(),ENABLE_COMMENTS:E.string().optional(),REDOCLY_EXP_DISABLE_MD_VALIDATION:_(),ENABLE_SOURCE_MAPS:_(),PLAN_GATES:E.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED:_(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL:E.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT:E.string().optional()});export{o as featureFlagsSchema};
@@ -3,4 +3,6 @@ export declare const MAX_REASONS_COUNT = 10;
3
3
  export declare const MAX_PATH_LENGTH = 1000;
4
4
  export declare const MAX_LANG_LENGTH = 20;
5
5
  export declare const MAX_EMAIL_LENGTH = 254;
6
+ export declare const MAX_AGENT_LENGTH = 200;
7
+ export declare const MAX_TARGET_FEATURE_LENGTH = 500;
6
8
  //# sourceMappingURL=feedback.d.ts.map
@@ -1 +1 @@
1
- const o=5e3,t=10,_=1e3,A=20,N=254;export{o as MAX_CONTEXT_LENGTH,N as MAX_EMAIL_LENGTH,A as MAX_LANG_LENGTH,_ as MAX_PATH_LENGTH,t as MAX_REASONS_COUNT};
1
+ const _=5e3,o=10,t=1e3,A=20,T=254,E=200,N=500;export{E as MAX_AGENT_LENGTH,_ as MAX_CONTEXT_LENGTH,T as MAX_EMAIL_LENGTH,A as MAX_LANG_LENGTH,t as MAX_PATH_LENGTH,o as MAX_REASONS_COUNT,N as MAX_TARGET_FEATURE_LENGTH};
@@ -1 +1 @@
1
- import o from"node:path";import{ASYNC_API_DOCS_TEMPLATE_ID as F,GRAPHQL_SPEC_SLUG as T,GRAPHQL_TEMPLATE_ID as d,OPENAPI_DOCS_TEMPLATE_ID as v}from"../../../../constants/common.js";import{isLocalLink as y}from"../../../../utils/path/is-local-link.js";import{normalizeRouteSlug as P}from"../../../../utils/path/normalize-route-slug.js";import{removeFragment as U}from"../../../../utils/path/remove-fragment.js";import{PUBLIC_API_DEFINITIONS_FOLDER as C,DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER as B}from"../../../constants/common.js";import{getInnerText as M}from"../../../../markdoc/helpers/get-inner-text.js";import{getNodeAttribute as N}from"../../../../markdoc/helpers/get-node-attribute.js";import{setNodeAttributeValue as p}from"../../../../markdoc/helpers/set-node-attribute-value.js";import{MdResolveError as g}from"./md-resolve-error.js";import{getLinkOriginalAttrName as W}from"./utils.js";import{isOpenApiURL as j}from"../../openapi-docs/is-openapi-doc.js";import{parseBaseName as G}from"../../utils.js";import{isMarkdownPage as $}from"../is-markdown-page.js";import{copyStaticFile as V}from"../../../utils/fs.js";const b=i=>[C,B,T].some(r=>i.startsWith(r));async function lt(i,r,k,{actions:L,context:c}){const{contentDir:w,outdir:D,getRouteByFsPath:A,hasRouteOrRedirectBySlug:E}=L,_=W(r),s=i[_]||N(i,r);if(i[_]=s,!y(s)||b(s))return;const[z,t="",R,h]=/^([^\?#]+)?([^#]+)?(.+)?/.exec(s)||[],f=i.type==="image"?"IMAGE":"LINK",u=String(i.attributes.title||i.attributes.alt||M([i])||""),n=U(k);if(i.type!=="image"){const{isOpenapiDetected:e,isOpenapiValid:m}=await j(t,n,L,c);if(e&&!m)throw new g(`OpenAPI route ${s} does not exist`,{rawLink:s,link:t,title:u,brokenLinkType:f})}if(o.extname(t)===""){if(t.startsWith("/")){if(!E(P(t)))throw new g(`Route ${t} does not exist`,{rawLink:s,link:t,title:u,brokenLinkType:f});p(i,r,t+(R||"")+(h||""))}if(!s.startsWith("#")&&!t.startsWith("/")&&$(n)){const e=A(n)?.slug;if(!e)return;const{isIndexFile:m}=G(n),I=m?P(o.posix.join(e,t)):P(o.posix.join(e,"../",t));if(!E(P(I)))throw new g(`Route ${t} does not exist`,{rawLink:s,link:I,title:u,brokenLinkType:f});p(i,r,I+(R||"")+(h||""))}return}const a=t.startsWith("/")?t.substring(1):o.posix.join(o.posix.dirname(n),decodeURI(t)),S=t.startsWith("/")?o.posix.join("static",t.substring(1)):"",x=c.fs.exists(a),O=c.fs.exists(S),l=A(a);if(!x&&!l&&!O)throw p(i,r,"#"),new g(`File ${a} does not exist`,{rawLink:s,link:a,title:u,brokenLinkType:f});if(l){const e=[v,d,F].includes(l.templateId);p(i,r,(e?l.baseSlug:l.slug)+(h||""))}else if(x){const e=c.fs.getFileInfo(a);if(!e||e.isVirtual)return;const m=await V(w,e.realRelativePath,D);p(i,r,m)}}export{lt as resolveLink};
1
+ import o from"node:path";import{ASYNC_API_DOCS_TEMPLATE_ID as T,GRAPHQL_TEMPLATE_ID as v,OPENAPI_DOCS_TEMPLATE_ID as y}from"../../../../constants/common.js";import{isLocalLink as D}from"../../../../utils/path/is-local-link.js";import{normalizeRouteSlug as h}from"../../../../utils/path/normalize-route-slug.js";import{removeFragment as F}from"../../../../utils/path/remove-fragment.js";import{getInnerText as M}from"../../../../markdoc/helpers/get-inner-text.js";import{getNodeAttribute as U}from"../../../../markdoc/helpers/get-node-attribute.js";import{setNodeAttributeValue as p}from"../../../../markdoc/helpers/set-node-attribute-value.js";import{isAuthRoutePath as W}from"../../../../utils/auth/is-auth-route-path.js";import{isApiDownloadLink as j}from"../../../utils/is-api-download-link.js";import{MdResolveError as g}from"./md-resolve-error.js";import{getLinkOriginalAttrName as B}from"./utils.js";import{isOpenApiURL as $}from"../../openapi-docs/is-openapi-doc.js";import{parseBaseName as C}from"../../utils.js";import{isMarkdownPage as V}from"../is-markdown-page.js";import{copyStaticFile as b}from"../../../utils/fs.js";async function at(i,s,E,{actions:k,context:f}){const{contentDir:d,outdir:S,getRouteByFsPath:w,hasRouteOrRedirectBySlug:A}=k,L=B(s),e=i[L]||U(i,s);if(i[L]=e,!D(e)||j(e)||W(e))return;const[z,t="",R,P]=/^([^\?#]+)?([^#]+)?(.+)?/.exec(e)||[],c=i.type==="image"?"IMAGE":"LINK",u=String(i.attributes.title||i.attributes.alt||M([i])||""),n=F(E);if(i.type!=="image"){const{isOpenapiDetected:r,isOpenapiValid:m}=await $(t,n,k,f);if(r&&!m)throw new g(`OpenAPI route ${e} does not exist`,{rawLink:e,link:t,title:u,brokenLinkType:c})}if(o.extname(t)===""){if(t.startsWith("/")){if(!A(h(t)))throw new g(`Route ${t} does not exist`,{rawLink:e,link:t,title:u,brokenLinkType:c});p(i,s,t+(R||"")+(P||""))}if(!e.startsWith("#")&&!t.startsWith("/")&&V(n)){const r=w(n)?.slug;if(!r)return;const{isIndexFile:m}=C(n),x=m?h(o.posix.join(r,t)):h(o.posix.join(r,"../",t));if(!A(h(x)))throw new g(`Route ${t} does not exist`,{rawLink:e,link:x,title:u,brokenLinkType:c});p(i,s,x+(R||"")+(P||""))}return}const a=t.startsWith("/")?t.substring(1):o.posix.join(o.posix.dirname(n),decodeURI(t)),_=t.startsWith("/")?o.posix.join("static",t.substring(1)):"",I=f.fs.exists(a),O=f.fs.exists(_),l=w(a);if(!I&&!l&&!O)throw p(i,s,"#"),new g(`File ${a} does not exist`,{rawLink:e,link:a,title:u,brokenLinkType:c});if(l){const r=[y,v,T].includes(l.templateId);p(i,s,(r?l.baseSlug:l.slug)+(P||""))}else if(I){const r=f.fs.getFileInfo(a);if(!r||r.isVirtual)return;const m=await b(d,r.realRelativePath,S);p(i,s,m)}}export{at as resolveLink};
@@ -0,0 +1,4 @@
1
+ import type { MarkdocTagSchema } from '@redocly/theme/markdoc/tags/types';
2
+ import type { RenderTagFn } from '../../../types/plugins/markdown';
3
+ export declare function createRenderTagFn(markdocTags: Record<string, MarkdocTagSchema> | undefined): RenderTagFn;
4
+ //# sourceMappingURL=create-render-tag-fn.d.ts.map
@@ -0,0 +1 @@
1
+ function t(e){return(r,n)=>{if(r.tag)return e?.[r.tag]?.renderForLlms?.(r,n)}}export{t as createRenderTagFn};
@@ -1,10 +1,9 @@
1
- import _ from"@markdoc/markdoc";import D from"node:path";import{AI_SEARCH_CHUNK_SIZE as E,AI_SEARCH_DOCUMENT_CHUNK_SIZE as M}from"../../../constants/plugins/search.js";import{slugger as P}from"../../../../utils/slugger.js";import{toMarkdown as U}from"./to-markdown.js";import{AstToSearchNodeTransformer as b}from"./walk-sections.js";import{getLocaleFromRelativePath as I}from"../../../fs/utils/get-locale-from-relative-path.js";import{HeadingNode as x}from"./nodes/heading-node.js";import{extractDocumentSearchFacets as y}from"./search-facets.js";import{formatDocumentMetadata as L}from"../../search/utils.js";import{TagNode as H}from"./nodes/tag-node.js";import{MARKDOC_PARTIALS_DATA_KEY as K}from"../../../store.js";const N=Symbol(),W=(n,r)=>async(e,c,s,i)=>{if(r?.excludeFromSearch)return;P.reset();const a=await e.getNavText?.()||D.basename(e.fsPath),m=_.Ast.fromJSON(c.ast),f=new b({partials:i.getGlobalConfig(K)||{},getInnerContent:U,ast:m,skipConditionals:!0}),d=Array.from(f.transform());return{async getLLMsTxts(){const o=r?.seo,g=o&&typeof o=="object"&&"description"in o?String(o.description):void 0,C=d.map(t=>t.content).filter(Boolean).join(`
2
- `).trim();return[{title:a,description:g,slug:e.slug,fsPath:e.fsPath,content:C,includeInLLMsTxt:!0}]},async getSearchDocuments(){return j(e,d,n,a)}}};function j(n,r,e,c){const s=n.slug,i=new Map,a=n.metadata||{},m=y(a,e),f=L(a),d=f?`Metadata:
1
+ import _ from"@markdoc/markdoc";import D from"node:path";import{AI_SEARCH_CHUNK_SIZE as E,AI_SEARCH_DOCUMENT_CHUNK_SIZE as M}from"../../../constants/plugins/search.js";import{slugger as P}from"../../../../utils/slugger.js";import{joinSectionContent as U}from"./join-section-content.js";import{toMarkdown as b}from"./to-markdown.js";import{AstToSearchNodeTransformer as I}from"./walk-sections.js";import{createRenderTagFn as x}from"./create-render-tag-fn.js";import{getLocaleFromRelativePath as y}from"../../../fs/utils/get-locale-from-relative-path.js";import{HeadingNode as L}from"./nodes/heading-node.js";import{extractDocumentSearchFacets as H}from"./search-facets.js";import{formatDocumentMetadata as K}from"../../search/utils.js";import{TagNode as N}from"./nodes/tag-node.js";import{MARKDOC_PARTIALS_DATA_KEY as R}from"../../../store.js";const j=Symbol(),et=(n,r)=>async(e,c,i,s)=>{if(r?.excludeFromSearch)return;P.reset();const a=await e.getNavText?.()||D.basename(e.fsPath),u=_.Ast.fromJSON(c.ast),f=new I({partials:s.getGlobalConfig(R)||{},renderTag:x(s.markdocOptions.tags),getInnerContent:b,ast:u,skipConditionals:!0}),d=Array.from(f.transform());return{async getLLMsTxts(){const o=r?.seo,g=o&&typeof o=="object"&&"description"in o?String(o.description):void 0,C=U(d);return[{title:a,description:g,slug:e.slug,fsPath:e.fsPath,content:C,includeInLLMsTxt:!0}]},async getSearchDocuments(){return F(e,d,n,a)}}};function F(n,r,e,c){const i=n.slug,s=new Map,a=n.metadata||{},u=H(a,e),f=K(a),d=f?`Metadata:
3
2
  ${f}
4
- `:"";let o=[];for(const t of r)if(t instanceof x){o.splice(t.attributes.level-1,6);const l=t.attributes.level>2,u=o[o.length-1]?.title,S=o[o.length-1]?.url,A=l&&u?u:w(c,t),T=l&&S?S:t.getUrl(s),h={title:A,content:"",url:T,level:t.attributes.level,toc:o.map(v=>p(v.section)).join(`
3
+ `:"";let o=[];for(const t of r)if(t instanceof L){o.splice(t.attributes.level-1,6);const l=t.attributes.level>2,m=o[o.length-1]?.title,S=o[o.length-1]?.url,T=l&&m?m:O(c,t),A=l&&S?S:t.getUrl(i),h={title:T,content:"",url:A,level:t.attributes.level,toc:o.map(v=>p(v.section)).join(`
5
4
  `)};(t.attributes.level>1||p(t)!==c)&&(h.content+=h.content?`
6
- `:"",h.content+=t.content.trimEnd()),i.set(t.id,h),o.push({section:t,title:A,url:T})}else if(t instanceof H)i.set(t.id,{title:t.content,content:t.content,url:t.getUrl(s),level:t.attributes.level+1,toc:o.map(l=>p(l.section)).concat(t.content).join(`
7
- `)});else{const l=t.parentNode?.id??N,u=i.get(l)??{title:c,content:"",url:s,level:1/0,toc:""};u.content+=u.content?`
8
- `:"",u.content+=t.content.trimEnd(),i.set(l,u)}const g=R(Array.from(i.values())),C=I(n.fsPath);return g.filter(t=>t.content).map(t=>({title:t.title,url:t.url,content:[d,t.toc||`# ${c}`,t.content].filter(Boolean).join(`
9
- `),fsPath:n.fsPath,locale:C,product:n.product?.name,facets:m}))}function k(n){return n.length/4}function R(n){if(n.length===0)return[];const r=[];let e=n[0];for(let c=1;c<n.length;c++){const s=n[c],i=k(e.content),a=k(s.content),m=c===n.length-1;a<E&&(i<M||m)&&s.level>e.level?e.content+=`
10
- `+s.content:(r.push(e),e=s)}return r.push(e),r}function w(n,r){return r.content===n?n:`${n} \u2192 ${p(r)}`}function p(n){return n.content.replace(/^#+/,"").trim()}export{W as getAiDocumentsStore};
5
+ `:"",h.content+=t.content.trimEnd()),s.set(t.id,h),o.push({section:t,title:T,url:A})}else if(t instanceof N)s.set(t.id,{title:t.content,content:t.content,url:t.getUrl(i),level:t.attributes.level+1,toc:o.map(l=>p(l.section)).concat(t.content).join(`
6
+ `)});else{const l=t.parentNode?.id??j,m=s.get(l)??{title:c,content:"",url:i,level:1/0,toc:""};m.content+=m.content?`
7
+ `:"",m.content+=t.content.trimEnd(),s.set(l,m)}const g=w(Array.from(s.values())),C=y(n.fsPath);return g.filter(t=>t.content).map(t=>({title:t.title,url:t.url,content:[d,t.toc||`# ${c}`,t.content].filter(Boolean).join(`
8
+ `),fsPath:n.fsPath,locale:C,product:n.product?.name,facets:u}))}function k(n){return n.length/4}function w(n){if(n.length===0)return[];const r=[];let e=n[0];for(let c=1;c<n.length;c++){const i=n[c],s=k(e.content),a=k(i.content),u=c===n.length-1;a<E&&(s<M||u)&&i.level>e.level?e.content+=`
9
+ `+i.content:(r.push(e),e=i)}return r.push(e),r}function O(n,r){return r.content===n?n:`${n} \u2192 ${p(r)}`}function p(n){return n.content.replace(/^#+/,"").trim()}export{et as getAiDocumentsStore};
@@ -0,0 +1,3 @@
1
+ import type { SearchNode } from './nodes/types';
2
+ export declare function joinSectionContent(sections: SearchNode[]): string;
3
+ //# sourceMappingURL=join-section-content.d.ts.map
@@ -0,0 +1,2 @@
1
+ function o(t){return t.map(n=>n.content.trimStart()).filter(Boolean).join(`
2
+ `).trim()}export{o as joinSectionContent};
@@ -1,11 +1,5 @@
1
1
  import { SectionNode, type SectionNodeParams } from './section-node.js';
2
- declare const HeadingNode_base: {
3
- new (...args: any[]): {
4
- [x: string]: any;
5
- "__#private@#id": string;
6
- get id(): string;
7
- };
8
- } & typeof SectionNode;
2
+ declare const HeadingNode_base: typeof SectionNode;
9
3
  export declare class HeadingNode extends HeadingNode_base {
10
4
  constructor(params: Omit<SectionNodeParams, 'parentNode'>);
11
5
  getUrl(slug: string): string;
@@ -17,19 +17,7 @@ export declare class SectionNode {
17
17
  get rbacTeams(): string[] | undefined;
18
18
  }
19
19
  type Constructor<T = any> = new (...args: any[]) => T;
20
- export declare function WithCounterId<TBase extends Constructor>(Base: TBase): {
21
- new (...args: any[]): {
22
- [x: string]: any;
23
- "__#private@#id": number;
24
- get id(): number;
25
- };
26
- } & TBase;
27
- export declare function WithSlugId<TBase extends Constructor>(Base: TBase): {
28
- new (...args: any[]): {
29
- [x: string]: any;
30
- "__#private@#id": string;
31
- get id(): string;
32
- };
33
- } & TBase;
20
+ export declare function WithCounterId<TBase extends Constructor>(Base: TBase): TBase;
21
+ export declare function WithSlugId<TBase extends Constructor>(Base: TBase): TBase;
34
22
  export {};
35
23
  //# sourceMappingURL=section-node.d.ts.map
@@ -1 +1 @@
1
- import{getInnerText as o}from"../../../../../markdoc/helpers/get-inner-text.js";import{slugger as c}from"../../../../../utils/slugger.js";class a{#t;#e;#r;#n;constructor(t){const{node:r,content:n,rbacTeams:s,parentNode:i}=t;this.#t=r,this.#e=n,this.#r=i,this.#n=s}get attributes(){return this.#t.attributes}get content(){return this.#e}get node(){return this.#t}get id(){throw new Error("SectionNode needs an id mixin applied")}get parentNode(){return this.#r}get rbacTeams(){return this.#n}}function h(e){let t=0;return class extends e{#t=++t;get id(){return this.#t}}}function g(e){return class extends e{#t;constructor(...t){super(...t);const r=this;this.#t=c.slug(o(r.node.children),{replaceDots:!0,replaceSlashes:!0})}get id(){return this.#t}}}export{a as SectionNode,h as WithCounterId,g as WithSlugId};
1
+ import{getInnerText as o}from"../../../../../markdoc/helpers/get-inner-text.js";import{slugger as d}from"../../../../../utils/slugger.js";class c{#t;#e;#r;#n;constructor(t){const{node:r,content:n,rbacTeams:i,parentNode:s}=t;this.#t=r,this.#e=n,this.#r=s,this.#n=i}get attributes(){return this.#t.attributes}get content(){return this.#e}get node(){return this.#t}get id(){throw new Error("SectionNode needs an id mixin applied")}get parentNode(){return this.#r}get rbacTeams(){return this.#n}}function a(e){let t=0;return class extends e{#t;get id(){return this.#t!==void 0?this.#t:(this.#t=++t,this.#t)}}}function g(e){return class extends e{#t;get id(){if(this.#t!==void 0)return this.#t;const t=this;return this.#t=d.slug(o(t.node.children),{replaceDots:!0,replaceSlashes:!0}),this.#t}}}export{c as SectionNode,a as WithCounterId,g as WithSlugId};
@@ -1,12 +1,6 @@
1
1
  import { SectionNode, type SectionNodeParams } from './section-node.js';
2
2
  export declare const TAG_TITLE_ATTRIBUTES: readonly ["title", "alt", "name", "label"];
3
- declare const TagNode_base: {
4
- new (...args: any[]): {
5
- [x: string]: any;
6
- "__#private@#id": number;
7
- get id(): number;
8
- };
9
- } & typeof SectionNode;
3
+ declare const TagNode_base: typeof SectionNode;
10
4
  export declare class TagNode extends TagNode_base {
11
5
  constructor(params: SectionNodeParams);
12
6
  getUrl(slug: string): string;
@@ -1,15 +1,17 @@
1
1
  import type { Node } from '@markdoc/markdoc';
2
2
  import type { GetInnerContentFn } from '../../../../types/index.js';
3
3
  import type { SearchNode } from './nodes/types.js';
4
+ import type { RenderTagFn } from '../../../types/plugins/markdown.js';
4
5
  type Params = {
5
6
  ast: Node;
6
7
  partials: Record<string, Node>;
7
8
  skipConditionals?: boolean;
8
9
  getInnerContent: GetInnerContentFn;
10
+ renderTag?: RenderTagFn;
9
11
  };
10
12
  export declare class AstToSearchNodeTransformer {
11
13
  #private;
12
- constructor({ ast, partials, skipConditionals, getInnerContent }: Params);
14
+ constructor({ ast, partials, skipConditionals, getInnerContent, renderTag }: Params);
13
15
  transform(): Generator<SearchNode, void, any>;
14
16
  }
15
17
  export {};
@@ -1 +1 @@
1
- import{logger as u}from"../../../tools/notifiers/logger.js";import{isNode as f}from"../../../../markdoc/helpers/guards/is-node.js";import{isConditionalNode as y}from"../../../../markdoc/helpers/guards/is-conditional-node.js";import{isContentNode as N}from"../../../../markdoc/helpers/guards/is-content-node.js";import{getNodeAttribute as n}from"../../../../markdoc/helpers/get-node-attribute.js";import{extractRbacFromCondition as T}from"../../../../markdoc/helpers/extract-rbac-from-condition-node.js";import{TextNode as e}from"./nodes/text-node.js";import{TAG_TITLE_ATTRIBUTES as b,TagNode as p}from"./nodes/tag-node.js";import{HeadingNode as a}from"./nodes/heading-node.js";class j{#s;#o;#i;#t;constructor({ast:i,partials:s,skipConditionals:r=!1,getInnerContent:t}){if(this.#s=i,this.#o=s,this.#i=r,this.#t=t,!this.#s||!f(this.#s))throw new Error("ast is not a valid Markdoc Node.")}*transform(){yield*this.#l(this.#s,{parentNode:null})}*#l(i,s,r=this.#t){if(!(!i||!f(i))){if(y(i)){if(this.#i)return;const t=T(i);t&&t.length>0&&(yield*this.#r(i,{...s,rbacTeams:t},r));return}if(N(i)){yield new e({node:i,content:r([i],{skipConditionals:this.#i}),...s});return}if(i.type==="heading"){yield new a({node:i,content:r([i],{skipConditionals:this.#i}),rbacTeams:s?.rbacTeams});return}if(i.type==="tag"){yield*this.#c(i,s,r);return}yield*this.#r(i,s,r)}}*#c(i,s,r=this.#t){switch(i.tag){case"partial":{const t=i.attributes.file,o=i.attributes.variables??{};if(t&&this.#o[t]){yield*this.#l(this.#o[t],s,(l,h)=>r(l,{...h,variables:o}));return}u.warn(`Could not create search indexes for partial \u201C${t}\u201D: file not found`);return}case"cards":case"tabs":case"code-walkthrough":{yield*this.#r(i,s,r);return}case"markdoc-example":{const t=r([i],{skipConditionals:this.#i});yield new e({node:i,content:t,...s});return}case"code-snippet":{const t=n(i,"title"),o=r([i],{skipConditionals:this.#i});if(t){const l=new p({node:i,content:t,...s});s={...s,parentNode:l},yield l}o&&(yield new e({node:i,content:o,...s}));return}default:{const t=b.find(c=>c in i.attributes),o=(t&&n(i,t))??"",l=typeof o=="string"?o:r([o]);if(l){const c=new p({node:i,content:l,...s});s={...s,parentNode:c},yield c}if(i.children.length>0||Object.keys(i.slots).length>0)yield*this.#r(i,s,r);else{const c=r([i],{skipConditionals:this.#i});c&&(yield new e({node:i,content:c,...s}))}return}}}*#r(i,s,r=this.#t){for(const t of[...Object.values(i.slots),...i.children])for(const o of this.#l(t,s,r))o instanceof a&&(s={...s,parentNode:o}),yield o}}export{j as AstToSearchNodeTransformer};
1
+ import{logger as N}from"../../../tools/notifiers/logger.js";import{isNode as h}from"../../../../markdoc/helpers/guards/is-node.js";import{isConditionalNode as T}from"../../../../markdoc/helpers/guards/is-conditional-node.js";import{isContentNode as m}from"../../../../markdoc/helpers/guards/is-content-node.js";import{getNodeAttribute as u}from"../../../../markdoc/helpers/get-node-attribute.js";import{extractRbacFromCondition as w}from"../../../../markdoc/helpers/extract-rbac-from-condition-node.js";import{TextNode as l}from"./nodes/text-node.js";import{TAG_TITLE_ATTRIBUTES as b,TagNode as p}from"./nodes/tag-node.js";import{HeadingNode as a}from"./nodes/heading-node.js";import{joinSectionContent as d}from"./join-section-content.js";class B{#s;#o;#i;#r;#c;constructor({ast:i,partials:t,skipConditionals:r=!1,getInnerContent:s,renderTag:o}){if(this.#s=i,this.#o=t,this.#i=r,this.#r=s,this.#c=o,!this.#s||!h(this.#s))throw new Error("ast is not a valid Markdoc Node.")}*transform(){yield*this.#e(this.#s,{parentNode:null})}*#e(i,t,r=this.#r){if(!(!i||!h(i))){if(T(i)){if(this.#i)return;const s=w(i);s&&s.length>0&&(yield*this.#t(i,{...t,rbacTeams:s},r));return}if(m(i)){yield new l({node:i,content:r([i],{skipConditionals:this.#i}),...t});return}if(i.type==="heading"){yield new a({node:i,content:r([i],{skipConditionals:this.#i}),rbacTeams:t?.rbacTeams});return}if(i.type==="tag"){yield*this.#l(i,t,r);return}yield*this.#t(i,t,r)}}*#l(i,t,r=this.#r){switch(i.tag){case"partial":{const s=i.attributes.file,o=i.attributes.variables??{};if(s&&this.#o[s]){yield*this.#e(this.#o[s],t,(e,n)=>r(e,{...n,variables:o}));return}N.warn(`Could not create search indexes for partial \u201C${s}\u201D: file not found`);return}case"cards":case"tabs":case"code-walkthrough":{yield*this.#t(i,t,r);return}case"markdoc-example":{const s=r([i],{skipConditionals:this.#i});yield new l({node:i,content:s,...t});return}case"code-snippet":{const s=u(i,"title"),o=r([i],{skipConditionals:this.#i});if(s){const e=new p({node:i,content:s,...t});t={...t,parentNode:e},yield e}o&&(yield new l({node:i,content:o,...t}));return}default:{const s=this.#n(i,t,r);if(s){yield*s;return}const o=b.find(c=>c in i.attributes),e=(o&&u(i,o))??"",n=typeof e=="string"?e:r([e]);if(n){const c=new p({node:i,content:n,...t});t={...t,parentNode:c},yield c}if(y(i))yield*this.#t(i,t,r);else{const c=r([i],{skipConditionals:this.#i});c&&(yield new l({node:i,content:c,...t}))}return}}}#n(i,t,r){const s=()=>y(i)?d([...this.#t(i,t,r)]):"",o=this.#c?.(i,{getBody:s});return o===void 0?void 0:[new l({node:i,content:o,...t})]}*#t(i,t,r=this.#r){for(const s of[...Object.values(i.slots),...i.children])for(const o of this.#e(s,t,r))o instanceof a&&(t={...t,parentNode:o}),yield o}}function y(f){return f.children.length>0||Object.keys(f.slots).length>0}export{B as AstToSearchNodeTransformer};
@@ -1,5 +1,5 @@
1
1
  import type { ContentItemModel, OpenAPIParser, Options, OpenAPIInfo } from '@redocly/openapi-docs';
2
- import type { AfterRoutesCreatedLifecycleContext, MdPageStaticData, PageRouteDetails } from '../../../types';
2
+ import type { AfterRoutesCreatedActions, AfterRoutesCreatedLifecycleContext, MdPageStaticData, PageRouteDetails } from '../../../types';
3
3
  import type { AiDocumentsStore } from '../../../plugins/search/types.js';
4
4
  import type { TagOperations } from '../types.js';
5
5
  import type { SearchFacet } from '@redocly/theme/core/types';
@@ -14,5 +14,5 @@ export declare const getAiDocumentsStore: ({ parser, options, info, tagOperation
14
14
  getSearchFacets: () => Map<string, SearchFacet>;
15
15
  includeInLLMsTxt: boolean;
16
16
  excludeFromSearch?: boolean;
17
- }) => (route: PageRouteDetails, staticData: MdPageStaticData, context: AfterRoutesCreatedLifecycleContext) => Promise<AiDocumentsStore | undefined>;
17
+ }) => (route: PageRouteDetails, staticData: MdPageStaticData, context: AfterRoutesCreatedLifecycleContext, actions: AfterRoutesCreatedActions) => Promise<AiDocumentsStore | undefined>;
18
18
  //# sourceMappingURL=get-ai-search-documents.d.ts.map