apiuikit 2.0.0 → 2.1.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-ILzruYIb.cjs → CodeSamples-5FoT0ZpU.cjs} +1 -1
- package/dist/{CodeSamples-DqJT72uU.js → CodeSamples-GTPVAAJ5.js} +1 -1
- package/dist/{LogoExtension-pwW1l7NO.cjs → LogoExtension-CbdKkZJ6.cjs} +1 -1
- package/dist/{LogoExtension-yx9jporL.js → LogoExtension-DuIqK_Wj.js} +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-DNsQrlh-.cjs → index-0u301gJq.cjs} +78 -78
- package/dist/{index-CfELqow6.cjs → index-BNwl4VfM.cjs} +1 -1
- package/dist/{index-Dbr8eb7Z.js → index-CT7jUAdL.js} +4260 -4006
- package/dist/{index-CI3MIo1V.cjs → index-CpdbrwV-.cjs} +1 -1
- package/dist/{index-BI2__AB3.js → index-D8Euqzmz.js} +1 -1
- package/dist/{index-6q1VqGzf.js → index-DRBkON8k.js} +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/{protoToJsonSchema-CbZrqF4-.js → protoToJsonSchema-CpU-wRjQ.js} +1 -1
- package/dist/{protoToJsonSchema-QVW5EW0-.cjs → protoToJsonSchema-DcX8BXD3.cjs} +1 -1
- package/dist/{protobufSchemaParser-BEVutm25.cjs → protobufSchemaParser-C0ip1oHD.cjs} +1 -1
- package/dist/{protobufSchemaParser-CtnNrHbS.js → protobufSchemaParser-ZdCXJyvr.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 +17 -1
|
@@ -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-CT7jUAdL.js";
|
|
5
5
|
function pi(t) {
|
|
6
6
|
return t.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
7
7
|
}
|
|
@@ -5,7 +5,7 @@ var Vp = (_i) => {
|
|
|
5
5
|
var bd = (_i, Oi, Ai) => Oi in _i ? gd(_i, Oi, { enumerable: !0, configurable: !0, writable: !0, value: Ai }) : _i[Oi] = Ai;
|
|
6
6
|
var Np = (_i, Oi, Ai) => bd(_i, typeof Oi != "symbol" ? Oi + "" : Oi, Ai), Fp = (_i, Oi, Ai) => Oi.has(_i) || Vp("Cannot " + Ai);
|
|
7
7
|
var pr = (_i, Oi, Ai) => (Fp(_i, Oi, "read from private field"), Ai ? Ai.call(_i) : Oi.get(_i)), co = (_i, Oi, Ai) => Oi.has(_i) ? Vp("Cannot add the same private member more than once") : Oi instanceof WeakSet ? Oi.add(_i) : Oi.set(_i, Ai), ca = (_i, Oi, Ai, cn) => (Fp(_i, Oi, "write to private field"), cn ? cn.call(_i, Ai) : Oi.set(_i, Ai), Ai);
|
|
8
|
-
import { g as vd } from "./index-
|
|
8
|
+
import { g as vd } from "./index-CT7jUAdL.js";
|
|
9
9
|
function jd(_i, Oi) {
|
|
10
10
|
for (var Ai = 0; Ai < Oi.length; Ai++) {
|
|
11
11
|
const cn = Oi[Ai];
|
package/dist/index.d.ts
CHANGED
|
@@ -23,10 +23,10 @@ export { parseAndRender } from './helpers/parser';
|
|
|
23
23
|
export { AsyncAPIRenderer } from './containers/AsyncAPI/AsyncAPIRenderer';
|
|
24
24
|
export { parseAndRender as parseAndRenderOpenAPI } from './helpers/openapiParser';
|
|
25
25
|
export { OpenAPIRenderer } from './containers/OpenAPI/OpenAPIRenderer';
|
|
26
|
-
export { AsyncAPIProvider, AsyncAPIServers, AsyncAPIOperations, AsyncAPIMessages, AsyncAPIInfo, } from './public/sections';
|
|
27
|
-
export type { SectionProps } from './public/sections';
|
|
26
|
+
export { AsyncAPIProvider, AsyncAPIServers, AsyncAPIOperations, AsyncAPIOperation, AsyncAPIMessages, AsyncAPIMessage, AsyncAPIInfo, } from './public/sections';
|
|
27
|
+
export type { SectionProps, AsyncAPIOperationProps, AsyncAPIMessageProps } from './public/sections';
|
|
28
28
|
export type { SectionLayout } from './components/Section';
|
|
29
|
-
export { Schemas, AsyncAPISchemas, OpenAPISchemas } from './public/schemasSection';
|
|
30
|
-
export type { SchemasSectionProps } from './public/schemasSection';
|
|
31
|
-
export { OpenAPIProvider, OpenAPIServers, OpenAPIEndpoints, OpenAPIWebhooks, OpenAPIInfo, } from './public/openapiSections';
|
|
32
|
-
export type { OpenAPISectionProps } from './public/openapiSections';
|
|
29
|
+
export { Schemas, Schema, AsyncAPISchemas, OpenAPISchemas } from './public/schemasSection';
|
|
30
|
+
export type { SchemasSectionProps, SchemaSectionProps } from './public/schemasSection';
|
|
31
|
+
export { OpenAPIProvider, OpenAPIServers, OpenAPIEndpoints, OpenAPIEndpoint, OpenAPIWebhooks, OpenAPIWebhook, OpenAPIInfo, } from './public/openapiSections';
|
|
32
|
+
export type { OpenAPISectionProps, OpenAPIEndpointProps, OpenAPIWebhookProps } from './public/openapiSections';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Yr = Object.defineProperty;
|
|
2
2
|
var Xr = (a, e, r) => e in a ? Yr(a, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[e] = r;
|
|
3
3
|
var ve = (a, e, r) => Xr(a, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { c as Ne, a as Kr } from "./index-
|
|
4
|
+
import { c as Ne, a as Kr } from "./index-CT7jUAdL.js";
|
|
5
5
|
var Er = { exports: {} }, Ar = { exports: {} }, Tr = {}, Ue = {}, Rr = Qr;
|
|
6
6
|
function Qr(a, e) {
|
|
7
7
|
for (var r = new Array(arguments.length - 1), f = 0, s = 2, u = !0; s < arguments.length; )
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Yr=Object.defineProperty;var Xr=(a,e,r)=>e in a?Yr(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var ve=(a,e,r)=>Xr(a,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xe=require("./index-
|
|
1
|
+
"use strict";var Yr=Object.defineProperty;var Xr=(a,e,r)=>e in a?Yr(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var ve=(a,e,r)=>Xr(a,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xe=require("./index-0u301gJq.cjs");var Er={exports:{}},Ar={exports:{}},Tr={},Ue={},Rr=Kr;function Kr(a,e){for(var r=new Array(arguments.length-1),f=0,s=2,u=!0;s<arguments.length;)r[f++]=arguments[s++];return new Promise(function(o,i){r[f]=function(c){if(u)if(u=!1,c)i(c);else{for(var l=new Array(arguments.length-1),d=0;d<l.length;)l[d++]=arguments[d];o.apply(null,l)}};try{a.apply(e||null,r)}catch(n){u&&(u=!1,i(n))}})}var Nr={};(function(a){var e=a;e.length=function(o){var i=o.length;if(!i)return 0;for(var n=0;--i%4>1&&o.charAt(i)==="=";)++n;return Math.ceil(o.length*3)/4-n};for(var r=new Array(64),f=new Array(123),s=0;s<64;)f[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;e.encode=function(o,i,n){for(var c=null,l=[],d=0,p=0,m;i<n;){var g=o[i++];switch(p){case 0:l[d++]=r[g>>2],m=(g&3)<<4,p=1;break;case 1:l[d++]=r[m|g>>4],m=(g&15)<<2,p=2;break;case 2:l[d++]=r[m|g>>6],l[d++]=r[g&63],p=0;break}d>8191&&((c||(c=[])).push(String.fromCharCode.apply(String,l)),d=0)}return p&&(l[d++]=r[m],l[d++]=61,p===1&&(l[d++]=61)),c?(d&&c.push(String.fromCharCode.apply(String,l.slice(0,d))),c.join("")):String.fromCharCode.apply(String,l.slice(0,d))};var u="invalid encoding";e.decode=function(o,i,n){for(var c=n,l=0,d,p=0;p<o.length;){var m=o.charCodeAt(p++);if(m===61&&l>1)break;if((m=f[m])===void 0)throw Error(u);switch(l){case 0:d=m,l=1;break;case 1:i[n++]=d<<2|(m&48)>>4,d=m,l=2;break;case 2:i[n++]=(d&15)<<4|(m&60)>>2,d=m,l=3;break;case 3:i[n++]=(d&3)<<6|m,l=0;break}}if(l===1)throw Error(u);return n-c},e.test=function(o){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(o)}})(Nr);var Qr=ze;function ze(){this._listeners=Object.create(null)}ze.prototype.on=function(e,r,f){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:f||this}),this};ze.prototype.off=function(e,r){if(e===void 0)this._listeners=Object.create(null);else if(r===void 0)this._listeners[e]=[];else{var f=this._listeners[e];if(!f)return this;for(var s=0;s<f.length;)f[s].fn===r?f.splice(s,1):++s}return this};ze.prototype.emit=function(e){var r=this._listeners[e];if(r){for(var f=[],s=1;s<arguments.length;)f.push(arguments[s++]);for(s=0;s<r.length;)r[s].fn.apply(r[s++].ctx,f)}return this};var ei=Ct(Ct);function Ct(a){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),f=r[3]===128;function s(i,n,c){e[0]=i,n[c]=r[0],n[c+1]=r[1],n[c+2]=r[2],n[c+3]=r[3]}function u(i,n,c){e[0]=i,n[c]=r[3],n[c+1]=r[2],n[c+2]=r[1],n[c+3]=r[0]}a.writeFloatLE=f?s:u,a.writeFloatBE=f?u:s;function t(i,n){return r[0]=i[n],r[1]=i[n+1],r[2]=i[n+2],r[3]=i[n+3],e[0]}function o(i,n){return r[3]=i[n],r[2]=i[n+1],r[1]=i[n+2],r[0]=i[n+3],e[0]}a.readFloatLE=f?t:o,a.readFloatBE=f?o:t})():(function(){function e(f,s,u,t){var o=s<0?1:0;if(o&&(s=-s),s===0)f(1/s>0?0:2147483648,u,t);else if(isNaN(s))f(2143289344,u,t);else if(s>34028234663852886e22)f((o<<31|2139095040)>>>0,u,t);else if(s<11754943508222875e-54)f((o<<31|Math.round(s/1401298464324817e-60))>>>0,u,t);else{var i=Math.floor(Math.log(s)/Math.LN2),n=Math.round(s*Math.pow(2,-i)*8388608)&8388607;f((o<<31|i+127<<23|n)>>>0,u,t)}}a.writeFloatLE=e.bind(null,Bt),a.writeFloatBE=e.bind(null,Pt);function r(f,s,u){var t=f(s,u),o=(t>>31)*2+1,i=t>>>23&255,n=t&8388607;return i===255?n?NaN:o*(1/0):i===0?o*1401298464324817e-60*n:o*Math.pow(2,i-150)*(n+8388608)}a.readFloatLE=r.bind(null,qt),a.readFloatBE=r.bind(null,jt)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),f=r[7]===128;function s(i,n,c){e[0]=i,n[c]=r[0],n[c+1]=r[1],n[c+2]=r[2],n[c+3]=r[3],n[c+4]=r[4],n[c+5]=r[5],n[c+6]=r[6],n[c+7]=r[7]}function u(i,n,c){e[0]=i,n[c]=r[7],n[c+1]=r[6],n[c+2]=r[5],n[c+3]=r[4],n[c+4]=r[3],n[c+5]=r[2],n[c+6]=r[1],n[c+7]=r[0]}a.writeDoubleLE=f?s:u,a.writeDoubleBE=f?u:s;function t(i,n){return r[0]=i[n],r[1]=i[n+1],r[2]=i[n+2],r[3]=i[n+3],r[4]=i[n+4],r[5]=i[n+5],r[6]=i[n+6],r[7]=i[n+7],e[0]}function o(i,n){return r[7]=i[n],r[6]=i[n+1],r[5]=i[n+2],r[4]=i[n+3],r[3]=i[n+4],r[2]=i[n+5],r[1]=i[n+6],r[0]=i[n+7],e[0]}a.readDoubleLE=f?t:o,a.readDoubleBE=f?o:t})():(function(){function e(f,s,u,t,o,i){var n=t<0?1:0;if(n&&(t=-t),t===0)f(0,o,i+s),f(1/t>0?0:2147483648,o,i+u);else if(isNaN(t))f(0,o,i+s),f(2146959360,o,i+u);else if(t>17976931348623157e292)f(0,o,i+s),f((n<<31|2146435072)>>>0,o,i+u);else{var c;if(t<22250738585072014e-324)c=t/5e-324,f(c>>>0,o,i+s),f((n<<31|c/4294967296)>>>0,o,i+u);else{var l=Math.floor(Math.log(t)/Math.LN2);l===1024&&(l=1023),c=t*Math.pow(2,-l),f(c*4503599627370496>>>0,o,i+s),f((n<<31|l+1023<<20|c*1048576&1048575)>>>0,o,i+u)}}}a.writeDoubleLE=e.bind(null,Bt,0,4),a.writeDoubleBE=e.bind(null,Pt,4,0);function r(f,s,u,t,o){var i=f(t,o+s),n=f(t,o+u),c=(n>>31)*2+1,l=n>>>20&2047,d=4294967296*(n&1048575)+i;return l===2047?d?NaN:c*(1/0):l===0?c*5e-324*d:c*Math.pow(2,l-1075)*(d+4503599627370496)}a.readDoubleLE=r.bind(null,qt,0,4),a.readDoubleBE=r.bind(null,jt,4,0)})(),a}function Bt(a,e,r){e[r]=a&255,e[r+1]=a>>>8&255,e[r+2]=a>>>16&255,e[r+3]=a>>>24}function Pt(a,e,r){e[r]=a>>>24,e[r+1]=a>>>16&255,e[r+2]=a>>>8&255,e[r+3]=a&255}function qt(a,e){return(a[e]|a[e+1]<<8|a[e+2]<<16|a[e+3]<<24)>>>0}function jt(a,e){return(a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3])>>>0}var kr={};(function(a){var e=a,r=65533;e.length=function(s){for(var u=0,t=0,o=0;o<s.length;++o)t=s.charCodeAt(o),t<128?u+=1:t<2048?u+=2:(t&64512)===55296&&(s.charCodeAt(o+1)&64512)===56320?(++o,u+=4):u+=3;return u},e.read=function(s,u,t){if(t-u<1)return"";for(var o=null,i=[],n=0,c,l,d,p;u<t;)c=s[u++],c<=127?i[n++]=c:c>=192&&c<224?(d=(c&31)<<6|s[u++]&63,i[n++]=d>=128?d:r):c>=224&&c<240?(p=(c&15)<<12|(s[u++]&63)<<6|s[u++]&63,i[n++]=p>=2048?p:r):c>=240&&(l=(c&7)<<18|(s[u++]&63)<<12|(s[u++]&63)<<6|s[u++]&63,l<65536||l>1114111?i[n++]=r:(l-=65536,i[n++]=55296+(l>>10),i[n++]=56320+(l&1023))),n>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i.slice(0,n))),n=0);return o?(n&&o.push(String.fromCharCode.apply(String,i.slice(0,n))),o.join("")):String.fromCharCode.apply(String,i.slice(0,n))},e.write=function(s,u,t){for(var o=t,i,n,c=0;c<s.length;++c)i=s.charCodeAt(c),i<128?u[t++]=i:i<2048?(u[t++]=i>>6|192,u[t++]=i&63|128):(i&64512)===55296&&((n=s.charCodeAt(c+1))&64512)===56320?(i=65536+((i&1023)<<10)+(n&1023),++c,u[t++]=i>>18|240,u[t++]=i>>12&63|128,u[t++]=i>>6&63|128,u[t++]=i&63|128):(u[t++]=i>>12|224,u[t++]=i>>6&63|128,u[t++]=i&63|128);return t-o}})(kr);var ti=ri;function ri(a,e,r){var f=r||8192,s=f>>>1,u=null,t=f;return function(i){if(i<1||i>s)return a(i);t+i>f&&(u=a(f),t=0);var n=e.call(u,t,t+=i);return t&7&&(t=(t|7)+1),n}}var Ze,$t;function ii(){if($t)return Ze;$t=1,Ze=e;var a=me();function e(u,t){this.lo=u>>>0,this.hi=t>>>0}var r=e.zero=new e(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var f=e.zeroHash="\0\0\0\0\0\0\0\0";e.fromNumber=function(t){if(t===0)return r;var o=t<0;o&&(t=-t);var i=t>>>0,n=(t-i)/4294967296>>>0;return o&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new e(i,n)},e.from=function(t){if(typeof t=="number")return e.fromNumber(t);if(a.isString(t))if(a.Long)t=a.Long.fromString(t);else return e.fromNumber(parseInt(t,10));return t.low||t.high?new e(t.low>>>0,t.high>>>0):r},e.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var o=~this.lo+1>>>0,i=~this.hi>>>0;return o||(i=i+1>>>0),-(o+i*4294967296)}return this.lo+this.hi*4294967296},e.prototype.toLong=function(t){return a.Long?new a.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}};var s=String.prototype.charCodeAt;return e.fromHash=function(t){return t===f?r:new e((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},e.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},e.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},e.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},e.prototype.length=function(){var t=this.lo,o=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return i===0?o===0?t<16384?t<128?1:2:t<2097152?3:4:o<16384?o<128?5:6:o<2097152?7:8:i<128?9:10},Ze}var De={exports:{}},ni=De.exports,Ut;function si(){return Ut||(Ut=1,(function(a,e){(function(r,f){function s(u){return u.default||u}f(e),a.exports=s(e)})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:ni,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2009 The Closure Library Authors
|
|
4
4
|
* Copyright 2020 Daniel Wirtz / The long.js Authors.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./protoToJsonSchema-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./protoToJsonSchema-DcX8BXD3.cjs"),e=require("./index-0u301gJq.cjs");function n(r){if(typeof r!="string")return["Protobuf schema must be a string of .proto source"];try{return t.protoToJsonSchema(r),[]}catch(o){return[o instanceof Error?o.message:"Failed to parse protobuf schema"]}}const s=["application/vnd.google.protobuf","application/vnd.google.protobuf;version=2","application/vnd.google.protobuf;version=3"];function a(){return{validate:u,parse:i,getMimeTypes:()=>s}}function c(r){e.registerSchemaParserWithFallback(r,a(),e.isProtobufSchemaFormat)}function u(r){return n(r.data).map(o=>({message:o,path:r.path}))}function i(r){if(typeof r.data!="string")return{[e.X_LIB_CONVERSION_ERROR]:"Protobuf schema must be a string of .proto source"};try{return t.protoToJsonSchema(r.data)}catch(o){return{[e.X_LIB_CONVERSION_ERROR]:o instanceof Error?o.message:"Failed to convert Protobuf schema"}}}exports.ProtobufSchemaParser=a;exports.registerProtobufSchemaParser=c;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { protoToJsonSchema as e } from "./protoToJsonSchema-
|
|
2
|
-
import { r as a, X as t, i as s } from "./index-
|
|
1
|
+
import { protoToJsonSchema as e } from "./protoToJsonSchema-CpU-wRjQ.js";
|
|
2
|
+
import { r as a, X as t, i as s } from "./index-CT7jUAdL.js";
|
|
3
3
|
function n(r) {
|
|
4
4
|
if (typeof r != "string")
|
|
5
5
|
return ["Protobuf schema must be a string of .proto source"];
|
|
@@ -5,8 +5,9 @@ import { ApiuikitPlugin } from '../plugins/types';
|
|
|
5
5
|
export interface GenericSectionProps<T> {
|
|
6
6
|
/** The document. Required standalone; unnecessary (and ignored) when rendered inside the matching provider. */
|
|
7
7
|
document?: T;
|
|
8
|
+
/** Theme, which sections to show, and other display options. See [Configuration](https://apiuikit.com/docs/configuration). */
|
|
8
9
|
config?: ConfigInterface;
|
|
9
|
-
/** Third-party plugins. Only applied standalone (this section sets up its own provider); composed under an ambient provider, that provider's own `plugins` apply instead. */
|
|
10
|
+
/** Third-party plugins. Only applied standalone (this section sets up its own provider); composed under an ambient provider, that provider's own `plugins` apply instead. See [Plugins](https://apiuikit.com/docs/plugins). */
|
|
10
11
|
plugins?: ApiuikitPlugin[];
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
@@ -1,38 +1,123 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ConfigInterface } from '../config';
|
|
3
3
|
import { ApiuikitPlugin } from '../plugins/types';
|
|
4
|
-
import { OpenAPIDocumentData } from '../types/openapi';
|
|
4
|
+
import { HttpMethod, OpenAPIDocumentData } from '../types/openapi';
|
|
5
|
+
import { EndpointSelector } from '../helpers/findItem';
|
|
5
6
|
import { SectionLayout } from '../components/Section';
|
|
6
7
|
/**
|
|
7
8
|
* Standalone, composable OpenAPI section components — mirrors public/sections.tsx
|
|
8
9
|
* (AsyncAPI). Each renders one part of an OpenAPI document (servers, endpoints,
|
|
9
|
-
* schemas, info) on its own, dual-mode
|
|
10
|
+
* schemas, info) on its own, dual-mode. `OpenAPIEndpoint` / `OpenAPIWebhook`
|
|
11
|
+
* render a single item inline instead of the whole list:
|
|
10
12
|
* - Standalone: <OpenAPIEndpoints document={doc} />
|
|
11
13
|
* - Composed: <OpenAPIProvider document={doc}><OpenAPIServers /><OpenAPIEndpoints /></OpenAPIProvider>
|
|
12
14
|
*/
|
|
13
15
|
export interface OpenAPISectionProps {
|
|
14
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The parsed OpenAPI JSON, for example a JSON file you imported.
|
|
18
|
+
* Pass it when this component is on the page by itself.
|
|
19
|
+
* Inside OpenAPIProvider, the document comes from there, and a value passed here is ignored.
|
|
20
|
+
*/
|
|
15
21
|
document?: OpenAPIDocumentData;
|
|
22
|
+
/**
|
|
23
|
+
* Theme and display options, such as schema expansion.
|
|
24
|
+
* Used when this component loads the document itself.
|
|
25
|
+
* Inside OpenAPIProvider, set `config` on the provider.
|
|
26
|
+
* See [Configuration](https://apiuikit.com/docs/configuration).
|
|
27
|
+
*/
|
|
16
28
|
config?: ConfigInterface;
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
29
|
+
/**
|
|
30
|
+
* Plugins for this component.
|
|
31
|
+
* Used when this component loads the document itself.
|
|
32
|
+
* Inside OpenAPIProvider, set `plugins` on the provider.
|
|
33
|
+
* See [Plugins](https://apiuikit.com/docs/plugins).
|
|
34
|
+
*/
|
|
19
35
|
plugins?: ApiuikitPlugin[];
|
|
20
36
|
/**
|
|
21
|
-
* `
|
|
22
|
-
*
|
|
23
|
-
*
|
|
37
|
+
* `columns` (the default) leaves an empty column on the right so this section
|
|
38
|
+
* lines up with Info and Servers.
|
|
39
|
+
* `stacked` uses the full width; choose it when the section is on the page by itself.
|
|
40
|
+
* For Info and Servers, `stacked` also moves the side content below the main content.
|
|
41
|
+
* See [Composables](https://apiuikit.com/docs/sections).
|
|
24
42
|
*/
|
|
25
43
|
layout?: SectionLayout;
|
|
26
44
|
}
|
|
27
45
|
export declare function OpenAPIProvider({ document, config, plugins, children, }: {
|
|
28
46
|
document: OpenAPIDocumentData;
|
|
47
|
+
/** Theme, which sections to show, and other display options. See [Configuration](https://apiuikit.com/docs/configuration). */
|
|
29
48
|
config?: ConfigInterface;
|
|
30
|
-
/** Third-party plugins shared with sections inside. */
|
|
49
|
+
/** Third-party plugins shared with sections inside. See [Plugins](https://apiuikit.com/docs/plugins). */
|
|
31
50
|
plugins?: ApiuikitPlugin[];
|
|
32
51
|
children: ReactNode;
|
|
33
52
|
}): import('react').JSX.Element;
|
|
53
|
+
/**
|
|
54
|
+
* The servers an OpenAPI document can call. Choose a server to see its URL,
|
|
55
|
+
* description, and variables.
|
|
56
|
+
*
|
|
57
|
+
* On its own, pass `document`. With other sections, render it inside
|
|
58
|
+
* OpenAPIProvider and pass `document` to the provider instead.
|
|
59
|
+
*/
|
|
34
60
|
export declare function OpenAPIServers({ layout, ...providerProps }: OpenAPISectionProps): import('react').JSX.Element;
|
|
61
|
+
/**
|
|
62
|
+
* A table of every endpoint in an OpenAPI document. Each row shows the path
|
|
63
|
+
* and HTTP method. Click a row to open a panel with the parameters, request
|
|
64
|
+
* body, responses, and security.
|
|
65
|
+
*
|
|
66
|
+
* On its own, pass `document`. With other sections, render it inside
|
|
67
|
+
* OpenAPIProvider and pass `document` to the provider instead.
|
|
68
|
+
*/
|
|
35
69
|
export declare function OpenAPIEndpoints({ layout, ...providerProps }: OpenAPISectionProps): import('react').JSX.Element;
|
|
36
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* A table of the webhooks an OpenAPI document receives. Each row is one
|
|
72
|
+
* webhook. Click a row to open a panel with its parameters, body, and
|
|
73
|
+
* responses. A document with no webhooks shows nothing here.
|
|
74
|
+
*
|
|
75
|
+
* On its own, pass `document`. With other sections, render it inside
|
|
76
|
+
* OpenAPIProvider and pass `document` to the provider instead.
|
|
77
|
+
*/
|
|
37
78
|
export declare function OpenAPIWebhooks({ layout, ...providerProps }: OpenAPISectionProps): import('react').JSX.Element;
|
|
79
|
+
interface SingleItemProps extends OpenAPISectionProps {
|
|
80
|
+
/**
|
|
81
|
+
* Called with an `operationId` when a response link to another operation is
|
|
82
|
+
* followed, so the host page can scroll to or route to wherever it shows
|
|
83
|
+
* that operation. Without it, such links render as plain text.
|
|
84
|
+
*/
|
|
85
|
+
onNavigate?: (operationId: string) => void;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Props for {@link OpenAPIEndpoint}: the shared section props plus either an
|
|
89
|
+
* `operationId` or a `method` + `path` pair naming the endpoint.
|
|
90
|
+
*/
|
|
91
|
+
export type OpenAPIEndpointProps = SingleItemProps & EndpointSelector;
|
|
92
|
+
/**
|
|
93
|
+
* One endpoint, rendered inline: its header and full detail (parameters,
|
|
94
|
+
* body, responses, code samples), without the list or the side panel.
|
|
95
|
+
*
|
|
96
|
+
* <OpenAPIEndpoint document={doc} operationId="addPet" />
|
|
97
|
+
* <OpenAPIEndpoint document={doc} method="get" path="/pets/{petId}" />
|
|
98
|
+
*
|
|
99
|
+
* Renders nothing (and warns) when no endpoint matches.
|
|
100
|
+
*/
|
|
101
|
+
export declare function OpenAPIEndpoint(props: OpenAPIEndpointProps): import('react').JSX.Element;
|
|
102
|
+
export interface OpenAPIWebhookProps extends SingleItemProps {
|
|
103
|
+
/** The webhook's key under the document's top-level `webhooks`. */
|
|
104
|
+
name: string;
|
|
105
|
+
/** Which method to show. Optional: defaults to the first one the webhook declares, which is usually its only one. */
|
|
106
|
+
method?: HttpMethod;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* One OpenAPI 3.1 webhook, rendered inline — the webhook counterpart to
|
|
110
|
+
* {@link OpenAPIEndpoint}.
|
|
111
|
+
*
|
|
112
|
+
* <OpenAPIWebhook document={doc} name="newPet" />
|
|
113
|
+
*/
|
|
114
|
+
export declare function OpenAPIWebhook({ name, method, onNavigate, layout, ...providerProps }: OpenAPIWebhookProps): import('react').JSX.Element;
|
|
115
|
+
/**
|
|
116
|
+
* The title, description, and version of an OpenAPI document, with license,
|
|
117
|
+
* contact, tags, and external docs beside it.
|
|
118
|
+
*
|
|
119
|
+
* On its own, pass `document`. With other sections, render it inside
|
|
120
|
+
* OpenAPIProvider and pass `document` to the provider instead.
|
|
121
|
+
*/
|
|
38
122
|
export declare function OpenAPIInfo({ layout, ...providerProps }: OpenAPISectionProps): import('react').JSX.Element;
|
|
123
|
+
export {};
|
|
@@ -13,21 +13,55 @@ import { SectionLayout } from '../components/Section';
|
|
|
13
13
|
* nothing for a mismatch warning to warn about.
|
|
14
14
|
*/
|
|
15
15
|
export interface SchemasSectionProps {
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The parsed AsyncAPI or OpenAPI JSON, for example a JSON file you imported.
|
|
18
|
+
* Pass it when this component is on the page by itself.
|
|
19
|
+
* Inside AsyncAPIProvider or OpenAPIProvider, the document comes from there, and a value passed here is ignored.
|
|
20
|
+
*/
|
|
17
21
|
document?: AsyncAPIDocumentData | OpenAPIDocumentData;
|
|
18
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Theme and display options, such as schema expansion.
|
|
24
|
+
* Used when this component loads the document itself.
|
|
25
|
+
* Inside a provider, set `config` on the provider.
|
|
26
|
+
* See [Configuration](https://apiuikit.com/docs/configuration).
|
|
27
|
+
*/
|
|
19
28
|
config?: ConfigInterface;
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
29
|
+
/**
|
|
30
|
+
* Plugins for this component.
|
|
31
|
+
* Used when this component loads the document itself.
|
|
32
|
+
* Inside a provider, set `plugins` on the provider.
|
|
33
|
+
* See [Plugins](https://apiuikit.com/docs/plugins).
|
|
34
|
+
*/
|
|
22
35
|
plugins?: ApiuikitPlugin[];
|
|
23
36
|
/**
|
|
24
|
-
* `
|
|
25
|
-
*
|
|
26
|
-
*
|
|
37
|
+
* `columns` (the default) leaves an empty column on the right so this section
|
|
38
|
+
* lines up with Info and Servers.
|
|
39
|
+
* `stacked` uses the full width; choose it when the section is on the page by itself.
|
|
40
|
+
* See [Composables](https://apiuikit.com/docs/sections).
|
|
27
41
|
*/
|
|
28
42
|
layout?: SectionLayout;
|
|
29
43
|
}
|
|
30
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The schemas in an AsyncAPI or OpenAPI document. Each one is an expandable
|
|
46
|
+
* tree of its properties. The same component works for both specs.
|
|
47
|
+
*
|
|
48
|
+
* On its own, pass `document`. With other sections, render it inside
|
|
49
|
+
* AsyncAPIProvider or OpenAPIProvider and pass `document` to the provider instead.
|
|
50
|
+
*/
|
|
51
|
+
export declare function Schemas({ layout, ...rootProps }: SchemasSectionProps): import('react').JSX.Element;
|
|
52
|
+
export interface SchemaSectionProps extends SchemasSectionProps {
|
|
53
|
+
/** The schema's key under `components.schemas`. */
|
|
54
|
+
name: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* One schema from an AsyncAPI or OpenAPI document, as the same card the
|
|
58
|
+
* Schemas section shows for it.
|
|
59
|
+
*
|
|
60
|
+
* <Schema document={doc} name="Pet" />
|
|
61
|
+
*
|
|
62
|
+
* Renders nothing (and warns) when there is no schema by that name.
|
|
63
|
+
*/
|
|
64
|
+
export declare function Schema({ name, layout, ...rootProps }: SchemaSectionProps): import('react').JSX.Element;
|
|
31
65
|
/** @deprecated Use `Schemas` — the schemas section is the same for both specs. */
|
|
32
66
|
export declare const AsyncAPISchemas: typeof Schemas;
|
|
33
67
|
/** @deprecated Use `Schemas` — the schemas section is the same for both specs. */
|
|
@@ -21,19 +21,32 @@ import { SectionLayout } from '../components/Section';
|
|
|
21
21
|
* </AsyncAPIProvider>
|
|
22
22
|
*/
|
|
23
23
|
export interface SectionProps {
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
24
|
+
/**
|
|
25
|
+
* The parsed AsyncAPI JSON, for example a JSON file you imported.
|
|
26
|
+
* Pass it when this component is on the page by itself.
|
|
27
|
+
* Inside AsyncAPIProvider or AsyncAPI, the document comes from there, and a value passed here is ignored.
|
|
28
|
+
*/
|
|
26
29
|
document?: AsyncAPIDocumentData;
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
30
|
+
/**
|
|
31
|
+
* Theme and display options, such as schema expansion.
|
|
32
|
+
* Used when this component loads the document itself.
|
|
33
|
+
* Inside AsyncAPIProvider, set `config` on the provider.
|
|
34
|
+
* See [Configuration](https://apiuikit.com/docs/configuration).
|
|
35
|
+
*/
|
|
29
36
|
config?: ConfigInterface;
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
37
|
+
/**
|
|
38
|
+
* Plugins for this component.
|
|
39
|
+
* Used when this component loads the document itself.
|
|
40
|
+
* Inside AsyncAPIProvider, set `plugins` on the provider.
|
|
41
|
+
* See [Plugins](https://apiuikit.com/docs/plugins).
|
|
42
|
+
*/
|
|
32
43
|
plugins?: ApiuikitPlugin[];
|
|
33
44
|
/**
|
|
34
|
-
* `
|
|
35
|
-
*
|
|
36
|
-
*
|
|
45
|
+
* `columns` (the default) leaves an empty column on the right so this section
|
|
46
|
+
* lines up with Info and Servers.
|
|
47
|
+
* `stacked` uses the full width; choose it when the section is on the page by itself.
|
|
48
|
+
* For Info and Servers, `stacked` also moves the side content below the main content.
|
|
49
|
+
* See [Composables](https://apiuikit.com/docs/sections).
|
|
37
50
|
*/
|
|
38
51
|
layout?: SectionLayout;
|
|
39
52
|
}
|
|
@@ -44,14 +57,69 @@ export interface SectionProps {
|
|
|
44
57
|
export declare function AsyncAPIProvider({ document, config, plugins, children, }: {
|
|
45
58
|
/** The AsyncAPI document to resolve and share with sections inside. */
|
|
46
59
|
document: AsyncAPIDocumentData;
|
|
47
|
-
/** UI configuration (theme, schema expansion defaults) shared with sections inside. */
|
|
60
|
+
/** UI configuration (theme, schema expansion defaults) shared with sections inside. See [Configuration](https://apiuikit.com/docs/configuration). */
|
|
48
61
|
config?: ConfigInterface;
|
|
49
|
-
/** Third-party plugins shared with sections inside. */
|
|
62
|
+
/** Third-party plugins shared with sections inside. See [Plugins](https://apiuikit.com/docs/plugins). */
|
|
50
63
|
plugins?: ApiuikitPlugin[];
|
|
51
64
|
/** Section components (or your own), rendered with access to the shared document context. */
|
|
52
65
|
children: ReactNode;
|
|
53
66
|
}): import('react').JSX.Element;
|
|
67
|
+
/**
|
|
68
|
+
* The servers an AsyncAPI document can connect to. Choose a server to see its
|
|
69
|
+
* host, protocol, variables, and security.
|
|
70
|
+
*
|
|
71
|
+
* On its own, pass `document`. With other sections, render it inside
|
|
72
|
+
* AsyncAPIProvider and pass `document` to the provider instead.
|
|
73
|
+
*/
|
|
54
74
|
export declare function AsyncAPIServers({ layout, ...providerProps }: SectionProps): import('react').JSX.Element;
|
|
75
|
+
/**
|
|
76
|
+
* A table of every operation in an AsyncAPI document. Each row shows the
|
|
77
|
+
* channel and whether the operation sends or receives. Click a row to open a
|
|
78
|
+
* panel with the description, messages, security, bindings, and reply.
|
|
79
|
+
*
|
|
80
|
+
* On its own, pass `document`. With other sections, render it inside
|
|
81
|
+
* AsyncAPIProvider and pass `document` to the provider instead.
|
|
82
|
+
*/
|
|
55
83
|
export declare function AsyncAPIOperations({ layout, ...providerProps }: SectionProps): import('react').JSX.Element;
|
|
84
|
+
export interface AsyncAPIOperationProps extends SectionProps {
|
|
85
|
+
/** The operation's key under the document's top-level `operations`. */
|
|
86
|
+
operationId: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* One operation, rendered inline: its header and full detail (messages,
|
|
90
|
+
* bindings, security, code samples), without the list or the side panel.
|
|
91
|
+
*
|
|
92
|
+
* <AsyncAPIOperation document={doc} operationId="receiveLightMeasurement" />
|
|
93
|
+
*
|
|
94
|
+
* Renders nothing (and warns) when the operation doesn't exist.
|
|
95
|
+
*/
|
|
96
|
+
export declare function AsyncAPIOperation({ operationId, layout, ...providerProps }: AsyncAPIOperationProps): import('react').JSX.Element;
|
|
97
|
+
/**
|
|
98
|
+
* A table of the messages in an AsyncAPI document. Each row shows the message
|
|
99
|
+
* name and summary. Expand a row to see its payload and headers.
|
|
100
|
+
*
|
|
101
|
+
* On its own, pass `document`. With other sections, render it inside
|
|
102
|
+
* AsyncAPIProvider and pass `document` to the provider instead.
|
|
103
|
+
*/
|
|
56
104
|
export declare function AsyncAPIMessages({ layout, ...providerProps }: SectionProps): import('react').JSX.Element;
|
|
105
|
+
export interface AsyncAPIMessageProps extends SectionProps {
|
|
106
|
+
/** The message's key under `components.messages`. */
|
|
107
|
+
messageId: string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* One `components.messages` entry, rendered on its own with its payload and
|
|
111
|
+
* headers open.
|
|
112
|
+
*
|
|
113
|
+
* <AsyncAPIMessage document={doc} messageId="lightMeasured" />
|
|
114
|
+
*
|
|
115
|
+
* Renders nothing (and warns) when the message doesn't exist.
|
|
116
|
+
*/
|
|
117
|
+
export declare function AsyncAPIMessage({ messageId, layout, ...providerProps }: AsyncAPIMessageProps): import('react').JSX.Element;
|
|
118
|
+
/**
|
|
119
|
+
* The title, description, and version of an AsyncAPI document, with license,
|
|
120
|
+
* contact, and external docs beside it.
|
|
121
|
+
*
|
|
122
|
+
* On its own, pass `document`. With other sections, render it inside
|
|
123
|
+
* AsyncAPIProvider and pass `document` to the provider instead.
|
|
124
|
+
*/
|
|
57
125
|
export declare function AsyncAPIInfo({ layout, ...providerProps }: SectionProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Warns when a single-item section can't find the item it was asked for. The
|
|
3
|
+
* section renders nothing in that case, the same way a mis-nested section
|
|
4
|
+
* degrades instead of crashing the page; this is what makes the blank spot
|
|
5
|
+
* explainable. Fires once per distinct miss rather than on every render.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useNotFoundWarning(missing: boolean, message: string): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apiuikit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A React UI library for rendering your API specifications",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"react-components",
|
|
8
|
+
"ui-kit",
|
|
9
|
+
"openapi",
|
|
10
|
+
"asyncapi",
|
|
11
|
+
"swagger",
|
|
12
|
+
"api-documentation",
|
|
13
|
+
"api-docs",
|
|
14
|
+
"api-reference",
|
|
15
|
+
"documentation",
|
|
16
|
+
"websocket",
|
|
17
|
+
"try-it",
|
|
18
|
+
"api-explorer",
|
|
19
|
+
"developer-portal"
|
|
20
|
+
],
|
|
5
21
|
"license": "Apache-2.0",
|
|
6
22
|
"bugs": {
|
|
7
23
|
"url": "https://github.com/AceTheCreator/apiuikit/issues"
|