@redocly/redoc 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.
- package/CHANGELOG.md +21 -0
- package/dist/client/app/utils/loadAndNavigate.js +1 -1
- package/dist/client/providers/hooks.js +1 -1
- package/dist/client/templates/asyncapi-docs/helpers.d.ts +3 -13
- package/dist/compiled/svgo/svgo-node.js +55 -49
- package/dist/constants/common.d.ts +1 -0
- package/dist/constants/common.js +1 -1
- package/dist/markdoc/tags/index.d.ts +30 -0
- package/dist/markdoc/types.d.ts +2 -2
- package/dist/server/api-routes/run-api-routes-worker.js +1 -1
- package/dist/server/config/env-config.d.ts +6 -0
- package/dist/server/config/env-schema.d.ts +149 -2
- package/dist/server/config/env-schema.js +1 -1
- package/dist/server/config/env-schemas/feature-flags.d.ts +12 -0
- package/dist/server/config/env-schemas/feature-flags.js +1 -1
- package/dist/server/constants/feedback.d.ts +2 -0
- package/dist/server/constants/feedback.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-link.js +1 -1
- package/dist/server/plugins/markdown/search/create-render-tag-fn.d.ts +4 -0
- package/dist/server/plugins/markdown/search/create-render-tag-fn.js +1 -0
- package/dist/server/plugins/markdown/search/get-ai-search-documents.js +7 -8
- package/dist/server/plugins/markdown/search/join-section-content.d.ts +3 -0
- package/dist/server/plugins/markdown/search/join-section-content.js +2 -0
- package/dist/server/plugins/markdown/search/nodes/heading-node.d.ts +1 -7
- package/dist/server/plugins/markdown/search/nodes/section-node.d.ts +2 -14
- package/dist/server/plugins/markdown/search/nodes/section-node.js +1 -1
- package/dist/server/plugins/markdown/search/nodes/tag-node.d.ts +1 -7
- package/dist/server/plugins/markdown/search/walk-sections.d.ts +3 -1
- package/dist/server/plugins/markdown/search/walk-sections.js +1 -1
- package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.d.ts +2 -2
- package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.js +30 -30
- package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.js +3 -1
- package/dist/server/store.d.ts +2 -34
- package/dist/server/types/plugins/common.d.ts +5 -0
- package/dist/server/types/plugins/markdown.d.ts +3 -0
- package/dist/server/utils/is-api-download-link.d.ts +2 -0
- package/dist/server/utils/is-api-download-link.js +1 -0
- package/dist/server/utils/llmstxt/agent-feedback-llms-footer.d.ts +3 -0
- package/dist/server/utils/llmstxt/agent-feedback-llms-footer.js +2 -0
- package/dist/server/utils/shared-data.js +1 -1
- package/dist/server/web-server/routes/auth.js +1 -1
- package/dist/server/web-server/routes/feedback.d.ts +16 -0
- package/dist/server/web-server/routes/feedback.js +1 -1
- package/dist/server/web-server/utils/feedback-ip.d.ts +2 -0
- package/dist/server/web-server/utils/feedback-ip.js +1 -0
- package/dist/server/web-server/utils/get-client-ip.d.ts +1 -0
- package/dist/server/web-server/utils/get-client-ip.js +1 -1
- package/dist/utils/auth/is-auth-route-path.js +1 -0
- package/package.json +7 -7
- package/dist/client/utils/auth/is-auth-route-path.js +0 -1
- /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";
|
package/dist/constants/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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
|
};
|
package/dist/markdoc/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MarkdocTagSchema } from '@redocly/theme/markdoc/tags/types';
|
|
2
2
|
export type CustomMarkdocTag = {
|
|
3
|
-
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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{
|
|
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
|
|
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()),
|
|
7
|
-
`)});else{const l=t.parentNode?.id??
|
|
8
|
-
`:"",
|
|
9
|
-
`),fsPath:n.fsPath,locale:C,product:n.product?.name,facets:
|
|
10
|
-
`+
|
|
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};
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
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
|