@redocly/realm 0.136.0-next.1 → 0.136.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 +29 -0
- package/dist/cli/eject/ejectComponent.d.ts +1 -1
- package/dist/cli/eject/ejectTheme.d.ts +1 -1
- package/dist/cli/eject/themeOperations.d.ts +2 -2
- package/dist/client/TestProvider.d.ts +1 -1
- package/dist/client/app/ConditionalLink.d.ts +1 -1
- package/dist/client/app/hooks/catalog/useCatalogFilter.d.ts +1 -1
- package/dist/client/app/hooks/catalog/useCatalogViewMode.js +1 -1
- package/dist/client/app/hooks/catalog/useFetchCatalogEntities.d.ts +1 -1
- package/dist/client/app/hooks/catalog/useFetchCatalogEntities.js +1 -1
- package/dist/client/app/hooks/catalog/useFetchCatalogEntitiesRelations.d.ts +2 -2
- package/dist/client/app/hooks/catalog/useFetchCatalogEntitiesRelations.js +1 -1
- package/dist/client/app/hooks/catalog/useFetchCatalogEntityRevisions.d.ts +1 -1
- package/dist/client/app/hooks/catalog/useSearchTracker.d.ts +2 -5
- package/dist/client/app/hooks/catalog/useSearchTracker.js +1 -1
- package/dist/client/app/hooks/codeHighlight/useCodeHighlight.d.ts +1 -6
- package/dist/client/app/pages/DevLogin/DevLoginForm.d.ts +1 -1
- package/dist/client/app/useGlobalData.d.ts +1 -1
- package/dist/client/app/utils/loadAndNavigate.d.ts +1 -1
- package/dist/client/providers/page-data/hooks.d.ts +2 -2
- package/dist/client/providers/post-message/use-post-message.d.ts +1 -1
- package/dist/markdoc/helpers/get-operation/get-operation.d.ts +1 -1
- package/dist/markdoc/tags/index.d.ts +48 -2
- package/dist/server/api-routes/helpers/read-stream-with-size-limit.d.ts +1 -1
- package/dist/server/api-routes/run-api-routes-worker.d.ts +1 -1
- package/dist/server/api-routes/run-api-routes-worker.js +1 -1
- package/dist/server/config/env-config.d.ts +2 -0
- package/dist/server/config/env-schema.d.ts +5 -0
- package/dist/server/config/env-schemas/feature-flags.d.ts +4 -0
- package/dist/server/config/env-schemas/feature-flags.js +1 -1
- package/dist/server/persistence/cache/mappers/create-cache-db-record.d.ts +1 -1
- package/dist/server/persistence/file-hashes/mappers/create-file-hash-db-record.d.ts +1 -1
- package/dist/server/persistence/kv/mappers/create-kv-db-record.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/catalog-entities-diff-publisher.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/catalog-entities-revisions-pruner.d.ts +4 -2
- package/dist/server/plugins/catalog-entities/database/catalog-entities-revisions-pruner.js +23 -3
- package/dist/server/plugins/catalog-entities/database/catalog-entities-service.d.ts +5 -5
- package/dist/server/plugins/catalog-entities/database/mappers/create-entity-attributes-db-record.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/mappers/create-entity-db-record.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/mappers/create-entity-relation-db-record-from-file-schema.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/remote-publish-lock-service.d.ts +3 -3
- package/dist/server/plugins/catalog-entities/database/repositories/bffEntities/bff-entities-read-repository.d.ts +2 -2
- package/dist/server/plugins/catalog-entities/database/repositories/common/filters-repository.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/common/revision-repository.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-read-repository.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-write-repository.d.ts +2 -2
- package/dist/server/plugins/catalog-entities/database/repositories/entities/entities-write-repository.js +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/entityAttributes/entity-attributes-write-repository.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/database/repositories/relations/relations-read-repository.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.d.ts +5 -2
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/base.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/fs-entities-extractor.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/plugin.js +1 -1
- package/dist/server/plugins/catalog-entities/utils/get-not-accessible-catalog-resources.d.ts +1 -1
- package/dist/server/plugins/catalog-entities/utils/openapi-component-content-extractor.d.ts +1 -1
- package/dist/server/plugins/dev-onboarding/index.d.ts +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/RevokeAPIKey.d.ts +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/RollAPIKey.d.ts +1 -1
- package/dist/server/plugins/graphql-docs/search/ai/utils.d.ts +1 -1
- package/dist/server/plugins/markdown/markdoc/markdoc-options.d.ts +9 -9
- package/dist/server/plugins/markdown/markdoc/plugins/utils.d.ts +5 -0
- package/dist/server/plugins/markdown/markdoc/plugins/utils.js +1 -1
- package/dist/server/plugins/markdown/runtime-transform.js +1 -1
- package/dist/server/plugins/markdown/utils/resolve-markdown-template.d.ts +1 -1
- package/dist/server/plugins/mcp/auth/auth-handlers.d.ts +2 -0
- package/dist/server/plugins/mcp/auth/auth-handlers.js +1 -1
- package/dist/server/plugins/mcp/codemode/prompts.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tool-schemas.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/constants.d.ts +2 -0
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/constants.js +1 -0
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-endpoint-info.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-security-schemes.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/utils.d.ts +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/utils.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/utils.d.ts +2 -2
- package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.d.ts +1 -1
- package/dist/server/plugins/mcp/servers/docs-server.d.ts +1 -1
- package/dist/server/plugins/mcp/workers/mcp-tool-telemetry.d.ts +2 -2
- package/dist/server/plugins/scorecard-classic/compute-scorecard.d.ts +1 -1
- package/dist/server/plugins/scorecard-classic/index.d.ts +1 -1
- package/dist/server/plugins/scorecard-classic/template/components.d.ts +1 -1
- package/dist/server/plugins/scorecard-classic/template/useData.d.ts +1 -1
- package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.d.ts +1 -1
- package/dist/server/plugins/search/engines/search-engine.d.ts +1 -1
- package/dist/server/plugins/search/llmstxt/index.d.ts +1 -1
- package/dist/server/plugins/sidebars/index.d.ts +1 -1
- package/dist/server/providers/database/database-path-generator.d.ts +2 -2
- package/dist/server/providers/database/utils/storage-limit-validator.d.ts +1 -1
- package/dist/server/sandbox/sandbox.js +2 -2
- package/dist/server/ssr/server-side-props/get-default-static-props.d.ts +1 -1
- package/dist/server/ssr/server-side-props/get-server-props-from-user-handler.d.ts +1 -1
- package/dist/server/ssr/template.d.ts +1 -1
- package/dist/server/store.js +1 -1
- package/dist/server/utils/sandbox-context.d.ts +18 -0
- package/dist/server/utils/sandbox-context.js +1 -0
- package/dist/server/web-server/auth.d.ts +1 -1
- package/dist/server/web-server/middleware/catalogAuthMiddleware.d.ts +1 -1
- package/dist/server/web-server/routes/auth.js +1 -1
- package/dist/server/web-server/routes/catalog/helpers/has-access-to-entity.d.ts +1 -1
- package/dist/server/web-server/routes/catalog/helpers/upsert-pages-stats.d.ts +1 -1
- package/dist/server/web-server/routes/feedback.d.ts +1 -1
- package/dist/server/web-server/routes/helpers/process-redirects.d.ts +1 -1
- package/dist/server/web-server/routes/mcp-routes/mcp-oauth.d.ts +5 -4
- package/dist/server/web-server/routes/mcp-routes/mcp-oauth.js +1 -1
- package/dist/server/web-server/routes/mcp-routes/mcp-routes.js +1 -1
- package/dist/server/web-server/routes/mcp-routes/utils/build-agent-card.d.ts +1 -1
- package/dist/server/web-server/utils/prepare-list-response.d.ts +1 -1
- package/dist/server/workers/api-routes-worker-pool.js +1 -1
- package/dist/server/workers/mcp-tool-worker-pool.js +1 -1
- package/dist/server/workers/worker-pool.d.ts +1 -0
- package/dist/server/workers/worker-pool.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @redocly/realm
|
|
2
2
|
|
|
3
|
+
## 0.136.0-next.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [0ca40bb3a4f]
|
|
8
|
+
- @redocly/openapi-docs@3.24.0-next.3
|
|
9
|
+
- @redocly/asyncapi-docs@1.13.0-next.3
|
|
10
|
+
- @redocly/graphql-docs@1.13.0-next.3
|
|
11
|
+
- @redocly/portal-plugin-mock-server@0.21.0-next.3
|
|
12
|
+
|
|
13
|
+
## 0.136.0-next.2
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- 94b73e18acd: Added `numbered-list` and `item` Markdoc tags to render step-by-step guides with numbered, icon, or dot markers and deep-linkable item headlines.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 14597a56ac1: Fixed the built-in Docs MCP OAuth flow for public sites so they no longer advertise an authorization server or force a login.
|
|
22
|
+
|
|
23
|
+
Resolved the real `idpId` for protected sites using custom SSO.
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [94b73e18acd]
|
|
26
|
+
- @redocly/theme@0.68.0-next.1
|
|
27
|
+
- @redocly/asyncapi-docs@1.13.0-next.2
|
|
28
|
+
- @redocly/graphql-docs@1.13.0-next.2
|
|
29
|
+
- @redocly/openapi-docs@3.24.0-next.2
|
|
30
|
+
- @redocly/portal-plugin-mock-server@0.21.0-next.2
|
|
31
|
+
|
|
3
32
|
## 0.136.0-next.1
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EjectComponentOptions, EjectOptions } from '../../types/index.js';
|
|
2
|
-
export default function ejectComponent({ pathToThemeFolder, pathToPortalCustomThemeFolder, componentToEject, theme }: EjectComponentOptions, options: EjectOptions): Promise<void>;
|
|
2
|
+
export default function ejectComponent({ pathToThemeFolder, pathToPortalCustomThemeFolder, componentToEject, theme, }: EjectComponentOptions, options: EjectOptions): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=ejectComponent.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EjectThemeOptions, EjectOptions } from '../../types/index.js';
|
|
2
|
-
export default function ejectTheme({ pathToThemeFolder, pathToPortalCustomThemeFolder, theme }: EjectThemeOptions, options: EjectOptions): Promise<void>;
|
|
2
|
+
export default function ejectTheme({ pathToThemeFolder, pathToPortalCustomThemeFolder, theme, }: EjectThemeOptions, options: EjectOptions): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=ejectTheme.d.ts.map
|
|
@@ -14,14 +14,14 @@ export declare function getThemeFiles(pathToThemeFolder: string, options?: {
|
|
|
14
14
|
export declare function getEjectedFiles(customThemeFiles: string[], themeFiles: string[]): string[];
|
|
15
15
|
export declare function copyThemeComponent(portalCustomThemeDir: string, pathToThemeFolder: string, componentToCopy: string): string;
|
|
16
16
|
export declare function copyComponentAndReport(componentToCopy: string, copyFrom: string, copyTo: string, options?: EjectOptions): void;
|
|
17
|
-
export declare function copyComponent({ componentToCopy, ejectedFiles, copyFrom, copyTo, options }: {
|
|
17
|
+
export declare function copyComponent({ componentToCopy, ejectedFiles, copyFrom, copyTo, options, }: {
|
|
18
18
|
componentToCopy: string;
|
|
19
19
|
ejectedFiles?: string[];
|
|
20
20
|
copyFrom: string;
|
|
21
21
|
copyTo: string;
|
|
22
22
|
options?: EjectOptions;
|
|
23
23
|
}): Promise<void>;
|
|
24
|
-
export declare function copyComponentsFromList({ componentList, ejectedComponents, pathToThemeFolder, pathToPortalCustomThemeFolder, options }: {
|
|
24
|
+
export declare function copyComponentsFromList({ componentList, ejectedComponents, pathToThemeFolder, pathToPortalCustomThemeFolder, options, }: {
|
|
25
25
|
componentList: string[];
|
|
26
26
|
ejectedComponents: string[];
|
|
27
27
|
pathToThemeFolder: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ResolvedPageData } from '../types/index.js';
|
|
3
|
-
export declare function TestProvider({ children, customPageData }: React.PropsWithChildren<{
|
|
3
|
+
export declare function TestProvider({ children, customPageData, }: React.PropsWithChildren<{
|
|
4
4
|
customPageData?: Partial<ResolvedPageData>;
|
|
5
5
|
}>): React.JSX.Element;
|
|
6
6
|
//# sourceMappingURL=TestProvider.d.ts.map
|
|
@@ -13,7 +13,7 @@ export declare function useCatalogFilter(config?: CatalogEntityConfig, serverFil
|
|
|
13
13
|
type?: 'select' | 'checkboxes' | 'date-range';
|
|
14
14
|
hide?: boolean;
|
|
15
15
|
label?: string;
|
|
16
|
-
options: import("@redocly/theme
|
|
16
|
+
options: import("@redocly/theme").FilterResult[];
|
|
17
17
|
toggleOption: (value: string) => void;
|
|
18
18
|
selectOption: (value: string) => void;
|
|
19
19
|
selectedOptions: FilterState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as
|
|
1
|
+
import{useRef as s,useState as c}from"react";import{generateBeforeAfterContext as d}from"@redocly/theme/core/utils";import{telemetry as w}from"../../telemetry/index.js";const l="catalog-view-mode",u="table";function m(a){const[o,n]=c(a??u),r=s(o);return{viewMode:o,setViewMode:t=>{const i=r.current;if(r.current=t,n(t),!(typeof window>"u")){try{localStorage.setItem(l,t)}catch(e){console.warn("Failed to save view mode preference to localStorage",e)}try{const e=new URL(window.location.href);e.searchParams.set("viewMode",t),window.history.replaceState({},"",e.toString()),w.sendCatalogEntitiesViewModeChangedMessage([...d("catalogEntitiesViewModeId","button",{mode:i},{mode:t})])}catch(e){console.warn("Failed to update viewMode query parameter",e)}}}}}export{m as useCatalogViewMode};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BffCatalogEntityList, CatalogApiParams } from '@redocly/theme/core/types';
|
|
2
2
|
export declare function useFetchCatalogEntities({ limit, filter, sort, search }?: CatalogApiParams, initialEntitiesList?: BffCatalogEntityList): {
|
|
3
3
|
query: import("@tanstack/react-query").DefinedUseInfiniteQueryResult<import("@tanstack/react-query").InfiniteData<BffCatalogEntityList, unknown>, Error>;
|
|
4
|
-
items: import("@redocly/theme
|
|
4
|
+
items: import("@redocly/theme").BffCatalogEntity[];
|
|
5
5
|
total: number;
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=useFetchCatalogEntities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useInfiniteQuery as y}from"@tanstack/react-query";import{useMemo as
|
|
1
|
+
import{useInfiniteQuery as y}from"@tanstack/react-query";import{useMemo as u,useRef as w}from"react";import{withPathPrefix as R}from"@redocly/theme/core/utils";import{getNextPageParam as S}from"../../../utils/catalog/get-next-page-param";import{useSearchTracker as F}from"./useSearchTracker";function x({limit:o=20,filter:i,sort:s="updated_at",search:n}={},r){const d=r?r.items.map(e=>e.key).join("-"):[],c=w(!0),m=c.current&&r;c.current&&(c.current=!1);const a=y({queryFn:async e=>{const t=new URLSearchParams;i&&t.append("filter",i),s&&t.append("sort",s),o&&t.append("limit",o.toString()),n&&t.append("search",n),e.pageParam&&Object.entries(e.pageParam).forEach(([P,f])=>{f!=null&&t.append(P,f.toString())});const p=new URL(R("/bff/catalog-entities"),window.location.origin);p.search=t.toString();const g=await fetch(p.toString());if(!g.ok)throw new Error(`Failed to fetch catalog entities from ${p.pathname}`);return g.json()},queryKey:["bff/catalog-entities",{limit:o,filter:i,sort:s,search:n,initialDataKeys:d}],initialData:m?{pages:[r],pageParams:[null]}:void 0,initialPageParam:null,getNextPageParam:S,refetchOnMount:!0,placeholderData:e=>e}),l=u(()=>{const e=a.data?.pages||[];return e[e.length-1]?.page.total},[a.data?.pages]),h=u(()=>(a.data?.pages||[]).flatMap(e=>e.items||[]),[a.data?.pages]);return F({isLoading:a.isLoading||a.isFetching,apiResource:"entities",searchQuery:n??""}),{query:a,items:h,total:l}}export{x as useFetchCatalogEntities};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { BffCatalogRelatedEntityList, CatalogApiParams } from '@redocly/theme/core/types';
|
|
2
|
-
export declare function useFetchCatalogEntitiesRelations({ entityKey, limit, filter, sort, search }: CatalogApiParams & {
|
|
2
|
+
export declare function useFetchCatalogEntitiesRelations({ entityKey, limit, filter, sort, search, }: CatalogApiParams & {
|
|
3
3
|
entityKey: string;
|
|
4
4
|
}, initialRelationsList?: BffCatalogRelatedEntityList): {
|
|
5
5
|
query: import("@tanstack/react-query").DefinedUseInfiniteQueryResult<import("@tanstack/react-query").InfiniteData<BffCatalogRelatedEntityList, unknown>, Error>;
|
|
6
|
-
items: import("@redocly/theme
|
|
6
|
+
items: import("@redocly/theme").BffCatalogRelatedEntity[];
|
|
7
7
|
total: number;
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=useFetchCatalogEntitiesRelations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useInfiniteQuery as y}from"@tanstack/react-query";import{useMemo as
|
|
1
|
+
import{useInfiniteQuery as y}from"@tanstack/react-query";import{useMemo as d,useRef as S}from"react";import{withPathPrefix as F}from"@redocly/theme/core/utils";import{getNextPageParam as R}from"../../../utils/catalog/get-next-page-param";import{useSearchTracker as b}from"./useSearchTracker";function E({entityKey:g,limit:o=20,filter:i,sort:s="updated_at",search:r},n){const m=n?n.items.map(e=>e.key).join("-"):[],c=S(!0),l=c.current&&n;c.current&&(c.current=!1);const t=y({queryFn:async e=>{const a=new URLSearchParams;i&&a.append("filter",i),s&&a.append("sort",s),o&&a.append("limit",o.toString()),r&&a.append("search",r),e.pageParam&&Object.entries(e.pageParam).forEach(([w,f])=>{f!=null&&a.append(w,f.toString())});const p=new URL(F(`/bff/catalog-related-entities/${g}`),window.location.origin);p.search=a.toString();const u=await fetch(p.toString());if(!u.ok)throw new Error(`Failed to fetch catalog entity relations from ${p.pathname}`);return u.json()},queryKey:["bff/catalog-entities-relations",{limit:o,filter:i,sort:s,search:r,entityKey:g,initialDataKeys:m}],initialPageParam:null,initialData:l?{pages:[n],pageParams:[null]}:void 0,refetchOnMount:!0,getNextPageParam:R}),h=d(()=>{const e=t.data?.pages||[];return e[e.length-1]?.page?.total},[t.data?.pages]),P=d(()=>(t.data?.pages||[]).flatMap(e=>e.items||[]),[t.data?.pages]);return b({isLoading:t.isLoading||t.isFetching,apiResource:"related_entities",searchQuery:r??""}),{query:t,items:P,total:h}}export{E as useFetchCatalogEntitiesRelations};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import type { BffCatalogEntityRevision, BffCatalogEntityRevisionList } from '@redocly/theme/core/types';
|
|
3
|
-
export declare function useFetchCatalogEntityRevisions({ entityKey, version }: {
|
|
3
|
+
export declare function useFetchCatalogEntityRevisions({ entityKey, version, }: {
|
|
4
4
|
entityKey: string;
|
|
5
5
|
version?: string | null;
|
|
6
6
|
}): {
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
2
|
-
type BaseEntity = Pick<BffCatalogEntity, 'id' | 'key' | 'type'>;
|
|
3
1
|
type ApiResource = 'entities' | 'related_entities';
|
|
4
|
-
type SearchTrackerProps
|
|
2
|
+
type SearchTrackerProps = {
|
|
5
3
|
isLoading: boolean;
|
|
6
|
-
items: T[];
|
|
7
4
|
apiResource: ApiResource;
|
|
8
5
|
searchQuery: string;
|
|
9
6
|
};
|
|
10
|
-
export declare function useSearchTracker
|
|
7
|
+
export declare function useSearchTracker({ isLoading, apiResource, searchQuery }: SearchTrackerProps): void;
|
|
11
8
|
export {};
|
|
12
9
|
//# sourceMappingURL=useSearchTracker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useEffect as c,useRef as o}from"react";import{getBaseDataAttributes as a}from"@redocly/theme/core/utils";import{telemetry as n}from"../../telemetry/index.js";const l={entities:t=>{n.sendCatalogEntitiesListSearchQueryMessage([{...a("catalogEntitiesListSearchId","catalogEntitiesListSearch"),query:t}])},related_entities:t=>{n.sendCatalogEntitiesRelatedEntitiesListSearchQueryMessage([{...a("catalogEntitiesRelatedEntitiesListSearchId","catalogEntitiesRelatedEntitiesListSearch"),query:t}])}};function m({isLoading:t,apiResource:i,searchQuery:e}){const r=o(e);c(()=>{if(t)return;const s=e?.trim();!s||s===r.current||(r.current=e,l[i](e))},[t,e,i])}export{m as useSearchTracker};
|
|
@@ -6,11 +6,6 @@ export declare const highlight: (rawContent: string, language: string | undefine
|
|
|
6
6
|
customTransformer?: ShikiTransformer;
|
|
7
7
|
} | undefined) => string;
|
|
8
8
|
export declare function useCodeHighlight(): {
|
|
9
|
-
highlight:
|
|
10
|
-
withLineNumbers?: boolean;
|
|
11
|
-
startLineNumber?: number;
|
|
12
|
-
highlight?: string;
|
|
13
|
-
customTransformer?: ShikiTransformer;
|
|
14
|
-
} | undefined) => string;
|
|
9
|
+
highlight: typeof highlight;
|
|
15
10
|
};
|
|
16
11
|
//# sourceMappingURL=useCodeHighlight.d.ts.map
|
|
@@ -6,6 +6,6 @@ type DevLoginFormProps = {
|
|
|
6
6
|
onSubmit: () => void;
|
|
7
7
|
teams: Array<string>;
|
|
8
8
|
};
|
|
9
|
-
export declare function DevLoginForm({ teams, formState: { values, errors }, setFormState, onSubmit }: DevLoginFormProps): React.JSX.Element;
|
|
9
|
+
export declare function DevLoginForm({ teams, formState: { values, errors }, setFormState, onSubmit, }: DevLoginFormProps): React.JSX.Element;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=DevLoginForm.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function useGlobalData(): import("../../types/
|
|
1
|
+
export declare function useGlobalData(): import("../../types/global-data").GlobalData;
|
|
2
2
|
//# sourceMappingURL=useGlobalData.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NavigateFunction, NavigateOptions } from 'react-router-dom';
|
|
2
2
|
export type HistoryOrigin = 'pm' | 'browser';
|
|
3
|
-
export declare function loadAndNavigate({ navigate, to, origin, options }: {
|
|
3
|
+
export declare function loadAndNavigate({ navigate, to, origin, options, }: {
|
|
4
4
|
navigate: NavigateFunction;
|
|
5
5
|
to: string;
|
|
6
6
|
origin?: HistoryOrigin;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PageProps, ResolvedNavItem, CatalogEntityConfig } from '@redocly/config';
|
|
2
2
|
import type { SidebarConnectedEntity } from '@redocly/theme/core/types';
|
|
3
3
|
export * from './use-page-shared-data';
|
|
4
|
-
export declare function usePageData(): import("../../../types
|
|
4
|
+
export declare function usePageData(): import("../../../types").ResolvedPageData | null;
|
|
5
5
|
export declare function usePageProps<T extends object>(): PageProps & T;
|
|
6
6
|
export declare function usePageVersions(): {
|
|
7
7
|
versions: {
|
|
@@ -28,5 +28,5 @@ export declare function useSidebarSiblingsData(): {
|
|
|
28
28
|
prevPage?: undefined;
|
|
29
29
|
nextPage?: undefined;
|
|
30
30
|
} | undefined;
|
|
31
|
-
export declare function usePageDataLoader(): import("../../../types
|
|
31
|
+
export declare function usePageDataLoader(): import("../../../types").ResolvedPageData | undefined;
|
|
32
32
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -4,7 +4,7 @@ import type { RedocConfig } from '@redocly/config';
|
|
|
4
4
|
export declare function getOperation(store: {
|
|
5
5
|
definition: OpenAPIDefinition;
|
|
6
6
|
options: RedocConfig;
|
|
7
|
-
}, { operationId, pointer }: OperationIdentifier, options: Options, { exampleKey, mimeType, environments, environment, requestBody }: {
|
|
7
|
+
}, { operationId, pointer }: OperationIdentifier, options: Options, { exampleKey, mimeType, environments, environment, requestBody, }: {
|
|
8
8
|
exampleKey?: string;
|
|
9
9
|
mimeType?: string;
|
|
10
10
|
environments?: Record<string, Record<string, string>>;
|
|
@@ -1,9 +1,55 @@
|
|
|
1
|
+
import { jsonSchema } from './json-schema.js';
|
|
2
|
+
import { openApiCodeSample } from './openapi-code-sample.js';
|
|
3
|
+
import { openApiExample } from './openapi-example.js';
|
|
4
|
+
import { replayOpenApi } from './replay-openapi.js';
|
|
5
|
+
import { openApiResponseSample } from './openapi-response-sample.js';
|
|
6
|
+
import { jsonExample } from './json-example.js';
|
|
1
7
|
declare const _default: {
|
|
2
|
-
[
|
|
8
|
+
[jsonSchema.tagName]: import("@markdoc/markdoc").Schema & {
|
|
3
9
|
attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
|
|
4
10
|
resolver?: string;
|
|
5
11
|
}>;
|
|
6
|
-
renderForLlms?: import("@redocly/theme/
|
|
12
|
+
renderForLlms?: import("@redocly/theme/markdoc/tags/types").RenderForLlmsFn;
|
|
13
|
+
} & {
|
|
14
|
+
dynamicComponentLib?: string;
|
|
15
|
+
};
|
|
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
|
+
} & {
|
|
22
|
+
dynamicComponentLib?: string;
|
|
23
|
+
};
|
|
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
|
+
} & {
|
|
30
|
+
dynamicComponentLib?: string;
|
|
31
|
+
};
|
|
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
|
+
} & {
|
|
38
|
+
dynamicComponentLib?: string;
|
|
39
|
+
};
|
|
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
|
+
} & {
|
|
46
|
+
dynamicComponentLib?: string;
|
|
47
|
+
};
|
|
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;
|
|
7
53
|
} & {
|
|
8
54
|
dynamicComponentLib?: string;
|
|
9
55
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function readStreamWithSizeLimit({ stream, maxSizeMB, onSizeExceededErrorHandler }: {
|
|
1
|
+
export declare function readStreamWithSizeLimit({ stream, maxSizeMB, onSizeExceededErrorHandler, }: {
|
|
2
2
|
stream: ReadableStream<Uint8Array>;
|
|
3
3
|
maxSizeMB: number;
|
|
4
4
|
onSizeExceededErrorHandler: () => never;
|
|
@@ -2,7 +2,7 @@ import type { Context } from 'hono';
|
|
|
2
2
|
import type { ApiRoute } from '../types';
|
|
3
3
|
import type { Store } from '../store.js';
|
|
4
4
|
export declare function runApiRoutesWorker(route: ApiRoute, ctx: Context, store: Store): Promise<Response>;
|
|
5
|
-
export declare function sendTelemetryErrorMessage({ requestHandlerId, error }: {
|
|
5
|
+
export declare function sendTelemetryErrorMessage({ requestHandlerId, error, }: {
|
|
6
6
|
requestHandlerId: string;
|
|
7
7
|
error: Error;
|
|
8
8
|
}): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as p from"workerpool";import{withPathPrefix as
|
|
1
|
+
import*as p from"workerpool";import{withPathPrefix as E}from"@redocly/theme/core/utils";import{envConfig as u}from"../config/env-config.js";import{telemetry as a}from"../telemetry/index.js";import{TimeoutExceededError as f}from"./errors/timeout-exceeded.js";import{serializeRequest as g}from"./helpers/serialize-request.js";import{apiRoutesWorkers as A,API_ROUTES_WORKER_KEY as T}from"../workers/api-routes-worker-pool.js";import{API_FUNCTIONS_REQUEST_HANDLER_ID as d}from"../plugins/api-functions/index.js";const _=1e4,h=15;async function q(e,r,t){a.initialize();const i=r.get("auth"),o=await t.resolveRouteStaticData(e)||{},n=E(e.slug);try{const{status:s,headers:l,body:c}=await A.exec(T,[{serverOutDir:t.serverOutDir,slug:n,requestHandlerId:e.requestHandlerId,maxResponseSizeMB:h,ctxData:{user:{teams:i.teams,email:i.claims.email,claims:i.claims,idpAccessToken:i.idpAccessToken,idpId:i.claims.idpId,isAuthenticated:i.isAuthenticated},config:t.config,outdir:t.outdir,baseUrl:new URL(r.req.url).origin},staticData:{...o,props:{...o.props,routeSlug:n,outdir:t.outdir}},req:await g(r.req.raw),sqldRemoteDatabaseUrl:u.SQLD_REMOTE_DATABASE_URL,sqldRemoteDatabaseAuthToken:u.SQLD_REMOTE_DATABASE_AUTH_TOKEN}],{timeout:_});R({requestHandlerId:e.requestHandlerId,status:s,ctx:r});const m=c.data?Buffer.from(c.data):null;return new Response(m,{status:s,headers:l})}catch(s){throw I({requestHandlerId:e.requestHandlerId,error:s}),s instanceof p.Promise.TimeoutError?new f("Timeout exceeded"):s}}function R({requestHandlerId:e,status:r,ctx:t}){e.startsWith(d)?a.sendApiFunctionCalledMessage([{id:"apiFunctionId",object:"apiFunction",uri:"urn:redocly:realm:api:apiFunction:apiFunctionId",handler:e,status:r,message:null}]):a.sendMockServerCalledMessage([{object:"mock_server",error:null,handler:e,headers:{"user-agent":t.req.header("user-agent")??null},status:r}])}function I({requestHandlerId:e,error:r}){e.startsWith(d)?a.sendApiFunctionErrorMessage([{id:"apiFunctionId",object:"apiFunction",uri:"urn:redocly:realm:api:apiFunction:apiFunctionId",status:500,handler:e,message:r.message}]):a.sendMockServerErrorMessage([{object:"mock_server",handler:e,message:r.message}])}export{q as runApiRoutesWorker,I as sendTelemetryErrorMessage};
|
|
@@ -54,6 +54,7 @@ declare function loadEnvConfig(): {
|
|
|
54
54
|
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
|
|
55
55
|
REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: boolean | undefined;
|
|
56
56
|
REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: boolean | undefined;
|
|
57
|
+
REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
|
|
57
58
|
SEARCH_DEV_REINIT?: string | undefined;
|
|
58
59
|
SEARCH_DEV_DEBUG: boolean;
|
|
59
60
|
TYPESENSE_API_URL?: string | undefined;
|
|
@@ -135,6 +136,7 @@ export declare const envConfig: {
|
|
|
135
136
|
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
|
|
136
137
|
REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: boolean | undefined;
|
|
137
138
|
REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: boolean | undefined;
|
|
139
|
+
REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
|
|
138
140
|
SEARCH_DEV_REINIT?: string | undefined;
|
|
139
141
|
SEARCH_DEV_DEBUG: boolean;
|
|
140
142
|
TYPESENSE_API_URL?: string | undefined;
|
|
@@ -58,6 +58,7 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
|
|
|
58
58
|
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT: z.ZodOptional<z.ZodString>;
|
|
59
59
|
REDOCLY_EXP_MCP_CODE_MODE_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
|
|
60
60
|
REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
|
|
61
|
+
REDOCLY_DISABLE_API_FUNCTION_SANDBOX: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
|
|
61
62
|
} & {
|
|
62
63
|
SEARCH_DEV_REINIT: z.ZodOptional<z.ZodString>;
|
|
63
64
|
SEARCH_DEV_DEBUG: z.ZodEffects<z.ZodDefault<z.ZodEnum<["true", "false"]>>, boolean, "false" | "true" | undefined>;
|
|
@@ -136,6 +137,7 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
|
|
|
136
137
|
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
|
|
137
138
|
REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: boolean | undefined;
|
|
138
139
|
REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: boolean | undefined;
|
|
140
|
+
REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
|
|
139
141
|
SEARCH_DEV_REINIT?: string | undefined;
|
|
140
142
|
SEARCH_DEV_DEBUG: boolean;
|
|
141
143
|
TYPESENSE_API_URL?: string | undefined;
|
|
@@ -207,6 +209,7 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
|
|
|
207
209
|
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
|
|
208
210
|
REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: "false" | "true" | undefined;
|
|
209
211
|
REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: "false" | "true" | undefined;
|
|
212
|
+
REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: "false" | "true" | undefined;
|
|
210
213
|
SEARCH_DEV_REINIT?: string | undefined;
|
|
211
214
|
SEARCH_DEV_DEBUG?: "false" | "true" | undefined;
|
|
212
215
|
TYPESENSE_API_URL?: string | undefined;
|
|
@@ -278,6 +281,7 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
|
|
|
278
281
|
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
|
|
279
282
|
REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: boolean | undefined;
|
|
280
283
|
REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: boolean | undefined;
|
|
284
|
+
REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
|
|
281
285
|
SEARCH_DEV_REINIT?: string | undefined;
|
|
282
286
|
SEARCH_DEV_DEBUG: boolean;
|
|
283
287
|
TYPESENSE_API_URL?: string | undefined;
|
|
@@ -349,6 +353,7 @@ export declare const envSchema: z.ZodEffects<z.ZodObject<{
|
|
|
349
353
|
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
|
|
350
354
|
REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: "false" | "true" | undefined;
|
|
351
355
|
REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: "false" | "true" | undefined;
|
|
356
|
+
REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: "false" | "true" | undefined;
|
|
352
357
|
SEARCH_DEV_REINIT?: string | undefined;
|
|
353
358
|
SEARCH_DEV_DEBUG?: "false" | "true" | undefined;
|
|
354
359
|
TYPESENSE_API_URL?: string | undefined;
|
|
@@ -19,6 +19,8 @@ export declare const featureFlagsSchema: z.ZodObject<{
|
|
|
19
19
|
REDOCLY_EXP_MCP_CODE_MODE_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
|
|
20
20
|
/** Experimental: give the docs MCP `execute` sandbox a guarded `fetch` that can call gateway-eligible APIs. */
|
|
21
21
|
REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
|
|
22
|
+
/** Escape hatch: disables the Node Permission Model sandbox on API function and MCP tool worker processes (hosted Reunite environments only). */
|
|
23
|
+
REDOCLY_DISABLE_API_FUNCTION_SANDBOX: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "false" | "true" | undefined>;
|
|
22
24
|
}, "strip", z.ZodTypeAny, {
|
|
23
25
|
NEW_CATALOG_ENABLED?: boolean | undefined;
|
|
24
26
|
NEW_SCORECARDS_ENABLED?: boolean | undefined;
|
|
@@ -31,6 +33,7 @@ export declare const featureFlagsSchema: z.ZodObject<{
|
|
|
31
33
|
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
|
|
32
34
|
REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: boolean | undefined;
|
|
33
35
|
REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: boolean | undefined;
|
|
36
|
+
REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: boolean | undefined;
|
|
34
37
|
}, {
|
|
35
38
|
NEW_CATALOG_ENABLED?: "false" | "true" | undefined;
|
|
36
39
|
NEW_SCORECARDS_ENABLED?: "false" | "true" | undefined;
|
|
@@ -43,5 +46,6 @@ export declare const featureFlagsSchema: z.ZodObject<{
|
|
|
43
46
|
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
|
|
44
47
|
REDOCLY_EXP_MCP_CODE_MODE_ENABLED?: "false" | "true" | undefined;
|
|
45
48
|
REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED?: "false" | "true" | undefined;
|
|
49
|
+
REDOCLY_DISABLE_API_FUNCTION_SANDBOX?: "false" | "true" | undefined;
|
|
46
50
|
}>;
|
|
47
51
|
//# sourceMappingURL=feature-flags.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as _}from"zod";import{envBooleanStringOptional as E}from"../../utils/envs/env-boolean-string.js";const D=_.object({NEW_CATALOG_ENABLED:E(),NEW_SCORECARDS_ENABLED:E(),ENABLE_COMMENTS:_.string().optional(),REDOCLY_EXP_DISABLE_MD_VALIDATION:E(),ENABLE_SOURCE_MAPS:E(),PLAN_GATES:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED:E(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT:_.string().optional(),REDOCLY_EXP_MCP_CODE_MODE_ENABLED:E(),REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED:E()});export{D as featureFlagsSchema};
|
|
1
|
+
import{z as _}from"zod";import{envBooleanStringOptional as E}from"../../utils/envs/env-boolean-string.js";const D=_.object({NEW_CATALOG_ENABLED:E(),NEW_SCORECARDS_ENABLED:E(),ENABLE_COMMENTS:_.string().optional(),REDOCLY_EXP_DISABLE_MD_VALIDATION:E(),ENABLE_SOURCE_MAPS:E(),PLAN_GATES:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED:E(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT:_.string().optional(),REDOCLY_EXP_MCP_CODE_MODE_ENABLED:E(),REDOCLY_EXP_MCP_GATEWAY_SERVER_ENABLED:E(),REDOCLY_DISABLE_API_FUNCTION_SANDBOX:E()});export{D as featureFlagsSchema};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DatabaseCacheDto } from '../../../providers/database/databases/sqlite-db/schemas/cache-table.js';
|
|
2
|
-
export declare function createCacheDbRecord({ key, value, namespace, ttlInSeconds }: {
|
|
2
|
+
export declare function createCacheDbRecord({ key, value, namespace, ttlInSeconds, }: {
|
|
3
3
|
key: string;
|
|
4
4
|
value: Record<string, unknown> | unknown[];
|
|
5
5
|
namespace: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FileType, FileHashStatus } from '../types.js';
|
|
2
2
|
import type { DatabaseFileHashDto } from '../../../providers/database/databases/sqlite-db/schemas/file-hashes-table.js';
|
|
3
|
-
export declare function createFileHashDbRecord({ id, fileType, filePath, hash, status }: {
|
|
3
|
+
export declare function createFileHashDbRecord({ id, fileType, filePath, hash, status, }: {
|
|
4
4
|
id?: string;
|
|
5
5
|
fileType: FileType;
|
|
6
6
|
filePath: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { KvValue, KvKey } from '@redocly/config';
|
|
2
2
|
import type { DatabaseKvDbInsertSchema } from '../../../providers/database/databases/sqlite-db/schemas/kv-table.js';
|
|
3
3
|
export declare const KV_KEY_SEPARATOR = "\u0001";
|
|
4
|
-
export declare function createKvDbRecord({ key, value, ttlInSeconds }: {
|
|
4
|
+
export declare function createKvDbRecord({ key, value, ttlInSeconds, }: {
|
|
5
5
|
key: KvKey;
|
|
6
6
|
value: KvValue;
|
|
7
7
|
ttlInSeconds?: number;
|
|
@@ -10,7 +10,7 @@ export type PublishDiffResult = {
|
|
|
10
10
|
};
|
|
11
11
|
export declare class CatalogEntitiesDiffPublisher {
|
|
12
12
|
#private;
|
|
13
|
-
static publishDiff({ runId, localConnection, remoteConnection, scopeFiles, chunkSize }: {
|
|
13
|
+
static publishDiff({ runId, localConnection, remoteConnection, scopeFiles, chunkSize, }: {
|
|
14
14
|
runId: string;
|
|
15
15
|
localConnection: DatabaseConnection;
|
|
16
16
|
remoteConnection: DatabaseConnection;
|
package/dist/server/plugins/catalog-entities/database/catalog-entities-revisions-pruner.d.ts
CHANGED
|
@@ -2,17 +2,19 @@ import type { DatabaseConnection } from './types';
|
|
|
2
2
|
export type PruneLocalRevisionsResult = {
|
|
3
3
|
prunedEntities: number;
|
|
4
4
|
prunedRelations: number;
|
|
5
|
+
legacyRelationsHealed: number;
|
|
6
|
+
legacyRelationsDeleted: number;
|
|
5
7
|
affectedSourceFiles: string[];
|
|
6
8
|
vacuumed: boolean;
|
|
7
9
|
};
|
|
8
10
|
export declare class CatalogEntitiesRevisionsPruner {
|
|
9
11
|
#private;
|
|
10
|
-
static pruneLocalRevisions({ localConnection, maxRevisions, vacuumThreshold }: {
|
|
12
|
+
static pruneLocalRevisions({ localConnection, maxRevisions, vacuumThreshold, }: {
|
|
11
13
|
localConnection: DatabaseConnection;
|
|
12
14
|
maxRevisions: number;
|
|
13
15
|
vacuumThreshold?: number;
|
|
14
16
|
}): Promise<PruneLocalRevisionsResult>;
|
|
15
|
-
static confirmPrunedFiles({ localConnection, sourceFiles }: {
|
|
17
|
+
static confirmPrunedFiles({ localConnection, sourceFiles, }: {
|
|
16
18
|
localConnection: DatabaseConnection;
|
|
17
19
|
sourceFiles: string[];
|
|
18
20
|
}): Promise<void>;
|
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
import{and as
|
|
1
|
+
import{and as U,eq as F,inArray as E,isNull as v,sql as a}from"drizzle-orm";import{entitiesRelationsTable as d}from"../../../providers/database/databases/sqlite-db/schemas/entities-relations-table.js";import{entitiesTable as w}from"../../../providers/database/databases/sqlite-db/schemas/entities-table.js";import{fileHashesTable as l}from"../../../providers/database/databases/sqlite-db/schemas/file-hashes-table.js";import{FileHashStatus as A}from"../../../persistence/file-hashes/types.js";import{DELETE_IDS_CHUNK_SIZE as _,VACUUM_AFTER_PRUNED_ROWS as g}from"./consts.js";const y={prunedEntities:0,prunedRelations:0,legacyRelationsHealed:0,legacyRelationsDeleted:0,affectedSourceFiles:[],vacuumed:!1};class c{static async pruneLocalRevisions({localConnection:n,maxRevisions:r,vacuumThreshold:s=g}){if(!Number.isFinite(r)||r<=0)return y;const t=n.client.client,S=await t.transaction(async i=>{const C=await i.all(a`
|
|
2
|
+
SELECT DISTINCT e.source_file
|
|
3
|
+
FROM entities_relations r
|
|
4
|
+
JOIN entities e ON e.key = r.source_key AND e.source_file IS NOT NULL
|
|
5
|
+
WHERE r.source_file IS NULL
|
|
6
|
+
`),h=await i.run(a`
|
|
7
|
+
UPDATE entities_relations
|
|
8
|
+
SET source_file = (
|
|
9
|
+
SELECT e.source_file FROM entities e
|
|
10
|
+
WHERE e.key = entities_relations.source_key
|
|
11
|
+
AND e.source_file IS NOT NULL
|
|
12
|
+
ORDER BY e.is_current DESC, e.revision DESC
|
|
13
|
+
LIMIT 1
|
|
14
|
+
)
|
|
15
|
+
WHERE source_file IS NULL
|
|
16
|
+
AND EXISTS (
|
|
17
|
+
SELECT 1 FROM entities e
|
|
18
|
+
WHERE e.key = entities_relations.source_key
|
|
19
|
+
AND e.source_file IS NOT NULL
|
|
20
|
+
)
|
|
21
|
+
`),N=Number(h.rowsAffected??0),k=await i.delete(d).where(v(d.sourceFile)).run(),T=Number(k.rowsAffected??0),u=await i.all(a`
|
|
2
22
|
SELECT id, source_file
|
|
3
23
|
FROM (
|
|
4
24
|
SELECT id,
|
|
@@ -15,7 +35,7 @@ import{and as h,eq as m,inArray as l,sql as S}from"drizzle-orm";import{entitiesR
|
|
|
15
35
|
WHERE revision_rank > ${r}
|
|
16
36
|
AND COALESCE(is_current, 1) = 0
|
|
17
37
|
AND COALESCE(is_default_version, 0) = 0
|
|
18
|
-
`)
|
|
38
|
+
`),f=new Set(C.map(e=>e.source_file));for(const e of u)e.source_file&&f.add(e.source_file);if(u.length===0&&N===0&&T===0)return{legacyRelationsHealed:N,legacyRelationsDeleted:T,prune:null};for(const e of c.#e(u.map(O=>O.id),_))await i.delete(w).where(E(w.id,e)).run();const D=await i.all(a`
|
|
19
39
|
SELECT id, source_file
|
|
20
40
|
FROM entities_relations r
|
|
21
41
|
WHERE r.source_file IS NOT NULL
|
|
@@ -39,4 +59,4 @@ import{and as h,eq as m,inArray as l,sql as S}from"drizzle-orm";import{entitiesR
|
|
|
39
59
|
)
|
|
40
60
|
)
|
|
41
61
|
)
|
|
42
|
-
`);for(const e of
|
|
62
|
+
`);for(const e of D)e.source_file&&f.add(e.source_file);for(const e of c.#e(D.map(O=>O.id),_))await i.delete(d).where(E(d.id,e)).run();const I=new Date().toISOString();for(const e of c.#e(Array.from(f),_))await i.update(l).set({status:A.OUTDATED,updatedAt:I}).where(E(l.filePath,e)).run();return{legacyRelationsHealed:N,legacyRelationsDeleted:T,prune:{prunedEntities:u.length,prunedRelations:D.length,affectedSourceFiles:Array.from(f)}}}),{legacyRelationsHealed:p,legacyRelationsDeleted:R,prune:o}=S;if(!o&&p===0&&R===0)return y;const m=(o?.prunedEntities??0)+(o?.prunedRelations??0)+R;let L=!1;return m>=s&&(await t.run(a`VACUUM`),L=!0),{prunedEntities:o?.prunedEntities??0,prunedRelations:o?.prunedRelations??0,legacyRelationsHealed:p,legacyRelationsDeleted:R,affectedSourceFiles:o?.affectedSourceFiles??[],vacuumed:L}}static async confirmPrunedFiles({localConnection:n,sourceFiles:r}){if(r.length===0)return;const s=n.client.client,t=new Date().toISOString();for(const S of c.#e(r,_))await s.update(l).set({status:A.UP_TO_DATE,updatedAt:t}).where(U(E(l.filePath,S),F(l.status,A.OUTDATED))).run()}static#e(n,r){const s=[];for(let t=0;t<n.length;t+=r)s.push(n.slice(t,t+r));return s}}export{c as CatalogEntitiesRevisionsPruner};
|
|
@@ -18,7 +18,7 @@ export declare class CatalogEntitiesService extends BaseService<CatalogEntitiesR
|
|
|
18
18
|
static getInstance(options: ServiceInstanceOptions): Promise<CatalogEntitiesService>;
|
|
19
19
|
sync(): Promise<void>;
|
|
20
20
|
transaction<T>(...args: Parameters<TransactionsManager['transaction']>): Promise<T>;
|
|
21
|
-
getEntities({ paginationParams, rbacTeams, excludedTypes, excludedEntities }: {
|
|
21
|
+
getEntities({ paginationParams, rbacTeams, excludedTypes, excludedEntities, }: {
|
|
22
22
|
paginationParams: PaginationParams;
|
|
23
23
|
rbacTeams?: string[];
|
|
24
24
|
excludedTypes?: string[];
|
|
@@ -33,13 +33,13 @@ export declare class CatalogEntitiesService extends BaseService<CatalogEntitiesR
|
|
|
33
33
|
getCatalogFilters(params: CatalogFiltersParams): Promise<Record<string, import("./repositories/types.js").FilterOption[]>>;
|
|
34
34
|
getEntityRelationById(id: string): Promise<EntityRelationReadModelSchema | null>;
|
|
35
35
|
getEntitiesRelations(paginationParams?: PaginationParams): Promise<ListResponseResult<EntityRelationReadModelSchema>>;
|
|
36
|
-
getEntitiesWithRelations({ paginationParams, rbacTeams, excludedTypes, excludedEntities }: {
|
|
36
|
+
getEntitiesWithRelations({ paginationParams, rbacTeams, excludedTypes, excludedEntities, }: {
|
|
37
37
|
paginationParams: PaginationParams;
|
|
38
38
|
rbacTeams?: string[];
|
|
39
39
|
excludedTypes?: string[];
|
|
40
40
|
excludedEntities?: string[];
|
|
41
41
|
}): Promise<BffCatalogEntityList>;
|
|
42
|
-
getEntityWithRelationsByKey({ entityKey, filter, rbacTeams, excludedTypes, excludedEntities }: {
|
|
42
|
+
getEntityWithRelationsByKey({ entityKey, filter, rbacTeams, excludedTypes, excludedEntities, }: {
|
|
43
43
|
entityKey: string;
|
|
44
44
|
filter?: {
|
|
45
45
|
revision?: string | null;
|
|
@@ -49,7 +49,7 @@ export declare class CatalogEntitiesService extends BaseService<CatalogEntitiesR
|
|
|
49
49
|
excludedTypes?: string[];
|
|
50
50
|
excludedEntities?: string[];
|
|
51
51
|
}): Promise<BffCatalogEntity | null>;
|
|
52
|
-
getRelatedEntities({ entityKey, paginationParams, rbacTeams, excludedTypes, excludedEntities }: {
|
|
52
|
+
getRelatedEntities({ entityKey, paginationParams, rbacTeams, excludedTypes, excludedEntities, }: {
|
|
53
53
|
entityKey: string;
|
|
54
54
|
paginationParams: PaginationParams;
|
|
55
55
|
rbacTeams?: string[];
|
|
@@ -76,7 +76,7 @@ export declare class CatalogEntitiesService extends BaseService<CatalogEntitiesR
|
|
|
76
76
|
createEntitiesRelations(entities: EntityRelationDtoSchema[]): Promise<BulkSyncResult<EntityRelationReadModelSchema>>;
|
|
77
77
|
updateEntityRelation(incomingRelationData: Partial<EntityRelationDtoSchema>, relationToBeUpdated: EntityRelationReadModelSchema): Promise<EntityRelationReadModelSchema | null>;
|
|
78
78
|
deleteEntityRelation(id: string): Promise<string | null>;
|
|
79
|
-
softDeleteEntitiesWithRelations({ filter, revision, fileHash }: {
|
|
79
|
+
softDeleteEntitiesWithRelations({ filter, revision, fileHash, }: {
|
|
80
80
|
filter: Filter;
|
|
81
81
|
revision: string;
|
|
82
82
|
fileHash: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DatabaseEntityAttributesDto } from '../../../../providers/database/databases/sqlite-db/schemas/entities-attributes-table.js';
|
|
2
|
-
export declare function createEntityAttributesDbRecord({ rbacTeams, entityKey, organizationId, projectId }: {
|
|
2
|
+
export declare function createEntityAttributesDbRecord({ rbacTeams, entityKey, organizationId, projectId, }: {
|
|
3
3
|
rbacTeams: string[];
|
|
4
4
|
entityKey: string;
|
|
5
5
|
organizationId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EntityBaseFileSchema } from '@redocly/config';
|
|
2
2
|
import type { DatabaseEntityDto } from '../../../../providers/database/databases/sqlite-db/schemas/entities-table.js';
|
|
3
|
-
export declare function createEntityDbRecord({ entity, organizationId, projectId, source, sourceFile, fileHash }: {
|
|
3
|
+
export declare function createEntityDbRecord({ entity, organizationId, projectId, source, sourceFile, fileHash, }: {
|
|
4
4
|
entity: EntityBaseFileSchema & {
|
|
5
5
|
id?: string;
|
|
6
6
|
createdAt?: string;
|