@clarify-labs/renderer 0.2.0 → 0.5.0
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/output/AppShell-D3FsVHQK.js +390 -0
- package/output/AppShell-D3FsVHQK.js.map +1 -0
- package/output/AppShell-DeaJ-rgo.cjs +409 -0
- package/output/AppShell-DeaJ-rgo.cjs.map +1 -0
- package/output/OpenApiOperation-DYXG-6Rw.js +1772 -0
- package/output/OpenApiOperation-DYXG-6Rw.js.map +1 -0
- package/output/OpenApiOperation-mhoi-s4N.cjs +1840 -0
- package/output/OpenApiOperation-mhoi-s4N.cjs.map +1 -0
- package/output/app/PageNavigation.d.ts +7 -0
- package/output/app/PageSkeleton.d.ts +1 -0
- package/output/{components → app}/SectionProvider.d.ts +3 -2
- package/output/chunk-DakpK96I.cjs +43 -0
- package/output/client.cjs +1 -1
- package/output/client.js +1 -1
- package/output/components/Button.d.ts +18 -0
- package/output/components/Code.d.ts +11 -7
- package/output/components/Collapse.d.ts +9 -0
- package/output/components/Heading.d.ts +10 -0
- package/output/components/Logo.d.ts +2 -0
- package/output/components/Prose.d.ts +7 -0
- package/output/components/Tag.d.ts +34 -0
- package/output/components/index.d.ts +9 -79
- package/output/components/patterns.d.ts +4 -2
- package/output/context.d.ts +1 -6
- package/output/core/context.d.ts +8 -0
- package/output/core/i18n.d.ts +5 -0
- package/output/core/index.d.ts +3 -0
- package/output/core/types.d.ts +174 -0
- package/output/i18n.d.ts +1 -0
- package/output/index.cjs +135 -766
- package/output/index.cjs.map +1 -1
- package/output/index.d.ts +15 -4
- package/output/index.js +108 -751
- package/output/index.js.map +1 -1
- package/output/markdown.cjs +3 -0
- package/output/markdown.d.ts +1 -0
- package/output/markdown.js +2 -0
- package/output/mdx/DocShell.d.ts +7 -0
- package/output/mdx/Markdown.d.ts +7 -0
- package/output/mdx/components.d.ts +7 -7
- package/output/mdx/primitives.d.ts +18 -12
- package/output/mdx/remark.d.ts +2 -0
- package/output/openapi/components/ExamplePanels.d.ts +36 -0
- package/output/openapi/components/OpenApiOperation.d.ts +33 -0
- package/output/openapi/components/SchemaProperties.d.ts +20 -0
- package/output/openapi/entry.d.ts +13 -0
- package/output/openapi/index.d.ts +3 -20
- package/output/openapi/lib/helpers.d.ts +25 -0
- package/output/openapi/lib/request-code.d.ts +18 -0
- package/output/openapi/lib/spec-path.d.ts +2 -0
- package/output/openapi/types.d.ts +70 -0
- package/output/preview/openapi.d.ts +28 -0
- package/output/preview.cjs +734 -0
- package/output/preview.cjs.map +1 -0
- package/output/preview.d.ts +19 -0
- package/output/preview.js +731 -0
- package/output/preview.js.map +1 -0
- package/output/remark-DNOdJz5i.cjs +14 -0
- package/output/remark-DNOdJz5i.cjs.map +1 -0
- package/output/remark-o5sg9Ilv.js +7 -0
- package/output/remark-o5sg9Ilv.js.map +1 -0
- package/output/{render-bPMMBoDH.js → render-BpavVnAe.js} +3 -2
- package/output/render-BpavVnAe.js.map +1 -0
- package/output/{render-z9rSQ00n.cjs → render-CjZt3edL.cjs} +6 -5
- package/output/render-CjZt3edL.cjs.map +1 -0
- package/output/renderer.css +1702 -591
- package/output/server.cjs +7 -5
- package/output/server.cjs.map +1 -1
- package/output/server.js +4 -2
- package/output/server.js.map +1 -1
- package/output/shell/ContentActions.d.ts +1 -0
- package/output/shell/Header.d.ts +4 -3
- package/output/shell/Navigation.d.ts +3 -2
- package/output/shell/Search.d.ts +6 -4
- package/output/{components → shell}/SiteLogo.d.ts +1 -1
- package/output/shell/icons.d.ts +5 -0
- package/output/shell/mobile.d.ts +5 -3
- package/output/{AppShell-Ci894P_0.js → shell-BlMMdTpZ.js} +1228 -867
- package/output/shell-BlMMdTpZ.js.map +1 -0
- package/output/{AppShell-4KB3lU-n.cjs → shell-_MyLsMUI.cjs} +1403 -1036
- package/output/shell-_MyLsMUI.cjs.map +1 -0
- package/output/{components → theme}/ThemeProvider.d.ts +3 -2
- package/output/types.d.ts +1 -121
- package/output/utils/clipboard.d.ts +1 -0
- package/output/utils/hash.d.ts +1 -0
- package/output/utils/href.d.ts +5 -0
- package/output/utils/lucide.d.ts +17 -0
- package/output/utils/path.d.ts +2 -0
- package/package.json +24 -10
- package/output/AppShell-4KB3lU-n.cjs.map +0 -1
- package/output/AppShell-Ci894P_0.js.map +0 -1
- package/output/render-bPMMBoDH.js.map +0 -1
- package/output/render-z9rSQ00n.cjs.map +0 -1
- /package/output/{components → app}/BuiltWithClarify.d.ts +0 -0
- /package/output/{components → app}/PageFooter.d.ts +0 -0
- /package/output/openapi/{utils.d.ts → lib/utils.d.ts} +0 -0
- /package/output/{components → theme}/ThemeToggle.d.ts +0 -0
package/output/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../source/mdx/primitives.tsx","../source/openapi/utils.ts","../source/openapi/index.tsx","../source/mdx/components.ts"],"sourcesContent":["import clsx from 'clsx'\nimport { createElement, type ComponentPropsWithoutRef, type ReactNode } from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { Button, Callout, Card, CardGroup, Heading, PageFooter, Prose } from '../components'\nimport { Code, CodeGroup, Pre } from '../components/Code'\n\nexport function wrapper(arg0: { children: ReactNode }) { const { children } = arg0\n\n return (\n <article className=\"clarify-mdx-page flex h-full flex-col pt-16 pb-10\">\n <Prose className=\"flex-auto\">{children}</Prose>\n <PageFooter />\n </article>\n )\n}\n\nexport function a(arg0: ComponentPropsWithoutRef<'a'>) { const { href = '', ...props } = arg0\n\n if (href.startsWith('/') && !href.startsWith('//')) {\n return <Link to={href} {...props} />\n }\n\n return <a href={href} {...props} />\n}\n\nexport const code = Code\nexport const pre = Pre\nexport { Button, Callout, Card, CardGroup, CodeGroup }\n\nexport function h2(props: Omit<ComponentPropsWithoutRef<typeof Heading>, 'level'>) {\n return createElement(Heading, { level: 2, ...props })\n}\n\nexport function h3(props: Omit<ComponentPropsWithoutRef<typeof Heading>, 'level'>) {\n return createElement(Heading, { level: 3, ...props })\n}\n\nfunction InfoIcon(props: ComponentPropsWithoutRef<'svg'>) {\n return (\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\" {...props}>\n <circle cx=\"8\" cy=\"8\" r=\"8\" strokeWidth=\"0\" />\n <path fill=\"none\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.5\" d=\"M6.75 7.75h1.5v3.5\" />\n <circle cx=\"8\" cy=\"4\" r=\".5\" fill=\"none\" />\n </svg>\n )\n}\n\nexport function Note(arg0: { children: ReactNode }) { const { children } = arg0\n\n return (\n <div className=\"clarify-note my-6 flex gap-2.5 rounded-2xl border border-emerald-500/20 bg-emerald-50/50 p-4 text-sm/6 text-emerald-900 dark:border-emerald-500/30 dark:bg-emerald-500/5 dark:text-emerald-200 dark:[--tw-prose-links-hover:var(--color-emerald-300)] dark:[--tw-prose-links:var(--color-white)]\">\n <InfoIcon className=\"mt-1 h-4 w-4 flex-none fill-emerald-500 stroke-white dark:fill-emerald-200/20 dark:stroke-emerald-200\" />\n <div className=\"*:first:mt-0 *:last:mb-0\">{children}</div>\n </div>\n )\n}\n\nexport function Row(arg0: { children: ReactNode }) { const { children } = arg0\n\n return <div className=\"clarify-row grid grid-cols-1 items-start gap-x-16 gap-y-10 xl:max-w-none xl:grid-cols-2\">{children}</div>\n}\n\nexport function Col(arg0: { children: ReactNode; sticky?: boolean }) { const { children, sticky = false } = arg0\n\n return <div className={clsx('clarify-col *:first:mt-0 *:last:mb-0', sticky && 'xl:sticky xl:top-24')}>{children}</div>\n}\n\nexport function Properties(arg0: { children: ReactNode }) { const { children } = arg0\n\n return (\n <div className=\"clarify-properties my-6\">\n <ul\n role=\"list\"\n className=\"m-0 list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5\"\n >\n {children}\n </ul>\n </div>\n )\n}\n\nexport function Property(arg0: { name: string; children: ReactNode; type?: string }) { const { name, children, type } = arg0\n\n return (\n <li className=\"clarify-property m-0 px-0 py-4 first:pt-0 last:pb-0\">\n <dl className=\"m-0 flex flex-wrap items-center gap-x-3 gap-y-2\">\n <dt className=\"sr-only\">Name</dt>\n <dd>\n <code>{name}</code>\n </dd>\n {type ? (\n <>\n <dt className=\"sr-only\">Type</dt>\n <dd className=\"font-mono text-xs text-zinc-400 dark:text-zinc-500\">{type}</dd>\n </>\n ) : null}\n <dt className=\"sr-only\">Description</dt>\n <dd className=\"w-full flex-none *:first:mt-0 *:last:mb-0\">{children}</dd>\n </dl>\n </li>\n )\n}\n","import type { OpenAPIV3, OpenAPIV3_1 } from 'openapi-types'\n\nexport type OpenAPISpec = OpenAPIV3.Document | OpenAPIV3_1.Document\nexport type OpenAPIOperation = OpenAPIV3.OperationObject | OpenAPIV3_1.OperationObject\n\nexport const OPENAPI_HTTP_METHODS = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'] as const\n\nexport type OpenAPIHttpMethod = typeof OPENAPI_HTTP_METHODS[number]\n\nexport function isOpenAPIHttpMethod(method: string): method is OpenAPIHttpMethod {\n return (OPENAPI_HTTP_METHODS as readonly string[]).includes(method.toLowerCase())\n}\n\nexport function getOpenApiOperation(spec: OpenAPISpec, path: string, method: string): OpenAPIOperation | undefined {\n if (!isOpenAPIHttpMethod(method)) return undefined\n return spec.paths?.[path]?.[method.toLowerCase() as OpenAPIHttpMethod]\n}\n\nexport function listOpenApiOperations(spec: OpenAPISpec): Array<{ path: string; method: OpenAPIHttpMethod; operation: OpenAPIOperation }> {\n const paths = spec.paths ?? {}\n const operations: Array<{ path: string; method: OpenAPIHttpMethod; operation: OpenAPIOperation }> = []\n\n for (const [path, pathItem] of Object.entries(paths)) {\n if (!pathItem) continue\n for (const method of OPENAPI_HTTP_METHODS) {\n const operation = pathItem[method]\n if (operation) operations.push({ path, method, operation })\n }\n }\n\n return operations\n}\n","import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/react'\nimport clsx from 'clsx'\nimport { slug } from 'github-slugger'\nimport { CheckIcon, ChevronsUpDownIcon } from 'lucide-react'\nimport { useRef, useState, type ReactNode } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nimport { Heading, PageFooter, Prose } from '../components'\nimport { useClarifyConfig, useOpenApis } from '../context'\nimport { Col, Properties, Property, Row } from '../mdx/primitives'\n\nimport { getOpenApiOperation, listOpenApiOperations } from './utils'\nimport type { OpenAPIOperation, OpenAPISpec } from './utils'\n\nexport type { OpenAPIOperation, OpenAPISpec } from './utils'\n\nexport type OpenApiPageProps = {\n spec?: OpenAPISpec\n specPath?: string\n}\n\nexport type ApiEndpointProps = {\n spec: OpenAPISpec\n path: string\n method: string\n}\n\nexport type OpenApiEndpointProps = {\n specPath: string\n path: string\n method: string\n}\n\ntype OpenApiRecord = Record<string, unknown>\n\ntype OpenApiParameter = {\n name?: string\n in?: string\n required?: boolean\n description?: string\n schema?: unknown\n}\n\ntype OpenApiMediaType = {\n schema?: unknown\n example?: unknown\n examples?: Record<string, unknown>\n}\n\ntype OpenApiResponse = {\n description?: string\n content?: Record<string, OpenApiMediaType>\n}\n\ntype MediaTypeEntry = {\n mediaType: string\n value: OpenApiMediaType\n}\n\ntype ExampleEntry = {\n key: string\n title: string\n summary?: string\n value: unknown\n generated?: boolean\n}\n\nconst VIRTUAL_PREFIX = 'virtual:clarify-page/'\n\nfunction isRecord(value: unknown): value is OpenApiRecord {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction isReference(value: unknown): value is { $ref: string } {\n return isRecord(value) && typeof value.$ref === 'string'\n}\n\nfunction resolveReferenceName(ref: string): string {\n return ref.split('/').filter(Boolean).at(-1) ?? ref\n}\n\nfunction getPathItem(spec: OpenAPISpec, path: string): OpenApiRecord | undefined {\n const pathItem = spec.paths?.[path]\n return isRecord(pathItem) ? pathItem : undefined\n}\n\nfunction getOperationParameters(spec: OpenAPISpec, path: string, operation: OpenAPIOperation): OpenApiParameter[] {\n const pathParameters = getPathItem(spec, path)?.parameters\n const operationParameters = (operation as OpenApiRecord).parameters\n\n return [...(Array.isArray(pathParameters) ? pathParameters : []), ...(Array.isArray(operationParameters) ? operationParameters : [])]\n .filter((parameter): parameter is OpenApiParameter => isRecord(parameter) && !isReference(parameter))\n}\n\nfunction getRequestBody(operation: OpenAPIOperation): OpenApiRecord | undefined {\n const requestBody = (operation as OpenApiRecord).requestBody\n return isRecord(requestBody) && !isReference(requestBody) ? requestBody : undefined\n}\n\nfunction getMediaTypeEntries(content: unknown): MediaTypeEntry[] {\n if (!isRecord(content)) return []\n\n return Object.entries(content)\n .filter(([, value]) => isRecord(value) && !isReference(value))\n .map(([mediaType, value]) => ({ mediaType, value: value as OpenApiMediaType }))\n .sort((a, z) => {\n const aJson = a.mediaType.includes('json') ? 0 : 1\n const zJson = z.mediaType.includes('json') ? 0 : 1\n return aJson - zJson\n })\n}\n\nfunction getJsonLikeContent(content: unknown): MediaTypeEntry | undefined {\n return getMediaTypeEntries(content)[0]\n}\n\nfunction getExampleValue(example: unknown): unknown {\n if (isRecord(example) && 'value' in example) return example.value\n if (isRecord(example) && 'externalValue' in example) return undefined\n return example\n}\n\nfunction getExampleTitle(key: string, example: unknown): { title: string; summary?: string } {\n if (isRecord(example)) {\n const summary = typeof example.summary === 'string' ? example.summary : undefined\n return { title: summary ?? key, summary }\n }\n\n return { title: key }\n}\n\nfunction getExampleEntries(mediaType?: OpenApiMediaType): ExampleEntry[] {\n if (!mediaType) return []\n\n if (isRecord(mediaType.examples)) {\n const examples: ExampleEntry[] = []\n\n for (const [key, example] of Object.entries(mediaType.examples)) {\n const value = getExampleValue(example)\n if (typeof value === 'undefined') continue\n\n const { title, summary } = getExampleTitle(key, example)\n examples.push({ key, title, summary, value })\n }\n\n if (examples.length > 0) return examples\n }\n\n if (typeof mediaType.example !== 'undefined') {\n return [{ key: 'default', title: 'Example', value: mediaType.example }]\n }\n\n const generated = schemaToExample(mediaType.schema)\n return typeof generated === 'undefined' ? [] : [{ key: 'schema', title: 'Schema example', value: generated, generated: true }]\n}\n\nfunction getContentExample(mediaType?: OpenApiMediaType): unknown {\n return getExampleEntries(mediaType)[0]?.value\n}\n\nfunction schemaToType(schema: unknown): string | undefined {\n if (!isRecord(schema)) return undefined\n if (isReference(schema)) return resolveReferenceName(schema.$ref)\n if (Array.isArray(schema.enum)) return schema.enum.map(String).join(' | ')\n\n const oneOf = schema.oneOf ?? schema.anyOf\n if (Array.isArray(oneOf)) {\n return oneOf.map(schemaToType).filter(Boolean).join(' | ')\n }\n\n if (schema.type === 'array') {\n return `${schemaToType(schema.items) ?? 'unknown'}[]`\n }\n\n return typeof schema.type === 'string' ? schema.type : undefined\n}\n\nfunction schemaToExample(schema: unknown, depth = 0): unknown {\n if (!isRecord(schema) || depth > 3) return undefined\n if (typeof schema.example !== 'undefined') return schema.example\n if (typeof schema.default !== 'undefined') return schema.default\n if (Array.isArray(schema.enum)) return schema.enum[0]\n if (isReference(schema)) return { id: resolveReferenceName(schema.$ref) }\n\n if (schema.type === 'array') {\n return [schemaToExample(schema.items, depth + 1) ?? 'string']\n }\n\n if (schema.type === 'object' || isRecord(schema.properties)) {\n const properties = isRecord(schema.properties) ? schema.properties : {}\n return Object.fromEntries(\n Object.entries(properties).slice(0, 8).map(([name, propertySchema]) => [\n name,\n schemaToExample(propertySchema, depth + 1) ?? exampleForType(schemaToType(propertySchema)),\n ]),\n )\n }\n\n return exampleForType(schemaToType(schema))\n}\n\nfunction exampleForType(type?: string): unknown {\n if (!type) return 'string'\n if (type.endsWith('[]')) return []\n if (type.includes('integer') || type.includes('number')) return 42\n if (type.includes('boolean')) return true\n if (type.includes('object')) return {}\n return 'string'\n}\n\nfunction stringifyExample(value: unknown): string {\n if (typeof value === 'undefined') return ''\n if (typeof value === 'string') return value\n return JSON.stringify(value, null, 2)\n}\n\nfunction shellQuote(value: string): string {\n return `'${value.replace(/'/g, `'\"'\"'`)}'`\n}\n\nfunction getServerUrl(spec: OpenAPISpec): string {\n const servers = (spec as OpenApiRecord).servers\n if (!Array.isArray(servers)) return ''\n\n const firstServer = servers.find(isRecord)\n return typeof firstServer?.url === 'string' ? firstServer.url : ''\n}\n\nfunction buildOperationUrl(spec: OpenAPISpec, path: string, parameters: OpenApiParameter[]): string {\n const query = parameters\n .filter((parameter) => parameter.in === 'query' && parameter.name)\n .map((parameter) => `${parameter.name}={${parameter.name}}`)\n .join('&')\n const serverUrl = getServerUrl(spec).replace(/\\/$/, '')\n return `${serverUrl}${path}${query ? `?${query}` : ''}`\n}\n\nfunction buildCurlExample(arg0: {\n spec: OpenAPISpec\n path: string\n method: string\n parameters: OpenApiParameter[]\n requestContent?: { mediaType: string; value: OpenApiMediaType }\n}): string { const {\n spec,\n path,\n method,\n parameters,\n requestContent,\n} = arg0\n\n const url = buildOperationUrl(spec, path, parameters)\n const lines = [`curl ${method === 'GET' ? '-G ' : ''}${shellQuote(url)}`]\n\n if (method !== 'GET') lines.push(` -X ${method}`)\n lines.push(\" -H 'Authorization: Bearer {token}'\")\n lines.push(\" -H 'Accept: application/json'\")\n\n const requestExample = getContentExample(requestContent?.value)\n if (requestContent && typeof requestExample !== 'undefined') {\n lines.push(` -H 'Content-Type: ${requestContent.mediaType}'`)\n lines.push(` -d ${shellQuote(stringifyExample(requestExample))}`)\n }\n\n return lines.join(' \\\\\\n')\n}\n\nfunction getResponseEntries(operation: OpenAPIOperation): Array<{ status: string; response: OpenApiResponse }> {\n const responses = (operation as OpenApiRecord).responses\n if (!isRecord(responses)) return []\n\n return Object.entries(responses)\n .filter(([, response]) => isRecord(response) && !isReference(response))\n .map(([status, response]) => ({ status, response: response as OpenApiResponse }))\n}\n\nfunction SchemaProperties(arg0: { title: string; schema: unknown }): ReactNode { const { title, schema } = arg0\n\n const targetSchema = isReference(schema) ? undefined : schema\n const properties = isRecord(targetSchema) && isRecord(targetSchema.properties) ? targetSchema.properties : undefined\n const required = isRecord(targetSchema) && Array.isArray(targetSchema.required) ? targetSchema.required.map(String) : []\n\n if (!properties || Object.keys(properties).length === 0) return null\n\n return (\n <div>\n <h3>{title}</h3>\n <Properties>\n {Object.entries(properties).map(([name, propertySchema]) => {\n const property = isRecord(propertySchema) ? propertySchema : {}\n const type = schemaToType(propertySchema)\n const description = typeof property.description === 'string' ? property.description : undefined\n const isRequired = required.includes(name)\n\n return (\n <Property key={name} name={name} type={isRequired && type ? `${type}, required` : type}>\n {description ?? (isRequired ? 'Required.' : 'Optional.')}\n </Property>\n )\n })}\n </Properties>\n </div>\n )\n}\n\nfunction ParameterList(arg0: { title: string; parameters: OpenApiParameter[] }): ReactNode { const { title, parameters } = arg0\n\n if (parameters.length === 0) return null\n\n return (\n <div>\n <h3>{title}</h3>\n <Properties>\n {parameters.map((parameter) => (\n <Property\n key={`${parameter.in}-${parameter.name}`}\n name={parameter.name ?? 'parameter'}\n type={[schemaToType(parameter.schema), parameter.required ? 'required' : undefined].filter(Boolean).join(', ') || undefined}\n >\n {parameter.description ?? `${parameter.in ?? 'Operation'} parameter.`}\n </Property>\n ))}\n </Properties>\n </div>\n )\n}\n\nfunction ResponseList(arg0: { operation: OpenAPIOperation }): ReactNode { const { operation } = arg0\n\n const responses = getResponseEntries(operation)\n if (responses.length === 0) return null\n\n return (\n <div>\n <h3>Responses</h3>\n <Properties>\n {responses.map(({ status, response }) => {\n const content = getJsonLikeContent(response.content)\n const type = schemaToType(content?.value.schema)\n\n return (\n <Property key={status} name={status} type={type}>\n {response.description ?? 'Response.'}\n </Property>\n )\n })}\n </Properties>\n </div>\n )\n}\n\nfunction codeLanguageForMediaType(mediaType?: string): string {\n if (!mediaType) return 'json'\n if (mediaType.includes('json')) return 'json'\n if (mediaType.includes('yaml') || mediaType.includes('yml')) return 'yaml'\n if (mediaType.startsWith('text/')) return 'text'\n if (mediaType.includes('xml')) return 'xml'\n return 'text'\n}\n\nfunction SelectControl(arg0: {\n label: string\n value: string\n options: string[]\n onChange: (value: string) => void\n}): ReactNode { const {\n label,\n value,\n options,\n onChange,\n} = arg0\n\n if (options.length <= 1) return null\n\n return (\n <Listbox value={value} onChange={onChange}>\n <div className=\"clarify-api-select relative flex flex-col gap-1 text-[0.625rem]/5 font-semibold tracking-widest text-zinc-400 uppercase\">\n <ListboxButton className=\"clarify-api-select-button flex min-w-32 items-center justify-between gap-2 rounded-lg border border-white/10 bg-zinc-900 px-2.5 py-1.5 font-mono text-xs font-medium tracking-normal text-zinc-100 outline-hidden transition hover:border-white/20 focus:border-emerald-400 focus:ring-2 focus:ring-emerald-400/20 data-open:border-emerald-400 data-open:ring-2 data-open:ring-emerald-400/20\">\n <span className=\"flex flex-col items-start gap-0.5 truncate\">\n <span className=\"font-sans text-[0.625rem]/4 font-semibold tracking-widest text-zinc-500 uppercase\">{label}</span>\n <span className=\"truncate\">{value}</span>\n </span>\n <ChevronsUpDownIcon className=\"h-3.5 w-3.5 shrink-0 text-zinc-500\" aria-hidden=\"true\" />\n </ListboxButton>\n <ListboxOptions\n anchor=\"bottom start\"\n className=\"clarify-api-select-options z-30 mt-1 max-h-64 w-(--button-width) min-w-40 overflow-auto rounded-xl border border-white/10 bg-zinc-900 p-1 text-xs shadow-lg shadow-black/20 [--anchor-gap:--spacing(1)] focus:outline-none\"\n >\n {options.map((option) => (\n <ListboxOption\n key={option}\n value={option}\n className=\"clarify-api-select-option group flex cursor-default items-center justify-between gap-3 rounded-lg px-2.5 py-2 font-mono text-xs text-zinc-300 select-none data-focus:bg-white/10 data-focus:text-white data-selected:text-emerald-300\"\n >\n <span className=\"truncate\">{option}</span>\n <CheckIcon className=\"h-3.5 w-3.5 shrink-0 opacity-0 group-data-selected:opacity-100\" aria-hidden=\"true\" />\n </ListboxOption>\n ))}\n </ListboxOptions>\n </div>\n </Listbox>\n )\n}\n\nfunction ExamplePicker(arg0: {\n examples: ExampleEntry[]\n selectedKey: string\n onSelect: (key: string) => void\n}): ReactNode { const {\n examples,\n selectedKey,\n onSelect,\n} = arg0\n\n const scrollerRef = useRef<HTMLDivElement | null>(null)\n\n if (examples.length <= 1) return null\n\n function scrollBy(direction: 1 | -1) {\n const el = scrollerRef.current\n if (!el) return\n el.scrollBy({ left: direction * Math.max(120, el.clientWidth * 0.6), behavior: 'smooth' })\n }\n\n return (\n <div className=\"relative -mr-1 flex min-w-0 flex-1 items-center gap-1\">\n <button\n type=\"button\"\n aria-label=\"Scroll examples left\"\n onClick={() => scrollBy(-1)}\n className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-zinc-500 transition hover:bg-white/5 hover:text-zinc-200\"\n >\n <svg viewBox=\"0 0 20 20\" fill=\"currentColor\" className=\"h-3 w-3\">\n <path fillRule=\"evenodd\" d=\"M12.79 5.23a.75.75 0 010 1.06L9.06 10l3.73 3.71a.75.75 0 11-1.06 1.06l-4.25-4.24a.75.75 0 010-1.06l4.25-4.24a.75.75 0 011.06 0z\" clipRule=\"evenodd\" />\n </svg>\n </button>\n <div\n ref={scrollerRef}\n className=\"flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto whitespace-nowrap scroll-smooth scrollbar-none [&::-webkit-scrollbar]:hidden\"\n >\n {examples.map((example) => (\n <button\n key={example.key}\n type=\"button\"\n onClick={() => onSelect(example.key)}\n title={example.summary}\n className={[\n 'shrink-0 rounded-md px-2 py-0.5 text-xs font-medium transition',\n example.key === selectedKey\n ? 'bg-white/10 text-white'\n : 'text-zinc-400 hover:bg-white/5 hover:text-zinc-200',\n ].join(' ')}\n >\n {example.title}\n </button>\n ))}\n </div>\n <button\n type=\"button\"\n aria-label=\"Scroll examples right\"\n onClick={() => scrollBy(1)}\n className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-zinc-500 transition hover:bg-white/5 hover:text-zinc-200\"\n >\n <svg viewBox=\"0 0 20 20\" fill=\"currentColor\" className=\"h-3 w-3\">\n <path fillRule=\"evenodd\" d=\"M7.21 14.77a.75.75 0 010-1.06L10.94 10 7.21 6.29a.75.75 0 111.06-1.06l4.25 4.24a.75.75 0 010 1.06l-4.25 4.24a.75.75 0 01-1.06 0z\" clipRule=\"evenodd\" />\n </svg>\n </button>\n </div>\n )\n}\n\nfunction CopyCodeButton(arg0: { code: string }): ReactNode { const { code } = arg0\n\n const [copied, setCopied] = useState(false)\n\n return (\n <button\n type=\"button\"\n onClick={() => {\n void window.navigator.clipboard.writeText(code).then(() => {\n setCopied(true)\n window.setTimeout(() => setCopied(false), 1000)\n })\n }}\n className=\"absolute top-3.5 right-4 rounded-full bg-white/5 px-3 py-1 text-2xs font-medium text-zinc-400 opacity-0 transition hover:bg-white/10 hover:text-zinc-200 group-hover:opacity-100 focus:opacity-100\"\n >\n {copied ? 'Copied!' : 'Copy'}\n </button>\n )\n}\n\nfunction ApiExampleCodeGroup(arg0: {\n title: string\n tag?: string\n label?: string\n code: string\n language: string\n examples?: ExampleEntry[]\n selectedExampleKey?: string\n onSelectExample?: (key: string) => void\n}): ReactNode { const {\n title,\n tag,\n label,\n code,\n language,\n examples,\n selectedExampleKey,\n onSelectExample,\n} = arg0\n\n return (\n <div className=\"clarify-api-example my-6 overflow-hidden rounded-2xl bg-zinc-900 shadow-md dark:ring-1 dark:ring-white/10\">\n <div className=\"not-prose\">\n <div className=\"clarify-api-example-header flex min-h-[calc(--spacing(12)+1px)] flex-wrap items-center gap-x-4 border-b border-zinc-700 bg-zinc-800 px-4 dark:border-zinc-800 dark:bg-transparent\">\n <h3 className=\"shrink-0 py-3 text-xs font-semibold text-white\">{title}</h3>\n {examples && examples.length > 1 && selectedExampleKey && onSelectExample ? (\n <ExamplePicker examples={examples} selectedKey={selectedExampleKey} onSelect={onSelectExample} />\n ) : null}\n </div>\n {tag || label ? (\n <div className=\"flex h-9 items-center gap-2 border-y border-t-transparent border-b-white/7.5 bg-zinc-900 px-4 dark:border-b-white/5 dark:bg-white/1\">\n {tag ? <span className=\"font-mono text-[0.625rem]/6 font-semibold text-emerald-400\">{tag}</span> : null}\n {tag && label ? <span className=\"h-0.5 w-0.5 rounded-full bg-zinc-500\" /> : null}\n {label ? <span className=\"font-mono text-xs text-zinc-400\">{label}</span> : null}\n </div>\n ) : null}\n <div className=\"clarify-api-example-code group relative\">\n <pre className=\"overflow-x-auto p-4 text-xs text-white\">\n <code className={`language-${language}`}>{code}</code>\n </pre>\n <CopyCodeButton code={code} />\n </div>\n </div>\n </div>\n )\n}\n\nfunction RequestExamplesPanel(arg0: {\n spec: OpenAPISpec\n path: string\n method: string\n parameters: OpenApiParameter[]\n requestContents: MediaTypeEntry[]\n}): ReactNode { const {\n spec,\n path,\n method,\n parameters,\n requestContents,\n} = arg0\n\n const [selectedMediaType, setSelectedMediaType] = useState(requestContents[0]?.mediaType ?? '')\n const selectedContent = requestContents.find((content) => content.mediaType === selectedMediaType) ?? requestContents[0]\n const examples = getExampleEntries(selectedContent?.value)\n const [selectedExampleKey, setSelectedExampleKey] = useState(examples[0]?.key ?? '')\n const selectedExample = examples.find((example) => example.key === selectedExampleKey) ?? examples[0]\n const requestContent = selectedContent ? { ...selectedContent, value: { ...selectedContent.value, example: selectedExample?.value, examples: undefined } } : undefined\n const curl = buildCurlExample({ spec, path, method, parameters, requestContent })\n\n return (\n <div>\n <div className=\"mb-3 flex flex-wrap gap-3\">\n <SelectControl\n label=\"Media type\"\n value={selectedContent?.mediaType ?? ''}\n options={requestContents.map((content) => content.mediaType)}\n onChange={(value) => {\n setSelectedMediaType(value)\n setSelectedExampleKey(getExampleEntries(requestContents.find((content) => content.mediaType === value)?.value)[0]?.key ?? '')\n }}\n />\n </div>\n <ApiExampleCodeGroup\n title=\"Request\"\n tag={method}\n label={path}\n code={curl}\n language=\"bash\"\n examples={examples}\n selectedExampleKey={selectedExample?.key}\n onSelectExample={setSelectedExampleKey}\n />\n </div>\n )\n}\n\nfunction ResponseExamplesPanel(arg0: { operation: OpenAPIOperation }): ReactNode { const { operation } = arg0\n\n const responses = getResponseEntries(operation).filter(({ response }) => getMediaTypeEntries(response.content).length > 0)\n const [selectedStatus, setSelectedStatus] = useState(responses.find(({ status }) => status.startsWith('2'))?.status ?? responses[0]?.status ?? '')\n const selectedResponse = responses.find(({ status }) => status === selectedStatus) ?? responses[0]\n const responseContents = getMediaTypeEntries(selectedResponse?.response.content)\n const [selectedMediaType, setSelectedMediaType] = useState(responseContents[0]?.mediaType ?? '')\n const selectedContent = responseContents.find((content) => content.mediaType === selectedMediaType) ?? responseContents[0]\n const examples = getExampleEntries(selectedContent?.value)\n const [selectedExampleKey, setSelectedExampleKey] = useState(examples[0]?.key ?? '')\n const selectedExample = examples.find((example) => example.key === selectedExampleKey) ?? examples[0]\n const responseCode = stringifyExample(selectedExample?.value)\n\n if (!selectedResponse || !selectedContent || !responseCode) return null\n\n return (\n <div>\n <div className=\"mb-3 flex flex-wrap gap-3\">\n <SelectControl\n label=\"Status\"\n value={selectedResponse.status}\n options={responses.map(({ status }) => status)}\n onChange={(value) => {\n const nextResponse = responses.find(({ status }) => status === value)\n const nextContents = getMediaTypeEntries(nextResponse?.response.content)\n setSelectedStatus(value)\n setSelectedMediaType(nextContents[0]?.mediaType ?? '')\n setSelectedExampleKey(getExampleEntries(nextContents[0]?.value)[0]?.key ?? '')\n }}\n />\n <SelectControl\n label=\"Media type\"\n value={selectedContent.mediaType}\n options={responseContents.map((content) => content.mediaType)}\n onChange={(value) => {\n setSelectedMediaType(value)\n setSelectedExampleKey(getExampleEntries(responseContents.find((content) => content.mediaType === value)?.value)[0]?.key ?? '')\n }}\n />\n </div>\n <ApiExampleCodeGroup\n title=\"Response\"\n tag={selectedResponse.status}\n label={selectedContent.mediaType}\n code={responseCode}\n language={codeLanguageForMediaType(selectedContent.mediaType)}\n examples={examples}\n selectedExampleKey={selectedExample?.key}\n onSelectExample={setSelectedExampleKey}\n />\n </div>\n )\n}\n\nfunction EndpointExamples(arg0: {\n spec: OpenAPISpec\n path: string\n method: string\n operation: OpenAPIOperation\n parameters: OpenApiParameter[]\n requestContents: MediaTypeEntry[]\n}): ReactNode { const {\n spec,\n path,\n method,\n operation,\n parameters,\n requestContents,\n} = arg0\n\n return (\n <div className=\"space-y-6\">\n <RequestExamplesPanel spec={spec} path={path} method={method} parameters={parameters} requestContents={requestContents} />\n <ResponseExamplesPanel operation={operation} />\n </div>\n )\n}\n\nfunction OpenApiHeader(arg0: { spec: OpenAPISpec }): ReactNode { const { spec } = arg0\n\n return (\n <header className=\"mb-16\">\n <p className=\"mb-3 font-mono text-xs/6 font-medium tracking-widest text-emerald-500 uppercase dark:text-emerald-400\">\n OpenAPI Reference\n </p>\n <h1>{spec.info?.title ?? 'API Documentation'}</h1>\n {spec.info?.description ? <p className=\"lead\">{spec.info.description}</p> : null}\n {spec.info?.version ? <p className=\"text-sm text-zinc-500 dark:text-zinc-400\">Version {spec.info.version}</p> : null}\n </header>\n )\n}\n\nfunction OpenApiOperation(arg0: { spec: OpenAPISpec; path: string; method: string; operation: OpenAPIOperation }): ReactNode { const { spec, path, method, operation } = arg0\n\n const id = slug(`${method.toLowerCase()} ${path}`)\n const summary = operation.summary ?? `${method} ${path}`\n const description = operation.description\n const parameters = getOperationParameters(spec, path, operation)\n const requestBody = getRequestBody(operation)\n const requestContents = getMediaTypeEntries(requestBody?.content)\n const requestSchema = requestContents[0]?.value.schema\n const groupedParameters = {\n path: parameters.filter((parameter) => parameter.in === 'path'),\n query: parameters.filter((parameter) => parameter.in === 'query'),\n header: parameters.filter((parameter) => parameter.in === 'header'),\n }\n\n return (\n <section className=\"clarify-api-endpoint scroll-mt-24\" aria-labelledby={id}>\n <Heading id={id} tag={method} label={path}>\n {summary}\n </Heading>\n <Row>\n <Col>\n {description ? <p>{description}</p> : null}\n <ParameterList title=\"Path parameters\" parameters={groupedParameters.path} />\n <ParameterList title=\"Query parameters\" parameters={groupedParameters.query} />\n <ParameterList title=\"Headers\" parameters={groupedParameters.header} />\n {requestBody && requestContents.length > 0 ? (\n <>\n <h3>Request body</h3>\n {typeof requestBody.description === 'string' ? <p>{requestBody.description}</p> : null}\n <SchemaProperties title=\"Body properties\" schema={requestSchema} />\n </>\n ) : null}\n <ResponseList operation={operation} />\n </Col>\n <Col sticky>\n <EndpointExamples\n spec={spec}\n path={path}\n method={method}\n operation={operation}\n parameters={parameters}\n requestContents={requestContents}\n />\n </Col>\n </Row>\n </section>\n )\n}\n\nfunction OpenApiPaths(arg0: { spec: OpenAPISpec }): ReactNode { const { spec } = arg0\n\n const entries = listOpenApiOperations(spec).map(({ path, method, operation }) => ({\n path,\n method: method.toUpperCase(),\n operation,\n }))\n\n return (\n <div className=\"clarify-api-endpoints space-y-16\">\n {entries.map(({ path, method, operation }) => (\n <OpenApiOperation key={`${method}-${path}`} spec={spec} path={path} method={method} operation={operation} />\n ))}\n </div>\n )\n}\n\nfunction resolveRelativePath(fromDir: string, to: string): string {\n const parts = (fromDir + '/' + to).split('/').filter(Boolean)\n const stack: string[] = []\n for (const part of parts) {\n if (part === '..') {\n stack.pop()\n } else if (part !== '.') {\n stack.push(part)\n }\n }\n return stack.join('/')\n}\n\nfunction normalizeSpecPath(specPath: string, currentRoutePath?: string, routePrefix = ''): string {\n if (specPath.startsWith(VIRTUAL_PREFIX)) return specPath\n\n const normalizedRoutePrefix = routePrefix.replace(/^\\/+|\\/+$/g, '')\n const normalizedSpecPath = specPath.startsWith('/') && normalizedRoutePrefix && specPath.slice(1).startsWith(`${normalizedRoutePrefix}/`)\n ? '/' + specPath.slice(normalizedRoutePrefix.length + 2)\n : specPath\n\n if (normalizedSpecPath.startsWith('/')) {\n return VIRTUAL_PREFIX + normalizedSpecPath.replace(/^\\//, '')\n }\n const fromDir = currentRoutePath === '/' ? '' : currentRoutePath?.replace(/^\\//, '').replace(/\\/[^/]*$/, '') ?? ''\n const normalizedFromDir = normalizedRoutePrefix && fromDir.startsWith(`${normalizedRoutePrefix}/`)\n ? fromDir.slice(normalizedRoutePrefix.length + 1)\n : fromDir\n return VIRTUAL_PREFIX + resolveRelativePath(normalizedFromDir, normalizedSpecPath)\n}\n\nfunction useOpenApiSpec(spec?: OpenAPISpec, specPath?: string): OpenAPISpec | null {\n const specs = useOpenApis()\n const location = useLocation()\n const config = useClarifyConfig()\n\n if (spec) return spec\n if (!specPath) return null\n\n const normalized = normalizeSpecPath(specPath, location.pathname, config.routePrefix)\n return specs[normalized] ?? null\n}\n\nfunction WarningBox(arg0: { children: ReactNode; tone?: 'amber' | 'red' }): ReactNode { const { children, tone = 'amber' } = arg0\n\n const classes = tone === 'red'\n ? 'rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-200'\n : 'rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200'\n\n return <div className={clsx('clarify-warning', classes)}>{children}</div>\n}\n\nexport function OpenApiPage(arg0: OpenApiPageProps): ReactNode {\n const { spec, specPath } = arg0\n const resolved = useOpenApiSpec(spec, specPath)\n\n if (!resolved) {\n return <WarningBox>OpenAPI spec not found: {specPath ?? '(未提供 spec 或 specPath)'}</WarningBox>\n }\n\n return (\n <article className=\"clarify-openapi-page flex h-full flex-col pt-16 pb-10\">\n <Prose className=\"flex-auto\">\n <OpenApiHeader spec={resolved} />\n <OpenApiPaths spec={resolved} />\n </Prose>\n <PageFooter />\n </article>\n )\n}\n\nexport function ApiEndpoint(arg0: ApiEndpointProps): ReactNode {\n const { spec, path, method } = arg0\n const op = getOpenApiOperation(spec, path, method)\n\n if (!op) {\n return <WarningBox tone=\"red\">Endpoint not found: {method.toUpperCase()} {path}</WarningBox>\n }\n\n return <OpenApiOperation spec={spec} path={path} method={method.toUpperCase()} operation={op} />\n}\n\nexport function OpenApiEndpoint(arg0: OpenApiEndpointProps): ReactNode {\n const { specPath, path, method } = arg0\n const spec = useOpenApiSpec(undefined, specPath)\n\n if (!spec) {\n return <WarningBox>OpenAPI spec not found: {specPath}</WarningBox>\n }\n\n return <ApiEndpoint spec={spec} path={path} method={method} />\n}\n","import { ApiEndpointCard, DocShell } from '../components'\nimport { OpenApiPage, ApiEndpoint, OpenApiEndpoint } from '../openapi'\n\nimport * as mdxPrimitives from './primitives'\n\nexport function useMDXComponents(components: Record<string, unknown> = {}) {\n return {\n ...components,\n ...mdxPrimitives,\n OpenApiPage,\n Ap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|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../source/openapi/lib/spec-path.ts","../source/openapi/lib/utils.ts","../source/openapi/entry.tsx","../source/mdx/components.ts","../source/mdx/DocShell.tsx"],"sourcesContent":["import { useLocation } from 'react-router-dom'\n\nimport { useClarifyConfig, useOpenApis } from '../../core/context'\n\nimport type { OpenAPISpec } from './utils'\n\nconst VIRTUAL_PREFIX = 'virtual:clarify-page/'\n\nfunction resolveRelativePath(fromDir: string, to: string): string {\n const parts = (fromDir + '/' + to).split('/').filter(Boolean)\n const stack: string[] = []\n for (const part of parts) {\n if (part === '..') {\n stack.pop()\n } else if (part !== '.') {\n stack.push(part)\n }\n }\n return stack.join('/')\n}\n\nfunction normalizeSpecPath(specPath: string, currentRoutePath?: string, routePrefix = ''): string {\n if (specPath.startsWith(VIRTUAL_PREFIX)) return specPath\n\n const normalizedRoutePrefix = routePrefix.replace(/^\\/+|\\/+$/g, '')\n const normalizedSpecPath = specPath.startsWith('/') && normalizedRoutePrefix && specPath.slice(1).startsWith(`${normalizedRoutePrefix}/`)\n ? '/' + specPath.slice(normalizedRoutePrefix.length + 2)\n : specPath\n\n if (normalizedSpecPath.startsWith('/')) {\n return VIRTUAL_PREFIX + normalizedSpecPath.replace(/^\\//, '')\n }\n const fromDir = currentRoutePath === '/' ? '' : currentRoutePath?.replace(/^\\//, '').replace(/\\/[^/]*$/, '') ?? ''\n const normalizedFromDir = normalizedRoutePrefix && fromDir.startsWith(`${normalizedRoutePrefix}/`)\n ? fromDir.slice(normalizedRoutePrefix.length + 1)\n : fromDir\n return VIRTUAL_PREFIX + resolveRelativePath(normalizedFromDir, normalizedSpecPath)\n}\n\nexport function useOpenApiSpec(spec?: OpenAPISpec, specPath?: string): OpenAPISpec | null {\n const specs = useOpenApis()\n const location = useLocation()\n const config = useClarifyConfig()\n\n if (spec) return spec\n if (!specPath) return null\n\n const normalized = normalizeSpecPath(specPath, location.pathname, config.routePrefix)\n return specs[normalized] ?? null\n}\n","import type { OpenAPIV3, OpenAPIV3_1 } from 'openapi-types'\n\nimport type { OpenApiRecord } from '../types'\n\nexport type OpenAPISpec = OpenAPIV3.Document | OpenAPIV3_1.Document\nexport type OpenAPIOperation = OpenAPIV3.OperationObject | OpenAPIV3_1.OperationObject\n\nexport const OPENAPI_HTTP_METHODS = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'] as const\n\nexport type OpenAPIHttpMethod = typeof OPENAPI_HTTP_METHODS[number]\n\nexport function isOpenAPIHttpMethod(method: string): method is OpenAPIHttpMethod {\n return (OPENAPI_HTTP_METHODS as readonly string[]).includes(method.toLowerCase())\n}\n\nfunction isRecord(value: unknown): value is OpenApiRecord {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction resolveOpenApiRef(spec: OpenAPISpec, ref: string): unknown {\n if (!ref.startsWith('#/')) return undefined\n\n return ref\n .slice(2)\n .split('/')\n .map((part) => part.replace(/~1/g, '/').replace(/~0/g, '~'))\n .reduce<unknown>((current, part) => (isRecord(current) ? current[part] : undefined), spec)\n}\n\nfunction getPathItem(spec: OpenAPISpec, path: string): OpenApiRecord | undefined {\n const pathItem = spec.paths?.[path]\n const resolved = isRecord(pathItem) && typeof pathItem.$ref === 'string' ? resolveOpenApiRef(spec, pathItem.$ref) : pathItem\n return isRecord(resolved) ? resolved : undefined\n}\n\nexport function getOpenApiOperation(spec: OpenAPISpec, path: string, method: string): OpenAPIOperation | undefined {\n if (!isOpenAPIHttpMethod(method)) return undefined\n return getPathItem(spec, path)?.[method.toLowerCase() as OpenAPIHttpMethod] as OpenAPIOperation | undefined\n}\n\nexport function listOpenApiOperations(spec: OpenAPISpec): Array<{ path: string; method: OpenAPIHttpMethod; operation: OpenAPIOperation }> {\n const paths = spec.paths ?? {}\n const operations: Array<{ path: string; method: OpenAPIHttpMethod; operation: OpenAPIOperation }> = []\n\n for (const path of Object.keys(paths)) {\n const pathItem = getPathItem(spec, path)\n if (!pathItem) continue\n for (const method of OPENAPI_HTTP_METHODS) {\n const operation = pathItem[method]\n if (operation) operations.push({ path, method, operation: operation as OpenAPIOperation })\n }\n }\n\n return operations\n}\n","import type { ReactNode } from 'react'\n\nimport { Prose } from '../components/Prose'\nimport { useBuiltInText } from '../core/i18n'\nimport { Markdown } from '../mdx/Markdown'\n\nimport { OpenApiOperation as OpenApiOperationComponent } from './components/OpenApiOperation'\nimport { useOpenApiSpec } from './lib/spec-path'\nimport { getOpenApiOperation, listOpenApiOperations } from './lib/utils'\nimport type { OpenAPISpec } from './lib/utils'\n\ntype OpenApiPathsProps = { spec: OpenAPISpec }\n\ntype OpenApiHeaderProps = { spec: OpenAPISpec }\n\ntype WarningBoxProps = {\n children: ReactNode\n tone?: 'amber' | 'red'\n}\n\nexport type OpenApiDocumentProps = {\n spec?: OpenAPISpec\n specPath?: string\n}\n\ntype OpenApiOperationWithSpecProps = {\n spec: OpenAPISpec\n path: string\n method: string\n}\n\nexport type OpenApiOperationProps = {\n specPath: string\n path: string\n method: string\n}\n\nfunction OpenApiHeader(arg0: OpenApiHeaderProps): ReactNode {\n const { spec } = arg0\n\n const t = useBuiltInText()\n return (\n <header className=\"mb-16\">\n <p className=\"mb-3 text-xs/6 font-medium tracking-widest text-emerald-500 uppercase dark:text-emerald-400\">\n {t('openapi.openApiReference')}\n </p>\n <h1>{spec.info?.title ?? t('openapi.apiDocumentation')}</h1>\n {spec.info?.description ? <Markdown className=\"lead *:first:mt-0 *:last:mb-0\">{spec.info.description}</Markdown> : null}\n {spec.info?.version ? <p className=\"text-sm text-zinc-500 dark:text-zinc-400\">{t('openapi.version', { version: spec.info.version })}</p> : null}\n </header>\n )\n}\n\nfunction OpenApiPaths(arg0: OpenApiPathsProps): ReactNode {\n const { spec } = arg0\n\n const entries = listOpenApiOperations(spec).map(({ path, method, operation }) => ({\n path,\n method: method.toUpperCase(),\n operation,\n }))\n\n return (\n <div className=\"clarify-api-endpoints divide-y divide-zinc-200/70 dark:divide-white/10\">\n {entries.map(({ path, method, operation }) => (\n <OpenApiOperationComponent key={`${method}-${path}`} spec={spec} path={path} method={method} operation={operation} />\n ))}\n </div>\n )\n}\n\nfunction WarningBox(arg0: WarningBoxProps): ReactNode {\n const { children, tone = 'amber' } = arg0\n\n const classes = tone === 'red'\n ? 'rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-200'\n : 'rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200'\n\n return <div className={`clarify-warning ${classes}`}>{children}</div>\n}\n\nexport function OpenApiDocument(arg0: OpenApiDocumentProps): ReactNode {\n const { spec, specPath } = arg0\n const t = useBuiltInText()\n const resolved = useOpenApiSpec(spec, specPath)\n\n if (!resolved) {\n return <WarningBox>{t('openapi.specNotFound', { specPath: specPath ?? t('openapi.specPathMissing') })}</WarningBox>\n }\n\n return (\n <article className=\"clarify-openapi-page flex h-full flex-col pt-16 pb-10\">\n <Prose className=\"flex-auto\">\n <OpenApiHeader spec={resolved} />\n <OpenApiPaths spec={resolved} />\n </Prose>\n </article>\n )\n}\n\nfunction OpenApiOperationWithSpec(arg0: OpenApiOperationWithSpecProps): ReactNode {\n const { spec, path, method } = arg0\n const t = useBuiltInText()\n const op = getOpenApiOperation(spec, path, method)\n\n if (!op) {\n return <WarningBox tone=\"red\">{t('openapi.endpointNotFound', { endpoint: `${method.toUpperCase()} ${path}` })}</WarningBox>\n }\n\n const normalizedMethod = method.toUpperCase()\n return <OpenApiOperationComponent key={`${normalizedMethod}-${path}`} spec={spec} path={path} method={normalizedMethod} operation={op} />\n}\n\nexport function OpenApiOperation(arg0: OpenApiOperationProps): ReactNode {\n const { specPath, path, method } = arg0\n const t = useBuiltInText()\n const spec = useOpenApiSpec(undefined, specPath)\n\n if (!spec) {\n return <WarningBox>{t('openapi.specNotFound', { specPath })}</WarningBox>\n }\n\n return <OpenApiOperationWithSpec spec={spec} path={path} method={method} />\n}\n","import { OpenApiDocument, OpenApiOperation } from '../openapi'\n\nimport { Markdown } from './Markdown'\nimport * as mdxPrimitives from './primitives'\nimport { Collapse } from '../components/Collapse'\n\nconst builtInMDXComponents = {\n ...mdxPrimitives,\n Markdown,\n Collapse,\n}\n\nconst builtInOpenAPIComponents = {\n OpenApiDocument,\n OpenApiOperation,\n}\n\nexport function useMDXComponents(components: Record<string, unknown> = {}) {\n return {\n ...components,\n ...builtInMDXComponents,\n ...builtInOpenAPIComponents,\n }\n}\n","import type { ReactNode } from 'react'\n\nimport { Prose } from '../components/Prose'\n\nexport type DocShellProps = {\n title: string\n subtitle?: string\n children: ReactNode\n}\n\nexport function DocShell(arg0: DocShellProps) {\n const { title, subtitle, children } = arg0\n\n return (\n <main className=\"clarify-doc-shell min-h-screen bg-white px-6 py-10 text-zinc-900 dark:bg-zinc-950 dark:text-white md:px-10\">\n <div className=\"mx-auto max-w-6xl\">\n <header className=\"mb-10\">\n <h1 className=\"text-3xl font-bold tracking-tight md:text-5xl\">{title}</h1>\n {subtitle ? <p className=\"mt-3 max-w-2xl text-zinc-600 dark:text-zinc-400\">{subtitle}</p> : null}\n </header>\n <Prose>{children}</Prose>\n </div>\n </main>\n )\n}\n"],"mappings":";;;;;;;;AAMA,IAAM,iBAAiB;AAEvB,SAAS,oBAAoB,SAAiB,IAAoB;CAChE,MAAM,SAAS,UAAU,MAAM,IAAI,MAAM,GAAG,EAAE,OAAO,OAAO;CAC5D,MAAM,QAAkB,CAAC;CACzB,KAAK,MAAM,QAAQ,OACjB,IAAI,SAAS,MACX,MAAM,IAAI;MACL,IAAI,SAAS,KAClB,MAAM,KAAK,IAAI;CAGnB,OAAO,MAAM,KAAK,GAAG;AACvB;AAEA,SAAS,kBAAkB,UAAkB,kBAA2B,cAAc,IAAY;CAChG,IAAI,SAAS,WAAW,cAAc,GAAG,OAAO;CAEhD,MAAM,wBAAwB,YAAY,QAAQ,cAAc,EAAE;CAClE,MAAM,qBAAqB,SAAS,WAAW,GAAG,KA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Y;EAAM,QAAQ;EAAkB,WAAW;CAAK,GAAjG,GAAG,iBAAiB,GAAG,MAA0E;AAC1I;AAEA,SAAgB,iBAAiB,MAAwC;CACvE,MAAM,EAAE,UAAU,MAAM,WAAW;CACnC,MAAM,IAAI,eAAe;CACzB,MAAM,OAAO,eAAe,KAAA,GAAW,QAAQ;CAE/C,IAAI,CAAC,MACH,OAAO,oBAAC,YAAD,EAAA,UAAa,EAAE,wBAAwB,EAAE,SAAS,CAAC,EAAc,CAAA;CAG1E,OAAO,oBAAC,0BAAD;EAAgC;EAAY;EAAc;CAAS,CAAA;AAC5E;;;ACrHA,IAAM,uBAAuB;CAC3B,GAAG;CACH;CACA;AACF;AAEA,IAAM,2BAA2B;CAC/B;CACA;AACF;AAEA,SAAgB,iBAAiB,aAAsC,CAAC,GAAG;CACzE,OAAO;EACL,GAAG;EACH,GAAG;EACH,GAAG;CACL;AACF;;;ACbA,SAAgB,SAAS,MAAqB;CAC5C,MAAM,EAAE,OAAO,UAAU,aAAa;CAEtC,OACE,oBAAC,QAAD;EAAM,WAAU;YACd,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,qBAAC,UAAD;IAAQ,WAAU;cAAlB,CACE,oBAAC,MAAD;KAAI,WAAU;eAAiD;IAAU,CAAA,GACxE,WAAW,oBAAC,KAAD;KAAG,WAAU;eAAmD;IAAY,CAAA,IAAI,IACtF;OACR,oBAAC,OAAD,EAAQ,SAAgB,CAAA,CACrB;;CACD,CAAA;AAEV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { markdownRemarkPlugins } from './mdx/remark';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OpenApiDocument, OpenApiOperation } from '../openapi';
|
|
2
|
+
import { Markdown } from './Markdown';
|
|
3
|
+
import { Collapse } from '../components/Collapse';
|
|
3
4
|
import * as mdxPrimitives from './primitives';
|
|
4
5
|
export declare function useMDXComponents(components?: Record<string, unknown>): {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
DocShell: typeof DocShell;
|
|
6
|
+
OpenApiDocument: typeof OpenApiDocument;
|
|
7
|
+
OpenApiOperation: typeof OpenApiOperation;
|
|
8
|
+
Markdown: typeof Markdown;
|
|
9
|
+
Collapse: typeof Collapse;
|
|
10
10
|
wrapper(arg0: {
|
|
11
11
|
children: import('react').ReactNode;
|
|
12
12
|
}): import("react").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import { Button, Callout, Card, CardGroup, Heading } from '../components';
|
|
3
3
|
import { Code, CodeGroup, Pre } from '../components/Code';
|
|
4
|
-
|
|
4
|
+
type WrapperProps = {
|
|
5
5
|
children: ReactNode;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
|
+
export declare function wrapper(arg0: WrapperProps): import("react").JSX.Element;
|
|
7
8
|
export declare function a(arg0: ComponentPropsWithoutRef<'a'>): import("react").JSX.Element;
|
|
8
9
|
export declare const code: typeof Code;
|
|
9
10
|
export declare const pre: typeof Pre;
|
|
@@ -22,21 +23,26 @@ export declare function h3(props: Omit<ComponentPropsWithoutRef<typeof Heading>,
|
|
|
22
23
|
level?: 2 | 3 | undefined;
|
|
23
24
|
anchor?: boolean;
|
|
24
25
|
}>;
|
|
25
|
-
|
|
26
|
+
type NoteProps = {
|
|
26
27
|
children: ReactNode;
|
|
27
|
-
}
|
|
28
|
-
export declare function
|
|
28
|
+
};
|
|
29
|
+
export declare function Note(arg0: NoteProps): import("react").JSX.Element;
|
|
30
|
+
type RowProps = {
|
|
29
31
|
children: ReactNode;
|
|
30
|
-
}
|
|
31
|
-
export declare function
|
|
32
|
+
};
|
|
33
|
+
export declare function Row(arg0: RowProps): import("react").JSX.Element;
|
|
34
|
+
type ColProps = {
|
|
32
35
|
children: ReactNode;
|
|
33
36
|
sticky?: boolean;
|
|
34
|
-
}
|
|
35
|
-
export declare function
|
|
37
|
+
};
|
|
38
|
+
export declare function Col(arg0: ColProps): import("react").JSX.Element;
|
|
39
|
+
type PropertiesProps = {
|
|
36
40
|
children: ReactNode;
|
|
37
|
-
}
|
|
38
|
-
export declare function
|
|
41
|
+
};
|
|
42
|
+
export declare function Properties(arg0: PropertiesProps): import("react").JSX.Element;
|
|
43
|
+
type PropertyProps = {
|
|
39
44
|
name: string;
|
|
40
45
|
children: ReactNode;
|
|
41
46
|
type?: string;
|
|
42
|
-
}
|
|
47
|
+
};
|
|
48
|
+
export declare function Property(arg0: PropertyProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { OpenAPIOperation, OpenAPISpec } from '../lib/utils';
|
|
3
|
+
import { MediaTypeEntry, OpenApiParameter, OpenApiSecurityScheme, OpenApiServer, RequestAuthInput } from '../types';
|
|
4
|
+
export declare function getServers(spec: OpenAPISpec, operation: OpenAPIOperation, path?: string): OpenApiServer[];
|
|
5
|
+
export declare function getServerKey(server: OpenApiServer, index: number): string;
|
|
6
|
+
export declare function getServerLabel(server: OpenApiServer, index: number): string;
|
|
7
|
+
export declare function defaultServerVariables(server?: OpenApiServer): Record<string, string>;
|
|
8
|
+
export type AuthOption = {
|
|
9
|
+
name: string;
|
|
10
|
+
scheme: OpenApiSecurityScheme;
|
|
11
|
+
};
|
|
12
|
+
export declare function getAuthOptions(spec: OpenAPISpec, operation: OpenAPIOperation): AuthOption[];
|
|
13
|
+
type AuthPlaceholderArg = {
|
|
14
|
+
scheme: OpenApiSecurityScheme;
|
|
15
|
+
};
|
|
16
|
+
export declare function authPlaceholder(auth?: AuthPlaceholderArg): string;
|
|
17
|
+
export declare function authLabel(name: string, scheme: OpenApiSecurityScheme): string;
|
|
18
|
+
type RequestExamplesPanelProps = {
|
|
19
|
+
spec: OpenAPISpec;
|
|
20
|
+
path: string;
|
|
21
|
+
method: string;
|
|
22
|
+
parameters: OpenApiParameter[];
|
|
23
|
+
requestContents: MediaTypeEntry[];
|
|
24
|
+
selectedMediaType: string;
|
|
25
|
+
onSelectMediaType: (value: string) => void;
|
|
26
|
+
selectedServer: OpenApiServer;
|
|
27
|
+
serverVariables: Record<string, string>;
|
|
28
|
+
auth?: RequestAuthInput;
|
|
29
|
+
};
|
|
30
|
+
export declare function RequestExamplesPanel(arg0: RequestExamplesPanelProps): ReactNode;
|
|
31
|
+
type ResponseExamplesPanelProps = {
|
|
32
|
+
operation: OpenAPIOperation;
|
|
33
|
+
spec?: OpenAPISpec;
|
|
34
|
+
};
|
|
35
|
+
export declare function ResponseExamplesPanel(arg0: ResponseExamplesPanelProps): ReactNode;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { OpenAPIOperation, OpenAPISpec } from '../lib/utils';
|
|
3
|
+
import { OpenApiServer } from '../types';
|
|
4
|
+
import { AuthOption } from './ExamplePanels';
|
|
5
|
+
export type OpenApiOperationProps = {
|
|
6
|
+
spec: OpenAPISpec;
|
|
7
|
+
path: string;
|
|
8
|
+
method: string;
|
|
9
|
+
operation: OpenAPIOperation;
|
|
10
|
+
};
|
|
11
|
+
type EndpointIdentityProps = {
|
|
12
|
+
method: string;
|
|
13
|
+
path: string;
|
|
14
|
+
servers: OpenApiServer[];
|
|
15
|
+
selectedServerKey: string;
|
|
16
|
+
selectedServer: OpenApiServer;
|
|
17
|
+
serverVariables: Record<string, string>;
|
|
18
|
+
serverOpen: boolean;
|
|
19
|
+
authOptions: AuthOption[];
|
|
20
|
+
selectedAuthName: string;
|
|
21
|
+
selectedAuth?: AuthOption;
|
|
22
|
+
authValues: Record<string, string>;
|
|
23
|
+
authOpen: boolean;
|
|
24
|
+
onSelectServer: (key: string) => void;
|
|
25
|
+
onChangeServerVariable: (name: string, value: string) => void;
|
|
26
|
+
onToggleServer: () => void;
|
|
27
|
+
onToggleAuth: () => void;
|
|
28
|
+
onSelectAuth: (name: string) => void;
|
|
29
|
+
onChangeAuthValue: (name: string, value: string) => void;
|
|
30
|
+
};
|
|
31
|
+
export declare function EndpointIdentity(arg0: EndpointIdentityProps): ReactNode;
|
|
32
|
+
export declare function OpenApiOperation(arg0: OpenApiOperationProps): ReactNode;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { OpenAPIOperation, OpenAPISpec } from '../lib/utils';
|
|
3
|
+
import { OpenApiParameter } from '../types';
|
|
4
|
+
type SchemaPropertiesProps = {
|
|
5
|
+
title: string;
|
|
6
|
+
schema: unknown;
|
|
7
|
+
spec: OpenAPISpec;
|
|
8
|
+
};
|
|
9
|
+
export declare function SchemaProperties(arg0: SchemaPropertiesProps): ReactNode;
|
|
10
|
+
type ParameterListProps = {
|
|
11
|
+
title: string;
|
|
12
|
+
parameters: OpenApiParameter[];
|
|
13
|
+
};
|
|
14
|
+
export declare function ParameterList(arg0: ParameterListProps): ReactNode;
|
|
15
|
+
type ResponseListProps = {
|
|
16
|
+
operation: OpenAPIOperation;
|
|
17
|
+
spec?: OpenAPISpec;
|
|
18
|
+
};
|
|
19
|
+
export declare function ResponseList(arg0: ResponseListProps): ReactNode;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { OpenAPISpec } from './lib/utils';
|
|
3
|
+
export type OpenApiDocumentProps = {
|
|
4
|
+
spec?: OpenAPISpec;
|
|
5
|
+
specPath?: string;
|
|
6
|
+
};
|
|
7
|
+
export type OpenApiOperationProps = {
|
|
8
|
+
specPath: string;
|
|
9
|
+
path: string;
|
|
10
|
+
method: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function OpenApiDocument(arg0: OpenApiDocumentProps): ReactNode;
|
|
13
|
+
export declare function OpenApiOperation(arg0: OpenApiOperationProps): ReactNode;
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type { OpenAPIOperation, OpenAPISpec } from './utils';
|
|
4
|
-
export type OpenApiPageProps = {
|
|
5
|
-
spec?: OpenAPISpec;
|
|
6
|
-
specPath?: string;
|
|
7
|
-
};
|
|
8
|
-
export type ApiEndpointProps = {
|
|
9
|
-
spec: OpenAPISpec;
|
|
10
|
-
path: string;
|
|
11
|
-
method: string;
|
|
12
|
-
};
|
|
13
|
-
export type OpenApiEndpointProps = {
|
|
14
|
-
specPath: string;
|
|
15
|
-
path: string;
|
|
16
|
-
method: string;
|
|
17
|
-
};
|
|
18
|
-
export declare function OpenApiPage(arg0: OpenApiPageProps): ReactNode;
|
|
19
|
-
export declare function ApiEndpoint(arg0: ApiEndpointProps): ReactNode;
|
|
20
|
-
export declare function OpenApiEndpoint(arg0: OpenApiEndpointProps): ReactNode;
|
|
1
|
+
export { OpenApiOperation, OpenApiDocument } from './entry';
|
|
2
|
+
export type { OpenApiOperationProps, OpenApiDocumentProps } from './entry';
|
|
3
|
+
export type { OpenAPIOperation, OpenAPISpec } from './lib/utils';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ExampleEntry, MediaTypeEntry, OpenApiMediaType, OpenApiParameter, OpenApiPathItem, OpenApiRecord, OpenApiResponse } from '../types';
|
|
2
|
+
import { OpenAPIOperation, OpenAPISpec } from './utils';
|
|
3
|
+
export declare function isRecord(value: unknown): value is OpenApiRecord;
|
|
4
|
+
export declare function isReference(value: unknown): value is {
|
|
5
|
+
$ref: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function resolveReferenceName(ref: string): string;
|
|
8
|
+
export declare function resolveOpenApiRef(spec: OpenAPISpec, ref: string): unknown;
|
|
9
|
+
export declare function resolveSchema(spec: OpenAPISpec, schema: unknown, seen?: Set<string>): unknown;
|
|
10
|
+
export declare function getPathItem(spec: OpenAPISpec, path: string): OpenApiPathItem | undefined;
|
|
11
|
+
export declare function schemaHasType(schema: unknown, type: string): boolean;
|
|
12
|
+
export declare function getOperationParameters(spec: OpenAPISpec, path: string, operation: OpenAPIOperation): OpenApiParameter[];
|
|
13
|
+
export declare function getRequestBody(spec: OpenAPISpec, operation: OpenAPIOperation): OpenApiRecord | undefined;
|
|
14
|
+
export declare function getMediaTypeEntries(content: unknown, spec?: OpenAPISpec): MediaTypeEntry[];
|
|
15
|
+
export declare function getJsonLikeContent(content: unknown, spec?: OpenAPISpec): MediaTypeEntry | undefined;
|
|
16
|
+
export declare function getExampleEntries(mediaType?: OpenApiMediaType): ExampleEntry[];
|
|
17
|
+
export declare function getContentExample(mediaType?: OpenApiMediaType): unknown;
|
|
18
|
+
export declare function schemaToType(schema: unknown): string | undefined;
|
|
19
|
+
export declare function schemaToExample(schema: unknown, depth?: number): unknown;
|
|
20
|
+
export declare function stringifyExample(value: unknown): string;
|
|
21
|
+
export declare function getResponseEntries(operation: OpenAPIOperation, spec?: OpenAPISpec): Array<{
|
|
22
|
+
status: string;
|
|
23
|
+
response: OpenApiResponse;
|
|
24
|
+
}>;
|
|
25
|
+
export declare function codeLanguageForMediaType(mediaType?: string): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OpenApiMediaType, OpenApiParameter, OpenApiServer, RequestAuthInput, RequestCodeExample } from '../types';
|
|
2
|
+
import { OpenAPISpec } from './utils';
|
|
3
|
+
type RequestContent = {
|
|
4
|
+
mediaType: string;
|
|
5
|
+
value: OpenApiMediaType;
|
|
6
|
+
};
|
|
7
|
+
export type RequestCodeInput = {
|
|
8
|
+
spec: OpenAPISpec;
|
|
9
|
+
path: string;
|
|
10
|
+
method: string;
|
|
11
|
+
parameters: OpenApiParameter[];
|
|
12
|
+
requestContent?: RequestContent;
|
|
13
|
+
server?: OpenApiServer;
|
|
14
|
+
serverVariables?: Record<string, string>;
|
|
15
|
+
auth?: RequestAuthInput;
|
|
16
|
+
};
|
|
17
|
+
export declare function buildRequestCodeExamples(input: RequestCodeInput): RequestCodeExample[];
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export type { OpenAPIOperation, OpenAPISpec } from './lib/utils';
|
|
2
|
+
export type OpenApiRecord = Record<string, unknown>;
|
|
3
|
+
export type OpenApiParameter = {
|
|
4
|
+
name?: string;
|
|
5
|
+
in?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
description?: string;
|
|
8
|
+
schema?: unknown;
|
|
9
|
+
};
|
|
10
|
+
export type OpenApiMediaType = {
|
|
11
|
+
schema?: unknown;
|
|
12
|
+
example?: unknown;
|
|
13
|
+
examples?: Record<string, unknown>;
|
|
14
|
+
encoding?: Record<string, {
|
|
15
|
+
contentType?: string;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
export type OpenApiResponse = {
|
|
19
|
+
description?: string;
|
|
20
|
+
content?: Record<string, OpenApiMediaType>;
|
|
21
|
+
};
|
|
22
|
+
export type OpenApiPathItem = OpenApiRecord & {
|
|
23
|
+
parameters?: unknown;
|
|
24
|
+
servers?: unknown;
|
|
25
|
+
};
|
|
26
|
+
export type OpenApiServerVariable = {
|
|
27
|
+
default?: string;
|
|
28
|
+
enum?: string[];
|
|
29
|
+
description?: string;
|
|
30
|
+
};
|
|
31
|
+
export type OpenApiServer = {
|
|
32
|
+
url?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
variables?: Record<string, OpenApiServerVariable>;
|
|
35
|
+
};
|
|
36
|
+
export type OpenApiSecurityScheme = {
|
|
37
|
+
type?: string;
|
|
38
|
+
scheme?: string;
|
|
39
|
+
bearerFormat?: string;
|
|
40
|
+
in?: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
flows?: unknown;
|
|
43
|
+
openIdConnectUrl?: string;
|
|
44
|
+
};
|
|
45
|
+
export type OpenApiSecurityRequirement = Record<string, string[]>;
|
|
46
|
+
export type RequestAuthInput = {
|
|
47
|
+
name: string;
|
|
48
|
+
value: string;
|
|
49
|
+
scheme: OpenApiSecurityScheme;
|
|
50
|
+
};
|
|
51
|
+
export type MediaTypeEntry = {
|
|
52
|
+
mediaType: string;
|
|
53
|
+
value: OpenApiMediaType;
|
|
54
|
+
};
|
|
55
|
+
export type ExampleEntry = {
|
|
56
|
+
key: string;
|
|
57
|
+
title: string;
|
|
58
|
+
summary?: string;
|
|
59
|
+
value: unknown;
|
|
60
|
+
generated?: boolean;
|
|
61
|
+
};
|
|
62
|
+
export type RequestCodeExample = {
|
|
63
|
+
key: string;
|
|
64
|
+
title: string;
|
|
65
|
+
language: string;
|
|
66
|
+
languageKey: string;
|
|
67
|
+
clientKey: string;
|
|
68
|
+
clientTitle: string;
|
|
69
|
+
code: string;
|
|
70
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type PreviewParameter = {
|
|
2
|
+
name: string;
|
|
3
|
+
in: string;
|
|
4
|
+
type: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
description?: string;
|
|
7
|
+
schema?: unknown;
|
|
8
|
+
};
|
|
9
|
+
export type PreviewEndpoint = {
|
|
10
|
+
method: string;
|
|
11
|
+
path: string;
|
|
12
|
+
summary: string;
|
|
13
|
+
description: string;
|
|
14
|
+
parameters?: PreviewParameter[];
|
|
15
|
+
requestDescription?: string;
|
|
16
|
+
requestSchema?: unknown;
|
|
17
|
+
requestExample?: unknown;
|
|
18
|
+
response?: string;
|
|
19
|
+
responseStatus?: string;
|
|
20
|
+
responseDescription?: string;
|
|
21
|
+
responseSchema?: unknown;
|
|
22
|
+
responseExample?: unknown;
|
|
23
|
+
};
|
|
24
|
+
type OpenApiExamplesPreviewProps = {
|
|
25
|
+
endpoint: PreviewEndpoint;
|
|
26
|
+
};
|
|
27
|
+
export declare function OpenApiExamplesPreview(arg0: OpenApiExamplesPreviewProps): import("react").JSX.Element;
|
|
28
|
+
export {};
|