@wildo-ai/saas-technical-doc 1.1.4 → 1.1.6
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/dist/esm/build/csp-emit.d.ts.map +1 -1
- package/dist/esm/build/load-materialized-frontend-providers.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-administration-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-administration-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-authentication-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts +37 -0
- package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-connection-documentation.js +46 -5
- package/dist/esm/companion/application-documentation/application-connection-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-documentation-chapters.d.ts +101 -0
- package/dist/esm/companion/application-documentation/application-documentation-chapters.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/application-documentation-chapters.js +205 -0
- package/dist/esm/companion/application-documentation/application-documentation-chapters.js.map +1 -0
- package/dist/esm/companion/application-documentation/application-domain-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-domain-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-integration-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-integration-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-organization-role-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-organization-role-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js +3 -0
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.d.ts +34 -0
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.js +45 -0
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.js.map +1 -0
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts +24 -10
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js +25 -15
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts +11 -3
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js +9 -2
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js +10 -4
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js.map +1 -1
- package/dist/esm/companion/content/application-consumer-documentation-content-loader.d.ts.map +1 -1
- package/dist/esm/companion/index.d.ts +2 -0
- package/dist/esm/companion/index.d.ts.map +1 -1
- package/dist/esm/companion/index.js +2 -0
- package/dist/esm/companion/index.js.map +1 -1
- package/dist/esm/companion/manual-controller-route-projection.d.ts.map +1 -1
- package/dist/esm/companion/manual-controller-route-projection.js.map +1 -1
- package/dist/esm/companion/openapi-example-derivation.d.ts +53 -0
- package/dist/esm/companion/openapi-example-derivation.d.ts.map +1 -0
- package/dist/esm/companion/openapi-example-derivation.js +229 -0
- package/dist/esm/companion/openapi-example-derivation.js.map +1 -0
- package/dist/esm/companion/openapi-generator.d.ts +8 -4
- package/dist/esm/companion/openapi-generator.d.ts.map +1 -1
- package/dist/esm/companion/openapi-generator.js +323 -33
- package/dist/esm/companion/openapi-generator.js.map +1 -1
- package/dist/esm/companion/operation-projection.schemas.d.ts +57 -1
- package/dist/esm/companion/operation-projection.schemas.d.ts.map +1 -1
- package/dist/esm/companion/operation-projection.schemas.js +29 -0
- package/dist/esm/companion/operation-projection.schemas.js.map +1 -1
- package/dist/esm/companion/publish-result.types.d.ts.map +1 -1
- package/dist/esm/companion/publish-result.types.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js +8 -0
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js +20 -0
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts +2 -0
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js +48 -31
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-render-model.js +26 -10
- package/dist/esm/companion/rendering/technical-documentation-render-model.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.js.map +1 -1
- package/dist/esm/companion/spec-to-operation-doc.d.ts +52 -10
- package/dist/esm/companion/spec-to-operation-doc.d.ts.map +1 -1
- package/dist/esm/companion/spec-to-operation-doc.js +125 -7
- package/dist/esm/companion/spec-to-operation-doc.js.map +1 -1
- package/dist/esm/companion/technical-documentation-asset-path.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-capture-execution-port.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-capture-execution-port.js.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-definitions.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-definitions.js.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-materializer.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-materializer.js.map +1 -1
- package/dist/esm/companion/technical-documentation-placeholder-materializer.d.ts.map +1 -1
- package/dist/esm/companion/zod-to-openapi.d.ts.map +1 -1
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/config/define-tech-doc-config.d.ts.map +1 -1
- package/dist/esm/config/index.d.ts.map +1 -1
- package/dist/esm/config/wildo-tech-doc-config.schemas.d.ts.map +1 -1
- package/dist/esm/config/wildo-tech-doc-config.schemas.js.map +1 -1
- package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts +27 -24
- package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -1
- package/dist/esm/content/application-consumer-documentation-content.techdoc.js +205 -82
- package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -1
- package/dist/esm/content.exports.d.ts.map +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/openapi/api-reference-link-index.d.ts +3 -0
- package/dist/esm/openapi/api-reference-link-index.d.ts.map +1 -1
- package/dist/esm/openapi/api-reference-link-index.js +26 -15
- package/dist/esm/openapi/api-reference-link-index.js.map +1 -1
- package/dist/esm/openapi/api-reference-pages.d.ts +55 -0
- package/dist/esm/openapi/api-reference-pages.d.ts.map +1 -0
- package/dist/esm/openapi/api-reference-pages.js +229 -0
- package/dist/esm/openapi/api-reference-pages.js.map +1 -0
- package/dist/esm/openapi/api-reference-search.d.ts +53 -0
- package/dist/esm/openapi/api-reference-search.d.ts.map +1 -0
- package/dist/esm/openapi/api-reference-search.js +100 -0
- package/dist/esm/openapi/api-reference-search.js.map +1 -0
- package/dist/esm/openapi/api-reference-targets.d.ts +11 -0
- package/dist/esm/openapi/api-reference-targets.d.ts.map +1 -1
- package/dist/esm/openapi/api-reference-targets.js +8 -0
- package/dist/esm/openapi/api-reference-targets.js.map +1 -1
- package/dist/esm/openapi/index.d.ts +2 -0
- package/dist/esm/openapi/index.d.ts.map +1 -1
- package/dist/esm/openapi/index.js +2 -0
- package/dist/esm/openapi/index.js.map +1 -1
- package/dist/esm/openapi/openapi-generation-output.schemas.d.ts.map +1 -1
- package/dist/esm/openapi-reference-model.exports.d.ts +2 -0
- package/dist/esm/openapi-reference-model.exports.d.ts.map +1 -1
- package/dist/esm/openapi-reference-model.exports.js +2 -0
- package/dist/esm/openapi-reference-model.exports.js.map +1 -1
- package/dist/esm/runtime/AuthExchangePage.d.ts +45 -4
- package/dist/esm/runtime/AuthExchangePage.d.ts.map +1 -1
- package/dist/esm/runtime/AuthExchangePage.js +45 -12
- package/dist/esm/runtime/AuthExchangePage.js.map +1 -1
- package/dist/esm/runtime/DocsAuthContext.d.ts +2 -2
- package/dist/esm/runtime/DocsAuthContext.d.ts.map +1 -1
- package/dist/esm/runtime/DocsAuthContext.js +8 -4
- package/dist/esm/runtime/DocsAuthContext.js.map +1 -1
- package/dist/esm/runtime/DocsFrontendProviders.d.ts +30 -0
- package/dist/esm/runtime/DocsFrontendProviders.d.ts.map +1 -0
- package/dist/esm/runtime/DocsFrontendProviders.js +39 -0
- package/dist/esm/runtime/DocsFrontendProviders.js.map +1 -0
- package/dist/esm/runtime/DocsProviderComponent.d.ts +41 -0
- package/dist/esm/runtime/DocsProviderComponent.d.ts.map +1 -0
- package/dist/esm/runtime/DocsProviderComponent.js +17 -0
- package/dist/esm/runtime/DocsProviderComponent.js.map +1 -0
- package/dist/esm/runtime/decode-jwt-claims.d.ts.map +1 -1
- package/dist/esm/runtime/docs-auth-client.d.ts.map +1 -1
- package/dist/esm/runtime/docs-auth-session.schemas.d.ts.map +1 -1
- package/dist/esm/runtime/documentation-site-translator.d.ts +53 -0
- package/dist/esm/runtime/documentation-site-translator.d.ts.map +1 -0
- package/dist/esm/runtime/documentation-site-translator.js +51 -0
- package/dist/esm/runtime/documentation-site-translator.js.map +1 -0
- package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts +1 -2
- package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts.map +1 -1
- package/dist/esm/runtime/frontend-provider-registry.techdoc.js.map +1 -1
- package/dist/esm/runtime/index.d.ts +8 -0
- package/dist/esm/runtime/index.d.ts.map +1 -1
- package/dist/esm/runtime/index.js +8 -0
- package/dist/esm/runtime/index.js.map +1 -1
- package/dist/esm/runtime/openapi-reference-conservation.d.ts.map +1 -1
- package/dist/esm/runtime/openapi-reference-model.d.ts +30 -0
- package/dist/esm/runtime/openapi-reference-model.d.ts.map +1 -1
- package/dist/esm/runtime/openapi-reference-model.js +85 -11
- package/dist/esm/runtime/openapi-reference-model.js.map +1 -1
- package/dist/esm/runtime/openapi-reference-navigation.d.ts +50 -0
- package/dist/esm/runtime/openapi-reference-navigation.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-navigation.js +46 -0
- package/dist/esm/runtime/openapi-reference-navigation.js.map +1 -0
- package/dist/esm/runtime/openapi-reference-samples.d.ts +40 -0
- package/dist/esm/runtime/openapi-reference-samples.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-samples.js +169 -0
- package/dist/esm/runtime/openapi-reference-samples.js.map +1 -0
- package/dist/esm/runtime/openapi-reference-styles.d.ts +28 -0
- package/dist/esm/runtime/openapi-reference-styles.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-styles.js +292 -0
- package/dist/esm/runtime/openapi-reference-styles.js.map +1 -0
- package/dist/esm/runtime/openapi-reference-view.d.ts +40 -5
- package/dist/esm/runtime/openapi-reference-view.d.ts.map +1 -1
- package/dist/esm/runtime/openapi-reference-view.js +828 -82
- package/dist/esm/runtime/openapi-reference-view.js.map +1 -1
- package/dist/esm/runtime/openapi-reference-words-context.d.ts +12 -0
- package/dist/esm/runtime/openapi-reference-words-context.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-words-context.js +30 -0
- package/dist/esm/runtime/openapi-reference-words-context.js.map +1 -0
- package/dist/esm/runtime/openapi-reference-words.d.ts +205 -0
- package/dist/esm/runtime/openapi-reference-words.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-words.js +162 -0
- package/dist/esm/runtime/openapi-reference-words.js.map +1 -0
- package/dist/esm/runtime/provider-component-registry.techdoc.d.ts +31 -0
- package/dist/esm/runtime/provider-component-registry.techdoc.d.ts.map +1 -0
- package/dist/esm/runtime/provider-component-registry.techdoc.js +35 -0
- package/dist/esm/runtime/provider-component-registry.techdoc.js.map +1 -0
- package/dist/esm/runtime/use-docs-auth-session.d.ts.map +1 -1
- package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts +1 -0
- package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts.map +1 -1
- package/dist/esm/runtime/use-docs-frontend-provider-registry.js +10 -2
- package/dist/esm/runtime/use-docs-frontend-provider-registry.js.map +1 -1
- package/dist/esm/runtime/use-docs-provider-component.d.ts +29 -0
- package/dist/esm/runtime/use-docs-provider-component.d.ts.map +1 -0
- package/dist/esm/runtime/use-docs-provider-component.js +42 -0
- package/dist/esm/runtime/use-docs-provider-component.js.map +1 -0
- package/dist/esm/runtime/use-docs-provider-scripts.d.ts +37 -0
- package/dist/esm/runtime/use-docs-provider-scripts.d.ts.map +1 -0
- package/dist/esm/runtime/use-docs-provider-scripts.js +47 -0
- package/dist/esm/runtime/use-docs-provider-scripts.js.map +1 -0
- package/dist/esm/runtime/use-docs-provider-sdks.d.ts.map +1 -1
- package/dist/esm/runtime/use-docs-provider-sdks.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -24
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The request sample and response examples shown beside an operation's contract (#1618).
|
|
3
|
+
*
|
|
4
|
+
* Everything here is DERIVED from the verified OpenAPI model: the server, the path, the parameters,
|
|
5
|
+
* the security scheme and the body example all come from the document, so a sample can only say what
|
|
6
|
+
* the contract says. It is a sample, not a console — nothing here sends a request or holds a
|
|
7
|
+
* credential; `<token>` and `<api-key>` are placeholders the reader replaces.
|
|
8
|
+
*
|
|
9
|
+
* curl is the one form every major API reference shows (Stripe, GitHub, Scalar) and the one a reader
|
|
10
|
+
* can paste into any terminal. JavaScript (`fetch`) and Python (`requests`) are the same call, spelled
|
|
11
|
+
* from the same parts, so the three tabs cannot disagree.
|
|
12
|
+
*/
|
|
13
|
+
/** Quote a value for a POSIX shell: single quotes, with an embedded `'` closed, escaped and reopened. */
|
|
14
|
+
function shellQuote(value) {
|
|
15
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
16
|
+
}
|
|
17
|
+
/** The value a parameter's first example gives, as the raw string that goes on the wire. */
|
|
18
|
+
function parameterExampleValue(parameter) {
|
|
19
|
+
const jsonValue = parameter.examples.find((example) => example.jsonValue !== null)?.jsonValue ?? null;
|
|
20
|
+
if (jsonValue === null)
|
|
21
|
+
return null;
|
|
22
|
+
try {
|
|
23
|
+
const parsed = JSON.parse(jsonValue);
|
|
24
|
+
return typeof parsed === 'string' ? parsed : jsonValue;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return jsonValue;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The header a security scheme is sent in, with a placeholder credential — or `null` when the scheme
|
|
32
|
+
* is not one a header can carry (a cookie or query scheme is left to the reader rather than guessed).
|
|
33
|
+
*/
|
|
34
|
+
function securityHeader(scheme) {
|
|
35
|
+
if (scheme.type === 'http' && scheme.scheme?.toLowerCase() === 'bearer')
|
|
36
|
+
return ['Authorization', 'Bearer <token>'];
|
|
37
|
+
if (scheme.type === 'http' && scheme.scheme?.toLowerCase() === 'basic')
|
|
38
|
+
return ['Authorization', 'Basic <credentials>'];
|
|
39
|
+
if (scheme.type === 'apiKey' && scheme.location === 'header' && scheme.parameterName !== null)
|
|
40
|
+
return [scheme.parameterName, '<api-key>'];
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
/** The code languages a request sample is offered in, in tab order. */
|
|
44
|
+
export var ApiReferenceSampleLanguage;
|
|
45
|
+
(function (ApiReferenceSampleLanguage) {
|
|
46
|
+
ApiReferenceSampleLanguage["CURL"] = "curl";
|
|
47
|
+
ApiReferenceSampleLanguage["JAVASCRIPT"] = "javascript";
|
|
48
|
+
ApiReferenceSampleLanguage["PYTHON"] = "python";
|
|
49
|
+
})(ApiReferenceSampleLanguage || (ApiReferenceSampleLanguage = {}));
|
|
50
|
+
function requestSampleParts(variant, serverUrl, securitySchemes) {
|
|
51
|
+
const query = variant.parameters
|
|
52
|
+
.filter((parameter) => parameter.location === 'query' && parameter.required)
|
|
53
|
+
.map((parameter) => `${encodeURIComponent(parameter.name)}=${parameterExampleValue(parameter) ?? `{${parameter.name}}`}`);
|
|
54
|
+
const url = `${(serverUrl ?? '').replace(/\/$/, '')}${variant.path}${query.length > 0 ? `?${query.join('&')}` : ''}`;
|
|
55
|
+
const headers = [];
|
|
56
|
+
const credential = variant.securitySchemes
|
|
57
|
+
.map((name) => securitySchemes.find((candidate) => candidate.name === name))
|
|
58
|
+
.map((scheme) => (scheme === undefined ? null : securityHeader(scheme)))
|
|
59
|
+
.find((candidate) => candidate !== null);
|
|
60
|
+
if (credential !== undefined)
|
|
61
|
+
headers.push(credential);
|
|
62
|
+
for (const parameter of variant.parameters.filter((candidate) => candidate.location === 'header' && candidate.required)) {
|
|
63
|
+
headers.push([parameter.name, parameterExampleValue(parameter) ?? `<${parameter.name}>`]);
|
|
64
|
+
}
|
|
65
|
+
const jsonMedia = variant.requestBody?.mediaTypes.find((media) => media.mediaType === 'application/json');
|
|
66
|
+
if (jsonMedia !== undefined)
|
|
67
|
+
headers.push(['Content-Type', 'application/json']);
|
|
68
|
+
return {
|
|
69
|
+
method: variant.method,
|
|
70
|
+
url,
|
|
71
|
+
headers,
|
|
72
|
+
jsonBody: jsonMedia === undefined ? null : jsonMedia.examples.find((candidate) => candidate.jsonValue !== null)?.jsonValue ?? '{}',
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** A curl command that calls `variant`, one option per line. */
|
|
76
|
+
export function buildCurlSample(variant, serverUrl, securitySchemes) {
|
|
77
|
+
const parts = requestSampleParts(variant, serverUrl, securitySchemes);
|
|
78
|
+
const lines = [parts.method === 'GET' ? `curl ${shellQuote(parts.url)}` : `curl -X ${parts.method} ${shellQuote(parts.url)}`];
|
|
79
|
+
for (const [name, value] of parts.headers)
|
|
80
|
+
lines.push(`-H ${shellQuote(`${name}: ${value}`)}`);
|
|
81
|
+
if (parts.jsonBody !== null)
|
|
82
|
+
lines.push(`--data ${shellQuote(parts.jsonBody)}`);
|
|
83
|
+
return lines.join(' \\\n ');
|
|
84
|
+
}
|
|
85
|
+
/** The same call with the browser and Node `fetch`. */
|
|
86
|
+
export function buildJavaScriptSample(variant, serverUrl, securitySchemes) {
|
|
87
|
+
const parts = requestSampleParts(variant, serverUrl, securitySchemes);
|
|
88
|
+
const options = [];
|
|
89
|
+
if (parts.method !== 'GET')
|
|
90
|
+
options.push(` method: ${JSON.stringify(parts.method)},`);
|
|
91
|
+
if (parts.headers.length > 0) {
|
|
92
|
+
options.push(' headers: {', ...parts.headers.map(([name, value]) => ` ${JSON.stringify(name)}: ${JSON.stringify(value)},`), ' },');
|
|
93
|
+
}
|
|
94
|
+
if (parts.jsonBody !== null) {
|
|
95
|
+
const parsed = parseJson(parts.jsonBody);
|
|
96
|
+
options.push(` body: JSON.stringify(${parsed.ok ? indentContinuation(JSON.stringify(parsed.value, null, 2), ' ') : JSON.stringify(parts.jsonBody)}),`);
|
|
97
|
+
}
|
|
98
|
+
const call = options.length === 0 ? `fetch(${JSON.stringify(parts.url)})` : `fetch(${JSON.stringify(parts.url)}, {\n${options.join('\n')}\n})`;
|
|
99
|
+
return `const response = await ${call};\nconst data = await response.json();`;
|
|
100
|
+
}
|
|
101
|
+
/** The same call with Python's `requests`. */
|
|
102
|
+
export function buildPythonSample(variant, serverUrl, securitySchemes) {
|
|
103
|
+
const parts = requestSampleParts(variant, serverUrl, securitySchemes);
|
|
104
|
+
const argumentsList = [` ${JSON.stringify(parts.url)},`];
|
|
105
|
+
if (parts.headers.length > 0) {
|
|
106
|
+
argumentsList.push(' headers={', ...parts.headers.map(([name, value]) => ` ${JSON.stringify(name)}: ${JSON.stringify(value)},`), ' },');
|
|
107
|
+
}
|
|
108
|
+
if (parts.jsonBody !== null) {
|
|
109
|
+
const parsed = parseJson(parts.jsonBody);
|
|
110
|
+
argumentsList.push(parsed.ok ? ` json=${indentContinuation(pythonLiteral(parsed.value, 0), ' ')},` : ` data=${JSON.stringify(parts.jsonBody)},`);
|
|
111
|
+
}
|
|
112
|
+
return `import requests\n\nresponse = requests.${parts.method.toLowerCase()}(\n${argumentsList.join('\n')}\n)\nprint(response.json())`;
|
|
113
|
+
}
|
|
114
|
+
/** Every language's sample for `variant`, keyed by language. */
|
|
115
|
+
export function buildRequestSamples(variant, serverUrl, securitySchemes) {
|
|
116
|
+
return {
|
|
117
|
+
[ApiReferenceSampleLanguage.CURL]: buildCurlSample(variant, serverUrl, securitySchemes),
|
|
118
|
+
[ApiReferenceSampleLanguage.JAVASCRIPT]: buildJavaScriptSample(variant, serverUrl, securitySchemes),
|
|
119
|
+
[ApiReferenceSampleLanguage.PYTHON]: buildPythonSample(variant, serverUrl, securitySchemes),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function parseJson(source) {
|
|
123
|
+
try {
|
|
124
|
+
return { ok: true, value: JSON.parse(source) };
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return { ok: false };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/** Indents every line after the first, so a multi-line value sits under the key that introduces it. */
|
|
131
|
+
function indentContinuation(text, indent) {
|
|
132
|
+
return text.split('\n').map((line, index) => (index === 0 ? line : `${indent}${line}`)).join('\n');
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* A parsed JSON value written as a Python literal. JSON strings are valid Python strings, so only the
|
|
136
|
+
* three words differ: `true`, `false` and `null` become `True`, `False` and `None`.
|
|
137
|
+
*/
|
|
138
|
+
function pythonLiteral(value, depth) {
|
|
139
|
+
const pad = ' '.repeat(depth + 1);
|
|
140
|
+
const closing = ' '.repeat(depth);
|
|
141
|
+
if (value === null)
|
|
142
|
+
return 'None';
|
|
143
|
+
if (value === true)
|
|
144
|
+
return 'True';
|
|
145
|
+
if (value === false)
|
|
146
|
+
return 'False';
|
|
147
|
+
if (typeof value === 'number' || typeof value === 'string')
|
|
148
|
+
return JSON.stringify(value);
|
|
149
|
+
if (Array.isArray(value)) {
|
|
150
|
+
return value.length === 0 ? '[]' : `[\n${value.map((item) => `${pad}${pythonLiteral(item, depth + 1)},`).join('\n')}\n${closing}]`;
|
|
151
|
+
}
|
|
152
|
+
const entries = Object.entries(value);
|
|
153
|
+
return entries.length === 0 ? '{}' : `{\n${entries.map(([key, item]) => `${pad}${JSON.stringify(key)}: ${pythonLiteral(item, depth + 1)},`).join('\n')}\n${closing}}`;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The response examples to show beside the contract: one per status that has one, successes first
|
|
157
|
+
* (they are what the reader is building for), then errors in status order.
|
|
158
|
+
*/
|
|
159
|
+
export function responseSamples(responses) {
|
|
160
|
+
const samples = responses.flatMap((response) => {
|
|
161
|
+
const example = response.mediaTypes.flatMap((media) => media.examples).find((candidate) => candidate.jsonValue !== null);
|
|
162
|
+
return example === undefined || example.jsonValue === null
|
|
163
|
+
? []
|
|
164
|
+
: [{ status: response.status, description: response.description, exampleName: example.name, jsonValue: example.jsonValue }];
|
|
165
|
+
});
|
|
166
|
+
const isSuccess = (status) => /^[23]/.test(status);
|
|
167
|
+
return [...samples.filter((sample) => isSuccess(sample.status)), ...samples.filter((sample) => !isSuccess(sample.status))];
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=openapi-reference-samples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-reference-samples.js","sourceRoot":"","sources":["../../../../src/runtime/openapi-reference-samples.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,yGAAyG;AACzG,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;AAC7C,CAAC;AAED,4FAA4F;AAC5F,SAAS,qBAAqB,CAAC,SAAgC;IAC7D,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,EAAE,SAAS,IAAI,IAAI,CAAC;IACtG,IAAI,SAAS,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC9C,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,MAAkC;IACxD,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,QAAQ;QAAE,OAAO,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;IACpH,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,OAAO;QAAE,OAAO,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;IACxH,IAAI,MAAM,CAA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AAW,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC7H,CAAC","sourcesContent":["/**\n * The request sample and response examples shown beside an operation's contract (#1618).\n *\n * Everything here is DERIVED from the verified OpenAPI model: the server, the path, the parameters,\n * the security scheme and the body example all come from the document, so a sample can only say what\n * the contract says. It is a sample, not a console — nothing here sends a request or holds a\n * credential; `<token>` and `<api-key>` are placeholders the reader replaces.\n *\n * curl is the one form every major API reference shows (Stripe, GitHub, Scalar) and the one a reader\n * can paste into any terminal. JavaScript (`fetch`) and Python (`requests`) are the same call, spelled\n * from the same parts, so the three tabs cannot disagree.\n */\n\nimport type { ApiReferenceParameter, ApiReferenceResponse, ApiReferenceSecurityScheme, ApiReferenceVariant } from './openapi-reference-model';\n\n/** Quote a value for a POSIX shell: single quotes, with an embedded `'` closed, escaped and reopened. */\nfunction shellQuote(value: string): string {\n return `'${value.replace(/'/g, `'\\\\''`)}'`;\n}\n\n/** The value a parameter's first example gives, as the raw string that goes on the wire. */\nfunction parameterExampleValue(parameter: ApiReferenceParameter): string | null {\n const jsonValue = parameter.examples.find((example) => example.jsonValue !== null)?.jsonValue ?? null;\n if (jsonValue === null) return null;\n try {\n const parsed: unknown = JSON.parse(jsonValue);\n return typeof parsed === 'string' ? parsed : jsonValue;\n } catch {\n return jsonValue;\n }\n}\n\n/**\n * The header a security scheme is sent in, with a placeholder credential — or `null` when the scheme\n * is not one a header can carry (a cookie or query scheme is left to the reader rather than guessed).\n */\nfunction securityHeader(scheme: ApiReferenceSecurityScheme): readonly [string, string] | null {\n if (scheme.type === 'http' && scheme.scheme?.toLowerCase() === 'bearer') return ['Authorization', 'Bearer <token>'];\n if (scheme.type === 'http' && scheme.scheme?.toLowerCase() === 'basic') return ['Authorization', 'Basic <credentials>'];\n if (scheme.type === 'apiKey' && scheme.location === 'header' && scheme.parameterName !== null) return [scheme.parameterName, '<api-key>'];\n return null;\n}\n\n/** The code languages a request sample is offered in, in tab order. */\nexport enum ApiReferenceSampleLanguage {\n CURL = 'curl',\n JAVASCRIPT = 'javascript',\n PYTHON = 'python',\n}\n\n/**\n * Everything a request sample says, before it is written in any language: the method, the full URL,\n * the headers and the JSON body. The three builders below only change the spelling, so they cannot\n * disagree about what the call is.\n *\n * Path parameters stay as `{name}` placeholders — the reader's ids are what belong there, and an\n * example id would look like a real one. Only REQUIRED query and header parameters are included, so\n * the sample is the smallest valid call; the parameter list shows the rest. The body is the request's\n * first example, authored or derived.\n */\ninterface RequestSampleParts {\n readonly method: string;\n readonly url: string;\n readonly headers: ReadonlyArray<readonly [name: string, value: string]>;\n /** The JSON body example exactly as the document gives it, or `null` for a call with no JSON body. */\n readonly jsonBody: string | null;\n}\n\nfunction requestSampleParts(\n variant: ApiReferenceVariant,\n serverUrl: string | null,\n securitySchemes: readonly ApiReferenceSecurityScheme[],\n): RequestSampleParts {\n const query = variant.parameters\n .filter((parameter) => parameter.location === 'query' && parameter.required)\n .map((parameter) => `${encodeURIComponent(parameter.name)}=${parameterExampleValue(parameter) ?? `{${parameter.name}}`}`);\n const url = `${(serverUrl ?? '').replace(/\\/$/, '')}${variant.path}${query.length > 0 ? `?${query.join('&')}` : ''}`;\n const headers: Array<readonly [string, string]> = [];\n const credential = variant.securitySchemes\n .map((name) => securitySchemes.find((candidate) => candidate.name === name))\n .map((scheme) => (scheme === undefined ? null : securityHeader(scheme)))\n .find((candidate): candidate is readonly [string, string] => candidate !== null);\n if (credential !== undefined) headers.push(credential);\n for (const parameter of variant.parameters.filter((candidate) => candidate.location === 'header' && candidate.required)) {\n headers.push([parameter.name, parameterExampleValue(parameter) ?? `<${parameter.name}>`]);\n }\n const jsonMedia = variant.requestBody?.mediaTypes.find((media) => media.mediaType === 'application/json');\n if (jsonMedia !== undefined) headers.push(['Content-Type', 'application/json']);\n return {\n method: variant.method,\n url,\n headers,\n jsonBody: jsonMedia === undefined ? null : jsonMedia.examples.find((candidate) => candidate.jsonValue !== null)?.jsonValue ?? '{}',\n };\n}\n\n/** A curl command that calls `variant`, one option per line. */\nexport function buildCurlSample(\n variant: ApiReferenceVariant,\n serverUrl: string | null,\n securitySchemes: readonly ApiReferenceSecurityScheme[],\n): string {\n const parts = requestSampleParts(variant, serverUrl, securitySchemes);\n const lines = [parts.method === 'GET' ? `curl ${shellQuote(parts.url)}` : `curl -X ${parts.method} ${shellQuote(parts.url)}`];\n for (const [name, value] of parts.headers) lines.push(`-H ${shellQuote(`${name}: ${value}`)}`);\n if (parts.jsonBody !== null) lines.push(`--data ${shellQuote(parts.jsonBody)}`);\n return lines.join(' \\\\\\n ');\n}\n\n/** The same call with the browser and Node `fetch`. */\nexport function buildJavaScriptSample(\n variant: ApiReferenceVariant,\n serverUrl: string | null,\n securitySchemes: readonly ApiReferenceSecurityScheme[],\n): string {\n const parts = requestSampleParts(variant, serverUrl, securitySchemes);\n const options: string[] = [];\n if (parts.method !== 'GET') options.push(` method: ${JSON.stringify(parts.method)},`);\n if (parts.headers.length > 0) {\n options.push(' headers: {', ...parts.headers.map(([name, value]) => ` ${JSON.stringify(name)}: ${JSON.stringify(value)},`), ' },');\n }\n if (parts.jsonBody !== null) {\n const parsed = parseJson(parts.jsonBody);\n options.push(` body: JSON.stringify(${parsed.ok ? indentContinuation(JSON.stringify(parsed.value, null, 2), ' ') : JSON.stringify(parts.jsonBody)}),`);\n }\n const call = options.length === 0 ? `fetch(${JSON.stringify(parts.url)})` : `fetch(${JSON.stringify(parts.url)}, {\\n${options.join('\\n')}\\n})`;\n return `const response = await ${call};\\nconst data = await response.json();`;\n}\n\n/** The same call with Python's `requests`. */\nexport function buildPythonSample(\n variant: ApiReferenceVariant,\n serverUrl: string | null,\n securitySchemes: readonly ApiReferenceSecurityScheme[],\n): string {\n const parts = requestSampleParts(variant, serverUrl, securitySchemes);\n const argumentsList = [` ${JSON.stringify(parts.url)},`];\n if (parts.headers.length > 0) {\n argumentsList.push(' headers={', ...parts.headers.map(([name, value]) => ` ${JSON.stringify(name)}: ${JSON.stringify(value)},`), ' },');\n }\n if (parts.jsonBody !== null) {\n const parsed = parseJson(parts.jsonBody);\n argumentsList.push(parsed.ok ? ` json=${indentContinuation(pythonLiteral(parsed.value, 0), ' ')},` : ` data=${JSON.stringify(parts.jsonBody)},`);\n }\n return `import requests\\n\\nresponse = requests.${parts.method.toLowerCase()}(\\n${argumentsList.join('\\n')}\\n)\\nprint(response.json())`;\n}\n\n/** Every language's sample for `variant`, keyed by language. */\nexport function buildRequestSamples(\n variant: ApiReferenceVariant,\n serverUrl: string | null,\n securitySchemes: readonly ApiReferenceSecurityScheme[],\n): Readonly<Record<ApiReferenceSampleLanguage, string>> {\n return {\n [ApiReferenceSampleLanguage.CURL]: buildCurlSample(variant, serverUrl, securitySchemes),\n [ApiReferenceSampleLanguage.JAVASCRIPT]: buildJavaScriptSample(variant, serverUrl, securitySchemes),\n [ApiReferenceSampleLanguage.PYTHON]: buildPythonSample(variant, serverUrl, securitySchemes),\n };\n}\n\nfunction parseJson(source: string): { readonly ok: true; readonly value: unknown } | { readonly ok: false } {\n try {\n return { ok: true, value: JSON.parse(source) as unknown };\n } catch {\n return { ok: false };\n }\n}\n\n/** Indents every line after the first, so a multi-line value sits under the key that introduces it. */\nfunction indentContinuation(text: string, indent: string): string {\n return text.split('\\n').map((line, index) => (index === 0 ? line : `${indent}${line}`)).join('\\n');\n}\n\n/**\n * A parsed JSON value written as a Python literal. JSON strings are valid Python strings, so only the\n * three words differ: `true`, `false` and `null` become `True`, `False` and `None`.\n */\nfunction pythonLiteral(value: unknown, depth: number): string {\n const pad = ' '.repeat(depth + 1);\n const closing = ' '.repeat(depth);\n if (value === null) return 'None';\n if (value === true) return 'True';\n if (value === false) return 'False';\n if (typeof value === 'number' || typeof value === 'string') return JSON.stringify(value);\n if (Array.isArray(value)) {\n return value.length === 0 ? '[]' : `[\\n${value.map((item) => `${pad}${pythonLiteral(item, depth + 1)},`).join('\\n')}\\n${closing}]`;\n }\n const entries = Object.entries(value as Record<string, unknown>);\n return entries.length === 0 ? '{}' : `{\\n${entries.map(([key, item]) => `${pad}${JSON.stringify(key)}: ${pythonLiteral(item, depth + 1)},`).join('\\n')}\\n${closing}}`;\n}\n\n/** One response status that has an example to show, with that example's JSON. */\nexport interface ApiReferenceResponseSample {\n readonly status: string;\n readonly description: string | null;\n readonly exampleName: string;\n readonly jsonValue: string;\n}\n\n/**\n * The response examples to show beside the contract: one per status that has one, successes first\n * (they are what the reader is building for), then errors in status order.\n */\nexport function responseSamples(responses: readonly ApiReferenceResponse[]): readonly ApiReferenceResponseSample[] {\n const samples = responses.flatMap((response) => {\n const example = response.mediaTypes.flatMap((media) => media.examples).find((candidate) => candidate.jsonValue !== null);\n return example === undefined || example.jsonValue === null\n ? []\n : [{ status: response.status, description: response.description, exampleName: example.name, jsonValue: example.jsonValue }];\n });\n const isSuccess = (status: string): boolean => /^[23]/.test(status);\n return [...samples.filter((sample) => isSuccess(sample.status)), ...samples.filter((sample) => !isSuccess(sample.status))];\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The API reference's stylesheet, rendered once by each reference view.
|
|
3
|
+
*
|
|
4
|
+
* It ships as a string rather than a `.css` file because this runtime is compiled by `tsc`, which does
|
|
5
|
+
* not copy stylesheets into `dist`, and the docs portal consumes the compiled package: a relative CSS
|
|
6
|
+
* import would resolve in source and break every consumer. The portal's content security policy
|
|
7
|
+
* allows inline styles for exactly this.
|
|
8
|
+
*
|
|
9
|
+
* Layout (#1616 redesign):
|
|
10
|
+
*
|
|
11
|
+
* - ≥ 1280 px: three columns. The navigation rail, the operation's documentation, and a dark
|
|
12
|
+
* request/response panel that stays in view while the documentation beside it scrolls.
|
|
13
|
+
* - 960–1279 px: the rail becomes a drawer behind a Menu button in a sticky sub-bar, which also holds
|
|
14
|
+
* an operation switcher. Documentation and samples stay side by side.
|
|
15
|
+
* - < 960 px: one column. The samples open in a bottom sheet from a button in each operation.
|
|
16
|
+
*
|
|
17
|
+
* The wide layout is the unconditioned default and the narrow ones are `max-width` overrides, so a
|
|
18
|
+
* renderer that evaluates no media query (a crawler, a test DOM) sees every sample in place.
|
|
19
|
+
*
|
|
20
|
+
* Colours are tokens on `.wildo-api-ref`, redefined under Docusaurus's `[data-theme='dark']`. The
|
|
21
|
+
* accent is the portal's own primary colour, so an application's brand carries into its reference.
|
|
22
|
+
* The code panel is dark in both themes.
|
|
23
|
+
*
|
|
24
|
+
* Method badges are coloured text on a tint, each at least 5.5:1 in light mode (POST, the lowest, 5.59:1). They were white on a
|
|
25
|
+
* solid colour until #1626 measured `PUT` at 3.4:1 on the default palette.
|
|
26
|
+
*/
|
|
27
|
+
export declare const API_REFERENCE_STYLES = "\n.wildo-api-ref {\n --wr-ink: #15171c; --wr-text: #3d434f; --wr-muted: #5b6270;\n --wr-bg: #ffffff; --wr-rail: #f7f7f4; --wr-subtle: #fafaf8;\n --wr-line: #e4e4de; --wr-line-soft: #eeeee9; --wr-chip: #f1f1ec; --wr-control: #dadad3;\n --wr-accent: var(--ifm-color-primary); --wr-accent-ink: var(--ifm-color-primary-darkest);\n --wr-accent-soft: color-mix(in srgb, var(--ifm-color-primary) 9%, transparent);\n --wr-required: #a8231a;\n --wr-ok: #16a34a; --wr-warn: #d97706; --wr-fail: #b42318;\n --wr-code-bg: #0f1217; --wr-code-card: #151920; --wr-code-line: #262b35; --wr-code-control: #1b2029;\n --wr-code-selected: #2a303b; --wr-code-text: #e3e6ec; --wr-code-muted: #a3abb9;\n --wr-top: var(--ifm-navbar-height, 3.75rem); --wr-subbar: 0px;\n --wr-rail-width: 18rem; --wr-code-width: clamp(22rem, 40%, 33rem);\n --wr-gutter: clamp(1rem, 3.5vw, 3.25rem);\n --wr-mono: var(--ifm-font-family-monospace);\n color: var(--wr-ink); background: var(--wr-bg); font-size: 0.9375rem; line-height: 1.55;\n}\n[data-theme='dark'] .wildo-api-ref {\n --wr-ink: #e8eaee; --wr-text: #c3c8d2; --wr-muted: #9aa2b1;\n --wr-bg: #16181d; --wr-rail: #1b1e24; --wr-subtle: #1d2027;\n --wr-line: #2c313a; --wr-line-soft: #252a32; --wr-chip: #262b34; --wr-control: #3a404c;\n --wr-accent-ink: var(--ifm-color-primary-lightest);\n --wr-accent-soft: color-mix(in srgb, var(--ifm-color-primary) 18%, transparent);\n --wr-required: #ff8a80; --wr-ok: #4ade80; --wr-warn: #f59e0b; --wr-fail: #f87171;\n --wr-code-bg: #0b0d11; --wr-code-card: #11151b;\n}\n.wildo-api-ref *, .wildo-api-ref *::before, .wildo-api-ref *::after { box-sizing: border-box; }\n.wildo-api-ref a { color: var(--wr-accent-ink); }\n.wildo-api-ref :is(a, button, input, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--wr-accent); outline-offset: 2px; }\n.wildo-api-ref [id] { scroll-margin-top: calc(var(--wr-top) + var(--wr-subbar) + 1rem); }\n.wildo-api-ref h1, .wildo-api-ref h2, .wildo-api-ref h3, .wildo-api-ref h4, .wildo-api-ref h5, .wildo-api-ref h6 { color: var(--wr-ink); }\n.wildo-api-ref code { border: 0; background: var(--wr-chip); color: var(--wr-ink); font-size: 0.85em; padding: 0.05rem 0.3rem; border-radius: 4px; }\n.wildo-api-ref pre code { background: transparent; padding: 0; font-size: inherit; color: inherit; }\n.wildo-api-ref :not(pre) > code { overflow-wrap: anywhere; }\n.wildo-api-ref pre { max-width: 100%; overflow: auto; }\n.wildo-api-ref details > summary { cursor: pointer; }\n.wildo-api-ref table { display: table; width: 100%; border-collapse: collapse; margin: 0; font-size: 0.875rem; }\n.wildo-api-ref tr, .wildo-api-ref tr:nth-child(2n) { border: 0; background: transparent; }\n.wildo-api-ref th, .wildo-api-ref td { border: 0; border-bottom: 1px solid var(--wr-line-soft); padding: 0.6rem 0.9rem 0.6rem 0; text-align: left; vertical-align: top; background: transparent; }\n.wildo-api-ref thead th { font-size: 0.75rem; font-weight: 600; color: var(--wr-muted); border-bottom-color: var(--wr-line); }\n.wildo-api-ref__visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }\n.wildo-api-ref__table-scroll { max-width: 100%; overflow-x: auto; }\n\n/* Shell ------------------------------------------------------------------------------------------ */\n.wildo-api-ref__shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - var(--wr-top)); }\n.wildo-api-ref__main { min-width: 0; }\n.wildo-api-ref__subbar { position: sticky; top: var(--wr-top); z-index: 150; display: flex; align-items: center; gap: 0.5rem; height: 3.25rem; padding: 0 var(--wr-gutter) 0 0.5rem; background: var(--wr-subtle); border-bottom: 1px solid var(--wr-line-soft); }\n.wildo-api-ref__subbar-title { flex: 1; min-width: 0; font-weight: 600; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.wildo-api-ref__icon-button { width: 2.75rem; height: 2.75rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: transparent; color: var(--wr-ink); cursor: pointer; }\n.wildo-api-ref__icon-button:hover { background: var(--wr-chip); }\n.wildo-api-ref__backdrop { display: none; }\n@media (min-width: 1280px) {\n .wildo-api-ref__shell--with-rail { grid-template-columns: var(--wr-rail-width) minmax(0, 1fr); }\n .wildo-api-ref__subbar { display: none; }\n .wildo-api-ref__rail { position: sticky; top: var(--wr-top); height: calc(100vh - var(--wr-top)); overflow-y: auto; }\n}\n@media (max-width: 1279.98px) {\n /* Only a page with a rail has a sub-bar, so only it offsets sticky elements and anchors by one. */\n .wildo-api-ref__shell--with-rail { --wr-subbar: 3.25rem; }\n .wildo-api-ref__rail { position: fixed; z-index: 400; top: 0; bottom: 0; left: 0; width: min(21rem, 88vw); overflow-y: auto; transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s; box-shadow: 8px 0 32px rgba(15, 18, 23, 0.18); }\n .wildo-api-ref--rail-open .wildo-api-ref__rail { transform: none; visibility: visible; transition: transform 0.2s ease; }\n .wildo-api-ref--rail-open .wildo-api-ref__backdrop { display: block; position: fixed; inset: 0; z-index: 399; border: 0; padding: 0; background: rgba(15, 18, 23, 0.45); cursor: default; }\n}\n@media (prefers-reduced-motion: reduce) { .wildo-api-ref__rail { transition: none !important; } }\n\n/* Rail ------------------------------------------------------------------------------------------- */\n.wildo-api-ref__rail { background: var(--wr-rail); border-right: 1px solid var(--wr-line); padding: 1.1rem 0.85rem 2rem; display: flex; flex-direction: column; gap: 1.1rem; font-size: 0.875rem; }\n.wildo-api-ref__rail-head { display: flex; align-items: center; gap: 0.5rem; margin: -0.5rem -0.35rem 0 0.25rem; }\n@media (min-width: 1280px) { .wildo-api-ref__rail-head { display: none; } }\n.wildo-api-ref__rail-head strong { flex: 1; font-size: 0.9375rem; }\n.wildo-api-ref__sections { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 3px; background: var(--wr-chip); border-radius: 9px; }\n.wildo-api-ref__sections a { text-align: center; padding: 0.35rem 0.5rem; border-radius: 7px; color: var(--wr-text); font-size: 0.8rem; font-weight: 500; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.wildo-api-ref__sections a[aria-current='page'] { background: var(--wr-bg); color: var(--wr-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(21, 23, 28, 0.08); }\n.wildo-api-ref__label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--wr-text); margin-bottom: 0.35rem; }\n.wildo-api-ref__input { width: 100%; height: 2.25rem; border: 1px solid var(--wr-control); border-radius: 8px; padding: 0 0.7rem; font: inherit; font-size: 0.875rem; background: var(--wr-bg); color: var(--wr-ink); }\n.wildo-api-ref__rail-group-title { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wr-muted); padding: 0 0.5rem 0.35rem; }\n.wildo-api-ref__rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }\n.wildo-api-ref__rail-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem; border-radius: 6px; color: var(--wr-text) !important; text-decoration: none !important; line-height: 1.35; }\n.wildo-api-ref__rail-link:hover { background: var(--wr-chip); color: var(--wr-ink) !important; }\n.wildo-api-ref__rail-link[aria-current='page'] { color: var(--wr-ink) !important; font-weight: 600; background: var(--wr-bg); box-shadow: inset 0 0 0 1px var(--wr-line); }\n.wildo-api-ref__rail-link[aria-current='location'] { background: var(--wr-accent-soft); color: var(--wr-ink) !important; font-weight: 600; }\n.wildo-api-ref__rail-count { margin-left: auto; font-family: var(--wr-mono); font-size: 0.6875rem; color: var(--wr-muted); }\n.wildo-api-ref__rail-families { list-style: none; margin: 0.15rem 0 0.35rem 0.35rem; padding: 0 0 0 0.35rem; border-left: 1px solid var(--wr-line); display: flex; flex-direction: column; gap: 1px; }\n.wildo-api-ref__rail-families .wildo-api-ref__rail-link { font-size: 0.8125rem; padding: 0.3rem 0.4rem; }\n.wildo-api-ref__rail-categories { display: flex; flex-direction: column; border-top: 1px solid var(--wr-line); padding-top: 0.5rem; }\n.wildo-api-ref__rail-category > summary { list-style: none; display: flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.5rem; border-radius: 6px; color: var(--wr-text); font-weight: 500; }\n.wildo-api-ref__rail-category > summary::-webkit-details-marker { display: none; }\n.wildo-api-ref__rail-category > summary:hover { background: var(--wr-chip); }\n.wildo-api-ref__rail-category > summary::before { content: ''; width: 0.4rem; height: 0.4rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s ease; flex-shrink: 0; margin-right: 0.15rem; }\n.wildo-api-ref__rail-category[open] > summary::before { transform: rotate(45deg); }\n.wildo-api-ref__rail-category > .wildo-api-ref__rail-list { padding: 0.1rem 0 0.4rem 0.9rem; }\n.wildo-api-ref__rail-empty { color: var(--wr-muted); padding: 0 0.5rem; margin: 0; }\n\n/* Operation switcher (sub-bar popover) ------------------------------------------------------------ */\n.wildo-api-ref__switcher { position: relative; flex-shrink: 0; }\n.wildo-api-ref__switcher-panel { position: absolute; right: 0; top: calc(100% + 0.4rem); width: min(24rem, calc(100vw - 1.5rem)); max-height: min(34rem, calc(100vh - var(--wr-top) - 5rem)); display: flex; flex-direction: column; background: var(--wr-bg); border: 1px solid var(--wr-line); border-radius: 14px; box-shadow: 0 18px 48px rgba(15, 18, 23, 0.22); overflow: hidden; z-index: 160; }\n.wildo-api-ref__switcher-filter { padding: 0.75rem; border-bottom: 1px solid var(--wr-line-soft); }\n.wildo-api-ref__switcher-list { list-style: none; margin: 0; padding: 0.35rem; overflow-y: auto; }\n.wildo-api-ref__switcher-list .wildo-api-ref__rail-link { min-height: 2.5rem; font-size: 0.875rem; }\n\n/* Buttons and chips ------------------------------------------------------------------------------- */\n.wildo-api-ref__button { display: inline-flex; align-items: center; gap: 0.4rem; height: 2rem; padding: 0 0.7rem; border: 1px solid var(--wr-control); border-radius: 8px; background: var(--wr-bg); color: var(--wr-text); font: inherit; font-size: 0.8rem; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; }\n.wildo-api-ref__button:hover { border-color: var(--wr-muted); color: var(--wr-ink); }\n.wildo-api-ref__chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.35rem 0; padding: 0; list-style: none; }\n.wildo-api-ref__chip { font-family: var(--wr-mono); font-size: 0.75rem !important; padding: 0.1rem 0.45rem !important; border-radius: 5px; background: var(--wr-chip); color: var(--wr-ink); }\n.wildo-api-ref__chip--outline { background: transparent !important; box-shadow: inset 0 0 0 1px var(--wr-line); color: var(--wr-text) !important; }\n.wildo-api-ref__method { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 3.6rem; font-family: var(--wr-mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1; padding: 0.35rem 0.4rem; border-radius: 5px; color: #3d434f; background: #ebebe5; }\n.wildo-api-ref__method--small { min-width: 3.25rem; font-size: 0.625rem; padding: 0.22rem 0.3rem; }\n.wildo-api-ref__method--get { color: #1747a6; background: #e6eefd; }\n.wildo-api-ref__method--post { color: #146c43; background: #e1f3e8; }\n.wildo-api-ref__method--put { color: #8f4308; background: #fceedd; }\n.wildo-api-ref__method--patch { color: #5b35b3; background: #efe9fd; }\n.wildo-api-ref__method--delete { color: #a8231a; background: #fce8e6; }\n[data-theme='dark'] .wildo-api-ref__method { color: #c3c8d2; background: #2a2f38; }\n[data-theme='dark'] .wildo-api-ref__method--get { color: #a9c4ff; background: rgba(59, 110, 246, 0.2); }\n[data-theme='dark'] .wildo-api-ref__method--post { color: #86dcaa; background: rgba(34, 160, 90, 0.2); }\n[data-theme='dark'] .wildo-api-ref__method--put { color: #f5bf86; background: rgba(234, 140, 40, 0.2); }\n[data-theme='dark'] .wildo-api-ref__method--patch { color: #cbb8ff; background: rgba(140, 100, 240, 0.22); }\n[data-theme='dark'] .wildo-api-ref__method--delete { color: #ffa39a; background: rgba(220, 60, 50, 0.22); }\n.wildo-api-ref__status-dot { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 99px; background: var(--wr-muted); flex-shrink: 0; }\n.wildo-api-ref__status-dot--success { background: var(--wr-ok); }\n.wildo-api-ref__status-dot--client-error { background: var(--wr-warn); }\n.wildo-api-ref__status-dot--server-error { background: var(--wr-fail); }\n\n/* Pages ------------------------------------------------------------------------------------------- */\n.wildo-api-ref__page { padding: 2.25rem var(--wr-gutter) 3rem; max-width: 76rem; }\n.wildo-api-ref__intro { padding: 2.25rem var(--wr-gutter) 1.75rem; max-width: 60rem; }\n.wildo-api-ref__eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wr-muted); margin: 0 0 0.5rem; }\n.wildo-api-ref__title { font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.75rem; }\n.wildo-api-ref__lead { font-size: 1rem; line-height: 1.6; color: var(--wr-text); max-width: 46rem; }\n.wildo-api-ref__breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; list-style: none; margin: 0 0 0.9rem; padding: 0; font-size: 0.8125rem; color: var(--wr-muted); }\n.wildo-api-ref__breadcrumb li + li::before { content: '/'; margin-right: 0.5rem; color: var(--wr-control); }\n.wildo-api-ref__breadcrumb a { color: var(--wr-muted); }\n.wildo-api-ref__stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; padding: 0; list-style: none; }\n.wildo-api-ref__stats li { font-size: 0.8125rem; color: var(--wr-text); padding: 0.2rem 0.65rem; border: 1px solid var(--wr-line); border-radius: 999px; }\n.wildo-api-ref__panel { border: 1px solid var(--wr-line); border-radius: 12px; padding: 1.1rem 1.25rem; margin: 0 0 1.5rem; background: var(--wr-bg); }\n.wildo-api-ref__panel > :first-child { margin-top: 0; }\n.wildo-api-ref__panel > :last-child { margin-bottom: 0; }\n.wildo-api-ref__panel h2 { font-size: 1.05rem; }\n.wildo-api-ref__panel h3 { font-size: 0.9rem; margin: 1rem 0 0.35rem; }\n.wildo-api-ref__disclosure { border: 1px solid var(--wr-line); border-radius: 12px; margin: 0 0 1.25rem; }\n.wildo-api-ref__disclosure > summary { padding: 0.8rem 1.1rem; font-weight: 600; }\n.wildo-api-ref__disclosure > summary > h2, .wildo-api-ref__disclosure > summary > h3 { display: inline; font-size: inherit; margin: 0; }\n.wildo-api-ref__disclosure > div, .wildo-api-ref__disclosure > ul, .wildo-api-ref__disclosure > section, .wildo-api-ref__disclosure > p { padding: 0 1.1rem 1rem; margin: 0; }\n.wildo-api-ref__search { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; margin: 1.5rem 0 0.25rem; max-width: 34rem; }\n.wildo-api-ref__search > div { flex: 1; min-width: 14rem; }\n.wildo-api-ref__search-status { min-height: 1.4rem; margin: 0 0 1rem; font-size: 0.8125rem; color: var(--wr-muted); }\n.wildo-api-ref__category { margin: 2rem 0 0; }\n.wildo-api-ref__category > h2 { font-size: 1.15rem; margin: 0 0 0.25rem; }\n.wildo-api-ref__category > p { color: var(--wr-text); margin: 0 0 0.75rem; }\n.wildo-api-ref__resource-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); list-style: none; margin: 0.75rem 0 0; padding: 0; }\n.wildo-api-ref__resource-card { position: relative; display: flex; flex-direction: column; gap: 0.35rem; border: 1px solid var(--wr-line); border-radius: 12px; padding: 0.95rem 1.1rem; background: var(--wr-bg); transition: border-color 0.15s ease, box-shadow 0.15s ease; }\n.wildo-api-ref__resource-card:hover { border-color: var(--wr-accent); box-shadow: 0 4px 16px rgba(21, 23, 28, 0.07); }\n.wildo-api-ref__resource-card a { color: var(--wr-ink); font-weight: 600; text-decoration: none; }\n.wildo-api-ref__resource-card a::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }\n.wildo-api-ref__resource-card p { margin: 0; font-size: 0.8125rem; color: var(--wr-text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }\n.wildo-api-ref__resource-card .wildo-api-ref__card-meta { margin-top: auto; padding-top: 0.25rem; font-size: 0.75rem; color: var(--wr-muted); -webkit-line-clamp: 1; }\n\n/* Operations -------------------------------------------------------------------------------------- */\n.wildo-api-ref__operations { border-top: 1px solid var(--wr-line); background: linear-gradient(to right, var(--wr-bg) calc(100% - var(--wr-code-width)), var(--wr-code-bg) 0); }\n.wildo-api-ref__operation { display: grid; grid-template-columns: minmax(0, 1fr) var(--wr-code-width); }\n.wildo-api-ref__operation-doc { min-width: 0; padding: 2.25rem var(--wr-gutter) 2.75rem; }\n.wildo-api-ref__operation-code { min-width: 0; padding: 2rem 1.25rem 2.5rem; }\n.wildo-api-ref__family + .wildo-api-ref__family .wildo-api-ref__operation-doc { border-top: 1px solid var(--wr-line); }\n.wildo-api-ref__family + .wildo-api-ref__family .wildo-api-ref__operation-code { border-top: 1px solid var(--wr-code-line); }\n.wildo-api-ref__samples { position: sticky; top: calc(var(--wr-top) + var(--wr-subbar) + 1rem); max-height: calc(100vh - var(--wr-top) - var(--wr-subbar) - 2rem); overflow: auto; }\n.wildo-api-ref__sheet-open { display: none !important; }\n@media (max-width: 959.98px) {\n .wildo-api-ref__operations { background: none; }\n .wildo-api-ref__operation { grid-template-columns: minmax(0, 1fr); }\n .wildo-api-ref__operation-code { display: none; }\n .wildo-api-ref__sheet-open { display: inline-flex !important; }\n}\n.wildo-api-ref__family-title { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wr-muted); margin: 0 0 0.6rem; }\n.wildo-api-ref__operation-title { font-size: clamp(1.35rem, 2.2vw, 1.65rem); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.9rem; }\n.wildo-api-ref__segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--wr-chip); border-radius: 9px; margin: 0 0 1.1rem; max-width: 100%; }\n.wildo-api-ref__segment { display: inline-flex; align-items: center; gap: 0.4rem; border: 0; background: transparent; border-radius: 7px; padding: 0.3rem 0.6rem; font: inherit; font-size: 0.8125rem; color: var(--wr-text); cursor: pointer; text-align: left; }\n.wildo-api-ref__segment[aria-selected='true'] { background: var(--wr-bg); color: var(--wr-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(21, 23, 28, 0.1); }\n.wildo-api-ref__endpoint { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.45rem 0.4rem 0.55rem; background: var(--wr-rail); border: 1px solid var(--wr-line); border-radius: 10px; margin: 0 0 1rem; }\n.wildo-api-ref__path { flex: 1; min-width: 0; font-family: var(--wr-mono); font-size: 0.85rem !important; background: none !important; padding: 0 !important; overflow-wrap: anywhere; color: var(--wr-ink); }\n.wildo-api-ref__path-param { color: var(--wr-accent-ink); }\n.wildo-api-ref__facts { display: flex; flex-wrap: wrap; gap: 1px; margin: 1.1rem 0; background: var(--wr-line); border: 1px solid var(--wr-line); border-radius: 10px; overflow: hidden; }\n.wildo-api-ref__fact { flex: 1 1 11rem; background: var(--wr-bg); padding: 0.6rem 0.85rem; min-width: 0; }\n.wildo-api-ref__fact dt { font-size: 0.75rem; font-weight: 400; color: var(--wr-muted); margin: 0; }\n.wildo-api-ref__fact dd { margin: 0.2rem 0 0; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; }\n.wildo-api-ref__note { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.75rem 0.9rem; margin: 0 0 1rem; background: var(--wr-accent-soft); border-radius: 10px; font-size: 0.875rem; color: var(--wr-ink); }\n.wildo-api-ref__note ul { margin: 0; padding-left: 1.1rem; }\n.wildo-api-ref__inline-disclosure > summary { font-size: 0.8125rem; font-weight: 500; color: var(--wr-text); margin: 0 0 0.5rem; }\n.wildo-api-ref__subheading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; font-size: 1.05rem; font-weight: 600; margin: 2rem 0 0.6rem; }\n.wildo-api-ref__subheading-meta { font-family: var(--wr-mono); font-size: 0.75rem; font-weight: 400; color: var(--wr-muted); }\n.wildo-api-ref__sheet-open { margin: 0.5rem 0 0; width: 100%; justify-content: center; height: 2.75rem; border: 0; background: var(--wr-code-bg); color: #ffffff; font-size: 0.9rem; font-weight: 600; border-radius: 12px; }\n.wildo-api-ref__sheet-open:hover { color: #ffffff; }\n\n/* Fields ------------------------------------------------------------------------------------------ */\n.wildo-api-ref__fields { list-style: none; margin: 0; padding: 0; }\n.wildo-api-ref__field { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 0.35rem 1.25rem; padding: 0.8rem 0; border-top: 1px solid var(--wr-line-soft); }\n.wildo-api-ref__fields > .wildo-api-ref__field:first-child { border-top-color: var(--wr-line); }\n.wildo-api-ref__field-head { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }\n.wildo-api-ref__field-name { font-family: var(--wr-mono); font-size: 0.875rem !important; font-weight: 600; background: none !important; padding: 0 !important; overflow-wrap: anywhere; }\n.wildo-api-ref__field-meta { font-size: 0.75rem; color: var(--wr-muted); }\n.wildo-api-ref__field-meta code { background: none; padding: 0; font-size: 0.75rem; color: var(--wr-muted); }\n.wildo-api-ref__required { color: var(--wr-required); font-weight: 600; }\n.wildo-api-ref__field-body { min-width: 0; font-size: 0.875rem; color: var(--wr-text); }\n.wildo-api-ref__field-body > :first-child { margin-top: 0; }\n.wildo-api-ref__field-body p { margin: 0 0 0.4rem; }\n.wildo-api-ref__field-body > :last-child { margin-bottom: 0; }\n.wildo-api-ref__children > summary { display: inline-flex; align-items: center; gap: 0.35rem; height: 1.75rem; padding: 0 0.7rem; margin: 0.25rem 0; border: 1px solid var(--wr-control); border-radius: 999px; font-size: 0.75rem; color: var(--wr-text); list-style: none; }\n.wildo-api-ref__children > summary::-webkit-details-marker { display: none; }\n.wildo-api-ref__children > summary::before { content: '+'; font-weight: 600; }\n.wildo-api-ref__children[open] > summary::before { content: '\u2212'; }\n.wildo-api-ref__children > .wildo-api-ref__nested { margin-top: 0.35rem; padding-left: 0.9rem; border-left: 2px solid var(--wr-line); }\n.wildo-api-ref__nested .wildo-api-ref__field { grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); padding: 0.6rem 0; }\n.wildo-api-ref__nested-label { font-size: 0.75rem; font-weight: 600; color: var(--wr-muted); margin: 0.5rem 0 0.25rem; }\n.wildo-api-ref__more { width: 100%; height: 2.5rem; margin-top: 0.25rem; border: 1px dashed var(--wr-control); border-radius: 9px; background: var(--wr-subtle); color: var(--wr-text); font: inherit; font-size: 0.8125rem; cursor: pointer; }\n.wildo-api-ref__enum { list-style: none; margin: 0.35rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }\n@media (max-width: 640px) {\n .wildo-api-ref__field, .wildo-api-ref__nested .wildo-api-ref__field { grid-template-columns: minmax(0, 1fr); }\n}\n\n/* Responses --------------------------------------------------------------------------------------- */\n.wildo-api-ref__status-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.75rem; }\n.wildo-api-ref__status-tab { display: inline-flex; align-items: center; gap: 0.45rem; height: 2rem; padding: 0 0.8rem; border: 1px solid var(--wr-control); border-radius: 999px; background: var(--wr-bg); color: var(--wr-text); font: inherit; font-size: 0.8125rem; font-family: var(--wr-mono); cursor: pointer; }\n.wildo-api-ref__status-tab[aria-selected='true'] { background: var(--wr-ink); border-color: var(--wr-ink); color: var(--wr-bg); }\n.wildo-api-ref__response { border: 1px solid var(--wr-line); border-radius: 10px; padding: 0.85rem 1rem; }\n.wildo-api-ref__response > p:first-child { margin: 0 0 0.5rem; }\n.wildo-api-ref__representations { list-style: none; margin: 0; padding: 0; }\n.wildo-api-ref__representations > li + li { margin-top: 0.75rem; }\n.wildo-api-ref__media { font-family: var(--wr-mono); font-size: 0.75rem; color: var(--wr-muted); }\n\n/* Code panel -------------------------------------------------------------------------------------- */\n.wildo-api-ref__samples { display: flex; flex-direction: column; gap: 1rem; color: var(--wr-code-text); }\n.wildo-api-ref__code-card { border: 1px solid var(--wr-code-line); border-radius: 12px; background: var(--wr-code-card); overflow: hidden; }\n.wildo-api-ref__code-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; padding: 0.4rem 0.5rem 0.4rem 0.75rem; border-bottom: 1px solid var(--wr-code-line); }\n.wildo-api-ref__code-title { font-size: 0.75rem; font-weight: 600; color: var(--wr-code-text); margin-right: 0.35rem; }\n.wildo-api-ref__code-tabs { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }\n.wildo-api-ref__code-tab { display: inline-flex; align-items: center; gap: 0.35rem; border: 0; background: transparent; color: var(--wr-code-muted); border-radius: 6px; padding: 0.3rem 0.55rem; font: inherit; font-size: 0.75rem; cursor: pointer; }\n.wildo-api-ref__code-tab:hover { color: var(--wr-code-text); }\n.wildo-api-ref__code-tab[aria-selected='true'] { background: var(--wr-code-selected); color: #ffffff; }\n.wildo-api-ref__code-server { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--wr-code-line); font-size: 0.75rem; color: var(--wr-code-muted); }\n.wildo-api-ref__code-server select { border: 1px solid #2e3440; border-radius: 6px; background: var(--wr-code-control); color: var(--wr-code-text); font: inherit; font-size: 0.75rem; padding: 0.15rem 0.4rem; max-width: 100%; }\n.wildo-api-ref__code-server code { background: none; color: var(--wr-code-text); padding: 0; overflow-wrap: anywhere; }\n.wildo-api-ref__code-card pre { margin: 0; padding: 0.9rem 1rem; background: transparent; color: var(--wr-code-text); font-family: var(--wr-mono); font-size: 0.78rem; line-height: 1.7; max-height: 28rem; overflow: auto; border-radius: 0; white-space: pre; }\n.wildo-api-ref__code-caption { margin: 0; padding: 0.5rem 0.9rem 0; font-size: 0.75rem; color: var(--wr-code-muted); }\n.wildo-api-ref__code-empty { margin: 0; padding: 0.9rem 1rem; font-size: 0.8rem; color: var(--wr-code-muted); }\n.wildo-api-ref__copy { display: inline-flex; align-items: center; gap: 0.35rem; height: 1.85rem; padding: 0 0.6rem; border: 1px solid var(--wr-control); border-radius: 7px; background: var(--wr-bg); color: var(--wr-text); font: inherit; font-size: 0.75rem; cursor: pointer; flex-shrink: 0; }\n.wildo-api-ref__copy:hover { color: var(--wr-ink); border-color: var(--wr-muted); }\n.wildo-api-ref__code-card .wildo-api-ref__copy { border-color: transparent; background: transparent; color: var(--wr-code-muted); }\n.wildo-api-ref__code-card .wildo-api-ref__copy:hover { color: #ffffff; background: var(--wr-code-selected); }\n.wildo-api-ref__tok--key { color: #8cc4ff; }\n.wildo-api-ref__tok--string { color: #b7e3a3; }\n.wildo-api-ref__tok--number, .wildo-api-ref__tok--literal { color: #f4c27a; }\n.wildo-api-ref__tok--keyword { color: #c7a6ff; }\n\n/* Bottom sheet (phones) --------------------------------------------------------------------------- */\n.wildo-api-ref__sheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 88vh; border: 0; border-radius: 18px 18px 0 0; background: var(--wr-code-bg); color: var(--wr-code-text); padding: 0.5rem 0.75rem 1.5rem; overflow: auto; }\n.wildo-api-ref__sheet::backdrop { background: rgba(15, 18, 23, 0.45); }\n.wildo-api-ref__sheet-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0 0.75rem 0.25rem; }\n.wildo-api-ref__sheet-head strong { flex: 1; font-size: 0.9rem; color: #ffffff; }\n.wildo-api-ref__sheet .wildo-api-ref__icon-button { color: var(--wr-code-text); }\n.wildo-api-ref__sheet .wildo-api-ref__icon-button:hover { background: var(--wr-code-selected); }\n\n/* Data models ------------------------------------------------------------------------------------- */\n.wildo-api-ref__models { padding: 1.5rem var(--wr-gutter) 3rem; border-top: 1px solid var(--wr-line); }\n.wildo-api-ref__models .wildo-api-ref__disclosure { max-width: 60rem; }\n";
|
|
28
|
+
//# sourceMappingURL=openapi-reference-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-reference-styles.d.ts","sourceRoot":"","sources":["../../../../src/runtime/openapi-reference-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,oBAAoB,+64BAwQhC,CAAC"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The API reference's stylesheet, rendered once by each reference view.
|
|
3
|
+
*
|
|
4
|
+
* It ships as a string rather than a `.css` file because this runtime is compiled by `tsc`, which does
|
|
5
|
+
* not copy stylesheets into `dist`, and the docs portal consumes the compiled package: a relative CSS
|
|
6
|
+
* import would resolve in source and break every consumer. The portal's content security policy
|
|
7
|
+
* allows inline styles for exactly this.
|
|
8
|
+
*
|
|
9
|
+
* Layout (#1616 redesign):
|
|
10
|
+
*
|
|
11
|
+
* - ≥ 1280 px: three columns. The navigation rail, the operation's documentation, and a dark
|
|
12
|
+
* request/response panel that stays in view while the documentation beside it scrolls.
|
|
13
|
+
* - 960–1279 px: the rail becomes a drawer behind a Menu button in a sticky sub-bar, which also holds
|
|
14
|
+
* an operation switcher. Documentation and samples stay side by side.
|
|
15
|
+
* - < 960 px: one column. The samples open in a bottom sheet from a button in each operation.
|
|
16
|
+
*
|
|
17
|
+
* The wide layout is the unconditioned default and the narrow ones are `max-width` overrides, so a
|
|
18
|
+
* renderer that evaluates no media query (a crawler, a test DOM) sees every sample in place.
|
|
19
|
+
*
|
|
20
|
+
* Colours are tokens on `.wildo-api-ref`, redefined under Docusaurus's `[data-theme='dark']`. The
|
|
21
|
+
* accent is the portal's own primary colour, so an application's brand carries into its reference.
|
|
22
|
+
* The code panel is dark in both themes.
|
|
23
|
+
*
|
|
24
|
+
* Method badges are coloured text on a tint, each at least 5.5:1 in light mode (POST, the lowest, 5.59:1). They were white on a
|
|
25
|
+
* solid colour until #1626 measured `PUT` at 3.4:1 on the default palette.
|
|
26
|
+
*/
|
|
27
|
+
export const API_REFERENCE_STYLES = `
|
|
28
|
+
.wildo-api-ref {
|
|
29
|
+
--wr-ink: #15171c; --wr-text: #3d434f; --wr-muted: #5b6270;
|
|
30
|
+
--wr-bg: #ffffff; --wr-rail: #f7f7f4; --wr-subtle: #fafaf8;
|
|
31
|
+
--wr-line: #e4e4de; --wr-line-soft: #eeeee9; --wr-chip: #f1f1ec; --wr-control: #dadad3;
|
|
32
|
+
--wr-accent: var(--ifm-color-primary); --wr-accent-ink: var(--ifm-color-primary-darkest);
|
|
33
|
+
--wr-accent-soft: color-mix(in srgb, var(--ifm-color-primary) 9%, transparent);
|
|
34
|
+
--wr-required: #a8231a;
|
|
35
|
+
--wr-ok: #16a34a; --wr-warn: #d97706; --wr-fail: #b42318;
|
|
36
|
+
--wr-code-bg: #0f1217; --wr-code-card: #151920; --wr-code-line: #262b35; --wr-code-control: #1b2029;
|
|
37
|
+
--wr-code-selected: #2a303b; --wr-code-text: #e3e6ec; --wr-code-muted: #a3abb9;
|
|
38
|
+
--wr-top: var(--ifm-navbar-height, 3.75rem); --wr-subbar: 0px;
|
|
39
|
+
--wr-rail-width: 18rem; --wr-code-width: clamp(22rem, 40%, 33rem);
|
|
40
|
+
--wr-gutter: clamp(1rem, 3.5vw, 3.25rem);
|
|
41
|
+
--wr-mono: var(--ifm-font-family-monospace);
|
|
42
|
+
color: var(--wr-ink); background: var(--wr-bg); font-size: 0.9375rem; line-height: 1.55;
|
|
43
|
+
}
|
|
44
|
+
[data-theme='dark'] .wildo-api-ref {
|
|
45
|
+
--wr-ink: #e8eaee; --wr-text: #c3c8d2; --wr-muted: #9aa2b1;
|
|
46
|
+
--wr-bg: #16181d; --wr-rail: #1b1e24; --wr-subtle: #1d2027;
|
|
47
|
+
--wr-line: #2c313a; --wr-line-soft: #252a32; --wr-chip: #262b34; --wr-control: #3a404c;
|
|
48
|
+
--wr-accent-ink: var(--ifm-color-primary-lightest);
|
|
49
|
+
--wr-accent-soft: color-mix(in srgb, var(--ifm-color-primary) 18%, transparent);
|
|
50
|
+
--wr-required: #ff8a80; --wr-ok: #4ade80; --wr-warn: #f59e0b; --wr-fail: #f87171;
|
|
51
|
+
--wr-code-bg: #0b0d11; --wr-code-card: #11151b;
|
|
52
|
+
}
|
|
53
|
+
.wildo-api-ref *, .wildo-api-ref *::before, .wildo-api-ref *::after { box-sizing: border-box; }
|
|
54
|
+
.wildo-api-ref a { color: var(--wr-accent-ink); }
|
|
55
|
+
.wildo-api-ref :is(a, button, input, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--wr-accent); outline-offset: 2px; }
|
|
56
|
+
.wildo-api-ref [id] { scroll-margin-top: calc(var(--wr-top) + var(--wr-subbar) + 1rem); }
|
|
57
|
+
.wildo-api-ref h1, .wildo-api-ref h2, .wildo-api-ref h3, .wildo-api-ref h4, .wildo-api-ref h5, .wildo-api-ref h6 { color: var(--wr-ink); }
|
|
58
|
+
.wildo-api-ref code { border: 0; background: var(--wr-chip); color: var(--wr-ink); font-size: 0.85em; padding: 0.05rem 0.3rem; border-radius: 4px; }
|
|
59
|
+
.wildo-api-ref pre code { background: transparent; padding: 0; font-size: inherit; color: inherit; }
|
|
60
|
+
.wildo-api-ref :not(pre) > code { overflow-wrap: anywhere; }
|
|
61
|
+
.wildo-api-ref pre { max-width: 100%; overflow: auto; }
|
|
62
|
+
.wildo-api-ref details > summary { cursor: pointer; }
|
|
63
|
+
.wildo-api-ref table { display: table; width: 100%; border-collapse: collapse; margin: 0; font-size: 0.875rem; }
|
|
64
|
+
.wildo-api-ref tr, .wildo-api-ref tr:nth-child(2n) { border: 0; background: transparent; }
|
|
65
|
+
.wildo-api-ref th, .wildo-api-ref td { border: 0; border-bottom: 1px solid var(--wr-line-soft); padding: 0.6rem 0.9rem 0.6rem 0; text-align: left; vertical-align: top; background: transparent; }
|
|
66
|
+
.wildo-api-ref thead th { font-size: 0.75rem; font-weight: 600; color: var(--wr-muted); border-bottom-color: var(--wr-line); }
|
|
67
|
+
.wildo-api-ref__visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
|
|
68
|
+
.wildo-api-ref__table-scroll { max-width: 100%; overflow-x: auto; }
|
|
69
|
+
|
|
70
|
+
/* Shell ------------------------------------------------------------------------------------------ */
|
|
71
|
+
.wildo-api-ref__shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - var(--wr-top)); }
|
|
72
|
+
.wildo-api-ref__main { min-width: 0; }
|
|
73
|
+
.wildo-api-ref__subbar { position: sticky; top: var(--wr-top); z-index: 150; display: flex; align-items: center; gap: 0.5rem; height: 3.25rem; padding: 0 var(--wr-gutter) 0 0.5rem; background: var(--wr-subtle); border-bottom: 1px solid var(--wr-line-soft); }
|
|
74
|
+
.wildo-api-ref__subbar-title { flex: 1; min-width: 0; font-weight: 600; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
75
|
+
.wildo-api-ref__icon-button { width: 2.75rem; height: 2.75rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: transparent; color: var(--wr-ink); cursor: pointer; }
|
|
76
|
+
.wildo-api-ref__icon-button:hover { background: var(--wr-chip); }
|
|
77
|
+
.wildo-api-ref__backdrop { display: none; }
|
|
78
|
+
@media (min-width: 1280px) {
|
|
79
|
+
.wildo-api-ref__shell--with-rail { grid-template-columns: var(--wr-rail-width) minmax(0, 1fr); }
|
|
80
|
+
.wildo-api-ref__subbar { display: none; }
|
|
81
|
+
.wildo-api-ref__rail { position: sticky; top: var(--wr-top); height: calc(100vh - var(--wr-top)); overflow-y: auto; }
|
|
82
|
+
}
|
|
83
|
+
@media (max-width: 1279.98px) {
|
|
84
|
+
/* Only a page with a rail has a sub-bar, so only it offsets sticky elements and anchors by one. */
|
|
85
|
+
.wildo-api-ref__shell--with-rail { --wr-subbar: 3.25rem; }
|
|
86
|
+
.wildo-api-ref__rail { position: fixed; z-index: 400; top: 0; bottom: 0; left: 0; width: min(21rem, 88vw); overflow-y: auto; transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s; box-shadow: 8px 0 32px rgba(15, 18, 23, 0.18); }
|
|
87
|
+
.wildo-api-ref--rail-open .wildo-api-ref__rail { transform: none; visibility: visible; transition: transform 0.2s ease; }
|
|
88
|
+
.wildo-api-ref--rail-open .wildo-api-ref__backdrop { display: block; position: fixed; inset: 0; z-index: 399; border: 0; padding: 0; background: rgba(15, 18, 23, 0.45); cursor: default; }
|
|
89
|
+
}
|
|
90
|
+
@media (prefers-reduced-motion: reduce) { .wildo-api-ref__rail { transition: none !important; } }
|
|
91
|
+
|
|
92
|
+
/* Rail ------------------------------------------------------------------------------------------- */
|
|
93
|
+
.wildo-api-ref__rail { background: var(--wr-rail); border-right: 1px solid var(--wr-line); padding: 1.1rem 0.85rem 2rem; display: flex; flex-direction: column; gap: 1.1rem; font-size: 0.875rem; }
|
|
94
|
+
.wildo-api-ref__rail-head { display: flex; align-items: center; gap: 0.5rem; margin: -0.5rem -0.35rem 0 0.25rem; }
|
|
95
|
+
@media (min-width: 1280px) { .wildo-api-ref__rail-head { display: none; } }
|
|
96
|
+
.wildo-api-ref__rail-head strong { flex: 1; font-size: 0.9375rem; }
|
|
97
|
+
.wildo-api-ref__sections { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 3px; background: var(--wr-chip); border-radius: 9px; }
|
|
98
|
+
.wildo-api-ref__sections a { text-align: center; padding: 0.35rem 0.5rem; border-radius: 7px; color: var(--wr-text); font-size: 0.8rem; font-weight: 500; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
99
|
+
.wildo-api-ref__sections a[aria-current='page'] { background: var(--wr-bg); color: var(--wr-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(21, 23, 28, 0.08); }
|
|
100
|
+
.wildo-api-ref__label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--wr-text); margin-bottom: 0.35rem; }
|
|
101
|
+
.wildo-api-ref__input { width: 100%; height: 2.25rem; border: 1px solid var(--wr-control); border-radius: 8px; padding: 0 0.7rem; font: inherit; font-size: 0.875rem; background: var(--wr-bg); color: var(--wr-ink); }
|
|
102
|
+
.wildo-api-ref__rail-group-title { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wr-muted); padding: 0 0.5rem 0.35rem; }
|
|
103
|
+
.wildo-api-ref__rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
|
|
104
|
+
.wildo-api-ref__rail-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem; border-radius: 6px; color: var(--wr-text) !important; text-decoration: none !important; line-height: 1.35; }
|
|
105
|
+
.wildo-api-ref__rail-link:hover { background: var(--wr-chip); color: var(--wr-ink) !important; }
|
|
106
|
+
.wildo-api-ref__rail-link[aria-current='page'] { color: var(--wr-ink) !important; font-weight: 600; background: var(--wr-bg); box-shadow: inset 0 0 0 1px var(--wr-line); }
|
|
107
|
+
.wildo-api-ref__rail-link[aria-current='location'] { background: var(--wr-accent-soft); color: var(--wr-ink) !important; font-weight: 600; }
|
|
108
|
+
.wildo-api-ref__rail-count { margin-left: auto; font-family: var(--wr-mono); font-size: 0.6875rem; color: var(--wr-muted); }
|
|
109
|
+
.wildo-api-ref__rail-families { list-style: none; margin: 0.15rem 0 0.35rem 0.35rem; padding: 0 0 0 0.35rem; border-left: 1px solid var(--wr-line); display: flex; flex-direction: column; gap: 1px; }
|
|
110
|
+
.wildo-api-ref__rail-families .wildo-api-ref__rail-link { font-size: 0.8125rem; padding: 0.3rem 0.4rem; }
|
|
111
|
+
.wildo-api-ref__rail-categories { display: flex; flex-direction: column; border-top: 1px solid var(--wr-line); padding-top: 0.5rem; }
|
|
112
|
+
.wildo-api-ref__rail-category > summary { list-style: none; display: flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.5rem; border-radius: 6px; color: var(--wr-text); font-weight: 500; }
|
|
113
|
+
.wildo-api-ref__rail-category > summary::-webkit-details-marker { display: none; }
|
|
114
|
+
.wildo-api-ref__rail-category > summary:hover { background: var(--wr-chip); }
|
|
115
|
+
.wildo-api-ref__rail-category > summary::before { content: ''; width: 0.4rem; height: 0.4rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s ease; flex-shrink: 0; margin-right: 0.15rem; }
|
|
116
|
+
.wildo-api-ref__rail-category[open] > summary::before { transform: rotate(45deg); }
|
|
117
|
+
.wildo-api-ref__rail-category > .wildo-api-ref__rail-list { padding: 0.1rem 0 0.4rem 0.9rem; }
|
|
118
|
+
.wildo-api-ref__rail-empty { color: var(--wr-muted); padding: 0 0.5rem; margin: 0; }
|
|
119
|
+
|
|
120
|
+
/* Operation switcher (sub-bar popover) ------------------------------------------------------------ */
|
|
121
|
+
.wildo-api-ref__switcher { position: relative; flex-shrink: 0; }
|
|
122
|
+
.wildo-api-ref__switcher-panel { position: absolute; right: 0; top: calc(100% + 0.4rem); width: min(24rem, calc(100vw - 1.5rem)); max-height: min(34rem, calc(100vh - var(--wr-top) - 5rem)); display: flex; flex-direction: column; background: var(--wr-bg); border: 1px solid var(--wr-line); border-radius: 14px; box-shadow: 0 18px 48px rgba(15, 18, 23, 0.22); overflow: hidden; z-index: 160; }
|
|
123
|
+
.wildo-api-ref__switcher-filter { padding: 0.75rem; border-bottom: 1px solid var(--wr-line-soft); }
|
|
124
|
+
.wildo-api-ref__switcher-list { list-style: none; margin: 0; padding: 0.35rem; overflow-y: auto; }
|
|
125
|
+
.wildo-api-ref__switcher-list .wildo-api-ref__rail-link { min-height: 2.5rem; font-size: 0.875rem; }
|
|
126
|
+
|
|
127
|
+
/* Buttons and chips ------------------------------------------------------------------------------- */
|
|
128
|
+
.wildo-api-ref__button { display: inline-flex; align-items: center; gap: 0.4rem; height: 2rem; padding: 0 0.7rem; border: 1px solid var(--wr-control); border-radius: 8px; background: var(--wr-bg); color: var(--wr-text); font: inherit; font-size: 0.8rem; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
|
|
129
|
+
.wildo-api-ref__button:hover { border-color: var(--wr-muted); color: var(--wr-ink); }
|
|
130
|
+
.wildo-api-ref__chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.35rem 0; padding: 0; list-style: none; }
|
|
131
|
+
.wildo-api-ref__chip { font-family: var(--wr-mono); font-size: 0.75rem !important; padding: 0.1rem 0.45rem !important; border-radius: 5px; background: var(--wr-chip); color: var(--wr-ink); }
|
|
132
|
+
.wildo-api-ref__chip--outline { background: transparent !important; box-shadow: inset 0 0 0 1px var(--wr-line); color: var(--wr-text) !important; }
|
|
133
|
+
.wildo-api-ref__method { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 3.6rem; font-family: var(--wr-mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1; padding: 0.35rem 0.4rem; border-radius: 5px; color: #3d434f; background: #ebebe5; }
|
|
134
|
+
.wildo-api-ref__method--small { min-width: 3.25rem; font-size: 0.625rem; padding: 0.22rem 0.3rem; }
|
|
135
|
+
.wildo-api-ref__method--get { color: #1747a6; background: #e6eefd; }
|
|
136
|
+
.wildo-api-ref__method--post { color: #146c43; background: #e1f3e8; }
|
|
137
|
+
.wildo-api-ref__method--put { color: #8f4308; background: #fceedd; }
|
|
138
|
+
.wildo-api-ref__method--patch { color: #5b35b3; background: #efe9fd; }
|
|
139
|
+
.wildo-api-ref__method--delete { color: #a8231a; background: #fce8e6; }
|
|
140
|
+
[data-theme='dark'] .wildo-api-ref__method { color: #c3c8d2; background: #2a2f38; }
|
|
141
|
+
[data-theme='dark'] .wildo-api-ref__method--get { color: #a9c4ff; background: rgba(59, 110, 246, 0.2); }
|
|
142
|
+
[data-theme='dark'] .wildo-api-ref__method--post { color: #86dcaa; background: rgba(34, 160, 90, 0.2); }
|
|
143
|
+
[data-theme='dark'] .wildo-api-ref__method--put { color: #f5bf86; background: rgba(234, 140, 40, 0.2); }
|
|
144
|
+
[data-theme='dark'] .wildo-api-ref__method--patch { color: #cbb8ff; background: rgba(140, 100, 240, 0.22); }
|
|
145
|
+
[data-theme='dark'] .wildo-api-ref__method--delete { color: #ffa39a; background: rgba(220, 60, 50, 0.22); }
|
|
146
|
+
.wildo-api-ref__status-dot { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 99px; background: var(--wr-muted); flex-shrink: 0; }
|
|
147
|
+
.wildo-api-ref__status-dot--success { background: var(--wr-ok); }
|
|
148
|
+
.wildo-api-ref__status-dot--client-error { background: var(--wr-warn); }
|
|
149
|
+
.wildo-api-ref__status-dot--server-error { background: var(--wr-fail); }
|
|
150
|
+
|
|
151
|
+
/* Pages ------------------------------------------------------------------------------------------- */
|
|
152
|
+
.wildo-api-ref__page { padding: 2.25rem var(--wr-gutter) 3rem; max-width: 76rem; }
|
|
153
|
+
.wildo-api-ref__intro { padding: 2.25rem var(--wr-gutter) 1.75rem; max-width: 60rem; }
|
|
154
|
+
.wildo-api-ref__eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wr-muted); margin: 0 0 0.5rem; }
|
|
155
|
+
.wildo-api-ref__title { font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.75rem; }
|
|
156
|
+
.wildo-api-ref__lead { font-size: 1rem; line-height: 1.6; color: var(--wr-text); max-width: 46rem; }
|
|
157
|
+
.wildo-api-ref__breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; list-style: none; margin: 0 0 0.9rem; padding: 0; font-size: 0.8125rem; color: var(--wr-muted); }
|
|
158
|
+
.wildo-api-ref__breadcrumb li + li::before { content: '/'; margin-right: 0.5rem; color: var(--wr-control); }
|
|
159
|
+
.wildo-api-ref__breadcrumb a { color: var(--wr-muted); }
|
|
160
|
+
.wildo-api-ref__stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
|
|
161
|
+
.wildo-api-ref__stats li { font-size: 0.8125rem; color: var(--wr-text); padding: 0.2rem 0.65rem; border: 1px solid var(--wr-line); border-radius: 999px; }
|
|
162
|
+
.wildo-api-ref__panel { border: 1px solid var(--wr-line); border-radius: 12px; padding: 1.1rem 1.25rem; margin: 0 0 1.5rem; background: var(--wr-bg); }
|
|
163
|
+
.wildo-api-ref__panel > :first-child { margin-top: 0; }
|
|
164
|
+
.wildo-api-ref__panel > :last-child { margin-bottom: 0; }
|
|
165
|
+
.wildo-api-ref__panel h2 { font-size: 1.05rem; }
|
|
166
|
+
.wildo-api-ref__panel h3 { font-size: 0.9rem; margin: 1rem 0 0.35rem; }
|
|
167
|
+
.wildo-api-ref__disclosure { border: 1px solid var(--wr-line); border-radius: 12px; margin: 0 0 1.25rem; }
|
|
168
|
+
.wildo-api-ref__disclosure > summary { padding: 0.8rem 1.1rem; font-weight: 600; }
|
|
169
|
+
.wildo-api-ref__disclosure > summary > h2, .wildo-api-ref__disclosure > summary > h3 { display: inline; font-size: inherit; margin: 0; }
|
|
170
|
+
.wildo-api-ref__disclosure > div, .wildo-api-ref__disclosure > ul, .wildo-api-ref__disclosure > section, .wildo-api-ref__disclosure > p { padding: 0 1.1rem 1rem; margin: 0; }
|
|
171
|
+
.wildo-api-ref__search { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; margin: 1.5rem 0 0.25rem; max-width: 34rem; }
|
|
172
|
+
.wildo-api-ref__search > div { flex: 1; min-width: 14rem; }
|
|
173
|
+
.wildo-api-ref__search-status { min-height: 1.4rem; margin: 0 0 1rem; font-size: 0.8125rem; color: var(--wr-muted); }
|
|
174
|
+
.wildo-api-ref__category { margin: 2rem 0 0; }
|
|
175
|
+
.wildo-api-ref__category > h2 { font-size: 1.15rem; margin: 0 0 0.25rem; }
|
|
176
|
+
.wildo-api-ref__category > p { color: var(--wr-text); margin: 0 0 0.75rem; }
|
|
177
|
+
.wildo-api-ref__resource-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); list-style: none; margin: 0.75rem 0 0; padding: 0; }
|
|
178
|
+
.wildo-api-ref__resource-card { position: relative; display: flex; flex-direction: column; gap: 0.35rem; border: 1px solid var(--wr-line); border-radius: 12px; padding: 0.95rem 1.1rem; background: var(--wr-bg); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
|
|
179
|
+
.wildo-api-ref__resource-card:hover { border-color: var(--wr-accent); box-shadow: 0 4px 16px rgba(21, 23, 28, 0.07); }
|
|
180
|
+
.wildo-api-ref__resource-card a { color: var(--wr-ink); font-weight: 600; text-decoration: none; }
|
|
181
|
+
.wildo-api-ref__resource-card a::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }
|
|
182
|
+
.wildo-api-ref__resource-card p { margin: 0; font-size: 0.8125rem; color: var(--wr-text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
|
|
183
|
+
.wildo-api-ref__resource-card .wildo-api-ref__card-meta { margin-top: auto; padding-top: 0.25rem; font-size: 0.75rem; color: var(--wr-muted); -webkit-line-clamp: 1; }
|
|
184
|
+
|
|
185
|
+
/* Operations -------------------------------------------------------------------------------------- */
|
|
186
|
+
.wildo-api-ref__operations { border-top: 1px solid var(--wr-line); background: linear-gradient(to right, var(--wr-bg) calc(100% - var(--wr-code-width)), var(--wr-code-bg) 0); }
|
|
187
|
+
.wildo-api-ref__operation { display: grid; grid-template-columns: minmax(0, 1fr) var(--wr-code-width); }
|
|
188
|
+
.wildo-api-ref__operation-doc { min-width: 0; padding: 2.25rem var(--wr-gutter) 2.75rem; }
|
|
189
|
+
.wildo-api-ref__operation-code { min-width: 0; padding: 2rem 1.25rem 2.5rem; }
|
|
190
|
+
.wildo-api-ref__family + .wildo-api-ref__family .wildo-api-ref__operation-doc { border-top: 1px solid var(--wr-line); }
|
|
191
|
+
.wildo-api-ref__family + .wildo-api-ref__family .wildo-api-ref__operation-code { border-top: 1px solid var(--wr-code-line); }
|
|
192
|
+
.wildo-api-ref__samples { position: sticky; top: calc(var(--wr-top) + var(--wr-subbar) + 1rem); max-height: calc(100vh - var(--wr-top) - var(--wr-subbar) - 2rem); overflow: auto; }
|
|
193
|
+
.wildo-api-ref__sheet-open { display: none !important; }
|
|
194
|
+
@media (max-width: 959.98px) {
|
|
195
|
+
.wildo-api-ref__operations { background: none; }
|
|
196
|
+
.wildo-api-ref__operation { grid-template-columns: minmax(0, 1fr); }
|
|
197
|
+
.wildo-api-ref__operation-code { display: none; }
|
|
198
|
+
.wildo-api-ref__sheet-open { display: inline-flex !important; }
|
|
199
|
+
}
|
|
200
|
+
.wildo-api-ref__family-title { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wr-muted); margin: 0 0 0.6rem; }
|
|
201
|
+
.wildo-api-ref__operation-title { font-size: clamp(1.35rem, 2.2vw, 1.65rem); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.9rem; }
|
|
202
|
+
.wildo-api-ref__segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--wr-chip); border-radius: 9px; margin: 0 0 1.1rem; max-width: 100%; }
|
|
203
|
+
.wildo-api-ref__segment { display: inline-flex; align-items: center; gap: 0.4rem; border: 0; background: transparent; border-radius: 7px; padding: 0.3rem 0.6rem; font: inherit; font-size: 0.8125rem; color: var(--wr-text); cursor: pointer; text-align: left; }
|
|
204
|
+
.wildo-api-ref__segment[aria-selected='true'] { background: var(--wr-bg); color: var(--wr-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(21, 23, 28, 0.1); }
|
|
205
|
+
.wildo-api-ref__endpoint { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.45rem 0.4rem 0.55rem; background: var(--wr-rail); border: 1px solid var(--wr-line); border-radius: 10px; margin: 0 0 1rem; }
|
|
206
|
+
.wildo-api-ref__path { flex: 1; min-width: 0; font-family: var(--wr-mono); font-size: 0.85rem !important; background: none !important; padding: 0 !important; overflow-wrap: anywhere; color: var(--wr-ink); }
|
|
207
|
+
.wildo-api-ref__path-param { color: var(--wr-accent-ink); }
|
|
208
|
+
.wildo-api-ref__facts { display: flex; flex-wrap: wrap; gap: 1px; margin: 1.1rem 0; background: var(--wr-line); border: 1px solid var(--wr-line); border-radius: 10px; overflow: hidden; }
|
|
209
|
+
.wildo-api-ref__fact { flex: 1 1 11rem; background: var(--wr-bg); padding: 0.6rem 0.85rem; min-width: 0; }
|
|
210
|
+
.wildo-api-ref__fact dt { font-size: 0.75rem; font-weight: 400; color: var(--wr-muted); margin: 0; }
|
|
211
|
+
.wildo-api-ref__fact dd { margin: 0.2rem 0 0; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; }
|
|
212
|
+
.wildo-api-ref__note { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.75rem 0.9rem; margin: 0 0 1rem; background: var(--wr-accent-soft); border-radius: 10px; font-size: 0.875rem; color: var(--wr-ink); }
|
|
213
|
+
.wildo-api-ref__note ul { margin: 0; padding-left: 1.1rem; }
|
|
214
|
+
.wildo-api-ref__inline-disclosure > summary { font-size: 0.8125rem; font-weight: 500; color: var(--wr-text); margin: 0 0 0.5rem; }
|
|
215
|
+
.wildo-api-ref__subheading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; font-size: 1.05rem; font-weight: 600; margin: 2rem 0 0.6rem; }
|
|
216
|
+
.wildo-api-ref__subheading-meta { font-family: var(--wr-mono); font-size: 0.75rem; font-weight: 400; color: var(--wr-muted); }
|
|
217
|
+
.wildo-api-ref__sheet-open { margin: 0.5rem 0 0; width: 100%; justify-content: center; height: 2.75rem; border: 0; background: var(--wr-code-bg); color: #ffffff; font-size: 0.9rem; font-weight: 600; border-radius: 12px; }
|
|
218
|
+
.wildo-api-ref__sheet-open:hover { color: #ffffff; }
|
|
219
|
+
|
|
220
|
+
/* Fields ------------------------------------------------------------------------------------------ */
|
|
221
|
+
.wildo-api-ref__fields { list-style: none; margin: 0; padding: 0; }
|
|
222
|
+
.wildo-api-ref__field { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 0.35rem 1.25rem; padding: 0.8rem 0; border-top: 1px solid var(--wr-line-soft); }
|
|
223
|
+
.wildo-api-ref__fields > .wildo-api-ref__field:first-child { border-top-color: var(--wr-line); }
|
|
224
|
+
.wildo-api-ref__field-head { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
|
|
225
|
+
.wildo-api-ref__field-name { font-family: var(--wr-mono); font-size: 0.875rem !important; font-weight: 600; background: none !important; padding: 0 !important; overflow-wrap: anywhere; }
|
|
226
|
+
.wildo-api-ref__field-meta { font-size: 0.75rem; color: var(--wr-muted); }
|
|
227
|
+
.wildo-api-ref__field-meta code { background: none; padding: 0; font-size: 0.75rem; color: var(--wr-muted); }
|
|
228
|
+
.wildo-api-ref__required { color: var(--wr-required); font-weight: 600; }
|
|
229
|
+
.wildo-api-ref__field-body { min-width: 0; font-size: 0.875rem; color: var(--wr-text); }
|
|
230
|
+
.wildo-api-ref__field-body > :first-child { margin-top: 0; }
|
|
231
|
+
.wildo-api-ref__field-body p { margin: 0 0 0.4rem; }
|
|
232
|
+
.wildo-api-ref__field-body > :last-child { margin-bottom: 0; }
|
|
233
|
+
.wildo-api-ref__children > summary { display: inline-flex; align-items: center; gap: 0.35rem; height: 1.75rem; padding: 0 0.7rem; margin: 0.25rem 0; border: 1px solid var(--wr-control); border-radius: 999px; font-size: 0.75rem; color: var(--wr-text); list-style: none; }
|
|
234
|
+
.wildo-api-ref__children > summary::-webkit-details-marker { display: none; }
|
|
235
|
+
.wildo-api-ref__children > summary::before { content: '+'; font-weight: 600; }
|
|
236
|
+
.wildo-api-ref__children[open] > summary::before { content: '−'; }
|
|
237
|
+
.wildo-api-ref__children > .wildo-api-ref__nested { margin-top: 0.35rem; padding-left: 0.9rem; border-left: 2px solid var(--wr-line); }
|
|
238
|
+
.wildo-api-ref__nested .wildo-api-ref__field { grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); padding: 0.6rem 0; }
|
|
239
|
+
.wildo-api-ref__nested-label { font-size: 0.75rem; font-weight: 600; color: var(--wr-muted); margin: 0.5rem 0 0.25rem; }
|
|
240
|
+
.wildo-api-ref__more { width: 100%; height: 2.5rem; margin-top: 0.25rem; border: 1px dashed var(--wr-control); border-radius: 9px; background: var(--wr-subtle); color: var(--wr-text); font: inherit; font-size: 0.8125rem; cursor: pointer; }
|
|
241
|
+
.wildo-api-ref__enum { list-style: none; margin: 0.35rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
|
|
242
|
+
@media (max-width: 640px) {
|
|
243
|
+
.wildo-api-ref__field, .wildo-api-ref__nested .wildo-api-ref__field { grid-template-columns: minmax(0, 1fr); }
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* Responses --------------------------------------------------------------------------------------- */
|
|
247
|
+
.wildo-api-ref__status-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.75rem; }
|
|
248
|
+
.wildo-api-ref__status-tab { display: inline-flex; align-items: center; gap: 0.45rem; height: 2rem; padding: 0 0.8rem; border: 1px solid var(--wr-control); border-radius: 999px; background: var(--wr-bg); color: var(--wr-text); font: inherit; font-size: 0.8125rem; font-family: var(--wr-mono); cursor: pointer; }
|
|
249
|
+
.wildo-api-ref__status-tab[aria-selected='true'] { background: var(--wr-ink); border-color: var(--wr-ink); color: var(--wr-bg); }
|
|
250
|
+
.wildo-api-ref__response { border: 1px solid var(--wr-line); border-radius: 10px; padding: 0.85rem 1rem; }
|
|
251
|
+
.wildo-api-ref__response > p:first-child { margin: 0 0 0.5rem; }
|
|
252
|
+
.wildo-api-ref__representations { list-style: none; margin: 0; padding: 0; }
|
|
253
|
+
.wildo-api-ref__representations > li + li { margin-top: 0.75rem; }
|
|
254
|
+
.wildo-api-ref__media { font-family: var(--wr-mono); font-size: 0.75rem; color: var(--wr-muted); }
|
|
255
|
+
|
|
256
|
+
/* Code panel -------------------------------------------------------------------------------------- */
|
|
257
|
+
.wildo-api-ref__samples { display: flex; flex-direction: column; gap: 1rem; color: var(--wr-code-text); }
|
|
258
|
+
.wildo-api-ref__code-card { border: 1px solid var(--wr-code-line); border-radius: 12px; background: var(--wr-code-card); overflow: hidden; }
|
|
259
|
+
.wildo-api-ref__code-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; padding: 0.4rem 0.5rem 0.4rem 0.75rem; border-bottom: 1px solid var(--wr-code-line); }
|
|
260
|
+
.wildo-api-ref__code-title { font-size: 0.75rem; font-weight: 600; color: var(--wr-code-text); margin-right: 0.35rem; }
|
|
261
|
+
.wildo-api-ref__code-tabs { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
|
|
262
|
+
.wildo-api-ref__code-tab { display: inline-flex; align-items: center; gap: 0.35rem; border: 0; background: transparent; color: var(--wr-code-muted); border-radius: 6px; padding: 0.3rem 0.55rem; font: inherit; font-size: 0.75rem; cursor: pointer; }
|
|
263
|
+
.wildo-api-ref__code-tab:hover { color: var(--wr-code-text); }
|
|
264
|
+
.wildo-api-ref__code-tab[aria-selected='true'] { background: var(--wr-code-selected); color: #ffffff; }
|
|
265
|
+
.wildo-api-ref__code-server { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--wr-code-line); font-size: 0.75rem; color: var(--wr-code-muted); }
|
|
266
|
+
.wildo-api-ref__code-server select { border: 1px solid #2e3440; border-radius: 6px; background: var(--wr-code-control); color: var(--wr-code-text); font: inherit; font-size: 0.75rem; padding: 0.15rem 0.4rem; max-width: 100%; }
|
|
267
|
+
.wildo-api-ref__code-server code { background: none; color: var(--wr-code-text); padding: 0; overflow-wrap: anywhere; }
|
|
268
|
+
.wildo-api-ref__code-card pre { margin: 0; padding: 0.9rem 1rem; background: transparent; color: var(--wr-code-text); font-family: var(--wr-mono); font-size: 0.78rem; line-height: 1.7; max-height: 28rem; overflow: auto; border-radius: 0; white-space: pre; }
|
|
269
|
+
.wildo-api-ref__code-caption { margin: 0; padding: 0.5rem 0.9rem 0; font-size: 0.75rem; color: var(--wr-code-muted); }
|
|
270
|
+
.wildo-api-ref__code-empty { margin: 0; padding: 0.9rem 1rem; font-size: 0.8rem; color: var(--wr-code-muted); }
|
|
271
|
+
.wildo-api-ref__copy { display: inline-flex; align-items: center; gap: 0.35rem; height: 1.85rem; padding: 0 0.6rem; border: 1px solid var(--wr-control); border-radius: 7px; background: var(--wr-bg); color: var(--wr-text); font: inherit; font-size: 0.75rem; cursor: pointer; flex-shrink: 0; }
|
|
272
|
+
.wildo-api-ref__copy:hover { color: var(--wr-ink); border-color: var(--wr-muted); }
|
|
273
|
+
.wildo-api-ref__code-card .wildo-api-ref__copy { border-color: transparent; background: transparent; color: var(--wr-code-muted); }
|
|
274
|
+
.wildo-api-ref__code-card .wildo-api-ref__copy:hover { color: #ffffff; background: var(--wr-code-selected); }
|
|
275
|
+
.wildo-api-ref__tok--key { color: #8cc4ff; }
|
|
276
|
+
.wildo-api-ref__tok--string { color: #b7e3a3; }
|
|
277
|
+
.wildo-api-ref__tok--number, .wildo-api-ref__tok--literal { color: #f4c27a; }
|
|
278
|
+
.wildo-api-ref__tok--keyword { color: #c7a6ff; }
|
|
279
|
+
|
|
280
|
+
/* Bottom sheet (phones) --------------------------------------------------------------------------- */
|
|
281
|
+
.wildo-api-ref__sheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 88vh; border: 0; border-radius: 18px 18px 0 0; background: var(--wr-code-bg); color: var(--wr-code-text); padding: 0.5rem 0.75rem 1.5rem; overflow: auto; }
|
|
282
|
+
.wildo-api-ref__sheet::backdrop { background: rgba(15, 18, 23, 0.45); }
|
|
283
|
+
.wildo-api-ref__sheet-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0 0.75rem 0.25rem; }
|
|
284
|
+
.wildo-api-ref__sheet-head strong { flex: 1; font-size: 0.9rem; color: #ffffff; }
|
|
285
|
+
.wildo-api-ref__sheet .wildo-api-ref__icon-button { color: var(--wr-code-text); }
|
|
286
|
+
.wildo-api-ref__sheet .wildo-api-ref__icon-button:hover { background: var(--wr-code-selected); }
|
|
287
|
+
|
|
288
|
+
/* Data models ------------------------------------------------------------------------------------- */
|
|
289
|
+
.wildo-api-ref__models { padding: 1.5rem var(--wr-gutter) 3rem; border-top: 1px solid var(--wr-line); }
|
|
290
|
+
.wildo-api-ref__models .wildo-api-ref__disclosure { max-width: 60rem; }
|
|
291
|
+
`;
|
|
292
|
+
//# sourceMappingURL=openapi-reference-styles.js.map
|