UNPKG

@janus-idp/backstage-plugin-jfrog-artifactory

Version:

The Jfrog Artifactory plugin displays information about your container images within the Jfrog Artifactory registry.

2 lines 2.99 kB
"use strict";(self.webpackChunkjanus_idp_backstage_plugin_jfrog_artifactory=self.webpackChunkjanus_idp_backstage_plugin_jfrog_artifactory||[]).push([[879],{87137:(i,e,t)=>{function r(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}t.d(e,{u:()=>o,C:()=>a});const a=(0,t(9490).createApiRef)({id:"plugin.jfrog-artifactory.service"});class o{async getBaseUrl(){const i=this.configApi.getOptionalString("jfrogArtifactory.proxyPath")||"/jfrog-artifactory/api";return`${await this.discoveryApi.getBaseUrl("proxy")}${i}`}async fetcher(i,e){const{token:t}=await this.identityApi.getCredentials(),r=await fetch(i,{headers:{"Content-Type":"application/json",...t&&{Authorization:`Bearer ${t}`}},method:"POST",body:e});if(!r.ok)throw new Error(`failed to fetch data, status ${r.status}: ${r.statusText}`);return await r.json()}async getTags(i){const e=await this.getBaseUrl(),t={query:"query ($filter: VersionFilter!, $first: Int, $orderBy: VersionOrder) { versions (filter: $filter, first: $first, orderBy: $orderBy) { edges { node { name, created, modified, package { id }, repos { name, type, leadFilePath }, licenses { name, source }, size, stats { downloadCount }, vulnerabilities { critical, high, medium, low, info, unknown, skipped }, files { name, lead, size, md5, sha1, sha256, mimeType } } } } }",variables:{filter:{packageId:`docker://${i}`,name:"*",ignorePreRelease:!1},first:100,orderBy:{field:"NAME_SEMVER",direction:"DESC"}}};return await this.fetcher(`${e}/metadata/api/v1/query`,JSON.stringify(t))}constructor(i){r(this,"discoveryApi",void 0),r(this,"configApi",void 0),r(this,"identityApi",void 0),this.discoveryApi=i.discoveryApi,this.configApi=i.configApi,this.identityApi=i.identityApi}}},84210:(i,e,t)=>{t.d(e,{Z:()=>a,_:()=>r});const r="jfrog-artifactory/image-name",a=({entity:i})=>{var e,t;const a=null!==(t=null==i||null===(e=i.metadata.annotations)||void 0===e?void 0:e[r])&&void 0!==t?t:"";if(!a)throw new Error("'Jfrog Artifactory' annotations are missing");return{imageName:a}}},99129:(i,e,t)=>{t.r(e),t.d(e,{JfrogArtifactoryPage:()=>c,isJfrogArtifactoryAvailable:()=>d,jfrogArtifactoryPlugin:()=>s});var r=t(9490),a=t(87137),o=t(84210);const n=(0,r.createRouteRef)({id:"jfrog-artifactory"}),s=(0,r.createPlugin)({id:"jfrog-artifactory",routes:{root:n},apis:[(0,r.createApiFactory)({api:a.C,deps:{discoveryApi:r.discoveryApiRef,configApi:r.configApiRef,identityApi:r.identityApiRef},factory:({discoveryApi:i,configApi:e,identityApi:t})=>new a.u({discoveryApi:i,configApi:e,identityApi:t})})]}),c=s.provide((0,r.createComponentExtension)({name:"JfrogArtifactoryPage",component:{lazy:()=>Promise.all([t.e(5124),t.e(4491),t.e(1042),t.e(5478),t.e(484),t.e(7326),t.e(1942),t.e(7761)]).then(t.bind(t,36906)).then((i=>i.JfrogArtifactoryDashboardPage))}})),d=i=>{var e;return Boolean(null==i||null===(e=i.metadata.annotations)||void 0===e?void 0:e[o._])}}}]); //# sourceMappingURL=exposed-PluginRoot.6256f88c.chunk.js.map