apiuikit 0.3.0 → 1.0.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.
Files changed (149) hide show
  1. package/README.md +66 -7
  2. package/dist/LinkedInExtension-6xekO5bX.cjs +1 -0
  3. package/dist/LinkedInExtension-BL-4T9tt.js +21 -0
  4. package/dist/LogoExtension-BOYrY_RE.cjs +1 -0
  5. package/dist/LogoExtension-HOlSsQf-.js +27 -0
  6. package/dist/XExtension-GyRtdHLL.js +23 -0
  7. package/dist/XExtension-jAiATfg-.cjs +1 -0
  8. package/dist/apiuikit.cjs.js +1 -1
  9. package/dist/apiuikit.css +1 -1
  10. package/dist/apiuikit.es.js +24 -17
  11. package/dist/c-Bz1-FJiA.js +277 -0
  12. package/dist/c-C_Sx7N-F.cjs +1 -0
  13. package/dist/clojure-DWYEZwCD.cjs +1 -0
  14. package/dist/clojure-aY2138WD.js +135 -0
  15. package/dist/components/Authorization.d.ts +28 -17
  16. package/dist/components/ChannelAddress.d.ts +8 -2
  17. package/dist/components/CodeBlock.d.ts +4 -1
  18. package/dist/components/CodeSamples.d.ts +12 -0
  19. package/dist/components/CollapsiblePanel.d.ts +24 -0
  20. package/dist/components/CopyMarkdownButton.d.ts +15 -0
  21. package/dist/components/Examples.d.ts +4 -2
  22. package/dist/components/InfoMetadata.d.ts +21 -2
  23. package/dist/components/Markdown.d.ts +2 -0
  24. package/dist/components/MarkdownExportMenu.d.ts +13 -0
  25. package/dist/components/MethodBadge.d.ts +14 -0
  26. package/dist/components/Navigation/AsyncAPINavigation.d.ts +28 -0
  27. package/dist/components/Navigation/Navigation.d.ts +58 -0
  28. package/dist/components/Navigation/OpenAPINavigation.d.ts +22 -0
  29. package/dist/components/Navigation/SpecNavigation.d.ts +25 -0
  30. package/dist/components/Navigation/index.d.ts +4 -0
  31. package/dist/components/Navigation/sharedSections.d.ts +10 -0
  32. package/dist/components/RenderExtensions.d.ts +28 -0
  33. package/dist/components/Section.d.ts +3 -1
  34. package/dist/components/ServerAddressBanner.d.ts +16 -0
  35. package/dist/components/SidePanel.d.ts +2 -0
  36. package/dist/components/Tabs.d.ts +3 -1
  37. package/dist/components/schema/SchemaTab.d.ts +24 -3
  38. package/dist/components/tests/Authorization.test.d.ts +1 -0
  39. package/dist/components/tests/Bindings.test.d.ts +1 -0
  40. package/dist/components/tests/CodeBlock.test.d.ts +1 -0
  41. package/dist/components/tests/CodeSamples.test.d.ts +1 -0
  42. package/dist/components/tests/CopyMarkdownButton.test.d.ts +1 -0
  43. package/dist/components/tests/MarkdownExportMenu.test.d.ts +1 -0
  44. package/dist/components/tests/RenderExtensions.test.d.ts +1 -0
  45. package/dist/config/config.d.ts +10 -0
  46. package/dist/containers/AsyncAPI/AsyncAPI.d.ts +12 -6
  47. package/dist/containers/AsyncAPI/AsyncAPIRenderer.d.ts +9 -0
  48. package/dist/containers/Information/InformationSection.d.ts +22 -0
  49. package/dist/containers/Information/OpenAPIInformation.d.ts +9 -0
  50. package/dist/containers/OpenAPI/Layout.d.ts +7 -0
  51. package/dist/containers/OpenAPI/OpenAPI.d.ts +18 -0
  52. package/dist/containers/OpenAPI/OpenAPIDocumentProvider.d.ts +13 -0
  53. package/dist/containers/OpenAPI/OpenAPIRenderer.d.ts +17 -0
  54. package/dist/containers/OpenAPI/tests/OpenAPI.test.d.ts +1 -0
  55. package/dist/containers/OpenAPI/tests/OpenAPIRenderer.test.d.ts +1 -0
  56. package/dist/containers/Operation/Operations.d.ts +2 -1
  57. package/dist/containers/Path/OperationCallbacks.d.ts +37 -0
  58. package/dist/containers/Path/PathOperation.d.ts +21 -0
  59. package/dist/containers/Path/Paths.d.ts +16 -0
  60. package/dist/containers/Path/ResponseLinks.d.ts +21 -0
  61. package/dist/containers/Path/tests/PathOperation.test.d.ts +1 -0
  62. package/dist/containers/Server/OpenAPIServer.d.ts +4 -0
  63. package/dist/containers/Server/OpenAPIServers.d.ts +13 -0
  64. package/dist/contants.d.ts +7 -0
  65. package/dist/contexts/useSpec.d.ts +30 -6
  66. package/dist/crystal-BcGgviMR.cjs +1 -0
  67. package/dist/crystal-BtD5fR4q.js +283 -0
  68. package/dist/csharp-AnFv7wyC.js +382 -0
  69. package/dist/csharp-yuAGIuP4.cjs +1 -0
  70. package/dist/go-BpetKc7b.cjs +1 -0
  71. package/dist/go-CkZ9_bn0.js +151 -0
  72. package/dist/helpers/codeSamples.d.ts +92 -0
  73. package/dist/helpers/exampleSchema.d.ts +19 -0
  74. package/dist/helpers/hljsLanguages.d.ts +6 -0
  75. package/dist/helpers/openapiParser.d.ts +10 -0
  76. package/dist/helpers/openapiSearchIndex.d.ts +3 -0
  77. package/dist/helpers/resolveDocument.d.ts +8 -0
  78. package/dist/helpers/runtimeExpression.d.ts +15 -0
  79. package/dist/helpers/schemaExample.d.ts +9 -0
  80. package/dist/helpers/searchIndex.d.ts +5 -2
  81. package/dist/helpers/tests/codeSamples.test.d.ts +1 -0
  82. package/dist/helpers/tests/exampleSchema.test.d.ts +1 -0
  83. package/dist/helpers/tests/openapiSearchIndex.test.d.ts +1 -0
  84. package/dist/helpers/tests/toMarkdown.test.d.ts +1 -0
  85. package/dist/helpers/toMarkdown.d.ts +20 -0
  86. package/dist/hooks/useDocumentProviderValue.d.ts +27 -0
  87. package/dist/hooks/useFuseSearch.d.ts +14 -0
  88. package/dist/hooks/useOpenAPISearch.d.ts +9 -0
  89. package/dist/hooks/useSearchResultFocus.d.ts +18 -0
  90. package/dist/hooks/useSpecLayoutController.d.ts +51 -0
  91. package/dist/hooks/useSpecSearch.d.ts +2 -6
  92. package/dist/http--XH4hLDt.cjs +1 -0
  93. package/dist/http-DKeNlJKS.js +85 -0
  94. package/dist/icons/Copy.d.ts +6 -0
  95. package/dist/icons/Info.d.ts +5 -0
  96. package/dist/icons/Search.d.ts +3 -0
  97. package/dist/{index-D7GelPk0.cjs → index-ArzwV232.cjs} +6 -6
  98. package/dist/index-Bh4OKjMA.js +25412 -0
  99. package/dist/index-C278WDNb.cjs +139 -0
  100. package/dist/index-C4I0xC5G.js +17544 -0
  101. package/dist/index-DuW5iShy.cjs +177 -0
  102. package/dist/index-PtAFPDfk.js +18851 -0
  103. package/dist/index.d.ts +7 -0
  104. package/dist/java-BIk0G-rH.cjs +1 -0
  105. package/dist/java-BicX26Pg.js +240 -0
  106. package/dist/kotlin-BwB8b-YX.js +242 -0
  107. package/dist/kotlin-kGuORR5a.cjs +2 -0
  108. package/dist/objectivec-CnyrJ13Z.js +237 -0
  109. package/dist/objectivec-CoeV81Tz.cjs +1 -0
  110. package/dist/ocaml-0j7KDjso.cjs +1 -0
  111. package/dist/ocaml-T8IqWCjo.js +67 -0
  112. package/dist/php-BL35ZHWM.js +566 -0
  113. package/dist/php-DF4zG2hq.cjs +2 -0
  114. package/dist/powershell-CvydS3ek.cjs +1 -0
  115. package/dist/powershell-DuhUKWoO.js +236 -0
  116. package/dist/protoToJsonSchema-AciPTlBK.cjs +83 -0
  117. package/dist/protoToJsonSchema-D1lojrO3.js +6131 -0
  118. package/dist/{protobufSchemaParser-D_2rEsD4.cjs → protobufSchemaParser-7SgmMhQd.cjs} +1 -1
  119. package/dist/{protobufSchemaParser-Cj2WOp05.js → protobufSchemaParser-BohWo_pY.js} +2 -2
  120. package/dist/public/createSectionRoot.d.ts +30 -0
  121. package/dist/public/openapiSections.d.ts +26 -0
  122. package/dist/public/sections.d.ts +6 -3
  123. package/dist/r-B8fCBydS.js +207 -0
  124. package/dist/r-CYaZnHkA.cjs +1 -0
  125. package/dist/ruby-CvOid-1s.js +388 -0
  126. package/dist/ruby-nPcbuC2a.cjs +1 -0
  127. package/dist/rust-BocnJ3Ns.js +305 -0
  128. package/dist/rust-DKnYCg2f.cjs +1 -0
  129. package/dist/stories/AsyncAPI.stories.d.ts +6 -0
  130. package/dist/stories/AsyncAPIRenderer.stories.d.ts +6 -0
  131. package/dist/stories/Messages.stories.d.ts +1 -0
  132. package/dist/stories/Operations.stories.d.ts +6 -0
  133. package/dist/stories/SchemaTab.stories.d.ts +1 -0
  134. package/dist/stories/SchemaTree.stories.d.ts +1 -0
  135. package/dist/stories/Server.stories.d.ts +1 -0
  136. package/dist/stories/documentContextDecorator.d.ts +2 -2
  137. package/dist/stories/noCanvasDocsPage.d.ts +9 -0
  138. package/dist/swift-C35Eof-I.js +799 -0
  139. package/dist/swift-CAnH__EC.cjs +1 -0
  140. package/dist/types/openapi.d.ts +85 -0
  141. package/package.json +16 -3
  142. package/dist/components/Navigation.d.ts +0 -28
  143. package/dist/icons/SideBar.d.ts +0 -6
  144. package/dist/index-Bad1aEIj.js +0 -11352
  145. package/dist/index-CzcxQGxP.js +0 -25414
  146. package/dist/index-gn5KpvCL.cjs +0 -73
  147. package/dist/protoToJsonSchema-8Mm10CIx.cjs +0 -83
  148. package/dist/protoToJsonSchema-BJpwl2Am.js +0 -6174
  149. 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,6 +1,6 @@
1
1
  {
2
2
  "name": "apiuikit",
3
- "version": "0.3.0",
3
+ "version": "1.0.0",
4
4
  "description": "A React UI library for rendering your API specifications",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -8,6 +8,9 @@
8
8
  "url": "https://github.com/AceTheCreator/apiuikit"
9
9
  },
10
10
  "type": "module",
11
+ "sideEffects": [
12
+ "*.css"
13
+ ],
11
14
  "main": "./dist/apiuikit.cjs.js",
12
15
  "module": "./dist/apiuikit.es.js",
13
16
  "types": "./dist/index.d.ts",
@@ -41,6 +44,7 @@
41
44
  "dependencies": {
42
45
  "@asyncapi/specs": "^6.8.1",
43
46
  "@json-schema-tools/reference-resolver": "^1.2.6",
47
+ "@readme/httpsnippet": "^11.4.0",
44
48
  "fuse.js": "^7.5.0",
45
49
  "highlight.js": "^11.11.1",
46
50
  "isomorphic-dompurify": "^2.24.0",
@@ -48,22 +52,30 @@
48
52
  "json-schema-resolver": "^3.0.0",
49
53
  "marked": "^15.0.11",
50
54
  "marked-highlight": "^2.2.1",
55
+ "openapi-types": "^12.1.3",
51
56
  "protobufjs": "^7.4.0",
52
57
  "react-markdown": "^9.0.3",
53
- "remark-gfm": "^4.0.1"
58
+ "remark-gfm": "^4.0.1",
59
+ "url": "^0.11.4"
54
60
  },
55
61
  "peerDependencies": {
56
62
  "@asyncapi/parser": "^3.6.0",
63
+ "@scalar/openapi-parser": "^0.28.10",
57
64
  "react": ">=18",
58
65
  "react-dom": ">=18"
59
66
  },
60
67
  "peerDependenciesMeta": {
61
68
  "@asyncapi/parser": {
62
69
  "optional": true
70
+ },
71
+ "@scalar/openapi-parser": {
72
+ "optional": true
63
73
  }
64
74
  },
65
75
  "devDependencies": {
66
76
  "@asyncapi/modelina": "^5.10.1",
77
+ "@asyncapi/parser": "^3.6.0",
78
+ "@scalar/openapi-parser": "^0.28.10",
67
79
  "@chromatic-com/storybook": "^3.2.3",
68
80
  "@eslint/js": "^9.17.0",
69
81
  "@storybook/addon-a11y": "^8.6.18",
@@ -97,7 +109,8 @@
97
109
  "typescript-eslint": "^8.18.2",
98
110
  "vite": "^6.0.5",
99
111
  "vite-plugin-dts": "^5.0.3",
100
- "vitest": "^4.1.10"
112
+ "vitest": "^4.1.10",
113
+ "x-tensions": "*"
101
114
  },
102
115
  "eslintConfig": {
103
116
  "extends": [
@@ -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 {};
@@ -1,6 +0,0 @@
1
- import { default as React } from 'react';
2
- interface SidebarIconProps {
3
- isCollapsed: boolean;
4
- }
5
- declare const SidebarIcon: React.FC<SidebarIconProps>;
6
- export default SidebarIcon;