@redocly/asyncapi-docs 1.1.0-next.5 → 1.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.
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";var q=exports&&exports.__createBinding||(Object.create?function(n,t,
|
|
1
|
+
"use strict";var q=exports&&exports.__createBinding||(Object.create?function(n,t,a,l){l===void 0&&(l=a);var o=Object.getOwnPropertyDescriptor(t,a);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(n,l,o)}:function(n,t,a,l){l===void 0&&(l=a),n[l]=t[a]}),C=exports&&exports.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),w=exports&&exports.__importStar||function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var a in n)a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)&&q(t,n,a);return C(t,n),t},A=exports&&exports.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ChannelSection=void 0;const i=require("react/jsx-runtime"),d=w(require("react")),v=A(require("styled-components")),j=require("jotai"),c=require("@redocly/openapi-docs"),u=require("@redocly/theme"),b=require("../jotai-store/app"),g=require("./common"),D=require("./ChannelParameters"),L=require("./ServersListPanel"),B=require("./ChannelBinding"),I=require("./MessageSection"),O=require("./OperationSection"),k=require("../hooks");exports.ChannelSection=d.default.memo(({item:n})=>{var t;const a=(0,j.useAtomValue)(b.layoutAtom),l=(0,j.useAtomValue)(b.routingBasePathAtom),o=(0,j.useAtomValue)(b.definitionAtom),p=a===u.LayoutVariant.STACKED,e=(t=o.channels)===null||t===void 0?void 0:t[n.id],{getProtocolLabel:x}=(0,k.useProtocolLabels)(e?.bindings),h=(0,d.useMemo)(()=>Object.entries(o.servers||{}).map(([r,s])=>({key:r,value:s})).filter(({value:r})=>{var s;return(s=e?.servers)===null||s===void 0?void 0:s.some(M=>M.host===r.host)}),[e?.servers,o.servers]),S=(0,d.useMemo)(()=>Object.entries(e?.bindings||{}).map(([r,s])=>({key:r,value:s})),[e?.bindings]),y=(0,d.useMemo)(()=>Object.entries(e?.messages||{}).map(([r,s])=>({key:r,value:s})),[e?.messages]),f=(0,d.useMemo)(()=>n.items.filter(r=>{var s;return r.action==="send"&&((s=o.operations)===null||s===void 0?void 0:s[r.id])}),[o.operations,n.items]),m=(0,d.useMemo)(()=>n.items.filter(r=>{var s;return r.action==="receive"&&((s=o.operations)===null||s===void 0?void 0:s[r.id])}),[o.operations,n.items]),P=(0,d.useMemo)(()=>{var r;return(r=e?.["x-badges"])===null||r===void 0?void 0:r.map(s=>Object.assign(Object.assign({},s),{position:s.position||"after"}))},[e]);if(!e)return null;const _=(0,u.combineUrls)(l,n.dataSectionId);return(0,i.jsxs)(H,{children:[(0,i.jsxs)(V,{sectionId:_,children:[(0,i.jsx)(c.Row,{layout:a,children:(0,i.jsx)(c.SamplesMiddlePanel,{compact:!0,className:"api-info",isStacked:p,children:(0,i.jsx)(g.ActionTag,{color:x("channel").toLowerCase(),children:x("channel")})})}),(0,i.jsxs)(c.Row,{layout:a,children:[(0,i.jsxs)(c.SamplesMiddlePanel,{compact:!0,className:"api-info",isStacked:p,children:[(0,i.jsxs)(R,{children:[(0,i.jsxs)(N,{children:[(0,i.jsx)(c.CustomBadges,{badges:P,children:e?.title||e?.address||n.id}),(0,i.jsx)(g.ShareLink,{to:_,"aria-label":`link to ${n.label}`})]}),(0,i.jsx)(u.PageActions,{pageSlug:_})]}),e.address&&(0,i.jsxs)(g.TagWithIcon,{icon:(0,i.jsx)(u.CurveAutoColonIcon,{size:"14px"}),children:["name: ",(0,i.jsx)("span",{children:e.address})]}),(0,i.jsx)(g.Information,{summary:e.summary,description:e.description,externalDocs:e.externalDocs}),e.parameters&&(0,i.jsx)(D.ChannelParameters,{parameters:e.parameters,id:n.link})]}),(0,i.jsxs)(c.OperationSamplesPanel,{isStacked:p,className:"panel-container-response-samples",children:[!!h?.length&&(0,i.jsx)(L.ServersListPanel,{servers:h,hideHeader:!0}),!!S.length&&(0,i.jsx)(B.ChannelBinding,{binding:S[0]})]})]}),y.length>0?(0,i.jsx)(I.MessageSection,{messages:y,id:n.link}):null]}),f.length>0?(0,i.jsx)(O.OperationSection,{operations:f,type:"send",id:n.link}):null,m.length>0&&f.length>0?(0,i.jsx)(c.Row,{layout:a,children:(0,i.jsx)(c.SamplesMiddlePanel,{isStacked:p,children:(0,i.jsx)(T,{})})}):null,m.length>0?(0,i.jsx)(O.OperationSection,{operations:m,type:"receive",id:n.link}):null]})});const H=v.default.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
|
|
4
4
|
&:not(:last-child) {
|
|
5
5
|
border-bottom: 1px solid var(--border-color-primary);
|
|
6
6
|
}
|
|
7
|
-
`,
|
|
7
|
+
`,V=(0,v.default)(c.Section)`
|
|
8
8
|
padding: var(--spacing-xxl) 0 var(--spacing-base);
|
|
9
9
|
scroll-margin-top: calc(var(--navbar-height) - var(--spacing-base)) !important;
|
|
10
|
-
`,N=(0,
|
|
10
|
+
`,N=(0,v.default)(u.H2)`
|
|
11
11
|
margin: 0 0 var(--spacing-xs) 0;
|
|
12
12
|
display: flex;
|
|
13
13
|
align-items: center;
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
visibility: visible;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
`,R=
|
|
22
|
+
`,R=v.default.div`
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: flex-start;
|
|
25
|
+
`,T=v.default.div`
|
|
23
26
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
24
27
|
`;
|
package/lib/types/async-api.d.ts
CHANGED
|
@@ -187,6 +187,7 @@ export interface AsyncApiOperation {
|
|
|
187
187
|
messages?: AsyncApiMessage[];
|
|
188
188
|
reply?: AsyncApiOperationReply;
|
|
189
189
|
'x-badges'?: AsyncApiXBadges[];
|
|
190
|
+
'x-owner-key'?: string;
|
|
190
191
|
[REDOCLY_TEAMS_RBAC]?: Record<string, string>;
|
|
191
192
|
}
|
|
192
193
|
export interface AsyncApiOperationReply {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/asyncapi-docs",
|
|
3
|
-
"version": "1.1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Async API docs for Redocly Realm",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"react-router-dom": "^6.21.1",
|
|
40
40
|
"styled-components": "5.3.11",
|
|
41
41
|
"web-vitals": "3.3.1",
|
|
42
|
+
"@redocly/openapi-docs": "3.12.0",
|
|
42
43
|
"@redocly/config": "0.28.0",
|
|
43
|
-
"@redocly/
|
|
44
|
-
"@redocly/theme": "0.56.0-next.13"
|
|
44
|
+
"@redocly/theme": "0.56.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": "^19.1.0"
|