@alauda/doom 1.18.0 → 1.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/plugins/global/index.d.ts +1 -1
- package/lib/runtime/components/ExternalSiteLink.js +2 -2
- package/lib/runtime/components/K8sAPI.d.ts +2 -1
- package/lib/runtime/components/K8sAPI.js +2 -2
- package/lib/runtime/components/Masonry.js +19 -18
- package/lib/runtime/components/OpenAPIPath.js +2 -2
- package/lib/runtime/components/_APIReferenceLink.d.ts +4 -0
- package/lib/runtime/components/_APIReferenceLink.js +13 -0
- package/lib/runtime/components/_K8sAPIEndpoints.d.ts +2 -1
- package/lib/runtime/components/_K8sAPIEndpoints.js +5 -4
- package/lib/runtime/components/_K8sAPISchema.js +2 -1
- package/lib/runtime/hooks/useIsPrint.js +1 -2
- package/lib/theme/index.d.ts +3 -4
- package/lib/theme/index.js +3 -4
- package/lib/theme/useEditLink.js +1 -1
- package/package.json +13 -13
- package/styles/global.scss +38 -34
- package/lib/theme/Link.d.ts +0 -2
- package/lib/theme/Link.js +0 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useLang, useSite } from '@rspress/core/runtime';
|
|
3
3
|
import { addTrailingSlash, isExternalUrl, normalizeHref, parseUrl, removeLeadingSlash, } from '@rspress/shared';
|
|
4
4
|
import { DEFAULT_PAGE_EXTENSIONS } from '@rspress/shared/constants';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -35,5 +35,5 @@ const ExternalSiteLink_ = ({ name, href = '', className, ...props }) => {
|
|
|
35
35
|
(lang && lang !== siteData.lang ? addTrailingSlash(lang) : '') +
|
|
36
36
|
(hash ? `${url}#${hash}` : url), target: "_blank", rel: "noopener noreferrer", className: clsx('rp-link', className), ...props }));
|
|
37
37
|
};
|
|
38
|
-
export const ExternalSiteLink = (props) => (_jsx(
|
|
38
|
+
export const ExternalSiteLink = (props) => (_jsx(ExternalSiteLink_, { ...props }));
|
|
39
39
|
export default ExternalSiteLink;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export interface K8sAPIProps {
|
|
2
2
|
name: string;
|
|
3
|
+
namespaced?: boolean;
|
|
3
4
|
pathPrefix?: string;
|
|
4
5
|
filepath?: string;
|
|
5
6
|
apiGroup?: string;
|
|
6
7
|
apiVersion?: string;
|
|
7
8
|
apiKind?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare const K8sAPI: ({ name, pathPrefix, filepath, apiGroup, apiVersion, apiKind, }: K8sAPIProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export declare const K8sAPI: ({ name, namespaced, pathPrefix, filepath, apiGroup, apiVersion, apiKind, }: K8sAPIProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
11
|
export default K8sAPI;
|
|
@@ -5,7 +5,7 @@ import { useMemo } from 'react';
|
|
|
5
5
|
import { resolveRef } from '../utils.js';
|
|
6
6
|
import { K8sAPIEndpoints } from './_K8sAPIEndpoints.js';
|
|
7
7
|
import { K8sAPISchema } from './_K8sAPISchema.js';
|
|
8
|
-
export const K8sAPI = ({ name, pathPrefix, filepath, apiGroup, apiVersion, apiKind, }) => {
|
|
8
|
+
export const K8sAPI = ({ name, namespaced, pathPrefix, filepath, apiGroup, apiVersion, apiKind, }) => {
|
|
9
9
|
const [, openapi] = useMemo(() => Object.entries(openapisMap).find(([pathname, openapi]) => {
|
|
10
10
|
if (filepath && pathname !== filepath) {
|
|
11
11
|
return;
|
|
@@ -56,6 +56,6 @@ export const K8sAPI = ({ name, pathPrefix, filepath, apiGroup, apiVersion, apiKi
|
|
|
56
56
|
console.error(`No OpenAPI nor CustomResourceDefinition schema found for ${name}`);
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
|
-
return schema ? (_jsxs(_Fragment, { children: [_jsx(K8sAPISchema, { schema: schema, fullSchema: openapi }), _jsx(K8sAPIEndpoints, { hasStatus: !!schema.properties?.status, group: apiGroup ?? k8sApiDef?.group, version: apiVersion ?? k8sApiDef?.version ?? '', kind: apiKind ?? k8sApiDef?.kind ?? '', pathPrefix: pathPrefix })] })) : null;
|
|
59
|
+
return schema ? (_jsxs(_Fragment, { children: [_jsx(K8sAPISchema, { schema: schema, fullSchema: openapi }), _jsx(K8sAPIEndpoints, { hasStatus: !!schema.properties?.status, group: apiGroup ?? k8sApiDef?.group, version: apiVersion ?? k8sApiDef?.version ?? '', kind: apiKind ?? k8sApiDef?.kind ?? '', pathPrefix: pathPrefix, namespaced: namespaced })] })) : null;
|
|
60
60
|
};
|
|
61
61
|
export default K8sAPI;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
return
|
|
19
|
-
};
|
|
2
|
+
import { NoSSR } from '@rspress/core/runtime';
|
|
3
|
+
import { lazy, Suspense, useLayoutEffect, useRef, } from 'react';
|
|
4
|
+
const LazyMasonry = lazy(() => import('masonry-layout').then(({ default: MasonryLayout }) => {
|
|
5
|
+
const Masonry = ({ options, ...props }) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
useLayoutEffect(() => {
|
|
8
|
+
if (!ref.current) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const masonry = new MasonryLayout(ref.current, options);
|
|
12
|
+
return () => {
|
|
13
|
+
masonry.destroy?.();
|
|
14
|
+
};
|
|
15
|
+
}, [options]);
|
|
16
|
+
return _jsx("div", { ref: ref, ...props });
|
|
17
|
+
};
|
|
18
|
+
return { default: Masonry };
|
|
19
|
+
}));
|
|
20
|
+
export const Masonry = ({ options, ...props }) => (_jsx(NoSSR, { children: _jsx(Suspense, { children: _jsx(LazyMasonry, { options: options, ...props }) }) }));
|
|
20
21
|
export default Masonry;
|
|
@@ -56,7 +56,7 @@ export const OpenAPIResponses = ({ responses, openapi, }) => {
|
|
|
56
56
|
else if (type && '$ref' in type) {
|
|
57
57
|
typeNode = _jsx(RefLink, { "$ref": type.$ref });
|
|
58
58
|
}
|
|
59
|
-
return (_jsxs(X.li, { children: [_jsx("code", { children: code }), typeNode, ": ", responseObj.description, extraNode] }, code));
|
|
59
|
+
return (_jsxs(X.li, { children: [_jsx("code", { children: code }), " ", typeNode, ": ", responseObj.description, extraNode] }, code));
|
|
60
60
|
}) }));
|
|
61
61
|
};
|
|
62
62
|
const getRefsForPath = (openapi, path, knownRefs) => {
|
|
@@ -133,7 +133,7 @@ export const OpenAPIPath = ({ path, openapiPath: openapiPath_, pathPrefix: pathP
|
|
|
133
133
|
const requestBodySchema = requestBodyRef
|
|
134
134
|
? resolveRef(openapi, requestBodyRef)
|
|
135
135
|
: undefined;
|
|
136
|
-
return (_jsxs(Fragment, { children: [_jsxs(HeadingTitle, { slugger: slugger, level: 3, children: [_jsx("code", { children: method }), summary] }), _jsx(Markdown, { children: description }), parameters && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Parameters" }), _jsx(OpenAPIParameters, { parameters: parameters, openapi: openapi })] })), requestBodySchema && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Request Body" }), _jsxs(X.p, { children: [_jsx(RefLink, { "$ref": requestBodyRef }), requestBodySchema.required && _jsx(Badge, { children: "required" })] })] })), responses && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Response" }), _jsx(OpenAPIResponses, { responses: responses, openapi: openapi })] }))] }, method));
|
|
136
|
+
return (_jsxs(Fragment, { children: [_jsxs(HeadingTitle, { slugger: slugger, level: 3, children: [_jsx("code", { children: method }), " ", summary] }), _jsx(Markdown, { children: description }), parameters && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Parameters" }), _jsx(OpenAPIParameters, { parameters: parameters, openapi: openapi })] })), requestBodySchema && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Request Body" }), _jsxs(X.p, { children: [_jsx(RefLink, { "$ref": requestBodyRef }), requestBodySchema.required && _jsx(Badge, { children: "required" })] })] })), responses && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Response" }), _jsx(OpenAPIResponses, { responses: responses, openapi: openapi })] }))] }, method));
|
|
137
137
|
}), refs?.map((ref) => {
|
|
138
138
|
return (_jsx(OpenAPIRef, { schema: ref, openapiPath: openapiPath, isCommonRef: false, collectRefs: false }, ref));
|
|
139
139
|
})] }));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import virtual from 'doom-@global-virtual';
|
|
3
|
+
import { ACP_BASE } from '../../shared/constants.js';
|
|
4
|
+
import { ExternalSiteLink } from './ExternalSiteLink.js';
|
|
5
|
+
import { X } from './_X.js';
|
|
6
|
+
const SELF_REFERENCE_BASES = new Set(['/', ACP_BASE]);
|
|
7
|
+
export const APIReferenceLink = ({ name }) => {
|
|
8
|
+
const href = `/apis/references/${name}.html`;
|
|
9
|
+
if (SELF_REFERENCE_BASES.has(virtual.userBase)) {
|
|
10
|
+
return _jsx(X.a, { href: href, children: name });
|
|
11
|
+
}
|
|
12
|
+
return (_jsx(ExternalSiteLink, { name: "acp", href: href, children: name }));
|
|
13
|
+
};
|
|
@@ -4,7 +4,8 @@ export interface K8sAPIDefinition {
|
|
|
4
4
|
kind: string;
|
|
5
5
|
}
|
|
6
6
|
export interface K8sAPIEndpointsProps extends K8sAPIDefinition {
|
|
7
|
+
namespaced?: boolean;
|
|
7
8
|
hasStatus?: boolean;
|
|
8
9
|
pathPrefix?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare const K8sAPIEndpoints: ({ hasStatus, group, version, kind, pathPrefix: pathPrefix_, }: K8sAPIEndpointsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const K8sAPIEndpoints: ({ hasStatus, group, version, kind, pathPrefix: pathPrefix_, namespaced, }: K8sAPIEndpointsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { FallbackHeading } from '@rspress/core/theme';
|
|
3
3
|
import virtual from 'doom-@api-virtual';
|
|
4
4
|
import { plural } from 'pluralize';
|
|
5
|
+
import { APIReferenceLink } from './_APIReferenceLink.js';
|
|
5
6
|
import { X } from './_X.js';
|
|
6
7
|
const QueryParameters = ({ fieldValidation = true, }) => {
|
|
7
8
|
return (_jsxs(_Fragment, { children: [_jsx("dl", { children: _jsx("dt", { children: "Query parameters" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Parameter" }), _jsx("th", { children: "Type" }), _jsx("th", { children: "Description" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: "dryRun" }) }), _jsx("td", { children: _jsx("code", { children: "string" }) }), _jsx("td", { children: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed" })] }), fieldValidation && (_jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: "fieldValidation" }) }), _jsx("td", { children: _jsx("code", { children: "string" }) }), _jsx("td", { children: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered." })] }))] })] })] }));
|
|
@@ -9,11 +10,11 @@ const QueryParameters = ({ fieldValidation = true, }) => {
|
|
|
9
10
|
const BodyParameters = ({ kind }) => {
|
|
10
11
|
return (_jsxs(_Fragment, { children: [_jsx("dl", { children: _jsx("dt", { children: "Body parameters" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Parameter" }), _jsx("th", { children: "Type" }), _jsx("th", { children: "Description" })] }) }), _jsx("tbody", { children: _jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: "body" }) }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] }), _jsxs("td", { children: [_jsx("code", { children: "application/json" }), " formatted"] })] }) })] })] }));
|
|
11
12
|
};
|
|
12
|
-
const K8sAPIListEndpoint = ({ kind }) => (_jsxs(_Fragment, { children: [_jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "DELETE" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["delete collection of ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(
|
|
13
|
-
const K8sAPIItemEndpoint = ({ kind }) => (_jsxs(_Fragment, { children: [_jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "DELETE" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["delete the specified ", kind] })] }), _jsx(QueryParameters, { fieldValidation: false }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(
|
|
13
|
+
const K8sAPIListEndpoint = ({ kind }) => (_jsxs(_Fragment, { children: [_jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "DELETE" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["delete collection of ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(APIReferenceLink, { name: "Status" }) }), ' ', "schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "GET" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["list objects of kind ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsxs("code", { children: [kind, "List"] }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "POST" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["create a new ", kind] })] }), _jsx(QueryParameters, {}), _jsx(BodyParameters, { kind: kind }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "201 - Created" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "202 - Accepted" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] })] }));
|
|
14
|
+
const K8sAPIItemEndpoint = ({ kind }) => (_jsxs(_Fragment, { children: [_jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "DELETE" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["delete the specified ", kind] })] }), _jsx(QueryParameters, { fieldValidation: false }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(APIReferenceLink, { name: "Status" }) }), ' ', "schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "202 - Accepted" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(APIReferenceLink, { name: "Status" }) }), ' ', "schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "GET" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["read the specified ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "PATCH" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["partially update the specified ", kind] })] }), _jsx(QueryParameters, {}), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "PUT" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["replace the specified ", kind] })] }), _jsx(QueryParameters, {}), _jsx(BodyParameters, { kind: kind }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "201 - Created" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] })] }));
|
|
14
15
|
const K8sAPIStatusEndpoint = ({ kind }) => (_jsxs(_Fragment, { children: [_jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "GET" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["read status of the specified ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "PATCH" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["partially update status of the specified ", kind] })] }), _jsx(QueryParameters, {}), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "PUT" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["replace status of the specified ", kind] })] }), _jsx(QueryParameters, {}), _jsx(BodyParameters, { kind: kind }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "201 - Created" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] })] }));
|
|
15
|
-
export const K8sAPIEndpoints = ({ hasStatus, group, version, kind, pathPrefix: pathPrefix_, }) => {
|
|
16
|
+
export const K8sAPIEndpoints = ({ hasStatus, group, version, kind, pathPrefix: pathPrefix_, namespaced = true, }) => {
|
|
16
17
|
const pathPrefix = pathPrefix_ ?? (virtual.pathPrefix || '');
|
|
17
|
-
const apiPath = `${pathPrefix}/${group ? `apis/${group}` : 'api'}/${version}
|
|
18
|
+
const apiPath = `${pathPrefix}/${group ? `apis/${group}` : 'api'}/${version}/${namespaced ? `namespaces/{namespace}/` : ''}${plural(kind).toLocaleLowerCase()}`;
|
|
18
19
|
return (_jsxs(_Fragment, { children: [_jsx(FallbackHeading, { level: 2, title: "API Endpoints" }), _jsx(X.p, { children: "The following API endpoints are available:" }), _jsxs(X.ul, { children: [_jsxs(X.li, { children: [_jsx("code", { children: apiPath }), _jsxs(X.ul, { children: [_jsxs(X.li, { children: [_jsx("code", { children: "DELETE" }), ": delete collection of ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "GET" }), ": list objects of kind ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "POST" }), ": create a new ", kind] })] })] }), _jsxs(X.li, { children: [_jsx("code", { children: `${apiPath}/{name}` }), _jsxs(X.ul, { children: [_jsxs(X.li, { children: [_jsx("code", { children: "DELETE" }), ": delete the specified ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "GET" }), ": read the specified ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "PATCH" }), ": partially update the specified ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "PUT" }), ": replace the specified ", kind] })] })] }), hasStatus && (_jsxs(X.li, { children: [_jsx("code", { children: `${apiPath}/{name}/status` }), _jsxs(X.ul, { children: [_jsxs(X.li, { children: [_jsx("code", { children: "GET" }), ": read status of the specified ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "PATCH" }), ": partially update status of the specified", ' ', kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "PUT" }), ": replace status of the specified ", kind] })] })] }))] }), _jsx("div", { className: "rp-toc-exclude", children: _jsx(FallbackHeading, { level: 3, title: apiPath }) }), _jsx(K8sAPIListEndpoint, { kind: kind }), _jsx("div", { className: "rp-toc-exclude", children: _jsx(FallbackHeading, { level: 3, title: `${apiPath}/{name}` }) }), _jsx(K8sAPIItemEndpoint, { kind: kind }), hasStatus && (_jsxs(_Fragment, { children: [_jsx("div", { className: "rp-toc-exclude", children: _jsx(FallbackHeading, { level: 3, title: `${apiPath}/{name}/status` }) }), _jsx(K8sAPIStatusEndpoint, { kind: kind })] }))] }));
|
|
19
20
|
};
|
|
@@ -3,6 +3,7 @@ import { FallbackHeading } from '@rspress/core/theme';
|
|
|
3
3
|
import { Fragment, useMemo } from 'react';
|
|
4
4
|
import { resolveRef } from '../utils.js';
|
|
5
5
|
import { Markdown } from './Markdown.js';
|
|
6
|
+
import { APIReferenceLink } from './_APIReferenceLink.js';
|
|
6
7
|
import { X } from './_X.js';
|
|
7
8
|
const getSchemaValue = (schema, key = 'type') => {
|
|
8
9
|
if (schema[key]) {
|
|
@@ -48,7 +49,7 @@ export const K8sAPISchemaItem = ({ schema, fullSchema, propertyPath = '', }) =>
|
|
|
48
49
|
return (_jsxs(_Fragment, { children: [_jsx(K8sAPISchemaItemBasic, { schema: schema }), !propertyPath && _jsx(FallbackHeading, { level: 2, title: "Specification" }), isArraySchema && (_jsxs(_Fragment, { children: [_jsx("div", { className: "rp-toc-exclude", children: _jsx(FallbackHeading, { level: 3, title: `${propertyPath}[]` }) }), _jsx(K8sAPISchemaItemBasic, { schema: nestedSchema })] })), propertiesEntry && (_jsxs(_Fragment, { children: [_jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Property" }), _jsx("th", { children: "Type" }), _jsx("th", { children: "Description" })] }) }), _jsx("tbody", { children: propertiesEntry.map(([key, value]) => {
|
|
49
50
|
const description = getSchemaValue(value, 'description');
|
|
50
51
|
const isMetadata = key === METADATA;
|
|
51
|
-
return (_jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: key }) }), _jsx("td", { children: isMetadata ? (_jsx("code", { children: _jsx(
|
|
52
|
+
return (_jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: key }) }), _jsx("td", { children: isMetadata ? (_jsx("code", { children: _jsx(APIReferenceLink, { name: "ObjectMeta" }) })) : (typeCode(getSchemaValue(value))) }), _jsx("td", { children: _jsx(Markdown, { children: description ||
|
|
52
53
|
(isMetadata ? DEFAULT_METADATA_DESCRIPTION : '') }) })] }, key));
|
|
53
54
|
}) })] }), propertiesEntry.map(([key, value]) => {
|
|
54
55
|
const type = getSchemaValue(value);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useSearchParams } from '@rspress/core/
|
|
1
|
+
import { useSearchParams } from '@rspress/core/runtime';
|
|
2
2
|
import { useState, useEffect, useCallback } from 'react';
|
|
3
3
|
import { FALSY_VALUES } from '../../shared/index.js';
|
|
4
4
|
export function useIsPrintQuery() {
|
|
@@ -13,7 +13,6 @@ const getPrintMediaQuery = () => {
|
|
|
13
13
|
return matchMedia('print');
|
|
14
14
|
};
|
|
15
15
|
export function useIsPrintMedia() {
|
|
16
|
-
// eslint-disable-next-line @eslint-react/naming-convention/use-state
|
|
17
16
|
const [printMediaQuery] = useState(getPrintMediaQuery);
|
|
18
17
|
const [isPrint, setIsPrint] = useState(!!printMediaQuery?.matches);
|
|
19
18
|
const onChange = useCallback((mqList) => {
|
package/lib/theme/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from '@rspress/core/theme-original';
|
|
2
|
-
export { EditLink } from './EditLink.
|
|
3
|
-
export { Layout } from './Layout.
|
|
4
|
-
export {
|
|
5
|
-
export { Search } from './Search.tsx';
|
|
2
|
+
export { EditLink } from './EditLink.js';
|
|
3
|
+
export { Layout } from './Layout.js';
|
|
4
|
+
export { Search } from './Search.js';
|
package/lib/theme/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import-x/export */
|
|
2
2
|
export * from '@rspress/core/theme-original';
|
|
3
|
-
export { EditLink } from
|
|
4
|
-
export { Layout } from
|
|
5
|
-
export {
|
|
6
|
-
export { Search } from "./Search.js";
|
|
3
|
+
export { EditLink } from './EditLink.js';
|
|
4
|
+
export { Layout } from './Layout.js';
|
|
5
|
+
export { Search } from './Search.js';
|
package/lib/theme/useEditLink.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alauda/doom",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Doctor Doom making docs.",
|
|
6
6
|
"repository": {
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@alauda/doom-export": "^0.3.1",
|
|
44
44
|
"@cspell/eslint-plugin": "^9.4.0",
|
|
45
|
-
"@eslint-react/eslint-plugin": "^2.5.
|
|
46
|
-
"@inquirer/prompts": "^8.
|
|
45
|
+
"@eslint-react/eslint-plugin": "^2.5.5",
|
|
46
|
+
"@inquirer/prompts": "^8.2.0",
|
|
47
47
|
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
|
|
48
48
|
"@rsbuild/plugin-react": "^1.4.2",
|
|
49
49
|
"@rsbuild/plugin-sass": "^1.4.0",
|
|
50
50
|
"@rsbuild/plugin-svgr": "^1.2.3",
|
|
51
51
|
"@rsbuild/plugin-yaml": "^1.0.3",
|
|
52
|
-
"@rspress/core": "2.0.0-rc.
|
|
53
|
-
"@rspress/plugin-algolia": "2.0.0-rc.
|
|
54
|
-
"@rspress/plugin-sitemap": "2.0.0-rc.
|
|
55
|
-
"@rspress/shared": "2.0.0-rc.
|
|
56
|
-
"@shikijs/transformers": "^3.
|
|
52
|
+
"@rspress/core": "2.0.0-rc.5",
|
|
53
|
+
"@rspress/plugin-algolia": "2.0.0-rc.5",
|
|
54
|
+
"@rspress/plugin-sitemap": "2.0.0-rc.5",
|
|
55
|
+
"@rspress/shared": "2.0.0-rc.5",
|
|
56
|
+
"@shikijs/transformers": "^3.21.0",
|
|
57
57
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
58
|
-
"@types/react": "^19.2.
|
|
58
|
+
"@types/react": "^19.2.8",
|
|
59
59
|
"ab64": "^0.1.6",
|
|
60
60
|
"chokidar": "^5.0.0",
|
|
61
61
|
"clsx": "^2.1.1",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"es-toolkit": "^1.43.0",
|
|
65
65
|
"eslint": "^9.39.2",
|
|
66
66
|
"eslint-plugin-mdx": "^3.6.2",
|
|
67
|
-
"globals": "^
|
|
67
|
+
"globals": "^17.0.0",
|
|
68
68
|
"html-tag-names": "^2.1.0",
|
|
69
69
|
"jsencrypt": "^3.5.4",
|
|
70
70
|
"masonry-layout": "^4.2.2",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"mdast-util-to-markdown": "^2.1.2",
|
|
75
75
|
"mdast-util-to-string": "^4.0.0",
|
|
76
76
|
"mermaid": "^11.12.2",
|
|
77
|
-
"openai": "^6.
|
|
77
|
+
"openai": "^6.16.0",
|
|
78
78
|
"openapi-types": "^12.1.3",
|
|
79
79
|
"p-ratelimit": "^1.0.1",
|
|
80
80
|
"picomatch": "^4.0.3",
|
|
@@ -95,14 +95,14 @@
|
|
|
95
95
|
"remark-mdx": "^3.1.1",
|
|
96
96
|
"remark-message-control": "^8.0.0",
|
|
97
97
|
"remark-stringify": "^11.0.0",
|
|
98
|
-
"shiki": "^3.
|
|
98
|
+
"shiki": "^3.21.0",
|
|
99
99
|
"simple-git": "^3.30.0",
|
|
100
100
|
"string-width": "^8.1.0",
|
|
101
101
|
"swagger2openapi": "^7.0.8",
|
|
102
102
|
"tinyglobby": "^0.2.15",
|
|
103
103
|
"type-fest": "^5.3.1",
|
|
104
104
|
"typescript": "^5.9.3",
|
|
105
|
-
"typescript-eslint": "^8.
|
|
105
|
+
"typescript-eslint": "^8.52.0",
|
|
106
106
|
"unified": "^11.0.5",
|
|
107
107
|
"unified-lint-rule": "^3.0.1",
|
|
108
108
|
"unist-util-position": "^5.0.0",
|
package/styles/global.scss
CHANGED
|
@@ -130,10 +130,47 @@ td {
|
|
|
130
130
|
--rp-code-block-bg: #{color.adjust($color: #242424, $lightness: 5%)};
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
.
|
|
133
|
+
.rp {
|
|
134
134
|
&-sidebar-item {
|
|
135
135
|
word-break: break-word;
|
|
136
136
|
}
|
|
137
|
+
|
|
138
|
+
&-doc {
|
|
139
|
+
dl {
|
|
140
|
+
margin: 1rem 0;
|
|
141
|
+
|
|
142
|
+
dt {
|
|
143
|
+
font-weight: 600;
|
|
144
|
+
margin: 0.5rem 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
dd {
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-wrap: wrap;
|
|
150
|
+
gap: 0.5rem;
|
|
151
|
+
margin: 0.5rem 0 0.5rem 1rem;
|
|
152
|
+
|
|
153
|
+
> p {
|
|
154
|
+
margin: 0.5rem 0;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
code .rp-link[target='_blank'] {
|
|
160
|
+
white-space: nowrap;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&-list-decimal:not(:has(p)) {
|
|
165
|
+
list-style: none;
|
|
166
|
+
counter-reset: section;
|
|
167
|
+
padding-left: 20px;
|
|
168
|
+
|
|
169
|
+
> li:before {
|
|
170
|
+
counter-increment: section;
|
|
171
|
+
content: counters(section, '.') '. ';
|
|
172
|
+
}
|
|
173
|
+
}
|
|
137
174
|
}
|
|
138
175
|
|
|
139
176
|
@mixin print {
|
|
@@ -163,37 +200,4 @@ td {
|
|
|
163
200
|
@include print;
|
|
164
201
|
}
|
|
165
202
|
|
|
166
|
-
.rp-list-decimal:not(:has(p)) {
|
|
167
|
-
list-style: none;
|
|
168
|
-
counter-reset: section;
|
|
169
|
-
padding-left: 20px;
|
|
170
|
-
|
|
171
|
-
> li:before {
|
|
172
|
-
counter-increment: section;
|
|
173
|
-
content: counters(section, '.') '. ';
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.rp-doc {
|
|
178
|
-
dl {
|
|
179
|
-
margin: 1rem 0;
|
|
180
|
-
|
|
181
|
-
dt {
|
|
182
|
-
font-weight: 600;
|
|
183
|
-
margin: 0.5rem 0;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
dd {
|
|
187
|
-
display: flex;
|
|
188
|
-
flex-wrap: wrap;
|
|
189
|
-
gap: 0.5rem;
|
|
190
|
-
margin: 0.5rem 0 0.5rem 1rem;
|
|
191
|
-
|
|
192
|
-
> p {
|
|
193
|
-
margin: 0.5rem 0;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
203
|
@import 'intelligence.scss';
|
package/lib/theme/Link.d.ts
DELETED
package/lib/theme/Link.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Link as OriginalLink, } from '@rspress/core/theme-original';
|
|
3
|
-
export const Link = (props) => {
|
|
4
|
-
if (typeof location !== 'undefined' &&
|
|
5
|
-
props.href?.startsWith(`${location.protocol}//${location.host}`)) {
|
|
6
|
-
return _jsx("a", { ...props });
|
|
7
|
-
}
|
|
8
|
-
return (_jsx(OriginalLink, { ...props, download:
|
|
9
|
-
// type-coverage:ignore-next-line -- out of control
|
|
10
|
-
props.download == null
|
|
11
|
-
? props.href?.endsWith('.pdf')
|
|
12
|
-
: // type-coverage:ignore-next-line -- out of control
|
|
13
|
-
props.download }));
|
|
14
|
-
};
|