@danxbot/ui 15.9.0 → 15.10.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.
@@ -0,0 +1,117 @@
1
+ /** A JSON Schema node (or an OpenAPI "Schema Object", which 3.1 defines as
2
+ * one). Loose on purpose — see the file header. */
3
+ export type OpenApiSchema = Record<string, unknown>;
4
+ export type OpenApiParameterLocation = "path" | "query" | "header" | "cookie";
5
+ export interface OpenApiParameter {
6
+ readonly name: string;
7
+ readonly in: OpenApiParameterLocation;
8
+ readonly required?: boolean;
9
+ readonly deprecated?: boolean;
10
+ readonly description?: string;
11
+ readonly schema?: OpenApiSchema;
12
+ readonly example?: unknown;
13
+ }
14
+ export interface OpenApiMediaType {
15
+ readonly schema?: OpenApiSchema;
16
+ readonly example?: unknown;
17
+ readonly examples?: Record<string, {
18
+ readonly summary?: string;
19
+ readonly value?: unknown;
20
+ }>;
21
+ }
22
+ export interface OpenApiRequestBody {
23
+ readonly required?: boolean;
24
+ readonly description?: string;
25
+ readonly content: Record<string, OpenApiMediaType>;
26
+ }
27
+ export interface OpenApiResponse {
28
+ readonly description: string;
29
+ readonly content?: Record<string, OpenApiMediaType>;
30
+ }
31
+ /** `{securitySchemeName: scopes[]}` — one alternative a caller may satisfy.
32
+ * An operation's `security` is an array of these; several entries in the
33
+ * SAME object mean "all of these together", several objects in the array
34
+ * mean "any one of these". An empty array (`[]` on the operation) means
35
+ * "no security" and overrides the document-level default. */
36
+ export type OpenApiSecurityRequirement = Record<string, readonly string[]>;
37
+ export interface OpenApiOperation {
38
+ readonly operationId?: string;
39
+ readonly summary?: string;
40
+ readonly description?: string;
41
+ readonly tags?: readonly string[];
42
+ readonly deprecated?: boolean;
43
+ readonly parameters?: readonly OpenApiParameter[];
44
+ readonly requestBody?: OpenApiRequestBody;
45
+ readonly responses: Record<string, OpenApiResponse>;
46
+ readonly security?: readonly OpenApiSecurityRequirement[];
47
+ /** Vendor extensions (`x-...`) ride along unread by name, so a caller can
48
+ * still reach `operation["x-served-by"]` off the resolved operation this
49
+ * package hands back from `groupOperations`. */
50
+ readonly [extension: `x-${string}`]: unknown;
51
+ }
52
+ export declare const HTTP_METHODS: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace"];
53
+ export type HttpMethod = (typeof HTTP_METHODS)[number];
54
+ export type OpenApiPathItem = Partial<Record<HttpMethod, OpenApiOperation>> & {
55
+ readonly summary?: string;
56
+ readonly description?: string;
57
+ readonly parameters?: readonly OpenApiParameter[];
58
+ };
59
+ export interface OpenApiSecurityScheme {
60
+ readonly type: "http" | "apiKey" | "oauth2" | "openIdConnect" | "mutualTLS";
61
+ readonly scheme?: string;
62
+ readonly bearerFormat?: string;
63
+ readonly in?: "query" | "header" | "cookie";
64
+ readonly name?: string;
65
+ readonly description?: string;
66
+ readonly openIdConnectUrl?: string;
67
+ readonly flows?: Record<string, {
68
+ readonly scopes?: Record<string, string>;
69
+ }>;
70
+ }
71
+ export interface OpenApiTag {
72
+ readonly name: string;
73
+ readonly description?: string;
74
+ }
75
+ export interface OpenApiDocument {
76
+ readonly openapi: string;
77
+ readonly info: {
78
+ readonly title: string;
79
+ readonly version: string;
80
+ readonly description?: string;
81
+ };
82
+ readonly servers?: readonly {
83
+ readonly url: string;
84
+ readonly description?: string;
85
+ }[];
86
+ readonly tags?: readonly OpenApiTag[];
87
+ readonly paths: Record<string, OpenApiPathItem>;
88
+ readonly components?: {
89
+ readonly schemas?: Record<string, OpenApiSchema>;
90
+ readonly securitySchemes?: Record<string, OpenApiSecurityScheme>;
91
+ };
92
+ readonly security?: readonly OpenApiSecurityRequirement[];
93
+ }
94
+ /** One operation, already paired with its method + path — `groupOperations`'s
95
+ * output unit, and `OperationCard`'s own prop. Carrying `path`/`method`
96
+ * alongside the raw `OpenApiOperation` means every renderer below the group
97
+ * level can stay a pure function of "one operation", never reaching back up
98
+ * for context its parent already had. */
99
+ export interface ResolvedOperation {
100
+ readonly method: HttpMethod;
101
+ readonly path: string;
102
+ readonly operation: OpenApiOperation;
103
+ /** Parameters declared on the shared `PathItem` (never overridden — 3.1
104
+ * merges these with the operation's own, operation-level winning on a
105
+ * `name`+`in` collision — see `resolve.ts#mergedParameters`). */
106
+ readonly pathParameters: readonly OpenApiParameter[];
107
+ }
108
+ /** One tag/path group of operations, in document order. */
109
+ export interface OperationGroup {
110
+ /** The tag name, or — when the document declares no tags at all on the
111
+ * operations it carries — the first non-empty path segment (`resolve.ts`).
112
+ * Never both in the same document: a document that tags ANY operation is
113
+ * grouped by tag, with untagged operations falling into `"Other"`. */
114
+ readonly name: string;
115
+ readonly description?: string;
116
+ readonly operations: readonly ResolvedOperation[];
117
+ }
@@ -138,6 +138,7 @@ export { NodeCanvas, LAYOUT_DEFAULTS, edgePath, layoutGraph, neighbourhood, type
138
138
  export { GraphExplorer, frameBoxFor, layoutExplorerTree, neighbourhoodTree, CAMERA_DEFAULTS, centerOn, clampScale, fitBox, fitBoxWithFloor, toContentPoint, toScreenPoint, unionBox, zoomAtPoint, type GraphExplorerProps, type Box, type CameraState, type FitOptions, type FitWithFloorOptions, type FitWithFloorResult, type FrameOverflow, type Point, type ScaleBounds, type Size, type CrossLink, type ExplorerLayout, type ExplorerNodeRenderContext, type ExplorerNodeRenderer, type ExplorerTree, type GraphExplorerVariant, type TreeNode as ExplorerTreeNode, } from "./components/graph-explorer";
139
139
  export { FocusWeb, CENTER_POSITION, PARENT_POSITION, WIDE_RING_THRESHOLD, layoutRing, type FocusNodeRenderContext, type FocusNodeRenderer, type FocusNodeRole, type FocusWebNode, type FocusWebNodeLook, type FocusWebProps, type PlacedRingNode, } from "./components/focus-web";
140
140
  export { SequenceDiagram, type SequenceDiagramProps, type SequenceStep, } from "./components/SequenceDiagram";
141
+ export { OpenApiViewer, type OpenApiViewerProps, OperationCard, type OperationCardProps, SchemaView, type SchemaViewProps, groupOperations, isHttpMethod, mergedParameters, operationAnchorId, resolveSchema, schemaToExample, type SchemaResolution, HTTP_METHODS, type HttpMethod, type OpenApiDocument, type OpenApiMediaType, type OpenApiOperation, type OpenApiParameter, type OpenApiParameterLocation, type OpenApiPathItem, type OpenApiRequestBody, type OpenApiResponse, type OpenApiSchema, type OpenApiSecurityRequirement, type OpenApiSecurityScheme, type OpenApiTag, type OperationGroup, type ResolvedOperation, } from "./components/openapi";
141
142
  export { defineRecordType, resetRecordTypes, useRecord, useRecords, useStaleness, write, writeAll, peekRecord, readState, readStaleness, subscribeToKey, subscribeToStaleness, retainKeys, sweepRecords, setRecordStoreTenant, getRecordStoreTenant, flushRecordNotifications, resetRecordStore, recordStoreStats, UNKNOWN_STATE, normalizeTypeName, normalizeTimestamp, recordKey, isRecordRef, type RecordRef, type ReadOptions, type RecordPayload, type RecordState, type RecordTypeOptions, type RecordTypeToken, type StalenessEntry, type WriteAllResult, type WriteOptions, type WriteResult, type WriteSource, type WriteVerdict, } from "./lib/records";
142
143
  export { RealtimeProvider, useRealtime, useRealtimeEpoch, useRealtimeHealth, useRealtimeRegistry, SubscriptionRegistry, normalizeScope, scopeKey, subscriptionKey, readRealtimeEpoch, subscribeToRealtimeEpoch, subscribeToRealtimeEvents, resetRealtimeSignals, type RealtimeChannel, type RealtimeConnectionState, type RealtimeDiagnostic, type RealtimeEvent, type RealtimeHealth, type RealtimeProviderProps, type RealtimeScope, type RealtimeScopeInput, type RealtimeStatus, type RealtimeTransport, type RegistryOptions, type SubscriptionHealth, type SubscriptionLease, type SubscriptionRequest, } from "./lib/realtime";
143
144
  export { useRecordRead, useRecordListRead, useRecordStoreSweep, applyMutationResult, optimisticWrite, beginOptimisticWrite, resetOptimisticWrites, type OptimisticHandle, type OptimisticWriteOptions, type OptimisticWriteSpec, type SlotDescriptor, acquireSlot, appendCreated, emptySlotSnapshot, readSlot, resetSlots, slotKeys, subscribeToSlot, writeSlot, RefetchRunner, registerActiveRead, resetActiveReads, type ActiveRead, type ListFetch, type ListFetchResult, type ListReadOptions, type ListReadResult, type ReadError, type RecordFetch, type RecordReadOptions, type RecordReadResult, type RunnerOptions, type SlotSnapshot, } from "./lib/reads";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danxbot/ui",
3
- "version": "15.9.0",
3
+ "version": "15.10.0",
4
4
  "type": "module",
5
5
  "description": "Danxbot — a domain-agnostic React design system with motion as a first-class primitive.",
6
6
  "license": "MIT",