@alauda/doom 1.17.6 → 1.18.1

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.
@@ -0,0 +1,11 @@
1
+ export interface K8sAPIProps {
2
+ name: string;
3
+ namespaced?: boolean;
4
+ pathPrefix?: string;
5
+ filepath?: string;
6
+ apiGroup?: string;
7
+ apiVersion?: string;
8
+ apiKind?: string;
9
+ }
10
+ export declare const K8sAPI: ({ name, namespaced, pathPrefix, filepath, apiGroup, apiVersion, apiKind, }: K8sAPIProps) => import("react/jsx-runtime").JSX.Element | null;
11
+ export default K8sAPI;
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import crdsMap from 'doom-@api-crdsMap';
3
+ import openapisMap from 'doom-@api-openapisMap';
4
+ import { useMemo } from 'react';
5
+ import { resolveRef } from '../utils.js';
6
+ import { K8sAPIEndpoints } from './_K8sAPIEndpoints.js';
7
+ import { K8sAPISchema } from './_K8sAPISchema.js';
8
+ export const K8sAPI = ({ name, namespaced, pathPrefix, filepath, apiGroup, apiVersion, apiKind, }) => {
9
+ const [, openapi] = useMemo(() => Object.entries(openapisMap).find(([pathname, openapi]) => {
10
+ if (filepath && pathname !== filepath) {
11
+ return;
12
+ }
13
+ return resolveRef(openapi, name);
14
+ }) || [], [filepath, name]);
15
+ const [, crd] = useMemo(() => Object.entries(crdsMap).find(([pathname, crd]) => {
16
+ if (filepath && pathname !== filepath) {
17
+ return;
18
+ }
19
+ return crd.metadata.name === name;
20
+ }) || [], [filepath, name]);
21
+ const schema = useMemo(() => {
22
+ if (openapi) {
23
+ return resolveRef(openapi, name);
24
+ }
25
+ if (!crd) {
26
+ return;
27
+ }
28
+ const { versions } = crd.spec;
29
+ const v = apiVersion ?? versions[0]?.name;
30
+ const versionDef = versions.find((ver) => ver.name === v);
31
+ if (!versionDef) {
32
+ console.error(`CRD ${name} does not have version ${v}, available versions: ${versions
33
+ .map((ver) => ver.name)
34
+ .join(', ')}`);
35
+ return;
36
+ }
37
+ return versionDef.schema.openAPIV3Schema;
38
+ }, [apiVersion, crd, name, openapi]);
39
+ const k8sApiDef = useMemo(() => {
40
+ if (!schema) {
41
+ return;
42
+ }
43
+ if ('x-kubernetes-group-version-kind' in schema) {
44
+ const def = schema['x-kubernetes-group-version-kind'];
45
+ return Array.isArray(def) ? def[0] : def;
46
+ }
47
+ if (crd) {
48
+ return {
49
+ group: crd.spec.group,
50
+ version: crd.spec.versions[0].name,
51
+ kind: crd.spec.names.kind,
52
+ };
53
+ }
54
+ }, [crd, schema]);
55
+ if (!openapi && !crd) {
56
+ console.error(`No OpenAPI nor CustomResourceDefinition schema found for ${name}`);
57
+ return null;
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, namespaced: namespaced })] })) : null;
60
+ };
61
+ export default K8sAPI;
@@ -0,0 +1,11 @@
1
+ export interface K8sAPIDefinition {
2
+ group?: string;
3
+ version: string;
4
+ kind: string;
5
+ }
6
+ export interface K8sAPIEndpointsProps extends K8sAPIDefinition {
7
+ namespaced?: boolean;
8
+ hasStatus?: boolean;
9
+ pathPrefix?: string;
10
+ }
11
+ export declare const K8sAPIEndpoints: ({ hasStatus, group, version, kind, pathPrefix: pathPrefix_, namespaced, }: K8sAPIEndpointsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { FallbackHeading } from '@rspress/core/theme';
3
+ import virtual from 'doom-@api-virtual';
4
+ import { plural } from 'pluralize';
5
+ import { X } from './_X.js';
6
+ const QueryParameters = ({ fieldValidation = true, }) => {
7
+ 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." })] }))] })] })] }));
8
+ };
9
+ const BodyParameters = ({ kind }) => {
10
+ 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
+ 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(X.a, { href: "#status", children: "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" })] })] })] })] }));
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(X.a, { href: "#status", children: "Status" }) }), ' ', "schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "202 - Accepted" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(X.a, { href: "#status", children: "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
+ 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_, namespaced = true, }) => {
16
+ const pathPrefix = pathPrefix_ ?? (virtual.pathPrefix || '');
17
+ const apiPath = `${pathPrefix}/${group ? `apis/${group}` : 'api'}/${version}/${namespaced ? `namespaces/{namespace}/` : ''}${plural(kind).toLocaleLowerCase()}`;
18
+ 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
+ };
@@ -0,0 +1,15 @@
1
+ import type { OpenAPIV3_1 } from 'openapi-types';
2
+ export interface K8sAPISchemaProps {
3
+ schema: OpenAPIV3_1.SchemaObject;
4
+ fullSchema?: OpenAPIV3_1.Document;
5
+ }
6
+ export interface K8sAPISchemaItemProps {
7
+ schema: OpenAPIV3_1.SchemaObject;
8
+ fullSchema?: OpenAPIV3_1.Document;
9
+ propertyPath?: string;
10
+ }
11
+ export declare const K8sAPISchemaItemBasic: ({ schema, }: {
12
+ schema: OpenAPIV3_1.SchemaObject;
13
+ }) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const K8sAPISchemaItem: ({ schema, fullSchema, propertyPath, }: K8sAPISchemaItemProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const K8sAPISchema: ({ schema, fullSchema }: K8sAPISchemaProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { FallbackHeading } from '@rspress/core/theme';
3
+ import { Fragment, useMemo } from 'react';
4
+ import { resolveRef } from '../utils.js';
5
+ import { Markdown } from './Markdown.js';
6
+ import { X } from './_X.js';
7
+ const getSchemaValue = (schema, key = 'type') => {
8
+ if (schema[key]) {
9
+ return schema[key];
10
+ }
11
+ if (schema.allOf?.length) {
12
+ const allOf = schema.allOf[0];
13
+ const value = allOf[key];
14
+ if (value) {
15
+ return value;
16
+ }
17
+ }
18
+ if (key === 'type' && schema.oneOf?.length) {
19
+ return schema.oneOf.map((it) => it[key]);
20
+ }
21
+ };
22
+ const NESTED_SCHEMA_TYPES = new Set(['object', 'array']);
23
+ const METADATA = 'metadata';
24
+ const DEFAULT_METADATA_DESCRIPTION = 'ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.';
25
+ const derefSchema = (schema, fullSchema) => {
26
+ const $ref = getSchemaValue(schema, '$ref');
27
+ if (fullSchema && $ref) {
28
+ return resolveRef(fullSchema, $ref);
29
+ }
30
+ return schema;
31
+ };
32
+ const typeCode = (type) => (_jsx("code", { children: Array.isArray(type) ? type.join('|') : type }));
33
+ export const K8sAPISchemaItemBasic = ({ schema, }) => {
34
+ const description = getSchemaValue(schema, 'description');
35
+ return (_jsxs("dl", { children: [description && (_jsxs(_Fragment, { children: [_jsx("dt", { children: "Description" }), _jsx("dd", { children: description })] })), _jsx("dt", { children: "Type" }), _jsx("dd", { children: typeCode(getSchemaValue(schema)) }), schema.required && (_jsxs(_Fragment, { children: [_jsx("dt", { children: "Required" }), _jsx("dd", { children: schema.required.map((it) => (_jsx("code", { children: it }, it))) })] }))] }));
36
+ };
37
+ export const K8sAPISchemaItem = ({ schema, fullSchema, propertyPath = '', }) => {
38
+ const schemaType = useMemo(() => getSchemaValue(schema), [schema]);
39
+ const isArraySchema = schemaType === 'array';
40
+ const nestedSchema = useMemo(() => isArraySchema
41
+ ? derefSchema(schema.items, fullSchema)
42
+ : schema, [fullSchema, isArraySchema, schema]);
43
+ const propertiesEntry = useMemo(() => {
44
+ const properties = getSchemaValue(nestedSchema, 'properties');
45
+ return (properties &&
46
+ Object.entries(properties).map(([key, value]) => [key, derefSchema(value, fullSchema)]));
47
+ }, [fullSchema, nestedSchema]);
48
+ 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
+ const description = getSchemaValue(value, 'description');
50
+ const isMetadata = key === METADATA;
51
+ return (_jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: key }) }), _jsx("td", { children: isMetadata ? (_jsx("code", { children: _jsx(X.a, { href: "/apis/references/ObjectMeta.html", children: "ObjectMeta" }) })) : (typeCode(getSchemaValue(value))) }), _jsx("td", { children: _jsx(Markdown, { children: description ||
52
+ (isMetadata ? DEFAULT_METADATA_DESCRIPTION : '') }) })] }, key));
53
+ }) })] }), propertiesEntry.map(([key, value]) => {
54
+ const type = getSchemaValue(value);
55
+ if (!NESTED_SCHEMA_TYPES.has(type) || key === METADATA) {
56
+ return;
57
+ }
58
+ const nestedPropertyPath = `${propertyPath}${isArraySchema ? '[]' : ''}.${key}`;
59
+ return (_jsxs(Fragment, { children: [_jsx("div", { className: "rp-toc-exclude", children: _jsx(FallbackHeading, { level: 3, title: nestedPropertyPath }) }), _jsx(K8sAPISchemaItem, { schema: value, fullSchema: fullSchema, propertyPath: nestedPropertyPath })] }, key));
60
+ })] }))] }));
61
+ };
62
+ export const K8sAPISchema = ({ schema, fullSchema }) => (_jsx(K8sAPISchemaItem, { schema: schema, fullSchema: fullSchema }));
@@ -6,6 +6,7 @@ export * from './ExternalApisOverview.js';
6
6
  export * from './ExternalSite.js';
7
7
  export * from './ExternalSiteLink.js';
8
8
  export * from './JsonViewer.js';
9
+ export * from './K8sAPI.js';
9
10
  export * from './K8sCrd.js';
10
11
  export * from './K8sPermissionTable.js';
11
12
  export * from './Markdown.js';
@@ -6,6 +6,7 @@ export * from './ExternalApisOverview.js';
6
6
  export * from './ExternalSite.js';
7
7
  export * from './ExternalSiteLink.js';
8
8
  export * from './JsonViewer.js';
9
+ export * from './K8sAPI.js';
9
10
  export * from './K8sCrd.js';
10
11
  export * from './K8sPermissionTable.js';
11
12
  export * from './Markdown.js';
@@ -1,4 +1,4 @@
1
- import { useSearchParams } from '@rspress/core/dist/runtime.js';
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) => {
@@ -1,4 +1,4 @@
1
- import { useI18n, usePageData } from '@rspress/runtime';
1
+ import { useI18n, usePageData } from '@rspress/core/runtime';
2
2
  export function useEditLink() {
3
3
  const { siteData, page } = usePageData();
4
4
  const editLink = siteData.themeConfig.editLink;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "1.17.6",
3
+ "version": "1.18.1",
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.0",
46
- "@inquirer/prompts": "^8.1.0",
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.4",
53
- "@rspress/plugin-algolia": "2.0.0-rc.4",
54
- "@rspress/plugin-sitemap": "2.0.0-rc.4",
55
- "@rspress/shared": "2.0.0-rc.4",
56
- "@shikijs/transformers": "^3.20.0",
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.7",
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": "^16.5.0",
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.15.0",
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.20.0",
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.51.0",
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",
@@ -130,10 +130,43 @@ td {
130
130
  --rp-code-block-bg: #{color.adjust($color: #242424, $lightness: 5%)};
131
131
  }
132
132
 
133
- .rspress {
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
+
160
+ &-list-decimal:not(:has(p)) {
161
+ list-style: none;
162
+ counter-reset: section;
163
+ padding-left: 20px;
164
+
165
+ > li:before {
166
+ counter-increment: section;
167
+ content: counters(section, '.') '. ';
168
+ }
169
+ }
137
170
  }
138
171
 
139
172
  @mixin print {
@@ -163,15 +196,4 @@ td {
163
196
  @include print;
164
197
  }
165
198
 
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
199
  @import 'intelligence.scss';