@redocly/redoc-reef 0.140.0-next.5 → 0.140.0-next.7
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 +72 -0
- package/dist/api-schemas/mcp-fetch-count.d.ts +2 -18
- package/dist/api-schemas/otel-traces.d.ts +7 -1345
- package/dist/api-schemas/otel-traces.js +1 -1
- package/dist/api-schemas/search-facets.d.ts +3 -31
- package/dist/api-schemas/search.d.ts +6 -52
- package/dist/cli/build/index.js +1 -1
- package/dist/cli/eject/resolveEjectParams.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/openapi-code-sample.d.ts +2 -0
- package/dist/client/app/markdoc/custom-components/openapi/openapi-code-sample.js +1 -1
- package/dist/compiled/@redocly/pii/index.mjs +1 -0
- package/dist/compiled/@redocly/pii/package.json +1 -0
- package/dist/markdoc/tags/openapi-code-sample.js +1 -1
- package/dist/server/api-routes/execute-api-route.js +1 -1
- package/dist/server/api-routes/run-api-routes-worker.js +1 -1
- package/dist/server/config/env-config.d.ts +24 -24
- package/dist/server/config/env-schema.d.ts +83 -326
- package/dist/server/config/env-schemas/api-urls.d.ts +2 -14
- package/dist/server/config/env-schemas/auth.d.ts +10 -32
- package/dist/server/config/env-schemas/catalog.d.ts +6 -9
- package/dist/server/config/env-schemas/database.d.ts +2 -8
- package/dist/server/config/env-schemas/environment-detection.d.ts +20 -18
- package/dist/server/config/env-schemas/feature-flags.d.ts +25 -33
- package/dist/server/config/env-schemas/organization-project.d.ts +3 -21
- package/dist/server/config/env-schemas/scorecards.d.ts +2 -6
- package/dist/server/config/env-schemas/search.d.ts +9 -15
- package/dist/server/config/env-schemas/server-config.d.ts +6 -31
- package/dist/server/config/env-schemas/site.d.ts +1 -5
- package/dist/server/config/env-schemas/ssr.d.ts +7 -12
- package/dist/server/config/env-schemas/telemetry.d.ts +1 -7
- package/dist/server/esbuild/plugins/themes-resolver.js +3 -3
- package/dist/server/external-plugins/resolve-external-plugins.js +1 -1
- package/dist/server/node-bundle-entry.js +1 -1
- package/dist/server/plugins/api-docs/index.js +1 -1
- package/dist/server/plugins/api-docs/spec-download.api.js +1 -1
- package/dist/server/plugins/api-docs/store-definition-bundles.d.ts +6 -0
- package/dist/server/plugins/api-docs/store-definition-bundles.js +1 -1
- package/dist/server/plugins/config-parser/index.js +1 -1
- package/dist/server/plugins/config-parser/loaders/utils/read-and-validate-config.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-openapi-code-samples.js +1 -1
- package/dist/server/plugins/mcp/codemode/tools/describe-tools.d.ts +1 -1
- package/dist/server/plugins/mcp/codemode/tools/describe-tools.js +1 -3
- package/dist/server/plugins/mcp/docs-mcp/tools/graphql/get-graphql-type-list.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/graphql/list-graphql-apis.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/graphql/types.d.ts +4 -4
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/list-apis.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/types.d.ts +2 -2
- package/dist/server/plugins/mcp/handlers/docs-mcp-handler.js +1 -1
- package/dist/server/plugins/mcp/handlers/handle-mcp-request.js +1 -1
- package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
- package/dist/server/plugins/mcp/servers/mcp-server.js +2 -2
- package/dist/server/plugins/mcp/types.d.ts +10 -0
- package/dist/server/plugins/mcp/utils/available-tools.d.ts +5 -0
- package/dist/server/plugins/mcp/utils/available-tools.js +1 -0
- package/dist/server/plugins/mcp/workers/worker-context.d.ts +4 -0
- package/dist/server/plugins/mcp/workers/worker-context.js +1 -0
- package/dist/server/plugins/scorecard-classic/template/Grid/GridHeader.js +3 -3
- package/dist/server/store-config.d.ts +33 -0
- package/dist/server/store-config.js +1 -0
- package/dist/server/store.d.ts +10 -15
- package/dist/server/store.js +1 -1
- package/dist/server/tools/notifiers/formatter.js +3 -3
- package/dist/server/types/plugins/api-routes.d.ts +4 -1
- package/dist/server/utils/envs/env-boolean-string.d.ts +9 -3
- package/dist/server/utils/envs/get-api-route-allowed-env-variables.d.ts +2 -0
- package/dist/server/utils/envs/get-api-route-allowed-env-variables.js +1 -1
- package/dist/server/utils/envs/interpolate-env-variables.d.ts +5 -1
- package/dist/server/utils/envs/interpolate-env-variables.js +1 -1
- package/dist/server/utils/envs/replace-env-variables-deep.d.ts +17 -9
- package/dist/server/utils/envs/replace-env-variables-deep.js +1 -1
- package/dist/server/web-server/middleware/jsonValidatorMiddleware.d.ts +556 -287
- package/dist/server/workers/mcp-tool-worker-methods.d.ts +7 -0
- package/dist/server/workers/mcp-tool-worker-methods.js +1 -0
- package/dist/server/workers/mcp-tool-worker-pool.d.ts +0 -1
- package/dist/server/workers/mcp-tool-worker-pool.js +1 -1
- package/dist/server/workers/mcp-tool-worker.js +1 -1
- package/dist/server/workers/types.d.ts +4 -8
- package/dist/server/workers/worker-config.d.ts +33 -0
- package/dist/server/workers/worker-config.js +1 -0
- package/package.json +8 -8
- package/dist/server/plugins/mcp/utils/available-sandbox-tools.d.ts +0 -4
- package/dist/server/plugins/mcp/utils/available-sandbox-tools.js +0 -1
- package/dist/server/tools/notifiers/helpers/privacy/mask-email.d.ts +0 -25
- package/dist/server/tools/notifiers/helpers/privacy/mask-email.js +0 -1
- package/dist/server/tools/notifiers/helpers/privacy/mask-subject.d.ts +0 -13
- package/dist/server/tools/notifiers/helpers/privacy/mask-subject.js +0 -1
- package/dist/server/tools/notifiers/helpers/privacy/remove-pii-from-url.d.ts +0 -25
- package/dist/server/tools/notifiers/helpers/privacy/remove-pii-from-url.js +0 -1
- package/dist/server/tools/notifiers/helpers/privacy/remove-pii.d.ts +0 -36
- package/dist/server/tools/notifiers/helpers/privacy/remove-pii.js +0 -1
|
@@ -3,41 +3,33 @@ import { z } from 'zod';
|
|
|
3
3
|
* Schema for feature flags.
|
|
4
4
|
*/
|
|
5
5
|
export declare const featureFlagsSchema: z.ZodObject<{
|
|
6
|
-
NEW_CATALOG_ENABLED: z.
|
|
7
|
-
|
|
6
|
+
NEW_CATALOG_ENABLED: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
false: "false";
|
|
8
|
+
true: "true";
|
|
9
|
+
}>>, z.ZodTransform<boolean | undefined, "false" | "true" | undefined>>;
|
|
10
|
+
NEW_SCORECARDS_ENABLED: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
false: "false";
|
|
12
|
+
true: "true";
|
|
13
|
+
}>>, z.ZodTransform<boolean | undefined, "false" | "true" | undefined>>;
|
|
8
14
|
ENABLE_COMMENTS: z.ZodOptional<z.ZodString>;
|
|
9
|
-
REDOCLY_EXP_DISABLE_MD_VALIDATION: z.
|
|
10
|
-
|
|
15
|
+
REDOCLY_EXP_DISABLE_MD_VALIDATION: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
|
|
16
|
+
false: "false";
|
|
17
|
+
true: "true";
|
|
18
|
+
}>>, z.ZodTransform<boolean | undefined, "false" | "true" | undefined>>;
|
|
19
|
+
ENABLE_SOURCE_MAPS: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
false: "false";
|
|
21
|
+
true: "true";
|
|
22
|
+
}>>, z.ZodTransform<boolean | undefined, "false" | "true" | undefined>>;
|
|
11
23
|
PLAN_GATES: z.ZodOptional<z.ZodString>;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
|
|
25
|
+
false: "false";
|
|
26
|
+
true: "true";
|
|
27
|
+
}>>, z.ZodTransform<boolean | undefined, "false" | "true" | undefined>>;
|
|
15
28
|
REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL: z.ZodOptional<z.ZodString>;
|
|
16
|
-
/** (Optional) API endpoint for the agent feedback endpoint;**/
|
|
17
29
|
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT: z.ZodOptional<z.ZodString>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
ENABLE_COMMENTS?: string | undefined;
|
|
24
|
-
REDOCLY_EXP_DISABLE_MD_VALIDATION?: boolean | undefined;
|
|
25
|
-
ENABLE_SOURCE_MAPS?: boolean | undefined;
|
|
26
|
-
PLAN_GATES?: string | undefined;
|
|
27
|
-
REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: boolean | undefined;
|
|
28
|
-
REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
|
|
29
|
-
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
|
|
30
|
-
REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED?: boolean | undefined;
|
|
31
|
-
}, {
|
|
32
|
-
NEW_CATALOG_ENABLED?: "false" | "true" | undefined;
|
|
33
|
-
NEW_SCORECARDS_ENABLED?: "false" | "true" | undefined;
|
|
34
|
-
ENABLE_COMMENTS?: string | undefined;
|
|
35
|
-
REDOCLY_EXP_DISABLE_MD_VALIDATION?: "false" | "true" | undefined;
|
|
36
|
-
ENABLE_SOURCE_MAPS?: "false" | "true" | undefined;
|
|
37
|
-
PLAN_GATES?: string | undefined;
|
|
38
|
-
REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED?: "false" | "true" | undefined;
|
|
39
|
-
REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL?: string | undefined;
|
|
40
|
-
REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT?: string | undefined;
|
|
41
|
-
REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED?: "false" | "true" | undefined;
|
|
42
|
-
}>;
|
|
30
|
+
REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
|
|
31
|
+
false: "false";
|
|
32
|
+
true: "true";
|
|
33
|
+
}>>, z.ZodTransform<boolean | undefined, "false" | "true" | undefined>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
43
35
|
//# sourceMappingURL=feature-flags.d.ts.map
|
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const organizationProjectSchema: z.ZodObject<{
|
|
3
|
-
ORGANIZATION_ID: z.
|
|
3
|
+
ORGANIZATION_ID: z.ZodOptional<z.ZodString>;
|
|
4
4
|
ORGANIZATION_SLUG: z.ZodOptional<z.ZodString>;
|
|
5
5
|
ORG_SLUG: z.ZodOptional<z.ZodString>;
|
|
6
|
-
PROJECT_ID: z.
|
|
6
|
+
PROJECT_ID: z.ZodOptional<z.ZodString>;
|
|
7
7
|
PROJECT_SLUG: z.ZodOptional<z.ZodString>;
|
|
8
8
|
PROJECT_URL: z.ZodOptional<z.ZodString>;
|
|
9
9
|
PROJECT_BUILD_ID: z.ZodOptional<z.ZodString>;
|
|
10
10
|
PUBLIC_REDOCLY_BRANCH_NAME: z.ZodOptional<z.ZodString>;
|
|
11
|
-
},
|
|
12
|
-
ORGANIZATION_ID?: string | undefined;
|
|
13
|
-
ORGANIZATION_SLUG?: string | undefined;
|
|
14
|
-
ORG_SLUG?: string | undefined;
|
|
15
|
-
PROJECT_ID?: string | undefined;
|
|
16
|
-
PROJECT_SLUG?: string | undefined;
|
|
17
|
-
PROJECT_URL?: string | undefined;
|
|
18
|
-
PROJECT_BUILD_ID?: string | undefined;
|
|
19
|
-
PUBLIC_REDOCLY_BRANCH_NAME?: string | undefined;
|
|
20
|
-
}, {
|
|
21
|
-
ORGANIZATION_ID?: string | undefined;
|
|
22
|
-
ORGANIZATION_SLUG?: string | undefined;
|
|
23
|
-
ORG_SLUG?: string | undefined;
|
|
24
|
-
PROJECT_ID?: string | undefined;
|
|
25
|
-
PROJECT_SLUG?: string | undefined;
|
|
26
|
-
PROJECT_URL?: string | undefined;
|
|
27
|
-
PROJECT_BUILD_ID?: string | undefined;
|
|
28
|
-
PUBLIC_REDOCLY_BRANCH_NAME?: string | undefined;
|
|
29
|
-
}>;
|
|
11
|
+
}, z.core.$strip>;
|
|
30
12
|
//# sourceMappingURL=organization-project.d.ts.map
|
|
@@ -3,10 +3,6 @@ import { z } from 'zod';
|
|
|
3
3
|
* Schema for scorecards configuration variables.
|
|
4
4
|
*/
|
|
5
5
|
export declare const scorecardsSchema: z.ZodObject<{
|
|
6
|
-
SCORECARDS_POLLING_INTERVAL_MS: z.ZodOptional<z.
|
|
7
|
-
},
|
|
8
|
-
SCORECARDS_POLLING_INTERVAL_MS?: string | undefined;
|
|
9
|
-
}, {
|
|
10
|
-
SCORECARDS_POLLING_INTERVAL_MS?: string | undefined;
|
|
11
|
-
}>;
|
|
6
|
+
SCORECARDS_POLLING_INTERVAL_MS: z.ZodOptional<z.ZodCoercedString<unknown>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
12
8
|
//# sourceMappingURL=scorecards.d.ts.map
|
|
@@ -4,21 +4,15 @@ import { z } from 'zod';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const searchSchema: z.ZodObject<{
|
|
6
6
|
SEARCH_DEV_REINIT: z.ZodOptional<z.ZodString>;
|
|
7
|
-
SEARCH_DEV_DEBUG: z.
|
|
8
|
-
|
|
7
|
+
SEARCH_DEV_DEBUG: z.ZodPipe<z.ZodDefault<z.ZodEnum<{
|
|
8
|
+
false: "false";
|
|
9
|
+
true: "true";
|
|
10
|
+
}>>, z.ZodTransform<boolean, "false" | "true">>;
|
|
11
|
+
REDOCLY_SKIP_TYPESENSE_INDEXING: z.ZodPipe<z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
false: "false";
|
|
13
|
+
true: "true";
|
|
14
|
+
}>>, z.ZodTransform<boolean, "false" | "true">>;
|
|
9
15
|
TYPESENSE_API_URL: z.ZodOptional<z.ZodString>;
|
|
10
16
|
TYPESENSE_API_KEY: z.ZodOptional<z.ZodString>;
|
|
11
|
-
},
|
|
12
|
-
SEARCH_DEV_REINIT?: string | undefined;
|
|
13
|
-
SEARCH_DEV_DEBUG: boolean;
|
|
14
|
-
REDOCLY_SKIP_TYPESENSE_INDEXING: boolean;
|
|
15
|
-
TYPESENSE_API_URL?: string | undefined;
|
|
16
|
-
TYPESENSE_API_KEY?: string | undefined;
|
|
17
|
-
}, {
|
|
18
|
-
SEARCH_DEV_REINIT?: string | undefined;
|
|
19
|
-
SEARCH_DEV_DEBUG?: "false" | "true" | undefined;
|
|
20
|
-
REDOCLY_SKIP_TYPESENSE_INDEXING?: "false" | "true" | undefined;
|
|
21
|
-
TYPESENSE_API_URL?: string | undefined;
|
|
22
|
-
TYPESENSE_API_KEY?: string | undefined;
|
|
23
|
-
}>;
|
|
17
|
+
}, z.core.$strip>;
|
|
24
18
|
//# sourceMappingURL=search.d.ts.map
|
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
* Schema for server configuration variables.
|
|
4
4
|
*/
|
|
5
5
|
export declare const serverConfigSchema: z.ZodObject<{
|
|
6
|
-
PORT: z.ZodOptional<z.
|
|
6
|
+
PORT: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
7
7
|
REDOCLY_LOG_FORMAT: z.ZodOptional<z.ZodString>;
|
|
8
8
|
REDOCLY_LOG_LEVEL: z.ZodOptional<z.ZodString>;
|
|
9
9
|
TERM: z.ZodOptional<z.ZodString>;
|
|
@@ -12,37 +12,12 @@ export declare const serverConfigSchema: z.ZodObject<{
|
|
|
12
12
|
REDOCLY_CONTENT_DIR: z.ZodOptional<z.ZodString>;
|
|
13
13
|
REDOCLY_PORTAL_VERSION: z.ZodOptional<z.ZodString>;
|
|
14
14
|
REDOCLY_TELEMETRY: z.ZodOptional<z.ZodString>;
|
|
15
|
-
TELEMETRY_DEV_DEBUG: z.
|
|
15
|
+
TELEMETRY_DEV_DEBUG: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
|
|
16
|
+
false: "false";
|
|
17
|
+
true: "true";
|
|
18
|
+
}>>, z.ZodTransform<boolean | undefined, "false" | "true" | undefined>>;
|
|
16
19
|
WEB_SERVER_IDLE_TIMEOUT: z.ZodOptional<z.ZodString>;
|
|
17
20
|
REDOCLY_PROBLEMS_OUTPUT_FILE: z.ZodOptional<z.ZodString>;
|
|
18
21
|
REDOCLY_METADATA_OUTPUT_FOLDER: z.ZodOptional<z.ZodString>;
|
|
19
|
-
},
|
|
20
|
-
PORT?: number | undefined;
|
|
21
|
-
REDOCLY_LOG_FORMAT?: string | undefined;
|
|
22
|
-
REDOCLY_LOG_LEVEL?: string | undefined;
|
|
23
|
-
TERM?: string | undefined;
|
|
24
|
-
INSPECT_MODE?: string | undefined;
|
|
25
|
-
REDOCLY_PREFIX_PATHS?: string | undefined;
|
|
26
|
-
REDOCLY_CONTENT_DIR?: string | undefined;
|
|
27
|
-
REDOCLY_PORTAL_VERSION?: string | undefined;
|
|
28
|
-
REDOCLY_TELEMETRY?: string | undefined;
|
|
29
|
-
TELEMETRY_DEV_DEBUG?: boolean | undefined;
|
|
30
|
-
WEB_SERVER_IDLE_TIMEOUT?: string | undefined;
|
|
31
|
-
REDOCLY_PROBLEMS_OUTPUT_FILE?: string | undefined;
|
|
32
|
-
REDOCLY_METADATA_OUTPUT_FOLDER?: string | undefined;
|
|
33
|
-
}, {
|
|
34
|
-
PORT?: number | undefined;
|
|
35
|
-
REDOCLY_LOG_FORMAT?: string | undefined;
|
|
36
|
-
REDOCLY_LOG_LEVEL?: string | undefined;
|
|
37
|
-
TERM?: string | undefined;
|
|
38
|
-
INSPECT_MODE?: string | undefined;
|
|
39
|
-
REDOCLY_PREFIX_PATHS?: string | undefined;
|
|
40
|
-
REDOCLY_CONTENT_DIR?: string | undefined;
|
|
41
|
-
REDOCLY_PORTAL_VERSION?: string | undefined;
|
|
42
|
-
REDOCLY_TELEMETRY?: string | undefined;
|
|
43
|
-
TELEMETRY_DEV_DEBUG?: "false" | "true" | undefined;
|
|
44
|
-
WEB_SERVER_IDLE_TIMEOUT?: string | undefined;
|
|
45
|
-
REDOCLY_PROBLEMS_OUTPUT_FILE?: string | undefined;
|
|
46
|
-
REDOCLY_METADATA_OUTPUT_FOLDER?: string | undefined;
|
|
47
|
-
}>;
|
|
22
|
+
}, z.core.$strip>;
|
|
48
23
|
//# sourceMappingURL=server-config.d.ts.map
|
|
@@ -4,9 +4,5 @@ import { z } from 'zod';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const siteSchema: z.ZodObject<{
|
|
6
6
|
SITE_URL: z.ZodOptional<z.ZodString>;
|
|
7
|
-
},
|
|
8
|
-
SITE_URL?: string | undefined;
|
|
9
|
-
}, {
|
|
10
|
-
SITE_URL?: string | undefined;
|
|
11
|
-
}>;
|
|
7
|
+
}, z.core.$strip>;
|
|
12
8
|
//# sourceMappingURL=site.d.ts.map
|
|
@@ -3,16 +3,11 @@ import { z } from 'zod';
|
|
|
3
3
|
* Schema for SSR (Server-Side Rendering) configuration variables.
|
|
4
4
|
*/
|
|
5
5
|
export declare const ssrSchema: z.ZodObject<{
|
|
6
|
-
REDOCLY_SSR_RENDER_MODE: z.ZodOptional<z.ZodEnum<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}, {
|
|
14
|
-
REDOCLY_SSR_RENDER_MODE?: "main" | "worker" | undefined;
|
|
15
|
-
REDOCLY_SSR_WORKERS_MIN?: number | undefined;
|
|
16
|
-
REDOCLY_SSR_WORKERS_MAX?: number | undefined;
|
|
17
|
-
}>;
|
|
6
|
+
REDOCLY_SSR_RENDER_MODE: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
main: "main";
|
|
8
|
+
worker: "worker";
|
|
9
|
+
}>>;
|
|
10
|
+
REDOCLY_SSR_WORKERS_MIN: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
11
|
+
REDOCLY_SSR_WORKERS_MAX: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
18
13
|
//# sourceMappingURL=ssr.d.ts.map
|
|
@@ -5,11 +5,5 @@ import { z } from 'zod';
|
|
|
5
5
|
export declare const telemetrySchema: z.ZodObject<{
|
|
6
6
|
OTEL_TRACES_URL: z.ZodOptional<z.ZodString>;
|
|
7
7
|
REQUEST_ID: z.ZodOptional<z.ZodString>;
|
|
8
|
-
},
|
|
9
|
-
OTEL_TRACES_URL?: string | undefined;
|
|
10
|
-
REQUEST_ID?: string | undefined;
|
|
11
|
-
}, {
|
|
12
|
-
OTEL_TRACES_URL?: string | undefined;
|
|
13
|
-
REQUEST_ID?: string | undefined;
|
|
14
|
-
}>;
|
|
8
|
+
}, z.core.$strip>;
|
|
15
9
|
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as
|
|
2
|
-
`),loader:"css",resolveDir:
|
|
1
|
+
import*as m from"node:path";import{CONFIG_FILE_NAME as D,DEFAULT_THEME_NAME as g,USER_THEME_ALIAS as d}from"../../../constants/common.js";import{isDefined as k}from"../../../utils/guards/is-defined.js";import{slash as $}from"../../../utils/path/slash.js";import{resolveExternalPlugins as i}from"../../external-plugins/resolve-external-plugins.js";import{generateMarkdocComponentsEntry as L,generateMarkdocSchemasEntry as M}from"./codegen/index.js";const y=new Map,S=(a,n)=>{const h=m.resolve(n,d),p=m.resolve(n,D),R=["components","core","layouts","markdoc","icons","config","ext"],w="@redocly\\/theme\\/",E=R.map(t=>`${w}${t}`).join("|"),F=new RegExp(`^(@redocly/theme$|${E})`);return{name:"esbuild-redocly-custom-themes-resolver",setup:t=>{t.onResolve({filter:/@redocly-markdoc\/schema/},async e=>{const s=(await i(n,a.config.plugins)).flatMap(r=>r.markdoc?.schemaFile).filter(k);return{namespace:"markdoc-schema-ns",path:e.path,watchFiles:[...s,p],watchDirs:[m.resolve(h,"markdoc")],pluginData:{schemaFiles:s}}}),t.onLoad({filter:/@redocly-markdoc\/schema/,namespace:"markdoc-schema-ns"},({pluginData:e})=>({contents:M(e),resolveDir:"/",loader:"ts"})),t.onResolve({filter:/@redocly-markdoc\/components/},async e=>{const s=[...(await i(n,a.config.plugins)).map(r=>r.markdoc?.componentsFile).filter(k)];return{namespace:"markdoc-schema-ns",path:e.path,watchFiles:[...s,p],pluginData:{componentsFiles:s},watchDirs:[m.resolve(h,"markdoc")]}}),t.onLoad({filter:/@redocly-markdoc\/components/,namespace:"markdoc-schema-ns"},({pluginData:e})=>({contents:L(e),resolveDir:"/",loader:"ts"})),t.onResolve({filter:/@styles/},async e=>{const s=(await i(n,a.config.plugins)).map(r=>r.stylesFile).filter(Boolean);return{namespace:"user-styles-ns",path:e.path,watchFiles:[...s,p],pluginData:{styleFiles:s},watchDirs:[h]}}),t.onLoad({filter:/@styles/,namespace:"user-styles-ns"},async({pluginData:e})=>{const{styleFiles:o}=e;return{contents:o.map(r=>`@import url("${$(m.relative(n,r))}");`).join(`
|
|
2
|
+
`),loader:"css",resolveDir:n}}),t.onResolve({filter:/(^|\/)styles\.css$/},async({path:e,...o})=>{if(o.pluginData==="missing-styles-ns")return;const s=await t.resolve(e,{...o,pluginData:"missing-styles-ns"});return s.errors.length&&s.errors.some(r=>r.text.match(/^Could not resolve .*?\bstyles.css\b/))?{namespace:"missing-styles-ns",path:e}:s}),t.onLoad({filter:/(^|\/)styles\.css$/,namespace:"missing-styles-ns"},async()=>({contents:"",loader:"css"})),t.onResolve({filter:/^react-router-dom$/},()=>({namespace:"react-router-dom-ns",path:"react-router-dom"})),t.onLoad({filter:/^react-router-dom$/,namespace:"react-router-dom-ns"},async()=>{const o=(await i(n,a.config.plugins)).find(({name:c})=>c===g),s=await t.resolve("@redocly/theme/package.json",{resolveDir:o?.pluginDirAbsolutePath??n,kind:"require-resolve"});return{contents:`import * as ReactRouter from 'react-router';
|
|
3
3
|
export const useLocation = ReactRouter.useLocation;
|
|
4
|
-
export const useInRouterContext = ReactRouter.useInRouterContext;`,loader:"js",resolveDir:
|
|
4
|
+
export const useInRouterContext = ReactRouter.useInRouterContext;`,loader:"js",resolveDir:s.errors.length?n:m.dirname(s.path)}}),t.onResolve({filter:F},async e=>{if(e.resolveDir==="")return;const o=`${e.path}:${e.importer}`;if(y.has(o))return y.get(o);const{path:s,...r}=e,c=await i(n,a.config.plugins),u=e.path.replace(g,"")||"index";for(let l=c.length-1;l>=0;l--){const x=c[l].isNpmPackage?[m.join(c[l].name,"src",u),{...r,resolveDir:c[l].pluginDirAbsolutePath}]:[`./${u}`,{...r,resolveDir:c[l].pluginDirAbsolutePath}],f=T(await t.resolve(...x));if("path"in f&&f.path!==e.importer){const v={...f,watchFiles:[p,m.join(n,d,u+".tsx")]};return c[l].name===d||y.set(o,v),v}}})}}};function T(a){return a.errors.length?{errors:a.errors}:a}export{S as ThemesResolver,y as resolveCache};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as
|
|
1
|
+
import{existsSync as m,readFileSync as F}from"node:fs";import{createRequire as k}from"node:module";import s from"node:path";import{resolvePlugins as A}from"@redocly/openapi-core";import{DEFAULT_PROJECT_PLUGIN_PATHS as d,DEFAULT_THEME_PLUGIN_PATH as c,STYLES_FILE as S}from"../constants/common.js";import{GATED_PLUGINS as v}from"../constants/entitlements.js";import{DEFAULT_THEME_NAME as h}from"../../constants/common.js";import{isDefined as _}from"../../utils/guards/is-defined.js";import{isPlainObject as g}from"../../utils/guards/is-plain-object.js";import{logger as C}from"../tools/notifiers/logger.js";import{reporter as L}from"../tools/notifiers/reporter.js";import{sha as w}from"../utils/crypto/sha.js";import{resolveModule as P}from"./resolve-module.js";import{EntitlementsProvider as I}from"../entitlements/entitlements-provider.js";const f={sha:"",value:Promise.resolve({resolvedPlugins:[],errors:[]})};async function ee(e,r=[]){const n=w(JSON.stringify(r));if(f.sha!==n){f.sha=n;const o=M(e),a=N(e,r,o),p=await A(a,e)||[];if(!a.some(i=>d.includes(i))){const i=d[0],l=s.join(e,i);p.push({id:"",absolutePath:l,path:i})}f.value=Promise.all(p.map(i=>b(i,i.path===o?c:i.path))).then(i=>{const l=i.filter(_),j=l.filter(u=>u?.type&&["error","warning"].includes(u.type)),D=l.filter(u=>u.type==="resolvedPlugin");return{errors:j,resolvedPlugins:D}})}const t=await f.value;if(t.errors.length)for(let o=0;o<t.errors.length;o++)await L.panicOnBuildContentError(t.errors[o].error);return t.resolvedPlugins}function M(e){const r=s.resolve(e,"package.json");if(!y(s.dirname(r)))return P(c)??c;const n=E(o=>k(r).resolve(o)),t=E(P);return n&&t&&n!==t&&C.warn("The project declares %s %s, and Realm uses it instead of the %s it was built with.",h,n,t),c}function y(e){const r=T(s.join(e,"package.json")),n=[r?.dependencies,r?.devDependencies].some(o=>g(o)&&h in o),t=s.dirname(e);return n||t!==e&&y(t)}function E(e){try{const r=e(`${h}/package.json`),n=r&&T(r)?.version;return typeof n=="string"?n:void 0}catch{return}}function T(e){try{const r=JSON.parse(F(e,"utf8"));return g(r)?r:void 0}catch{return}}function N(e,r=[],n){const t=[...r];for(const o of d)!t.includes(o)&&m(s.join(e,o))&&t.push(o);return t.includes(c)||t.unshift(n),t}async function b(e,r){if(!e.absolutePath||!r)return{type:"error",error:`Plugin with path "${e}" not found`};const n=s.dirname(e.absolutePath),{lifecyclePlugin:t,config:o}=R(e,r);return{name:s.dirname(r),type:"resolvedPlugin",isNpmPackage:O(r),pluginDirAbsolutePath:n,lifecyclePlugin:t,config:o,stylesFile:s.resolve(n,S),markdoc:U(n)}}function O(e){const r=s.dirname(e);return P(s.join(r,"package.json"))!=null}function R(e,r){const n=I.instance(),t=!n.canAccessFeature("customPlugins")&&!v.includes(r),o=e.requiredEntitlements&&v.includes(r)&&!e.requiredEntitlements.every(a=>n.canAccessFeature(a));return t||o?{lifecyclePlugin:{id:e.id},config:{}}:{lifecyclePlugin:{id:e.id,processContent:e.processContent,afterRoutesCreated:e.afterRoutesCreated,loaders:e.loaders,requiredEntitlements:e.requiredEntitlements},config:{schema:e.redoclyConfigSchema,ejectIgnore:e.ejectIgnore}}}function U(e){const r=s.resolve(e,"markdoc"),n=s.join(r,"schema.ts");if(!m(n))return null;const t=s.join(r,"components.tsx");return{schemaFile:n,componentsFile:m(t)?t:void 0}}export{ee as resolveExternalPlugins};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolve as
|
|
1
|
+
import{resolve as c,dirname as p}from"node:path";import{fileURLToPath as f}from"node:url";import{createReadStream as l}from"fs";import{envConfig as u}from"./config/env-config.js";import{telemetry as d}from"./telemetry/index.js";import{createRouter as v}from"./web-server/router.js";import{installProdRoutes as g}from"./web-server/routes/index.js";import{Store as S}from"./store.js";import{loadEnvVariables as R}from"./utils/envs/load-env-variables.js";import{startHttpServer as x}from"./web-server/http.js";import{readStaticData as D}from"./utils/static-data.js";import{startIdleTimeout as P}from"./web-server/middleware/idleTimeoutMiddleware.js";import{reporter as w}from"./tools/notifiers/reporter.js";import{logger as E}from"./tools/notifiers/logger.js";import{EntitlementsProvider as y}from"./entitlements/entitlements-provider.js";import{DatabasePreconnectService as b}from"./providers/database/database-preconnect-service.js";import{KvService as h}from"./persistence/kv/services/kv-service.js";import{runScorecardsWorker as I}from"./plugins/scorecards/workers/run-scorecards-worker.js";import{isScorecardsEnabled as O}from"./utils/is-scorecards-enabled.js";import{isRealmOrReef as T}from"./utils/is-realm-or-reef.js";import{renderPage as rr}from"./ssr/index.js";const k=new URL(import.meta.url),A=k.searchParams.get("only-exports")==="true";if(!A){let s=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=p(f(import.meta.url));await R(e);const n=await S.fromServerFiles({outdir:c(e,"../client"),serverOutDir:e,serverMode:!0,contentDir:""});if(await y.instance().init({ignoreTokenExpiration:!0}),T()){await b.init(e);const r=await h.getInstance({baseDbDir:e});setInterval(()=>{r.clearExpired().catch(t=>{E.error("Failed to clear expired KV entries",t)})},300*1e3)}m(n).catch(r=>{console.error(r)});async function m(r){d.initialize();const t=v();g(t,r,{readStaticAsset:async a=>l(a),resolveRouteData:async a=>D(a.slug,r.outdir)}),w.printErrors();const o=s(),i=u.PORT;return await x(t,o??i??4e3),P(),O(r.config)&&I(r.serverOutDir,r.config.scorecards),t}}export{rr as renderPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{REDOCLY_ROUTE_RBAC as
|
|
1
|
+
import{REDOCLY_ROUTE_RBAC as T,REDOCLY_TEAMS_RBAC as A}from"@redocly/config";import{mcpTagSchemas as rt,schemaDefinitionTag as at,markdocParser as U}from"@redocly/api-docs";import{withPathPrefix as $}from"@redocly/theme/core/utils";import{API_DOCS_TEMPLATE_ID as j,GRAPHQL_SPEC_SLUG as st,PUBLIC_RBAC_SCOPE_ITEM as N}from"../../../constants/common.js";import{DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER as it,PUBLIC_API_DEFINITIONS_FOLDER as nt}from"../../constants/common.js";import{API_DOCS_SHARED_DATA_PREFIX as k}from"../../constants/plugins/api-docs.js";import{fromCurrentDir as ct}from"../../utils/paths.js";import{normalizeRouteSlug as pt}from"../../../utils/path/normalize-route-slug.js";import{removeTrailingSlash as ut}from"../../../utils/url/remove-trailing-slash.js";import{isTranslationFallback as lt}from"../../fs/utils/is-translation-fallback.js";import{createSlugify as dt}from"../create-slugify.js";import{apiDocLoader as mt,apiDocsLoader as ft}from"./loader.js";import{getTemplatePath as V}from"./get-template-path.js";import{getDefinitionSourcePaths as gt,storeDefinitionBundles as ht}from"./store-definition-bundles.js";import{telemetryTraceStep as St}from"../../../cli/telemetry/helpers/trace-step.js";import{searchResolver as Dt}from"./search/search-resolver.js";import{getAiDocumentsStore as Pt}from"./search/get-ai-search-documents.js";import{getApiConfigByPath as yt}from"../get-api-config.js";import{getRouteSlugsForPath as It}from"../utils.js";import{collectItemRoutes as At}from"./utils/collect-item-routes.js";import{isChunkCurrent as vt}from"./utils/decorators.js";import{applyNavItemToRoot as bt}from"./utils/apply-nav-item-to-root.js";import{buildRoutesMapping as Rt}from"./utils/build-routes-mapping.js";import{buildItemPositions as _t}from"./utils/build-item-positions.js";import{resolveApiDocTitle as Ct}from"./utils/resolve-api-doc-title.js";import{resolveConfigRbac as W}from"./utils/resolve-config-rbac.js";import{relativePathToBaseSlug as Tt}from"./utils/relative-path-to-base-slug.js";import{normalizeApiVersion as wt}from"./utils/normalize-api-version.js";import{importApiDocsBuilder as Q}from"./import-api-docs-builder.js";import{envConfig as G}from"../../config/env-config.js";import{logger as Et}from"../../tools/notifiers/logger.js";const O="openapi-spec-download",kt={asyncapi:"AsyncAPI Docs",graphql:"GraphQL Docs",openapi:"OpenAPI Docs"};async function fe(){let e=[],r=new Map;const s=new WeakMap;let n=new Set,m={},b={};function Y(o,S,v){const I=s.get(o)??new Map;s.set(o,I);const D=S??"";return I.get(D)===v?!1:(I.set(D,v),!0)}return{id:"api-docs",requiredEntitlements:["openapi","asyncapi","graphql"],loaders:{"api-doc":mt,"api-docs":ft},processContent:async(o,S)=>{await St("com.redocly.build.plugin.apiDocs",async()=>{o.createRequestHandler(O,ct(import.meta.url,"./spec-download.api.js")),o.addApiRoute({slug:nt+"/*",requestHandlerId:O,httpMethod:"all",[A]:N,getStaticData:async()=>({props:{definitionSourcePaths:b}})}),o.addApiRoute({slug:it+"/*",requestHandlerId:O,httpMethod:"all",[A]:N,getStaticData:async()=>({props:{definitionSourcePaths:b}})}),o.addApiRoute({slug:st+"/*",requestHandlerId:O,httpMethod:"all",[A]:N,getStaticData:async()=>({props:{}})});const v=o.createTemplate(j,V("../../../client/templates/api-docs/template.js")),I=o.registerServerPropsGetter(j,V("./get-server-props.js")),D=await S.getConfig();r=new Map,m={};const P=await o.loadApiDocuments(S);ht(P,o.outdir),b=gt(P);const w=!!D.plugins?.some(t=>typeof t=="string"&&t.startsWith("@redocly/portal-plugin-async-api/"));w&&P.some(t=>t.type==="asyncapi")&&Et.warn("The plugin '@redocly/portal-plugin-async-api' is deprecated. Please remove it from your config to use built-in AsyncAPI docs.");const c=w?P.filter(t=>t.type!=="asyncapi"):P;e=c.map(({markdocChunks:t,relativePath:y,isVirtual:p,customOutputRelativeFile:a,realRelativePath:h})=>({chunks:t??[],relativePath:y,realRelativePath:h,isVirtual:a!=null||p}));const{buildItems:i}=await Q(o.serverOutDir),f=(await S.cache.load("content-slugs","content-slugs")).data,g=dt(f),F=t=>pt(g(t));for(const t of c){const y=t.customOutputRelativeFile||t.relativePath,p=F(y);Mt(t,p);const{items:a,store:h}=await i({type:t.type,document:t.document,options:t.options,basePath:p,markdownParser:U}),R=`${k}${t.relativePath}`,M=G.isDevelopMode?t.relativePath:void 0,u=Bt(t.document),_=u?.["x-metadata"],C=t.isVirtual?void 0:_?.apiId,L={document:t,basePath:p,sourcePath:M,apiId:C,build:{items:a,store:h}};await o.createSharedData(R,z(L,a,h));const X=W(t.config),B=!!t.options.excludeFromSearch,J=t.type==="openapi",Z=At(a,X),tt=lt(t),d=Z.map(l=>{const x=l.metadata?.seo,E={fsPath:y,templateId:v,sharedData:[{key:"apiDocsStore",id:R}],serverPropsGetterIds:[I],excludeFromSearch:B,getStaticData:Ft(l.label,x,tt),[A]:l[A]};return Object.assign(E,Lt(l.link,p)),J&&l.httpVerb&&(E.httpVerb=l.httpVerb,E.metadata={subType:"openapi-operation"}),E});if(!d.length)continue;const H=Ct(u,t.type,a),et=wt(u?.version),q={type:t.type,title:H,version:et,description:typeof u?.description=="string"?u.description:void 0,summary:typeof u?.summary=="string"?u.summary:void 0,...u?.["x-metadata"]&&typeof u["x-metadata"]=="object"?u["x-metadata"]:{}};d[0]={...d[0],metadata:q,hasClientRoutes:!0,getSidebar:(l,x)=>bt(K(a),p,x),getNavText:()=>H??kt[t.type]??"API Docs",getSearchDocuments:Dt(a,q,o.getSearchFacets,o.setSearchFacets,B,h,t.document),getAiDocumentsStore:Pt({getBuild:()=>L.build,metadata:q,document:t.document,specType:t.type,excludeFromSearch:B,basePath:p,getSearchFacets:o.getSearchFacets,markdocTags:{...rt,schemaDefinition:at}})};const ot=d[0];d[0]=d[d.length-1],d[d.length-1]=ot;for(const l of d)o.addRoute(l);if(C){const l=yt(t.config?.apis,t.realRelativePath);m[C]={[A]:l.rbac,[T]:{fsPath:y}}}r.set(R,L)}})},afterRoutesCreated:async(o,S)=>{const{buildItems:v,simplifyAstStructure:I}=await Q(o.serverOutDir),D=new Set,P=new Set;for(const{chunks:c,relativePath:i,isVirtual:f}of e){const g=`${k}${i}`,F=It(o.getAllRoutes(),i);for(const{node:t,markdown:y,pointer:p,key:a,relativePath:h}of c){const{ast:R,compoundHash:M}=await o.parseMarkdoc({input:{content:y,relativePath:h,isVirtual:f},resource:p,context:S,deps:{sharedDataIds:[`${k}${h}`],routeSlugs:F}});if(D.add(p),!(a==="graphql-docs"?t?.description?.value!==void 0:!!a&&vt(t,a,y))||!Y(t,a,M))continue;P.add(g);const _=I(R);if(a==="graphql-docs"){t.description&&(t.description.value=_);const C=`${k}${h}`;Ot(r.get(C),_)}else a&&(t[a]=_)}}const w=n.difference(D);for(const c of w)S.cache.delete(c);n=D,Object.entries(m).forEach(([c,i])=>{const f=i[T]?.fsPath;if(!f)return;const g=o.getRouteByFsPath(f)?.baseSlug;m[c]={...i,[T]:{...i[T],slug:g},slug:g}}),o.setGlobalData({apiProducts:m});for(const[c,i]of r){if(!P.has(c))continue;const{items:f,store:g}=await v({type:i.document.type,document:i.document.document,options:i.document.options,basePath:i.basePath,markdownParser:U});i.build={items:f,store:g},await o.createSharedData(c,z(i,f,g))}}}}function z({document:e,basePath:r,sourcePath:s,apiId:n},m,b){return{[A]:W(e.config),[T]:{slug:ut(r),fsPath:e.customOutputRelativeFile||e.relativePath},items:m,store:b,options:e.options,baseSlug:r,routesMapping:G.isDevelopMode?Rt(m,r):{},graphqlPositions:G.isDevelopMode&&e.type==="graphql"?_t(m,r):void 0,sourcePath:s,apiId:n}}function Ot(e,r){e?.document.type!=="graphql"||!e.document.options||(e.document.options.info={...e.document.options.info||{},description:r})}function Ft(e,r,s){return async function(n){return{...s?{isTranslationFallback:!0}:{},props:{settings:{baseUrlPath:$(n.baseSlug)},disableAutoScroll:!0,seo:{title:e,...r}}}}}function Mt(e,r){const s=e.options?.mockServer,n=$(`/_mock${Tt(e.relativePath)}`);s?.url===n&&(e.options={...e.options,mockServer:{...s,url:$(`/_mock${r}`)}})}function Lt(e,r){if(e===r)return{};const s=r==="/"?"/":`${r}/`;if(e.startsWith(s)){const n=e.slice(s.length);return n?{slugSuffix:n}:{}}return{slug:e}}function Bt(e){if(e&&typeof e=="object"&&"info"in e)return e.info}function K(e){return e.map(({content:r,items:s,...n})=>({...n,...s&&{items:K(s)}}))}export{fe as apiDocsPlugin,Lt as toRouteSlugFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"node:path";import{existsSync as f}from"node:fs";import{readFile as w}from"node:fs/promises";import g from"js-yaml";import{withoutPathPrefix as T}from"@redocly/theme/core/utils";import{DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER as C,PUBLIC_API_DEFINITIONS_FOLDER as A}from"../../constants/common.js";import{GRAPHQL_SPEC_SLUG as U}from"../../../constants/common.js";import{canDownloadApiDefinition as B,filterDataByAccessDeep as G}from"../../utils/rbac.js";import{API_DOWNLOAD_PREFIXES as W}from"../../utils/is-api-download-link.js";import{decodeRequestPath as X}from"../../utils/decode-request-path.js";import{replaceFileExtension as $}from"./utils/replace-file-extension.js";const v=[".json",".yaml",".yml"],H=[".graphql",".gql"];function F(r,o){const t=e.parse(r);return e.join(t.dir,t.name+o)}const J=async(r,o,t)=>{const{isAuthenticated:c,teams:d,claims:{email:m}}=o.user,_=new URL(r.url),n=X(T(_.pathname));if(n===void 0||n.endsWith("/"))return new Response("Bad Request",{status:400});const i=W.find(a=>n.startsWith(`${a}/`));if(i===void 0)return new Response("Not found",{status:404});const p=i===U,s=n.slice(i.length),l=e.extname(s);if(!(p?H:v).includes(l))return new Response("Not found",{status:404});const{rbac:h={},requiresLogin:P=!1}=o.config.access||{},y=t.props?.definitionSourcePaths??{},E=p?void 0:y[$(s.slice(1),"")],D=E?`${i}/${E}`:n;if(!B(D,h,P,{isAuthenticated:c,email:m,teams:d}))return new Response("Unauthorized",{status:c?403:401});const u=t.props?.outdir||"";if(p){const a=e.join(u,A,s);if(!f(a))return new Response("Not found",{status:404});const j=await w(a,"utf-8");return new Response(j,{headers:{"Content-Type":"application/graphql"}})}const R=e.join(u,A,F(s,".json")),N=e.join(u,C,F(s,".json")),S=f(R),x=f(N);if(!S&&!x)return new Response("Not found",{status:404});const O=await w(S?R:N,"utf-8"),L=JSON.parse(O),I=G(L,{isAuthenticated:c,email:m,teams:d},h,P),q=l===".yaml"?g.dump(I):JSON.stringify(I,null,2);return new Response(q,{headers:{"Content-Type":l===".yaml"?"application/yaml":"application/json"}})};var oe=J;export{oe as default};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { BundledApiDefinition } from './loader.js';
|
|
2
|
+
/**
|
|
3
|
+
* Source file of each OpenAPI/AsyncAPI bundle, keyed by the bundle path without its extension
|
|
4
|
+
* (`apis/museum` for `apis/museum.yaml`): the download route serves one bundle under `.json`,
|
|
5
|
+
* `.yaml` and `.yml`, and access rules name the source file.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getDefinitionSourcePaths(definitions: BundledApiDefinition[]): Record<string, string>;
|
|
2
8
|
export declare function storeDefinitionBundles(definitions: BundledApiDefinition[], outDir: string): void;
|
|
3
9
|
//# sourceMappingURL=store-definition-bundles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{writeFileSync as
|
|
1
|
+
import{writeFileSync as h}from"fs";import m from"path";import{print as u}from"graphql";import{PUBLIC_API_DEFINITIONS_FOLDER as d,PUBLIC_STATIC_FOLDER as a}from"../../constants/common.js";import{logger as g}from"../../tools/notifiers/logger.js";import{ensureDir as P}from"../../utils/fs.js";import{replaceFileExtension as l}from"./utils/replace-file-extension.js";const f=new Map;function _(o){const t={};for(const{relativePath:i,type:n}of o)n==="graphql"||i.startsWith(a+"/")||(t[l(i,"")]=i);return t}function E(o,t){const i=d.slice(1);try{for(const n of o){const{document:s,relativePath:e,hash:r,type:p}=n;if(f.get(e)!==r){if(p==="graphql"){c({outDir:t,definitionFolder:i,relativePath:e,definitionString:u(s)}),f.set(e,r);continue}if(e.startsWith(a+"/")){c({outDir:t,definitionFolder:".",relativePath:e.replace(a+"/",""),definitionString:JSON.stringify(s,null,2)}),f.set(e,r);continue}c({outDir:t,definitionFolder:i,relativePath:l(e,".json"),definitionString:JSON.stringify(s,null,2)}),f.set(e,r)}}}catch(n){g.error("failed to store definition bundles",n)}}function c({outDir:o,definitionString:t,relativePath:i,definitionFolder:n}){h(P(m.resolve(o,`${n}/${i}`)),t,"utf8")}export{_ as getDefinitionSourcePaths,E as storeDefinitionBundles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import S from"path";import{REDOCLY_ROUTE_RBAC as
|
|
1
|
+
import S from"path";import{REDOCLY_ROUTE_RBAC as b,REDOCLY_TEAMS_RBAC as y}from"@redocly/config";import{deepMerge as w}from"../../../utils/object/deep-merge.js";import{parsePathVersions as D}from"../../../utils/path/parse-path-versions.js";import{buildWildcardRedirectsTree as T}from"../../utils/redirects/build-wildcard-redirects-tree.js";import{shaHexShort as O}from"../../utils/crypto/sha-hex-short.js";import{isDefined as E}from"../../../utils/guards/is-defined.js";import{logger as L}from"../../tools/notifiers/logger.js";import{formatCustomScripts as h,formatCustomLinks as k}from"./format-custom-tags.js";import{applyL10nToRbacConfig as G,resolveDirectoryHashes as j}from"../../utils/rbac.js";import{isConsentEnabled as B}from"../consent/is-consent-enabled.js";import{copySeoAssets as F}from"./copy-seo-assets.js";import{normalizeRedirectSources as _}from"./normalize-redirect-sources.js";import{applyL10nToRedirects as x}from"./apply-l10n-to-redirects.js";import{DEFAULT_LOADERS as M}from"./loaders/index.js";import{resolveSearchFacets as z}from"./resolve-search-facets.js";import{telemetryTraceStep as I}from"../../../cli/telemetry/helpers/trace-step.js";import{transformMdAst as V}from"../markdown/runtime-transform.js";import{EntitlementsProvider as q}from"../../entitlements/entitlements-provider.js";async function lr(){return{id:"Config Parser",loaders:M,async processContent(e,{getConfig:a,fs:n}){await I("com.redocly.build.plugin.configParser",async t=>{const{contentDir:l,setGlobalConfig:o,setGlobalData:s}=e,r=await a(),i=r.access||{},m=G(n,i.rbac||{}),f={outdir:e.outdir,contentDir:l,consentEnabled:B(r.consent)},C=await h(r.scripts?.head,f),P=await k(r.links,f),R=await h(r.scripts?.body,f),d=w(r,{headScriptTags:C,linkTags:P,postBodyScriptTags:R});t?.setAttribute("config",JSON.stringify(d));const p=r.redirects?_(r.redirects):{},v=Object.keys(p),A=d.banner?.map(c=>typeof c=="object"&&c!==null&&c.rbac?{...c,[y]:c.rbac}:c);o({...d,banner:A,access:{...i,requiresLogin:!!i.requiresLogin,rbac:m},directoryPaths:await j(n,i.rbac),seo:r.seo&&await F(r.seo,f.contentDir,f.outdir),redirects:x(p,r.l10n),wildcardRedirectsTree:T(p),originalRedirectSources:v}),z(r.search?.filters?.facets||[],e.getSearchFacets,e.setSearchFacets);const g=q.instance(),u=!!g.canAccessFeature("removeAttribution");s({removeAttribution:g.pricingTier?u:!0,removeConsoleAttribution:u&&r.removeAttribution===!0})})},async afterRoutesCreated(e,a){H(e);const n=e.getGlobalConfig("banner");if(Array.isArray(n)){const t=await Promise.all(n.map(async(l,o)=>{const{content:s,...r}=l;if(!s){L.warn(`redocly.yaml: banner[${o}] has no content and is not shown.`);return}const{ast:i}=await e.parseMarkdoc({input:{content:s,relativePath:"redocly.yaml"},context:a,resource:`redocly.yaml#banner${o}`}),{renderableAst:m}=await V(i,{variables:{},partials:{}},e.serverOutDir);return Object.assign(r,{ast:m,hash:O(s)})}));e.setGlobalConfig({banner:t.filter(E)})}}}}function H(e){const a=e.getGlobalConfig("access")?.rbac,n=e.getGlobalConfig("directoryPaths");if(!(!a||Object.keys(a).length===0))for(const t of e.getAllRoutes()){if(t.versions&&n){const l=D(t.fsPath)?.filePathInVersion||"index.md";for(const o of t.versions){const s=n[o.folderId],i=s==="."||s==="/"?"":s;o[b]={slug:o.link,fsPath:S.posix.join(i,"@"+o.version,l)}}}t[b]||t[y]||(t[b]={slug:t.slug,fsPath:t.fsPath})}}export{lr as configParserPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import w from"path";import{lintConfig as $,loadConfig as
|
|
1
|
+
import w from"path";import{lintConfig as $,loadConfig as E,createConfigTypes as L}from"@redocly/openapi-core";import{rootRedoclyConfigSchema as q}from"@redocly/config";import{deepMerge as x}from"../../../../../utils/object/deep-merge.js";import{isPlainObject as g}from"../../../../../utils/guards/is-plain-object.js";import{logger as d}from"../../../../tools/notifiers/logger.js";import{BRANCH_ENV_PREFIX as j}from"../../../../../constants/common.js";import{sanitizeBranchName as O}from"../../../../utils/envs/sanitize-branch-name.js";import{envConfig as R}from"../../../../config/env-config.js";import{ajv as S,safeParsePartial as B}from"../../safe-parse.js";import{formatConfigProblem as I}from"../../format-error.js";import{ExternalResolver as M}from"../../../../fs/utils/external-ref-resolver.js";import{resolveMutuallyExclusiveProps as N}from"../../resolve-mutual-exclusion.js";function y(e,t,s,r){t in e&&e[t]&&typeof e[t]=="string"&&(/^https?:\/\/.*/.test(e[t])||r(new Error(`Invalid ${s} URL: "${e[t]}". ${s} must start with "http://" or "https://".`)))}function k(e,t){if("access"in e&&e.access&&typeof e.access=="object"){const s=e.access;y(s,"logoutReturnUrl","access.logoutReturnUrl",t),y(s,"residency","access.residency",t);const r=["requiresLogin","logoutReturnUrl","residency","sso","rbac"];for(const n of r)n in s&&s[n]!==void 0&&n in e&&e[n]!==void 0&&t(new Error(`Property '${n}' is defined both at root level and in 'access' object. Please use 'access.${n}' to define this configuration.`))}}function _(e){return S.compile(q.properties.graphql.properties.servers.items.properties.url)(e)}function C(e,t,s){if(g(e)&&Array.isArray(e.servers))for(const r of e.servers){const n=g(r)?r.url:void 0;if(typeof n=="string"&&!_(n)){const c=e.servers.indexOf(r),a=`${t}.servers[${c}].url`;s(new Error(`Invalid ${a}: "${n}". It must be an absolute http:// or https:// URL.`))}}}function D(e,t){if(C(e.graphql,"graphql",t),!!g(e.apis))for(const[s,r]of Object.entries(e.apis))g(r)&&C(r.graphql,`apis.${s}.graphql`,t)}async function ie(e,t,s,r){const c=t.getFileInfo(e)?.realRelativePath||e;async function a(){const p=new M(t),f=w.join(t.cwd,c),l=await E({configPath:f,externalRefResolver:p}),m=await r(l.resolvedConfig);if(m===void 0)return l.resolvedConfig;const h=l.document?.source,P=[...h?await $({config:l,externalConfigTypes:L(m,l)}):[],...h?N(l.resolvedConfig,h):[]];if(P.length>0)for(const U of P)s(new Error(I(U,t.cwd)));return l.resolvedConfig}const i=t.exists(e)?await a():{},T=F(i),b=await r(i);y(i,"residency","Residency",s),y(i,"logoutReturnUrl","Logout return URL",s),k(i,s),D(i,s);let u=b?B(b,i):i;u=z(u);const{env:v}=u;if(v){const p=R.REDOCLY_ENV,f=v[p]||{},l=R.PUBLIC_REDOCLY_BRANCH_NAME||"",m=l?O(l):"",h=m&&v[`${j}${m}`]||{};u=x(u,h,f)}const o=V(u,T);if(o.imports&&o.imports.length>0){d.warn("The 'imports' property is deprecated. Please use 'plugins' property instead.");const p=new Set([...o.plugins||[],...o.imports.map(f=>w.posix.join(f,"plugin.js"))]);o.plugins=Array.from(p),delete o.imports}if(o.catalog&&(d.warn("The 'catalog' property is deprecated. Please use 'catalogClassic' property instead."),o.catalogClassic={...o.catalog},delete o.catalog),o.scorecard&&(d.warn("The 'scorecard' property is deprecated. Please use 'scorecardClassic' property instead."),o.scorecardClassic=o.scorecard,delete o.scorecard),o.search?.ai){d.warn("The 'search.ai' property is deprecated. Please use 'aiAssistant' property instead.");const p={...o.search?.ai,...o.aiAssistant,suggestions:o.aiAssistant?.suggestions?.length?o.aiAssistant.suggestions:o.search?.ai.suggestions||[]};o.aiAssistant=p,delete o.search.ai}return G(o)}function G(e){const t={...e},r={..."access"in e&&e.access&&typeof e.access=="object"?e.access:{}},n=["requiresLogin","logoutReturnUrl","residency","sso","idps","rbac"],c=[];for(const a of n){const i=t[a];i!==void 0&&(c.push(a),a==="requiresLogin"&&r.requiresLogin===void 0&&(r.requiresLogin=i),a==="logoutReturnUrl"&&r.logoutReturnUrl===void 0&&(r.logoutReturnUrl=i),a==="residency"&&r.residency===void 0&&(r.residency=i),a==="sso"&&r.sso===void 0&&(r.sso=i),a==="idps"&&r.idps===void 0&&(r.idps=i),a==="rbac"&&r.rbac===void 0&&(r.rbac=i),delete t[a])}return c.length>0&&d.warn(`The following properties at root level are deprecated: ${c.join(", ")}. Please move them to the 'access' object.`),Object.keys(r).length>0&&(t.access=r),t}function z(e){const t=Object.entries(e.env??{});[e,...t.map(([,n])=>n)].some(n=>n?.mcp?.docs)&&d.warn("The 'mcp.docs' property is deprecated. Please use the 'mcp' properties instead.");const s=e.mcp?{...e,mcp:A(e.mcp)}:e;if(!e.env)return s;const r=t.map(([n,c])=>[n,c?.mcp?{...c,mcp:A(c.mcp)}:c]);return{...s,env:Object.fromEntries(r)}}function A(e){const t=e.docs??{},s={};(e.hide??t.hide)!==void 0&&(s.hide=e.hide===!0||t.hide===!0);const r=e.name??t.name;r!==void 0&&(s.name=r);const n=e.ignore??t.ignore;n!==void 0&&(s.ignore=n);const c=e.publicEndpoint??t.publicEndpoint;return c!==void 0&&(s.publicEndpoint=c),{...e,...s,docs:{...t,...s}}}function F(e){if(!e.theme)return[];d.warn("The 'theme' property in redocly.yaml is deprecated. Please move all of the properties from 'theme' to the root of the config.");const t=[];for(const s of Object.keys(e.theme))e[s]==null?t.push(s):d.warn(`Detected both '${s}' and 'theme.${s}' properties in redocly.yaml. The 'theme.${s}' property will be ignored and needs to be removed or merged into the '${s}'.`);return t}function V(e,t){if(!e.theme||t.length===0)return e;const s={...e};for(const r of t)s[r]=e.theme[r];return delete s.theme,s}export{G as ensureAccessBackwardsCompatibility,ie as readAndValidateConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{buildCodeSamples as
|
|
1
|
+
import{buildCodeSamples as v,getRequestBodySamples as d,normalizeOptions as f,resolveOperationSampleContext as S}from"@redocly/api-docs";import{setNodeAttributeValue as O}from"../../../../markdoc/helpers/set-node-attribute-value.js";import{loadOpenapiBundle as b}from"./helpers/load-openapi-bundle.js";import{getOptionalAttribute as t}from"./utils.js";const h={curl:"shell",JavaScript:"javascript","Node.js":"javascript",Python:"python",Java:"java","Java8+Apache":"java","C#":"csharp","C#+Newtonsoft":"csharp",PHP:"php",Go:"go",Ruby:"ruby",R:"r"};async function N(e,u,x,{context:g}){const o=await b(e,g);if(!o)return;const i=t(e,"language"),l=t(e,"options"),n={exampleKey:t(e,"exampleKey"),mimeType:t(e,"mimeType"),parameters:t(e,"parameters"),requestBody:t(e,"requestBody"),environments:t(e,"environments"),environment:t(e,"environment")},y={...o.rawOptions,...l,...o.rawOptions.mockServer&&{mockServer:{...o.rawOptions.mockServer,position:"off"}},codeSamples:{...o.rawOptions.codeSamples,...l?.codeSamples,...i&&{languages:[{lang:i}]}}},m=f(y),r=S(o.definition,m,{operationId:t(e,"operationId"),pointer:t(e,"pointer")});if(!r)return;const s=v(r,n).map(a=>({lang:h[a.lang]??a.lang.toLowerCase(),title:a.label??a.lang,source:a.source})),c=m.codeSamples?.languages??[],p=c.findIndex(({lang:a})=>a==="Payload");if(p!==-1){const a=d(r,{exampleKey:n.exampleKey,mimeType:n.mimeType,titlePrefix:c[p].label});s.splice(p,0,...a)}s.length&&O(e,u,s)}export{N as resolveOpenapiCodeSamples};
|
|
@@ -2,5 +2,5 @@ import type { McpToolSchema } from '../../../../types';
|
|
|
2
2
|
import type { McpToolCallback, McpToolContext } from '../../types.js';
|
|
3
3
|
import { type SandboxCapability } from '../capabilities/index.js';
|
|
4
4
|
export declare function describeToolsSchema(tools: McpToolSchema[], capabilities: SandboxCapability[]): McpToolSchema;
|
|
5
|
-
export declare function describeTools(tools: McpToolSchema[],
|
|
5
|
+
export declare function describeTools(tools: McpToolSchema[], capabilities: SandboxCapability[], context: McpToolContext): McpToolCallback;
|
|
6
6
|
//# sourceMappingURL=describe-tools.d.ts.map
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import{renderDescribeToolsOutput as
|
|
2
|
-
|
|
3
|
-
`);return E({tool:l,mode:m,serverType:u.Docs,args:t,result:h,...d}),k({tool:l,mode:m,serverType:u.Docs,durationMs:Math.round(performance.now()-b),outputLength:h.length,...d}),{content:[{type:"text",text:h}]}}catch(e){const i=e instanceof O,a=i?"tool_error":"server_error";throw E({tool:l,mode:m,serverType:u.Docs,args:t,errorClass:a,...d}),C({tool:l,mode:m,serverType:u.Docs,durationMs:Math.round(performance.now()-b),message:e instanceof Error?e.message:String(e),stack:!i&&e instanceof Error&&e.stack||"",errorClass:a,...d}),e}}}export{z as describeTools,B as describeToolsSchema};
|
|
1
|
+
import{renderDescribeToolsOutput as E}from"../capabilities/index.js";import{McpServerType as u,READ_ONLY_ANNOTATIONS as O}from"../../constants.js";import{logMcpToolCallAudit as h,reportMcpToolCalled as S,reportMcpToolError as b}from"../../workers/mcp-tool-telemetry.js";import{DESCRIBE_TOOLS_TOOL_NAME as l}from"../constants.js";import{DESCRIBE_TOOLS_DESCRIPTION as v}from"../prompts.js";import{sanitizeToolName as s}from"../build-tool-type-declarations.js";import{UnknownToolError as w}from"./tool-errors.js";import{callAttribution as D}from"../../utils/telemetry-attributes.js";function R(p,i){const n=[...new Set([...p.map(r=>s(r.name)),...i.map(r=>s(r.id))])];return{name:l,title:"Get docs function signatures",description:v,annotations:O,schema:{type:"object",required:[],additionalProperties:!1,properties:{tools:{type:"array",description:`Tool names to describe: ${n.join(", ")}. Omit to describe everything.`,items:n.length>0?{type:"string",enum:n}:{type:"string"},nullable:!0}}}}}function U(p,i,n){const r=new Map(p.map(t=>[s(t.name),t])),T=new Map(i.map(t=>[s(t.id),t]));return async t=>{const y=performance.now(),m=n.mcpMode??"code",d=D(n);try{const o=[...new Set((t.tools??[]).map(s))],a=o.length===0,c=o.filter(e=>!r.has(e)&&!T.has(e));if(c.length>0){const e=[...r.keys(),...T.keys()];throw new w(`Unknown tool(s): ${c.join(", ")}. Valid tools: ${e.join(", ")}.`)}const M=a?i:i.filter(e=>o.includes(s(e.id))),g=a?p:o.filter(e=>r.has(e)).map(e=>r.get(e)),f=E(g,M,n);return h({tool:l,mode:m,serverType:u.Docs,args:t,result:f,...d}),S({tool:l,mode:m,serverType:u.Docs,durationMs:Math.round(performance.now()-y),outputLength:f.length,...d}),{content:[{type:"text",text:f}]}}catch(o){const a=o instanceof w,c=a?"tool_error":"server_error";throw h({tool:l,mode:m,serverType:u.Docs,args:t,errorClass:c,...d}),b({tool:l,mode:m,serverType:u.Docs,durationMs:Math.round(performance.now()-y),message:o instanceof Error?o.message:String(o),stack:!a&&o instanceof Error&&o.stack||"",errorClass:c,...d}),o}}}export{U as describeTools,R as describeToolsSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FIELD_SCOPE_KINDS as n,GRAPHQL_TYPE_KINDS as u}from"./constants.js";import{respondWithGraphqlSchema as g,paginate as d}from"./tool-helpers.js";import{groupSchemaTypes as h,fieldMembers as y,filterMembersReferencingType as S,matchesFilter as b}from"./utils.js";function T(r,p,t){if(p==="fields"){if(t&&!n.some(e=>e===t))throw new Error(`scope "fields" lists the fields of object, interface, and input types; kind must be ${n.map(e=>`"${e}"`).join(", ")}, or omitted.`);return y(r,t)}const o=h(r);return(t?[t]:u).flatMap(e=>o[e].map(s=>({kind:e,...s})))}const E=(r,p)=>g(r.name,p,({name:t,schema:o})=>{const{kind:e,scope:s="members",filter:f,referencesType:l,page:m
|
|
1
|
+
import{FIELD_SCOPE_KINDS as n,GRAPHQL_TYPE_KINDS as u}from"./constants.js";import{respondWithGraphqlSchema as g,paginate as d}from"./tool-helpers.js";import{groupSchemaTypes as h,fieldMembers as y,filterMembersReferencingType as S,matchesFilter as b}from"./utils.js";function T(r,p,t){if(p==="fields"){if(t&&!n.some(e=>e===t))throw new Error(`scope "fields" lists the fields of object, interface, and input types; kind must be ${n.map(e=>`"${e}"`).join(", ")}, or omitted.`);return y(r,t)}const o=h(r);return(t?[t]:u).flatMap(e=>o[e].map(s=>({kind:e,...s})))}const E=(r,p)=>g(r.name,p,({name:t,schema:o})=>{const{kind:e,scope:s="members",filter:f,referencesType:l,page:m,limit:a}=r;let i=T(o,s,e);return l&&(i=S(o,i,l)),f&&(i=i.filter(c=>b(c,f))),JSON.stringify({name:t,...d(i,m??1,a??300)},null,2)});var D={"get-graphql-type-list":E};export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{paginate as p,textResult as m}from"./tool-helpers.js";const c=async(r,l)=>{const{filter:i,page:o
|
|
1
|
+
import{paginate as p,textResult as m}from"./tool-helpers.js";const c=async(r,l)=>{const{filter:i,page:o,limit:n}=r;let t=l.graphqlDescriptions;if(i){const e=i.toLowerCase();t=t.filter(s=>s.name.toLowerCase().includes(e))}const a=p(t,o??1,n??300);return m(JSON.stringify({...a,items:a.items.map(({name:e,description:s})=>({name:e,description:s}))}))};var g={"list-graphql-apis":c};export{g as default};
|
|
@@ -14,8 +14,8 @@ export type SchemaMemberWithKind = SchemaMember & {
|
|
|
14
14
|
export type GroupedSchemaTypes = Record<GraphqlTypeKind, SchemaMember[]>;
|
|
15
15
|
export type ListGraphqlApisArgs = {
|
|
16
16
|
filter?: string;
|
|
17
|
-
page?: number;
|
|
18
|
-
limit?: number;
|
|
17
|
+
page?: number | null;
|
|
18
|
+
limit?: number | null;
|
|
19
19
|
};
|
|
20
20
|
export type GetGraphqlTypeListArgs = {
|
|
21
21
|
name: string;
|
|
@@ -23,8 +23,8 @@ export type GetGraphqlTypeListArgs = {
|
|
|
23
23
|
scope?: GraphqlListScope;
|
|
24
24
|
filter?: string;
|
|
25
25
|
referencesType?: string;
|
|
26
|
-
page?: number;
|
|
27
|
-
limit?: number;
|
|
26
|
+
page?: number | null;
|
|
27
|
+
limit?: number | null;
|
|
28
28
|
};
|
|
29
29
|
export type GetGraphqlTypeArgs = {
|
|
30
30
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCallableApis as b}from"../../../gateway-mcp/callable-apis.js";import{filterApiDescriptionsByName as d}from"../../utils/api-name-matching.js";import{apiTitleKey as y,countApiTitles as A,orderSharedTitles as T}from"../../utils/api-titles.js";const x=async(
|
|
1
|
+
import{getCallableApis as b}from"../../../gateway-mcp/callable-apis.js";import{filterApiDescriptionsByName as d}from"../../utils/api-name-matching.js";import{apiTitleKey as y,countApiTitles as A,orderSharedTitles as T}from"../../utils/api-titles.js";const x=async(l,s)=>{const{filter:a}=l,n=l.page??1,e=l.limit??300,o=new Set(b(s).map(i=>i.relativePath)),m=o.size>0,c=T(Object.values(s.apiDescriptionsMap)),f=A(c);let t=c;a&&(t=d(t,a));const p=(n-1)*e,u=p+e,g=Math.ceil(t.length/e),h=t.length;return t=t.slice(p,u),{content:[{type:"text",text:JSON.stringify({items:t.map(({relativePath:i,fetchEligible:D,...r})=>({filePath:i,...r,...(f.get(y(r.name))??0)>1?{ambiguousTitle:!0}:{},...m?{callable:o.has(i)}:{}})),limit:e,total:h,page:n,totalPages:g})}]}};var I={"list-apis":x};export{I as default};
|