apiuikit 0.5.0 → 1.0.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.
- package/README.md +47 -6
- package/dist/apiuikit.cjs.js +1 -1
- package/dist/apiuikit.css +1 -1
- package/dist/apiuikit.es.js +24 -17
- package/dist/c-Bz1-FJiA.js +277 -0
- package/dist/c-C_Sx7N-F.cjs +1 -0
- package/dist/clojure-DWYEZwCD.cjs +1 -0
- package/dist/clojure-aY2138WD.js +135 -0
- package/dist/components/Authorization.d.ts +28 -17
- package/dist/components/ChannelAddress.d.ts +17 -3
- package/dist/components/CodeBlock.d.ts +4 -1
- package/dist/components/CodeSamples.d.ts +12 -0
- package/dist/components/CollapsiblePanel.d.ts +24 -0
- package/dist/components/CopyMarkdownButton.d.ts +15 -0
- package/dist/components/Examples.d.ts +4 -2
- package/dist/components/InfoMetadata.d.ts +15 -2
- package/dist/components/Markdown.d.ts +2 -0
- package/dist/components/MarkdownExportMenu.d.ts +13 -0
- package/dist/components/MethodBadge.d.ts +14 -0
- package/dist/components/Navigation/AsyncAPINavigation.d.ts +28 -0
- package/dist/components/Navigation/Navigation.d.ts +58 -0
- package/dist/components/Navigation/OpenAPINavigation.d.ts +22 -0
- package/dist/components/Navigation/SpecNavigation.d.ts +25 -0
- package/dist/components/Navigation/index.d.ts +4 -0
- package/dist/components/Navigation/sharedSections.d.ts +10 -0
- package/dist/components/Navigation/spineTicks.d.ts +28 -0
- package/dist/components/Navigation/tests/spineTicks.test.d.ts +1 -0
- package/dist/components/RenderExtensions.d.ts +14 -1
- package/dist/components/Section.d.ts +3 -1
- package/dist/components/ServerAddressBanner.d.ts +16 -0
- package/dist/components/SidePanel.d.ts +2 -0
- package/dist/components/Tabs.d.ts +3 -1
- package/dist/components/schema/SchemaTab.d.ts +19 -3
- package/dist/components/tests/Bindings.test.d.ts +1 -0
- package/dist/components/tests/ChannelAddress.test.d.ts +1 -0
- package/dist/components/tests/CodeBlock.test.d.ts +1 -0
- package/dist/components/tests/CodeSamples.test.d.ts +1 -0
- package/dist/components/tests/CopyMarkdownButton.test.d.ts +1 -0
- package/dist/components/tests/MarkdownExportMenu.test.d.ts +1 -0
- package/dist/config/config.d.ts +8 -0
- package/dist/containers/AsyncAPI/AsyncAPI.d.ts +1 -1
- package/dist/containers/Information/InformationSection.d.ts +22 -0
- package/dist/containers/Information/OpenAPIInformation.d.ts +9 -0
- package/dist/containers/OpenAPI/Layout.d.ts +7 -0
- package/dist/containers/OpenAPI/OpenAPI.d.ts +18 -0
- package/dist/containers/OpenAPI/OpenAPIDocumentProvider.d.ts +13 -0
- package/dist/containers/OpenAPI/OpenAPIRenderer.d.ts +17 -0
- package/dist/containers/OpenAPI/tests/OpenAPI.test.d.ts +1 -0
- package/dist/containers/OpenAPI/tests/OpenAPIRenderer.test.d.ts +1 -0
- package/dist/containers/Operation/Operations.d.ts +2 -1
- package/dist/containers/Path/OperationCallbacks.d.ts +37 -0
- package/dist/containers/Path/PathOperation.d.ts +21 -0
- package/dist/containers/Path/Paths.d.ts +16 -0
- package/dist/containers/Path/ResponseLinks.d.ts +21 -0
- package/dist/containers/Path/tests/PathOperation.test.d.ts +1 -0
- package/dist/containers/Path/tests/Paths.test.d.ts +1 -0
- package/dist/containers/Server/OpenAPIServer.d.ts +4 -0
- package/dist/containers/Server/OpenAPIServers.d.ts +13 -0
- package/dist/contants.d.ts +7 -0
- package/dist/contexts/useSpec.d.ts +28 -6
- package/dist/crystal-BcGgviMR.cjs +1 -0
- package/dist/crystal-BtD5fR4q.js +283 -0
- package/dist/csharp-AnFv7wyC.js +382 -0
- package/dist/csharp-yuAGIuP4.cjs +1 -0
- package/dist/go-BpetKc7b.cjs +1 -0
- package/dist/go-CkZ9_bn0.js +151 -0
- package/dist/helpers/codeSamples.d.ts +92 -0
- package/dist/helpers/exampleSchema.d.ts +19 -0
- package/dist/helpers/hljsLanguages.d.ts +6 -0
- package/dist/helpers/openapiParser.d.ts +10 -0
- package/dist/helpers/openapiSearchIndex.d.ts +3 -0
- package/dist/helpers/resolveDocument.d.ts +8 -0
- package/dist/helpers/runtimeExpression.d.ts +15 -0
- package/dist/helpers/schemaExample.d.ts +9 -0
- package/dist/helpers/searchIndex.d.ts +5 -2
- package/dist/helpers/tests/codeSamples.test.d.ts +1 -0
- package/dist/helpers/tests/exampleSchema.test.d.ts +1 -0
- package/dist/helpers/tests/openapiSearchIndex.test.d.ts +1 -0
- package/dist/helpers/tests/toMarkdown.test.d.ts +1 -0
- package/dist/helpers/toMarkdown.d.ts +20 -0
- package/dist/hooks/useDocumentProviderValue.d.ts +27 -0
- package/dist/hooks/useFuseSearch.d.ts +14 -0
- package/dist/hooks/useOpenAPISearch.d.ts +9 -0
- package/dist/hooks/useSearchResultFocus.d.ts +18 -0
- package/dist/hooks/useSpecLayoutController.d.ts +51 -0
- package/dist/hooks/useSpecSearch.d.ts +2 -6
- package/dist/http--XH4hLDt.cjs +1 -0
- package/dist/http-DKeNlJKS.js +85 -0
- package/dist/icons/Copy.d.ts +6 -0
- package/dist/icons/Info.d.ts +5 -0
- package/dist/index-C9Pyi0cN.cjs +177 -0
- package/dist/index-CFqT-0u9.js +17544 -0
- package/dist/index-CkQBQKmb.cjs +139 -0
- package/dist/index-DSOufiFF.js +18957 -0
- package/dist/{index-BcNlIoEF.cjs → index-QHokKPe8.cjs} +6 -6
- package/dist/index-xz-kuNHf.js +25412 -0
- package/dist/index.d.ts +7 -0
- package/dist/java-BIk0G-rH.cjs +1 -0
- package/dist/java-BicX26Pg.js +240 -0
- package/dist/kotlin-BwB8b-YX.js +242 -0
- package/dist/kotlin-kGuORR5a.cjs +2 -0
- package/dist/objectivec-CnyrJ13Z.js +237 -0
- package/dist/objectivec-CoeV81Tz.cjs +1 -0
- package/dist/ocaml-0j7KDjso.cjs +1 -0
- package/dist/ocaml-T8IqWCjo.js +67 -0
- package/dist/php-BL35ZHWM.js +566 -0
- package/dist/php-DF4zG2hq.cjs +2 -0
- package/dist/powershell-CvydS3ek.cjs +1 -0
- package/dist/powershell-DuhUKWoO.js +236 -0
- package/dist/protoToJsonSchema-ScIUJOSl.cjs +83 -0
- package/dist/protoToJsonSchema-dSLrBGlF.js +6131 -0
- package/dist/{protobufSchemaParser-sEw46uRx.cjs → protobufSchemaParser-Bd0cGKWk.cjs} +1 -1
- package/dist/{protobufSchemaParser-BQVXzHsQ.js → protobufSchemaParser-DE3p5F51.js} +2 -2
- package/dist/public/createSectionRoot.d.ts +30 -0
- package/dist/public/openapiSections.d.ts +26 -0
- package/dist/r-B8fCBydS.js +207 -0
- package/dist/r-CYaZnHkA.cjs +1 -0
- package/dist/ruby-CvOid-1s.js +388 -0
- package/dist/ruby-nPcbuC2a.cjs +1 -0
- package/dist/rust-BocnJ3Ns.js +305 -0
- package/dist/rust-DKnYCg2f.cjs +1 -0
- package/dist/swift-C35Eof-I.js +799 -0
- package/dist/swift-CAnH__EC.cjs +1 -0
- package/dist/types/openapi.d.ts +85 -0
- package/package.json +17 -2
- package/dist/components/Navigation.d.ts +0 -28
- package/dist/icons/SideBar.d.ts +0 -6
- package/dist/index-BG6colCU.js +0 -11473
- package/dist/index-Bmw7IyyF.cjs +0 -73
- package/dist/index-CEf0X0H_.js +0 -25414
- package/dist/protoToJsonSchema-BcqPKXqK.js +0 -6174
- package/dist/protoToJsonSchema-C43lKcgx.cjs +0 -83
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function W(t){return t?typeof t=="string"?t:t.source:null}function m(t){return e("(?=",t,")")}function e(...t){return t.map(A=>W(A)).join("")}function fe(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function s(...t){return"("+(fe(t).capture?"":"?:")+t.map(c=>W(c)).join("|")+")"}const g=t=>e(/\b/,t,/\w$/.test(t)?/\b/:/\B/),he=["Protocol","Type"].map(g),K=["init","self"].map(g),ye=["Any","Self"],C=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],G=["false","nil","true"],Ne=["assignment","associativity","higherThan","left","lowerThan","none","right"],Te=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],x=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],$=s(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Y=s($,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),S=e($,Y,"*"),j=s(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),T=s(j,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),a=e(j,T,"*"),N=e(/[A-Z]/,T,"*"),Re=["attached","autoclosure",e(/convention\(/,s("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",e(/objc\(/,a,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],_e=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function we(t){const o={match:/\s+/,relevance:0},A=t.COMMENT("/\\*","\\*/",{contains:["self"]}),c=[t.C_LINE_COMMENT_MODE,A],X={match:[/\./,s(...he,...K)],className:{2:"keyword"}},z={match:e(/\./,s(...C)),relevance:0},H=C.filter(n=>typeof n=="string").concat(["_|0"]),V=C.filter(n=>typeof n!="string").concat(ye).map(g),q={variants:[{className:"keyword",match:s(...V,...K)}]},i={$pattern:s(/\b\w+/,/#\w+/),keyword:H.concat(Te),literal:G},r=[X,z,q],Z={match:e(/\./,s(...x)),relevance:0},J={className:"built_in",match:e(/\b/,s(...x),/(?=\()/)},R=[Z,J],O={match:/->/,relevance:0},Q={className:"operator",relevance:0,variants:[{match:S},{match:`\\.(\\.|${Y})+`}]},E=[O,Q],b="([0-9]_*)+",D="([0-9a-fA-F]_*)+",d={className:"number",relevance:0,variants:[{match:`\\b(${b})(\\.(${b}))?([eE][+-]?(${b}))?\\b`},{match:`\\b0x(${D})(\\.(${D}))?([pP][+-]?(${b}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},v=(n="")=>({className:"subst",variants:[{match:e(/\\/,n,/[0\\tnr"']/)},{match:e(/\\/,n,/u\{[0-9a-fA-F]{1,8}\}/)}]}),ee=(n="")=>({className:"subst",match:e(/\\/,n,/[\t ]*(?:[\r\n]|\r\n)/)}),P=(n="")=>({className:"subst",label:"interpol",begin:e(/\\/,n,/\(/),end:/\)/}),F=(n="")=>({begin:e(n,/"""/),end:e(/"""/,n),contains:[v(n),ee(n),P(n)]}),f=(n="")=>({begin:e(n,/"/),end:e(/"/,n),contains:[v(n),P(n)]}),l={className:"string",variants:[F(),F("#"),F("##"),F("###"),f(),f("#"),f("##"),f("###")]},L=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],ne={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:L},_=n=>{const y=e(n,/\//),p=e(/\//,n);return{begin:y,end:p,contains:[...L,{scope:"comment",begin:`#(?!.*${p})`,end:/$/}]}},k={scope:"regexp",variants:[_("###"),_("##"),_("#"),ne]},B={match:e(/`/,a,/`/)},te={className:"variable",match:/\$\d+/},se={className:"variable",match:`\\$${T}+`},w=[B,te,se],ae={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:_e,contains:[...E,d,l]}]}},oe={scope:"keyword",match:e(/@/,s(...Re),m(s(/\(/,/\s+/)))},ce={scope:"meta",match:e(/@/,a)},h=[ae,oe,ce],u={match:m(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:e(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,T,"+")},{className:"type",match:N,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:e(/\s+&\s+/,m(N)),relevance:0}]},ie={begin:/</,end:/>/,keywords:i,contains:[...c,...r,...h,O,u]};u.contains.push(ie);const re={match:e(a,/\s*:/),keywords:"_|0",relevance:0},M={begin:/\(/,end:/\)/,relevance:0,keywords:i,contains:["self",re,...c,k,...r,...R,...E,d,l,...w,...h,u]},I={begin:/</,end:/>/,keywords:"repeat each",contains:[...c,u]},ue={begin:s(m(e(a,/\s*:/)),m(e(a,/\s+/,a,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:a}]},U={begin:/\(/,end:/\)/,keywords:i,contains:[ue,...c,...r,...E,d,l,...h,u,M],endsParent:!0,illegal:/["']/},le={match:[/(func|macro)/,/\s+/,s(B.match,a,S)],className:{1:"keyword",3:"title.function"},contains:[I,U,o],illegal:[/\[/,/%/]},Ee={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[I,U,o],illegal:/\[|%/},de={match:[/operator/,/\s+/,S],className:{1:"keyword",3:"title"}},pe={begin:[/precedencegroup/,/\s+/,N],className:{1:"keyword",3:"title"},contains:[u],keywords:[...Ne,...G],end:/}/},me={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ae={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},be={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,a,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:i,contains:[I,...r,{begin:/:/,end:/\{/,keywords:i,contains:[{scope:"title.class.inherited",match:N},...r],relevance:0}]};for(const n of l.variants){const y=n.contains.find(Fe=>Fe.label==="interpol");y.keywords=i;const p=[...r,...R,...E,d,l,...w];y.contains=[...p,{begin:/\(/,end:/\)/,contains:["self",...p]}]}return{name:"Swift",keywords:i,contains:[...c,le,Ee,me,Ae,be,de,pe,{beginKeywords:"import",end:/$/,contains:[...c],relevance:0},k,...r,...R,...E,d,l,...w,...h,u,M]}}exports.default=we;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { OpenAPIV3, OpenAPIV3_1 } from 'openapi-types';
|
|
2
|
+
import { SchemaNodeData } from './schema';
|
|
3
|
+
export type OpenAPIInfoData = OpenAPIV3.InfoObject | OpenAPIV3_1.InfoObject;
|
|
4
|
+
export type OpenAPIServerData = OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject;
|
|
5
|
+
export type OpenAPIServerVariableData = OpenAPIV3.ServerVariableObject | OpenAPIV3_1.ServerVariableObject;
|
|
6
|
+
export type OpenAPIParameterData = OpenAPIV3.ParameterObject | OpenAPIV3_1.ParameterObject;
|
|
7
|
+
export type OpenAPIRequestBodyData = OpenAPIV3.RequestBodyObject | OpenAPIV3_1.RequestBodyObject;
|
|
8
|
+
export type OpenAPIResponseData = OpenAPIV3.ResponseObject | OpenAPIV3_1.ResponseObject;
|
|
9
|
+
export type OpenAPIMediaTypeData = OpenAPIV3.MediaTypeObject | OpenAPIV3_1.MediaTypeObject;
|
|
10
|
+
export type OpenAPIHeaderData = OpenAPIV3.HeaderObject | OpenAPIV3_1.HeaderObject;
|
|
11
|
+
export type OpenAPILinkData = OpenAPIV3.LinkObject | OpenAPIV3_1.LinkObject;
|
|
12
|
+
export type OpenAPISecuritySchemeData = OpenAPIV3.SecuritySchemeObject | OpenAPIV3_1.SecuritySchemeObject;
|
|
13
|
+
export type OpenAPITagData = OpenAPIV3.TagObject | OpenAPIV3_1.TagObject;
|
|
14
|
+
export type OpenAPIExternalDocsData = OpenAPIV3.ExternalDocumentationObject | OpenAPIV3_1.ExternalDocumentationObject;
|
|
15
|
+
export declare const HTTP_METHODS: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace"];
|
|
16
|
+
export type HttpMethod = (typeof HTTP_METHODS)[number];
|
|
17
|
+
export interface OpenAPIOperationData extends Record<string, unknown> {
|
|
18
|
+
operationId?: string;
|
|
19
|
+
summary?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
tags?: string[];
|
|
22
|
+
parameters?: OpenAPIParameterData[];
|
|
23
|
+
requestBody?: OpenAPIRequestBodyData;
|
|
24
|
+
responses?: Record<string, OpenAPIResponseData>;
|
|
25
|
+
security?: Array<Record<string, string[]>>;
|
|
26
|
+
deprecated?: boolean;
|
|
27
|
+
externalDocs?: OpenAPIExternalDocsData;
|
|
28
|
+
/**
|
|
29
|
+
* Out-of-band requests the API sends *to the caller* after this operation.
|
|
30
|
+
* Keyed by callback name, then by a URL-template expression naming where the
|
|
31
|
+
* request goes, whose value is a Path Item Object like any other.
|
|
32
|
+
*/
|
|
33
|
+
callbacks?: Record<string, OpenAPICallbackData>;
|
|
34
|
+
}
|
|
35
|
+
/** One callback's URL-expression map. Each value is a Path Item Object, so it renders like any other operation. */
|
|
36
|
+
export type OpenAPICallbackData = Record<string, OpenAPIPathItemData>;
|
|
37
|
+
export type OpenAPIPathItemData = Partial<Record<HttpMethod, OpenAPIOperationData>> & {
|
|
38
|
+
summary?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
parameters?: OpenAPIParameterData[];
|
|
41
|
+
};
|
|
42
|
+
export interface FlatEndpoint {
|
|
43
|
+
key: string;
|
|
44
|
+
method: HttpMethod;
|
|
45
|
+
path: string;
|
|
46
|
+
}
|
|
47
|
+
export declare const endpointKey: (method: string, path: string) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Parameters shared across every method on a path can be declared once on
|
|
50
|
+
* the PathItem instead of repeated per operation (e.g. a `{userId}` path
|
|
51
|
+
* param declared on `/users/{userId}` itself) — merge those in, with the
|
|
52
|
+
* operation's own parameters overriding a path-item one of the same name+in.
|
|
53
|
+
*/
|
|
54
|
+
export declare function resolveOperationParameters(pathItem: OpenAPIPathItemData | undefined, operation: OpenAPIOperationData | null | undefined): OpenAPIParameterData[];
|
|
55
|
+
/** Flattens `paths` (each holding multiple HTTP methods) into one row per operation, sorted by path. Shared by Paths.tsx (the Endpoints list) and OpenAPINavigation.tsx (the sidebar), which otherwise duplicated this walk. */
|
|
56
|
+
export declare function flattenEndpoints(paths: Record<string, OpenAPIPathItemData | undefined>): FlatEndpoint[];
|
|
57
|
+
/**
|
|
58
|
+
* Internal document model produced by both entry points (mirrors
|
|
59
|
+
* AsyncAPIDocumentData). Both the no-parser path and `@scalar/openapi-parser`
|
|
60
|
+
* output are normalized through `resolveDocument`, so downstream components
|
|
61
|
+
* always deal with one shape: a plain acyclic object tree where cycle points
|
|
62
|
+
* are `$ref` nodes resolved lazily via the context's `deref` (see
|
|
63
|
+
* resolveDocument's contract).
|
|
64
|
+
*/
|
|
65
|
+
export interface OpenAPIDocumentData extends Record<string, unknown> {
|
|
66
|
+
openapi: string;
|
|
67
|
+
info: OpenAPIInfoData;
|
|
68
|
+
servers?: OpenAPIServerData[];
|
|
69
|
+
paths?: Record<string, OpenAPIPathItemData | undefined>;
|
|
70
|
+
/**
|
|
71
|
+
* OpenAPI 3.1's top-level `webhooks`: operations the API sends *out* rather
|
|
72
|
+
* than ones a client calls. Each value is a Path Item Object exactly like
|
|
73
|
+
* `paths`', keyed by an event name instead of a URL path, so both render
|
|
74
|
+
* through the same components.
|
|
75
|
+
*/
|
|
76
|
+
webhooks?: Record<string, OpenAPIPathItemData | undefined>;
|
|
77
|
+
components?: {
|
|
78
|
+
schemas?: Record<string, SchemaNodeData>;
|
|
79
|
+
securitySchemes?: Record<string, OpenAPISecuritySchemeData>;
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
security?: Array<Record<string, string[]>>;
|
|
83
|
+
tags?: OpenAPITagData[];
|
|
84
|
+
externalDocs?: OpenAPIExternalDocsData;
|
|
85
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apiuikit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A React UI library for rendering your API specifications",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/AceTheCreator/apiuikit/issues"
|
|
8
|
+
},
|
|
6
9
|
"repository": {
|
|
7
10
|
"type": "git",
|
|
8
11
|
"url": "https://github.com/AceTheCreator/apiuikit"
|
|
9
12
|
},
|
|
13
|
+
"homepage": "https://apiuikit.com",
|
|
10
14
|
"type": "module",
|
|
15
|
+
"sideEffects": [
|
|
16
|
+
"*.css"
|
|
17
|
+
],
|
|
11
18
|
"main": "./dist/apiuikit.cjs.js",
|
|
12
19
|
"module": "./dist/apiuikit.es.js",
|
|
13
20
|
"types": "./dist/index.d.ts",
|
|
@@ -41,6 +48,7 @@
|
|
|
41
48
|
"dependencies": {
|
|
42
49
|
"@asyncapi/specs": "^6.8.1",
|
|
43
50
|
"@json-schema-tools/reference-resolver": "^1.2.6",
|
|
51
|
+
"@readme/httpsnippet": "^11.4.0",
|
|
44
52
|
"fuse.js": "^7.5.0",
|
|
45
53
|
"highlight.js": "^11.11.1",
|
|
46
54
|
"isomorphic-dompurify": "^2.24.0",
|
|
@@ -48,23 +56,30 @@
|
|
|
48
56
|
"json-schema-resolver": "^3.0.0",
|
|
49
57
|
"marked": "^15.0.11",
|
|
50
58
|
"marked-highlight": "^2.2.1",
|
|
59
|
+
"openapi-types": "^12.1.3",
|
|
51
60
|
"protobufjs": "^7.4.0",
|
|
52
61
|
"react-markdown": "^9.0.3",
|
|
53
|
-
"remark-gfm": "^4.0.1"
|
|
62
|
+
"remark-gfm": "^4.0.1",
|
|
63
|
+
"url": "^0.11.4"
|
|
54
64
|
},
|
|
55
65
|
"peerDependencies": {
|
|
56
66
|
"@asyncapi/parser": "^3.6.0",
|
|
67
|
+
"@scalar/openapi-parser": "^0.28.10",
|
|
57
68
|
"react": ">=18",
|
|
58
69
|
"react-dom": ">=18"
|
|
59
70
|
},
|
|
60
71
|
"peerDependenciesMeta": {
|
|
61
72
|
"@asyncapi/parser": {
|
|
62
73
|
"optional": true
|
|
74
|
+
},
|
|
75
|
+
"@scalar/openapi-parser": {
|
|
76
|
+
"optional": true
|
|
63
77
|
}
|
|
64
78
|
},
|
|
65
79
|
"devDependencies": {
|
|
66
80
|
"@asyncapi/modelina": "^5.10.1",
|
|
67
81
|
"@asyncapi/parser": "^3.6.0",
|
|
82
|
+
"@scalar/openapi-parser": "^0.28.10",
|
|
68
83
|
"@chromatic-com/storybook": "^3.2.3",
|
|
69
84
|
"@eslint/js": "^9.17.0",
|
|
70
85
|
"@storybook/addon-a11y": "^8.6.18",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Operation } from '../types/asyncapi/Operation';
|
|
2
|
-
import { MessageObject } from '../types/asyncapi/MessageObject';
|
|
3
|
-
import { Info } from '../types/asyncapi/Info';
|
|
4
|
-
import { SideBarConfig } from '../config/config';
|
|
5
|
-
export type NavTab = "operations" | "messages" | "schemas";
|
|
6
|
-
export type NavSectionId = NavTab | "servers";
|
|
7
|
-
interface NavigationProps {
|
|
8
|
-
info: Info;
|
|
9
|
-
operations?: Record<string, Operation>;
|
|
10
|
-
messages?: Record<string, MessageObject>;
|
|
11
|
-
schemas?: Record<string, unknown>;
|
|
12
|
-
servers?: Record<string, unknown>;
|
|
13
|
-
/** Which section is currently the user's focus, for header highlighting —
|
|
14
|
-
* a single authoritative value covering all four sections (including
|
|
15
|
-
* Servers) so at most one header is ever highlighted at once. Distinct
|
|
16
|
-
* from `onTabChange`, which only fires for the three switchable tabs. */
|
|
17
|
-
activeTab: NavSectionId | null;
|
|
18
|
-
onTabChange: (tab: NavTab) => void;
|
|
19
|
-
onItemSelect?: (tab: NavTab, key: string) => void;
|
|
20
|
-
onSelectServer?: (key: string) => void;
|
|
21
|
-
selectedItem?: {
|
|
22
|
-
tab: NavSectionId;
|
|
23
|
-
key: string;
|
|
24
|
-
} | null;
|
|
25
|
-
sidebarConfig?: SideBarConfig;
|
|
26
|
-
}
|
|
27
|
-
export default function Navigation({ info, operations, messages, schemas, servers, activeTab, onTabChange, onItemSelect, onSelectServer, selectedItem, sidebarConfig, }: NavigationProps): import("react").JSX.Element;
|
|
28
|
-
export {};
|