@backstage/plugin-catalog-unprocessed-entities 0.1.0-next.2 → 0.1.0
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 +16 -0
- package/dist/esm/{UnprocessedEntities-16922014.esm.js → UnprocessedEntities-1031f5ca.esm.js} +2 -2
- package/dist/esm/{UnprocessedEntities-16922014.esm.js.map → UnprocessedEntities-1031f5ca.esm.js.map} +1 -1
- package/dist/esm/{index-a9a60a39.esm.js → index-afbab918.esm.js} +8 -7
- package/dist/esm/index-afbab918.esm.js.map +1 -0
- package/dist/index.esm.js +1 -1
- package/package.json +10 -11
- package/dist/esm/index-a9a60a39.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-unprocessed-entities
|
|
2
2
|
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d44fcd9829c2: Added a new plugin to expose entities which are unprocessed or have errors processing
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 493eab8c577f: Use FetchApi instead of native fetch
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/core-plugin-api@1.5.2
|
|
14
|
+
- @backstage/core-components@0.13.2
|
|
15
|
+
- @backstage/theme@0.4.0
|
|
16
|
+
- @backstage/catalog-model@1.4.0
|
|
17
|
+
- @backstage/errors@1.2.0
|
|
18
|
+
|
|
3
19
|
## 0.1.0-next.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/esm/{UnprocessedEntities-16922014.esm.js → UnprocessedEntities-1031f5ca.esm.js}
RENAMED
|
@@ -10,7 +10,7 @@ import IconButton from '@material-ui/core/IconButton';
|
|
|
10
10
|
import { makeStyles, createStyles } from '@material-ui/core/styles';
|
|
11
11
|
import CloseIcon from '@material-ui/icons/Close';
|
|
12
12
|
import DescriptionIcon from '@material-ui/icons/Description';
|
|
13
|
-
import { c as catalogUnprocessedEntitiesApiRef } from './index-
|
|
13
|
+
import { c as catalogUnprocessedEntitiesApiRef } from './index-afbab918.esm.js';
|
|
14
14
|
import useAsync from 'react-use/lib/useAsync';
|
|
15
15
|
import '@backstage/errors';
|
|
16
16
|
|
|
@@ -215,4 +215,4 @@ const UnprocessedEntities = () => {
|
|
|
215
215
|
};
|
|
216
216
|
|
|
217
217
|
export { UnprocessedEntities, UnprocessedEntitiesContent };
|
|
218
|
-
//# sourceMappingURL=UnprocessedEntities-
|
|
218
|
+
//# sourceMappingURL=UnprocessedEntities-1031f5ca.esm.js.map
|
package/dist/esm/{UnprocessedEntities-16922014.esm.js.map → UnprocessedEntities-1031f5ca.esm.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnprocessedEntities-16922014.esm.js","sources":["../../src/components/EntityDialog.tsx","../../src/components/FailedEntities.tsx","../../src/components/PendingEntities.tsx","../../src/components/UnprocessedEntities.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 */\nimport React, { useState } from 'react';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport IconButton from '@material-ui/core/IconButton';\nimport { makeStyles, createStyles, Theme } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport DescriptionIcon from '@material-ui/icons/Description';\n\nimport { UnprocessedEntity } from './../types';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n entity: {\n overflow: 'scroll',\n width: '100%',\n },\n codeBox: {\n border: '1px solid black',\n padding: '1em',\n },\n }),\n);\n\nexport const EntityDialog = ({ entity }: { entity: UnprocessedEntity }) => {\n const [open, setOpen] = useState(false);\n const classes = useStyles();\n\n const openDialog = () => {\n setOpen(true);\n };\n\n const closeDialog = () => {\n setOpen(false);\n };\n\n const dialogContent = () => {\n return (\n <CodeSnippet\n language=\"json\"\n showLineNumbers\n text={JSON.stringify(entity, null, 4)}\n />\n );\n };\n\n return (\n <>\n <IconButton color=\"primary\" onClick={openDialog}>\n <DescriptionIcon />\n </IconButton>\n <Dialog fullWidth open={open} onClose={closeDialog}>\n <DialogTitle id=\"dialog-title\">\n <IconButton\n aria-label=\"close\"\n className={classes.closeButton}\n onClick={closeDialog}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent>{dialogContent()}</DialogContent>\n </Dialog>\n </>\n );\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 */\nimport React from 'react';\n\nimport {\n ErrorPanel,\n MarkdownContent,\n Progress,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { BackstageThemeOptions } from '@backstage/theme';\nimport { Box, Typography, makeStyles } from '@material-ui/core';\n\nimport { UnprocessedEntity } from '../types';\nimport { EntityDialog } from './EntityDialog';\nimport { catalogUnprocessedEntitiesApiRef } from '../api';\nimport useAsync from 'react-use/lib/useAsync';\n\nconst useStyles = makeStyles((theme: BackstageThemeOptions) => ({\n errorBox: {\n color: theme.palette.status.error,\n backgroundColor: theme.palette.errorBackground,\n padding: '1em',\n margin: '1em',\n border: `1px solid ${theme.palette.status.error}`,\n },\n errorTitle: {\n width: '100%',\n fontWeight: 'bold',\n },\n successMessage: {\n background: theme.palette.infoBackground,\n color: theme.palette.infoText,\n },\n}));\n\nconst RenderErrorContext = ({\n error,\n rowData,\n}: {\n error: { message: string };\n rowData: UnprocessedEntity;\n}) => {\n if (error.message.includes('tags.')) {\n return (\n <>\n <Typography>Tags</Typography>\n <ul>\n {rowData.unprocessed_entity.metadata.tags?.map(t => (\n <li>{t}</li>\n ))}\n </ul>\n </>\n );\n }\n\n if (error.message.includes('metadata.name')) {\n return (\n <>\n <Typography>Name</Typography>\n <Typography variant=\"caption\">\n {rowData.unprocessed_entity.metadata.name}\n </Typography>\n </>\n );\n }\n\n return null;\n};\n\nexport const FailedEntities = () => {\n const classes = useStyles();\n const unprocessedApi = useApi(catalogUnprocessedEntitiesApiRef);\n const {\n loading,\n error,\n value: data,\n } = useAsync(async () => await unprocessedApi.failed());\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const columns: TableColumn[] = [\n {\n title: <Typography>entityRef</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).entity_ref,\n },\n {\n title: <Typography>Kind</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.kind,\n },\n {\n title: <Typography>Owner</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.spec?.owner ||\n 'unknown',\n },\n {\n title: <Typography>Raw</Typography>,\n render: (rowData: UnprocessedEntity | {}) => (\n <EntityDialog entity={rowData as UnprocessedEntity} />\n ),\n },\n ];\n return (\n <>\n <Table\n options={{ pageSize: 40, search: true }}\n columns={columns}\n data={data?.entities || []}\n emptyContent={\n <Typography className={classes.successMessage}>\n No failed entities found\n </Typography>\n }\n detailPanel={({ rowData }) => {\n const errors = (rowData as UnprocessedEntity).errors;\n return (\n <>\n {errors?.map(e => {\n return (\n <Box className={classes.errorBox}>\n <Typography className={classes.errorTitle}>\n {e.name}\n </Typography>\n <MarkdownContent content={e.message} />\n <RenderErrorContext\n error={e}\n rowData={rowData as UnprocessedEntity}\n />\n </Box>\n );\n })}\n </>\n );\n }}\n />\n </>\n );\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 */\nimport React from 'react';\n\nimport {\n ErrorPanel,\n Progress,\n TableColumn,\n Table,\n} from '@backstage/core-components';\nimport { Typography, makeStyles } from '@material-ui/core';\n\nimport { UnprocessedEntity } from '../types';\n\nimport { EntityDialog } from './EntityDialog';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { catalogUnprocessedEntitiesApiRef } from '../api';\nimport { BackstageTheme } from '@backstage/theme';\n\nconst useStyles = makeStyles((theme: BackstageTheme) => ({\n successMessage: {\n background: theme.palette.infoBackground,\n color: theme.palette.infoText,\n padding: theme.spacing(2),\n },\n}));\n\nexport const PendingEntities = () => {\n const classes = useStyles();\n const unprocessedApi = useApi(catalogUnprocessedEntitiesApiRef);\n const {\n loading,\n error,\n value: data,\n } = useAsync(async () => await unprocessedApi.pending());\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const columns: TableColumn[] = [\n {\n title: <Typography>entityRef</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).entity_ref,\n },\n {\n title: <Typography>Kind</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.kind,\n },\n {\n title: <Typography>Owner</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.spec?.owner ||\n 'unknown',\n },\n {\n title: <Typography>Raw</Typography>,\n render: (rowData: UnprocessedEntity | {}) => (\n <EntityDialog entity={rowData as UnprocessedEntity} />\n ),\n },\n ];\n return (\n <>\n <Table\n options={{ pageSize: 40 }}\n columns={columns}\n data={data?.entities || []}\n emptyContent={\n <Typography className={classes.successMessage}>\n No pending entities found\n </Typography>\n }\n />\n </>\n );\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 */\nimport React, { useState } from 'react';\n\nimport { Page, Header, Content } from '@backstage/core-components';\nimport { Tab } from '@material-ui/core';\nimport { TabContext, TabList, TabPanel } from '@material-ui/lab';\n\nimport { FailedEntities } from './FailedEntities';\nimport { PendingEntities } from './PendingEntities';\n\nexport const UnprocessedEntitiesContent = () => {\n const [tab, setTab] = useState('failed');\n const handleChange = (_event: React.ChangeEvent<{}>, tabValue: string) => {\n setTab(tabValue);\n };\n\n return (\n <Content>\n <TabContext value={tab}>\n <TabList onChange={handleChange}>\n <Tab label=\"Failed\" value=\"failed\" />\n <Tab label=\"Pending\" value=\"pending\" />\n </TabList>\n <TabPanel value=\"failed\">\n <FailedEntities />\n </TabPanel>\n <TabPanel value=\"pending\">\n <PendingEntities />\n </TabPanel>\n </TabContext>\n </Content>\n );\n};\n\nexport const UnprocessedEntities = () => {\n return (\n <Page themeId=\"tool\">\n <Header title=\"Unprocessed Entitites\" />\n <UnprocessedEntitiesContent />\n </Page>\n );\n};\n"],"names":["useStyles","makeStyles"],"mappings":";;;;;;;;;;;;;;;;AA4BA,MAAMA,WAAY,GAAA,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAa,CAAA;AAAA,IACX,WAAa,EAAA;AAAA,MACX,QAAU,EAAA,UAAA;AAAA,MACV,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACtB,GAAA,EAAK,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACpB,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAA;AAAA,KAC/B;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA,QAAA;AAAA,MACV,KAAO,EAAA,MAAA;AAAA,KACT;AAAA,IACA,OAAS,EAAA;AAAA,MACP,MAAQ,EAAA,iBAAA;AAAA,MACR,OAAS,EAAA,KAAA;AAAA,KACX;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAEO,MAAM,YAAe,GAAA,CAAC,EAAE,MAAA,EAA4C,KAAA;AACzE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AACtC,EAAA,MAAM,UAAUA,WAAU,EAAA,CAAA;AAE1B,EAAA,MAAM,aAAa,MAAM;AACvB,IAAA,OAAA,CAAQ,IAAI,CAAA,CAAA;AAAA,GACd,CAAA;AAEA,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,OAAA,CAAQ,KAAK,CAAA,CAAA;AAAA,GACf,CAAA;AAEA,EAAA,MAAM,gBAAgB,MAAM;AAC1B,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,QAAS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AAA,2CACG,OACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,KAAO,EAAA,GAAA,EAAA,sCAChB,OAAQ,EAAA,EAAA,QAAA,EAAU,YACjB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,KAAM,EAAA,QAAA,EAAS,OAAM,QAAS,EAAA,CAAA,sCAClC,GAAI,EAAA,EAAA,KAAA,EAAM,SAAU,EAAA,KAAA,EAAM,WAAU,CACvC,CAAA,sCACC,QAAS,EAAA,EAAA,KAAA,EAAM,4BACb,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,IAAe,CAClB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,YAAS,KAAM,EAAA,SAAA,EAAA,sCACb,eAAgB,EAAA,IAAA,CACnB,CACF,CACF,CAAA,CAAA;AAEJ,EAAA;AAEO,MAAM,sBAAsB,MAAM;AACvC,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,MAAO,EAAA,EAAA,KAAA,EAAM,uBAAwB,EAAA,CAAA,kBACrC,KAAA,CAAA,aAAA,CAAA,0BAAA,EAAA,IAA2B,CAC9B,CAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"UnprocessedEntities-1031f5ca.esm.js","sources":["../../src/components/EntityDialog.tsx","../../src/components/FailedEntities.tsx","../../src/components/PendingEntities.tsx","../../src/components/UnprocessedEntities.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 */\nimport React, { useState } from 'react';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport IconButton from '@material-ui/core/IconButton';\nimport { makeStyles, createStyles, Theme } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport DescriptionIcon from '@material-ui/icons/Description';\n\nimport { UnprocessedEntity } from './../types';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n entity: {\n overflow: 'scroll',\n width: '100%',\n },\n codeBox: {\n border: '1px solid black',\n padding: '1em',\n },\n }),\n);\n\nexport const EntityDialog = ({ entity }: { entity: UnprocessedEntity }) => {\n const [open, setOpen] = useState(false);\n const classes = useStyles();\n\n const openDialog = () => {\n setOpen(true);\n };\n\n const closeDialog = () => {\n setOpen(false);\n };\n\n const dialogContent = () => {\n return (\n <CodeSnippet\n language=\"json\"\n showLineNumbers\n text={JSON.stringify(entity, null, 4)}\n />\n );\n };\n\n return (\n <>\n <IconButton color=\"primary\" onClick={openDialog}>\n <DescriptionIcon />\n </IconButton>\n <Dialog fullWidth open={open} onClose={closeDialog}>\n <DialogTitle id=\"dialog-title\">\n <IconButton\n aria-label=\"close\"\n className={classes.closeButton}\n onClick={closeDialog}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent>{dialogContent()}</DialogContent>\n </Dialog>\n </>\n );\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 */\nimport React from 'react';\n\nimport {\n ErrorPanel,\n MarkdownContent,\n Progress,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { BackstageThemeOptions } from '@backstage/theme';\nimport { Box, Typography, makeStyles } from '@material-ui/core';\n\nimport { UnprocessedEntity } from '../types';\nimport { EntityDialog } from './EntityDialog';\nimport { catalogUnprocessedEntitiesApiRef } from '../api';\nimport useAsync from 'react-use/lib/useAsync';\n\nconst useStyles = makeStyles((theme: BackstageThemeOptions) => ({\n errorBox: {\n color: theme.palette.status.error,\n backgroundColor: theme.palette.errorBackground,\n padding: '1em',\n margin: '1em',\n border: `1px solid ${theme.palette.status.error}`,\n },\n errorTitle: {\n width: '100%',\n fontWeight: 'bold',\n },\n successMessage: {\n background: theme.palette.infoBackground,\n color: theme.palette.infoText,\n },\n}));\n\nconst RenderErrorContext = ({\n error,\n rowData,\n}: {\n error: { message: string };\n rowData: UnprocessedEntity;\n}) => {\n if (error.message.includes('tags.')) {\n return (\n <>\n <Typography>Tags</Typography>\n <ul>\n {rowData.unprocessed_entity.metadata.tags?.map(t => (\n <li>{t}</li>\n ))}\n </ul>\n </>\n );\n }\n\n if (error.message.includes('metadata.name')) {\n return (\n <>\n <Typography>Name</Typography>\n <Typography variant=\"caption\">\n {rowData.unprocessed_entity.metadata.name}\n </Typography>\n </>\n );\n }\n\n return null;\n};\n\nexport const FailedEntities = () => {\n const classes = useStyles();\n const unprocessedApi = useApi(catalogUnprocessedEntitiesApiRef);\n const {\n loading,\n error,\n value: data,\n } = useAsync(async () => await unprocessedApi.failed());\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const columns: TableColumn[] = [\n {\n title: <Typography>entityRef</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).entity_ref,\n },\n {\n title: <Typography>Kind</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.kind,\n },\n {\n title: <Typography>Owner</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.spec?.owner ||\n 'unknown',\n },\n {\n title: <Typography>Raw</Typography>,\n render: (rowData: UnprocessedEntity | {}) => (\n <EntityDialog entity={rowData as UnprocessedEntity} />\n ),\n },\n ];\n return (\n <>\n <Table\n options={{ pageSize: 40, search: true }}\n columns={columns}\n data={data?.entities || []}\n emptyContent={\n <Typography className={classes.successMessage}>\n No failed entities found\n </Typography>\n }\n detailPanel={({ rowData }) => {\n const errors = (rowData as UnprocessedEntity).errors;\n return (\n <>\n {errors?.map(e => {\n return (\n <Box className={classes.errorBox}>\n <Typography className={classes.errorTitle}>\n {e.name}\n </Typography>\n <MarkdownContent content={e.message} />\n <RenderErrorContext\n error={e}\n rowData={rowData as UnprocessedEntity}\n />\n </Box>\n );\n })}\n </>\n );\n }}\n />\n </>\n );\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 */\nimport React from 'react';\n\nimport {\n ErrorPanel,\n Progress,\n TableColumn,\n Table,\n} from '@backstage/core-components';\nimport { Typography, makeStyles } from '@material-ui/core';\n\nimport { UnprocessedEntity } from '../types';\n\nimport { EntityDialog } from './EntityDialog';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { catalogUnprocessedEntitiesApiRef } from '../api';\nimport { BackstageTheme } from '@backstage/theme';\n\nconst useStyles = makeStyles((theme: BackstageTheme) => ({\n successMessage: {\n background: theme.palette.infoBackground,\n color: theme.palette.infoText,\n padding: theme.spacing(2),\n },\n}));\n\nexport const PendingEntities = () => {\n const classes = useStyles();\n const unprocessedApi = useApi(catalogUnprocessedEntitiesApiRef);\n const {\n loading,\n error,\n value: data,\n } = useAsync(async () => await unprocessedApi.pending());\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const columns: TableColumn[] = [\n {\n title: <Typography>entityRef</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).entity_ref,\n },\n {\n title: <Typography>Kind</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.kind,\n },\n {\n title: <Typography>Owner</Typography>,\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.spec?.owner ||\n 'unknown',\n },\n {\n title: <Typography>Raw</Typography>,\n render: (rowData: UnprocessedEntity | {}) => (\n <EntityDialog entity={rowData as UnprocessedEntity} />\n ),\n },\n ];\n return (\n <>\n <Table\n options={{ pageSize: 40 }}\n columns={columns}\n data={data?.entities || []}\n emptyContent={\n <Typography className={classes.successMessage}>\n No pending entities found\n </Typography>\n }\n />\n </>\n );\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 */\nimport React, { useState } from 'react';\n\nimport { Page, Header, Content } from '@backstage/core-components';\nimport { Tab } from '@material-ui/core';\nimport { TabContext, TabList, TabPanel } from '@material-ui/lab';\n\nimport { FailedEntities } from './FailedEntities';\nimport { PendingEntities } from './PendingEntities';\n\nexport const UnprocessedEntitiesContent = () => {\n const [tab, setTab] = useState('failed');\n const handleChange = (_event: React.ChangeEvent<{}>, tabValue: string) => {\n setTab(tabValue);\n };\n\n return (\n <Content>\n <TabContext value={tab}>\n <TabList onChange={handleChange}>\n <Tab label=\"Failed\" value=\"failed\" />\n <Tab label=\"Pending\" value=\"pending\" />\n </TabList>\n <TabPanel value=\"failed\">\n <FailedEntities />\n </TabPanel>\n <TabPanel value=\"pending\">\n <PendingEntities />\n </TabPanel>\n </TabContext>\n </Content>\n );\n};\n\nexport const UnprocessedEntities = () => {\n return (\n <Page themeId=\"tool\">\n <Header title=\"Unprocessed Entitites\" />\n <UnprocessedEntitiesContent />\n </Page>\n );\n};\n"],"names":["useStyles","makeStyles"],"mappings":";;;;;;;;;;;;;;;;AA4BA,MAAMA,WAAY,GAAA,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAa,CAAA;AAAA,IACX,WAAa,EAAA;AAAA,MACX,QAAU,EAAA,UAAA;AAAA,MACV,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACtB,GAAA,EAAK,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACpB,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAA;AAAA,KAC/B;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA,QAAA;AAAA,MACV,KAAO,EAAA,MAAA;AAAA,KACT;AAAA,IACA,OAAS,EAAA;AAAA,MACP,MAAQ,EAAA,iBAAA;AAAA,MACR,OAAS,EAAA,KAAA;AAAA,KACX;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAEO,MAAM,YAAe,GAAA,CAAC,EAAE,MAAA,EAA4C,KAAA;AACzE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AACtC,EAAA,MAAM,UAAUA,WAAU,EAAA,CAA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/C,CAAA;AAAA,KAAA;AAAA,GAGN,CAAA,CAAA;AAEJ,CAAA;;ACvEO,MAAM,6BAA6B,MAAM;AAC9C,EAAA,MAAM,CAAC,GAAA,EAAK,MAAM,CAAA,GAAI,SAAS,QAAQ,CAAA,CAAA;AACvC,EAAM,MAAA,YAAA,GAAe,CAAC,MAAA,EAA+B,QAAqB,KAAA;AACxE,IAAA,MAAA,CAAO,QAAQ,CAAA,CAAA;AAAA,GACjB,CAAA;AAEA,EAAA,2CACG,OACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,KAAO,EAAA,GAAA,EAAA,sCAChB,OAAQ,EAAA,EAAA,QAAA,EAAU,YACjB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,KAAM,EAAA,QAAA,EAAS,OAAM,QAAS,EAAA,CAAA,sCAClC,GAAI,EAAA,EAAA,KAAA,EAAM,SAAU,EAAA,KAAA,EAAM,WAAU,CACvC,CAAA,sCACC,QAAS,EAAA,EAAA,KAAA,EAAM,4BACb,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,IAAe,CAClB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,YAAS,KAAM,EAAA,SAAA,EAAA,sCACb,eAAgB,EAAA,IAAA,CACnB,CACF,CACF,CAAA,CAAA;AAEJ,EAAA;AAEO,MAAM,sBAAsB,MAAM;AACvC,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,MAAO,EAAA,EAAA,KAAA,EAAM,uBAAwB,EAAA,CAAA,kBACrC,KAAA,CAAA,aAAA,CAAA,0BAAA,EAAA,IAA2B,CAC9B,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRouteRef, createApiRef, createPlugin, createApiFactory, discoveryApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
1
|
+
import { createRouteRef, createApiRef, createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
2
2
|
import { ResponseError } from '@backstage/errors';
|
|
3
3
|
|
|
4
4
|
const rootRouteRef = createRouteRef({
|
|
@@ -9,15 +9,16 @@ const catalogUnprocessedEntitiesApiRef = createApiRef({
|
|
|
9
9
|
id: "plugin.catalog-unprocessed-entities.service"
|
|
10
10
|
});
|
|
11
11
|
class CatalogUnprocessedEntitiesApi {
|
|
12
|
-
constructor(discovery) {
|
|
12
|
+
constructor(discovery, fetchApi) {
|
|
13
13
|
this.discovery = discovery;
|
|
14
|
+
this.fetchApi = fetchApi;
|
|
14
15
|
this.url = "";
|
|
15
16
|
}
|
|
16
17
|
async fetch(path, init) {
|
|
17
18
|
if (!this.url) {
|
|
18
19
|
this.url = await this.discovery.getBaseUrl("catalog");
|
|
19
20
|
}
|
|
20
|
-
const resp = await fetch(`${this.url}/${path}`, init);
|
|
21
|
+
const resp = await this.fetchApi.fetch(`${this.url}/${path}`, init);
|
|
21
22
|
if (!resp.ok) {
|
|
22
23
|
throw await ResponseError.fromResponse(resp);
|
|
23
24
|
}
|
|
@@ -39,15 +40,15 @@ const catalogUnprocessedEntitiesPlugin = createPlugin({
|
|
|
39
40
|
apis: [
|
|
40
41
|
createApiFactory({
|
|
41
42
|
api: catalogUnprocessedEntitiesApiRef,
|
|
42
|
-
deps: { discoveryApi: discoveryApiRef },
|
|
43
|
-
factory: ({ discoveryApi }) => new CatalogUnprocessedEntitiesApi(discoveryApi)
|
|
43
|
+
deps: { discoveryApi: discoveryApiRef, fetchApi: fetchApiRef },
|
|
44
|
+
factory: ({ discoveryApi, fetchApi }) => new CatalogUnprocessedEntitiesApi(discoveryApi, fetchApi)
|
|
44
45
|
})
|
|
45
46
|
]
|
|
46
47
|
});
|
|
47
48
|
const CatalogUnprocessedEntitiesPage = catalogUnprocessedEntitiesPlugin.provide(
|
|
48
49
|
createRoutableExtension({
|
|
49
50
|
name: "CatalogUnprocessedEntitiesPage",
|
|
50
|
-
component: () => import('./UnprocessedEntities-
|
|
51
|
+
component: () => import('./UnprocessedEntities-1031f5ca.esm.js').then(
|
|
51
52
|
(m) => m.UnprocessedEntities
|
|
52
53
|
),
|
|
53
54
|
mountPoint: rootRouteRef
|
|
@@ -55,4 +56,4 @@ const CatalogUnprocessedEntitiesPage = catalogUnprocessedEntitiesPlugin.provide(
|
|
|
55
56
|
);
|
|
56
57
|
|
|
57
58
|
export { CatalogUnprocessedEntitiesPage as C, catalogUnprocessedEntitiesPlugin as a, catalogUnprocessedEntitiesApiRef as c };
|
|
58
|
-
//# sourceMappingURL=index-
|
|
59
|
+
//# sourceMappingURL=index-afbab918.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-afbab918.esm.js","sources":["../../src/routes.ts","../../src/api/index.ts","../../src/plugin.ts"],"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 */\nimport { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'catalog-unprocessed-entities',\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 */\nimport {\n DiscoveryApi,\n createApiRef,\n FetchApi,\n} from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { UnprocessedEntity } from '../types';\n\n/**\n * {@link @backstage/core-plugin-api#ApiRef} for the {@link CatalogUnprocessedEntitiesApi}\n *\n * @public\n */\nexport const catalogUnprocessedEntitiesApiRef =\n createApiRef<CatalogUnprocessedEntitiesApi>({\n id: 'plugin.catalog-unprocessed-entities.service',\n });\n\n/**\n * API client for the Catalog Unprocessed Entities plugin\n *\n * @public\n */\nexport class CatalogUnprocessedEntitiesApi {\n url: string = '';\n\n constructor(public discovery: DiscoveryApi, public fetchApi: FetchApi) {}\n\n private async fetch<T>(path: string, init?: RequestInit): Promise<T> {\n if (!this.url) {\n this.url = await this.discovery.getBaseUrl('catalog');\n }\n const resp = await this.fetchApi.fetch(`${this.url}/${path}`, init);\n if (!resp.ok) {\n throw await ResponseError.fromResponse(resp);\n }\n\n return await resp.json();\n }\n\n async pending(): Promise<{ entities: UnprocessedEntity[] }> {\n return await this.fetch('entities/unprocessed/pending');\n }\n\n async failed(): Promise<{ entities: UnprocessedEntity[] }> {\n return await this.fetch('entities/unprocessed/failed');\n }\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 */\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\n\nimport { rootRouteRef } from './routes';\nimport {\n CatalogUnprocessedEntitiesApi,\n catalogUnprocessedEntitiesApiRef,\n} from './api';\n\n/**\n * Plugin entry point\n *\n * @public\n */\nexport const catalogUnprocessedEntitiesPlugin = createPlugin({\n id: 'catalog-unprocessed-entities',\n routes: {\n root: rootRouteRef,\n },\n apis: [\n createApiFactory({\n api: catalogUnprocessedEntitiesApiRef,\n deps: { discoveryApi: discoveryApiRef, fetchApi: fetchApiRef },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogUnprocessedEntitiesApi(discoveryApi, fetchApi),\n }),\n ],\n});\n\n/**\n * Tool page for the Catalog Unprocessed Entities Plugin\n *\n * @public\n */\nexport const CatalogUnprocessedEntitiesPage =\n catalogUnprocessedEntitiesPlugin.provide(\n createRoutableExtension({\n name: 'CatalogUnprocessedEntitiesPage',\n component: () =>\n import('./components/UnprocessedEntities').then(\n m => m.UnprocessedEntities,\n ),\n mountPoint: rootRouteRef,\n }),\n );\n"],"names":[],"mappings":";;;AAiBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA,8BAAA;AACN,CAAC,CAAA;;ACSM,MAAM,mCACX,YAA4C,CAAA;AAAA,EAC1C,EAAI,EAAA,6CAAA;AACN,CAAC,EAAA;AAOI,MAAM,6BAA8B,CAAA;AAAA,EAGzC,WAAA,CAAmB,WAAgC,QAAoB,EAAA;AAApD,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA,CAAA;AAAgC,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;AAFnD,IAAc,IAAA,CAAA,GAAA,GAAA,EAAA,CAAA;AAAA,GAE0D;AAAA,EAExE,MAAc,KAAS,CAAA,IAAA,EAAc,IAAgC,EAAA;AACnE,IAAI,IAAA,CAAC,KAAK,GAAK,EAAA;AACb,MAAA,IAAA,CAAK,GAAM,GAAA,MAAM,IAAK,CAAA,SAAA,CAAU,WAAW,SAAS,CAAA,CAAA;AAAA,KACtD;AACA,IAAM,MAAA,IAAA,GAAO,MAAM,IAAK,CAAA,QAAA,CAAS,MAAM,CAAG,EAAA,IAAA,CAAK,GAAO,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,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nprocessedEntitiesPlugin } from './esm/index-
|
|
1
|
+
export { C as CatalogUnprocessedEntitiesPage, a as catalogUnprocessedEntitiesPlugin } from './esm/index-afbab918.esm.js';
|
|
2
2
|
import '@backstage/core-plugin-api';
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
//# sourceMappingURL=index.esm.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-unprocessed-entities",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"main": "dist/index.esm.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"postpack": "backstage-cli package postpack"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@backstage/catalog-model": "^1.4.0
|
|
26
|
-
"@backstage/core-components": "^0.13.2
|
|
27
|
-
"@backstage/core-plugin-api": "^1.5.2
|
|
28
|
-
"@backstage/errors": "^1.2.0
|
|
29
|
-
"@backstage/theme": "^0.4.0
|
|
25
|
+
"@backstage/catalog-model": "^1.4.0",
|
|
26
|
+
"@backstage/core-components": "^0.13.2",
|
|
27
|
+
"@backstage/core-plugin-api": "^1.5.2",
|
|
28
|
+
"@backstage/errors": "^1.2.0",
|
|
29
|
+
"@backstage/theme": "^0.4.0",
|
|
30
30
|
"@material-ui/core": "^4.9.13",
|
|
31
31
|
"@material-ui/icons": "^4.9.1",
|
|
32
32
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
@@ -36,15 +36,14 @@
|
|
|
36
36
|
"react": "^16.13.1 || ^17.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@backstage/cli": "^0.22.8
|
|
40
|
-
"@backstage/core-app-api": "^1.8.1
|
|
41
|
-
"@backstage/dev-utils": "^1.0.16
|
|
42
|
-
"@backstage/test-utils": "^1.4.0
|
|
39
|
+
"@backstage/cli": "^0.22.8",
|
|
40
|
+
"@backstage/core-app-api": "^1.8.1",
|
|
41
|
+
"@backstage/dev-utils": "^1.0.16",
|
|
42
|
+
"@backstage/test-utils": "^1.4.0",
|
|
43
43
|
"@testing-library/jest-dom": "^5.10.1",
|
|
44
44
|
"@testing-library/react": "^12.1.3",
|
|
45
45
|
"@testing-library/user-event": "^14.0.0",
|
|
46
46
|
"@types/node": "*",
|
|
47
|
-
"cross-fetch": "^3.1.5",
|
|
48
47
|
"msw": "^1.0.0"
|
|
49
48
|
},
|
|
50
49
|
"files": [
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-a9a60a39.esm.js","sources":["../../src/routes.ts","../../src/api/index.ts","../../src/plugin.ts"],"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 */\nimport { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'catalog-unprocessed-entities',\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 */\nimport { DiscoveryApi, createApiRef } from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { UnprocessedEntity } from '../types';\n\n/**\n * {@link @backstage/core-plugin-api#ApiRef} for the {@link CatalogUnprocessedEntitiesApi}\n *\n * @public\n */\nexport const catalogUnprocessedEntitiesApiRef =\n createApiRef<CatalogUnprocessedEntitiesApi>({\n id: 'plugin.catalog-unprocessed-entities.service',\n });\n\n/**\n * API client for the Catalog Unprocessed Entities plugin\n *\n * @public\n */\nexport class CatalogUnprocessedEntitiesApi {\n url: string = '';\n\n constructor(public discovery: DiscoveryApi) {}\n\n private async fetch<T>(path: string, init?: RequestInit): Promise<T> {\n if (!this.url) {\n this.url = await this.discovery.getBaseUrl('catalog');\n }\n const resp = await fetch(`${this.url}/${path}`, init);\n if (!resp.ok) {\n throw await ResponseError.fromResponse(resp);\n }\n\n return await resp.json();\n }\n\n async pending(): Promise<{ entities: UnprocessedEntity[] }> {\n return await this.fetch('entities/unprocessed/pending');\n }\n\n async failed(): Promise<{ entities: UnprocessedEntity[] }> {\n return await this.fetch('entities/unprocessed/failed');\n }\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 */\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n} from '@backstage/core-plugin-api';\n\nimport { rootRouteRef } from './routes';\nimport {\n CatalogUnprocessedEntitiesApi,\n catalogUnprocessedEntitiesApiRef,\n} from './api';\n\n/**\n * Plugin entry point\n *\n * @public\n */\nexport const catalogUnprocessedEntitiesPlugin = createPlugin({\n id: 'catalog-unprocessed-entities',\n routes: {\n root: rootRouteRef,\n },\n apis: [\n createApiFactory({\n api: catalogUnprocessedEntitiesApiRef,\n deps: { discoveryApi: discoveryApiRef },\n factory: ({ discoveryApi }) =>\n new CatalogUnprocessedEntitiesApi(discoveryApi),\n }),\n ],\n});\n\n/**\n * Tool page for the Catalog Unprocessed Entities Plugin\n *\n * @public\n */\nexport const CatalogUnprocessedEntitiesPage =\n catalogUnprocessedEntitiesPlugin.provide(\n createRoutableExtension({\n name: 'CatalogUnprocessedEntitiesPage',\n component: () =>\n import('./components/UnprocessedEntities').then(\n m => m.UnprocessedEntities,\n ),\n mountPoint: rootRouteRef,\n }),\n );\n"],"names":[],"mappings":";;;AAiBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA,8BAAA;AACN,CAAC,CAAA;;ACKM,MAAM,mCACX,YAA4C,CAAA;AAAA,EAC1C,EAAI,EAAA,6CAAA;AACN,CAAC,EAAA;AAOI,MAAM,6BAA8B,CAAA;AAAA,EAGzC,YAAmB,SAAyB,EAAA;AAAzB,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA,CAAA;AAFnB,IAAc,IAAA,CAAA,GAAA,GAAA,EAAA,CAAA;AAAA,GAE+B;AAAA,EAE7C,MAAc,KAAS,CAAA,IAAA,EAAc,IAAgC,EAAA;AACnE,IAAI,IAAA,CAAC,KAAK,GAAK,EAAA;AACb,MAAA,IAAA,CAAK,GAAM,GAAA,MAAM,IAAK,CAAA,SAAA,CAAU,WAAW,SAAS,CAAA,CAAA;AAAA,KACtD;AACA,IAAA,MAAM,OAAO,MAAM,KAAA,CAAM,GAAG,IAAK,CAAA,GAAA,CAAA,CAAA,EAAO,QAAQ,IAAI,CAAA,CAAA;AACpD,IAAI,IAAA,CAAC,KAAK,EAAI,EAAA;AACZ,MAAM,MAAA,MAAM,aAAc,CAAA,YAAA,CAAa,IAAI,CAAA,CAAA;AAAA,KAC7C;AAEA,IAAO,OAAA,MAAM,KAAK,IAAK,EAAA,CAAA;AAAA,GACzB;AAAA,EAEA,MAAM,OAAsD,GAAA;AAC1D,IAAO,OAAA,MAAM,IAA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