@redocly/realm 0.134.0-next.1 → 0.134.0-next.3
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 +36 -0
- package/dist/client/app/utils/getBlocksHeight.d.ts +5 -14
- package/dist/client/app/utils/getBlocksHeight.js +1 -1
- package/dist/client/app/utils/loadAndNavigate.js +1 -1
- package/dist/client/app/utils/syncScrollWithEditor.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/node-bundle-entry.js +1 -1
- package/dist/server/persistence/cache/repositories/cache-repository.js +1 -1
- package/dist/server/persistence/file-hashes/repositories/file-hashes-repository.js +1 -1
- package/dist/server/persistence/kv/repositories/kv-repository.d.ts +1 -1
- package/dist/server/persistence/kv/repositories/kv-repository.js +2 -2
- package/dist/server/persistence/kv/services/kv-service.d.ts +3 -2
- package/dist/server/persistence/kv/services/kv-service.js +1 -1
- package/dist/server/plugins/catalog-entities/database/catalog-entities-service.d.ts +2 -1
- package/dist/server/plugins/catalog-entities/database/catalog-entities-service.js +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/catalog-entities-repository.d.ts +1 -4
- package/dist/server/plugins/catalog-entities/database/repositories/catalog-entities-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-read-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-write-repository.js +1 -1
- package/dist/server/plugins/entitlements/utils/get-billed-catalog-build-pages-count.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/scorecards/database/repositories/scorecards-config-repository.d.ts +4 -0
- package/dist/server/plugins/scorecards/database/repositories/scorecards-config-repository.js +1 -1
- package/dist/server/plugins/scorecards/database/scorecards-config-service.d.ts +4 -4
- package/dist/server/plugins/scorecards/database/scorecards-config-service.js +1 -1
- package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.js +3 -1
- package/dist/server/providers/database/base-service.d.ts +25 -0
- package/dist/server/providers/database/base-service.js +1 -0
- package/dist/server/providers/database/database-preconnect-service.js +1 -1
- package/dist/server/providers/database/instance-cache-resolver.d.ts +19 -0
- package/dist/server/providers/database/instance-cache-resolver.js +1 -0
- 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/is-realm-or-reef.d.ts +2 -0
- package/dist/server/utils/is-realm-or-reef.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/dev-server.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/server/plugins/catalog-entities/utils/has-options-changed.d.ts +0 -2
- package/dist/server/plugins/catalog-entities/utils/has-options-changed.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{resolve as n,dirname as f}from"node:path";import{fileURLToPath as l}from"node:url";import{readFile as u}from"fs/promises";import{createReadStream as d}from"fs";import{envConfig as v}from"./config/env-config.js";import{telemetry as g}from"./telemetry/index.js";import{createRouter as S}from"./web-server/router.js";import{installProdRoutes as
|
|
1
|
+
import{resolve as n,dirname as f}from"node:path";import{fileURLToPath as l}from"node:url";import{readFile as u}from"fs/promises";import{createReadStream as d}from"fs";import{envConfig as v}from"./config/env-config.js";import{telemetry as g}from"./telemetry/index.js";import{createRouter as S}from"./web-server/router.js";import{installProdRoutes as R}from"./web-server/routes/index.js";import{Store as w}from"./store.js";import{loadEnvVariables as x}from"./utils/envs/load-env-variables.js";import{startHttpServer as D}from"./web-server/http.js";import{readStaticData as P}from"./utils/static-data.js";import{startIdleTimeout as E}from"./web-server/middleware/idleTimeoutMiddleware.js";import{reporter as y}from"./tools/notifiers/reporter.js";import{logger as b}from"./tools/notifiers/logger.js";import{EntitlementsProvider as h}from"./entitlements/entitlements-provider.js";import{DatabasePreconnectService as I}from"./providers/database/database-preconnect-service.js";import{KvService as O}from"./persistence/kv/services/kv-service.js";import{runScorecardsWorker as N}from"./plugins/scorecards/workers/run-scorecards-worker.js";import{isScorecardsEnabled as T}from"./utils/is-scorecards-enabled.js";import{isRealmOrReef as k}from"./utils/is-realm-or-reef.js";import{renderPage as or}from"./ssr/index.js";const A=new URL(import.meta.url),F=A.searchParams.get("only-exports")==="true";if(!F){let p=function(){const r=process.argv.findIndex(i=>i==="--port"||i==="-p");if(r===-1)return null;const t=process.argv[r+1];if(t.startsWith("-"))return null;const o=parseInt(t,10);return isNaN(o)?null:o};const e=f(l(import.meta.url));await x(e);const s=JSON.parse(await u(n(e,"./store.json"),"utf-8")),m=w.fromJson(s,{outdir:n(e,"../client"),serverOutDir:e,serverMode:!0,contentDir:""});if(await h.instance().init({ignoreTokenExpiration:!0}),k()){await I.init(e);const r=await O.getInstance({baseDbDir:e});setInterval(()=>{r.clearExpired().catch(t=>{b.error("Failed to clear expired KV entries",t)})},300*1e3)}c(m).catch(r=>{console.error(r)});async function c(r){g.initialize();const t=await S();R(t,r,{readStaticAsset:async a=>d(a),resolveRouteData:async a=>P(a.slug,r.outdir)}),y.printErrors();const o=p(),i=v.PORT;return await D(t,o??i??4e3),E(),T(r.config)&&N(r.serverOutDir,r.config.scorecards),t}}export{or as renderPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{and as
|
|
1
|
+
import{and as i,eq as a}from"drizzle-orm";import{isTtlExpired as m}from"../../../utils/is-ttl-expired.js";import{logger as n}from"../../../tools/notifiers/logger.js";import{cacheTable as r}from"../../../providers/database/databases/sqlite-db/schemas/cache-table.js";import{createDatabaseRepositoryInstance as d,InstanceCacheResolver as h}from"../../../providers/database/instance-cache-resolver.js";import{createCacheDbRecord as u}from"../mappers/create-cache-db-record.js";import{createCacheReadModel as p}from"../mappers/create-cache-read-model.js";class l{static#t=new h(e=>d(e,"cache",l));#e;constructor(e){this.#e=e.client}static async getInstance(e){return l.#t.get(e)}async get(e,t){const c=[a(r.key,e)];t&&c.push(a(r.namespace,t));const o=await this.#e.client.select().from(r).where(i(...c)).get();if(!o)return null;const s=p(o);return m(s.ttlInSeconds,s.createdAt)?(await this.delete(e,t),null):s}async set(e){try{const t=u(e);return await this.#e.client.insert(r).values(t).onConflictDoUpdate({target:[r.key],set:{value:t.value,namespace:t.namespace,ttl:t.ttl,updatedAt:t.updatedAt}}),t.key}catch(t){return n.error("Error setting cache: "+t.message),null}}async delete(e,t){try{return await this.#e.client.delete(r).where(i(a(r.key,e),a(r.namespace,t))),!0}catch(c){return n.error("Error deleting cache: "+c.message),!1}}async deleteByNamespace(e){try{return await this.#e.client.delete(r).where(a(r.namespace,e)),!0}catch(t){return n.error("Error deleting cache by namespace: "+t.message),!1}}async clearAll(){try{return await this.#e.client.delete(r),!0}catch(e){return n.error("Error clearing all cache: "+e.message),!1}}}export{l as CacheRepository};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{BaseRepository as a}from"../../../providers/database/base-repository.js";import{createDatabaseRepositoryInstance as r,InstanceCacheResolver as i}from"../../../providers/database/instance-cache-resolver.js";import{FileHashesWriteRepository as n}from"./file-hashes-write-repository.js";import{FileHashesReadRepository as l}from"./file-hashes-read-repository.js";class t extends a{static#s=new i(e=>r(e,"file hashes",t));#e;#t;constructor(e){super(e),this.#e=new l(this.databaseClient),this.#t=new n(this.databaseClient)}static async getInstance(e){return t.#s.get(e)}async getByPath(e){return this.#e.getByPath(e)}async getAllOutdated(e){return this.#e.getAllOutdated(e)}async getAllByFileType(e){return this.#e.getAllByFileType(e)}async upsertFileHash(e){return await this.#t.upsertFileHash(e)}async updateFileHashesStatus(e,s){return this.#t.updateFileHashes(e,s)}async deleteFileHashes(e){return this.#t.deleteFileHashes(e)}}export{t as FileHashesRepository};
|
|
@@ -5,7 +5,7 @@ export declare const KV_KEY_END_BOUNDARY = "\u0002";
|
|
|
5
5
|
export declare class KvRepository extends BaseRepository {
|
|
6
6
|
#private;
|
|
7
7
|
constructor(dbConnection: DatabaseConnection);
|
|
8
|
-
static
|
|
8
|
+
static create(options: RepositoryInstanceOptions): Promise<KvRepository>;
|
|
9
9
|
sync(): Promise<void>;
|
|
10
10
|
get<T extends KvValue = KvValue>(key: KvKey): Promise<T | null>;
|
|
11
11
|
getMany<T extends KvValue = KvValue>(keys: KvKey[]): Promise<(KvListEntry<T> | null)[]>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{eq as
|
|
2
|
-
All changes and data will only persist locally and will not be synced remotely.`),this.#
|
|
1
|
+
import{eq as b,and as m,gte as l,gt as B,lt as g,asc as S,desc as R,or as f,isNull as K,sql as o,inArray as L,count as M}from"drizzle-orm";import{logger as C}from"../../../tools/notifiers/logger.js";import{kvTable as e}from"../../../providers/database/databases/sqlite-db/schemas/kv-table.js";import{BaseRepository as N}from"../../../providers/database/base-repository.js";import{createDatabaseRepositoryInstance as T}from"../../../providers/database/instance-cache-resolver.js";import{createKvValue as $}from"../mappers/create-kv-value.js";import{createKvDbRecord as D,encodeKvKey as c}from"../mappers/create-kv-db-record.js";import{decodeCursor as k}from"../helpers/decode-cursor.js";import{encodeCursor as I}from"../helpers/encode-cursor.js";import{createKvListEntry as x}from"../mappers/create-kv-list-entry.js";const O="";class v extends N{#e=!1;constructor(t){super(t)}static create(t){return T(t,"kv",v)}async sync(){if(this.isNonRemoteDatabaseMode()){this.#e||(C.warn(`KV database is currently operating in local mode: not connected to the remote database.
|
|
2
|
+
All changes and data will only persist locally and will not be synced remotely.`),this.#e=!0);return}await this.databaseClient.sync()}async get(t){const n=c(t),r=await this.databaseClient.client.select().from(e).where(m(b(e.encodedKey,n),f(K(e.expiresAt),l(o`datetime(${e.expiresAt})`,o`datetime('now')`)))).get();return r?$(r):null}async getMany(t){if(t.length===0)return[];const n=t.map(d=>c(d)),r=f(K(e.expiresAt),l(o`datetime(${e.expiresAt})`,o`datetime('now')`)),a=await this.databaseClient.client.select().from(e).where(m(L(e.encodedKey,n),r)).all(),s=new Map(a.map(d=>[d.encodedKey,d]));return t.map((d,p)=>{const w=n[p],y=s.get(w);return y?x(y):null})}async list(t,n){const r=n?.limit??100,a=n?.reverse??!1,s=[],d=f(K(e.expiresAt),l(o`datetime(${e.expiresAt})`,o`datetime('now')`));if(s.push(d),"prefix"in t){const i=c(t.prefix),u="start"in t?c(t.start):i,E="end"in t?c(t.end):i+O;s.push(l(e.encodedKey,u)),s.push(g(e.encodedKey,E))}else if("start"in t&&"end"in t){const i=c(t.start),u=c(t.end);s.push(l(e.encodedKey,i)),s.push(g(e.encodedKey,u))}if(n?.cursor){const i=k(n.cursor),u=a?g(e.encodedKey,i):B(e.encodedKey,i);s.push(u)}const p=this.databaseClient.client.select().from(e),w=s.length>0?p.where(m(...s)):p,y=this.databaseClient.client.select({count:M()}).from(e),A=(await(s.length>0?y.where(m(...s)):y).get())?.count??0,h=await w.orderBy(a?R(e.encodedKey):S(e.encodedKey)).limit(r).all();return{items:h.map(i=>x(i)),total:A,cursor:A>h.length?I(h[h.length-1]?.encodedKey):null}}async set(t,n,r){const a=D({key:t,value:n,ttlInSeconds:r?.ttlInSeconds});return await this.databaseClient.client.insert(e).values(a).onConflictDoUpdate({target:[e.encodedKey],set:{value:a.value,expiresAt:a.expiresAt,updatedAt:a.updatedAt}}),x(a)}async delete(t){const n=c(t);await this.databaseClient.client.delete(e).where(b(e.encodedKey,n))}async clearExpired(){await this.databaseClient.client.delete(e).where(g(o`datetime(${e.expiresAt})`,o`datetime('now')`))}async transaction(t){return this.databaseClient.transactionsManager.transaction(async()=>t({get:async r=>this.get(r),getMany:async r=>this.getMany(r),set:async(r,a,s)=>this.set(r,a,s),delete:async r=>this.delete(r)}))}async getTotalStoredEntryBytes(){try{return await this.getTableSizeInBytes("kv")}catch(t){return C.error("Error getting total kv stored entry bytes",t),0}}async getStoredEntrySizeByEncodedKey(t){try{const n=f(K(e.expiresAt),l(o`datetime(${e.expiresAt})`,o`datetime('now')`)),r=await this.databaseClient.client.select({bytes:o`COALESCE(LENGTH(CAST(${e.encodedKey} AS BLOB)) + LENGTH(CAST(${e.value} AS BLOB)), 0)`}).from(e).where(m(b(e.encodedKey,t),n)).get();return Number(r?.bytes??0)}catch(n){return C.error("Error getting kv entry size by encoded key",n),0}}}export{O as KV_KEY_END_BOUNDARY,v as KvRepository};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { KvValue, KvKey, KvListEntry, KvSetOptions, KvListOptions, KvListResponse, KvListSelector, KvTransaction } from '@redocly/config';
|
|
2
2
|
import type { ServiceInstanceOptions } from '../../../providers/database/types.js';
|
|
3
|
+
import { BaseService } from '../../../providers/database/base-service.js';
|
|
3
4
|
import { KvRepository } from '../repositories/kv-repository.js';
|
|
4
|
-
export declare class KvService {
|
|
5
|
+
export declare class KvService extends BaseService<KvRepository> {
|
|
5
6
|
#private;
|
|
6
|
-
constructor(repository: KvRepository
|
|
7
|
+
constructor(repository: KvRepository, options?: ServiceInstanceOptions);
|
|
7
8
|
static getInstance(options: ServiceInstanceOptions): Promise<KvService>;
|
|
8
9
|
/**
|
|
9
10
|
* Get a kv entry by key
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PLAN_GATES_DEFAULTS as
|
|
1
|
+
import{PLAN_GATES_DEFAULTS as g}from"../../../constants/entitlements.js";import{EntitlementsProvider as m}from"../../../entitlements/entitlements-provider.js";import{BaseService as S}from"../../../providers/database/base-service.js";import{InstanceCacheResolver as f}from"../../../providers/database/instance-cache-resolver.js";import{StorageLimitValidator as h}from"../../../providers/database/utils/storage-limit-validator.js";import{KvRepository as p}from"../repositories/kv-repository.js";import{encodeKvKey as E}from"../mappers/create-kv-db-record.js";import{kvKeyValidator as i,kvListOptionsValidator as B,kvListSelectorValidator as w,kvSetOptionsValidator as d}from"../schemas/kv-schemas.js";const k=100*1024*1024;class l extends S{static#n=new f(async t=>new l(await p.create(t),t));#t;constructor(t,e){super(e,{repository:t,createRepository:p.create}),this.#t=new h}static async getInstance(t){return l.#n.get(t)}async get(t){const e=i.parse(t);return this.runRead(r=>r.get(e))}async getMany(t){if(t.length===0)return[];const e=t.map(r=>i.parse(r));return this.runRead(r=>r.getMany(e))}async list(t,e){const r=w.parse(t),s=B.parse(e??{});return this.runRead(n=>n.list(r,s))}async set(t,e,r){const s=i.parse(t),n=d.parse(r??{});this.#e(e);const a=JSON.stringify(e);return this.#r(a),await this.#s(s,a),this.runWrite(o=>o.set(s,e,n))}async delete(t){const e=i.parse(t);await this.runWrite(r=>r.delete(e))}async clearExpired(){await this.runWrite(t=>t.clearExpired())}async transaction(t){return await this.syncRepositoryIfNeeded(),this.getRepository().transaction(async e=>t({get:async s=>{const n=i.parse(s);return e.get(n)},getMany:async s=>{const n=s.map(a=>i.parse(a));return e.getMany(n)},set:async(s,n,a)=>{const o=i.parse(s),c=d.parse(a??{});this.#e(n);const y=JSON.stringify(n);return this.#r(y),await this.#s(o,y,{skipSync:!0}),e.set(o,n,c)},delete:async s=>{const n=i.parse(s);return e.delete(n)}}))}#e(t){try{JSON.stringify(t)}catch(e){const r=e instanceof Error?e.message:"Unknown error";throw new Error(`Value is not JSON serializable: ${r}`)}}#r(t){const r=Buffer.byteLength(t,"utf8");if(r>1048576){const s=(r/1024).toFixed(2);throw new Error(`Value size (${s} KB) exceeds the maximum allowed size of 1 MB (1024 KB)`)}}async#s(t,e,r){const s=E(t),n=await this.runRead(async c=>{const y=await c.getTotalStoredEntryBytes(),u=await c.getStoredEntrySizeByEncodedKey(s);return{currentTotalStoredEntryBytes:y,existingEntryBytes:u}},{onRepositoryMissing:()=>null,skipSync:r?.skipSync??!1});if(!n)return;const a=Math.max(0,n.currentTotalStoredEntryBytes-k),o=Buffer.byteLength(s,"utf8")+Buffer.byteLength(e,"utf8");this.#t.validate({storageLimitGb:this.#a(),currentTotalBytes:a,existingEntryBytes:n.existingEntryBytes,incomingEntryBytes:o,errorMessagePrefix:"KV storage limit"})}#a(){const t=m.instance().entitlements?.kvStorageLimit;return typeof t=="number"&&t>0?t:g.pro.kvStorageLimit}}export{l as KvService};
|
|
@@ -8,10 +8,11 @@ import type { Filter } from '../../../providers/database/pagination/types.js';
|
|
|
8
8
|
import type { ScorecardsStatus } from '../entities/types.js';
|
|
9
9
|
import type { GetEntityByIdParams } from '../types/params.js';
|
|
10
10
|
import type { BulkSyncResult } from './types.js';
|
|
11
|
+
import { BaseService } from '../../../providers/database/base-service.js';
|
|
11
12
|
import { type EntityDtoSchema, type EntityRelationDtoSchema } from '../schemas/dto-schemas.js';
|
|
12
13
|
import { CatalogEntitiesRepository } from './repositories/catalog-entities-repository.js';
|
|
13
14
|
import { type ListResponseResult } from '../../../web-server/utils/prepare-list-response.js';
|
|
14
|
-
export declare class CatalogEntitiesService {
|
|
15
|
+
export declare class CatalogEntitiesService extends BaseService<CatalogEntitiesRepository> {
|
|
15
16
|
#private;
|
|
16
17
|
constructor(catalogEntitiesRepository: CatalogEntitiesRepository, options?: ServiceInstanceOptions);
|
|
17
18
|
static getInstance(options: ServiceInstanceOptions): Promise<CatalogEntitiesService>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{promiseMapLimit as
|
|
1
|
+
import{promiseMapLimit as d}from"../../../utils/async/promise-map-limit.js";import{envConfig as u}from"../../../config/env-config.js";import{BaseService as p}from"../../../providers/database/base-service.js";import{InstanceCacheResolver as W}from"../../../providers/database/instance-cache-resolver.js";import{CatalogEntitiesRepository as l}from"./repositories/catalog-entities-repository.js";import{prepareListResponse as y}from"../../../web-server/utils/prepare-list-response.js";import{ENTITY_RELATION_FROM_DATABASE as E}from"./mappers/field-transformations.js";const R=15;class c extends p{static#e=new W(async t=>new c(await l.create(t),t));#t={};constructor(t,e){super(e,{repository:t,createRepository:l.create})}static async getInstance(t){return c.#e.get(t)}async sync(){await this.syncRepositoryIfNeeded()}async transaction(...t){return this.getRepository().transactionsManager.transaction(...t)}async getEntities({paginationParams:t,rbacTeams:e,excludedTypes:i,excludedEntities:n}){return this.runRead(async s=>{const{items:r,total:a,hasMore:o}=await s.entitiesRead.getEntities({paginationParams:t,rbacTeams:e,excludedTypes:i,excludedEntities:n});return y({data:r,params:t,totalCount:a,hasMore:o})})}async getEntityById(t,e){return this.runRead(async i=>await i.entitiesRead.getEntityById(t,e)??null)}async getEntityKeysAndVersionsBySourceFile(t){return this.runRead(e=>e.entitiesRead.getEntityKeysAndVersionsBySourceFile(t))}async getEntitiesCountByTypes(){return this.runRead(t=>t.entitiesRead.getEntitiesCountByTypes())}async getCatalogFilters(t){return this.runRead(e=>e.filters.getCatalogFilters(t))}async getEntityRelationById(t){return this.runRead(async e=>await e.relationsRead.getEntityRelationById(t)??null)}async getEntitiesRelations(t={}){return this.runRead(async e=>{const{items:i,total:n,hasMore:s}=await e.relationsRead.getEntitiesRelations(t);return y({data:i,params:t,totalCount:n,nameTransformationsFromDatabase:E,hasMore:s})})}async getEntitiesWithRelations({paginationParams:t,rbacTeams:e,excludedTypes:i,excludedEntities:n}){return this.runRead(async s=>{const{items:r,total:a,hasMore:o}=await s.bffEntitiesRead.getEntitiesWithRelations({paginationParams:t,rbacTeams:e,excludedTypes:i,excludedEntities:n});return y({data:r,params:t,totalCount:a,hasMore:o})})}async getEntityWithRelationsByKey({entityKey:t,filter:e,rbacTeams:i,excludedTypes:n,excludedEntities:s}){return this.runRead(r=>r.bffEntitiesRead.getEntityWithRelationsByKey({entityKey:t,filter:e,rbacTeams:i,excludedTypes:n,excludedEntities:s}))}async getRelatedEntities({entityKey:t,paginationParams:e,rbacTeams:i,excludedTypes:n,excludedEntities:s}){return this.runRead(async r=>{const{items:a,total:o,hasMore:h}=await r.relationsRead.getRelatedEntities({key:t,paginationParams:e,rbacTeams:i,excludedTypes:n,excludedEntities:s});return y({data:a,params:e,totalCount:o,nameTransformationsFromDatabase:E,hasMore:h})})}async listEntityRevisions(t,e){return this.runRead(i=>i.revisions.listEntityRevisions(t,e))}async getOutdatedEntities(t){return this.runRead(e=>e.entitiesRead.getOutdatedEntities(t))}async getEntitiesCount(t,e,i){return this.runRead(n=>n.entitiesRead.getEntitiesCount(t,e,i))}async createEntity(t){if(u.isDevelopMode&&t.source==="remote")throw new Error("API based entity creation is not supported in the develop mode");return t.isRootEntity&&t.sourceFile&&(this.#t[t.sourceFile]={key:t.entity.key,version:t.entity.version??void 0}),this.runWrite(e=>e.entitiesWrite.createEntity(t))}async createEntities(t,e){if(u.isDevelopMode&&e==="remote")throw new Error("API based entity creation is not supported in the develop mode");return await d(t,R,async i=>this.runWrite(n=>n.entitiesWrite.createEntity({entity:i,source:e})).then(n=>({status:"ok",resource:n})).catch(n=>({key:i.key,status:"error",error:n})))}getEntitySources(){return this.#t}async createEntityRelations(t){await this.runWrite(e=>e.relationsWrite.createEntityRelations(t))}async updateEntity(t,e){if(u.isDevelopMode&&e.source==="remote")throw new Error("Entity update is not supported in the develop mode");return this.runWrite(i=>i.transactionsManager.transaction(()=>i.entitiesWrite.updateEntity(t,e)))}async deleteEntity(t){if(u.isDevelopMode&&t.source==="remote")throw new Error("Entity deletion is not supported in the develop mode");return this.runWrite(e=>e.entitiesWrite.deleteEntity(t))}async deleteEntities(t){await this.runWrite(async e=>{await e.entitiesWrite.deleteEntities(t)})}async createEntityRelation(t){return this.runWrite(e=>e.relationsWrite.createEntityRelation(t))}async createEntitiesRelations(t){return await d(t,R,async e=>this.runWrite(i=>i.relationsWrite.createEntityRelation(e)).then(i=>({status:"ok",resource:i})).catch(i=>({key:e.sourceKey,status:"error",error:i})))}async updateEntityRelation(t,e){const i={...e,...t,type:t.type??e.type};return this.runWrite(n=>n.relationsWrite.createEntityRelation(i))}async deleteEntityRelation(t){return this.runWrite(e=>e.relationsWrite.deleteEntityRelation(t))}async softDeleteEntitiesWithRelations({filter:t,revision:e,fileHash:i}){return this.runWrite(n=>n.entitiesWrite.softDeleteEntitiesWithRelations({filter:t,revision:e,fileHash:i}))}async updateEntityScorecardsStatus(t,e){return this.runWrite(i=>i.entitiesWrite.updateEntityScorecardsStatus(t,e))}async updateEntityScorecardsStatusIfCalculating(t,e){return this.runWrite(i=>i.entitiesWrite.updateEntityScorecardsStatusIfCalculating(t,e))}async setEntitiesAsOutdated(t){await this.runWrite(async e=>{await e.entitiesWrite.setEntitiesAsOutdated(t)})}}export{c as CatalogEntitiesService};
|
package/dist/server/plugins/catalog-entities/database/repositories/catalog-entities-repository.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { EntitiesWriteRepository } from './entities/entities-write-repository.js
|
|
|
8
8
|
import { RelationsWriteRepository } from './relations/relations-write-repository.js';
|
|
9
9
|
import { FiltersRepository } from './common/filters-repository.js';
|
|
10
10
|
export declare class CatalogEntitiesRepository extends BaseRepository {
|
|
11
|
-
#private;
|
|
12
11
|
readonly entitiesRead: EntitiesReadRepository;
|
|
13
12
|
readonly entitiesWrite: EntitiesWriteRepository;
|
|
14
13
|
readonly relationsRead: RelationsReadRepository;
|
|
@@ -19,8 +18,6 @@ export declare class CatalogEntitiesRepository extends BaseRepository {
|
|
|
19
18
|
get transactionsManager(): import("../../../../providers/database/transactions-manager.js").TransactionsManager;
|
|
20
19
|
constructor(dbConnection: DatabaseConnection);
|
|
21
20
|
sync(): Promise<void>;
|
|
22
|
-
static
|
|
23
|
-
static recreateInstance(options: RepositoryInstanceOptions): Promise<CatalogEntitiesRepository>;
|
|
24
|
-
static resetInstance(): Promise<void>;
|
|
21
|
+
static create(options: RepositoryInstanceOptions): Promise<CatalogEntitiesRepository>;
|
|
25
22
|
}
|
|
26
23
|
//# sourceMappingURL=catalog-entities-repository.d.ts.map
|
package/dist/server/plugins/catalog-entities/database/repositories/catalog-entities-repository.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{logger as
|
|
1
|
+
import{logger as o}from"../../../../tools/notifiers/logger.js";import{telemetryTraceStep as i}from"../../../../telemetry/helpers/trace-step.js";import{BaseRepository as a}from"../../../../providers/database/base-repository.js";import{createDatabaseRepositoryInstance as n}from"../../../../providers/database/instance-cache-resolver.js";import{RelationsReadRepository as c}from"./relations/relations-read-repository.js";import{RevisionRepository as p}from"./common/revision-repository.js";import{BffEntitiesReadRepository as l}from"./bffEntities/bff-entities-read-repository.js";import{EntitiesReadRepository as m}from"./entities/entities-read-repository.js";import{EntitiesWriteRepository as y}from"./entities/entities-write-repository.js";import{RelationsWriteRepository as R}from"./relations/relations-write-repository.js";import{FiltersRepository as f}from"./common/filters-repository.js";class r extends a{entitiesRead;entitiesWrite;relationsRead;relationsWrite;bffEntitiesRead;filters;revisions;get transactionsManager(){return this.databaseClient.transactionsManager}constructor(t){super(t),this.revisions=new p(t.client),this.bffEntitiesRead=new l(t.client),this.relationsRead=new c(t.client),this.entitiesRead=new m(t.client),this.entitiesWrite=new y(t.client,this.organizationId,this.projectId),this.relationsWrite=new R(t.client,this.organizationId,this.projectId),this.filters=new f(t.client)}async sync(){return i("catalog_entities.repository.sync",async()=>{await this.databaseClient.sync()})}static async create(t){return await i("catalog_entities.repository.get_instance",async s=>{try{return await n(t,"catalog entities",r)}catch(e){throw o.error("Error creating db connection for catalog entities repository",e),s?.error(e),e}})}}export{r as CatalogEntitiesRepository};
|