UNPKG

@techdocs/cli

Version:

Utility CLI for managing TechDocs sites in Backstage.

2 lines • 32.4 kB
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["8403"],{21205:function(e,t,i){i.d(t,{es:()=>o,x7:()=>r});var a=i(79146);let n="catalog-entity";(0,a.J)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:n});let r=(0,a.J)({name:"catalog.entity.create",attributes:{action:"create"}});(0,a.J)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:n});let o=(0,a.J)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:n});(0,a.J)({name:"catalog.entity.validate",attributes:{}}),(0,a.J)({name:"catalog.location.read",attributes:{action:"read"}}),(0,a.J)({name:"catalog.location.create",attributes:{action:"create"}}),(0,a.J)({name:"catalog.location.analyze",attributes:{}}),(0,a.J)({name:"catalog.location.delete",attributes:{action:"delete"}})},5e4:function(e,t,i){i.d(t,{X2:()=>d,ce:()=>c,h$:()=>p});var a=i(52322),n=i(39381),r=i(60214),o=i(18011),s=i(88260);let l=(0,o.CT)("entity-context"),p=e=>{let{children:t,entity:i,loading:o,error:p,refresh:d}=e;return(0,a.jsx)(l.Provider,{value:(0,s.E)({1:{entity:i,loading:o,error:p,refresh:d}}),children:(0,a.jsx)(r.fC,{attributes:{...i?{entityRef:(0,n.eE)(i)}:void 0},children:t})})};function d(){let e=(0,o.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 c(){let e=(0,o.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:i,loading:a,error:n,refresh:r}=t;return{entity:i,loading:a,error:n,refresh:r}}},94890:function(e,t,i){i.d(t,{s:()=>a});let a=(0,i(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"}}}})},34626:function(e,t,i){i.r(t),i.d(t,{AboutContent:()=>eb,AboutField:()=>ey,AboutCard:()=>ew});var a=i(52322),n=i(2784),r=i(79692),o=i(94339),s=i(24579),l=i(32552),p=i(85256),d=i(61837),c=i(52866),m=i(27604),u=i(30254),h=i(88188),y=i(16709),f=i.n(y),g=i(35292),b=i(13039),x=i(53244),v=i(90436);let k=(0,r.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function w({color:e="primary",disabled:t=!1,href:i="#",icon:n=(0,a.jsx)(g.default,{}),label:r,onClick:o,title:s}){let l=k();return t?(0,a.jsxs)(x.Z,{title:s,className:f()(l.link,l.disabled),children:[n,(0,a.jsx)(v.Z,{variant:"caption",component:"span",className:l.label,children:r})]}):(0,a.jsxs)(b.rU,{title:s,className:f()(l.link,l[e]),to:i,onClick:o,children:[n,(0,a.jsx)(v.Z,{variant:"caption",component:"span",className:l.label,children:r})]})}let j=(0,r.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3),wordBreak:"keep-all"}}),{name:"BackstageHeaderIconLinkRow"});function T(e){let{links:t}=e,i=j();return(0,a.jsx)("nav",{className:i.links,children:t.map((e,t)=>(0,a.jsx)(w,{...e},t+1))})}var C=i(1820),L=i(16162),A=i(93048),S=i(40098),E=i(14083),N=i(8349),I=i(14380),U=i(43221),R=i(73250);let $=e=>{let{type:t}=e,i=(0,S.q)(),n=R.default,r=t?i.getSystemIcon(t)??n:n;return(0,a.jsx)(r,{})};var M=i(99182),Z=i(91656),F=i(39381),P=i(5e4),O=i(47645),B=i(84081),q=i(68043),D=i(21205),z=i(99503),J=i(25942),V=i(27991),_=i.n(V),H=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that\'s common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}'),G=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),W=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),X=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","targetRef"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference","deprecated":true},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');let K=new Map,Y=[G,H,W,X];var Q=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","type":"website","lifecycle":"production","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the template.","examples":["experimental","production","deprecated"],"minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"presentation":{"type":"object","description":"A way to redefine the presentation of the scaffolder.","properties":{"buttonLabels":{"type":"object","description":"A way to redefine the labels for actionable buttons.","properties":{"backButtonText":{"type":"string","description":"A button which return the user to one step back."},"createButtonText":{"type":"string","description":"A button which start the execution of the template."},"reviewButtonText":{"type":"string","description":"A button which open the review step to verify the input prior to start the execution."}}}}},"EXPERIMENTAL_recovery":{"type":"object","description":"A task recovery section.","properties":{"EXPERIMENTAL_strategy":{"type":"string","description":"Recovery strategy for your task (none or startOver). By default none"}}},"EXPERIMENTAL_formDecorators":{"type":"array","description":"A list of decorators and their inputs that the form should trigger before submitting the job","items":{"type":"object","properties":{"id":{"type":"string","description":"The form hook ID"},"input":{"type":"object","description":"A object describing the inputs to the form hook."}}}},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');(function(e,t={}){let i=t?.disableCache??!1,a=i?"":JSON.stringify(e);if(!i){let e=K.get(a);if(e)return}let n=function(e){if("object"!=typeof e)return[];let t=new Set;e.$id&&t.add(e.$id);let i=[],a=[e];for(;a.length;)for(let e of function*(e){let t=[e];for(;t.length;){let e=t.pop();if("object"==typeof e&&e)for(let[i,a]of Object.entries(e))"$ref"===i&&"string"==typeof a?yield a.split("#")[0]:t.push(a)}}(a.pop()))if(!t.has(e)){t.add(e);let n=Y.find(t=>t.$id===e);n&&(i.push(n),a.push(n))}return i}(e),r=new(_())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});n.length&&r.addSchema(n,void 0,void 0,!0);let o=r.compile(e);i||K.set(a,o)})(Q);var ee=i(79146);let et="scaffolder-template",ei="scaffolder-task",ea=((0,ee.J)({name:"scaffolder.action.execute",attributes:{},resourceType:"scaffolder-action"}),(0,ee.J)({name:"scaffolder.template.parameter.read",attributes:{action:"read"},resourceType:et}),(0,ee.J)({name:"scaffolder.template.step.read",attributes:{action:"read"},resourceType:et}),(0,ee.J)({name:"scaffolder.task.read",attributes:{action:"read"},resourceType:ei}),(0,ee.J)({name:"scaffolder.task.create",attributes:{action:"create"}}));(0,ee.J)({name:"scaffolder.task.cancel",attributes:{},resourceType:ei}),(0,ee.J)({name:"scaffolder.template.management",attributes:{}});var en=i(2694),er=i(94890),eo=i(64279),es=i(58985),el=i(79043),ep=i(57148),ed=i(86784),ec=i(60905),em=i(87609),eu=i(37840);let eh=(0,r.Z)(e=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:e.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function ey(e){let{label:t,value:i,gridSizes:n,children:r,className:o}=e,s=eh(),l=(0,eu.v)(r,e=>e.getElements()),p=l.length>0?l:(0,a.jsx)(v.Z,{variant:"body2",className:s.value,children:i||"unknown"});return(0,a.jsxs)(ec.Z,{item:!0,...n,className:o,children:[(0,a.jsx)(v.Z,{variant:"h2",className:s.label,children:t}),p]})}var ef=i(62823);let eg=(0,r.Z)({description:{wordBreak:"break-word"}});function eb(e){let t,{entity:i}=e,n=eg(),{t:r}=(0,I.i)(er.s),o="system"===i.kind.toLocaleLowerCase("en-US"),s="resource"===i.kind.toLocaleLowerCase("en-US"),l="component"===i.kind.toLocaleLowerCase("en-US"),p="api"===i.kind.toLocaleLowerCase("en-US"),d="template"===i.kind.toLocaleLowerCase("en-US"),c="location"===i.kind.toLocaleLowerCase("en-US"),m="group"===i.kind.toLocaleLowerCase("en-US"),u=(0,el.h)(i,es.cz,{kind:"system"}),h=(0,el.h)(i,es.cz,{kind:"component"}),y=(0,el.h)(i,es.cz,{kind:"domain"}),f=(0,el.h)(i,es.S4);try{t=(0,O.CV)(i)}catch(e){t=void 0}return(0,a.jsxs)(ec.Z,{container:!0,children:[(0,a.jsx)(ey,{label:r("aboutCard.descriptionField.label"),gridSizes:{xs:12},children:(0,a.jsx)(em.S,{className:n.description,content:i?.metadata?.description||r("aboutCard.descriptionField.value")})}),(0,a.jsx)(ey,{label:r("aboutCard.ownerField.label"),value:r("aboutCard.ownerField.value"),className:n.description,gridSizes:{xs:12,sm:6,lg:4},children:f.length>0&&(0,a.jsx)(ep.r,{entityRefs:f,defaultKind:"group"})}),(o||y.length>0)&&(0,a.jsx)(ey,{label:r("aboutCard.domainField.label"),value:r("aboutCard.domainField.value"),gridSizes:{xs:12,sm:6,lg:4},children:y.length>0&&(0,a.jsx)(ep.r,{entityRefs:y,defaultKind:"domain"})}),(p||l||s||u.length>0)&&(0,a.jsx)(ey,{label:r("aboutCard.systemField.label"),value:r("aboutCard.systemField.value"),gridSizes:{xs:12,sm:6,lg:4},children:u.length>0&&(0,a.jsx)(ep.r,{entityRefs:u,defaultKind:"system"})}),l&&h.length>0&&(0,a.jsx)(ey,{label:r("aboutCard.parentComponentField.label"),value:r("aboutCard.parentComponentField.value"),gridSizes:{xs:12,sm:6,lg:4},children:(0,a.jsx)(ep.r,{entityRefs:h,defaultKind:"component"})}),(p||l||s||d||m||c||"string"==typeof i?.spec?.type)&&(0,a.jsx)(ey,{label:r("aboutCard.typeField.label"),value:i?.spec?.type,gridSizes:{xs:12,sm:6,lg:4}}),(p||l||"string"==typeof i?.spec?.lifecycle)&&(0,a.jsx)(ey,{label:r("aboutCard.lifecycleField.label"),value:i?.spec?.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,a.jsx)(ey,{label:r("aboutCard.tagsField.label"),value:r("aboutCard.tagsField.value"),gridSizes:{xs:12,sm:6,lg:4},children:(i?.metadata?.tags||[]).map(e=>(0,a.jsx)(ed.Z,{size:"small",label:e},e))}),c&&(i?.spec?.targets||i?.spec?.target)&&(0,a.jsx)(ey,{label:r("aboutCard.targetsField.label"),gridSizes:{xs:12},children:(0,a.jsx)(ef.s,{cols:1,items:(i.spec.targets||[i.spec.target]).map(e=>e).map(e=>({text:e,href:function(e,t,i){if("url"===t||e.includes("://"))return e;let a="file"===i.type?`file://${i.target}`:i.target;return"file"===t||"file"===i.type?new URL(e,a).href:a}(e,i?.spec?.type||"unknown",t)}))})})]})}function ex(){let{entity:e}=(0,P.X2)(),t=function(){let{entity:e}=(0,P.X2)(),t=(0,L.h_)(U.q),{t:i}=(0,I.i)(er.s),n=function(e,t){let i=e.metadata.annotations?.[Z.M6];if(i)try{let e=(0,O.Ou)(i),a=t.byUrl(e.target);return{locationTargetUrl:e.target,integrationType:a?.type}}catch{return}}(e,t);return{label:i("aboutCard.viewSource"),disabled:!n,icon:(0,a.jsx)($,{type:n?.integrationType}),href:n?.locationTargetUrl}}(),i=function(){let{entity:e}=(0,P.X2)(),t=(0,A.t)(en.jU),{t:i}=(0,I.i)(er.s);return{label:i("aboutCard.viewTechdocs"),disabled:!(e.metadata.annotations?.[z.w5]||e.metadata.annotations?.[z.Un])||!t,icon:(0,a.jsx)(u.default,{}),href:(0,J.Li)(e,t)}}(),n=function(){let e=(0,S.q)(),{entity:t}=(0,P.X2)(),i=(0,A.t)(en.ql),{t:n}=(0,I.i)(er.s),r=e.getSystemIcon("scaffolder")??h.default,{allowed:o}=(0,q.g)({permission:ea});return{label:n("aboutCard.launchTemplate"),icon:(0,a.jsx)(r,{}),disabled:!i||!o,href:i&&i({templateName:t.metadata.name,namespace:t.metadata.namespace||M.zG})}}(),r=[t,i];return"scaffolder.backstage.io/v1beta3"===e.apiVersion&&"Template"===e.kind&&r.push(n),(0,a.jsx)(T,{links:r})}let ev=(0,r.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function ek(e){let{variant:t,subheader:i}=e,r=ev(),{entity:u}=(0,P.X2)(),h=(0,L.h_)(B.A),y=(0,L.h_)(E.$),f=(0,L.h_)(N.V),g=(0,A.t)(en.ql),x=(e=>{let t=(0,L.h_)(B.A),{value:i}=(0,eo.default)(async()=>{let i,a=e.metadata.annotations?.["backstage.io/source-template"];if(a)try{let e=await t.getEntityByRef(a);return i=(0,F.of)(a),void 0!==e?i:void 0}catch{return}},[t,e]);return i})(u),{allowed:v}=function(e){let{entity:t,loading:i,error:a}=(0,P.ce)(),{allowed:n,loading:r,error:o}=(0,q.g)({permission:e,resourceRef:t?(0,F.eE)(t):void 0});return i||r?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:n,error:o}}(D.es),{t:k}=(0,I.i)(er.s),w=u.metadata.annotations?.[M.Tf],j="";"gridItem"===t?j=r.gridItemCard:"fullHeight"===t&&(j=r.fullHeightCard);let T="";"gridItem"===t?T=r.gridItemCardContent:"fullHeight"===t&&(T=r.fullHeightCardContent);let S=u.metadata.annotations?.[Z.P1],U=S?.startsWith("url:")||S?.startsWith("file:"),R=(0,n.useCallback)(async()=>{try{await h.refreshEntity((0,F.eE)(u)),y.post({message:k("aboutCard.refreshScheduledMessage"),severity:"info",display:"transient"})}catch(e){f.post(e)}},[h,u,y,k,f]);return(0,a.jsxs)(o.Z,{className:j,children:[(0,a.jsx)(l.Z,{title:k("aboutCard.title"),action:(0,a.jsxs)(a.Fragment,{children:[U&&v&&(0,a.jsx)(d.Z,{"aria-label":"Refresh",title:k("aboutCard.refreshButtonTitle"),onClick:R,children:(0,a.jsx)(c.default,{})}),(0,a.jsx)(d.Z,{component:b.rU,"aria-label":"Edit",disabled:!w,title:k("aboutCard.editButtonTitle"),to:w??"#",children:(0,a.jsx)(m.default,{})}),x&&g&&(0,a.jsx)(d.Z,{component:b.rU,title:k("aboutCard.createSimilarButtonTitle"),to:g({namespace:x.namespace,templateName:x.name}),children:(0,a.jsx)(C.yO,{id:"scaffolder"})})]}),subheader:i??(0,a.jsx)(ex,{})}),(0,a.jsx)(p.Z,{}),(0,a.jsx)(s.Z,{className:T,children:(0,a.jsx)(eb,{entity:u})})]})}function ew(e){return(0,a.jsx)(ek,{...e})}},62823:function(e,t,i){i.d(t,{s:()=>y});var a=i(52322),n=i(90348),r=i(11861),o=i(53244),s=i(90436),l=i(79692),p=i(52160),d=i(13039);let c=(0,l.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function m(e){let{href:t,text:i,Icon:n}=e,r=c();return(0,a.jsxs)(o.Z,{display:"flex",children:[(0,a.jsx)(o.Z,{mr:1,className:r.svgIcon,children:(0,a.jsx)(s.Z,{component:"div",children:n?(0,a.jsx)(n,{}):(0,a.jsx)(p.default,{})})}),(0,a.jsx)(o.Z,{flexGrow:"1",children:(0,a.jsx)(d.rU,{to:t,target:"_blank",rel:"noopener",children:i||t})})]})}var u=i(41156);let h={xs:1,sm:1,md:1,lg:2,xl:3};function y(e){let{items:t,cols:i}=e,o=function(e){let t=[(0,u.Z)(e=>e.breakpoints.up("xl"))?"xl":null,(0,u.Z)(e=>e.breakpoints.up("lg"))?"lg":null,(0,u.Z)(e=>e.breakpoints.up("md"))?"md":null,(0,u.Z)(e=>e.breakpoints.up("sm"))?"sm":null,(0,u.Z)(e=>e.breakpoints.up("xs"))?"xs":null],i=1;if("number"==typeof e)i=e;else{let a=t.find(e=>null!==e)??"xs";i=e?.[a]??h[a]}return i}(i);return(0,a.jsx)(n.Z,{rowHeight:"auto",cols:o,children:t.map(({text:e,href:t,Icon:i},n)=>(0,a.jsx)(r.Z,{children:(0,a.jsx)(m,{href:t,text:e??t,Icon:i})},n))})}},79146:function(e,t,i){i.d(t,{J:()=>a});function a({name:e,attributes:t,resourceType:i}){return i?{type:"resource",name:e,attributes:t,resourceType:i}:{type:"basic",name:e,attributes:t}}},68043:function(e,t,i){i.d(t,{g:()=>l});var a=i(16162),n=i(55944),r=i(79563),o=i(45471),s=i(4841);function l(e){let t=(0,a.h_)(n.R),{data:i,error:l}=(0,s.ZP)(e,async e=>{if((0,r.g2)(e.permission)&&!e.resourceRef)return o.r.DENY;let{result:i}=await t.authorize(e);return i});return l?{error:l,loading:!1,allowed:!1}:void 0===i?{loading:!0,allowed:!1}:{loading:!1,allowed:i===o.r.ALLOW}}}}]); //# sourceMappingURL=8403.3a64a455.chunk.js.map