apiuikit 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("./index-C2-zxpuU.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("./index-BK2Ww7ke.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;
@@ -1,5 +1,5 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { d as l } from "./index-DCUxUfs9.js";
2
+ import { d as l } from "./index-Wj8fLc_a.js";
3
3
  function e({ value: r }) {
4
4
  const o = l(r);
5
5
  return o ? /* @__PURE__ */ t(
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-C2-zxpuU.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;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-BK2Ww7ke.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;
@@ -1,4 +1,4 @@
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-DCUxUfs9.js";
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-Wj8fLc_a.js";
2
2
  export {
3
3
  e as AsyncAPI,
4
4
  n as AsyncAPIInfo,
@@ -0,0 +1,23 @@
1
+ /** JSON Schema keywords whose values are subschemas (or maps/lists of them). */
2
+ export declare const SCHEMA_STRUCTURAL_KEYS: Set<string>;
3
+ /** The component schema a JSON Pointer is or points inside of (`#/components/schemas/<name>/…`), if any. */
4
+ export declare const componentSchemaContaining: (pointer: string) => string | undefined;
5
+ /**
6
+ * Names a document's component schemas wherever they've been inlined, so a
7
+ * walker can stop at one instead of re-expanding it at every reference site.
8
+ * In densely linked specs that re-expansion is what blows up: Stripe's
9
+ * response schemas are ~9k distinct objects but tens of millions of nodes
10
+ * walked as a tree.
11
+ *
12
+ * Matched by identity, two ways: resolveDocument inlines a `$ref` as the
13
+ * target object itself (its `copies`), while @scalar/openapi-parser inlines a
14
+ * fresh shallow copy of the target whose structural children (`properties`,
15
+ * `items`, …) are still the target's own — so a node also matches when one of
16
+ * those children is the same object, under the same key, on a named schema of
17
+ * the same `type`. Where such a copy sits inside its own target, resolveDocument
18
+ * cuts the cycle by replacing that child with a `$ref` stub to wherever the
19
+ * child first appeared — often deep under `#/paths`, not under the schema —
20
+ * so with `deref` (against the same resolved document) a stub child is
21
+ * followed and matched the same way.
22
+ */
23
+ export declare const createNamedSchemaLookup: (schemas: Record<string, unknown> | undefined, deref?: (ref: string) => unknown) => ((node: unknown) => string | undefined);
@@ -16,6 +16,14 @@ export interface SearchEntry {
16
16
  schemaFocusTokens?: string[];
17
17
  }
18
18
  export declare const normalizeString: (value: unknown) => string;
19
- /** Walks a single JSON Schema node into flat search entries — spec-agnostic (AsyncAPI and OpenAPI schemas share the same shape), reused by openapiSearchIndex.ts. */
20
- export declare const addSchemaEntries: (entries: SearchEntry[], schema: unknown, schemaKey: string, schemaName: string) => void;
19
+ /**
20
+ * Walks a single JSON Schema node into flat search entries — spec-agnostic (AsyncAPI and OpenAPI schemas share the same shape), reused by openapiSearchIndex.ts.
21
+ *
22
+ * `namedSchemaOf` (createNamedSchemaLookup) recognizes the document's
23
+ * component schemas, each indexed by its own call. A reference to one still gets an entry where it occurs, but the
24
+ * walk doesn't descend into it — otherwise every schema re-indexes everything
25
+ * it can reach: on a densely linked spec like Stripe's, 271k entries for ~10k
26
+ * distinct nodes.
27
+ */
28
+ export declare const addSchemaEntries: (entries: SearchEntry[], schema: unknown, schemaKey: string, schemaName: string, namedSchemaOf?: (node: unknown) => string | undefined) => void;
21
29
  export declare function buildSearchIndex(asyncapi: AsyncAPIDocumentData): SearchEntry[];
@@ -11,8 +11,8 @@ export declare function openApiToMarkdown(doc: OpenAPIDocumentData, deref?: Dere
11
11
  /**
12
12
  * Builds a self-contained Markdown snippet for a single OpenAPI endpoint:
13
13
  * doc info + servers (so the snippet stands alone without the rest of the
14
- * document) followed by that one endpoint's fully-dereferenced parameters,
15
- * request body, and responses, as opposed to `openApiToMarkdown`'s
14
+ * document) followed by that one endpoint's parameters, request body, and
15
+ * responses, then every component schema those reference, as opposed to `openApiToMarkdown`'s
16
16
  * whole-document export. Backs the "Agent Prompt" entry in the endpoint's
17
17
  * code-sample dropdown (components/CodeSamples.tsx).
18
18
  */