UNPKG

@techdocs/cli

Version:

Utility CLI for managing TechDocs sites in Backstage.

2 lines • 16.3 kB
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["73"],{27597:function(e,t,n){var i=n(15755),a=n(25357);t.default=void 0;var o=a(n(2784));t.default=(0,i(n(50175)).default)(o.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward")},57575:function(e,t,n){n.d(t,{O:()=>l});var i=n(52322),a=n(79692),o=n(80030),r=n(90436);let s=(0,a.Z)({container:{overflow:"visible !important"},typo:{fontSize:"inherit",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":({line:e})=>e||1,"-webkit-box-orient":"vertical"}},{name:"BackstageOverflowTooltip"});function l(e){let t=s(e);return(0,i.jsx)(o.ZP,{title:e.title??(e.text||""),placement:e.placement,children:(0,i.jsx)(r.Z,{className:t.typo,variant:"inherit",children:e.text})})}},35402:function(e,t,n){n.d(t,{r:()=>R});var i=n(52322),a=n(94339),o=n(14503),r=n(24579),s=n(32552),l=n(85256),c=n(79692),d=n(77392),u=n(16709),m=n.n(u),p=n(53244),y=n(90436),h=n(27597),f=n(13039);let g=(0,c.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function x(e){let{link:t,title:n,onClick:a}=e,o=g();return(0,i.jsxs)(p.Z,{children:[(0,i.jsx)(l.Z,{}),(0,i.jsx)(f.rU,{to:t,onClick:a,underline:"none",children:(0,i.jsxs)(p.Z,{display:"flex",alignItems:"center",className:o.root,children:[(0,i.jsx)(p.Z,{className:o.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,i.jsx)(y.Z,{children:(0,i.jsx)("strong",{children:n})})}),(0,i.jsx)(h.default,{className:o.arrow})]})})]})}var C=n(2784),b=n(37667),v=n(33414),w=n(2210),j=n(14380);let E=e=>{let{slackChannel:t}=e,{t:n}=(0,j.i)(w.v);return t?"string"==typeof t?(0,i.jsx)(y.Z,{children:n("errorBoundary.title",{slackChannel:t})}):t.href?(0,i.jsx)(b.Q,{to:t.href,variant:"contained",children:t.name}):(0,i.jsx)(y.Z,{children:n("errorBoundary.title",{slackChannel:t.name})}):null},T=class extends C.Component{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(e,t){console.error(`ErrorBoundary, error: ${e}`,{error:e,errorInfo:t}),this.setState({error:e,errorInfo:t})}render(){let{slackChannel:e,children:t}=this.props,{error:n}=this.state;return n?(0,i.jsx)(v.y,{title:"Something Went Wrong",error:n,children:(0,i.jsx)(E,{slackChannel:e})}):t}},k=(0,c.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},contentAlignBottom:{display:"flex",alignItems:"self-end"},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),S=(0,d.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(o.Z),L={flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},Z={fullHeight:{flex:1},gridItem:{flex:1}};function R(e){let{title:t,subheader:n,divider:c=!0,deepLink:d,slackChannel:u,errorBoundaryProps:p,variant:y,alignContent:h="normal",children:f,headerStyle:g,headerProps:C,icon:b,action:v,actionsClassName:w,actions:j,cardClassName:E,actionsTopRight:R,className:D,noPadding:O,titleTypographyProps:M,subheaderTypographyProps:N}=e,B=k(),A={},I={};return y&&y.split(/[\s]+/g).forEach(e=>{A={...A,...L[e]},I={...I,...Z[e]}}),(0,i.jsx)(a.Z,{style:A,className:D,children:(0,i.jsxs)(T,{...p||(u?{slackChannel:u}:{}),children:[t&&(0,i.jsx)(s.Z,{classes:{root:m()(B.header),title:B.headerTitle,subheader:B.headerSubheader,avatar:B.headerAvatar,action:B.headerAction,content:B.headerContent},title:t,subheader:n||b?(0,i.jsxs)("div",{"data-testid":"info-card-subheader",children:[n&&(0,i.jsx)("div",{className:B.subheader,children:n}),b]}):null,action:v,style:{...g},titleTypographyProps:M,subheaderTypographyProps:N,...C}),R&&(0,i.jsx)(S,{children:R}),c&&(0,i.jsx)(l.Z,{}),(0,i.jsx)(r.Z,{className:m()(E,{[B.noPadding]:O,[B.contentAlignBottom]:"bottom"===h}),style:I,children:f}),j&&(0,i.jsx)(o.Z,{className:w,children:j}),d&&(0,i.jsx)(x,{...d})]})})}},47898:function(e,t,n){n.d(t,{u:()=>g});var i=n(52322),a=n(79692),o=n(58985),r=n(57575),s=n(79043),l=n(93386),c=n(41410),d=n(57148),u=n(58833);let m=Object.freeze({createEntityRefColumn(e){let{defaultKind:t}=e;function n(e){return e.metadata?.title||(0,l.$)(e,{defaultKind:t})}return{title:(0,i.jsx)(u.Z,{translationKey:"name"}),highlight:!0,customFilterAndSearch:(e,t)=>n(t).includes(e),customSort:(e,t)=>n(e).localeCompare(n(t)),render:e=>(0,i.jsx)(c.d,{entityRef:e,defaultKind:t,title:e.metadata?.title})}},createEntityRelationColumn(e){let{title:t,relation:n,defaultKind:a,filter:o}=e;function r(e){return(0,s.h)(e,n,o)}function c(e){return r(e).map(e=>(0,l.$)(e,{defaultKind:a})).join(", ")}return{title:t,customFilterAndSearch:(e,t)=>c(t).includes(e),customSort:(e,t)=>c(e).localeCompare(c(t)),render:e=>(0,i.jsx)(d.r,{entityRefs:r(e),defaultKind:a})}},createOwnerColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(u.Z,{translationKey:"type"}),relation:o.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(u.Z,{translationKey:"domain"}),relation:o.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(u.Z,{translationKey:"system"}),relation:o.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn:()=>({title:(0,i.jsx)(u.Z,{translationKey:"description"}),field:"metadata.description",render:e=>(0,i.jsx)(r.O,{text:e.metadata.description,placement:"bottom-start",line:2})}),createSpecLifecycleColumn:()=>({title:(0,i.jsx)(u.Z,{translationKey:"lifecycle"}),field:"spec.lifecycle"}),createSpecTypeColumn:()=>({title:(0,i.jsx)(u.Z,{translationKey:"type"}),field:"spec.type"})}),p=[m.createEntityRefColumn({defaultKind:"system"}),m.createDomainColumn(),m.createOwnerColumn(),m.createMetadataDescriptionColumn()],y=[m.createEntityRefColumn({defaultKind:"component"}),m.createSystemColumn(),m.createOwnerColumn(),m.createSpecTypeColumn(),m.createSpecLifecycleColumn(),m.createMetadataDescriptionColumn()];var h=n(33702);let f=(0,a.Z)(e=>({empty:{padding:e.spacing(2),display:"flex",justifyContent:"center"}})),g=e=>{let{entities:t,title:n,emptyContent:a,variant:o="gridItem",columns:r,tableOptions:s={}}=e,l=f(),c={minWidth:"0",width:"100%"};return"gridItem"===o&&(c.height="calc(100% - 10px)"),(0,i.jsx)(h.i,{columns:r,title:n,style:c,emptyContent:a&&(0,i.jsx)("div",{className:l.empty,children:a}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,...s},data:t})};g.columns=m,g.systemEntityColumns=p,g.componentEntityColumns=y},58833:function(e,t,n){n.d(t,{Z:()=>o});var i=n(14380),a=n(79669);let o=({translationKey:e})=>{let{t}=(0,i.i)(a.P);return t(`entityTableColumnTitle.${e}`)}},5e4:function(e,t,n){n.d(t,{X2:()=>d,ce:()=>u,h$:()=>c});var i=n(52322),a=n(39381),o=n(60214),r=n(18011),s=n(88260);let l=(0,r.CT)("entity-context"),c=e=>{let{children:t,entity:n,loading:r,error:c,refresh:d}=e;return(0,i.jsx)(l.Provider,{value:(0,s.E)({1:{entity:n,loading:r,error:c,refresh:d}}),children:(0,i.jsx)(o.fC,{attributes:{...n?{entityRef:(0,a.eE)(n)}:void 0},children:t})})};function d(){let e=(0,r.Vt)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");if(!t.entity)throw Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:t.entity}}function u(){let e=(0,r.Vt)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");let{entity:n,loading:i,error:a,refresh:o}=t;return{entity:n,loading:i,error:a,refresh:o}}},94890:function(e,t,n){n.d(t,{s:()=>i});let i=(0,n(73669).F)({id:"catalog",messages:{indexPage:{title:"{{orgName}} Catalog",createButtonTitle:"Create",supportButtonContent:"All your software catalog entities"},aboutCard:{title:"About",refreshButtonTitle:"Schedule entity refresh",editButtonTitle:"Edit Metadata",createSimilarButtonTitle:"Create something similar",refreshScheduledMessage:"Refresh scheduled",launchTemplate:"Launch Template",viewTechdocs:"View TechDocs",viewSource:"View Source",descriptionField:{label:"Description",value:"No description"},ownerField:{label:"Owner",value:"No Owner"},domainField:{label:"Domain",value:"No Domain"},systemField:{label:"System",value:"No System"},parentComponentField:{label:"Parent Component",value:"No Parent Component"},typeField:{label:"Type"},lifecycleField:{label:"Lifecycle"},tagsField:{label:"Tags",value:"No Tags"},targetsField:{label:"Targets"}},searchResultItem:{lifecycle:"Lifecycle",Owner:"Owner"},catalogTable:{warningPanelTitle:"Could not fetch catalog entities.",viewActionTitle:"View",editActionTitle:"Edit",starActionTitle:"Add to favorites",unStarActionTitle:"Remove from favorites"},dependencyOfComponentsCard:{title:"Dependency of components",emptyMessage:"No component depends on this component"},dependsOnComponentsCard:{title:"Depends on components",emptyMessage:"No component is a dependency of this component"},dependsOnResourcesCard:{title:"Depends on resources",emptyMessage:"No resource is a dependency of this component"},entityContextMenu:{copiedMessage:"Copied!",moreButtonTitle:"More",inspectMenuTitle:"Inspect entity",copyURLMenuTitle:"Copy entity URL",unregisterMenuTitle:"Unregister entity"},entityLabelsCard:{title:"Labels",emptyDescription:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityLabels:{warningPanelTitle:"Entity not found",ownerLabel:"Owner",lifecycleLabel:"Lifecycle"},entityLinksCard:{title:"Links",emptyDescription:"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityNotFound:{title:"Entity was not found",description:"Want to help us build this? Check out our Getting Started documentation.",docButtonTitle:"DOCS"},deleteEntity:{dialogTitle:"Are you sure you want to delete this entity?",deleteButtonTitle:"Delete",cancelButtonTitle:"Cancel",description:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."},entityProcessingErrorsDescription:"The error below originates from",entityRelationWarningDescription:"This entity has relations to other entities, which can't be found in the catalog.\n Entities not found are: ",hasComponentsCard:{title:"Has components",emptyMessage:"No component is part of this system"},hasResourcesCard:{title:"Has resources",emptyMessage:"No resource is part of this system"},hasSubcomponentsCard:{title:"Has subcomponents",emptyMessage:"No subcomponent is part of this component"},hasSubdomainsCard:{title:"Has subdomains",emptyMessage:"No subdomain is part of this domain"},hasSystemsCard:{title:"Has systems",emptyMessage:"No system is part of this domain"},relatedEntitiesCard:{emptyHelpLinkTitle:"Learn how to change this"},systemDiagramCard:{title:"System Diagram",description:"Use pinch & zoom to move around the diagram.",edgeLabels:{partOf:"part of",provides:"provides",dependsOn:"depends on"}}}})},78205:function(e,t,n){n.r(t),n.d(t,{HasSubdomainsCard:()=>c});var i=n(52322),a=n(58985),o=n(39408),r=n(87416),s=n(94890),l=n(14380);function c(e){let{t}=(0,l.i)(s.s),{variant:n="gridItem",title:c=t("hasSubdomainsCard.title"),columns:d=o.w7,tableOptions:u={}}=e;return(0,i.jsx)(r.f,{variant:n,title:c,entityKind:"Domain",relationType:a.aS,columns:d,asRenderableEntities:o.OC,emptyMessage:t("hasSubdomainsCard.emptyMessage"),emptyHelpLink:o.WW,tableOptions:u})}},87416:function(e,t,n){n.d(t,{f:()=>k});var i=n(52322),a=n(90436),o=n(5e4),r=n(39381),s=n(16162),l=n(4812),c=n(84081),d=n(47898),u=n(35402),m=n(77344),p=n(79692),y=n(85256),h=n(38402),f=n(49378),g=n(12753),x=n(50276),C=n(33414);let b=(0,p.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function v(e){let{title:t,error:n,defaultExpanded:a}=e,o=b();if("ResponseError"!==n.name)return(0,i.jsx)(C.y,{title:t??n.message,defaultExpanded:a,error:n});let{body:r,cause:s}=n,{request:l,response:c}=r,d=`${c.statusCode}: ${s.name}`,u=l&&`${l.method} ${l.url}`,m=s.message.replace(/\\n/g,"\n"),p=s.stack?.replace(/\\n/g,"\n"),v=JSON.stringify(r,void 0,2);return(0,i.jsxs)(C.y,{title:t??n.message,defaultExpanded:a,error:{name:d,message:m,stack:p},children:[u&&(0,i.jsxs)(h.Z,{alignItems:"flex-start",children:[(0,i.jsx)(f.Z,{classes:{secondary:o.text},primary:"Request",secondary:l?`${u}`:void 0}),(0,i.jsx)(x.b,{text:u})]}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y.Z,{component:"li",className:o.divider}),(0,i.jsx)(h.Z,{alignItems:"flex-start",children:(0,i.jsx)(f.Z,{classes:{secondary:o.text},primary:"Full Error as JSON"})}),(0,i.jsx)(g.O,{language:"json",text:v,showCopyCodeButton:!0})]})]})}var w=n(13039),j=n(39408),E=n(94890),T=n(14380);let k=e=>{let{variant:t="gridItem",title:n,columns:p,entityKind:y,relationType:h,emptyMessage:f,emptyHelpLink:g,asRenderableEntities:x,tableOptions:C={}}=e,{t:b}=(0,T.i)(E.s),{entity:j}=(0,o.X2)(),{entities:k,loading:S,error:L}=function(e,t){let n=t?.type?.toLocaleLowerCase("en-US"),i=t?.kind?.toLocaleLowerCase("en-US"),a=(0,s.h_)(c.A),{loading:o,value:d,error:u}=(0,l.Z)(async()=>{let t=e.relations?.filter(e=>(!n||e.type.toLocaleLowerCase("en-US")===n)&&(!i||(0,r.of)(e.targetRef).kind===i));if(!t?.length)return[];let{items:o}=await a.getEntitiesByRefs({entityRefs:t.map(e=>e.targetRef)});return o.filter(e=>!!e)},[e,n,i]);return{entities:d,loading:o,error:u}}(j,{type:h,kind:y});return S?(0,i.jsx)(u.r,{variant:t,title:n,children:(0,i.jsx)(m.E,{})}):L?(0,i.jsx)(u.r,{variant:t,title:n,children:(0,i.jsx)(v,{error:L})}):(0,i.jsx)(d.u,{title:n,variant:t,emptyContent:(0,i.jsxs)("div",{style:{textAlign:"center"},children:[(0,i.jsx)(a.Z,{variant:"body1",children:f}),(0,i.jsx)(a.Z,{variant:"body2",children:(0,i.jsx)(w.rU,{to:g,externalLinkIcon:!0,children:b("relatedEntitiesCard.emptyHelpLinkTitle")})})]}),columns:p,entities:x(k||[]),tableOptions:C})};k.componentEntityColumns=j.we,k.componentEntityHelpLink=j.AE,k.asComponentEntities=j.D,k.resourceEntityColumns=j.xp,k.resourceEntityHelpLink=j.Uc,k.asResourceEntities=j.$c,k.systemEntityColumns=j._v,k.systemEntityHelpLink=j.G5,k.asSystemEntities=j.el,k.domainEntityColums=j.w7,k.domainEntityHelpLink=j.WW,k.asDomainEntities=j.OC},39408:function(e,t,n){n.d(t,{$c:()=>c,AE:()=>o,D:()=>r,G5:()=>u,OC:()=>h,Uc:()=>l,WW:()=>y,_v:()=>d,el:()=>m,w7:()=>p,we:()=>a,xp:()=>s});var i=n(47898);let a=[i.u.columns.createEntityRefColumn({defaultKind:"component"}),i.u.columns.createOwnerColumn(),i.u.columns.createSpecTypeColumn(),i.u.columns.createSpecLifecycleColumn(),i.u.columns.createMetadataDescriptionColumn()],o="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",r=e=>e,s=[i.u.columns.createEntityRefColumn({defaultKind:"resource"}),i.u.columns.createOwnerColumn(),i.u.columns.createSpecTypeColumn(),i.u.columns.createSpecLifecycleColumn(),i.u.columns.createMetadataDescriptionColumn()],l="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",c=e=>e,d=[i.u.columns.createEntityRefColumn({defaultKind:"system"}),i.u.columns.createOwnerColumn(),i.u.columns.createMetadataDescriptionColumn()],u="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",m=e=>e,p=[i.u.columns.createEntityRefColumn({defaultKind:"domain"}),i.u.columns.createOwnerColumn(),i.u.columns.createMetadataDescriptionColumn()],y="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain",h=e=>e}}]); //# sourceMappingURL=73.20ff1e8c.chunk.js.map