apiuikit 2.0.1 → 2.2.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/dist/{CodeSamples-bu8KSzOn.js → CodeSamples-BxUKzCvO.js} +771 -753
- package/dist/{CodeSamples-C5Tl3k83.cjs → CodeSamples-C9DFITYX.cjs} +31 -31
- package/dist/{LogoExtension-CZJpJnyk.js → LogoExtension-DZ4kFXRU.js} +1 -1
- package/dist/{LogoExtension-BVOE2HZc.cjs → LogoExtension-z_uLvzXh.cjs} +1 -1
- package/dist/apiuikit.cjs.js +1 -1
- package/dist/apiuikit.es.js +44 -39
- package/dist/components/ItemCard.d.ts +16 -0
- package/dist/containers/AsyncAPI/AsyncAPI.d.ts +15 -12
- package/dist/containers/AsyncAPI/AsyncAPIRenderer.d.ts +18 -12
- package/dist/containers/Messages/MessageCard.d.ts +15 -0
- package/dist/containers/OpenAPI/OpenAPI.d.ts +16 -12
- package/dist/containers/OpenAPI/OpenAPIRenderer.d.ts +18 -12
- package/dist/containers/Operation/OperationCard.d.ts +13 -0
- package/dist/containers/Operation/OperationHeader.d.ts +18 -0
- package/dist/containers/Path/Endpoint.d.ts +23 -0
- package/dist/containers/Path/EndpointHeader.d.ts +21 -0
- package/dist/containers/Schema/SchemaCard.d.ts +18 -0
- package/dist/helpers/findItem.d.ts +21 -0
- package/dist/helpers/openapiParameters.d.ts +5 -0
- package/dist/{index-CbVUi36m.js → index-B3fyC_vS.js} +1 -1
- package/dist/{index-DkjcpZQZ.js → index-BGwEEF4U.js} +4173 -3907
- package/dist/{index-Ccaf5SNM.js → index-CfMaEll2.js} +1 -1
- package/dist/{index-DKcgVKzx.cjs → index-DI1pJDDr.cjs} +1 -1
- package/dist/{index-29FyeXas.cjs → index-Db1Uh19l.cjs} +1 -1
- package/dist/{index-C2tdEw22.cjs → index-DhjNPCD8.cjs} +77 -77
- package/dist/index.d.ts +6 -6
- package/dist/{protoToJsonSchema-CQwj_Ytd.cjs → protoToJsonSchema-BCcfO1xm.cjs} +1 -1
- package/dist/{protoToJsonSchema-BvNrF6Ce.js → protoToJsonSchema-DSskBSDK.js} +1 -1
- package/dist/{protobufSchemaParser-DO1jnL81.cjs → protobufSchemaParser-Brl5Ve-k.cjs} +1 -1
- package/dist/{protobufSchemaParser-hOIbQrct.js → protobufSchemaParser-Cz0UkK1s.js} +2 -2
- package/dist/public/createSectionRoot.d.ts +2 -1
- package/dist/public/openapiSections.d.ts +95 -10
- package/dist/public/schemasSection.d.ts +42 -8
- package/dist/public/sections.d.ts +79 -11
- package/dist/public/useNotFoundWarning.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("./index-DhjNPCD8.cjs");function n({value:e}){const o=t.resolveLogo(e);return o?r.jsx("img",{src:o.url,alt:o.altText??"logo",style:o.backgroundColor?{backgroundColor:o.backgroundColor}:void 0,className:"max-h-24 max-w-24 object-contain"}):null}exports.default=n;
|
package/dist/apiuikit.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-DhjNPCD8.cjs");exports.AsyncAPI=e.AsyncAPI;exports.AsyncAPIInfo=e.AsyncAPIInfo;exports.AsyncAPIMessage=e.AsyncAPIMessage;exports.AsyncAPIMessages=e.AsyncAPIMessages;exports.AsyncAPIOperation=e.AsyncAPIOperation;exports.AsyncAPIOperations=e.AsyncAPIOperations;exports.AsyncAPIProvider=e.AsyncAPIProvider;exports.AsyncAPIRenderer=e.AsyncAPIRenderer;exports.AsyncAPISchemas=e.AsyncAPISchemas;exports.AsyncAPIServers=e.AsyncAPIServers;exports.ErrorBoundary=e.ErrorBoundary;exports.OpenAPI=e.OpenAPI;exports.OpenAPIEndpoint=e.OpenAPIEndpoint;exports.OpenAPIEndpoints=e.OpenAPIEndpoints;exports.OpenAPIInfo=e.OpenAPIInfo;exports.OpenAPIProvider=e.OpenAPIProvider;exports.OpenAPIRenderer=e.OpenAPIRenderer;exports.OpenAPISchemas=e.OpenAPISchemas;exports.OpenAPIServers=e.OpenAPIServers;exports.OpenAPIWebhook=e.OpenAPIWebhook;exports.OpenAPIWebhooks=e.OpenAPIWebhooks;exports.PluginSlot=e.PluginSlot;exports.Schema=e.Schema;exports.SchemaTab=e.SchemaTabs;exports.SchemaTree=e.SchemaTree;exports.Schemas=e.Schemas;exports.asyncApiOperationToMarkdown=e.asyncApiOperationToMarkdown;exports.asyncApiToMarkdown=e.asyncApiToMarkdown;exports.default=e.AsyncAPI;exports.defaultConfig=e.defaultConfig;exports.documentToLlmsTxt=e.documentToLlmsTxt;exports.documentToMarkdown=e.documentToMarkdown;exports.listDocumentTargets=e.listDocumentTargets;exports.markdownForLlm=e.markdownForLlm;exports.openApiEndpointToMarkdown=e.openApiEndpointToMarkdown;exports.openApiToMarkdown=e.openApiToMarkdown;exports.parseAndRender=e.parseAndRender;exports.parseAndRenderOpenAPI=e.parseAndRender$1;exports.targetSlug=e.targetSlug;exports.useAsyncAPIDocument=e.useAsyncAPIDocument;exports.useAsyncAPIDocumentContext=e.useAsyncAPIDocumentContext;exports.useDocumentContext=e.useDocumentContext;exports.useOpenAPIDocumentContext=e.useOpenAPIDocumentContext;exports.useOperationTabPlugins=e.useOperationTabPlugins;exports.usePluginSlot=e.usePluginSlot;
|
package/dist/apiuikit.es.js
CHANGED
|
@@ -1,43 +1,48 @@
|
|
|
1
|
-
import { A as e, f as n, j as o, k as A, l as r, m as t, n as P, p,
|
|
1
|
+
import { A as e, f as n, j as o, k as A, l as r, m as t, n as P, p, q as c, s as I, E as d, O as u, t as i, v as m, w as O, x as y, y as l, z as S, B as T, D as g, F as k, P as h, S as M, G as f, H as w, I as x, J as D, K as v, A as E, L as R, M as b, N as C, Q as L, R as W, o as B, T as F, U as j, V as q, W as z, Y as G, Z as H, u as J, _ as K, $ as N, a0 as Q } from "./index-BGwEEF4U.js";
|
|
2
2
|
export {
|
|
3
3
|
e as AsyncAPI,
|
|
4
4
|
n as AsyncAPIInfo,
|
|
5
|
-
o as
|
|
6
|
-
A as
|
|
7
|
-
r as
|
|
8
|
-
t as
|
|
9
|
-
P as
|
|
10
|
-
p as
|
|
11
|
-
c as
|
|
12
|
-
I as
|
|
13
|
-
d as
|
|
14
|
-
u as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
l as
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
g as
|
|
23
|
-
k as
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
x as
|
|
29
|
-
D as
|
|
30
|
-
v as
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
L as
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
j as
|
|
40
|
-
q as
|
|
41
|
-
z as
|
|
42
|
-
G as
|
|
5
|
+
o as AsyncAPIMessage,
|
|
6
|
+
A as AsyncAPIMessages,
|
|
7
|
+
r as AsyncAPIOperation,
|
|
8
|
+
t as AsyncAPIOperations,
|
|
9
|
+
P as AsyncAPIProvider,
|
|
10
|
+
p as AsyncAPIRenderer,
|
|
11
|
+
c as AsyncAPISchemas,
|
|
12
|
+
I as AsyncAPIServers,
|
|
13
|
+
d as ErrorBoundary,
|
|
14
|
+
u as OpenAPI,
|
|
15
|
+
i as OpenAPIEndpoint,
|
|
16
|
+
m as OpenAPIEndpoints,
|
|
17
|
+
O as OpenAPIInfo,
|
|
18
|
+
y as OpenAPIProvider,
|
|
19
|
+
l as OpenAPIRenderer,
|
|
20
|
+
S as OpenAPISchemas,
|
|
21
|
+
T as OpenAPIServers,
|
|
22
|
+
g as OpenAPIWebhook,
|
|
23
|
+
k as OpenAPIWebhooks,
|
|
24
|
+
h as PluginSlot,
|
|
25
|
+
M as Schema,
|
|
26
|
+
f as SchemaTab,
|
|
27
|
+
w as SchemaTree,
|
|
28
|
+
x as Schemas,
|
|
29
|
+
D as asyncApiOperationToMarkdown,
|
|
30
|
+
v as asyncApiToMarkdown,
|
|
31
|
+
E as default,
|
|
32
|
+
R as defaultConfig,
|
|
33
|
+
b as documentToLlmsTxt,
|
|
34
|
+
C as documentToMarkdown,
|
|
35
|
+
L as listDocumentTargets,
|
|
36
|
+
W as markdownForLlm,
|
|
37
|
+
B as openApiEndpointToMarkdown,
|
|
38
|
+
F as openApiToMarkdown,
|
|
39
|
+
j as parseAndRender,
|
|
40
|
+
q as parseAndRenderOpenAPI,
|
|
41
|
+
z as targetSlug,
|
|
42
|
+
G as useAsyncAPIDocument,
|
|
43
|
+
H as useAsyncAPIDocumentContext,
|
|
44
|
+
J as useDocumentContext,
|
|
45
|
+
K as useOpenAPIDocumentContext,
|
|
46
|
+
N as useOperationTabPlugins,
|
|
47
|
+
Q as usePluginSlot
|
|
43
48
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ItemCardProps {
|
|
3
|
+
/** The item's identity row: what the list's side panel shows as its title. */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** Rendered at the end of the title row, e.g. the Try-it button. */
|
|
6
|
+
headerActions?: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The inline frame a single-item section (one endpoint, one operation) renders
|
|
11
|
+
* its detail in: the same header row and body padding as SidePanel, laid out
|
|
12
|
+
* in the page flow instead of a drawer, so the detail reads identically in
|
|
13
|
+
* both places.
|
|
14
|
+
*/
|
|
15
|
+
export default function ItemCard({ title, headerActions, children }: ItemCardProps): import('react').JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -5,28 +5,31 @@ import { ErrorInfo, ReactNode } from 'react';
|
|
|
5
5
|
import { ApiuikitPlugin } from '../../plugins/types';
|
|
6
6
|
import { LayoutProps } from './Layout';
|
|
7
7
|
export interface IAsyncAPIProps {
|
|
8
|
-
/**
|
|
8
|
+
/** The parsed AsyncAPI JSON, for example a JSON file you imported. `$ref`s in the object are resolved for you. */
|
|
9
9
|
asyncapi: AsyncAPIDocumentData;
|
|
10
|
-
/**
|
|
10
|
+
/** Theme, which sections to show, and sidebar options. See [Configuration](https://apiuikit.com/docs/configuration). */
|
|
11
11
|
config?: ConfigInterface;
|
|
12
|
-
/**
|
|
12
|
+
/** Plugins that add UI to this page, such as a "try it" panel. See [Plugins](https://apiuikit.com/docs/plugins). */
|
|
13
13
|
plugins?: ApiuikitPlugin[];
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Pass `"resolved"` when the document is already fully dereferenced.
|
|
16
|
+
* Leftover `$ref`s are still resolved, and a warning is logged.
|
|
17
|
+
* See [Without Parser](https://apiuikit.com/docs/no-parser).
|
|
18
|
+
*/
|
|
15
19
|
kind?: "resolved";
|
|
16
|
-
/**
|
|
20
|
+
/** UI shown if rendering throws. A built-in fallback is used when this is omitted. */
|
|
17
21
|
errorFallback?: ReactNode | ErrorBoundaryFallbackRenderer;
|
|
18
|
-
/** Called
|
|
22
|
+
/** Called when rendering throws, for example to report it to your own logging. */
|
|
19
23
|
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
20
|
-
/**
|
|
24
|
+
/** Which tab and item to select on first render, for example from a URL. Applied once. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
|
|
21
25
|
initialLocation?: LayoutProps["initialLocation"];
|
|
22
|
-
/**
|
|
26
|
+
/** Called when the selected tab or item changes, for example to keep a URL in sync. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
|
|
23
27
|
onLocationChange?: LayoutProps["onLocationChange"];
|
|
24
28
|
}
|
|
25
29
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* `AsyncAPIRenderer` instead, which parses first.
|
|
30
|
+
* A full AsyncAPI documentation page: sidebar, search, servers, operations,
|
|
31
|
+
* messages, and schemas. Pass `asyncapi` the parsed JSON. For a YAML or JSON
|
|
32
|
+
* string, use AsyncAPIRenderer, which parses the text first.
|
|
30
33
|
*/
|
|
31
34
|
declare const AsyncAPI: (props: IAsyncAPIProps) => import('react').JSX.Element;
|
|
32
35
|
export default AsyncAPI;
|
|
@@ -4,28 +4,34 @@ import { ErrorBoundaryFallbackRenderer } from '../../components/ErrorBoundary';
|
|
|
4
4
|
import { ErrorInfo, ReactNode } from 'react';
|
|
5
5
|
import { ApiuikitPlugin } from '../../plugins/types';
|
|
6
6
|
interface AsyncAPIRendererProps {
|
|
7
|
-
/**
|
|
7
|
+
/** The AsyncAPI document as a YAML or JSON string. It is parsed before the page renders. */
|
|
8
8
|
raw: string;
|
|
9
|
-
/**
|
|
9
|
+
/** Theme, which sections to show, and sidebar options. See [Configuration](https://apiuikit.com/docs/configuration). */
|
|
10
10
|
config?: ConfigInterface;
|
|
11
|
-
/**
|
|
11
|
+
/** Plugins that add UI to this page, such as a "try it" panel. See [Plugins](https://apiuikit.com/docs/plugins). */
|
|
12
12
|
plugins?: ApiuikitPlugin[];
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Called with parser errors and warnings after each parse.
|
|
15
|
+
* A document that fails to parse does not render a page; this is where you hear about it.
|
|
16
|
+
* See [With Parser](https://apiuikit.com/docs/with-parser).
|
|
17
|
+
*/
|
|
14
18
|
onDiagnostics?: (diagnostics: unknown[]) => void;
|
|
15
|
-
/**
|
|
19
|
+
/** UI shown if rendering the parsed document throws. A built-in fallback is used when this is omitted. */
|
|
16
20
|
errorFallback?: ReactNode | ErrorBoundaryFallbackRenderer;
|
|
17
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Called when rendering throws, for example to report it to your own logging.
|
|
23
|
+
* Parse failures are reported through `onDiagnostics` instead.
|
|
24
|
+
*/
|
|
18
25
|
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
19
|
-
/**
|
|
26
|
+
/** Which tab and item to select once the parsed document first renders, for example from a URL. Applied once. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
|
|
20
27
|
initialLocation?: IAsyncAPIProps["initialLocation"];
|
|
21
|
-
/**
|
|
28
|
+
/** Called when the selected tab or item changes, for example to keep a URL in sync. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
|
|
22
29
|
onLocationChange?: IAsyncAPIProps["onLocationChange"];
|
|
23
30
|
}
|
|
24
31
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* loaded from a file at runtime.
|
|
32
|
+
* The same full AsyncAPI page as AsyncAPI, starting from the document as text.
|
|
33
|
+
* Pass `raw` a YAML or JSON string. Parser errors and warnings are handed to
|
|
34
|
+
* `onDiagnostics`.
|
|
29
35
|
*/
|
|
30
36
|
export declare function AsyncAPIRenderer({ raw, config, plugins, onDiagnostics, errorFallback, onError, initialLocation, onLocationChange, }: AsyncAPIRendererProps): import('react').JSX.Element | null;
|
|
31
37
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SectionLayout } from '../../components/Section';
|
|
2
|
+
import { MessageObject } from '../../types/asyncapi/MessageObject';
|
|
3
|
+
interface MessageCardProps {
|
|
4
|
+
messageKey: string;
|
|
5
|
+
message: MessageObject;
|
|
6
|
+
layout?: SectionLayout;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* One `components.messages` entry rendered on its own: the same name, key,
|
|
10
|
+
* summary and badges a row of the Messages table shows, with its details
|
|
11
|
+
* (description, payload/headers, tags) open from the start — a lone message
|
|
12
|
+
* has no list to keep compact.
|
|
13
|
+
*/
|
|
14
|
+
export default function MessageCard({ messageKey, message, layout }: MessageCardProps): import('react').JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -5,28 +5,32 @@ import { ErrorInfo, ReactNode } from 'react';
|
|
|
5
5
|
import { ApiuikitPlugin } from '../../plugins/types';
|
|
6
6
|
import { OpenAPILayoutProps } from './Layout';
|
|
7
7
|
export interface IOpenAPIProps {
|
|
8
|
-
/**
|
|
8
|
+
/** The parsed OpenAPI JSON, for example a JSON file you imported. `$ref`s in the object are resolved for you. */
|
|
9
9
|
openapi: OpenAPIDocumentData;
|
|
10
|
-
/**
|
|
10
|
+
/** Theme, which sections to show, and sidebar options. See [Configuration](https://apiuikit.com/docs/configuration). */
|
|
11
11
|
config?: ConfigInterface;
|
|
12
|
-
/**
|
|
12
|
+
/** Plugins that add UI to this page, such as a "try it" panel. See [Plugins](https://apiuikit.com/docs/plugins). */
|
|
13
13
|
plugins?: ApiuikitPlugin[];
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Pass `"resolved"` when the document is already fully dereferenced.
|
|
16
|
+
* Leftover `$ref`s are still resolved, and a warning is logged.
|
|
17
|
+
* See [Without Parser](https://apiuikit.com/docs/no-parser).
|
|
18
|
+
*/
|
|
15
19
|
kind?: "resolved";
|
|
16
|
-
/**
|
|
20
|
+
/** UI shown if rendering throws. A built-in fallback is used when this is omitted. */
|
|
17
21
|
errorFallback?: ReactNode | ErrorBoundaryFallbackRenderer;
|
|
18
|
-
/** Called
|
|
22
|
+
/** Called when rendering throws, for example to report it to your own logging. */
|
|
19
23
|
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
20
|
-
/**
|
|
24
|
+
/** Which tab and item to select on first render, for example from a URL. Applied once. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
|
|
21
25
|
initialLocation?: OpenAPILayoutProps["initialLocation"];
|
|
22
|
-
/**
|
|
26
|
+
/** Called when the selected tab or item changes, for example to keep a URL in sync. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
|
|
23
27
|
onLocationChange?: OpenAPILayoutProps["onLocationChange"];
|
|
24
28
|
}
|
|
25
29
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
+
* A full OpenAPI documentation page: sidebar, search, servers, endpoints, and
|
|
31
|
+
* schemas. Webhooks appear when the document declares them. Pass `openapi` the
|
|
32
|
+
* parsed JSON. For a YAML or JSON string, use OpenAPIRenderer, which parses
|
|
33
|
+
* the text first.
|
|
30
34
|
*/
|
|
31
35
|
declare const OpenAPI: (props: IOpenAPIProps) => import('react').JSX.Element;
|
|
32
36
|
export default OpenAPI;
|
|
@@ -4,28 +4,34 @@ import { ErrorBoundaryFallbackRenderer } from '../../components/ErrorBoundary';
|
|
|
4
4
|
import { ErrorInfo, ReactNode } from 'react';
|
|
5
5
|
import { ApiuikitPlugin } from '../../plugins/types';
|
|
6
6
|
interface OpenAPIRendererProps {
|
|
7
|
-
/**
|
|
7
|
+
/** The OpenAPI document as a YAML or JSON string. It is parsed before the page renders. */
|
|
8
8
|
raw: string;
|
|
9
|
-
/**
|
|
9
|
+
/** Theme, which sections to show, and sidebar options. See [Configuration](https://apiuikit.com/docs/configuration). */
|
|
10
10
|
config?: ConfigInterface;
|
|
11
|
-
/**
|
|
11
|
+
/** Plugins that add UI to this page, such as a "try it" panel. See [Plugins](https://apiuikit.com/docs/plugins). */
|
|
12
12
|
plugins?: ApiuikitPlugin[];
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Called with parser errors and warnings after each parse.
|
|
15
|
+
* A document that fails to parse does not render a page; this is where you hear about it.
|
|
16
|
+
* See [With Parser](https://apiuikit.com/docs/with-parser).
|
|
17
|
+
*/
|
|
14
18
|
onDiagnostics?: (diagnostics: unknown[]) => void;
|
|
15
|
-
/**
|
|
19
|
+
/** UI shown if rendering the parsed document throws. A built-in fallback is used when this is omitted. */
|
|
16
20
|
errorFallback?: ReactNode | ErrorBoundaryFallbackRenderer;
|
|
17
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Called when rendering throws, for example to report it to your own logging.
|
|
23
|
+
* Parse failures are reported through `onDiagnostics` instead.
|
|
24
|
+
*/
|
|
18
25
|
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
19
|
-
/**
|
|
26
|
+
/** Which tab and item to select once the parsed document first renders, for example from a URL. Applied once. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
|
|
20
27
|
initialLocation?: IOpenAPIProps["initialLocation"];
|
|
21
|
-
/**
|
|
28
|
+
/** Called when the selected tab or item changes, for example to keep a URL in sync. See [Deep linking](https://apiuikit.com/docs/deep-linking). */
|
|
22
29
|
onLocationChange?: IOpenAPIProps["onLocationChange"];
|
|
23
30
|
}
|
|
24
31
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* or loaded from a file at runtime.
|
|
32
|
+
* The same full OpenAPI page as OpenAPI, starting from the document as text.
|
|
33
|
+
* Pass `raw` a YAML or JSON string. Parser errors and warnings are handed to
|
|
34
|
+
* `onDiagnostics`.
|
|
29
35
|
*/
|
|
30
36
|
export declare function OpenAPIRenderer({ raw, config, plugins, onDiagnostics, errorFallback, onError, initialLocation, onLocationChange, }: OpenAPIRendererProps): import('react').JSX.Element | null;
|
|
31
37
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SectionLayout } from '../../components/Section';
|
|
2
|
+
import { Operation as OperationType } from '../../types/asyncapi/Operation';
|
|
3
|
+
interface OperationCardProps {
|
|
4
|
+
operationKey: string;
|
|
5
|
+
op: OperationType;
|
|
6
|
+
layout?: SectionLayout;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* One AsyncAPI operation rendered inline: the header and detail the list's
|
|
10
|
+
* side panel shows for it (Operations.tsx), framed as a card in the page flow.
|
|
11
|
+
*/
|
|
12
|
+
export default function OperationCard({ operationKey, op, layout }: OperationCardProps): import('react').JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Operation as OperationType } from '../../types/asyncapi/Operation';
|
|
2
|
+
/**
|
|
3
|
+
* An operation's identity: action badge and channel address. Shared by the
|
|
4
|
+
* list's side-panel title (Operations.tsx) and the inline single-operation
|
|
5
|
+
* card. Falls back to the operation key for a channel without an address.
|
|
6
|
+
*/
|
|
7
|
+
export declare function OperationTitle({ op, operationKey }: {
|
|
8
|
+
op: OperationType;
|
|
9
|
+
operationKey: string;
|
|
10
|
+
}): import('react').JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* The built-in WebSocket Try-it button for an operation, or nothing while
|
|
13
|
+
* `show.tryIt` is off. The button itself renders nothing for an operation
|
|
14
|
+
* with no WebSocket server, so non-WS documents get an unchanged header.
|
|
15
|
+
*/
|
|
16
|
+
export declare function OperationHeaderActions({ operationKey }: {
|
|
17
|
+
operationKey: string;
|
|
18
|
+
}): import('react').JSX.Element | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SectionLayout } from '../../components/Section';
|
|
2
|
+
import { HttpMethod, OpenAPIPathItemData, OpenAPISecuritySchemeData } from '../../types/openapi';
|
|
3
|
+
interface EndpointProps {
|
|
4
|
+
method: HttpMethod;
|
|
5
|
+
path: string;
|
|
6
|
+
/** The Path Item `path` lives under; its shared parameters merge into the operation's. */
|
|
7
|
+
pathItem: OpenAPIPathItemData;
|
|
8
|
+
/** Every path in the same list, so response links can tell whether their target operationId exists. */
|
|
9
|
+
paths: Record<string, OpenAPIPathItemData | undefined>;
|
|
10
|
+
security?: Array<Record<string, string[]>>;
|
|
11
|
+
securitySchemes?: Record<string, OpenAPISecuritySchemeData>;
|
|
12
|
+
/** Prefix for DOM anchor ids — "webhook" for webhooks, as in Paths.tsx. */
|
|
13
|
+
idPrefix?: string;
|
|
14
|
+
/** Called when a response link to another operation is followed. Without it, links render as plain text. */
|
|
15
|
+
onNavigate?: (operationId: string) => void;
|
|
16
|
+
layout?: SectionLayout;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* One endpoint (or webhook) rendered inline: the header and detail the list's
|
|
20
|
+
* side panel shows for it (Paths.tsx), framed as a card in the page flow.
|
|
21
|
+
*/
|
|
22
|
+
export default function Endpoint({ method, path, pathItem, paths, security, securitySchemes, idPrefix, onNavigate, layout, }: EndpointProps): import('react').JSX.Element | null;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HttpMethod, OpenAPIParameterData } from '../../types/openapi';
|
|
2
|
+
/**
|
|
3
|
+
* An endpoint's identity: method badge, path, query-parameter chip. The path
|
|
4
|
+
* keeps the room and clips to a single line (its ellipsis peeks the whole
|
|
5
|
+
* thing); the query parameters — the part that actually ran the header long —
|
|
6
|
+
* sit beside it as a chip. Shared by the list's side-panel title (Paths.tsx)
|
|
7
|
+
* and the inline single-endpoint card (Endpoint.tsx).
|
|
8
|
+
*/
|
|
9
|
+
export declare function EndpointTitle({ method, path, parameters, }: {
|
|
10
|
+
method: HttpMethod;
|
|
11
|
+
path: string;
|
|
12
|
+
parameters: OpenAPIParameterData[];
|
|
13
|
+
}): import('react').JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* The built-in Try-it button for an endpoint, or nothing while `show.tryIt`
|
|
16
|
+
* is off or the ambient document isn't an OpenAPI one.
|
|
17
|
+
*/
|
|
18
|
+
export declare function EndpointHeaderActions({ method, path }: {
|
|
19
|
+
method: HttpMethod;
|
|
20
|
+
path: string;
|
|
21
|
+
}): import('react').JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ResolvedSchemaInput } from '../../helpers/schemaFormat';
|
|
2
|
+
interface SchemaCardProps {
|
|
3
|
+
schemaName: string;
|
|
4
|
+
/** The entry after resolveSchemaInput — multi-format wrappers normalized for rendering. */
|
|
5
|
+
resolved: ResolvedSchemaInput;
|
|
6
|
+
/** DOM id for search/sidebar anchors. The list uses `schema-<name>`; a standalone card has none by default so it can't collide with the list's. */
|
|
7
|
+
anchorId?: string;
|
|
8
|
+
/** Highlights the card, and lets `focusTarget` reach into its tree. */
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
/** The precisely-matched nested node search navigated to, if any — see Layout.tsx. */
|
|
11
|
+
focusTarget?: {
|
|
12
|
+
tokens: string[];
|
|
13
|
+
id: string;
|
|
14
|
+
} | null;
|
|
15
|
+
}
|
|
16
|
+
/** One `components.schemas` entry: name, description, badges, and its tree. */
|
|
17
|
+
export default function SchemaCard({ schemaName, resolved, anchorId, selected, focusTarget }: SchemaCardProps): import('react').JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HttpMethod, OpenAPIPathItemData } from '../types/openapi';
|
|
2
|
+
/** How a single-endpoint section names its endpoint: by `operationId`, or by method + path. */
|
|
3
|
+
export type EndpointSelector = {
|
|
4
|
+
operationId: string;
|
|
5
|
+
} | {
|
|
6
|
+
method: HttpMethod;
|
|
7
|
+
path: string;
|
|
8
|
+
};
|
|
9
|
+
export interface FoundEndpoint {
|
|
10
|
+
method: HttpMethod;
|
|
11
|
+
path: string;
|
|
12
|
+
pathItem: OpenAPIPathItemData;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Finds one endpoint in a `paths` (or `webhooks`) map. Method matching is
|
|
16
|
+
* case-insensitive, since `"GET"` is what people tend to type and the map
|
|
17
|
+
* keys are lowercase. Returns null when nothing matches.
|
|
18
|
+
*/
|
|
19
|
+
export declare function findEndpoint(paths: Record<string, OpenAPIPathItemData | undefined>, selector: EndpointSelector): FoundEndpoint | null;
|
|
20
|
+
/** A readable form of a selector, for "not found" warnings. */
|
|
21
|
+
export declare function describeEndpointSelector(selector: EndpointSelector): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ChannelAddressParameterDetail } from '../components/ChannelAddress';
|
|
2
|
+
import { QueryParameterDetail } from '../components/QueryParameters';
|
|
3
|
+
import { OpenAPIParameterData } from '../types/openapi';
|
|
4
|
+
export declare function toChannelAddressParameters(parameters: OpenAPIParameterData[]): Record<string, ChannelAddressParameterDetail>;
|
|
5
|
+
export declare function toQueryParameters(parameters: OpenAPIParameterData[]): QueryParameterDetail[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Jl = Object.defineProperty;
|
|
2
2
|
var Wl = (t, e, r) => e in t ? Jl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var Xe = (t, e, r) => Wl(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { g as zn } from "./index-
|
|
4
|
+
import { g as zn } from "./index-BGwEEF4U.js";
|
|
5
5
|
function pi(t) {
|
|
6
6
|
return t.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
7
7
|
}
|