@backstage-community/plugin-badges 0.2.59 → 0.2.60

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @backstage-community/plugin-badges
2
2
 
3
+ ## 0.2.60
4
+
5
+ ### Patch Changes
6
+
7
+ - b17bd5d: version:bump to v1.29.1
8
+
3
9
  ## 0.2.59
4
10
 
5
11
  ### Patch Changes
@@ -1,19 +1,12 @@
1
1
  import { generatePath } from 'react-router-dom';
2
2
  import { ResponseError } from '@backstage/errors';
3
3
  import { DEFAULT_NAMESPACE } from '@backstage/catalog-model';
4
- import { createApiRef, createPlugin, createApiFactory, fetchApiRef, discoveryApiRef, configApiRef, createComponentExtension } from '@backstage/core-plugin-api';
5
4
 
6
- var __defProp = Object.defineProperty;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __publicField = (obj, key, value) => {
9
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
10
- return value;
11
- };
12
5
  class BadgesClient {
6
+ discoveryApi;
7
+ fetchApi;
8
+ configApi;
13
9
  constructor(options) {
14
- __publicField(this, "discoveryApi");
15
- __publicField(this, "fetchApi");
16
- __publicField(this, "configApi");
17
10
  this.discoveryApi = options.discoveryApi;
18
11
  this.fetchApi = options.fetchApi;
19
12
  this.configApi = options.configApi;
@@ -70,47 +63,13 @@ class BadgesClient {
70
63
  }
71
64
  // This function is used to generate the route parameters using the entity kind, namespace and name
72
65
  getEntityRouteParams(entity) {
73
- var _a, _b;
74
66
  return {
75
67
  kind: entity.kind.toLocaleLowerCase("en-US"),
76
- namespace: (_b = (_a = entity.metadata.namespace) == null ? void 0 : _a.toLocaleLowerCase("en-US")) != null ? _b : DEFAULT_NAMESPACE,
68
+ namespace: entity.metadata.namespace?.toLocaleLowerCase("en-US") ?? DEFAULT_NAMESPACE,
77
69
  name: entity.metadata.name
78
70
  };
79
71
  }
80
72
  }
81
73
 
82
- const badgesApiRef = createApiRef({
83
- id: "plugin.badges.client"
84
- });
85
-
86
- const badgesPlugin = createPlugin({
87
- id: "badges",
88
- apis: [
89
- createApiFactory({
90
- api: badgesApiRef,
91
- deps: {
92
- fetchApi: fetchApiRef,
93
- discoveryApi: discoveryApiRef,
94
- configApi: configApiRef
95
- },
96
- factory: ({ fetchApi, discoveryApi, configApi }) => new BadgesClient({
97
- fetchApi,
98
- discoveryApi,
99
- configApi
100
- })
101
- })
102
- ]
103
- });
104
- const EntityBadgesDialog = badgesPlugin.provide(
105
- createComponentExtension({
106
- name: "EntityBadgesDialog",
107
- component: {
108
- lazy: () => import('./EntityBadgesDialog-DwRwuts8.esm.js').then(
109
- (m) => m.EntityBadgesDialog
110
- )
111
- }
112
- })
113
- );
114
-
115
- export { EntityBadgesDialog as E, badgesPlugin as a, badgesApiRef as b };
116
- //# sourceMappingURL=index-R_9uVcjC.esm.js.map
74
+ export { BadgesClient };
75
+ //# sourceMappingURL=BadgesClient.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BadgesClient.esm.js","sources":["../../src/api/BadgesClient.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { generatePath } from 'react-router-dom';\nimport { ResponseError } from '@backstage/errors';\nimport { Entity, DEFAULT_NAMESPACE } from '@backstage/catalog-model';\nimport { BadgesApi, BadgeSpec } from './types';\nimport { ConfigApi, DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\n\nexport class BadgesClient implements BadgesApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n private readonly configApi: ConfigApi;\n\n constructor(options: {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n configApi: ConfigApi;\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n this.configApi = options.configApi;\n }\n\n static fromConfig(options: {\n fetchApi: FetchApi;\n discoveryApi: DiscoveryApi;\n configApi: ConfigApi;\n }) {\n return new BadgesClient(options);\n }\n\n public async getEntityBadgeSpecs(entity: Entity): Promise<BadgeSpec[]> {\n // Check if obfuscation is enabled in the configuration\n const obfuscate = this.configApi.getOptionalBoolean('app.badges.obfuscate');\n\n if (obfuscate) {\n const entityUuidUrl = await this.getEntityUuidUrl(entity);\n const entityUuid = await this.getEntityUuid(entityUuidUrl).then(data => {\n return data.uuid;\n });\n const entityUuidBadgeSpecsUrl = await this.getEntityUuidBadgeSpecsUrl(\n entityUuid,\n );\n\n const response = await this.fetchApi.fetch(entityUuidBadgeSpecsUrl);\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return await response.json();\n }\n\n // If obfuscation is disabled, get the badge specs directly as the previous implementation\n const entityBadgeSpecsUrl = await this.getEntityBadgeSpecsUrl(entity);\n const response = await this.fetchApi.fetch(entityBadgeSpecsUrl);\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return await response.json();\n }\n\n private async getEntityUuidUrl(entity: Entity): Promise<string> {\n const routeParams = this.getEntityRouteParams(entity);\n const path = generatePath(`:namespace/:kind/:name`, routeParams);\n const baseUrl = await this.discoveryApi.getBaseUrl('badges');\n const obfuscatedEntityUrl = `${baseUrl}/entity/${path}/obfuscated`;\n\n return obfuscatedEntityUrl;\n }\n\n private async getEntityUuid(entityUuidUrl: string): Promise<any> {\n const responseEntityUuid = await this.fetchApi.fetch(entityUuidUrl);\n\n if (!responseEntityUuid.ok) {\n throw await ResponseError.fromResponse(responseEntityUuid);\n }\n return await responseEntityUuid.json();\n }\n\n private async getEntityUuidBadgeSpecsUrl(entityUuid: {\n uuid: string;\n }): Promise<string> {\n const baseUrl = await this.discoveryApi.getBaseUrl('badges');\n return `${baseUrl}/entity/${entityUuid}/badge-specs`;\n }\n\n private async getEntityBadgeSpecsUrl(entity: Entity): Promise<string> {\n const routeParams = this.getEntityRouteParams(entity);\n const path = generatePath(`:namespace/:kind/:name`, routeParams);\n const baseUrl = await this.discoveryApi.getBaseUrl('badges');\n return `${baseUrl}/entity/${path}/badge-specs`;\n }\n\n // This function is used to generate the route parameters using the entity kind, namespace and name\n private getEntityRouteParams(entity: Entity) {\n return {\n kind: entity.kind.toLocaleLowerCase('en-US'),\n namespace:\n entity.metadata.namespace?.toLocaleLowerCase('en-US') ??\n DEFAULT_NAMESPACE,\n name: entity.metadata.name,\n };\n }\n}\n"],"names":["response"],"mappings":";;;;AAsBO,MAAM,YAAkC,CAAA;AAAA,EAC5B,YAAA,CAAA;AAAA,EACA,QAAA,CAAA;AAAA,EACA,SAAA,CAAA;AAAA,EAEjB,YAAY,OAIT,EAAA;AACD,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,YAAA,CAAA;AAC5B,IAAA,IAAA,CAAK,WAAW,OAAQ,CAAA,QAAA,CAAA;AACxB,IAAA,IAAA,CAAK,YAAY,OAAQ,CAAA,SAAA,CAAA;AAAA,GAC3B;AAAA,EAEA,OAAO,WAAW,OAIf,EAAA;AACD,IAAO,OAAA,IAAI,aAAa,OAAO,CAAA,CAAA;AAAA,GACjC;AAAA,EAEA,MAAa,oBAAoB,MAAsC,EAAA;AAErE,IAAA,MAAM,SAAY,GAAA,IAAA,CAAK,SAAU,CAAA,kBAAA,CAAmB,sBAAsB,CAAA,CAAA;AAE1E,IAAA,IAAI,SAAW,EAAA;AACb,MAAA,MAAM,aAAgB,GAAA,MAAM,IAAK,CAAA,gBAAA,CAAiB,MAAM,CAAA,CAAA;AACxD,MAAA,MAAM,aAAa,MAAM,IAAA,CAAK,c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ACxB,CAAA;AAAA,GACF;AACF;;;;"}
@@ -0,0 +1,8 @@
1
+ import { createApiRef } from '@backstage/core-plugin-api';
2
+
3
+ const badgesApiRef = createApiRef({
4
+ id: "plugin.badges.client"
5
+ });
6
+
7
+ export { badgesApiRef };
8
+ //# sourceMappingURL=types.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.esm.js","sources":["../../src/api/types.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\nexport const badgesApiRef = createApiRef<BadgesApi>({\n id: 'plugin.badges.client',\n});\n\nexport type BadgeStyle =\n | 'plastic'\n | 'flat'\n | 'flat-square'\n | 'for-the-badge'\n | 'social';\n\ninterface Badge {\n color?: string;\n description?: string;\n kind?: 'entity';\n label: string;\n labelColor?: string;\n link?: string;\n message: string;\n style?: BadgeStyle;\n}\n\nexport interface BadgeSpec {\n /** Badge id */\n id: string;\n\n /** Badge data */\n badge: Badge;\n\n /** The URL to the badge image */\n url: string;\n\n /** The markdown code to use the badge */\n markdown: string;\n}\n\nexport interface BadgesApi {\n getEntityBadgeSpecs(entity: Entity): Promise<BadgeSpec[]>;\n}\n"],"names":[],"mappings":";;AAmBO,MAAM,eAAe,YAAwB,CAAA;AAAA,EAClD,EAAI,EAAA,sBAAA;AACN,CAAC;;;;"}
@@ -13,7 +13,7 @@ import useAsync from 'react-use/esm/useAsync';
13
13
  import 'react-router-dom';
14
14
  import '@backstage/errors';
15
15
  import '@backstage/catalog-model';
16
- import { b as badgesApiRef } from './index-R_9uVcjC.esm.js';
16
+ import { badgesApiRef } from '../api/types.esm.js';
17
17
  import { CodeSnippet, Progress, ResponseErrorPanel } from '@backstage/core-components';
18
18
  import { useApi } from '@backstage/core-plugin-api';
19
19
 
@@ -40,4 +40,4 @@ const EntityBadgesDialog = (props) => {
40
40
  };
41
41
 
42
42
  export { EntityBadgesDialog };
43
- //# sourceMappingURL=EntityBadgesDialog-DwRwuts8.esm.js.map
43
+ //# sourceMappingURL=EntityBadgesDialog.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityBadgesDialog.esm.js","sources":["../../src/components/EntityBadgesDialog.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useAsyncEntity } from '@backstage/plugin-catalog-react';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport { useTheme } from '@material-ui/core/styles';\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { badgesApiRef } from '../api';\n\nimport {\n CodeSnippet,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nexport const EntityBadgesDialog = (props: {\n open: boolean;\n onClose?: () => any;\n}) => {\n const { open, onClose } = props;\n const theme = useTheme();\n const { entity } = useAsyncEntity();\n const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));\n const badgesApi = useApi(badgesApiRef);\n\n const {\n value: badges,\n loading,\n error,\n } = useAsync(async () => {\n if (open && entity) {\n return await badgesApi.getEntityBadgeSpecs(entity);\n }\n return [];\n }, [badgesApi, entity, open]);\n\n const content = (badges || []).map(\n ({ badge: { description }, id, url, markdown }) => (\n <Box marginTop={4} key={id}>\n <DialogContentText component=\"div\">\n <img alt={description || id} src={url} />\n <CodeSnippet language=\"markdown\" text={markdown} showCopyCodeButton />\n </DialogContentText>\n </Box>\n ),\n );\n\n return (\n <Dialog fullScreen={fullScreen} open={open} onClose={onClose}>\n <DialogTitle>Entity Badges</DialogTitle>\n <DialogContent>\n <DialogContentText>\n Embed badges in other web sites that link back to this entity. Copy\n the relevant snippet of Markdown code to use the badge.\n </DialogContentText>\n\n {loading && <Progress />}\n {error && <ResponseErrorPanel error={error} />}\n\n {content}\n </DialogContent>\n\n <DialogActions>\n <Button onClick={onClose} color=\"primary\">\n Close\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAqCa,MAAA,kBAAA,GAAqB,CAAC,KAG7B,KAAA;AACJ,EAAM,MAAA,EAAE,IAAM,EAAA,OAAA,EAAY,GAAA,KAAA,CAAA;AAC1B,EAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,cAAe,EAAA,CAAA;AAClC,EAAA,MAAM,aAAa,aAAc,CAAA,KAAA,CAAM,WAAY,CAAA,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAC7D,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA,CAAA;AAErC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,MAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,GACF,GAAI,SAAS,YAAY;AACvB,IAAA,IAAI,QA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1C,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
package/dist/index.esm.js CHANGED
@@ -1,6 +1,2 @@
1
- export { E as EntityBadgesDialog, a as badgesPlugin } from './esm/index-R_9uVcjC.esm.js';
2
- import 'react-router-dom';
3
- import '@backstage/errors';
4
- import '@backstage/catalog-model';
5
- import '@backstage/core-plugin-api';
1
+ export { EntityBadgesDialog, badgesPlugin } from './plugin.esm.js';
6
2
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ import { BadgesClient } from './api/BadgesClient.esm.js';
2
+ import { badgesApiRef } from './api/types.esm.js';
3
+ import { createPlugin, createApiFactory, fetchApiRef, discoveryApiRef, configApiRef, createComponentExtension } from '@backstage/core-plugin-api';
4
+
5
+ const badgesPlugin = createPlugin({
6
+ id: "badges",
7
+ apis: [
8
+ createApiFactory({
9
+ api: badgesApiRef,
10
+ deps: {
11
+ fetchApi: fetchApiRef,
12
+ discoveryApi: discoveryApiRef,
13
+ configApi: configApiRef
14
+ },
15
+ factory: ({ fetchApi, discoveryApi, configApi }) => new BadgesClient({
16
+ fetchApi,
17
+ discoveryApi,
18
+ configApi
19
+ })
20
+ })
21
+ ]
22
+ });
23
+ const EntityBadgesDialog = badgesPlugin.provide(
24
+ createComponentExtension({
25
+ name: "EntityBadgesDialog",
26
+ component: {
27
+ lazy: () => import('./components/EntityBadgesDialog.esm.js').then(
28
+ (m) => m.EntityBadgesDialog
29
+ )
30
+ }
31
+ })
32
+ );
33
+
34
+ export { EntityBadgesDialog, badgesPlugin };
35
+ //# sourceMappingURL=plugin.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { badgesApiRef, BadgesClient } from './api';\nimport {\n configApiRef,\n createApiFactory,\n createComponentExtension,\n createPlugin,\n fetchApiRef,\n discoveryApiRef,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const badgesPlugin = createPlugin({\n id: 'badges',\n apis: [\n createApiFactory({\n api: badgesApiRef,\n deps: {\n fetchApi: fetchApiRef,\n discoveryApi: discoveryApiRef,\n configApi: configApiRef,\n },\n factory: ({ fetchApi, discoveryApi, configApi }) =>\n new BadgesClient({\n fetchApi,\n discoveryApi,\n configApi,\n }),\n }),\n ],\n});\n\n/** @public */\nexport const EntityBadgesDialog = badgesPlugin.provide(\n createComponentExtension({\n name: 'EntityBadgesDialog',\n component: {\n lazy: () =>\n import('./components/EntityBadgesDialog').then(\n m => m.EntityBadgesDialog,\n ),\n },\n }),\n);\n"],"names":[],"mappings":";;;;AA0BO,MAAM,eAAe,YAAa,CAAA;AAAA,EACvC,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,YAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,QAAU,EAAA,WAAA;AAAA,QACV,YAAc,EAAA,eAAA;AAAA,QACd,SAAW,EAAA,YAAA;AAAA,OACb;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,QAAA,EAAU,cAAc,SAAU,EAAA,KAC5C,IAAI,YAAa,CAAA;AAAA,QACf,QAAA;AAAA,QACA,YAAA;AAAA,QACA,SAAA;AAAA,OACD,CAAA;AAAA,KACJ,CAAA;AAAA,GACH;AACF,CAAC,EAAA;AAGM,MAAM,qBAAqB,YAAa,CAAA,OAAA;AAAA,EAC7C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,oBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,wCAAiC,CAAE,CAAA,IAAA;AAAA,QACxC,OAAK,CAAE,CAAA,kBAAA;AAAA,OACT;AAAA,KACJ;AAAA,GACD,CAAA;AACH;;;;"}
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-badges",
3
- "version": "0.2.59",
3
+ "version": "0.2.60",
4
4
  "description": "A Backstage plugin that generates README badges for your entities",
5
5
  "backstage": {
6
- "role": "frontend-plugin"
6
+ "role": "frontend-plugin",
7
+ "pluginId": "badges",
8
+ "pluginPackages": [
9
+ "@backstage-community/plugin-badges",
10
+ "@backstage-community/plugin-badges-backend"
11
+ ]
7
12
  },
8
13
  "publishConfig": {
9
14
  "access": "public",
@@ -33,19 +38,19 @@
33
38
  "test": "backstage-cli package test"
34
39
  },
35
40
  "dependencies": {
36
- "@backstage/catalog-model": "^1.4.5",
37
- "@backstage/core-components": "^0.14.4",
38
- "@backstage/core-plugin-api": "^1.9.2",
41
+ "@backstage/catalog-model": "^1.5.0",
42
+ "@backstage/core-components": "^0.14.9",
43
+ "@backstage/core-plugin-api": "^1.9.3",
39
44
  "@backstage/errors": "^1.2.4",
40
- "@backstage/plugin-catalog-react": "^1.11.3",
45
+ "@backstage/plugin-catalog-react": "^1.12.2",
41
46
  "@material-ui/core": "^4.12.2",
42
47
  "@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
43
48
  "react-use": "^17.2.4"
44
49
  },
45
50
  "devDependencies": {
46
- "@backstage/cli": "^0.26.3",
47
- "@backstage/dev-utils": "^1.0.31",
48
- "@backstage/test-utils": "^1.5.4",
51
+ "@backstage/cli": "^0.26.11",
52
+ "@backstage/dev-utils": "^1.0.35",
53
+ "@backstage/test-utils": "^1.5.8",
49
54
  "@testing-library/dom": "^10.0.0",
50
55
  "@testing-library/jest-dom": "^6.0.0",
51
56
  "@testing-library/react": "^15.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"EntityBadgesDialog-DwRwuts8.esm.js","sources":["../../src/components/EntityBadgesDialog.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useAsyncEntity } from '@backstage/plugin-catalog-react';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport { useTheme } from '@material-ui/core/styles';\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { badgesApiRef } from '../api';\n\nimport {\n CodeSnippet,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nexport const EntityBadgesDialog = (props: {\n open: boolean;\n onClose?: () => any;\n}) => {\n const { open, onClose } = props;\n const theme = useTheme();\n const { entity } = useAsyncEntity();\n const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));\n const badgesApi = useApi(badgesApiRef);\n\n const {\n value: badges,\n loading,\n error,\n } = useAsync(async () => {\n if (open && entity) {\n return await badgesApi.getEntityBadgeSpecs(entity);\n }\n return [];\n }, [badgesApi, entity, open]);\n\n const content = (badges || []).map(\n ({ badge: { description }, id, url, markdown }) => (\n <Box marginTop={4} key={id}>\n <DialogContentText component=\"div\">\n <img alt={description || id} src={url} />\n <CodeSnippet language=\"markdown\" text={markdown} showCopyCodeButton />\n </DialogContentText>\n </Box>\n ),\n );\n\n return (\n <Dialog fullScreen={fullScreen} open={open} onClose={onClose}>\n <DialogTitle>Entity Badges</DialogTitle>\n <DialogContent>\n <DialogContentText>\n Embed badges in other web sites that link back to this entity. Copy\n the relevant snippet of Markdown code to use the badge.\n </DialogContentText>\n\n {loading && <Progress />}\n {error && <ResponseErrorPanel error={error} />}\n\n {content}\n </DialogContent>\n\n <DialogActions>\n <Button onClick={onClose} color=\"primary\">\n Close\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAqCa,MAAA,kBAAA,GAAqB,CAAC,KAG7B,KAAA;AACJ,EAAM,MAAA,EAAE,IAAM,EAAA,OAAA,EAAY,GAAA,KAAA,CAAA;AAC1B,EAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,cAAe,EAAA,CAAA;AAClC,EAAA,MAAM,aAAa,aAAc,CAAA,KAAA,CAAM,WAAY,CAAA,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAC7D,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA,CAAA;AAErC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,MAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,GACF,GAAI,SAAS,YAAY;AACvB,IAAA,IAAI,QAAQ,MAAQ,EAAA;AAClB,MAAO,OAAA,MAAM,SAAU,CAAA,mBAAA,CAAoB,MAAM,CAAA,CAAA;AAAA,KACnD;AACA,IAAA,OAAO,EAAC,CAAA;AAAA,GACP,EAAA,CAAC,SAAW,EAAA,MAAA,EAAQ,IAAI,CAAC,CAAA,CAAA;AAE5B,EAAM,MAAA,OAAA,GAAA,CAAW,MAAU,IAAA,EAAI,EAAA,GAAA;AAAA,IAC7B,CAAC,EAAE,KAAA,EAAO,EAAE,WAAA,IAAe,EAAI,EAAA,GAAA,EAAK,QAAS,EAAA,yCAC1C,GAAI,EAAA,EAAA,SAAA,EAAW,CAAG,EAAA,GAAA,EAAK,sBACrB,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAkB,SAAU,EAAA,KAAA,EAAA,sCAC1B,KAAI,EAAA,EAAA,GAAA,EAAK,WAAe,IAAA,EAAA,EAAI,KAAK,GAAK,EAAA,CAAA,kBACtC,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,EAAY,UAAS,UAAW,EAAA,IAAA,EAAM,UAAU,kBAAkB,EAAA,IAAA,EAAC,CACtE,CACF,CAAA;AAAA,GAEJ,CAAA;AAEA,EAAA,2CACG,MAAO,EAAA,EAAA,UAAA,EAAwB,IAAY,EAAA,OAAA,EAAA,sCACzC,WAAY,EAAA,IAAA,EAAA,eAAa,CAC1B,kBAAA,KAAA,CAAA,aAAA,CAAC,qCACE,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,IAAA,EAAkB,6HAGnB,CAAA,EAEC,2BAAY,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,IAAS,CACrB,EAAA,KAAA,wCAAU,kBAAmB,EAAA,EAAA,KAAA,EAAc,CAE3C,EAAA,OACH,mBAEC,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAO,SAAS,OAAS,EAAA,KAAA,EAAM,SAAU,EAAA,EAAA,OAE1C,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-R_9uVcjC.esm.js","sources":["../../src/api/BadgesClient.ts","../../src/api/types.ts","../../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { generatePath } from 'react-router-dom';\nimport { ResponseError } from '@backstage/errors';\nimport { Entity, DEFAULT_NAMESPACE } from '@backstage/catalog-model';\nimport { BadgesApi, BadgeSpec } from './types';\nimport { ConfigApi, DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\n\nexport class BadgesClient implements BadgesApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n private readonly configApi: ConfigApi;\n\n constructor(options: {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n configApi: ConfigApi;\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n this.configApi = options.configApi;\n }\n\n static fromConfig(options: {\n fetchApi: FetchApi;\n discoveryApi: DiscoveryApi;\n configApi: ConfigApi;\n }) {\n return new BadgesClient(options);\n }\n\n public async getEntityBadgeSpecs(entity: Entity): Promise<BadgeSpec[]> {\n // Check if obfuscation is enabled in the configuration\n const obfuscate = this.configApi.getOptionalBoolean('app.badges.obfuscate');\n\n if (obfuscate) {\n const entityUuidUrl = await this.getEntityUuidUrl(entity);\n const entityUuid = await this.getEntityUuid(entityUuidUrl).then(data => {\n return data.uuid;\n });\n const entityUuidBadgeSpecsUrl = await this.getEntityUuidBadgeSpecsUrl(\n entityUuid,\n );\n\n const response = await this.fetchApi.fetch(entityUuidBadgeSpecsUrl);\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return await response.json();\n }\n\n // If obfuscation is disabled, get the badge specs directly as the previous implementation\n const entityBadgeSpecsUrl = await this.getEntityBadgeSpecsUrl(entity);\n const response = await this.fetchApi.fetch(entityBadgeSpecsUrl);\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return await response.json();\n }\n\n private async getEntityUuidUrl(entity: Entity): Promise<string> {\n const routeParams = this.getEntityRouteParams(entity);\n const path = generatePath(`:namespace/:kind/:name`, routeParams);\n const baseUrl = await this.discoveryApi.getBaseUrl('badges');\n const obfuscatedEntityUrl = `${baseUrl}/entity/${path}/obfuscated`;\n\n return obfuscatedEntityUrl;\n }\n\n private async getEntityUuid(entityUuidUrl: string): Promise<any> {\n const responseEntityUuid = await this.fetchApi.fetch(entityUuidUrl);\n\n if (!responseEntityUuid.ok) {\n throw await ResponseError.fromResponse(responseEntityUuid);\n }\n return await responseEntityUuid.json();\n }\n\n private async getEntityUuidBadgeSpecsUrl(entityUuid: {\n uuid: string;\n }): Promise<string> {\n const baseUrl = await this.discoveryApi.getBaseUrl('badges');\n return `${baseUrl}/entity/${entityUuid}/badge-specs`;\n }\n\n private async getEntityBadgeSpecsUrl(entity: Entity): Promise<string> {\n const routeParams = this.getEntityRouteParams(entity);\n const path = generatePath(`:namespace/:kind/:name`, routeParams);\n const baseUrl = await this.discoveryApi.getBaseUrl('badges');\n return `${baseUrl}/entity/${path}/badge-specs`;\n }\n\n // This function is used to generate the route parameters using the entity kind, namespace and name\n private getEntityRouteParams(entity: Entity) {\n return {\n kind: entity.kind.toLocaleLowerCase('en-US'),\n namespace:\n entity.metadata.namespace?.toLocaleLowerCase('en-US') ??\n DEFAULT_NAMESPACE,\n name: entity.metadata.name,\n };\n }\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\nexport const badgesApiRef = createApiRef<BadgesApi>({\n id: 'plugin.badges.client',\n});\n\nexport type BadgeStyle =\n | 'plastic'\n | 'flat'\n | 'flat-square'\n | 'for-the-badge'\n | 'social';\n\ninterface Badge {\n color?: string;\n description?: string;\n kind?: 'entity';\n label: string;\n labelColor?: string;\n link?: string;\n message: string;\n style?: BadgeStyle;\n}\n\nexport interface BadgeSpec {\n /** Badge id */\n id: string;\n\n /** Badge data */\n badge: Badge;\n\n /** The URL to the badge image */\n url: string;\n\n /** The markdown code to use the badge */\n markdown: string;\n}\n\nexport interface BadgesApi {\n getEntityBadgeSpecs(entity: Entity): Promise<BadgeSpec[]>;\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { badgesApiRef, BadgesClient } from './api';\nimport {\n configApiRef,\n createApiFactory,\n createComponentExtension,\n createPlugin,\n fetchApiRef,\n discoveryApiRef,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const badgesPlugin = createPlugin({\n id: 'badges',\n apis: [\n createApiFactory({\n api: badgesApiRef,\n deps: {\n fetchApi: fetchApiRef,\n discoveryApi: discoveryApiRef,\n configApi: configApiRef,\n },\n factory: ({ fetchApi, discoveryApi, configApi }) =>\n new BadgesClient({\n fetchApi,\n discoveryApi,\n configApi,\n }),\n }),\n ],\n});\n\n/** @public */\nexport const EntityBadgesDialog = badgesPlugin.provide(\n createComponentExtension({\n name: 'EntityBadgesDialog',\n component: {\n lazy: () =>\n import('./components/EntityBadgesDialog').then(\n m => m.EntityBadgesDial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