@techdocs/cli 1.10.4 → 1.10.5-next.1
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 +21 -0
- package/bin/techdocs-cli +4 -2
- package/dist/commands/generate/generate.cjs.js +1 -1
- package/dist/commands/generate/generate.cjs.js.map +1 -1
- package/dist/commands/publish/publish.cjs.js +1 -1
- package/dist/commands/publish/publish.cjs.js.map +1 -1
- package/dist/commands/serve/serve.cjs.js +1 -1
- package/dist/commands/serve/serve.cjs.js.map +1 -1
- package/dist/embedded-app/.config-schema.json +191 -163
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/index.html.tmpl +1 -1
- package/dist/embedded-app/static/{1155.b5590627.chunk.js → 1155.7fdf8f74.chunk.js} +2 -2
- package/dist/embedded-app/static/{1155.b5590627.chunk.js.map → 1155.7fdf8f74.chunk.js.map} +1 -1
- package/dist/embedded-app/static/1335.20ce41a6.chunk.js +2 -0
- package/dist/embedded-app/static/1335.20ce41a6.chunk.js.map +1 -0
- package/dist/embedded-app/static/1749.675429c1.chunk.js +2 -0
- package/dist/embedded-app/static/1749.675429c1.chunk.js.map +1 -0
- package/dist/embedded-app/static/1994.2a1755bc.chunk.js +2 -0
- package/dist/embedded-app/static/1994.2a1755bc.chunk.js.map +1 -0
- package/dist/embedded-app/static/2295.4ced0142.chunk.js +5 -0
- package/dist/embedded-app/static/2295.4ced0142.chunk.js.map +1 -0
- package/dist/embedded-app/static/4645.cc59b13f.chunk.js +2 -0
- package/dist/embedded-app/static/{4645.2529d0aa.chunk.js.map → 4645.cc59b13f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/4648.b290d75e.chunk.js +2 -0
- package/dist/embedded-app/static/4648.b290d75e.chunk.js.map +1 -0
- package/dist/embedded-app/static/5495.2e93b457.chunk.js +2 -0
- package/dist/embedded-app/static/5495.2e93b457.chunk.js.map +1 -0
- package/dist/embedded-app/static/6138.48ea9ccb.chunk.js +2 -0
- package/dist/embedded-app/static/6138.48ea9ccb.chunk.js.map +1 -0
- package/dist/embedded-app/static/{6270.e3b38d1d.chunk.js → 6270.9a83c78f.chunk.js} +2 -2
- package/dist/embedded-app/static/{6270.e3b38d1d.chunk.js.map → 6270.9a83c78f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7186.06700aac.chunk.js +2 -0
- package/dist/embedded-app/static/7186.06700aac.chunk.js.map +1 -0
- package/dist/embedded-app/static/7203.3c95a690.chunk.js +2 -0
- package/dist/embedded-app/static/7203.3c95a690.chunk.js.map +1 -0
- package/dist/embedded-app/static/7382.2d83d2b3.chunk.js +2 -0
- package/dist/embedded-app/static/7382.2d83d2b3.chunk.js.map +1 -0
- package/dist/embedded-app/static/7526.074248a6.chunk.js +2 -0
- package/dist/embedded-app/static/7526.074248a6.chunk.js.map +1 -0
- package/dist/embedded-app/static/8125.71f8d063.chunk.js +7 -0
- package/dist/embedded-app/static/8125.71f8d063.chunk.js.map +1 -0
- package/dist/embedded-app/static/9050.f09397cc.chunk.js +2 -0
- package/dist/embedded-app/static/9050.f09397cc.chunk.js.map +1 -0
- package/dist/embedded-app/static/9230.fb6e1c4a.chunk.js +2 -0
- package/dist/embedded-app/static/9230.fb6e1c4a.chunk.js.map +1 -0
- package/dist/embedded-app/static/9579.060201ba.chunk.js +2 -0
- package/dist/embedded-app/static/9579.060201ba.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.b2329633.css +2 -0
- package/dist/embedded-app/static/main.b2329633.css.map +1 -0
- package/dist/embedded-app/static/main.c9d6fc0d.js +527 -0
- package/dist/embedded-app/static/main.c9d6fc0d.js.map +1 -0
- package/dist/embedded-app/static/{module-date-fns.fe699224.js → module-date-fns.bfd1b82f.js} +2 -2
- package/dist/embedded-app/static/{module-date-fns.fe699224.js.map → module-date-fns.bfd1b82f.js.map} +1 -1
- package/dist/embedded-app/static/module-i18next.c154323c.js +2 -0
- package/dist/embedded-app/static/{module-i18next.685d0b2d.js.map → module-i18next.c154323c.js.map} +1 -1
- package/dist/embedded-app/static/module-lodash.c50623b1.js +2 -0
- package/dist/embedded-app/static/module-lodash.c50623b1.js.map +1 -0
- package/dist/embedded-app/static/module-material-table.40a11f4e.js +2 -0
- package/dist/embedded-app/static/{module-material-table.5a3a2d93.js.map → module-material-table.40a11f4e.js.map} +1 -1
- package/dist/embedded-app/static/module-material-ui.3c48b777.js +2 -0
- package/dist/embedded-app/static/{module-material-ui.9517effb.js.map → module-material-ui.3c48b777.js.map} +1 -1
- package/dist/embedded-app/static/module-mui.c5efba64.js +2 -0
- package/dist/embedded-app/static/{module-mui.375d6d62.js.map → module-mui.c5efba64.js.map} +1 -1
- package/dist/embedded-app/static/{module-react-beautiful-dnd.29de0c3a.js → module-react-beautiful-dnd.6e061f96.js} +2 -2
- package/dist/embedded-app/static/{module-react-beautiful-dnd.29de0c3a.js.map → module-react-beautiful-dnd.6e061f96.js.map} +1 -1
- package/dist/embedded-app/static/module-react-dom.c631e87d.js +2 -0
- package/dist/embedded-app/static/{module-react-dom.44002a3f.js.map → module-react-dom.c631e87d.js.map} +1 -1
- package/dist/embedded-app/static/module-remix-run.d87774b0.js +2 -0
- package/dist/embedded-app/static/{module-remix-run.8b5ff4b7.js.map → module-remix-run.d87774b0.js.map} +1 -1
- package/dist/embedded-app/static/module-zod.c31bff05.js +2 -0
- package/dist/embedded-app/static/{module-zod.4600b494.js.map → module-zod.c31bff05.js.map} +1 -1
- package/dist/embedded-app/static/react-syntax-highlighter/lowlight-import.df3f7284.chunk.js +2 -0
- package/dist/embedded-app/static/react-syntax-highlighter/{lowlight-import.7b0d2cbc.chunk.js.map → lowlight-import.df3f7284.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.f12aa553.js → runtime.18d1df8a.js} +2 -2
- package/dist/embedded-app/static/{runtime.f12aa553.js.map → runtime.18d1df8a.js.map} +1 -1
- package/dist/embedded-app/static/vendor.e4357869.js +2 -0
- package/dist/embedded-app/static/{vendor.c30d98c8.js.map → vendor.e4357869.js.map} +1 -1
- package/dist/lib/httpServer.cjs.js +1 -1
- package/dist/lib/httpServer.cjs.js.map +1 -1
- package/dist/lib/livereload.cjs.js.map +1 -1
- package/dist/lib/utility.cjs.js +4 -4
- package/dist/lib/utility.cjs.js.map +1 -1
- package/dist/package.json.cjs.js +1 -1
- package/package.json +8 -8
- package/dist/embedded-app/static/1335.18ed80ea.chunk.js +0 -2
- package/dist/embedded-app/static/1335.18ed80ea.chunk.js.map +0 -1
- package/dist/embedded-app/static/1749.12caaf36.chunk.js +0 -2
- package/dist/embedded-app/static/1749.12caaf36.chunk.js.map +0 -1
- package/dist/embedded-app/static/1994.10e5e0a5.chunk.js +0 -2
- package/dist/embedded-app/static/1994.10e5e0a5.chunk.js.map +0 -1
- package/dist/embedded-app/static/2295.ba227b79.chunk.js +0 -5
- package/dist/embedded-app/static/2295.ba227b79.chunk.js.map +0 -1
- package/dist/embedded-app/static/3222.d20eecea.chunk.js +0 -2
- package/dist/embedded-app/static/3222.d20eecea.chunk.js.map +0 -1
- package/dist/embedded-app/static/4645.2529d0aa.chunk.js +0 -2
- package/dist/embedded-app/static/4648.df344fd4.chunk.js +0 -2
- package/dist/embedded-app/static/4648.df344fd4.chunk.js.map +0 -1
- package/dist/embedded-app/static/6138.9fb528c4.chunk.js +0 -2
- package/dist/embedded-app/static/6138.9fb528c4.chunk.js.map +0 -1
- package/dist/embedded-app/static/7186.0b7e4914.chunk.js +0 -2
- package/dist/embedded-app/static/7186.0b7e4914.chunk.js.map +0 -1
- package/dist/embedded-app/static/7203.c157eeae.chunk.js +0 -2
- package/dist/embedded-app/static/7203.c157eeae.chunk.js.map +0 -1
- package/dist/embedded-app/static/7382.75824f8e.chunk.js +0 -2
- package/dist/embedded-app/static/7382.75824f8e.chunk.js.map +0 -1
- package/dist/embedded-app/static/7526.dd1429dd.chunk.js +0 -2
- package/dist/embedded-app/static/7526.dd1429dd.chunk.js.map +0 -1
- package/dist/embedded-app/static/8125.b12aec21.chunk.js +0 -7
- package/dist/embedded-app/static/8125.b12aec21.chunk.js.map +0 -1
- package/dist/embedded-app/static/9050.21dcd5d1.chunk.js +0 -2
- package/dist/embedded-app/static/9050.21dcd5d1.chunk.js.map +0 -1
- package/dist/embedded-app/static/9230.885db42d.chunk.js +0 -2
- package/dist/embedded-app/static/9230.885db42d.chunk.js.map +0 -1
- package/dist/embedded-app/static/9579.84d1dba2.chunk.js +0 -2
- package/dist/embedded-app/static/9579.84d1dba2.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.0c6dd09c.css +0 -2
- package/dist/embedded-app/static/main.0c6dd09c.css.map +0 -1
- package/dist/embedded-app/static/main.bd200dfa.js +0 -550
- package/dist/embedded-app/static/main.bd200dfa.js.map +0 -1
- package/dist/embedded-app/static/module-i18next.685d0b2d.js +0 -2
- package/dist/embedded-app/static/module-lodash.7d4f904e.js +0 -2
- package/dist/embedded-app/static/module-lodash.7d4f904e.js.map +0 -1
- package/dist/embedded-app/static/module-material-table.5a3a2d93.js +0 -2
- package/dist/embedded-app/static/module-material-ui.9517effb.js +0 -2
- package/dist/embedded-app/static/module-mui.375d6d62.js +0 -2
- package/dist/embedded-app/static/module-react-dom.44002a3f.js +0 -2
- package/dist/embedded-app/static/module-remix-run.8b5ff4b7.js +0 -2
- package/dist/embedded-app/static/module-zod.4600b494.js +0 -2
- package/dist/embedded-app/static/react-syntax-highlighter/lowlight-import.7b0d2cbc.chunk.js +0 -2
- package/dist/embedded-app/static/vendor.c30d98c8.js +0 -2
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var serveHandler = require('serve-handler');
|
|
6
|
-
var http = require('http');
|
|
6
|
+
var http = require('node:http');
|
|
7
7
|
var httpProxy = require('http-proxy');
|
|
8
8
|
var utility = require('./utility.cjs.js');
|
|
9
9
|
var livereload = require('./livereload.cjs.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpServer.cjs.js","sources":["../../src/lib/httpServer.ts"],"sourcesContent":["/*\n * Copyright 2020 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 serveHandler from 'serve-handler';\nimport http from 'http';\nimport httpProxy from 'http-proxy';\nimport { createLogger } from './utility';\nimport {\n proxyHtmlWithLivereloadInjection,\n proxyMkdocsLivereload,\n} from './livereload';\n\nexport default class HTTPServer {\n private readonly proxyEndpoint: string;\n private readonly backstageBundleDir: string;\n private readonly backstagePort: number;\n private readonly mkdocsTargetAddress: string;\n private readonly verbose: boolean;\n\n constructor(\n backstageBundleDir: string,\n backstagePort: number,\n mkdocsTargetAddress: string,\n verbose: boolean,\n ) {\n this.proxyEndpoint = '/api/techdocs/';\n this.backstageBundleDir = backstageBundleDir;\n this.backstagePort = backstagePort;\n this.mkdocsTargetAddress = mkdocsTargetAddress;\n this.verbose = verbose;\n }\n\n // Create a Proxy for mkdocs server\n private createProxy() {\n const proxy = httpProxy.createProxyServer({\n target: this.mkdocsTargetAddress,\n });\n\n return (request: http.IncomingMessage): [httpProxy, string] => {\n // If the request path is prefixed with this.proxyEndpoint, remove it.\n const proxyEndpointPath = new RegExp(`^${this.proxyEndpoint}`, 'i');\n const forwardPath = request.url?.replace(proxyEndpointPath, '') || '';\n\n return [proxy, forwardPath];\n };\n }\n\n public async serve(): Promise<http.Server> {\n return new Promise<http.Server>((resolve, reject) => {\n const proxyHandler = this.createProxy();\n const server = http.createServer(\n (request: http.IncomingMessage, response: http.ServerResponse) => {\n // This endpoint is used by the frontend to issue a cookie for the user.\n // But the MkDocs server doesn't expose it as a the Backstage backend does.\n // So we need to fake it here to prevent 404 errors.\n if (request.url === '/api/techdocs/.backstage/auth/v1/cookie') {\n const oneHourInMilliseconds = 60 * 60 * 1000;\n const expiresAt = new Date(Date.now() + oneHourInMilliseconds);\n const cookie = { expiresAt: expiresAt.toISOString() };\n response.setHeader('Content-Type', 'application/json');\n response.end(JSON.stringify(cookie));\n return;\n }\n\n if (request.url?.startsWith(this.proxyEndpoint)) {\n // Handle HTML files with livereload parameter injection\n if (request.url?.endsWith('.html')) {\n proxyHtmlWithLivereloadInjection({\n request,\n response,\n mkdocsTargetAddress: this.mkdocsTargetAddress,\n proxyEndpoint: this.proxyEndpoint,\n onError: (error: Error) => reject(error),\n });\n return;\n }\n\n // Handle non-HTML files with regular proxy\n const [proxy, forwardPath] = proxyHandler(request);\n\n proxy.on('error', (error: Error) => {\n reject(error);\n });\n\n response.setHeader('Access-Control-Allow-Origin', '*');\n response.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');\n\n request.url = forwardPath;\n proxy.web(request, response);\n return;\n }\n\n // This endpoint is used by the frontend to detect where the backend is running.\n if (request.url === '/.detect') {\n response.setHeader('Content-Type', 'text/plain');\n response.end('techdocs-cli-server');\n return;\n }\n\n // This endpoint is used by the frontend to pass livereload requests to the mkdocs server.\n if (request.url?.startsWith('/.livereload')) {\n proxyMkdocsLivereload({\n request,\n response,\n mkdocsTargetAddress: this.mkdocsTargetAddress,\n onError: (error: Error) => reject(error),\n });\n return;\n }\n\n serveHandler(request, response, {\n public: this.backstageBundleDir,\n trailingSlash: true,\n rewrites: [{ source: '**', destination: 'index.html' }],\n });\n },\n );\n\n const logger = createLogger({ verbose: false });\n server.listen(this.backstagePort, () => {\n if (this.verbose) {\n logger.info(\n `[techdocs-preview-bundle] Running local version of Backstage at http://localhost:${this.backstagePort}`,\n );\n }\n resolve(server);\n });\n\n server.on('error', (error: Error) => {\n reject(error);\n });\n });\n }\n}\n"],"names":["httpProxy","http","proxyHtmlWithLivereloadInjection","proxyMkdocsLivereload","serveHandler","createLogger"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gB,YAAY,CAAA;AAC/C,YAAA,QAAA,CAAS,IAAI,qBAAqB,CAAA;AAClC,YAAA;AAAA,UACF;AAGA,UAAA,IAAI,OAAA,CAAQ,GAAA,EAAK,UAAA,CAAW,cAAc,CAAA,EAAG;AAC3C,YAAAC,gCAAA,CAAsB;AAAA,cACpB,OAAA;AAAA,cACA,QAAA;AAAA,cACA,qBAAqB,IAAA,CAAK,mBAAA;AAAA,cAC1B,OAAA,EAAS,CAAC,KAAA,KAAiB,MAAA,CAAO,KAAK;AAAA,aACxC,CAAA;AACD,YAAA;AAAA,UACF;AAEA,UAAAC,6BAAA,CAAa,SAAS,QAAA,EAAU;AAAA,YAC9B,QAAQ,IAAA,CAAK,kBAAA;AAAA,YACb,aAAA,EAAe,IAAA;AAAA,YACf,UAAU,CAAC,EAAE,QAAQ,IAAA,EAAM,WAAA,EAAa,cAAc;AAAA,WACvD,CAAA;AAAA,QACH;AAAA,OACF;AAEA,MAAA,MAAM,MAAA,GAASC,oBAAA,CAAa,EAAE,OAAA,EAAS,OAAO,CAAA;AAC9C,MAAA,MAAA,CAAO,MAAA,CAAO,IAAA,CAAK,aAAA,EAAe,MAAM;AACtC,QAAA,IAAI,KAAK,OAAA,EAAS;AAChB,UAAA,MAAA,CAAO,IAAA;AAAA,YACL,CAAA,iFAAA,EAAoF,KAAK,aAAa,CAAA;AAAA,WACxG;AAAA,QACF;AACA,QAAA,OAAA,CAAQ,MAAM,CAAA;AAAA,MAChB,CAAC,CAAA;AAED,MAAA,MAAA,CAAO,EAAA,CAAG,OAAA,EAAS,CAAC,KAAA,KAAiB;AACnC,QAAA,MAAA,CAAO,KAAK,CAAA;AAAA,MACd,CAAC,CAAA;AAAA,IACH,CAAC,CAAA;AAAA,EACH;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"httpServer.cjs.js","sources":["../../src/lib/httpServer.ts"],"sourcesContent":["/*\n * Copyright 2020 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 serveHandler from 'serve-handler';\nimport http from 'node:http';\nimport httpProxy from 'http-proxy';\nimport { createLogger } from './utility';\nimport {\n proxyHtmlWithLivereloadInjection,\n proxyMkdocsLivereload,\n} from './livereload';\n\nexport default class HTTPServer {\n private readonly proxyEndpoint: string;\n private readonly backstageBundleDir: string;\n private readonly backstagePort: number;\n private readonly mkdocsTargetAddress: string;\n private readonly verbose: boolean;\n\n constructor(\n backstageBundleDir: string,\n backstagePort: number,\n mkdocsTargetAddress: string,\n verbose: boolean,\n ) {\n this.proxyEndpoint = '/api/techdocs/';\n this.backstageBundleDir = backstageBundleDir;\n this.backstagePort = backstagePort;\n this.mkdocsTargetAddress = mkdocsTargetAddress;\n this.verbose = verbose;\n }\n\n // Create a Proxy for mkdocs server\n private createProxy() {\n const proxy = httpProxy.createProxyServer({\n target: this.mkdocsTargetAddress,\n });\n\n return (request: http.IncomingMessage): [httpProxy, string] => {\n // If the request path is prefixed with this.proxyEndpoint, remove it.\n const proxyEndpointPath = new RegExp(`^${this.proxyEndpoint}`, 'i');\n const forwardPath = request.url?.replace(proxyEndpointPath, '') || '';\n\n return [proxy, forwardPath];\n };\n }\n\n public async serve(): Promise<http.Server> {\n return new Promise<http.Server>((resolve, reject) => {\n const proxyHandler = this.createProxy();\n const server = http.createServer(\n (request: http.IncomingMessage, response: http.ServerResponse) => {\n // This endpoint is used by the frontend to issue a cookie for the user.\n // But the MkDocs server doesn't expose it as a the Backstage backend does.\n // So we need to fake it here to prevent 404 errors.\n if (request.url === '/api/techdocs/.backstage/auth/v1/cookie') {\n const oneHourInMilliseconds = 60 * 60 * 1000;\n const expiresAt = new Date(Date.now() + oneHourInMilliseconds);\n const cookie = { expiresAt: expiresAt.toISOString() };\n response.setHeader('Content-Type', 'application/json');\n response.end(JSON.stringify(cookie));\n return;\n }\n\n if (request.url?.startsWith(this.proxyEndpoint)) {\n // Handle HTML files with livereload parameter injection\n if (request.url?.endsWith('.html')) {\n proxyHtmlWithLivereloadInjection({\n request,\n response,\n mkdocsTargetAddress: this.mkdocsTargetAddress,\n proxyEndpoint: this.proxyEndpoint,\n onError: (error: Error) => reject(error),\n });\n return;\n }\n\n // Handle non-HTML files with regular proxy\n const [proxy, forwardPath] = proxyHandler(request);\n\n proxy.on('error', (error: Error) => {\n reject(error);\n });\n\n response.setHeader('Access-Control-Allow-Origin', '*');\n response.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');\n\n request.url = forwardPath;\n proxy.web(request, response);\n return;\n }\n\n // This endpoint is used by the frontend to detect where the backend is running.\n if (request.url === '/.detect') {\n response.setHeader('Content-Type', 'text/plain');\n response.end('techdocs-cli-server');\n return;\n }\n\n // This endpoint is used by the frontend to pass livereload requests to the mkdocs server.\n if (request.url?.startsWith('/.livereload')) {\n proxyMkdocsLivereload({\n request,\n response,\n mkdocsTargetAddress: this.mkdocsTargetAddress,\n onError: (error: Error) => reject(error),\n });\n return;\n }\n\n serveHandler(request, response, {\n public: this.backstageBundleDir,\n trailingSlash: true,\n rewrites: [{ source: '**', destination: 'index.html' }],\n });\n },\n );\n\n const logger = createLogger({ verbose: false });\n server.listen(this.backstagePort, () => {\n if (this.verbose) {\n logger.info(\n `[techdocs-preview-bundle] Running local version of Backstage at http://localhost:${this.backstagePort}`,\n );\n }\n resolve(server);\n });\n\n server.on('error', (error: Error) => {\n reject(error);\n });\n });\n }\n}\n"],"names":["httpProxy","http","proxyHtmlWithLivereloadInjection","proxyMkdocsLivereload","serveHandler","createLogger"],"mappings":";;;;;;;;;;;;;;;;AAyBA,MAAqB,UAAA,CAAW;AAAA,EACb,aAAA;AAAA,EACA,kBAAA;AAAA,EACA,aAA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OAAA,CAAQ,GAAA,EAAK,UAAA,CAAW,cAAc,CAAA,EAAG;AAC3C,YAAAC,gCAAA,CAAsB;AAAA,cACpB,OAAA;AAAA,cACA,QAAA;AAAA,cACA,qBAAqB,IAAA,CAAK,mBAAA;AAAA,cAC1B,OAAA,EAAS,CAAC,KAAA,KAAiB,MAAA,CAAO,KAAK;AAAA,aACxC,CAAA;AACD,YAAA;AAAA,UACF;AAEA,UAAAC,6BAAA,CAAa,SAAS,QAAA,EAAU;AAAA,YAC9B,QAAQ,IAAA,CAAK,kBAAA;AAAA,YACb,aAAA,EAAe,IAAA;AAAA,YACf,UAAU,CAAC,EAAE,QAAQ,IAAA,EAAM,WAAA,EAAa,cAAc;AAAA,WACvD,CAAA;AAAA,QACH;AAAA,OACF;AAEA,MAAA,MAAM,MAAA,GAASC,oBAAA,CAAa,EAAE,OAAA,EAAS,OAAO,CAAA;AAC9C,MAAA,MAAA,CAAO,MAAA,CAAO,IAAA,CAAK,aAAA,EAAe,MAAM;AACtC,QAAA,IAAI,KAAK,OAAA,EAAS;AAChB,UAAA,MAAA,CAAO,IAAA;AAAA,YACL,CAAA,iFAAA,EAAoF,KAAK,aAAa,CAAA;AAAA,WACxG;AAAA,QACF;AACA,QAAA,OAAA,CAAQ,MAAM,CAAA;AAAA,MAChB,CAAC,CAAA;AAED,MAAA,MAAA,CAAO,EAAA,CAAG,OAAA,EAAS,CAAC,KAAA,KAAiB;AACnC,QAAA,MAAA,CAAO,KAAK,CAAA;AAAA,MACd,CAAC,CAAA;AAAA,IACH,CAAC,CAAA;AAAA,EACH;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"livereload.cjs.js","sources":["../../src/lib/livereload.ts"],"sourcesContent":["/*\n * Copyright 2025 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 http from 'http';\nimport httpProxy from 'http-proxy';\n\n/**\n * Livereload support for techdocs-cli.\n *\n * Context:\n * - MkDocs implements autoreload using a long-poll endpoint `/livereload` and a script that injects\n * a call like: `livereload(epoch, request_id)`, where `epoch` is derived from Python's\n * `time.monotonic()`.\n * - Node.js monotonic clocks (`process.hrtime`/`performance.now`) are not compatible with Python's\n * value across processes and platforms. We therefore CANNOT reliably re-create the same epoch on\n * the frontend or in this CLI, and must read the values produced by MkDocs itself.\n * - The MkDocs script tag is removed by DOM sanitization (DomPurify) in TechDocs, so we can't rely\n * on the script being present in the embedded app. To bridge this, we extract the parameters on\n * the server side while proxying HTML and inject them as a safe custom element that survives\n * sanitization: `<live-reload live-reload-epoch=\"…\" live-reload-request-id=\"…\"/>`.\n * - The frontend addon reads that element and polls `/.livereload` (served by techdocs-cli), which\n * this module maps to MkDocs `/livereload` with permissive CORS headers.\n * - Quality-of-life: if extraction fails or the endpoint is unavailable, normal docs still work.\n *\n * See issue for background and rationale: https://github.com/backstage/backstage/issues/30514\n */\n\nconst LIVE_RELOAD_ELEMENT = 'live-reload';\nconst LIVE_RELOAD_ATTR_EPOCH = 'live-reload-epoch';\nconst LIVE_RELOAD_ATTR_REQUEST_ID = 'live-reload-request-id';\nconst CLI_LIVERELOAD_PATH = '/.livereload';\nconst MKDOCS_LIVERELOAD_PATH = '/livereload';\nconst CONTENT_TYPE_HTML = 'text/html';\nconst HEADER_CONTENT_LENGTH = 'content-length';\n\nconst BODY_START_RE = /<body\\b[^>]*>/;\n// Matches mkdocs injected call livereload(epoch, requestId)\nconst MKDOCS_LIVERELOAD_CALL_RE = /livereload\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\s*;?/;\n\n/**\n * Extract livereload parameters from mkdocs HTML and inject them as a custom element.\n * The injected element will later be read by the frontend addon even after DOM sanitization.\n *\n * Note:\n * - we don't add to <head> because of DomPurify sanitization.\n * - we add close to the body opening to avoid reading too far into the body.\n * - we should use streamed injection to improve performance.\n */\nexport function injectLivereloadParameters(html: string): string {\n const livereloadMatch = html.match(MKDOCS_LIVERELOAD_CALL_RE);\n\n // If we couldn't find livereload parameters, return original HTML untouched.\n if (!livereloadMatch) {\n return html;\n }\n\n const [, epoch, requestId] = livereloadMatch;\n // Insert a minimal custom element that the frontend addon can discover post-sanitization.\n // Note: embedded app needs a custom config to allow the element to survive sanitization.\n const liveReloadTag = `<${LIVE_RELOAD_ELEMENT} ${LIVE_RELOAD_ATTR_EPOCH}=\"${epoch}\" ${LIVE_RELOAD_ATTR_REQUEST_ID}=\"${requestId}\"></${LIVE_RELOAD_ELEMENT}>`;\n\n // Naively find where to insert the livereload tag.\n const bodyStart = html.match(BODY_START_RE);\n const bodyStartIndex = bodyStart?.index ?? 0;\n const bodyStartLength = bodyStart?.[0]?.length ?? 0;\n if (bodyStartIndex === 0 || bodyStartLength === 0) {\n return html;\n }\n const bodyEndIndex = bodyStartIndex + bodyStartLength;\n\n return html.slice(0, bodyEndIndex) + liveReloadTag + html.slice(bodyEndIndex);\n}\n\nfunction setCorsHeaders(response: http.ServerResponse) {\n response.setHeader('Access-Control-Allow-Origin', '*');\n response.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');\n}\n\n/**\n * Proxies a mkdocs HTML response, injecting livereload parameters into the HTML body.\n */\nexport function proxyHtmlWithLivereloadInjection(options: {\n request: http.IncomingMessage;\n response: http.ServerResponse;\n mkdocsTargetAddress: string;\n proxyEndpoint: string;\n onError: (error: Error) => void;\n}): void {\n const { request, response, mkdocsTargetAddress, proxyEndpoint, onError } =\n options;\n\n const htmlProxy = httpProxy.createProxyServer({\n target: mkdocsTargetAddress,\n selfHandleResponse: true,\n });\n\n htmlProxy.on('error', onError);\n\n // Intercept HTML responses to inject `<live-reload …>`\n htmlProxy.on('proxyRes', (proxyRes, _req, res) => {\n const contentType = proxyRes.headers['content-type'];\n const contentEncoding = proxyRes.headers['content-encoding'];\n const isHtml =\n contentType &&\n typeof contentType === 'string' &&\n contentType.startsWith(CONTENT_TYPE_HTML);\n if (isHtml && !contentEncoding) {\n const chunks: Buffer[] = [];\n proxyRes.on('data', (chunk: Buffer | string) => {\n chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));\n });\n proxyRes.on('end', () => {\n const body = Buffer.concat(chunks).toString('utf8');\n const modifiedHtml = injectLivereloadParameters(body);\n res.statusCode = (proxyRes.statusCode as number | undefined) ?? 200;\n Object.keys(proxyRes.headers).forEach(key => {\n if (key.toLowerCase() !== HEADER_CONTENT_LENGTH) {\n res.setHeader(key, proxyRes.headers[key]!);\n }\n });\n setCorsHeaders(res);\n res.end(modifiedHtml);\n });\n } else {\n res.statusCode = (proxyRes.statusCode as number | undefined) ?? 200;\n Object.keys(proxyRes.headers).forEach(key => {\n res.setHeader(key, proxyRes.headers[key]!);\n });\n setCorsHeaders(res);\n proxyRes.pipe(res);\n }\n });\n\n const forwardPath =\n request.url?.replace(new RegExp(`^${proxyEndpoint}`, 'i'), '') || '';\n request.url = forwardPath;\n htmlProxy.web(request, response);\n}\n\n/**\n * Proxies mkdocs livereload long-polling requests, mapping the CLI path to mkdocs path.\n */\nexport function proxyMkdocsLivereload(options: {\n request: http.IncomingMessage;\n response: http.ServerResponse;\n mkdocsTargetAddress: string;\n onError: (error: Error) => void;\n}): void {\n const { request, response, mkdocsTargetAddress, onError } = options;\n\n const proxy = httpProxy.createProxyServer({ target: mkdocsTargetAddress });\n proxy.on('error', onError);\n\n setCorsHeaders(response);\n response.setHeader('Access-Control-Allow-Headers', 'Content-Type');\n\n request.url = request.url?.replace(\n CLI_LIVERELOAD_PATH,\n MKDOCS_LIVERELOAD_PATH,\n );\n proxy.web(request, response);\n}\n"],"names":["httpProxy"],"mappings":";;;;;;;;AAwCA,MAAM,mBAAA,GAAs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AA,MAAM,QAAQA,0BAAA,CAAU,iBAAA,CAAkB,EAAE,MAAA,EAAQ,qBAAqB,CAAA;AACzE,EAAA,KAAA,CAAM,EAAA,CAAG,SAAS,OAAO,CAAA;AAEzB,EAAA,cAAA,CAAe,QAAQ,CAAA;AACvB,EAAA,QAAA,CAAS,SAAA,CAAU,gCAAgC,cAAc,CAAA;AAEjE,EAAA,OAAA,CAAQ,GAAA,GAAM,QAAQ,GAAA,EAAK,OAAA;AAAA,IACzB,mBAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,KAAA,CAAM,GAAA,CAAI,SAAS,QAAQ,CAAA;AAC7B;;;;;;"}
|
|
1
|
+
{"version":3,"file":"livereload.cjs.js","sources":["../../src/lib/livereload.ts"],"sourcesContent":["/*\n * Copyright 2025 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 http from 'node:http';\nimport httpProxy from 'http-proxy';\n\n/**\n * Livereload support for techdocs-cli.\n *\n * Context:\n * - MkDocs implements autoreload using a long-poll endpoint `/livereload` and a script that injects\n * a call like: `livereload(epoch, request_id)`, where `epoch` is derived from Python's\n * `time.monotonic()`.\n * - Node.js monotonic clocks (`process.hrtime`/`performance.now`) are not compatible with Python's\n * value across processes and platforms. We therefore CANNOT reliably re-create the same epoch on\n * the frontend or in this CLI, and must read the values produced by MkDocs itself.\n * - The MkDocs script tag is removed by DOM sanitization (DomPurify) in TechDocs, so we can't rely\n * on the script being present in the embedded app. To bridge this, we extract the parameters on\n * the server side while proxying HTML and inject them as a safe custom element that survives\n * sanitization: `<live-reload live-reload-epoch=\"…\" live-reload-request-id=\"…\"/>`.\n * - The frontend addon reads that element and polls `/.livereload` (served by techdocs-cli), which\n * this module maps to MkDocs `/livereload` with permissive CORS headers.\n * - Quality-of-life: if extraction fails or the endpoint is unavailable, normal docs still work.\n *\n * See issue for background and rationale: https://github.com/backstage/backstage/issues/30514\n */\n\nconst LIVE_RELOAD_ELEMENT = 'live-reload';\nconst LIVE_RELOAD_ATTR_EPOCH = 'live-reload-epoch';\nconst LIVE_RELOAD_ATTR_REQUEST_ID = 'live-reload-request-id';\nconst CLI_LIVERELOAD_PATH = '/.livereload';\nconst MKDOCS_LIVERELOAD_PATH = '/livereload';\nconst CONTENT_TYPE_HTML = 'text/html';\nconst HEADER_CONTENT_LENGTH = 'content-length';\n\nconst BODY_START_RE = /<body\\b[^>]*>/;\n// Matches mkdocs injected call livereload(epoch, requestId)\nconst MKDOCS_LIVERELOAD_CALL_RE = /livereload\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\s*;?/;\n\n/**\n * Extract livereload parameters from mkdocs HTML and inject them as a custom element.\n * The injected element will later be read by the frontend addon even after DOM sanitization.\n *\n * Note:\n * - we don't add to <head> because of DomPurify sanitization.\n * - we add close to the body opening to avoid reading too far into the body.\n * - we should use streamed injection to improve performance.\n */\nexport function injectLivereloadParameters(html: string): string {\n const livereloadMatch = html.match(MKDOCS_LIVERELOAD_CALL_RE);\n\n // If we couldn't find livereload parameters, return original HTML untouched.\n if (!livereloadMatch) {\n return html;\n }\n\n const [, epoch, requestId] = livereloadMatch;\n // Insert a minimal custom element that the frontend addon can discover post-sanitization.\n // Note: embedded app needs a custom config to allow the element to survive sanitization.\n const liveReloadTag = `<${LIVE_RELOAD_ELEMENT} ${LIVE_RELOAD_ATTR_EPOCH}=\"${epoch}\" ${LIVE_RELOAD_ATTR_REQUEST_ID}=\"${requestId}\"></${LIVE_RELOAD_ELEMENT}>`;\n\n // Naively find where to insert the livereload tag.\n const bodyStart = html.match(BODY_START_RE);\n const bodyStartIndex = bodyStart?.index ?? 0;\n const bodyStartLength = bodyStart?.[0]?.length ?? 0;\n if (bodyStartIndex === 0 || bodyStartLength === 0) {\n return html;\n }\n const bodyEndIndex = bodyStartIndex + bodyStartLength;\n\n return html.slice(0, bodyEndIndex) + liveReloadTag + html.slice(bodyEndIndex);\n}\n\nfunction setCorsHeaders(response: http.ServerResponse) {\n response.setHeader('Access-Control-Allow-Origin', '*');\n response.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');\n}\n\n/**\n * Proxies a mkdocs HTML response, injecting livereload parameters into the HTML body.\n */\nexport function proxyHtmlWithLivereloadInjection(options: {\n request: http.IncomingMessage;\n response: http.ServerResponse;\n mkdocsTargetAddress: string;\n proxyEndpoint: string;\n onError: (error: Error) => void;\n}): void {\n const { request, response, mkdocsTargetAddress, proxyEndpoint, onError } =\n options;\n\n const htmlProxy = httpProxy.createProxyServer({\n target: mkdocsTargetAddress,\n selfHandleResponse: true,\n });\n\n htmlProxy.on('error', onError);\n\n // Intercept HTML responses to inject `<live-reload …>`\n htmlProxy.on('proxyRes', (proxyRes, _req, res) => {\n const contentType = proxyRes.headers['content-type'];\n const contentEncoding = proxyRes.headers['content-encoding'];\n const isHtml =\n contentType &&\n typeof contentType === 'string' &&\n contentType.startsWith(CONTENT_TYPE_HTML);\n if (isHtml && !contentEncoding) {\n const chunks: Buffer[] = [];\n proxyRes.on('data', (chunk: Buffer | string) => {\n chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));\n });\n proxyRes.on('end', () => {\n const body = Buffer.concat(chunks).toString('utf8');\n const modifiedHtml = injectLivereloadParameters(body);\n res.statusCode = (proxyRes.statusCode as number | undefined) ?? 200;\n Object.keys(proxyRes.headers).forEach(key => {\n if (key.toLowerCase() !== HEADER_CONTENT_LENGTH) {\n res.setHeader(key, proxyRes.headers[key]!);\n }\n });\n setCorsHeaders(res);\n res.end(modifiedHtml);\n });\n } else {\n res.statusCode = (proxyRes.statusCode as number | undefined) ?? 200;\n Object.keys(proxyRes.headers).forEach(key => {\n res.setHeader(key, proxyRes.headers[key]!);\n });\n setCorsHeaders(res);\n proxyRes.pipe(res);\n }\n });\n\n const forwardPath =\n request.url?.replace(new RegExp(`^${proxyEndpoint}`, 'i'), '') || '';\n request.url = forwardPath;\n htmlProxy.web(request, response);\n}\n\n/**\n * Proxies mkdocs livereload long-polling requests, mapping the CLI path to mkdocs path.\n */\nexport function proxyMkdocsLivereload(options: {\n request: http.IncomingMessage;\n response: http.ServerResponse;\n mkdocsTargetAddress: string;\n onError: (error: Error) => void;\n}): void {\n const { request, response, mkdocsTargetAddress, onError } = options;\n\n const proxy = httpProxy.createProxyServer({ target: mkdocsTargetAddress });\n proxy.on('error', onError);\n\n setCorsHeaders(response);\n response.setHeader('Access-Control-Allow-Headers', 'Content-Type');\n\n request.url = request.url?.replace(\n CLI_LIVERELOAD_PATH,\n MKDOCS_LIVERELOAD_PATH,\n );\n proxy.web(request, response);\n}\n"],"names":["httpProxy"],"mappings":";;;;;;;;AAwCA,MAAM,mBAAA,GAAsB,aAAA;AAC5B,MAAM,sBAAA,GAAyB,mBAAA;AAC/B,MAAM,2BAAA,GAA8B,wBAAA;AACpC,MAAM,mBAAA,GAAsB,cAAA;AAC5B,MAAM,sBAAA,GAAyB,aAAA;AAC/B,MAAM,iBAAA,GAAoB,WAAA;AAC1B,MAAM,qBAAA,GAAwB,gBAAA;AAE9B,MAAM,aAAA,GAAgB,eAAA;AAEtB,MAAM,yBAAA,GAA4B,4CAAA;AAW3B,SAAS,2BAA2B,IAAA,EAAsB;AAC/D,EAAA,MAAM,eAAA,GAAkB,IAAA,CAAK,KAAA,CAAM,yBAAyB,CAAA;AAG5D,EAAA,IAAI,CAAC,eAAA,EAAiB;AACpB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,GAAG,KAAA,EAAO,SAAS,CAAA,GAAI,eAAA;AAG7B,EAAA,MAAM,aAAA,GAAgB,CAAA,CAAA,EAAI,mBAAmB,CAAA,CAAA,EAAI,sBAAsB,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AAC3C,QAAA,GAAA,CAAI,SAAA,CAAU,GAAA,EAAK,QAAA,CAAS,OAAA,CAAQ,GAAG,CAAE,CAAA;AAAA,MAC3C,CAAC,CAAA;AACD,MAAA,cAAA,CAAe,GAAG,CAAA;AAClB,MAAA,QAAA,CAAS,KAAK,GAAG,CAAA;AAAA,IACnB;AAAA,EACF,CAAC,CAAA;AAED,EAAA,MAAM,WAAA,GACJ,OAAA,CAAQ,GAAA,EAAK,OAAA,CAAQ,IAAI,MAAA,CAAO,CAAA,CAAA,EAAI,aAAa,CAAA,CAAA,EAAI,GAAG,CAAA,EAAG,EAAE,CAAA,IAAK,EAAA;AACpE,EAAA,OAAA,CAAQ,GAAA,GAAM,WAAA;AACd,EAAA,SAAA,CAAU,GAAA,CAAI,SAAS,QAAQ,CAAA;AACjC;AAKO,SAAS,sBAAsB,OAAA,EAK7B;AACP,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,mBAAA,EAAqB,SAAQ,GAAI,OAAA;AAE5D,EAAA,MAAM,QAAQA,0BAAA,CAAU,iBAAA,CAAkB,EAAE,MAAA,EAAQ,qBAAqB,CAAA;AACzE,EAAA,KAAA,CAAM,EAAA,CAAG,SAAS,OAAO,CAAA;AAEzB,EAAA,cAAA,CAAe,QAAQ,CAAA;AACvB,EAAA,QAAA,CAAS,SAAA,CAAU,gCAAgC,cAAc,CAAA;AAEjE,EAAA,OAAA,CAAQ,GAAA,GAAM,QAAQ,GAAA,EAAK,OAAA;AAAA,IACzB,mBAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,KAAA,CAAM,GAAA,CAAI,SAAS,QAAQ,CAAA;AAC7B;;;;;;"}
|
package/dist/lib/utility.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var winston = require('winston');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var node_stream = require('node:stream');
|
|
5
|
+
var node_process = require('node:process');
|
|
6
6
|
|
|
7
7
|
function _interopNamespaceCompat(e) {
|
|
8
8
|
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
@@ -46,9 +46,9 @@ const createLogger = ({
|
|
|
46
46
|
};
|
|
47
47
|
const getLogStream = (logger) => {
|
|
48
48
|
if (process.env.LOG_LEVEL === "debug") {
|
|
49
|
-
return
|
|
49
|
+
return node_process.stdout;
|
|
50
50
|
}
|
|
51
|
-
return new
|
|
51
|
+
return new node_stream.Writable({
|
|
52
52
|
defaultEncoding: "utf8",
|
|
53
53
|
write(chunk, _encoding, next) {
|
|
54
54
|
logger.verbose(chunk.toString().trim());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.cjs.js","sources":["../../src/lib/utility.ts"],"sourcesContent":["/*\n * Copyright 2020 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 {\n RemoteProtocol,\n ParsedLocationAnnotation,\n} from '@backstage/plugin-techdocs-node';\nimport * as winston from 'winston';\nimport { Writable } from 'stream';\nimport { stdout } from 'process';\n\nexport const convertTechDocsRefToLocationAnnotation = (\n techdocsRef: string,\n): ParsedLocationAnnotation => {\n // Split on the first colon for the protocol and the rest after the first split\n // is the location.\n const [type, target] = techdocsRef.split(/:(.+)/) as [\n RemoteProtocol?,\n string?,\n ];\n\n if (!type || !target) {\n throw new Error(\n `Can not parse --techdocs-ref ${techdocsRef}. Should be of type HOST:URL.`,\n );\n }\n\n return { type, target };\n};\n\nexport const createLogger = ({\n verbose = false,\n}: {\n verbose: boolean;\n}): winston.Logger => {\n const logger = winston.createLogger({\n level: verbose ? 'verbose' : 'info',\n transports: [\n new winston.transports.Console({ format: winston.format.simple() }),\n ],\n });\n\n return logger;\n};\n\nexport const getLogStream = (logger: winston.Logger): Writable => {\n if (process.env.LOG_LEVEL === 'debug') {\n return stdout;\n }\n\n return new Writable({\n defaultEncoding: 'utf8',\n write(chunk, _encoding, next) {\n logger.verbose(chunk.toString().trim());\n next();\n },\n });\n};\n"],"names":["winston","stdout","Writable"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,sCAAA,GAAyC,CACpD,WAAA,KAC6B;AAG7B,EAAA,MAAM,CAAC,IAAA,EAAM,MAAM,CAAA,GAAI,WAAA,CAAY,MAAM,OAAO,CAAA;AAKhD,EAAA,IAAI,CAAC,IAAA,IAAQ,CAAC,MAAA,EAAQ;AACpB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,gCAAgC,WAAW,CAAA,6BAAA;AAAA,KAC7C;AAAA,EACF;AAEA,EAAA,OAAO,EAAE,MAAM,MAAA,EAAO;AACxB;AAEO,MAAM,eAAe,CAAC;AAAA,EAC3B,OAAA,GAAU;AACZ,CAAA,KAEsB;AACpB,EAAA,MAAM,MAAA,GAASA,mBAAQ,YAAA,CAAa;AAAA,IAClC,KAAA,EAAO,UAAU,SAAA,GAAY,MAAA;AAAA,IAC7B,UAAA,EAAY;AAAA,MACV,IAAIA,kBAAA,CAAQ,UAAA,CAAW,OAAA,CAAQ,EAAE,QAAQA,kBAAA,CAAQ,MAAA,CAAO,MAAA,EAAO,EAAG;AAAA;AACpE,GACD,CAAA;AAED,EAAA,OAAO,MAAA;AACT;AAEO,MAAM,YAAA,GAAe,CAAC,MAAA,KAAqC;AAChE,EAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,SAAA,KAAc,OAAA,EAAS;AACrC,IAAA,OAAOC,
|
|
1
|
+
{"version":3,"file":"utility.cjs.js","sources":["../../src/lib/utility.ts"],"sourcesContent":["/*\n * Copyright 2020 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 {\n RemoteProtocol,\n ParsedLocationAnnotation,\n} from '@backstage/plugin-techdocs-node';\nimport * as winston from 'winston';\nimport { Writable } from 'node:stream';\nimport { stdout } from 'node:process';\n\nexport const convertTechDocsRefToLocationAnnotation = (\n techdocsRef: string,\n): ParsedLocationAnnotation => {\n // Split on the first colon for the protocol and the rest after the first split\n // is the location.\n const [type, target] = techdocsRef.split(/:(.+)/) as [\n RemoteProtocol?,\n string?,\n ];\n\n if (!type || !target) {\n throw new Error(\n `Can not parse --techdocs-ref ${techdocsRef}. Should be of type HOST:URL.`,\n );\n }\n\n return { type, target };\n};\n\nexport const createLogger = ({\n verbose = false,\n}: {\n verbose: boolean;\n}): winston.Logger => {\n const logger = winston.createLogger({\n level: verbose ? 'verbose' : 'info',\n transports: [\n new winston.transports.Console({ format: winston.format.simple() }),\n ],\n });\n\n return logger;\n};\n\nexport const getLogStream = (logger: winston.Logger): Writable => {\n if (process.env.LOG_LEVEL === 'debug') {\n return stdout;\n }\n\n return new Writable({\n defaultEncoding: 'utf8',\n write(chunk, _encoding, next) {\n logger.verbose(chunk.toString().trim());\n next();\n },\n });\n};\n"],"names":["winston","stdout","Writable"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,sCAAA,GAAyC,CACpD,WAAA,KAC6B;AAG7B,EAAA,MAAM,CAAC,IAAA,EAAM,MAAM,CAAA,GAAI,WAAA,CAAY,MAAM,OAAO,CAAA;AAKhD,EAAA,IAAI,CAAC,IAAA,IAAQ,CAAC,MAAA,EAAQ;AACpB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,gCAAgC,WAAW,CAAA,6BAAA;AAAA,KAC7C;AAAA,EACF;AAEA,EAAA,OAAO,EAAE,MAAM,MAAA,EAAO;AACxB;AAEO,MAAM,eAAe,CAAC;AAAA,EAC3B,OAAA,GAAU;AACZ,CAAA,KAEsB;AACpB,EAAA,MAAM,MAAA,GAASA,mBAAQ,YAAA,CAAa;AAAA,IAClC,KAAA,EAAO,UAAU,SAAA,GAAY,MAAA;AAAA,IAC7B,UAAA,EAAY;AAAA,MACV,IAAIA,kBAAA,CAAQ,UAAA,CAAW,OAAA,CAAQ,EAAE,QAAQA,kBAAA,CAAQ,MAAA,CAAO,MAAA,EAAO,EAAG;AAAA;AACpE,GACD,CAAA;AAED,EAAA,OAAO,MAAA;AACT;AAEO,MAAM,YAAA,GAAe,CAAC,MAAA,KAAqC;AAChE,EAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,SAAA,KAAc,OAAA,EAAS;AACrC,IAAA,OAAOC,mBAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAIC,oBAAA,CAAS;AAAA,IAClB,eAAA,EAAiB,MAAA;AAAA,IACjB,KAAA,CAAM,KAAA,EAAO,SAAA,EAAW,IAAA,EAAM;AAC5B,MAAA,MAAA,CAAO,OAAA,CAAQ,KAAA,CAAM,QAAA,EAAS,CAAE,MAAM,CAAA;AACtC,MAAA,IAAA,EAAK;AAAA,IACP;AAAA,GACD,CAAA;AACH;;;;;;"}
|
package/dist/package.json.cjs.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techdocs/cli",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.5-next.1",
|
|
4
4
|
"description": "Utility CLI for managing TechDocs sites in Backstage.",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "cli"
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"watch": "./src"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@backstage/backend-defaults": "
|
|
48
|
-
"@backstage/catalog-model": "
|
|
49
|
-
"@backstage/cli-common": "
|
|
50
|
-
"@backstage/config": "
|
|
51
|
-
"@backstage/plugin-techdocs-node": "
|
|
47
|
+
"@backstage/backend-defaults": "0.15.2-next.1",
|
|
48
|
+
"@backstage/catalog-model": "1.7.6",
|
|
49
|
+
"@backstage/cli-common": "0.1.18-next.0",
|
|
50
|
+
"@backstage/config": "1.3.6",
|
|
51
|
+
"@backstage/plugin-techdocs-node": "1.14.2-next.1",
|
|
52
52
|
"commander": "^12.0.0",
|
|
53
53
|
"fs-extra": "^11.0.0",
|
|
54
54
|
"global-agent": "^3.0.0",
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"winston": "^3.2.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@backstage/cli": "
|
|
61
|
+
"@backstage/cli": "0.35.4-next.2",
|
|
62
62
|
"@types/commander": "^2.12.2",
|
|
63
63
|
"@types/fs-extra": "^11.0.0",
|
|
64
64
|
"@types/http-proxy": "^1.17.4",
|
|
65
65
|
"@types/node": "^22.13.14",
|
|
66
66
|
"@types/serve-handler": "^6.1.0",
|
|
67
67
|
"@types/webpack-env": "^1.15.3",
|
|
68
|
-
"find-process": "^
|
|
68
|
+
"find-process": "^2.0.0",
|
|
69
69
|
"nodemon": "^3.0.1",
|
|
70
70
|
"techdocs-cli-embedded-app": "link:../techdocs-cli-embedded-app"
|
|
71
71
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["1335"],{50010(e,t,i){i.d(t,{W:()=>n});let n=(0,i(97386).h)({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"}}}})},50874(e,t,i){i.d(t,{CatalogSearchResultListItem:()=>y});var n=i(31085),o=i(9720),s=i(94390),a=i(46423),l=i(5951),r=i(72501),d=i(58837),c=i(60603),p=i(7613),m=i(50010),h=i(89595);let u=(0,d.A)({item:{display:"flex"},flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}},{name:"CatalogSearchResultListItem"});function y(e){let t=e.result,i=e.highlight,d=u(),{t:y}=(0,h.i)(m.W);return t?(0,n.jsxs)("div",{className:d.item,children:[e.icon&&(0,n.jsx)(a.A,{children:"function"==typeof e.icon?e.icon(t):e.icon}),(0,n.jsxs)("div",{className:d.flexContainer,children:[(0,n.jsx)(l.A,{className:d.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,n.jsx)(c.N_,{noTrack:!0,to:t.location,children:i?.fields.title?(0,n.jsx)(p.e,{text:i.fields.title,preTag:i.preTag,postTag:i.postTag}):t.title}),secondary:(0,n.jsx)(r.A,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:e.lineClamp,overflow:"hidden"},color:"textSecondary",variant:"body2",children:i?.fields.text?(0,n.jsx)(p.e,{text:i.fields.text,preTag:i.preTag,postTag:i.postTag}):t.text})}),(0,n.jsxs)(o.A,{children:[t.kind&&(0,n.jsx)(s.A,{label:`Kind: ${t.kind}`,size:"small"}),t.type&&(0,n.jsx)(s.A,{label:`Type: ${t.type}`,size:"small"}),t.lifecycle&&(0,n.jsx)(s.A,{label:`${y("searchResultItem.lifecycle")}: ${t.lifecycle}`,size:"small"}),t.owner&&(0,n.jsx)(s.A,{label:`${y("searchResultItem.Owner")}: ${t.owner}`,size:"small"})]})]})]}):null}}}]);
|
|
2
|
-
//# sourceMappingURL=1335.18ed80ea.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/1335.18ed80ea.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/translation.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n indexPage: {\n title: `{{orgName}} Catalog`,\n createButtonTitle: 'Create',\n supportButtonContent: 'All your software catalog entities',\n },\n aboutCard: {\n title: 'About',\n refreshButtonTitle: 'Schedule entity refresh',\n editButtonTitle: 'Edit Metadata',\n createSimilarButtonTitle: 'Create something similar',\n refreshScheduledMessage: 'Refresh scheduled',\n launchTemplate: 'Launch Template',\n viewTechdocs: 'View TechDocs',\n viewSource: 'View Source',\n descriptionField: {\n label: 'Description',\n value: 'No description',\n },\n ownerField: {\n label: 'Owner',\n value: 'No Owner',\n },\n domainField: {\n label: 'Domain',\n value: 'No Domain',\n },\n systemField: {\n label: 'System',\n value: 'No System',\n },\n parentComponentField: {\n label: 'Parent Component',\n value: 'No Parent Component',\n },\n typeField: {\n label: 'Type',\n },\n lifecycleField: {\n label: 'Lifecycle',\n },\n tagsField: {\n label: 'Tags',\n value: 'No Tags',\n },\n targetsField: {\n label: 'Targets',\n },\n },\n searchResultItem: {\n lifecycle: 'Lifecycle',\n Owner: 'Owner',\n },\n catalogTable: {\n warningPanelTitle: 'Could not fetch catalog entities.',\n viewActionTitle: 'View',\n editActionTitle: 'Edit',\n starActionTitle: 'Add to favorites',\n unStarActionTitle: 'Remove from favorites',\n },\n dependencyOfComponentsCard: {\n title: 'Dependency of components',\n emptyMessage: 'No component depends on this component',\n },\n dependsOnComponentsCard: {\n title: 'Depends on components',\n emptyMessage: 'No component is a dependency of this component',\n },\n dependsOnResourcesCard: {\n title: 'Depends on resources',\n emptyMessage: 'No resource is a dependency of this component',\n },\n entityContextMenu: {\n copiedMessage: 'Copied!',\n moreButtonTitle: 'More',\n inspectMenuTitle: 'Inspect entity',\n copyURLMenuTitle: 'Copy entity URL',\n unregisterMenuTitle: 'Unregister entity',\n },\n entityLabelsCard: {\n title: 'Labels',\n emptyDescription:\n 'No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityLabels: {\n warningPanelTitle: 'Entity not found',\n ownerLabel: 'Owner',\n lifecycleLabel: 'Lifecycle',\n },\n entityLinksCard: {\n title: 'Links',\n emptyDescription:\n 'No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityNotFound: {\n title: 'Entity was not found',\n description:\n 'Want to help us build this? Check out our Getting Started documentation.',\n docButtonTitle: 'DOCS',\n },\n deleteEntity: {\n dialogTitle: 'Are you sure you want to delete this entity?',\n deleteButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n description:\n 'This entity is not referenced by any location and is therefore not receiving updates. Click here to delete.',\n },\n entityProcessingErrorsDescription: 'The error below originates from',\n entityRelationWarningDescription:\n \"This entity has relations to other entities, which can't be found in the catalog.\\n Entities not found are: \",\n hasComponentsCard: {\n title: 'Has components',\n emptyMessage: 'No component is part of this system',\n },\n hasResourcesCard: {\n title: 'Has resources',\n emptyMessage: 'No resource is part of this system',\n },\n hasSubcomponentsCard: {\n title: 'Has subcomponents',\n emptyMessage: 'No subcomponent is part of this component',\n },\n hasSubdomainsCard: {\n title: 'Has subdomains',\n emptyMessage: 'No subdomain is part of this domain',\n },\n hasSystemsCard: {\n title: 'Has systems',\n emptyMessage: 'No system is part of this domain',\n },\n relatedEntitiesCard: {\n emptyHelpLinkTitle: 'Learn how to change this',\n },\n systemDiagramCard: {\n title: 'System Diagram',\n description: 'Use pinch & zoom to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\n },\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 { ReactNode } from 'react';\nimport Box from '@material-ui/core/Box';\nimport Chip from '@material-ui/core/Chip';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Link } from '@backstage/core-components';\nimport {\n IndexableDocument,\n ResultHighlight,\n} from '@backstage/plugin-search-common';\nimport { HighlightedSearchResultText } from '@backstage/plugin-search-react';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @public */\nexport type CatalogSearchResultListItemClassKey =\n | 'item'\n | 'flexContainer'\n | 'itemText';\n\nconst useStyles = makeStyles(\n {\n item: {\n display: 'flex',\n },\n flexContainer: {\n flexWrap: 'wrap',\n },\n itemText: {\n width: '100%',\n wordBreak: 'break-all',\n marginBottom: '1rem',\n },\n },\n { name: 'CatalogSearchResultListItem' },\n);\n\n/**\n * Props for {@link CatalogSearchResultListItem}.\n *\n * @public\n */\nexport interface CatalogSearchResultListItemProps {\n icon?: ReactNode | ((result: IndexableDocument) => ReactNode);\n result?: IndexableDocument;\n highlight?: ResultHighlight;\n rank?: number;\n lineClamp?: number;\n}\n\n/** @public */\nexport function CatalogSearchResultListItem(\n props: CatalogSearchResultListItemProps,\n) {\n const result = props.result as any;\n const highlight = props.highlight as ResultHighlight;\n\n const classes = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n if (!result) return null;\n\n return (\n <div className={classes.item}>\n {props.icon && (\n <ListItemIcon>\n {typeof props.icon === 'function' ? props.icon(result) : props.icon}\n </ListItemIcon>\n )}\n <div className={classes.flexContainer}>\n <ListItemText\n className={classes.itemText}\n primaryTypographyProps={{ variant: 'h6' }}\n primary={\n <Link noTrack to={result.location}>\n {highlight?.fields.title ? (\n <HighlightedSearchResultText\n text={highlight.fields.title}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.title\n )}\n </Link>\n }\n secondary={\n <Typography\n component=\"span\"\n style={{\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: props.lineClamp,\n overflow: 'hidden',\n }}\n color=\"textSecondary\"\n variant=\"body2\"\n >\n {highlight?.fields.text ? (\n <HighlightedSearchResultText\n text={highlight.fields.text}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.text\n )}\n </Typography>\n }\n />\n <Box>\n {result.kind && <Chip label={`Kind: ${result.kind}`} size=\"small\" />}\n {result.type && <Chip label={`Type: ${result.type}`} size=\"small\" />}\n {result.lifecycle && (\n <Chip\n label={`${t('searchResultItem.lifecycle')}: ${result.lifecycle}`}\n size=\"small\"\n />\n )}\n {result.owner && (\n <Chip\n label={`${t('searchResultItem.Owner')}: ${result.owner}`}\n size=\"small\"\n />\n )}\n </Box>\n </div>\n </div>\n );\n}\n"],"names":["catalogTranslationRef","createTranslationRef","useStyles","makeStyles","CatalogSearchResultListItem","props","result","highlight","classes","t","useTranslationRef","ListItemIcon","ListItemText","Link","HighlightedSearchResultText","Typography","Box","Chip"],"mappings":"uJAmBO,IAAMA,EAAwBC,AAAAA,GAAAA,A,SAAAA,CAAAA,AAAAA,EAAqB,CACxD,GAAI,UACJ,SAAU,CACR,UAAW,CACT,MAAO,sBACP,kBAAmB,SACnB,qBAAsB,oCACxB,EACA,UAAW,CACT,MAAO,QACP,mBAAoB,0BACpB,gBAAiB,gBACjB,yBAA0B,2BAC1B,wBAAyB,oBACzB,eAAgB,kBAChB,aAAc,gBACd,WAAY,cACZ,iBAAkB,CAChB,MAAO,cACP,MAAO,gBACT,EACA,WAAY,CACV,MAAO,QACP,MAAO,UACT,EACA,YAAa,CACX,MAAO,SACP,MAAO,WACT,EACA,YAAa,CACX,MAAO,SACP,MAAO,WACT,EACA,qBAAsB,CACpB,MAAO,mBACP,MAAO,qBACT,EACA,UAAW,CACT,MAAO,MACT,EACA,eAAgB,CACd,MAAO,WACT,EACA,UAAW,CACT,MAAO,OACP,MAAO,SACT,EACA,aAAc,CACZ,MAAO,SACT,CACF,EACA,iBAAkB,CAChB,UAAW,YACX,MAAO,OACT,EACA,aAAc,CACZ,kBAAmB,oCACnB,gBAAiB,OACjB,gBAAiB,OACjB,gBAAiB,mBACjB,kBAAmB,uBACrB,EACA,2BAA4B,CAC1B,MAAO,2BACP,aAAc,wCAChB,EACA,wBAAyB,CACvB,MAAO,wBACP,aAAc,gDAChB,EACA,uBAAwB,CACtB,MAAO,uBACP,aAAc,+CAChB,EACA,kBAAmB,CACjB,cAAe,UACf,gBAAiB,OACjB,iBAAkB,iBAClB,iBAAkB,kBAClB,oBAAqB,mBACvB,EACA,iBAAkB,CAChB,MAAO,SACP,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B,EAAE,EAAEH,EAAO,KAAK,CAAC,CAAC,CACxD,KAAK,O,YA9DG,IAqEtB,C"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["1749"],{52235(e,t,n){var i=n(4293),a=n(78920);t.default=void 0;var o=a(n(14041));t.default=(0,i(n(74044)).default)(o.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward")},98557(e,t,n){n.d(t,{M:()=>l});var i=n(31085),a=n(58837),o=n(71677),s=n(72501);let r=(0,a.A)({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=r(e);return(0,i.jsx)(o.Ay,{title:e.title??(e.text||""),placement:e.placement,classes:e.tooltipClasses,children:(0,i.jsx)(s.A,{className:t.typo,variant:"inherit",children:e.text})})}},89439(e,t,n){n.d(t,{n:()=>R});var i=n(31085),a=n(40703),o=n(59469),s=n(48653),r=n(45685),l=n(37197),c=n(58837),d=n(24568),m=n(53373),u=n.n(m),p=n(9720),y=n(72501),h=n(52235),f=n(60603);let g=(0,c.A)(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.A,{children:[(0,i.jsx)(l.A,{}),(0,i.jsx)(f.N_,{to:t,onClick:a,underline:"none",children:(0,i.jsxs)(p.A,{display:"flex",alignItems:"center",className:o.root,children:[(0,i.jsx)(p.A,{className:o.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,i.jsx)(y.A,{children:(0,i.jsx)("strong",{children:n})})}),(0,i.jsx)(h.default,{className:o.arrow})]})})]})}var C=n(14041),b=n(45463),v=n(60691),j=n(89332),w=n(89595);let E=e=>{let{slackChannel:t}=e,{t:n}=(0,w.i)(j.O);return t?"string"==typeof t?(0,i.jsx)(y.A,{children:n("errorBoundary.title",{slackChannel:t})}):t.href?(0,i.jsx)(b.z,{to:t.href,variant:"contained",children:t.name}):(0,i.jsx)(y.A,{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.b,{title:"Something Went Wrong",error:n,children:(0,i.jsx)(E,{slackChannel:e})}):t}},A=(0,c.A)(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"}),k=(0,d.A)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(o.A),S={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"}}},L={fullHeight:{flex:1},gridItem:{flex:1}};function R(e){let{title:t,subheader:n,divider:c=!0,deepLink:d,slackChannel:m,errorBoundaryProps:p,variant:y,alignContent:h="normal",children:f,headerStyle:g,headerProps:C,icon:b,action:v,actionsClassName:j,actions:w,cardClassName:E,actionsTopRight:R,className:M,noPadding:N,titleTypographyProps:O,subheaderTypographyProps:B}=e,D=A(),K={},I={};return y&&y.split(/[\s]+/g).forEach(e=>{K={...K,...S[e]},I={...I,...L[e]}}),(0,i.jsx)(a.A,{style:K,className:M,children:(0,i.jsxs)(T,{...p||(m?{slackChannel:m}:{}),children:[t&&(0,i.jsx)(r.A,{classes:{root:u()(D.header),title:D.headerTitle,subheader:D.headerSubheader,avatar:D.headerAvatar,action:D.headerAction,content:D.headerContent},title:t,subheader:n||b?(0,i.jsxs)("div",{"data-testid":"info-card-subheader",children:[n&&(0,i.jsx)("div",{className:D.subheader,children:n}),b]}):null,action:v,style:{...g},titleTypographyProps:O,subheaderTypographyProps:B,...C}),R&&(0,i.jsx)(k,{children:R}),c&&(0,i.jsx)(l.A,{}),(0,i.jsx)(s.A,{className:u()(E,{[D.noPadding]:N,[D.contentAlignBottom]:"bottom"===h}),style:I,children:f}),w&&(0,i.jsx)(o.A,{className:j,children:w}),d&&(0,i.jsx)(x,{...d})]})})}},65671(e,t,n){n.d(t,{s:()=>g});var i=n(31085),a=n(58837),o=n(96403),s=n(98557),r=n(53320),l=n(7537),c=n(76025),d=n(53987),m=n(19857);let u=Object.freeze({createEntityRefColumn(e){let{defaultKind:t}=e;function n(e){return e.metadata?.title||(0,l.S)(e,{defaultKind:t})}return{title:(0,i.jsx)(m.g,{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.z,{entityRef:e,defaultKind:t,title:e.metadata?.title})}},createEntityRelationColumn(e){let{title:t,relation:n,defaultKind:a,filter:o}=e;function s(e){return(0,r.t)(e,n,o)}function c(e){return s(e).map(e=>(0,l.S)(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.i,{entityRefs:s(e),defaultKind:a})}},createOwnerColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"owner"}),relation:o.vv,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"domain"}),relation:o.jn,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"system"}),relation:o.jn,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"description"}),field:"metadata.description",render:e=>(0,i.jsx)(s.M,{text:e.metadata.description,placement:"bottom-start",line:2})}),createSpecLifecycleColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"lifecycle"}),field:"spec.lifecycle"}),createSpecTypeColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"type"}),field:"spec.type"})}),p=[u.createEntityRefColumn({defaultKind:"system"}),u.createDomainColumn(),u.createOwnerColumn(),u.createMetadataDescriptionColumn()],y=[u.createEntityRefColumn({defaultKind:"component"}),u.createSystemColumn(),u.createOwnerColumn(),u.createSpecTypeColumn(),u.createSpecLifecycleColumn(),u.createMetadataDescriptionColumn()];var h=n(28499);let f=(0,a.A)(e=>({empty:{padding:e.spacing(2),display:"flex",justifyContent:"center"}})),g=e=>{let{entities:t,title:n,emptyContent:a,variant:o="gridItem",columns:s,tableOptions:r={}}=e,l=f(),c={minWidth:"0",width:"100%"};return"gridItem"===o&&(c.height="calc(100% - 10px)"),(0,i.jsx)(h.X,{columns:s,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,...r},data:t})};g.columns=u,g.systemEntityColumns=p,g.componentEntityColumns=y},19857(e,t,n){n.d(t,{g:()=>o});var i=n(89595),a=n(79811);let o=({translationKey:e})=>{let{t}=(0,i.i)(a.j);return t(`entityTableColumnTitle.${e}`)}},22845(e,t,n){n.d(t,{T7:()=>c,TY:()=>m,tN:()=>d});var i=n(31085),a=n(58077),o=n(92829),s=n(9135),r=n(20549);let l=(0,s.tK)("entity-context"),c=e=>{let{children:t,entity:n,loading:s,error:c,refresh:d}=e;return(0,i.jsx)(l.Provider,{value:(0,r.B)({1:{entity:n,loading:s,error:c,refresh:d}}),children:(0,i.jsx)(o.Ig,{attributes:{...n?{entityRef:(0,a.U2)(n)}:void 0},children:t})})};function d(){let e=(0,s.qO)("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 m(){let e=(0,s.qO)("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}}},50010(e,t,n){n.d(t,{W:()=>i});let i=(0,n(97386).h)({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"}}}})},7396(e,t,n){n.d(t,{DependsOnComponentsCard:()=>c});var i=n(31085),a=n(96403),o=n(79842),s=n(44849),r=n(50010),l=n(89595);function c(e){let{t}=(0,l.i)(r.W),{variant:n="gridItem",title:c=t("dependsOnComponentsCard.title"),columns:d=o.mz,tableOptions:m={}}=e;return(0,i.jsx)(s.p,{variant:n,title:c,entityKind:"Component",relationType:a.nC,columns:d,emptyMessage:t("dependsOnComponentsCard.emptyMessage"),emptyHelpLink:o.e2,asRenderableEntities:o.xJ,tableOptions:m})}},44849(e,t,n){n.d(t,{p:()=>A});var i=n(31085),a=n(72501),o=n(22845),s=n(58077),r=n(50509),l=n(73466),c=n(76272),d=n(65671),m=n(89439),u=n(55489),p=n(58837),y=n(37197),h=n(8109),f=n(5951),g=n(4809),x=n(55555),C=n(60691);let b=(0,p.A)(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.b,{title:t??n.message,defaultExpanded:a,error:n});let{body:s,cause:r}=n,{request:l,response:c}=s,d=`${c.statusCode}: ${r.name}`,m=l&&`${l.method} ${l.url}`,u=r.message.replace(/\\n/g,"\n"),p=r.stack?.replace(/\\n/g,"\n"),v=JSON.stringify(s,void 0,2);return(0,i.jsxs)(C.b,{title:t??n.message,defaultExpanded:a,error:{name:d,message:u,stack:p},children:[m&&(0,i.jsxs)(h.A,{alignItems:"flex-start",children:[(0,i.jsx)(f.A,{classes:{secondary:o.text},primary:"Request",secondary:l?`${m}`:void 0}),(0,i.jsx)(x.l,{text:m})]}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y.A,{component:"li",className:o.divider}),(0,i.jsx)(h.A,{alignItems:"flex-start",children:(0,i.jsx)(f.A,{classes:{secondary:o.text},primary:"Full Error as JSON"})}),(0,i.jsx)(g.z,{language:"json",text:v,showCopyCodeButton:!0})]})]})}var j=n(60603),w=n(79842),E=n(50010),T=n(89595);let A=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.W),{entity:w}=(0,o.tN)(),{entities:A,loading:k,error:S}=function(e,t){let n=t?.type?.toLocaleLowerCase("en-US"),i=t?.kind?.toLocaleLowerCase("en-US"),a=(0,r.gf)(c.v),{loading:o,value:d,error:m}=(0,l.A)(async()=>{let t=e.relations?.filter(e=>(!n||e.type.toLocaleLowerCase("en-US")===n)&&(!i||(0,s.KU)(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:m}}(w,{type:h,kind:y});return k?(0,i.jsx)(m.n,{variant:t,title:n,children:(0,i.jsx)(u.k,{})}):S?(0,i.jsx)(m.n,{variant:t,title:n,children:(0,i.jsx)(v,{error:S})}):(0,i.jsx)(d.s,{title:n,variant:t,emptyContent:(0,i.jsxs)("div",{style:{textAlign:"center"},children:[(0,i.jsx)(a.A,{variant:"body1",children:f}),(0,i.jsx)(a.A,{variant:"body2",children:(0,i.jsx)(j.N_,{to:g,externalLinkIcon:!0,children:b("relatedEntitiesCard.emptyHelpLinkTitle")})})]}),columns:p,entities:x(A||[]),tableOptions:C})};A.componentEntityColumns=w.mz,A.componentEntityHelpLink=w.e2,A.asComponentEntities=w.xJ,A.resourceEntityColumns=w.v9,A.resourceEntityHelpLink=w.nz,A.asResourceEntities=w.eB,A.systemEntityColumns=w.MW,A.systemEntityHelpLink=w.iU,A.asSystemEntities=w.vy,A.domainEntityColums=w.xO,A.domainEntityHelpLink=w.Xr,A.asDomainEntities=w.QS},79842(e,t,n){n.d(t,{MW:()=>d,QS:()=>h,Xr:()=>y,e2:()=>o,eB:()=>c,iU:()=>m,mz:()=>a,nz:()=>l,v9:()=>r,vy:()=>u,xJ:()=>s,xO:()=>p});var i=n(65671);let a=[i.s.columns.createEntityRefColumn({defaultKind:"component"}),i.s.columns.createOwnerColumn(),i.s.columns.createSpecTypeColumn(),i.s.columns.createSpecLifecycleColumn(),i.s.columns.createMetadataDescriptionColumn()],o="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",s=e=>e,r=[i.s.columns.createEntityRefColumn({defaultKind:"resource"}),i.s.columns.createOwnerColumn(),i.s.columns.createSpecTypeColumn(),i.s.columns.createSpecLifecycleColumn(),i.s.columns.createMetadataDescriptionColumn()],l="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",c=e=>e,d=[i.s.columns.createEntityRefColumn({defaultKind:"system"}),i.s.columns.createOwnerColumn(),i.s.columns.createMetadataDescriptionColumn()],m="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",u=e=>e,p=[i.s.columns.createEntityRefColumn({defaultKind:"domain"}),i.s.columns.createOwnerColumn(),i.s.columns.createMetadataDescriptionColumn()],y="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain",h=e=>e}}]);
|
|
2
|
-
//# sourceMappingURL=1749.12caaf36.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/1749.12caaf36.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../../node_modules/@material-ui/icons/ArrowForward.js","webpack://techdocs-cli-embedded-app/../core-components/src/components/OverflowTooltip/OverflowTooltip.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/BottomLink/BottomLink.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/ErrorBoundary/ErrorBoundary.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/InfoCard/InfoCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/columns.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/presets.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/EntityTable.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/TitleColumn.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useEntity.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/translation.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/DependsOnComponentsCard/DependsOnComponentsCard.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/ResponseErrorPanel/ResponseErrorPanel.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useRelatedEntities.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/presets.ts"],"sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\"\n}), 'ArrowForward');\n\nexports.default = _default;","/*\n * Copyright 2020 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 { makeStyles } from '@material-ui/core/styles';\nimport Tooltip, { TooltipProps } from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\n\ntype Props = {\n text?: string | undefined;\n title?: TooltipProps['title'];\n line?: number | undefined;\n placement?: TooltipProps['placement'];\n tooltipClasses?: TooltipProps['classes'];\n};\n\nexport type OverflowTooltipClassKey = 'container';\n\nconst useStyles = makeStyles(\n {\n container: {\n overflow: 'visible !important',\n },\n typo: {\n fontSize: 'inherit',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n display: '-webkit-box',\n '-webkit-line-clamp': ({ line }: Props) => line || 1,\n '-webkit-box-orient': 'vertical',\n },\n },\n { name: 'BackstageOverflowTooltip' },\n);\n\nexport function OverflowTooltip(props: Props) {\n const classes = useStyles(props);\n\n return (\n <Tooltip\n title={props.title ?? (props.text || '')}\n placement={props.placement}\n classes={props.tooltipClasses}\n >\n <Typography className={classes.typo} variant=\"inherit\">\n {props.text}\n </Typography>\n </Tooltip>\n );\n}\n","/*\n * Copyright 2020 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 Box from '@material-ui/core/Box';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport ArrowIcon from '@material-ui/icons/ArrowForward';\nimport { MouseEvent } from 'react';\nimport { Link } from '../../components/Link';\n\n/** @public */\nexport type BottomLinkClassKey = 'root' | 'boxTitle' | 'arrow';\n\nconst useStyles = makeStyles(\n theme => ({\n root: {\n maxWidth: 'fit-content',\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n boxTitle: {\n margin: 0,\n color: theme.palette.textSubtle,\n },\n arrow: {\n color: theme.palette.textSubtle,\n },\n }),\n { name: 'BackstageBottomLink' },\n);\n\n/** @public */\nexport type BottomLinkProps = {\n link: string;\n title: string;\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n};\n\n/**\n * Footer with link used in {@link InfoCard } and {@link TabbedCard}\n *\n * @public\n *\n */\nexport function BottomLink(props: BottomLinkProps) {\n const { link, title, onClick } = props;\n const classes = useStyles();\n\n return (\n <Box>\n <Divider />\n <Link to={link} onClick={onClick} underline=\"none\">\n <Box display=\"flex\" alignItems=\"center\" className={classes.root}>\n <Box className={classes.boxTitle} fontWeight=\"fontWeightBold\" m={1}>\n <Typography>\n <strong>{title}</strong>\n </Typography>\n </Box>\n <ArrowIcon className={classes.arrow} />\n </Box>\n </Link>\n </Box>\n );\n}\n","/*\n * Copyright 2020 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 Typography from '@material-ui/core/Typography';\nimport { PropsWithChildren, ComponentClass, Component, ErrorInfo } from 'react';\nimport { LinkButton } from '../../components/LinkButton';\nimport { ErrorPanel } from '../../components/ErrorPanel';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\ntype SlackChannel = {\n name: string;\n href?: string;\n};\n\n/** @public */\nexport type ErrorBoundaryProps = PropsWithChildren<{\n slackChannel?: string | SlackChannel;\n onError?: (error: Error, errorInfo: string) => null;\n}>;\n\ntype State = {\n error?: Error;\n errorInfo?: ErrorInfo;\n};\n\nconst SlackLink = (props: { slackChannel?: string | SlackChannel }) => {\n const { slackChannel } = props;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n if (!slackChannel) {\n return null;\n } else if (typeof slackChannel === 'string') {\n return (\n <Typography>{t('errorBoundary.title', { slackChannel })}</Typography>\n );\n } else if (!slackChannel.href) {\n return (\n <Typography>\n {t('errorBoundary.title', {\n slackChannel: slackChannel.name,\n })}\n </Typography>\n );\n }\n\n return (\n <LinkButton to={slackChannel.href} variant=\"contained\">\n {slackChannel.name}\n </LinkButton>\n );\n};\n\n/** @public */\nexport const ErrorBoundary: ComponentClass<\n ErrorBoundaryProps,\n State\n> = class ErrorBoundary extends Component<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = {\n error: undefined,\n errorInfo: undefined,\n };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n // eslint-disable-next-line no-console\n console.error(`ErrorBoundary, error: ${error}`, { error, errorInfo });\n this.setState({ error, errorInfo });\n }\n\n render() {\n const { slackChannel, children } = this.props;\n const { error } = this.state;\n\n if (!error) {\n return children;\n }\n\n return (\n <ErrorPanel title=\"Something Went Wrong\" error={error}>\n <SlackLink slackChannel={slackChannel} />\n </ErrorPanel>\n );\n }\n};\n","/*\n * Copyright 2020 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 Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader, { CardHeaderProps } from '@material-ui/core/CardHeader';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { ReactNode } from 'react';\nimport { BottomLink, BottomLinkProps } from '../BottomLink';\nimport { ErrorBoundary, ErrorBoundaryProps } from '../ErrorBoundary';\n\n/** @public */\nexport type InfoCardClassKey =\n | 'noPadding'\n | 'header'\n | 'headerTitle'\n | 'headerSubheader'\n | 'headerAvatar'\n | 'headerAction'\n | 'headerContent';\n\nconst useStyles = makeStyles(\n theme => ({\n noPadding: {\n padding: 0,\n '&:last-child': {\n paddingBottom: 0,\n },\n },\n contentAlignBottom: {\n display: 'flex',\n alignItems: 'self-end',\n },\n header: {\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n headerTitle: {\n fontWeight: theme.typography.fontWeightBold,\n },\n headerSubheader: {\n paddingTop: theme.spacing(1),\n },\n headerAvatar: {},\n headerAction: {},\n headerContent: {},\n subheader: {\n display: 'flex',\n },\n }),\n { name: 'BackstageInfoCard' },\n);\n\n/** @public */\nexport type CardActionsTopRightClassKey = 'root';\n\nconst CardActionsTopRight = withStyles(\n theme => ({\n root: {\n display: 'inline-block',\n padding: theme.spacing(8, 8, 0, 0),\n float: 'right',\n },\n }),\n { name: 'BackstageInfoCardCardActionsTopRight' },\n)(CardActions);\n\nconst VARIANT_STYLES = {\n card: {\n flex: {\n display: 'flex',\n flexDirection: 'column',\n },\n fullHeight: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n },\n gridItem: {\n display: 'flex',\n flexDirection: 'column',\n height: 'calc(100% - 10px)', // for pages without content header\n marginBottom: '10px',\n breakInside: 'avoid-page',\n '@media print': {\n height: 'auto',\n },\n },\n },\n cardContent: {\n fullHeight: {\n flex: 1,\n },\n gridItem: {\n flex: 1,\n },\n },\n};\n\n/** @public */\nexport type InfoCardVariants = 'flex' | 'fullHeight' | 'gridItem';\n\n/**\n * InfoCard is used to display a paper-styled block on the screen, similar to a panel.\n *\n * You can custom style an InfoCard with the 'className' (outer container) and 'cardClassName' (inner container)\n * props. This is typically used with the material-ui makeStyles mechanism.\n *\n * The InfoCard serves as an error boundary. As a result, if you provide an 'errorBoundaryProps' property this\n * specifies the extra information to display in the error component that is displayed if an error occurs\n * in any descendent components.\n *\n * By default the InfoCard has no custom layout of its children, but is treated as a block element. A\n * couple common variants are provided and can be specified via the variant property:\n *\n * When the InfoCard is displayed as a grid item within a grid, you may want items to have the same height for all items.\n * Set to the 'gridItem' variant to display the InfoCard with full height suitable for Grid:\n *\n * `<InfoCard variant=\"gridItem\">...</InfoCard>`\n */\nexport type Props = {\n title?: ReactNode;\n subheader?: ReactNode;\n divider?: boolean;\n deepLink?: BottomLinkProps;\n /** @deprecated Use errorBoundaryProps instead */\n slackChannel?: string;\n errorBoundaryProps?: ErrorBoundaryProps;\n variant?: InfoCardVariants;\n alignContent?: 'normal' | 'bottom';\n children?: ReactNode;\n headerStyle?: object;\n headerProps?: CardHeaderProps;\n icon?: ReactNode;\n action?: ReactNode;\n actionsClassName?: string;\n actions?: ReactNode;\n cardClassName?: string;\n actionsTopRight?: ReactNode;\n className?: string;\n noPadding?: boolean;\n titleTypographyProps?: object;\n subheaderTypographyProps?: object;\n};\n\n/**\n * Material-ui card with header , content and actions footer\n *\n * @public\n *\n */\nexport function InfoCard(props: Props): JSX.Element {\n const {\n title,\n subheader,\n divider = true,\n deepLink,\n slackChannel,\n errorBoundaryProps,\n variant,\n alignContent = 'normal',\n children,\n headerStyle,\n headerProps,\n icon,\n action,\n actionsClassName,\n actions,\n cardClassName,\n actionsTopRight,\n className,\n noPadding,\n titleTypographyProps,\n subheaderTypographyProps,\n } = props;\n const classes = useStyles();\n /**\n * If variant is specified, we build up styles for that particular variant for both\n * the Card and the CardContent (since these need to be synced)\n */\n let calculatedStyle = {};\n let calculatedCardStyle = {};\n if (variant) {\n const variants = variant.split(/[\\s]+/g);\n variants.forEach(name => {\n calculatedStyle = {\n ...calculatedStyle,\n ...VARIANT_STYLES.card[name as keyof (typeof VARIANT_STYLES)['card']],\n };\n calculatedCardStyle = {\n ...calculatedCardStyle,\n ...VARIANT_STYLES.cardContent[\n name as keyof (typeof VARIANT_STYLES)['cardContent']\n ],\n };\n });\n }\n\n const cardSubTitle = () => {\n if (!subheader && !icon) {\n return null;\n }\n\n return (\n <div data-testid=\"info-card-subheader\">\n {subheader && <div className={classes.subheader}>{subheader}</div>}\n {icon}\n </div>\n );\n };\n\n const errProps: ErrorBoundaryProps =\n errorBoundaryProps || (slackChannel ? { slackChannel } : {});\n\n return (\n <Card style={calculatedStyle} className={className}>\n <ErrorBoundary {...errProps}>\n {title && (\n <CardHeader\n classes={{\n root: classNames(classes.header),\n title: classes.headerTitle,\n subheader: classes.headerSubheader,\n avatar: classes.headerAvatar,\n action: classes.headerAction,\n content: classes.headerContent,\n }}\n title={title}\n subheader={cardSubTitle()}\n action={action}\n style={{ ...headerStyle }}\n titleTypographyProps={titleTypographyProps}\n subheaderTypographyProps={subheaderTypographyProps}\n {...headerProps}\n />\n )}\n {actionsTopRight && (\n <CardActionsTopRight>{actionsTopRight}</CardActionsTopRight>\n )}\n {divider && <Divider />}\n <CardContent\n className={classNames(cardClassName, {\n [classes.noPadding]: noPadding,\n [classes.contentAlignBottom]: alignContent === 'bottom',\n })}\n style={calculatedCardStyle}\n >\n {children}\n </CardContent>\n {actions && (\n <CardActions className={actionsClassName}>{actions}</CardActions>\n )}\n {deepLink && <BottomLink {...deepLink} />}\n </ErrorBoundary>\n </Card>\n );\n}\n","/*\n * Copyright 2020 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 {\n Entity,\n CompoundEntityRef,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n} from '@backstage/catalog-model';\nimport { OverflowTooltip, TableColumn } from '@backstage/core-components';\nimport { getEntityRelations } from '../../utils';\nimport {\n EntityRefLink,\n EntityRefLinks,\n humanizeEntityRef,\n} from '../EntityRefLink';\nimport { EntityTableColumnTitle } from './TitleColumn';\n\n/** @public */\nexport const columnFactories = Object.freeze({\n createEntityRefColumn<T extends Entity>(options: {\n defaultKind?: string;\n }): TableColumn<T> {\n const { defaultKind } = options;\n function formatContent(entity: T): string {\n return (\n entity.metadata?.title ||\n humanizeEntityRef(entity, {\n defaultKind,\n })\n );\n }\n\n return {\n title: <EntityTableColumnTitle translationKey=\"name\" />,\n highlight: true,\n customFilterAndSearch(filter, entity) {\n // TODO: We could implement this more efficiently, like searching over\n // each field that is displayed individually (kind, namespace, name).\n // but that might confuse the user as it will behave different than a\n // simple text search.\n // Another alternative would be to cache the values. But writing them\n // into the entity feels bad too.\n return formatContent(entity).includes(filter);\n },\n customSort(entity1, entity2) {\n // TODO: We could implement this more efficiently by comparing field by field.\n // This has similar issues as above.\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: entity => (\n <EntityRefLink\n entityRef={entity}\n defaultKind={defaultKind}\n title={entity.metadata?.title}\n />\n ),\n };\n },\n createEntityRelationColumn<T extends Entity>(options: {\n title: string | JSX.Element;\n relation: string;\n defaultKind?: string;\n filter?: { kind: string };\n }): TableColumn<T> {\n const { title, relation, defaultKind, filter: entityFilter } = options;\n\n function getRelations(entity: T): CompoundEntityRef[] {\n return getEntityRelations(entity, relation, entityFilter);\n }\n\n function formatContent(entity: T): string {\n return getRelations(entity)\n .map(r => humanizeEntityRef(r, { defaultKind }))\n .join(', ');\n }\n\n return {\n title,\n customFilterAndSearch(filter, entity) {\n return formatContent(entity).includes(filter);\n },\n customSort(entity1, entity2) {\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: entity => {\n return (\n <EntityRefLinks\n entityRefs={getRelations(entity)}\n defaultKind={defaultKind}\n />\n );\n },\n };\n },\n createOwnerColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: <EntityTableColumnTitle translationKey=\"owner\" />,\n relation: RELATION_OWNED_BY,\n defaultKind: 'group',\n });\n },\n createDomainColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: <EntityTableColumnTitle translationKey=\"domain\" />,\n relation: RELATION_PART_OF,\n defaultKind: 'domain',\n filter: {\n kind: 'domain',\n },\n });\n },\n createSystemColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: <EntityTableColumnTitle translationKey=\"system\" />,\n relation: RELATION_PART_OF,\n defaultKind: 'system',\n filter: {\n kind: 'system',\n },\n });\n },\n createMetadataDescriptionColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: <EntityTableColumnTitle translationKey=\"description\" />,\n field: 'metadata.description',\n render: entity => (\n <OverflowTooltip\n text={entity.metadata.description}\n placement=\"bottom-start\"\n line={2}\n />\n ),\n };\n },\n createSpecLifecycleColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: <EntityTableColumnTitle translationKey=\"lifecycle\" />,\n field: 'spec.lifecycle',\n };\n },\n createSpecTypeColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: <EntityTableColumnTitle translationKey=\"type\" />,\n field: 'spec.type',\n };\n },\n});\n","/*\n * Copyright 2020 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 { ComponentEntity, SystemEntity } from '@backstage/catalog-model';\nimport { TableColumn } from '@backstage/core-components';\nimport { columnFactories } from './columns';\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n columnFactories.createEntityRefColumn({ defaultKind: 'system' }),\n columnFactories.createDomainColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n];\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n columnFactories.createEntityRefColumn({ defaultKind: 'component' }),\n columnFactories.createSystemColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n];\n","/*\n * Copyright 2020 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 { makeStyles } from '@material-ui/core/styles';\nimport { CSSProperties, ReactNode } from 'react';\nimport { columnFactories } from './columns';\nimport { componentEntityColumns, systemEntityColumns } from './presets';\nimport {\n InfoCardVariants,\n Table,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\n\n/**\n * Props for {@link EntityTable}.\n *\n * @public\n */\nexport interface EntityTableProps<T extends Entity> {\n title: string;\n variant?: InfoCardVariants;\n entities: T[];\n emptyContent?: ReactNode;\n columns: TableColumn<T>[];\n tableOptions?: TableOptions;\n}\n\nconst useStyles = makeStyles(theme => ({\n empty: {\n padding: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n },\n}));\n\n/**\n * A general entity table component, that can be used for composing more\n * specific entity tables.\n *\n * @public\n */\nexport const EntityTable = <T extends Entity>(props: EntityTableProps<T>) => {\n const {\n entities,\n title,\n emptyContent,\n variant = 'gridItem',\n columns,\n tableOptions = {},\n } = props;\n\n const classes = useStyles();\n const tableStyle: CSSProperties = {\n minWidth: '0',\n width: '100%',\n };\n\n if (variant === 'gridItem') {\n tableStyle.height = 'calc(100% - 10px)';\n }\n\n return (\n <Table<T>\n columns={columns}\n title={title}\n style={tableStyle}\n emptyContent={\n emptyContent && <div className={classes.empty}>{emptyContent}</div>\n }\n options={{\n // TODO: Toolbar padding if off compared to other cards, should be: padding: 16px 24px;\n search: false,\n paging: false,\n actionsColumnIndex: -1,\n padding: 'dense',\n draggable: false,\n ...tableOptions,\n }}\n data={entities}\n />\n );\n};\n\nEntityTable.columns = columnFactories;\n\nEntityTable.systemEntityColumns = systemEntityColumns;\n\nEntityTable.componentEntityColumns = componentEntityColumns;\n","/*\n * Copyright 2025 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 { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogReactTranslationRef } from '../../translation';\n\n/**\n * @alpha\n */\nexport type EntityTableColumnTitleProps = {\n translationKey:\n | 'name'\n | 'system'\n | 'owner'\n | 'type'\n | 'lifecycle'\n | 'namespace'\n | 'description'\n | 'tags'\n | 'targets'\n | 'title'\n | 'label'\n | 'domain';\n};\n\n/**\n * @alpha\n */\nexport const EntityTableColumnTitle = ({\n translationKey,\n}: EntityTableColumnTitleProps) => {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return t(`entityTableColumnTitle.${translationKey}`);\n};\n","/*\n * Copyright 2020 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 { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { AnalyticsContext } from '@backstage/core-plugin-api';\nimport {\n createVersionedContext,\n createVersionedValueMap,\n useVersionedContext,\n} from '@backstage/version-bridge';\nimport { ReactNode } from 'react';\n\n/** @public */\nexport type EntityLoadingStatus<TEntity extends Entity = Entity> = {\n entity?: TEntity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n};\n\n// This context has support for multiple concurrent versions of this package.\n// It is currently used in parallel with the old context in order to provide\n// a smooth transition, but will eventually be the only context we use.\nconst NewEntityContext = createVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n);\n\n/**\n * Properties for the AsyncEntityProvider component.\n *\n * @public\n */\nexport interface AsyncEntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n}\n\n/**\n * Provides a loaded entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const AsyncEntityProvider = (props: AsyncEntityProviderProps) => {\n const { children, entity, loading, error, refresh } = props;\n const value = { entity, loading, error, refresh };\n // We provide both the old and the new context, since\n // consumers might be doing things like `useContext(EntityContext)`\n return (\n <NewEntityContext.Provider value={createVersionedValueMap({ 1: value })}>\n <AnalyticsContext\n attributes={{\n ...(entity ? { entityRef: stringifyEntityRef(entity) } : undefined),\n }}\n >\n {children}\n </AnalyticsContext>\n </NewEntityContext.Provider>\n );\n};\n\n/**\n * Properties for the EntityProvider component.\n *\n * @public\n */\nexport interface EntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n}\n\n/**\n * Provides an entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const EntityProvider = (props: EntityProviderProps) => (\n <AsyncEntityProvider\n entity={props.entity}\n loading={!Boolean(props.entity)}\n error={undefined}\n refresh={undefined}\n children={props.children}\n />\n);\n\n/**\n * Grab the current entity from the context, throws if the entity has not yet been loaded\n * or is not available.\n *\n * @public\n */\nexport function useEntity<TEntity extends Entity = Entity>(): {\n entity: TEntity;\n} {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n if (!value.entity) {\n throw new Error(\n 'useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.',\n );\n }\n\n return { entity: value.entity as TEntity };\n}\n\n/**\n * Grab the current entity from the context, provides loading state and errors, and the ability to refresh.\n *\n * @public\n */\nexport function useAsyncEntity<\n TEntity extends Entity = Entity,\n>(): EntityLoadingStatus<TEntity> {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n const { entity, loading, error, refresh } = value;\n return { entity: entity as TEntity, loading, error, refresh };\n}\n","/*\n * Copyright 2023 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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n indexPage: {\n title: `{{orgName}} Catalog`,\n createButtonTitle: 'Create',\n supportButtonContent: 'All your software catalog entities',\n },\n aboutCard: {\n title: 'About',\n refreshButtonTitle: 'Schedule entity refresh',\n editButtonTitle: 'Edit Metadata',\n createSimilarButtonTitle: 'Create something similar',\n refreshScheduledMessage: 'Refresh scheduled',\n launchTemplate: 'Launch Template',\n viewTechdocs: 'View TechDocs',\n viewSource: 'View Source',\n descriptionField: {\n label: 'Description',\n value: 'No description',\n },\n ownerField: {\n label: 'Owner',\n value: 'No Owner',\n },\n domainField: {\n label: 'Domain',\n value: 'No Domain',\n },\n systemField: {\n label: 'System',\n value: 'No System',\n },\n parentComponentField: {\n label: 'Parent Component',\n value: 'No Parent Component',\n },\n typeField: {\n label: 'Type',\n },\n lifecycleField: {\n label: 'Lifecycle',\n },\n tagsField: {\n label: 'Tags',\n value: 'No Tags',\n },\n targetsField: {\n label: 'Targets',\n },\n },\n searchResultItem: {\n lifecycle: 'Lifecycle',\n Owner: 'Owner',\n },\n catalogTable: {\n warningPanelTitle: 'Could not fetch catalog entities.',\n viewActionTitle: 'View',\n editActionTitle: 'Edit',\n starActionTitle: 'Add to favorites',\n unStarActionTitle: 'Remove from favorites',\n },\n dependencyOfComponentsCard: {\n title: 'Dependency of components',\n emptyMessage: 'No component depends on this component',\n },\n dependsOnComponentsCard: {\n title: 'Depends on components',\n emptyMessage: 'No component is a dependency of this component',\n },\n dependsOnResourcesCard: {\n title: 'Depends on resources',\n emptyMessage: 'No resource is a dependency of this component',\n },\n entityContextMenu: {\n copiedMessage: 'Copied!',\n moreButtonTitle: 'More',\n inspectMenuTitle: 'Inspect entity',\n copyURLMenuTitle: 'Copy entity URL',\n unregisterMenuTitle: 'Unregister entity',\n },\n entityLabelsCard: {\n title: 'Labels',\n emptyDescription:\n 'No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityLabels: {\n warningPanelTitle: 'Entity not found',\n ownerLabel: 'Owner',\n lifecycleLabel: 'Lifecycle',\n },\n entityLinksCard: {\n title: 'Links',\n emptyDescription:\n 'No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityNotFound: {\n title: 'Entity was not found',\n description:\n 'Want to help us build this? Check out our Getting Started documentation.',\n docButtonTitle: 'DOCS',\n },\n deleteEntity: {\n dialogTitle: 'Are you sure you want to delete this entity?',\n deleteButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n description:\n 'This entity is not referenced by any location and is therefore not receiving updates. Click here to delete.',\n },\n entityProcessingErrorsDescription: 'The error below originates from',\n entityRelationWarningDescription:\n \"This entity has relations to other entities, which can't be found in the catalog.\\n Entities not found are: \",\n hasComponentsCard: {\n title: 'Has components',\n emptyMessage: 'No component is part of this system',\n },\n hasResourcesCard: {\n title: 'Has resources',\n emptyMessage: 'No resource is part of this system',\n },\n hasSubcomponentsCard: {\n title: 'Has subcomponents',\n emptyMessage: 'No subcomponent is part of this component',\n },\n hasSubdomainsCard: {\n title: 'Has subdomains',\n emptyMessage: 'No subdomain is part of this domain',\n },\n hasSystemsCard: {\n title: 'Has systems',\n emptyMessage: 'No system is part of this domain',\n },\n relatedEntitiesCard: {\n emptyHelpLinkTitle: 'Learn how to change this',\n },\n systemDiagramCard: {\n title: 'System Diagram',\n description: 'Use pinch & zoom to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\n },\n },\n },\n});\n","/*\n * Copyright 2020 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 { RELATION_DEPENDS_ON, ComponentEntity } from '@backstage/catalog-model';\nimport {\n InfoCardVariants,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\nimport {\n asComponentEntities,\n componentEntityColumns,\n componentEntityHelpLink,\n RelatedEntitiesCard,\n} from '../RelatedEntitiesCard';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport interface DependsOnComponentsCardProps {\n variant?: InfoCardVariants;\n title?: string;\n columns?: TableColumn<ComponentEntity>[];\n tableOptions?: TableOptions;\n}\n\nexport function DependsOnComponentsCard(props: DependsOnComponentsCardProps) {\n const { t } = useTranslationRef(catalogTranslationRef);\n const {\n variant = 'gridItem',\n title = t('dependsOnComponentsCard.title'),\n columns = componentEntityColumns,\n tableOptions = {},\n } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Component\"\n relationType={RELATION_DEPENDS_ON}\n columns={columns}\n emptyMessage={t('dependsOnComponentsCard.emptyMessage')}\n emptyHelpLink={componentEntityHelpLink}\n asRenderableEntities={asComponentEntities}\n tableOptions={tableOptions}\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 { ResponseError } from '@backstage/errors';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Divider from '@material-ui/core/Divider';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { CodeSnippet } from '../CodeSnippet';\nimport { CopyTextButton } from '../CopyTextButton';\nimport { ErrorPanel, ErrorPanelProps } from '../ErrorPanel';\n\nexport type ResponseErrorPanelClassKey = 'text' | 'divider';\n\nconst useStyles = makeStyles(\n theme => ({\n text: {\n fontFamily: 'monospace',\n whiteSpace: 'pre',\n overflowX: 'auto',\n marginRight: theme.spacing(2),\n },\n divider: {\n margin: theme.spacing(2),\n },\n }),\n { name: 'BackstageResponseErrorPanel' },\n);\n\n/**\n * Renders a warning panel as the effect of a failed server request.\n *\n * @remarks\n * Has special treatment for ResponseError errors, to display rich\n * server-provided information about what happened.\n */\nexport function ResponseErrorPanel(props: ErrorPanelProps) {\n const { title, error, defaultExpanded } = props;\n const classes = useStyles();\n\n if (error.name !== 'ResponseError') {\n return (\n <ErrorPanel\n title={title ?? error.message}\n defaultExpanded={defaultExpanded}\n error={error}\n />\n );\n }\n\n const { body, cause } = error as ResponseError;\n const { request, response } = body;\n\n const errorString = `${response.statusCode}: ${cause.name}`;\n const requestString = request && `${request.method} ${request.url}`;\n const messageString = cause.message.replace(/\\\\n/g, '\\n');\n const stackString = cause.stack?.replace(/\\\\n/g, '\\n');\n const jsonString = JSON.stringify(body, undefined, 2);\n\n return (\n <ErrorPanel\n title={title ?? error.message}\n defaultExpanded={defaultExpanded}\n error={{ name: errorString, message: messageString, stack: stackString }}\n >\n {requestString && (\n <ListItem alignItems=\"flex-start\">\n <ListItemText\n classes={{ secondary: classes.text }}\n primary=\"Request\"\n secondary={request ? `${requestString}` : undefined}\n />\n <CopyTextButton text={requestString} />\n </ListItem>\n )}\n <>\n <Divider component=\"li\" className={classes.divider} />\n <ListItem alignItems=\"flex-start\">\n <ListItemText\n classes={{ secondary: classes.text }}\n primary=\"Full Error as JSON\"\n />\n </ListItem>\n <CodeSnippet language=\"json\" text={jsonString} showCopyCodeButton />\n </>\n </ErrorPanel>\n );\n}\n","/*\n * Copyright 2020 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 Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n ResponseErrorPanel,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\nimport {\n asComponentEntities,\n asDomainEntities,\n asResourceEntities,\n asSystemEntities,\n componentEntityColumns,\n componentEntityHelpLink,\n domainEntityColumns,\n domainEntityHelpLink,\n resourceEntityColumns,\n resourceEntityHelpLink,\n systemEntityColumns,\n systemEntityHelpLink,\n} from './presets';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type RelatedEntitiesCardProps<T extends Entity> = {\n variant?: InfoCardVariants;\n title: string;\n columns: TableColumn<T>[];\n entityKind?: string;\n relationType: string;\n emptyMessage: string;\n emptyHelpLink: string;\n asRenderableEntities: (entities: Entity[]) => T[];\n tableOptions?: TableOptions;\n};\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @public\n */\nexport const RelatedEntitiesCard = <T extends Entity>(\n props: RelatedEntitiesCardProps<T>,\n) => {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n tableOptions = {},\n } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error) {\n return (\n <InfoCard variant={variant} title={title}>\n <ResponseErrorPanel error={error} />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">{emptyMessage}</Typography>\n <Typography variant=\"body2\">\n <Link to={emptyHelpLink} externalLinkIcon>\n {t('relatedEntitiesCard.emptyHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={asRenderableEntities(entities || [])}\n tableOptions={tableOptions}\n />\n );\n};\n\nRelatedEntitiesCard.componentEntityColumns = componentEntityColumns;\nRelatedEntitiesCard.componentEntityHelpLink = componentEntityHelpLink;\nRelatedEntitiesCard.asComponentEntities = asComponentEntities;\nRelatedEntitiesCard.resourceEntityColumns = resourceEntityColumns;\nRelatedEntitiesCard.resourceEntityHelpLink = resourceEntityHelpLink;\nRelatedEntitiesCard.asResourceEntities = asResourceEntities;\nRelatedEntitiesCard.systemEntityColumns = systemEntityColumns;\nRelatedEntitiesCard.systemEntityHelpLink = systemEntityHelpLink;\nRelatedEntitiesCard.asSystemEntities = asSystemEntities;\nRelatedEntitiesCard.domainEntityColums = domainEntityColumns;\nRelatedEntitiesCard.domainEntityHelpLink = domainEntityHelpLink;\nRelatedEntitiesCard.asDomainEntities = asDomainEntities;\n","/*\n * Copyright 2020 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, parseEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogApiRef } from '../api';\n\n/**\n * Fetches all entities that appear in the entity's relations, optionally\n * filtered by relation type and kind.\n *\n * @public\n */\nexport function useRelatedEntities(\n entity: Entity,\n relationFilter: { type?: string; kind?: string },\n): {\n entities: Entity[] | undefined;\n loading: boolean;\n error: Error | undefined;\n} {\n const filterByTypeLower = relationFilter?.type?.toLocaleLowerCase('en-US');\n const filterByKindLower = relationFilter?.kind?.toLocaleLowerCase('en-US');\n const catalogApi = useApi(catalogApiRef);\n\n const {\n loading,\n value: entities,\n error,\n } = useAsync(async () => {\n const relations = entity.relations?.filter(\n r =>\n (!filterByTypeLower ||\n r.type.toLocaleLowerCase('en-US') === filterByTypeLower) &&\n (!filterByKindLower ||\n parseEntityRef(r.targetRef).kind === filterByKindLower),\n );\n\n if (!relations?.length) {\n return [];\n }\n\n const { items } = await catalogApi.getEntitiesByRefs({\n entityRefs: relations.map(r => r.targetRef),\n });\n\n return items.filter((x): x is Entity => Boolean(x));\n }, [entity, filterByTypeLower, filterByKindLower]);\n\n return {\n entities,\n loading,\n error,\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 */\nimport {\n ComponentEntity,\n DomainEntity,\n Entity,\n ResourceEntity,\n SystemEntity,\n} from '@backstage/catalog-model';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport { TableColumn } from '@backstage/core-components';\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities: Entity[]): ComponentEntity[] =>\n entities as ComponentEntity[];\n\nexport const resourceEntityColumns: TableColumn<ResourceEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities: Entity[]): ResourceEntity[] =>\n entities as ResourceEntity[];\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities: Entity[]): SystemEntity[] =>\n entities as SystemEntity[];\n\nexport const domainEntityColumns: TableColumn<DomainEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'domain' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const domainEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain';\nexport const asDomainEntities = (entities: Entity[]): DomainEntity[] =>\n entities as DomainEntity[];\n"],"names":["useStyles","makeStyles","line","OverflowTooltip","props","classes","Tooltip","Typography","theme","BottomLink","link","title","onClick","Box","Divider","Link","ArrowIcon","SlackLink","slackChannel","t","useTranslationRef","coreComponentsTranslationRef","LinkButton","ErrorBoundary","Component","undefined","error","errorInfo","console","children","ErrorPanel","CardActionsTopRight","withStyles","CardActions","InfoCard","subheader","divider","deepLink","errorBoundaryProps","variant","alignContent","headerStyle","headerProps","icon","action","actionsClassName","actions","cardClassName","actionsTopRight","className","noPadding","titleTypographyProps","subheaderTypographyProps","calculatedStyle","calculatedCardStyle","variants","name","VARIANT_STYLES","Card","CardHeader","classNames","CardContent","columnFactories","Object","options","defaultKind","formatContent","entity","humanizeEntityRef","EntityTableColumnTitle","filter","entity1","entity2","EntityRefLink","relation","entityFilter","getRelations","getEntityRelations","r","EntityRefLinks","RELATION_OWNED_BY","RELATION_PART_OF","systemEntityColumns","componentEntityColumns","EntityTable","entities","emptyContent","columns","tableOptions","tableStyle","Table","translationKey","catalogReactTranslationRef","NewEntityContext","createVersionedContext","AsyncEntityProvider","loading","refresh","createVersionedValueMap","AnalyticsContext","stringifyEntityRef","useEntity","versionedHolder","useVersionedContext","Error","value","useAsyncEntity","catalogTranslationRef","createTranslationRef","DependsOnComponentsCard","RelatedEntitiesCard","RELATION_DEPENDS_ON","componentEntityHelpLink","asComponentEntities","ResponseErrorPanel","defaultExpanded","body","cause","request","response","errorString","requestString","messageString","stackString","jsonString","JSON","ListItem","ListItemText","CopyTextButton","CodeSnippet","entityKind","relationType","emptyMessage","emptyHelpLink","asRenderableEntities","useRelatedEntities","relationFilter","filterByTypeLower","filterByKindLower","catalogApi","useApi","catalogApiRef","useAsync","relations","parseEntityRef","items","x","Boolean","Progress","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities","systemEntityHelpLink","asSystemEntities","domainEntityColumns","domainEntityHelpLink","asDomainEntities"],"mappings":"sIAEA,IAAI,EAAyB,EAAQ,MAEjC,EAA0B,EAAQ,MAKtC,UAAe,CAAG,KAAK,EAEvB,IAAI,EAAQ,EAAwB,EAAQ,OAQ5C,UAAe,CAJA,AAAC,GAAG,AAFE,EAAuB,EAAQ,QAElB,OAAO,AAAD,EAAiB,EAAM,aAAa,CAAC,OAAQ,CACnF,EAAG,2DACL,GAAI,e,gFCaJ,IAAMA,EAAYC,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,EAChB,CACE,UAAW,CACT,SAAU,oBACZ,EACA,KAAM,CACJ,SAAU,UACV,SAAU,SACV,aAAc,WACd,QAAS,cACT,qBAAsB,CAAC,CAAEC,KAAAA,CAAI,CAAS,GAAKA,GAAQ,EACnD,qBAAsB,UACxB,CACF,EACA,CAAE,KAAM,0BAA2B,GAG9B,SAASC,EAAgBC,CAAY,EAC1C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CAAAA,OAAAA,CAAAA,iBAAqC,GACrCA,EAAAA,CAAAA,CAAAA,OAAAA,CAAAA,+BAAmD,GACpD,CACYoE,EACX,oFACWC,EAAmB,AAACpE,GAC/BA,EAEWqE,EAAmD,CAC9DtE,EAAAA,CAAAA,CAAAA,OAAAA,CAAAA,qBAAyC,CAAC,CAAE,YAAa,QAAS,GAClEA,EAAAA,CAAAA,CAAAA,OAAAA,CAAAA,iBAAqC,GACrCA,EAAAA,CAAAA,CAAAA,OAAAA,CAAAA,+BAAmD,GACpD,CACYuE,EACX,oFACWC,EAAmB,AAACvE,GAC/BA,C"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["1994"],{52235(e,t,n){var i=n(4293),a=n(78920);t.default=void 0;var o=a(n(14041));t.default=(0,i(n(74044)).default)(o.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward")},98557(e,t,n){n.d(t,{M:()=>l});var i=n(31085),a=n(58837),o=n(71677),s=n(72501);let r=(0,a.A)({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=r(e);return(0,i.jsx)(o.Ay,{title:e.title??(e.text||""),placement:e.placement,classes:e.tooltipClasses,children:(0,i.jsx)(s.A,{className:t.typo,variant:"inherit",children:e.text})})}},89439(e,t,n){n.d(t,{n:()=>R});var i=n(31085),a=n(40703),o=n(59469),s=n(48653),r=n(45685),l=n(37197),c=n(58837),d=n(24568),m=n(53373),u=n.n(m),p=n(9720),y=n(72501),h=n(52235),f=n(60603);let g=(0,c.A)(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.A,{children:[(0,i.jsx)(l.A,{}),(0,i.jsx)(f.N_,{to:t,onClick:a,underline:"none",children:(0,i.jsxs)(p.A,{display:"flex",alignItems:"center",className:o.root,children:[(0,i.jsx)(p.A,{className:o.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,i.jsx)(y.A,{children:(0,i.jsx)("strong",{children:n})})}),(0,i.jsx)(h.default,{className:o.arrow})]})})]})}var C=n(14041),b=n(45463),v=n(60691),j=n(89332),w=n(89595);let E=e=>{let{slackChannel:t}=e,{t:n}=(0,w.i)(j.O);return t?"string"==typeof t?(0,i.jsx)(y.A,{children:n("errorBoundary.title",{slackChannel:t})}):t.href?(0,i.jsx)(b.z,{to:t.href,variant:"contained",children:t.name}):(0,i.jsx)(y.A,{children:n("errorBoundary.title",{slackChannel:t.name})}):null},A=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.b,{title:"Something Went Wrong",error:n,children:(0,i.jsx)(E,{slackChannel:e})}):t}},T=(0,c.A)(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"}),k=(0,d.A)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(o.A),S={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"}}},L={fullHeight:{flex:1},gridItem:{flex:1}};function R(e){let{title:t,subheader:n,divider:c=!0,deepLink:d,slackChannel:m,errorBoundaryProps:p,variant:y,alignContent:h="normal",children:f,headerStyle:g,headerProps:C,icon:b,action:v,actionsClassName:j,actions:w,cardClassName:E,actionsTopRight:R,className:M,noPadding:N,titleTypographyProps:B,subheaderTypographyProps:O}=e,D=T(),K={},I={};return y&&y.split(/[\s]+/g).forEach(e=>{K={...K,...S[e]},I={...I,...L[e]}}),(0,i.jsx)(a.A,{style:K,className:M,children:(0,i.jsxs)(A,{...p||(m?{slackChannel:m}:{}),children:[t&&(0,i.jsx)(r.A,{classes:{root:u()(D.header),title:D.headerTitle,subheader:D.headerSubheader,avatar:D.headerAvatar,action:D.headerAction,content:D.headerContent},title:t,subheader:n||b?(0,i.jsxs)("div",{"data-testid":"info-card-subheader",children:[n&&(0,i.jsx)("div",{className:D.subheader,children:n}),b]}):null,action:v,style:{...g},titleTypographyProps:B,subheaderTypographyProps:O,...C}),R&&(0,i.jsx)(k,{children:R}),c&&(0,i.jsx)(l.A,{}),(0,i.jsx)(s.A,{className:u()(E,{[D.noPadding]:N,[D.contentAlignBottom]:"bottom"===h}),style:I,children:f}),w&&(0,i.jsx)(o.A,{className:j,children:w}),d&&(0,i.jsx)(x,{...d})]})})}},65671(e,t,n){n.d(t,{s:()=>g});var i=n(31085),a=n(58837),o=n(96403),s=n(98557),r=n(53320),l=n(7537),c=n(76025),d=n(53987),m=n(19857);let u=Object.freeze({createEntityRefColumn(e){let{defaultKind:t}=e;function n(e){return e.metadata?.title||(0,l.S)(e,{defaultKind:t})}return{title:(0,i.jsx)(m.g,{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.z,{entityRef:e,defaultKind:t,title:e.metadata?.title})}},createEntityRelationColumn(e){let{title:t,relation:n,defaultKind:a,filter:o}=e;function s(e){return(0,r.t)(e,n,o)}function c(e){return s(e).map(e=>(0,l.S)(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.i,{entityRefs:s(e),defaultKind:a})}},createOwnerColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"owner"}),relation:o.vv,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"domain"}),relation:o.jn,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"system"}),relation:o.jn,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"description"}),field:"metadata.description",render:e=>(0,i.jsx)(s.M,{text:e.metadata.description,placement:"bottom-start",line:2})}),createSpecLifecycleColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"lifecycle"}),field:"spec.lifecycle"}),createSpecTypeColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"type"}),field:"spec.type"})}),p=[u.createEntityRefColumn({defaultKind:"system"}),u.createDomainColumn(),u.createOwnerColumn(),u.createMetadataDescriptionColumn()],y=[u.createEntityRefColumn({defaultKind:"component"}),u.createSystemColumn(),u.createOwnerColumn(),u.createSpecTypeColumn(),u.createSpecLifecycleColumn(),u.createMetadataDescriptionColumn()];var h=n(28499);let f=(0,a.A)(e=>({empty:{padding:e.spacing(2),display:"flex",justifyContent:"center"}})),g=e=>{let{entities:t,title:n,emptyContent:a,variant:o="gridItem",columns:s,tableOptions:r={}}=e,l=f(),c={minWidth:"0",width:"100%"};return"gridItem"===o&&(c.height="calc(100% - 10px)"),(0,i.jsx)(h.X,{columns:s,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,...r},data:t})};g.columns=u,g.systemEntityColumns=p,g.componentEntityColumns=y},19857(e,t,n){n.d(t,{g:()=>o});var i=n(89595),a=n(79811);let o=({translationKey:e})=>{let{t}=(0,i.i)(a.j);return t(`entityTableColumnTitle.${e}`)}},22845(e,t,n){n.d(t,{T7:()=>c,TY:()=>m,tN:()=>d});var i=n(31085),a=n(58077),o=n(92829),s=n(9135),r=n(20549);let l=(0,s.tK)("entity-context"),c=e=>{let{children:t,entity:n,loading:s,error:c,refresh:d}=e;return(0,i.jsx)(l.Provider,{value:(0,r.B)({1:{entity:n,loading:s,error:c,refresh:d}}),children:(0,i.jsx)(o.Ig,{attributes:{...n?{entityRef:(0,a.U2)(n)}:void 0},children:t})})};function d(){let e=(0,s.qO)("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 m(){let e=(0,s.qO)("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}}},50010(e,t,n){n.d(t,{W:()=>i});let i=(0,n(97386).h)({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"}}}})},385(e,t,n){n.d(t,{HasSubcomponentsCard:()=>c});var i=n(31085),a=n(96403),o=n(79842),s=n(44849),r=n(50010),l=n(89595);function c(e){let{t}=(0,l.i)(r.W),{variant:n="gridItem",title:c=t("hasSubcomponentsCard.title"),columns:d=o.mz,tableOptions:m={},kind:u="Component"}=e;return(0,i.jsx)(s.p,{variant:n,title:c,entityKind:u,relationType:a.sA,columns:d,asRenderableEntities:o.xJ,emptyMessage:t("hasSubcomponentsCard.emptyMessage"),emptyHelpLink:"https://backstage.io/docs/features/software-catalog/descriptor-format#specsubcomponentof-optional",tableOptions:m})}},44849(e,t,n){n.d(t,{p:()=>T});var i=n(31085),a=n(72501),o=n(22845),s=n(58077),r=n(50509),l=n(73466),c=n(76272),d=n(65671),m=n(89439),u=n(55489),p=n(58837),y=n(37197),h=n(8109),f=n(5951),g=n(4809),x=n(55555),C=n(60691);let b=(0,p.A)(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.b,{title:t??n.message,defaultExpanded:a,error:n});let{body:s,cause:r}=n,{request:l,response:c}=s,d=`${c.statusCode}: ${r.name}`,m=l&&`${l.method} ${l.url}`,u=r.message.replace(/\\n/g,"\n"),p=r.stack?.replace(/\\n/g,"\n"),v=JSON.stringify(s,void 0,2);return(0,i.jsxs)(C.b,{title:t??n.message,defaultExpanded:a,error:{name:d,message:u,stack:p},children:[m&&(0,i.jsxs)(h.A,{alignItems:"flex-start",children:[(0,i.jsx)(f.A,{classes:{secondary:o.text},primary:"Request",secondary:l?`${m}`:void 0}),(0,i.jsx)(x.l,{text:m})]}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y.A,{component:"li",className:o.divider}),(0,i.jsx)(h.A,{alignItems:"flex-start",children:(0,i.jsx)(f.A,{classes:{secondary:o.text},primary:"Full Error as JSON"})}),(0,i.jsx)(g.z,{language:"json",text:v,showCopyCodeButton:!0})]})]})}var j=n(60603),w=n(79842),E=n(50010),A=n(89595);let T=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,A.i)(E.W),{entity:w}=(0,o.tN)(),{entities:T,loading:k,error:S}=function(e,t){let n=t?.type?.toLocaleLowerCase("en-US"),i=t?.kind?.toLocaleLowerCase("en-US"),a=(0,r.gf)(c.v),{loading:o,value:d,error:m}=(0,l.A)(async()=>{let t=e.relations?.filter(e=>(!n||e.type.toLocaleLowerCase("en-US")===n)&&(!i||(0,s.KU)(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:m}}(w,{type:h,kind:y});return k?(0,i.jsx)(m.n,{variant:t,title:n,children:(0,i.jsx)(u.k,{})}):S?(0,i.jsx)(m.n,{variant:t,title:n,children:(0,i.jsx)(v,{error:S})}):(0,i.jsx)(d.s,{title:n,variant:t,emptyContent:(0,i.jsxs)("div",{style:{textAlign:"center"},children:[(0,i.jsx)(a.A,{variant:"body1",children:f}),(0,i.jsx)(a.A,{variant:"body2",children:(0,i.jsx)(j.N_,{to:g,externalLinkIcon:!0,children:b("relatedEntitiesCard.emptyHelpLinkTitle")})})]}),columns:p,entities:x(T||[]),tableOptions:C})};T.componentEntityColumns=w.mz,T.componentEntityHelpLink=w.e2,T.asComponentEntities=w.xJ,T.resourceEntityColumns=w.v9,T.resourceEntityHelpLink=w.nz,T.asResourceEntities=w.eB,T.systemEntityColumns=w.MW,T.systemEntityHelpLink=w.iU,T.asSystemEntities=w.vy,T.domainEntityColums=w.xO,T.domainEntityHelpLink=w.Xr,T.asDomainEntities=w.QS},79842(e,t,n){n.d(t,{MW:()=>d,QS:()=>h,Xr:()=>y,e2:()=>o,eB:()=>c,iU:()=>m,mz:()=>a,nz:()=>l,v9:()=>r,vy:()=>u,xJ:()=>s,xO:()=>p});var i=n(65671);let a=[i.s.columns.createEntityRefColumn({defaultKind:"component"}),i.s.columns.createOwnerColumn(),i.s.columns.createSpecTypeColumn(),i.s.columns.createSpecLifecycleColumn(),i.s.columns.createMetadataDescriptionColumn()],o="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",s=e=>e,r=[i.s.columns.createEntityRefColumn({defaultKind:"resource"}),i.s.columns.createOwnerColumn(),i.s.columns.createSpecTypeColumn(),i.s.columns.createSpecLifecycleColumn(),i.s.columns.createMetadataDescriptionColumn()],l="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",c=e=>e,d=[i.s.columns.createEntityRefColumn({defaultKind:"system"}),i.s.columns.createOwnerColumn(),i.s.columns.createMetadataDescriptionColumn()],m="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",u=e=>e,p=[i.s.columns.createEntityRefColumn({defaultKind:"domain"}),i.s.columns.createOwnerColumn(),i.s.columns.createMetadataDescriptionColumn()],y="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain",h=e=>e}}]);
|
|
2
|
-
//# sourceMappingURL=1994.10e5e0a5.chunk.js.map
|