@backstage/plugin-catalog 1.24.1-next.1 → 1.24.1-next.2
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/alpha/package.json +1 -1
- package/dist/alpha/EntityOverviewPage.esm.js.map +1 -1
- package/dist/alpha/apis.esm.js.map +1 -1
- package/dist/alpha/blueprints/CatalogFilterBlueprint.esm.js.map +1 -1
- package/dist/alpha/entityCards.esm.js.map +1 -1
- package/dist/alpha/entityContents.esm.js.map +1 -1
- package/dist/alpha/filter/FilterWrapper.esm.js.map +1 -1
- package/dist/alpha/filter/matchers/createHasMatcher.esm.js.map +1 -1
- package/dist/alpha/filter/matchers/createIsMatcher.esm.js.map +1 -1
- package/dist/alpha/filter/matchers/createKindMatcher.esm.js.map +1 -1
- package/dist/alpha/filter/matchers/createTypeMatcher.esm.js.map +1 -1
- package/dist/alpha/filter/parseFilterExpression.esm.js.map +1 -1
- package/dist/alpha/filters.esm.js.map +1 -1
- package/dist/alpha/navItems.esm.js.map +1 -1
- package/dist/alpha/pages.esm.js.map +1 -1
- package/dist/alpha/plugin.esm.js.map +1 -1
- package/dist/alpha/searchResultItems.esm.js.map +1 -1
- package/dist/alpha/translation.esm.js.map +1 -1
- package/dist/apis/EntityPresentationApi/DefaultEntityPresentationApi.esm.js.map +1 -1
- package/dist/apis/EntityPresentationApi/defaults.esm.js.map +1 -1
- package/dist/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.esm.js.map +1 -1
- package/dist/apis/StarredEntitiesApi/migration.esm.js.map +1 -1
- package/dist/components/AboutCard/AboutCard.esm.js.map +1 -1
- package/dist/components/AboutCard/AboutContent.esm.js.map +1 -1
- package/dist/components/AboutCard/AboutField.esm.js.map +1 -1
- package/dist/components/AboutCard/hooks.esm.js.map +1 -1
- package/dist/components/CatalogEntityPage/CatalogEntityPage.esm.js.map +1 -1
- package/dist/components/CatalogEntityPage/useEntityFromUrl.esm.js.map +1 -1
- package/dist/components/CatalogKindHeader/CatalogKindHeader.esm.js.map +1 -1
- package/dist/components/CatalogKindHeader/kindFilterUtils.esm.js.map +1 -1
- package/dist/components/CatalogPage/CatalogPage.esm.js.map +1 -1
- package/dist/components/CatalogPage/DefaultCatalogPage.esm.js.map +1 -1
- package/dist/components/CatalogSearchResultListItem/CatalogSearchResultListItem.esm.js.map +1 -1
- package/dist/components/CatalogTable/CatalogTable.esm.js.map +1 -1
- package/dist/components/CatalogTable/CatalogTableToolbar.esm.js.map +1 -1
- package/dist/components/CatalogTable/CursorPaginatedCatalogTable.esm.js.map +1 -1
- package/dist/components/CatalogTable/OffsetPaginatedCatalogTable.esm.js.map +1 -1
- package/dist/components/CatalogTable/columns.esm.js.map +1 -1
- package/dist/components/CatalogTable/defaultCatalogTableColumnsFunc.esm.js.map +1 -1
- package/dist/components/DependencyOfComponentsCard/DependencyOfComponentsCard.esm.js.map +1 -1
- package/dist/components/DependsOnComponentsCard/DependsOnComponentsCard.esm.js.map +1 -1
- package/dist/components/DependsOnResourcesCard/DependsOnResourcesCard.esm.js.map +1 -1
- package/dist/components/EntityContextMenu/EntityContextMenu.esm.js.map +1 -1
- package/dist/components/EntityContextMenu/UnregisterEntity.esm.js.map +1 -1
- package/dist/components/EntityLabelsCard/EntityLabelsCard.esm.js.map +1 -1
- package/dist/components/EntityLabelsCard/EntityLabelsEmptyState.esm.js.map +1 -1
- package/dist/components/EntityLabelsCard/conditions.esm.js.map +1 -1
- package/dist/components/EntityLayout/EntityLayout.esm.js.map +1 -1
- package/dist/components/EntityLinksCard/EntityLinksCard.esm.js.map +1 -1
- package/dist/components/EntityLinksCard/EntityLinksEmptyState.esm.js.map +1 -1
- package/dist/components/EntityLinksCard/IconLink.esm.js.map +1 -1
- package/dist/components/EntityLinksCard/LinksGridList.esm.js.map +1 -1
- package/dist/components/EntityLinksCard/useDynamicColumns.esm.js.map +1 -1
- package/dist/components/EntityOrphanWarning/DeleteEntityDialog.esm.js.map +1 -1
- package/dist/components/EntityOrphanWarning/EntityOrphanWarning.esm.js.map +1 -1
- package/dist/components/EntityProcessingErrorsPanel/EntityProcessingErrorsPanel.esm.js.map +1 -1
- package/dist/components/EntityRelationWarning/EntityRelationWarning.esm.js.map +1 -1
- package/dist/components/EntitySwitch/EntitySwitch.esm.js.map +1 -1
- package/dist/components/EntitySwitch/conditions.esm.js.map +1 -1
- package/dist/components/FilteredEntityLayout/index.esm.js.map +1 -1
- package/dist/components/HasComponentsCard/HasComponentsCard.esm.js.map +1 -1
- package/dist/components/HasResourcesCard/HasResourcesCard.esm.js.map +1 -1
- package/dist/components/HasSubcomponentsCard/HasSubcomponentsCard.esm.js.map +1 -1
- package/dist/components/HasSubdomainsCard/HasSubdomainsCard.esm.js.map +1 -1
- package/dist/components/HasSystemsCard/HasSystemsCard.esm.js.map +1 -1
- package/dist/components/RelatedEntitiesCard/RelatedEntitiesCard.esm.js.map +1 -1
- package/dist/components/RelatedEntitiesCard/presets.esm.js.map +1 -1
- package/dist/plugin.esm.js.map +1 -1
- package/dist/routes.esm.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @backstage/plugin-catalog
|
|
2
2
|
|
|
3
|
+
## 1.24.1-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/catalog-client@1.8.0-next.1
|
|
9
|
+
- @backstage/plugin-catalog-react@1.14.1-next.2
|
|
10
|
+
- @backstage/catalog-model@1.7.0
|
|
11
|
+
- @backstage/core-compat-api@0.3.2-next.1
|
|
12
|
+
- @backstage/core-components@0.16.0-next.1
|
|
13
|
+
- @backstage/core-plugin-api@1.10.0
|
|
14
|
+
- @backstage/errors@1.2.4
|
|
15
|
+
- @backstage/frontend-plugin-api@0.9.1-next.1
|
|
16
|
+
- @backstage/integration-react@1.2.0
|
|
17
|
+
- @backstage/types@1.1.1
|
|
18
|
+
- @backstage/plugin-catalog-common@1.1.0
|
|
19
|
+
- @backstage/plugin-permission-react@0.4.27
|
|
20
|
+
- @backstage/plugin-scaffolder-common@1.5.6
|
|
21
|
+
- @backstage/plugin-search-common@1.2.14
|
|
22
|
+
- @backstage/plugin-search-react@1.8.2-next.1
|
|
23
|
+
|
|
3
24
|
## 1.24.1-next.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/alpha/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityOverviewPage.esm.js","sources":["../../src/alpha/EntityOverviewPage.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 { Entity } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport Grid from '@material-ui/core/Grid';\nimport React from 'react';\nimport { FilterWrapper } from './filter/FilterWrapper';\nimport { EntitySwitch } from '../components/EntitySwitch';\nimport {\n EntityOrphanWarning,\n isOrphan,\n} from '../components/EntityOrphanWarning';\nimport {\n EntityRelationWarning,\n hasRelationWarnings,\n} from '../components/EntityRelationWarning';\nimport {\n EntityProcessingErrorsPanel,\n hasCatalogProcessingErrors,\n} from '../components/EntityProcessingErrorsPanel';\n\ninterface EntityOverviewPageProps {\n cards: Array<{\n element: React.JSX.Element;\n filterFunction?: (entity: Entity) => boolean;\n filterExpression?: string;\n }>;\n}\n\nconst entityWarningContent = (\n <>\n <EntitySwitch>\n <EntitySwitch.Case if={isOrphan}>\n <Grid item xs={12}>\n <EntityOrphanWarning />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasRelationWarnings}>\n <Grid item xs={12}>\n <EntityRelationWarning />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasCatalogProcessingErrors}>\n <Grid item xs={12}>\n <EntityProcessingErrorsPanel />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n </>\n);\n\nexport function EntityOverviewPage(props: EntityOverviewPageProps) {\n const { entity } = useEntity();\n return (\n <Grid container spacing={3} alignItems=\"stretch\">\n {entityWarningContent}\n {props.cards.map((card, index) => (\n <FilterWrapper key={index} entity={entity} {...card} />\n ))}\n </Grid>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AA2CA,MAAM,oBACJ,mBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,YAAA,CAAa,IAAb,EAAA,EAAkB,EAAI,EAAA,QAAA,EAAA,kBACpB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,IAAoB,CACvB,CACF,CACF,CAAA,kBAEC,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,YAAA,CAAa,IAAb,EAAA,EAAkB,EAAI,EAAA,mBAAA,EAAA,kBACpB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,IAAsB,CACzB,CACF,CACF,CAAA,kBAEC,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,YAAA,CAAa,IAAb,EAAA,EAAkB,EAAI,EAAA,0BAAA,EAAA,kBACpB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,2BAAA,EAAA,IAA4B,CAC/B,CACF,CACF,CACF,CAAA
|
|
1
|
+
{"version":3,"file":"EntityOverviewPage.esm.js","sources":["../../src/alpha/EntityOverviewPage.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 { Entity } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport Grid from '@material-ui/core/Grid';\nimport React from 'react';\nimport { FilterWrapper } from './filter/FilterWrapper';\nimport { EntitySwitch } from '../components/EntitySwitch';\nimport {\n EntityOrphanWarning,\n isOrphan,\n} from '../components/EntityOrphanWarning';\nimport {\n EntityRelationWarning,\n hasRelationWarnings,\n} from '../components/EntityRelationWarning';\nimport {\n EntityProcessingErrorsPanel,\n hasCatalogProcessingErrors,\n} from '../components/EntityProcessingErrorsPanel';\n\ninterface EntityOverviewPageProps {\n cards: Array<{\n element: React.JSX.Element;\n filterFunction?: (entity: Entity) => boolean;\n filterExpression?: string;\n }>;\n}\n\nconst entityWarningContent = (\n <>\n <EntitySwitch>\n <EntitySwitch.Case if={isOrphan}>\n <Grid item xs={12}>\n <EntityOrphanWarning />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasRelationWarnings}>\n <Grid item xs={12}>\n <EntityRelationWarning />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasCatalogProcessingErrors}>\n <Grid item xs={12}>\n <EntityProcessingErrorsPanel />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n </>\n);\n\nexport function EntityOverviewPage(props: EntityOverviewPageProps) {\n const { entity } = useEntity();\n return (\n <Grid container spacing={3} alignItems=\"stretch\">\n {entityWarningContent}\n {props.cards.map((card, index) => (\n <FilterWrapper key={index} entity={entity} {...card} />\n ))}\n </Grid>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AA2CA,MAAM,oBACJ,mBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,YAAA,CAAa,IAAb,EAAA,EAAkB,EAAI,EAAA,QAAA,EAAA,kBACpB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,IAAoB,CACvB,CACF,CACF,CAAA,kBAEC,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,YAAA,CAAa,IAAb,EAAA,EAAkB,EAAI,EAAA,mBAAA,EAAA,kBACpB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,IAAsB,CACzB,CACF,CACF,CAAA,kBAEC,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,YAAA,CAAa,IAAb,EAAA,EAAkB,EAAI,EAAA,0BAAA,EAAA,kBACpB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,2BAAA,EAAA,IAA4B,CAC/B,CACF,CACF,CACF,CAAA;AAGK,SAAS,mBAAmB,KAAgC,EAAA;AACjE,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,SAAS,EAAA,IAAA,EAAC,SAAS,CAAG,EAAA,UAAA,EAAW,SACpC,EAAA,EAAA,oBAAA,EACA,KAAM,CAAA,KAAA,CAAM,IAAI,CAAC,IAAA,EAAM,KACtB,qBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,GAAA,EAAK,OAAO,MAAiB,EAAA,GAAG,IAAM,EAAA,CACtD,CACH,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apis.esm.js","sources":["../../src/alpha/apis.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 {\n createApiFactory,\n discoveryApiRef,\n fetchApiRef,\n storageApiRef,\n} from '@backstage/core-plugin-api';\nimport { CatalogClient } from '@backstage/catalog-client';\nimport { ApiBlueprint } from '@backstage/frontend-plugin-api';\nimport {\n catalogApiRef,\n entityPresentationApiRef,\n starredEntitiesApiRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n DefaultEntityPresentationApi,\n DefaultStarredEntitiesApi,\n} from '../apis';\n\nexport const catalogApi = ApiBlueprint.make({\n params: {\n factory: createApiFactory({\n api: catalogApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogClient({ discoveryApi, fetchApi }),\n }),\n },\n});\n\nexport const catalogStarredEntitiesApi = ApiBlueprint.make({\n name: 'starred-entities',\n params: {\n factory: createApiFactory({\n api: starredEntitiesApiRef,\n deps: { storageApi: storageApiRef },\n factory: ({ storageApi }) =>\n new DefaultStarredEntitiesApi({ storageApi }),\n }),\n },\n});\n\nexport const entityPresentationApi = ApiBlueprint.make({\n name: 'entity-presentation',\n params: {\n factory: createApiFactory({\n api: entityPresentationApiRef,\n deps: { catalogApiImp: catalogApiRef },\n factory: ({ catalogApiImp }) =>\n DefaultEntityPresentationApi.create({ catalogApi: catalogApiImp }),\n }),\n },\n});\n\nexport default [catalogApi, catalogStarredEntitiesApi, entityPresentationApi];\n"],"names":[],"mappings":";;;;;;;AAkCa,MAAA,UAAA,GAAa,aAAa,IAAK,CAAA;AAAA,EAC1C,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,aAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA
|
|
1
|
+
{"version":3,"file":"apis.esm.js","sources":["../../src/alpha/apis.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 {\n createApiFactory,\n discoveryApiRef,\n fetchApiRef,\n storageApiRef,\n} from '@backstage/core-plugin-api';\nimport { CatalogClient } from '@backstage/catalog-client';\nimport { ApiBlueprint } from '@backstage/frontend-plugin-api';\nimport {\n catalogApiRef,\n entityPresentationApiRef,\n starredEntitiesApiRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n DefaultEntityPresentationApi,\n DefaultStarredEntitiesApi,\n} from '../apis';\n\nexport const catalogApi = ApiBlueprint.make({\n params: {\n factory: createApiFactory({\n api: catalogApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogClient({ discoveryApi, fetchApi }),\n }),\n },\n});\n\nexport const catalogStarredEntitiesApi = ApiBlueprint.make({\n name: 'starred-entities',\n params: {\n factory: createApiFactory({\n api: starredEntitiesApiRef,\n deps: { storageApi: storageApiRef },\n factory: ({ storageApi }) =>\n new DefaultStarredEntitiesApi({ storageApi }),\n }),\n },\n});\n\nexport const entityPresentationApi = ApiBlueprint.make({\n name: 'entity-presentation',\n params: {\n factory: createApiFactory({\n api: entityPresentationApiRef,\n deps: { catalogApiImp: catalogApiRef },\n factory: ({ catalogApiImp }) =>\n DefaultEntityPresentationApi.create({ catalogApi: catalogApiImp }),\n }),\n },\n});\n\nexport default [catalogApi, catalogStarredEntitiesApi, entityPresentationApi];\n"],"names":[],"mappings":";;;;;;;AAkCa,MAAA,UAAA,GAAa,aAAa,IAAK,CAAA;AAAA,EAC1C,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,aAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,aAAc,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU;AAAA,KAC/C;AAAA;AAEL,CAAC;AAEY,MAAA,yBAAA,GAA4B,aAAa,IAAK,CAAA;AAAA,EACzD,IAAM,EAAA,kBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,qBAAA;AAAA,MACL,IAAA,EAAM,EAAE,UAAA,EAAY,aAAc,EAAA;AAAA,MAClC,OAAA,EAAS,CAAC,EAAE,UAAA,OACV,IAAI,yBAAA,CAA0B,EAAE,UAAA,EAAY;AAAA,KAC/C;AAAA;AAEL,CAAC;AAEY,MAAA,qBAAA,GAAwB,aAAa,IAAK,CAAA;AAAA,EACrD,IAAM,EAAA,qBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,wBAAA;AAAA,MACL,IAAA,EAAM,EAAE,aAAA,EAAe,aAAc,EAAA;AAAA,MACrC,OAAA,EAAS,CAAC,EAAE,aAAc,EAAA,KACxB,6BAA6B,MAAO,CAAA,EAAE,UAAY,EAAA,aAAA,EAAe;AAAA,KACpE;AAAA;AAEL,CAAC;AAED,WAAe,CAAC,UAAY,EAAA,yBAAA,EAA2B,qBAAqB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogFilterBlueprint.esm.js","sources":["../../../src/alpha/blueprints/CatalogFilterBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 ExtensionBoundary,\n coreExtensionData,\n createExtensionBlueprint,\n} from '@backstage/frontend-plugin-api';\n\n/**\n * Creates Catalog Filter Extensions\n * @alpha\n */\nexport const CatalogFilterBlueprint = createExtensionBlueprint({\n kind: 'catalog-filter',\n attachTo: { id: 'page:catalog', input: 'filters' },\n output: [coreExtensionData.reactElement],\n factory(params: { loader: () => Promise<JSX.Element> }, { node }) {\n return [\n coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, params.loader),\n ),\n ];\n },\n});\n"],"names":[],"mappings":";;AA0BO,MAAM,yBAAyB,wBAAyB,CAAA;AAAA,EAC7D,IAAM,EAAA,gBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,cAAA,EAAgB,OAAO,SAAU,EAAA;AAAA,EACjD,MAAA,EAAQ,CAAC,iBAAA,CAAkB,YAAY,CAAA;AAAA,EACvC,OAAQ,CAAA,MAAA,EAAgD,EAAE,IAAA,EAAQ,EAAA;AAChE,IAAO,OAAA;AAAA,MACL,iBAAkB,CAAA,YAAA;AAAA,QAChB,iBAAkB,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,CAAO,MAAM
|
|
1
|
+
{"version":3,"file":"CatalogFilterBlueprint.esm.js","sources":["../../../src/alpha/blueprints/CatalogFilterBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 ExtensionBoundary,\n coreExtensionData,\n createExtensionBlueprint,\n} from '@backstage/frontend-plugin-api';\n\n/**\n * Creates Catalog Filter Extensions\n * @alpha\n */\nexport const CatalogFilterBlueprint = createExtensionBlueprint({\n kind: 'catalog-filter',\n attachTo: { id: 'page:catalog', input: 'filters' },\n output: [coreExtensionData.reactElement],\n factory(params: { loader: () => Promise<JSX.Element> }, { node }) {\n return [\n coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, params.loader),\n ),\n ];\n },\n});\n"],"names":[],"mappings":";;AA0BO,MAAM,yBAAyB,wBAAyB,CAAA;AAAA,EAC7D,IAAM,EAAA,gBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,cAAA,EAAgB,OAAO,SAAU,EAAA;AAAA,EACjD,MAAA,EAAQ,CAAC,iBAAA,CAAkB,YAAY,CAAA;AAAA,EACvC,OAAQ,CAAA,MAAA,EAAgD,EAAE,IAAA,EAAQ,EAAA;AAChE,IAAO,OAAA;AAAA,MACL,iBAAkB,CAAA,YAAA;AAAA,QAChB,iBAAkB,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,CAAO,MAAM;AAAA;AAC5C,KACF;AAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityCards.esm.js","sources":["../../src/alpha/entityCards.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 React from 'react';\nimport { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { compatWrapper } from '@backstage/core-compat-api';\n\nexport const catalogAboutEntityCard = EntityCardBlueprint.make({\n name: 'about',\n params: {\n loader: async () =>\n import('../components/AboutCard').then(m =>\n compatWrapper(<m.AboutCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogLinksEntityCard = EntityCardBlueprint.make({\n name: 'links',\n params: {\n filter: 'has:links',\n loader: async () =>\n import('../components/EntityLinksCard').then(m =>\n compatWrapper(<m.EntityLinksCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogLabelsEntityCard = EntityCardBlueprint.make({\n name: 'labels',\n params: {\n filter: 'has:labels',\n loader: async () =>\n import('../components/EntityLabelsCard').then(m =>\n compatWrapper(<m.EntityLabelsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogDependsOnComponentsEntityCard = EntityCardBlueprint.make({\n name: 'depends-on-components',\n params: {\n filter: 'kind:component',\n loader: async () =>\n import('../components/DependsOnComponentsCard').then(m =>\n compatWrapper(<m.DependsOnComponentsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogDependsOnResourcesEntityCard = EntityCardBlueprint.make({\n name: 'depends-on-resources',\n params: {\n filter: 'kind:component',\n loader: async () =>\n import('../components/DependsOnResourcesCard').then(m =>\n compatWrapper(<m.DependsOnResourcesCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogHasComponentsEntityCard = EntityCardBlueprint.make({\n name: 'has-components',\n params: {\n filter: 'kind:system',\n loader: async () =>\n import('../components/HasComponentsCard').then(m =>\n compatWrapper(<m.HasComponentsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogHasResourcesEntityCard = EntityCardBlueprint.make({\n name: 'has-resources',\n params: {\n filter: 'kind:system',\n loader: async () =>\n import('../components/HasResourcesCard').then(m =>\n compatWrapper(<m.HasResourcesCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogHasSubcomponentsEntityCard = EntityCardBlueprint.make({\n name: 'has-subcomponents',\n params: {\n filter: 'kind:component',\n loader: async () =>\n import('../components/HasSubcomponentsCard').then(m =>\n compatWrapper(<m.HasSubcomponentsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogHasSubdomainsEntityCard = EntityCardBlueprint.make({\n name: 'has-subdomains',\n params: {\n filter: 'kind:domain',\n loader: async () =>\n import('../components/HasSubdomainsCard').then(m =>\n compatWrapper(<m.HasSubdomainsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogHasSystemsEntityCard = EntityCardBlueprint.make({\n name: 'has-systems',\n params: {\n filter: 'kind:domain',\n loader: async () =>\n import('../components/HasSystemsCard').then(m =>\n compatWrapper(<m.HasSystemsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport default [\n catalogAboutEntityCard,\n catalogLinksEntityCard,\n catalogLabelsEntityCard,\n catalogDependsOnComponentsEntityCard,\n catalogDependsOnResourcesEntityCard,\n catalogHasComponentsEntityCard,\n catalogHasResourcesEntityCard,\n catalogHasSubcomponentsEntityCard,\n catalogHasSubdomainsEntityCard,\n catalogHasSystemsEntityCard,\n];\n"],"names":[],"mappings":";;;;AAoBa,MAAA,sBAAA,GAAyB,oBAAoB,IAAK,CAAA;AAAA,EAC7D,IAAM,EAAA,OAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,YACN,OAAO,sCAAyB,CAAE,CAAA,IAAA;AAAA,MAAK,CAAA,CAAA,KACrC,8BAAe,KAAA,CAAA,aAAA,CAAA,CAAA,CAAE,WAAF,EAAY,OAAA,EAAQ,YAAW,CAAE
|
|
1
|
+
{"version":3,"file":"entityCards.esm.js","sources":["../../src/alpha/entityCards.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 React from 'react';\nimport { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { compatWrapper } from '@backstage/core-compat-api';\n\nexport const catalogAboutEntityCard = EntityCardBlueprint.make({\n name: 'about',\n params: {\n loader: async () =>\n import('../components/AboutCard').then(m =>\n compatWrapper(<m.AboutCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogLinksEntityCard = EntityCardBlueprint.make({\n name: 'links',\n params: {\n filter: 'has:links',\n loader: async () =>\n import('../components/EntityLinksCard').then(m =>\n compatWrapper(<m.EntityLinksCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogLabelsEntityCard = EntityCardBlueprint.make({\n name: 'labels',\n params: {\n filter: 'has:labels',\n loader: async () =>\n import('../components/EntityLabelsCard').then(m =>\n compatWrapper(<m.EntityLabelsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogDependsOnComponentsEntityCard = EntityCardBlueprint.make({\n name: 'depends-on-components',\n params: {\n filter: 'kind:component',\n loader: async () =>\n import('../components/DependsOnComponentsCard').then(m =>\n compatWrapper(<m.DependsOnComponentsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogDependsOnResourcesEntityCard = EntityCardBlueprint.make({\n name: 'depends-on-resources',\n params: {\n filter: 'kind:component',\n loader: async () =>\n import('../components/DependsOnResourcesCard').then(m =>\n compatWrapper(<m.DependsOnResourcesCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogHasComponentsEntityCard = EntityCardBlueprint.make({\n name: 'has-components',\n params: {\n filter: 'kind:system',\n loader: async () =>\n import('../components/HasComponentsCard').then(m =>\n compatWrapper(<m.HasComponentsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogHasResourcesEntityCard = EntityCardBlueprint.make({\n name: 'has-resources',\n params: {\n filter: 'kind:system',\n loader: async () =>\n import('../components/HasResourcesCard').then(m =>\n compatWrapper(<m.HasResourcesCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogHasSubcomponentsEntityCard = EntityCardBlueprint.make({\n name: 'has-subcomponents',\n params: {\n filter: 'kind:component',\n loader: async () =>\n import('../components/HasSubcomponentsCard').then(m =>\n compatWrapper(<m.HasSubcomponentsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogHasSubdomainsEntityCard = EntityCardBlueprint.make({\n name: 'has-subdomains',\n params: {\n filter: 'kind:domain',\n loader: async () =>\n import('../components/HasSubdomainsCard').then(m =>\n compatWrapper(<m.HasSubdomainsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport const catalogHasSystemsEntityCard = EntityCardBlueprint.make({\n name: 'has-systems',\n params: {\n filter: 'kind:domain',\n loader: async () =>\n import('../components/HasSystemsCard').then(m =>\n compatWrapper(<m.HasSystemsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport default [\n catalogAboutEntityCard,\n catalogLinksEntityCard,\n catalogLabelsEntityCard,\n catalogDependsOnComponentsEntityCard,\n catalogDependsOnResourcesEntityCard,\n catalogHasComponentsEntityCard,\n catalogHasResourcesEntityCard,\n catalogHasSubcomponentsEntityCard,\n catalogHasSubdomainsEntityCard,\n catalogHasSystemsEntityCard,\n];\n"],"names":[],"mappings":";;;;AAoBa,MAAA,sBAAA,GAAyB,oBAAoB,IAAK,CAAA;AAAA,EAC7D,IAAM,EAAA,OAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,YACN,OAAO,sCAAyB,CAAE,CAAA,IAAA;AAAA,MAAK,CAAA,CAAA,KACrC,8BAAe,KAAA,CAAA,aAAA,CAAA,CAAA,CAAE,WAAF,EAAY,OAAA,EAAQ,YAAW,CAAE;AAAA;AAClD;AAEN,CAAC;AAEY,MAAA,sBAAA,GAAyB,oBAAoB,IAAK,CAAA;AAAA,EAC7D,IAAM,EAAA,OAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,WAAA;AAAA,IACR,MAAQ,EAAA,YACN,OAAO,4CAA+B,CAAE,CAAA,IAAA;AAAA,MAAK,CAAA,CAAA,KAC3C,8BAAe,KAAA,CAAA,aAAA,CAAA,CAAA,CAAE,iBAAF,EAAkB,OAAA,EAAQ,YAAW,CAAE;AAAA;AACxD;AAEN,CAAC;AAEY,MA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MAAQ,EAAA,YACN,OAAO,2CAA8B,CAAE,CAAA,IAAA;AAAA,MAAK,CAAA,CAAA,KAC1C,8BAAe,KAAA,CAAA,aAAA,CAAA,CAAA,CAAE,gBAAF,EAAiB,OAAA,EAAQ,YAAW,CAAE;AAAA;AACvD;AAEN,CAAC;AAED,kBAAe;AAAA,EACb,sBAAA;AAAA,EACA,sBAAA;AAAA,EACA,uBAAA;AAAA,EACA,oCAAA;AAAA,EACA,mCAAA;AAAA,EACA,8BAAA;AAAA,EACA,6BAAA;AAAA,EACA,iCAAA;AAAA,EACA,8BAAA;AAAA,EACA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityContents.esm.js","sources":["../../src/alpha/entityContents.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 React from 'react';\nimport {\n coreExtensionData,\n createExtensionInput,\n} from '@backstage/frontend-plugin-api';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\n\nexport const catalogOverviewEntityContent =\n EntityContentBlueprint.makeWithOverrides({\n name: 'overview',\n inputs: {\n cards: createExtensionInput([\n coreExtensionData.reactElement,\n EntityContentBlueprint.dataRefs.filterFunction.optional(),\n EntityContentBlueprint.dataRefs.filterExpression.optional(),\n ]),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory({\n defaultPath: '/',\n defaultTitle: 'Overview',\n loader: async () =>\n import('./EntityOverviewPage').then(m => (\n <m.EntityOverviewPage\n cards={inputs.cards.map(c => ({\n element: c.get(coreExtensionData.reactElement),\n filterFunction: c.get(\n EntityContentBlueprint.dataRefs.filterFunction,\n ),\n filterExpression: c.get(\n EntityContentBlueprint.dataRefs.filterExpression,\n ),\n }))}\n />\n )),\n });\n },\n });\n\nexport default [catalogOverviewEntityContent];\n"],"names":[],"mappings":";;;;AAuBa,MAAA,4BAAA,GACX,uBAAuB,iBAAkB,CAAA;AAAA,EACvC,IAAM,EAAA,UAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,OAAO,oBAAqB,CAAA;AAAA,MAC1B,iBAAkB,CAAA,YAAA;AAAA,MAClB,sBAAA,CAAuB,QAAS,CAAA,cAAA,CAAe,QAAS,EAAA;AAAA,MACxD,sBAAA,CAAuB,QAAS,CAAA,gBAAA,CAAiB,QAAS
|
|
1
|
+
{"version":3,"file":"entityContents.esm.js","sources":["../../src/alpha/entityContents.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 React from 'react';\nimport {\n coreExtensionData,\n createExtensionInput,\n} from '@backstage/frontend-plugin-api';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\n\nexport const catalogOverviewEntityContent =\n EntityContentBlueprint.makeWithOverrides({\n name: 'overview',\n inputs: {\n cards: createExtensionInput([\n coreExtensionData.reactElement,\n EntityContentBlueprint.dataRefs.filterFunction.optional(),\n EntityContentBlueprint.dataRefs.filterExpression.optional(),\n ]),\n },\n factory: (originalFactory, { inputs }) => {\n return originalFactory({\n defaultPath: '/',\n defaultTitle: 'Overview',\n loader: async () =>\n import('./EntityOverviewPage').then(m => (\n <m.EntityOverviewPage\n cards={inputs.cards.map(c => ({\n element: c.get(coreExtensionData.reactElement),\n filterFunction: c.get(\n EntityContentBlueprint.dataRefs.filterFunction,\n ),\n filterExpression: c.get(\n EntityContentBlueprint.dataRefs.filterExpression,\n ),\n }))}\n />\n )),\n });\n },\n });\n\nexport default [catalogOverviewEntityContent];\n"],"names":[],"mappings":";;;;AAuBa,MAAA,4BAAA,GACX,uBAAuB,iBAAkB,CAAA;AAAA,EACvC,IAAM,EAAA,UAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,OAAO,oBAAqB,CAAA;AAAA,MAC1B,iBAAkB,CAAA,YAAA;AAAA,MAClB,sBAAA,CAAuB,QAAS,CAAA,cAAA,CAAe,QAAS,EAAA;AAAA,MACxD,sBAAA,CAAuB,QAAS,CAAA,gBAAA,CAAiB,QAAS;AAAA,KAC3D;AAAA,GACH;AAAA,EACA,OAAS,EAAA,CAAC,eAAiB,EAAA,EAAE,QAAa,KAAA;AACxC,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,WAAa,EAAA,GAAA;AAAA,MACb,YAAc,EAAA,UAAA;AAAA,MACd,QAAQ,YACN,OAAO,6BAAsB,CAAA,CAAE,KAAK,CAClC,CAAA,qBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,CAAE,CAAA,kBAAA;AAAA,QAAF;AAAA,UACC,KAAO,EAAA,MAAA,CAAO,KAAM,CAAA,GAAA,CAAI,CAAM,CAAA,MAAA;AAAA,YAC5B,OAAS,EAAA,CAAA,CAAE,GAAI,CAAA,iBAAA,CAAkB,YAAY,CAAA;AAAA,YAC7C,gBAAgB,CAAE,CAAA,GAAA;AAAA,cAChB,uBAAuB,QAAS,CAAA;AAAA,aAClC;AAAA,YACA,kBAAkB,CAAE,CAAA,GAAA;AAAA,cAClB,uBAAuB,QAAS,CAAA;AAAA;AAClC,WACA,CAAA;AAAA;AAAA,OAEL;AAAA,KACJ,CAAA;AAAA;AAEL,CAAC;AAEH,qBAAe,CAAC,4BAA4B,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterWrapper.esm.js","sources":["../../../src/alpha/filter/FilterWrapper.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Grid from '@material-ui/core/Grid';\nimport React, { useMemo } from 'react';\nimport { parseFilterExpression } from './parseFilterExpression';\n\n// Keeps track of what filter expression strings that we've seen duplicates of\n// with functions, or which emitted parsing errors for so far\nconst seenParseErrorExpressionStrings = new Set<string>();\nconst seenDuplicateExpressionStrings = new Set<string>();\n\n// Given an optional filter function and an optional filter expression, make\n// sure that at most one of them was given, and return a filter function that\n// does the right thing.\nexport function buildFilterFn(\n filterFunction?: (entity: Entity) => boolean,\n filterExpression?: string,\n): (entity: Entity) => boolean {\n if (\n filterFunction &&\n filterExpression &&\n !seenDuplicateExpressionStrings.has(filterExpression)\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `Duplicate entity filter methods found, both '${filterExpression}' as well as a callback function, which is not permitted - using the callback`,\n );\n seenDuplicateExpressionStrings.add(filterExpression);\n }\n\n const filter = filterFunction || filterExpression;\n if (!filter) {\n return () => true;\n } else if (typeof filter === 'function') {\n return subject => filter(subject);\n }\n\n const result = parseFilterExpression(filter);\n if (\n result.expressionParseErrors.length &&\n !seenParseErrorExpressionStrings.has(filter)\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `Error(s) in entity filter expression '${filter}'`,\n result.expressionParseErrors,\n );\n seenParseErrorExpressionStrings.add(filter);\n }\n\n return result.filterFn;\n}\n\n// Handles the memoized parsing of filter expressions\nexport function FilterWrapper(props: {\n entity: Entity;\n element: React.JSX.Element;\n filterFunction?: (entity: Entity) => boolean;\n filterExpression?: string;\n}) {\n const { entity, element, filterFunction, filterExpression } = props;\n\n const filterFn = useMemo(\n () => buildFilterFn(filterFunction, filterExpression),\n [filterFunction, filterExpression],\n );\n\n return filterFn(entity) ? (\n <Grid item md={6} xs={12}>\n {element}\n </Grid>\n ) : null;\n}\n"],"names":[],"mappings":";;;;AAuBA,MAAM,+BAAA,uBAAsC,GAAY,EAAA
|
|
1
|
+
{"version":3,"file":"FilterWrapper.esm.js","sources":["../../../src/alpha/filter/FilterWrapper.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Grid from '@material-ui/core/Grid';\nimport React, { useMemo } from 'react';\nimport { parseFilterExpression } from './parseFilterExpression';\n\n// Keeps track of what filter expression strings that we've seen duplicates of\n// with functions, or which emitted parsing errors for so far\nconst seenParseErrorExpressionStrings = new Set<string>();\nconst seenDuplicateExpressionStrings = new Set<string>();\n\n// Given an optional filter function and an optional filter expression, make\n// sure that at most one of them was given, and return a filter function that\n// does the right thing.\nexport function buildFilterFn(\n filterFunction?: (entity: Entity) => boolean,\n filterExpression?: string,\n): (entity: Entity) => boolean {\n if (\n filterFunction &&\n filterExpression &&\n !seenDuplicateExpressionStrings.has(filterExpression)\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `Duplicate entity filter methods found, both '${filterExpression}' as well as a callback function, which is not permitted - using the callback`,\n );\n seenDuplicateExpressionStrings.add(filterExpression);\n }\n\n const filter = filterFunction || filterExpression;\n if (!filter) {\n return () => true;\n } else if (typeof filter === 'function') {\n return subject => filter(subject);\n }\n\n const result = parseFilterExpression(filter);\n if (\n result.expressionParseErrors.length &&\n !seenParseErrorExpressionStrings.has(filter)\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `Error(s) in entity filter expression '${filter}'`,\n result.expressionParseErrors,\n );\n seenParseErrorExpressionStrings.add(filter);\n }\n\n return result.filterFn;\n}\n\n// Handles the memoized parsing of filter expressions\nexport function FilterWrapper(props: {\n entity: Entity;\n element: React.JSX.Element;\n filterFunction?: (entity: Entity) => boolean;\n filterExpression?: string;\n}) {\n const { entity, element, filterFunction, filterExpression } = props;\n\n const filterFn = useMemo(\n () => buildFilterFn(filterFunction, filterExpression),\n [filterFunction, filterExpression],\n );\n\n return filterFn(entity) ? (\n <Grid item md={6} xs={12}>\n {element}\n </Grid>\n ) : null;\n}\n"],"names":[],"mappings":";;;;AAuBA,MAAM,+BAAA,uBAAsC,GAAY,EAAA;AACxD,MAAM,8BAAA,uBAAqC,GAAY,EAAA;AAKvC,SAAA,aAAA,CACd,gBACA,gBAC6B,EAAA;AAC7B,EAAA,IACE,kBACA,gBACA,IAAA,CAAC,8BAA+B,CAAA,GAAA,CAAI,gBAAgB,CACpD,EAAA;AAEA,IAAQ,OAAA,CAAA,IAAA;AAAA,MACN,gDAAgD,gBAAgB,CAAA,6EAAA;AAAA,KAClE;AACA,IAAA,8BAAA,CAA+B,IAAI,gBAAgB,CAAA;AAAA;AAGrD,EAAA,MAAM,SAAS,cAAkB,IAAA,gBAAA;AACjC,EAAA,IAAI,CAAC,MAAQ,EAAA;AACX,IAAA,OAAO,MAAM,IAAA;AAAA,GACf,MAAA,IAAW,OAAO,MAAA,KAAW,UAAY,EAAA;AACvC,IAAO,OAAA,CAAA,OAAA,KAAW,OAAO,OAAO,CAAA;AAAA;AAGlC,EAAM,MAAA,MAAA,GAAS,sBAAsB,MAAM,CAAA;AAC3C,EAAA,IACE,OAAO,qBAAsB,CAAA,MAAA,IAC7B,CAAC,+BAAgC,CAAA,GAAA,CAAI,MAAM,CAC3C,EAAA;AAEA,IAAQ,OAAA,CAAA,IAAA;AAAA,MACN,yCAAyC,MAAM,CAAA,CAAA,CAAA;AAAA,MAC/C,MAAO,CAAA;AAAA,KACT;AACA,IAAA,+BAAA,CAAgC,IAAI,MAAM,CAAA;AAAA;AAG5C,EAAA,OAAO,MAAO,CAAA,QAAA;AAChB;AAGO,SAAS,cAAc,KAK3B,EAAA;AACD,EAAA,MAAM,EAAE,MAAA,EAAQ,OAAS,EAAA,cAAA,EAAgB,kBAAqB,GAAA,KAAA;AAE9D,EAAA,MAAM,QAAW,GAAA,OAAA;AAAA,IACf,MAAM,aAAc,CAAA,cAAA,EAAgB,gBAAgB,CAAA;AAAA,IACpD,CAAC,gBAAgB,gBAAgB;AAAA,GACnC;AAEA,EAAA,OAAO,QAAS,CAAA,MAAM,CACpB,mBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,CAAG,EAAA,EAAA,EAAI,EACnB,EAAA,EAAA,OACH,CACE,GAAA,IAAA;AACN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHasMatcher.esm.js","sources":["../../../../src/alpha/filter/matchers/createHasMatcher.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 */\n\nimport { InputError } from '@backstage/errors';\nimport { EntityMatcherFn } from './types';\n\nconst allowedMatchers: Record<string, EntityMatcherFn> = {\n labels: entity => {\n return Object.keys(entity.metadata.labels ?? {}).length > 0;\n },\n links: entity => {\n return (entity.metadata.links ?? []).length > 0;\n },\n};\n\n/**\n * Matches on the non-empty presence of different parts of the entity\n */\nexport function createHasMatcher(\n parameters: string[],\n onParseError: (error: Error) => void,\n): EntityMatcherFn {\n const matchers = parameters.flatMap(parameter => {\n const matcher = allowedMatchers[parameter.toLocaleLowerCase('en-US')];\n if (!matcher) {\n const known = Object.keys(allowedMatchers).map(m => `'${m}'`);\n onParseError(\n new InputError(\n `'${parameter}' is not a valid parameter for 'has' filter expressions, expected one of ${known}`,\n ),\n );\n return [];\n }\n return [matcher];\n });\n\n return entity =>\n matchers.length ? matchers.some(matcher => matcher(entity)) : true;\n}\n"],"names":[],"mappings":";;AAmBA,MAAM,eAAmD,GAAA;AAAA,EACvD,QAAQ,CAAU,MAAA,KAAA;AAChB,IAAO,OAAA,MAAA,CAAO,KAAK,MAAO,CAAA,QAAA,CAAS,UAAU,EAAE,EAAE,MAAS,GAAA,CAAA
|
|
1
|
+
{"version":3,"file":"createHasMatcher.esm.js","sources":["../../../../src/alpha/filter/matchers/createHasMatcher.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 */\n\nimport { InputError } from '@backstage/errors';\nimport { EntityMatcherFn } from './types';\n\nconst allowedMatchers: Record<string, EntityMatcherFn> = {\n labels: entity => {\n return Object.keys(entity.metadata.labels ?? {}).length > 0;\n },\n links: entity => {\n return (entity.metadata.links ?? []).length > 0;\n },\n};\n\n/**\n * Matches on the non-empty presence of different parts of the entity\n */\nexport function createHasMatcher(\n parameters: string[],\n onParseError: (error: Error) => void,\n): EntityMatcherFn {\n const matchers = parameters.flatMap(parameter => {\n const matcher = allowedMatchers[parameter.toLocaleLowerCase('en-US')];\n if (!matcher) {\n const known = Object.keys(allowedMatchers).map(m => `'${m}'`);\n onParseError(\n new InputError(\n `'${parameter}' is not a valid parameter for 'has' filter expressions, expected one of ${known}`,\n ),\n );\n return [];\n }\n return [matcher];\n });\n\n return entity =>\n matchers.length ? matchers.some(matcher => matcher(entity)) : true;\n}\n"],"names":[],"mappings":";;AAmBA,MAAM,eAAmD,GAAA;AAAA,EACvD,QAAQ,CAAU,MAAA,KAAA;AAChB,IAAO,OAAA,MAAA,CAAO,KAAK,MAAO,CAAA,QAAA,CAAS,UAAU,EAAE,EAAE,MAAS,GAAA,CAAA;AAAA,GAC5D;AAAA,EACA,OAAO,CAAU,MAAA,KAAA;AACf,IAAA,OAAA,CAAQ,MAAO,CAAA,QAAA,CAAS,KAAS,IAAA,IAAI,MAAS,GAAA,CAAA;AAAA;AAElD,CAAA;AAKgB,SAAA,gBAAA,CACd,YACA,YACiB,EAAA;AACjB,EAAM,MAAA,QAAA,GAAW,UAAW,CAAA,OAAA,CAAQ,CAAa,SAAA,KAAA;AAC/C,IAAA,MAAM,OAAU,GAAA,eAAA,CAAgB,SAAU,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AACpE,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAM,MAAA,KAAA,GAAQ,OAAO,IAAK,CAAA,eAAe,EAAE,GAAI,CAAA,CAAA,CAAA,KAAK,CAAI,CAAA,EAAA,CAAC,CAAG,CAAA,CAAA,CAAA;AAC5D,MAAA,YAAA;AAAA,QACE,IAAI,UAAA;AAAA,UACF,CAAA,CAAA,EAAI,SAAS,CAAA,yEAAA,EAA4E,KAAK,CAAA;AAAA;AAChG,OACF;AACA,MAAA,OAAO,EAAC;AAAA;AAEV,IAAA,OAAO,CAAC,OAAO,CAAA;AAAA,GAChB,CAAA;AAED,EAAO,OAAA,CAAA,MAAA,KACL,SAAS,MAAS,GAAA,QAAA,CAAS,KAAK,CAAW,OAAA,KAAA,OAAA,CAAQ,MAAM,CAAC,CAAI,GAAA,IAAA;AAClE;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createIsMatcher.esm.js","sources":["../../../../src/alpha/filter/matchers/createIsMatcher.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 */\n\nimport { InputError } from '@backstage/errors';\nimport { EntityMatcherFn } from './types';\n\nconst allowedMatchers: Record<string, EntityMatcherFn> = {\n orphan: entity =>\n Boolean(entity.metadata.annotations?.['backstage.io/orphan']),\n};\n\n/**\n * Matches on different semantic properties of the entity\n */\nexport function createIsMatcher(\n parameters: string[],\n onParseError: (error: Error) => void,\n): EntityMatcherFn {\n const matchers = parameters.flatMap(parameter => {\n const matcher = allowedMatchers[parameter.toLocaleLowerCase('en-US')];\n if (!matcher) {\n const known = Object.keys(allowedMatchers).map(m => `'${m}'`);\n onParseError(\n new InputError(\n `'${parameter}' is not a valid parameter for 'is' filter expressions, expected one of ${known}`,\n ),\n );\n return [];\n }\n return [matcher];\n });\n\n return entity =>\n matchers.length ? matchers.some(matcher => matcher(entity)) : true;\n}\n"],"names":[],"mappings":";;AAmBA,MAAM,eAAmD,GAAA;AAAA,EACvD,QAAQ,CACN,MAAA,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"createIsMatcher.esm.js","sources":["../../../../src/alpha/filter/matchers/createIsMatcher.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 */\n\nimport { InputError } from '@backstage/errors';\nimport { EntityMatcherFn } from './types';\n\nconst allowedMatchers: Record<string, EntityMatcherFn> = {\n orphan: entity =>\n Boolean(entity.metadata.annotations?.['backstage.io/orphan']),\n};\n\n/**\n * Matches on different semantic properties of the entity\n */\nexport function createIsMatcher(\n parameters: string[],\n onParseError: (error: Error) => void,\n): EntityMatcherFn {\n const matchers = parameters.flatMap(parameter => {\n const matcher = allowedMatchers[parameter.toLocaleLowerCase('en-US')];\n if (!matcher) {\n const known = Object.keys(allowedMatchers).map(m => `'${m}'`);\n onParseError(\n new InputError(\n `'${parameter}' is not a valid parameter for 'is' filter expressions, expected one of ${known}`,\n ),\n );\n return [];\n }\n return [matcher];\n });\n\n return entity =>\n matchers.length ? matchers.some(matcher => matcher(entity)) : true;\n}\n"],"names":[],"mappings":";;AAmBA,MAAM,eAAmD,GAAA;AAAA,EACvD,QAAQ,CACN,MAAA,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,qBAAqB,CAAC;AAChE,CAAA;AAKgB,SAAA,eAAA,CACd,YACA,YACiB,EAAA;AACjB,EAAM,MAAA,QAAA,GAAW,UAAW,CAAA,OAAA,CAAQ,CAAa,SAAA,KAAA;AAC/C,IAAA,MAAM,OAAU,GAAA,eAAA,CAAgB,SAAU,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AACpE,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAM,MAAA,KAAA,GAAQ,OAAO,IAAK,CAAA,eAAe,EAAE,GAAI,CAAA,CAAA,CAAA,KAAK,CAAI,CAAA,EAAA,CAAC,CAAG,CAAA,CAAA,CAAA;AAC5D,MAAA,YAAA;AAAA,QACE,IAAI,UAAA;AAAA,UACF,CAAA,CAAA,EAAI,SAAS,CAAA,wEAAA,EAA2E,KAAK,CAAA;AAAA;AAC/F,OACF;AACA,MAAA,OAAO,EAAC;AAAA;AAEV,IAAA,OAAO,CAAC,OAAO,CAAA;AAAA,GAChB,CAAA;AAED,EAAO,OAAA,CAAA,MAAA,KACL,SAAS,MAAS,GAAA,QAAA,CAAS,KAAK,CAAW,OAAA,KAAA,OAAA,CAAQ,MAAM,CAAC,CAAI,GAAA,IAAA;AAClE;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createKindMatcher.esm.js","sources":["../../../../src/alpha/filter/matchers/createKindMatcher.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 */\n\nimport { EntityMatcherFn } from './types';\n\n/**\n * Matches on kind\n */\nexport function createKindMatcher(\n parameters: string[],\n _onParseError: (error: Error) => void,\n): EntityMatcherFn {\n const items = parameters.map(p => p.toLocaleLowerCase('en-US'));\n return entity => items.includes(entity.kind.toLocaleLowerCase('en-US'));\n}\n"],"names":[],"mappings":"AAqBgB,SAAA,iBAAA,CACd,YACA,aACiB,EAAA;AACjB,EAAA,MAAM,QAAQ,UAAW,CAAA,GAAA,CAAI,OAAK,CAAE,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA
|
|
1
|
+
{"version":3,"file":"createKindMatcher.esm.js","sources":["../../../../src/alpha/filter/matchers/createKindMatcher.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 */\n\nimport { EntityMatcherFn } from './types';\n\n/**\n * Matches on kind\n */\nexport function createKindMatcher(\n parameters: string[],\n _onParseError: (error: Error) => void,\n): EntityMatcherFn {\n const items = parameters.map(p => p.toLocaleLowerCase('en-US'));\n return entity => items.includes(entity.kind.toLocaleLowerCase('en-US'));\n}\n"],"names":[],"mappings":"AAqBgB,SAAA,iBAAA,CACd,YACA,aACiB,EAAA;AACjB,EAAA,MAAM,QAAQ,UAAW,CAAA,GAAA,CAAI,OAAK,CAAE,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AAC9D,EAAA,OAAO,YAAU,KAAM,CAAA,QAAA,CAAS,OAAO,IAAK,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AACxE;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTypeMatcher.esm.js","sources":["../../../../src/alpha/filter/matchers/createTypeMatcher.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 */\n\nimport { EntityMatcherFn } from './types';\n\n/**\n * Matches on spec.type\n */\nexport function createTypeMatcher(\n parameters: string[],\n _onParseError: (error: Error) => void,\n): EntityMatcherFn {\n const items = parameters.map(p => p.toLocaleLowerCase('en-US'));\n return entity => {\n const value = entity.spec?.type;\n return (\n typeof value === 'string' &&\n items.includes(value.toLocaleLowerCase('en-US'))\n );\n };\n}\n"],"names":[],"mappings":"AAqBgB,SAAA,iBAAA,CACd,YACA,aACiB,EAAA;AACjB,EAAA,MAAM,QAAQ,UAAW,CAAA,GAAA,CAAI,OAAK,CAAE,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA
|
|
1
|
+
{"version":3,"file":"createTypeMatcher.esm.js","sources":["../../../../src/alpha/filter/matchers/createTypeMatcher.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 */\n\nimport { EntityMatcherFn } from './types';\n\n/**\n * Matches on spec.type\n */\nexport function createTypeMatcher(\n parameters: string[],\n _onParseError: (error: Error) => void,\n): EntityMatcherFn {\n const items = parameters.map(p => p.toLocaleLowerCase('en-US'));\n return entity => {\n const value = entity.spec?.type;\n return (\n typeof value === 'string' &&\n items.includes(value.toLocaleLowerCase('en-US'))\n );\n };\n}\n"],"names":[],"mappings":"AAqBgB,SAAA,iBAAA,CACd,YACA,aACiB,EAAA;AACjB,EAAA,MAAM,QAAQ,UAAW,CAAA,GAAA,CAAI,OAAK,CAAE,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AAC9D,EAAA,OAAO,CAAU,MAAA,KAAA;AACf,IAAM,MAAA,KAAA,GAAQ,OAAO,IAAM,EAAA,IAAA;AAC3B,IACE,OAAA,OAAO,UAAU,QACjB,IAAA,KAAA,CAAM,SAAS,KAAM,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AAAA,GAEnD;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseFilterExpression.esm.js","sources":["../../../src/alpha/filter/parseFilterExpression.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 */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { InputError } from '@backstage/errors';\nimport { EntityMatcherFn } from './matchers/types';\nimport { createKindMatcher } from './matchers/createKindMatcher';\nimport { createTypeMatcher } from './matchers/createTypeMatcher';\nimport { createIsMatcher } from './matchers/createIsMatcher';\nimport { createHasMatcher } from './matchers/createHasMatcher';\n\nconst rootMatcherFactories: Record<\n string,\n (\n parameters: string[],\n onParseError: (error: Error) => void,\n negation?: boolean,\n ) => EntityMatcherFn\n> = {\n kind: createKindMatcher,\n type: createTypeMatcher,\n is: createIsMatcher,\n has: createHasMatcher,\n};\n\n/**\n * Parses a filter expression that decides whether to render an entity component\n * or not. Returns a function that matches entities based on that expression.\n *\n * @remarks\n *\n * Filter strings are on the form `kind:user,group is:orphan`. There's\n * effectively an AND between the space separated parts, and an OR between comma\n * separated parameters. So the example filter string semantically means\n * \"entities that are of either User or Group kind, and also are orphans\".\n *\n * The `expressionParseErrors` array contains any errors that were encountered\n * during initial parsing of the expression. Note that the parts of the input\n * expression that had errors are ignored entirely and parsing continues as if\n * they didn't exist.\n */\nexport function parseFilterExpression(expression: string): {\n filterFn: (entity: Entity) => boolean;\n expressionParseErrors: Error[];\n} {\n const expressionParseErrors: Error[] = [];\n\n const parts = splitFilterExpression(expression, e =>\n expressionParseErrors.push(e),\n );\n const matchers = parts.flatMap(part => {\n const factory = rootMatcherFactories[part.key];\n const negation = part.negation;\n if (!factory) {\n const known = Object.keys(rootMatcherFactories).map(m => `'${m}'`);\n expressionParseErrors.push(\n new InputError(\n `'${part.key}' is not a valid filter expression key, expected one of ${known}`,\n ),\n );\n return [];\n }\n\n const matcher = factory(part.parameters, e =>\n expressionParseErrors.push(e),\n );\n\n return [negation ? (entity: Entity) => !matcher(entity) : matcher];\n });\n\n const filterFn = (entity: Entity) =>\n matchers.every(matcher => {\n try {\n return matcher(entity);\n } catch {\n return false;\n }\n });\n\n return {\n filterFn,\n expressionParseErrors,\n };\n}\n\nexport function splitFilterExpression(\n expression: string,\n onParseError: (error: Error) => void,\n): Array<{ key: string; parameters: string[]; negation: boolean }> {\n const words = expression\n .split(' ')\n .map(w => w.trim())\n .filter(Boolean);\n\n const result = new Array<{\n key: string;\n parameters: string[];\n negation: boolean;\n }>();\n\n for (const word of words) {\n const match = word.match(/^(not:)?([^:]+):(.+)$/);\n if (!match) {\n onParseError(\n new InputError(\n `'${word}' is not a valid filter expression, expected 'key:parameter' form`,\n ),\n );\n continue;\n }\n const key = match[2];\n const parameters = match[3].split(',').filter(Boolean); // silently ignore double commas\n const negation = Boolean(match[1]);\n result.push({ key, parameters, negation });\n }\n\n return result;\n}\n"],"names":[],"mappings":";;;;;;AAwBA,MAAM,oBAOF,GAAA;AAAA,EACF,IAAM,EAAA,iBAAA;AAAA,EACN,IAAM,EAAA,iBAAA;AAAA,EACN,EAAI,EAAA,eAAA;AAAA,EACJ,GAAK,EAAA
|
|
1
|
+
{"version":3,"file":"parseFilterExpression.esm.js","sources":["../../../src/alpha/filter/parseFilterExpression.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 */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { InputError } from '@backstage/errors';\nimport { EntityMatcherFn } from './matchers/types';\nimport { createKindMatcher } from './matchers/createKindMatcher';\nimport { createTypeMatcher } from './matchers/createTypeMatcher';\nimport { createIsMatcher } from './matchers/createIsMatcher';\nimport { createHasMatcher } from './matchers/createHasMatcher';\n\nconst rootMatcherFactories: Record<\n string,\n (\n parameters: string[],\n onParseError: (error: Error) => void,\n negation?: boolean,\n ) => EntityMatcherFn\n> = {\n kind: createKindMatcher,\n type: createTypeMatcher,\n is: createIsMatcher,\n has: createHasMatcher,\n};\n\n/**\n * Parses a filter expression that decides whether to render an entity component\n * or not. Returns a function that matches entities based on that expression.\n *\n * @remarks\n *\n * Filter strings are on the form `kind:user,group is:orphan`. There's\n * effectively an AND between the space separated parts, and an OR between comma\n * separated parameters. So the example filter string semantically means\n * \"entities that are of either User or Group kind, and also are orphans\".\n *\n * The `expressionParseErrors` array contains any errors that were encountered\n * during initial parsing of the expression. Note that the parts of the input\n * expression that had errors are ignored entirely and parsing continues as if\n * they didn't exist.\n */\nexport function parseFilterExpression(expression: string): {\n filterFn: (entity: Entity) => boolean;\n expressionParseErrors: Error[];\n} {\n const expressionParseErrors: Error[] = [];\n\n const parts = splitFilterExpression(expression, e =>\n expressionParseErrors.push(e),\n );\n const matchers = parts.flatMap(part => {\n const factory = rootMatcherFactories[part.key];\n const negation = part.negation;\n if (!factory) {\n const known = Object.keys(rootMatcherFactories).map(m => `'${m}'`);\n expressionParseErrors.push(\n new InputError(\n `'${part.key}' is not a valid filter expression key, expected one of ${known}`,\n ),\n );\n return [];\n }\n\n const matcher = factory(part.parameters, e =>\n expressionParseErrors.push(e),\n );\n\n return [negation ? (entity: Entity) => !matcher(entity) : matcher];\n });\n\n const filterFn = (entity: Entity) =>\n matchers.every(matcher => {\n try {\n return matcher(entity);\n } catch {\n return false;\n }\n });\n\n return {\n filterFn,\n expressionParseErrors,\n };\n}\n\nexport function splitFilterExpression(\n expression: string,\n onParseError: (error: Error) => void,\n): Array<{ key: string; parameters: string[]; negation: boolean }> {\n const words = expression\n .split(' ')\n .map(w => w.trim())\n .filter(Boolean);\n\n const result = new Array<{\n key: string;\n parameters: string[];\n negation: boolean;\n }>();\n\n for (const word of words) {\n const match = word.match(/^(not:)?([^:]+):(.+)$/);\n if (!match) {\n onParseError(\n new InputError(\n `'${word}' is not a valid filter expression, expected 'key:parameter' form`,\n ),\n );\n continue;\n }\n const key = match[2];\n const parameters = match[3].split(',').filter(Boolean); // silently ignore double commas\n const negation = Boolean(match[1]);\n result.push({ key, parameters, negation });\n }\n\n return result;\n}\n"],"names":[],"mappings":";;;;;;AAwBA,MAAM,oBAOF,GAAA;AAAA,EACF,IAAM,EAAA,iBAAA;AAAA,EACN,IAAM,EAAA,iBAAA;AAAA,EACN,EAAI,EAAA,eAAA;AAAA,EACJ,GAAK,EAAA;AACP,CAAA;AAkBO,SAAS,sBAAsB,UAGpC,EAAA;AACA,EAAA,MAAM,wBAAiC,EAAC;AAExC,EAAA,MAAM,KAAQ,GAAA,qBAAA;AAAA,IAAsB,UAAA;AAAA,IAAY,CAAA,CAAA,KAC9C,qBAAsB,CAAA,IAAA,CAAK,CAAC;AAAA,GAC9B;AACA,EAAM,MAAA,QAAA,GAAW,KAAM,CAAA,OAAA,CAAQ,CAAQ,IAAA,KAAA;AACrC,IAAM,MAAA,OAAA,GAAU,oBAAqB,CAAA,IAAA,CAAK,GAAG,CAAA;AAC7C,IAAA,MAAM,WAAW,IAAK,CAAA,QAAA;AACtB,IAAA,IAAI,CAAC,OAAS,EAAA;AAC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,KAAO,EAAA;AACV,MAAA,YAAA;AAAA,QACE,IAAI,UAAA;AAAA,UACF,IAAI,IAAI,CAAA,iEAAA;AAAA;AACV,OACF;AACA,MAAA;AAAA;AAEF,IAAM,MAAA,GAAA,GAAM,MAAM,CAAC,CAAA;AACnB,IAAM,MAAA,UAAA,GAAa,MAAM,CAAC,CAAA,CAAE,MAAM,GAAG,CAAA,CAAE,OAAO,OAAO,CAAA;AACrD,IAAA,MAAM,QAAW,GAAA,OAAA,CAAQ,KAAM,CAAA,CAAC,CAAC,CAAA;AACjC,IAAA,MAAA,CAAO,IAAK,CAAA,EAAE,GAAK,EAAA,UAAA,EAAY,UAAU,CAAA;AAAA;AAG3C,EAAO,OAAA,MAAA;AACT;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.esm.js","sources":["../../src/alpha/filters.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 React from 'react';\nimport { CatalogFilterBlueprint } from './blueprints';\n\nconst catalogTagCatalogFilter = CatalogFilterBlueprint.make({\n name: 'tag',\n params: {\n loader: async () => {\n const { EntityTagPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityTagPicker />;\n },\n },\n});\n\nconst catalogKindCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'kind',\n config: {\n schema: {\n initialFilter: z => z.string().default('component'),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { EntityKindPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityKindPicker initialFilter={config.initialFilter} />;\n },\n });\n },\n});\n\nconst catalogTypeCatalogFilter = CatalogFilterBlueprint.make({\n name: 'type',\n params: {\n loader: async () => {\n const { EntityTypePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityTypePicker />;\n },\n },\n});\n\nconst catalogModeCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'mode',\n config: {\n schema: {\n mode: z => z.enum(['owners-only', 'all']).optional(),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { EntityOwnerPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityOwnerPicker mode={config.mode} />;\n },\n });\n },\n});\n\nconst catalogNamespaceCatalogFilter = CatalogFilterBlueprint.make({\n name: 'namespace',\n params: {\n loader: async () => {\n const { EntityNamespacePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityNamespacePicker />;\n },\n },\n});\n\nconst catalogLifecycleCatalogFilter = CatalogFilterBlueprint.make({\n name: 'lifecycle',\n params: {\n loader: async () => {\n const { EntityLifecyclePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityLifecyclePicker />;\n },\n },\n});\n\nconst catalogProcessingStatusCatalogFilter = CatalogFilterBlueprint.make({\n name: 'processing-status',\n params: {\n loader: async () => {\n const { EntityProcessingStatusPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityProcessingStatusPicker />;\n },\n },\n});\n\nconst catalogListCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'list',\n config: {\n schema: {\n initialFilter: z => z.enum(['owned', 'starred', 'all']).default('owned'),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { UserListPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <UserListPicker initialFilter={config.initialFilter} />;\n },\n });\n },\n});\n\nexport default [\n catalogTagCatalogFilter,\n catalogKindCatalogFilter,\n catalogTypeCatalogFilter,\n catalogModeCatalogFilter,\n catalogNamespaceCatalogFilter,\n catalogLifecycleCatalogFilter,\n catalogProcessingStatusCatalogFilter,\n catalogListCatalogFilter,\n];\n"],"names":[],"mappings":";;;AAmBA,MAAM,uBAAA,GAA0B,uBAAuB,IAAK,CAAA;AAAA,EAC1D,IAAM,EAAA,KAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,QAAQ,YAAY;AAClB,MAAA,MAAM,EAAE,eAAA,EAAoB,GAAA,MAAM,OAChC,iCACF,CAAA
|
|
1
|
+
{"version":3,"file":"filters.esm.js","sources":["../../src/alpha/filters.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 React from 'react';\nimport { CatalogFilterBlueprint } from './blueprints';\n\nconst catalogTagCatalogFilter = CatalogFilterBlueprint.make({\n name: 'tag',\n params: {\n loader: async () => {\n const { EntityTagPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityTagPicker />;\n },\n },\n});\n\nconst catalogKindCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'kind',\n config: {\n schema: {\n initialFilter: z => z.string().default('component'),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { EntityKindPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityKindPicker initialFilter={config.initialFilter} />;\n },\n });\n },\n});\n\nconst catalogTypeCatalogFilter = CatalogFilterBlueprint.make({\n name: 'type',\n params: {\n loader: async () => {\n const { EntityTypePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityTypePicker />;\n },\n },\n});\n\nconst catalogModeCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'mode',\n config: {\n schema: {\n mode: z => z.enum(['owners-only', 'all']).optional(),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { EntityOwnerPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityOwnerPicker mode={config.mode} />;\n },\n });\n },\n});\n\nconst catalogNamespaceCatalogFilter = CatalogFilterBlueprint.make({\n name: 'namespace',\n params: {\n loader: async () => {\n const { EntityNamespacePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityNamespacePicker />;\n },\n },\n});\n\nconst catalogLifecycleCatalogFilter = CatalogFilterBlueprint.make({\n name: 'lifecycle',\n params: {\n loader: async () => {\n const { EntityLifecyclePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityLifecyclePicker />;\n },\n },\n});\n\nconst catalogProcessingStatusCatalogFilter = CatalogFilterBlueprint.make({\n name: 'processing-status',\n params: {\n loader: async () => {\n const { EntityProcessingStatusPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityProcessingStatusPicker />;\n },\n },\n});\n\nconst catalogListCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'list',\n config: {\n schema: {\n initialFilter: z => z.enum(['owned', 'starred', 'all']).default('owned'),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { UserListPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <UserListPicker initialFilter={config.initialFilter} />;\n },\n });\n },\n});\n\nexport default [\n catalogTagCatalogFilter,\n catalogKindCatalogFilter,\n catalogTypeCatalogFilter,\n catalogModeCatalogFilter,\n catalogNamespaceCatalogFilter,\n catalogLifecycleCatalogFilter,\n catalogProcessingStatusCatalogFilter,\n catalogListCatalogFilter,\n];\n"],"names":[],"mappings":";;;AAmBA,MAAM,uBAAA,GAA0B,uBAAuB,IAAK,CAAA;AAAA,EAC1D,IAAM,EAAA,KAAA;AAAA,EACN,MAAQ,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AAM,EAAA,MAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,aAAA,EAAe,CAAK,CAAA,KAAA,CAAA,CAAE,IAAK,CAAA,CAAC,OAAS,EAAA,SAAA,EAAW,KAAK,CAAC,CAAE,CAAA,OAAA,CAAQ,OAAO;AAAA;AACzE,GACF;AAAA,EACA,OAAQ,CAAA,eAAA,EAAiB,EAAE,MAAA,EAAU,EAAA;AACnC,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,QAAQ,YAAY;AAClB,QAAA,MAAM,EAAE,cAAA,EAAmB,GAAA,MAAM,OAC/B,iCACF,CAAA;AACA,QAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,EAAe,aAAe,EAAA,MAAA,CAAO,aAAe,EAAA,CAAA;AAAA;AAC9D,KACD,CAAA;AAAA;AAEL,CAAC,CAAA;AAED,cAAe;AAAA,EACb,uBAAA;AAAA,EACA,wBAAA;AAAA,EACA,wBAAA;AAAA,EACA,wBAAA;AAAA,EACA,6BAAA;AAAA,EACA,6BAAA;AAAA,EACA,oCAAA;AAAA,EACA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navItems.esm.js","sources":["../../src/alpha/navItems.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 HomeIcon from '@material-ui/icons/Home';\nimport { convertLegacyRouteRef } from '@backstage/core-compat-api';\nimport { NavItemBlueprint } from '@backstage/frontend-plugin-api';\nimport { rootRouteRef } from '../routes';\n\nexport const catalogNavItem = NavItemBlueprint.make({\n params: {\n routeRef: convertLegacyRouteRef(rootRouteRef),\n title: 'Catalog',\n icon: HomeIcon,\n },\n});\n\nexport default [catalogNavItem];\n"],"names":[],"mappings":";;;;;AAqBa,MAAA,cAAA,GAAiB,iBAAiB,IAAK,CAAA;AAAA,EAClD,MAAQ,EAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,KAAO,EAAA,SAAA;AAAA,IACP,IAAM,EAAA
|
|
1
|
+
{"version":3,"file":"navItems.esm.js","sources":["../../src/alpha/navItems.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 HomeIcon from '@material-ui/icons/Home';\nimport { convertLegacyRouteRef } from '@backstage/core-compat-api';\nimport { NavItemBlueprint } from '@backstage/frontend-plugin-api';\nimport { rootRouteRef } from '../routes';\n\nexport const catalogNavItem = NavItemBlueprint.make({\n params: {\n routeRef: convertLegacyRouteRef(rootRouteRef),\n title: 'Catalog',\n icon: HomeIcon,\n },\n});\n\nexport default [catalogNavItem];\n"],"names":[],"mappings":";;;;;AAqBa,MAAA,cAAA,GAAiB,iBAAiB,IAAK,CAAA;AAAA,EAClD,MAAQ,EAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,KAAO,EAAA,SAAA;AAAA,IACP,IAAM,EAAA;AAAA;AAEV,CAAC;AAED,eAAe,CAAC,cAAc,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.esm.js","sources":["../../src/alpha/pages.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 React from 'react';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport {\n coreExtensionData,\n createExtensionInput,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n AsyncEntityProvider,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { rootRouteRef } from '../routes';\nimport { useEntityFromUrl } from '../components/CatalogEntityPage/useEntityFromUrl';\nimport { buildFilterFn } from './filter/FilterWrapper';\n\nexport const catalogPage = PageBlueprint.makeWithOverrides({\n inputs: {\n filters: createExtensionInput([coreExtensionData.reactElement]),\n },\n factory(originalFactory, { inputs }) {\n return originalFactory({\n defaultPath: '/catalog',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: async () => {\n const { BaseCatalogPage } = await import('../components/CatalogPage');\n const filters = inputs.filters.map(filter =>\n filter.get(coreExtensionData.reactElement),\n );\n return compatWrapper(<BaseCatalogPage filters={<>{filters}</>} />);\n },\n });\n },\n});\n\nexport const catalogEntityPage = PageBlueprint.makeWithOverrides({\n name: 'entity',\n inputs: {\n contents: createExtensionInput([\n coreExtensionData.reactElement,\n coreExtensionData.routePath,\n coreExtensionData.routeRef.optional(),\n EntityContentBlueprint.dataRefs.title,\n EntityContentBlueprint.dataRefs.filterFunction.optional(),\n EntityContentBlueprint.dataRefs.filterExpression.optional(),\n ]),\n },\n factory(originalFactory, { inputs }) {\n return originalFactory({\n defaultPath: '/catalog/:namespace/:kind/:name',\n routeRef: convertLegacyRouteRef(entityRouteRef),\n loader: async () => {\n const { EntityLayout } = await import('../components/EntityLayout');\n const Component = () => {\n return (\n <AsyncEntityProvider {...useEntityFromUrl()}>\n <EntityLayout>\n {inputs.contents.map(output => {\n return (\n <EntityLayout.Route\n key={output.get(coreExtensionData.routePath)}\n path={output.get(coreExtensionData.routePath)}\n title={output.get(EntityContentBlueprint.dataRefs.title)}\n if={buildFilterFn(\n output.get(\n EntityContentBlueprint.dataRefs.filterFunction,\n ),\n output.get(\n EntityContentBlueprint.dataRefs.filterExpression,\n ),\n )}\n >\n {output.get(coreExtensionData.reactElement)}\n </EntityLayout.Route>\n );\n })}\n </EntityLayout>\n </AsyncEntityProvider>\n );\n };\n return compatWrapper(<Component />);\n },\n });\n },\n});\n\nexport default [catalogPage, catalogEntityPage];\n"],"names":[],"mappings":";;;;;;;;;AAmCa,MAAA,WAAA,GAAc,cAAc,iBAAkB,CAAA;AAAA,EACzD,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"pages.esm.js","sources":["../../src/alpha/pages.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 React from 'react';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport {\n coreExtensionData,\n createExtensionInput,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n AsyncEntityProvider,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { rootRouteRef } from '../routes';\nimport { useEntityFromUrl } from '../components/CatalogEntityPage/useEntityFromUrl';\nimport { buildFilterFn } from './filter/FilterWrapper';\n\nexport const catalogPage = PageBlueprint.makeWithOverrides({\n inputs: {\n filters: createExtensionInput([coreExtensionData.reactElement]),\n },\n factory(originalFactory, { inputs }) {\n return originalFactory({\n defaultPath: '/catalog',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: async () => {\n const { BaseCatalogPage } = await import('../components/CatalogPage');\n const filters = inputs.filters.map(filter =>\n filter.get(coreExtensionData.reactElement),\n );\n return compatWrapper(<BaseCatalogPage filters={<>{filters}</>} />);\n },\n });\n },\n});\n\nexport const catalogEntityPage = PageBlueprint.makeWithOverrides({\n name: 'entity',\n inputs: {\n contents: createExtensionInput([\n coreExtensionData.reactElement,\n coreExtensionData.routePath,\n coreExtensionData.routeRef.optional(),\n EntityContentBlueprint.dataRefs.title,\n EntityContentBlueprint.dataRefs.filterFunction.optional(),\n EntityContentBlueprint.dataRefs.filterExpression.optional(),\n ]),\n },\n factory(originalFactory, { inputs }) {\n return originalFactory({\n defaultPath: '/catalog/:namespace/:kind/:name',\n routeRef: convertLegacyRouteRef(entityRouteRef),\n loader: async () => {\n const { EntityLayout } = await import('../components/EntityLayout');\n const Component = () => {\n return (\n <AsyncEntityProvider {...useEntityFromUrl()}>\n <EntityLayout>\n {inputs.contents.map(output => {\n return (\n <EntityLayout.Route\n key={output.get(coreExtensionData.routePath)}\n path={output.get(coreExtensionData.routePath)}\n title={output.get(EntityContentBlueprint.dataRefs.title)}\n if={buildFilterFn(\n output.get(\n EntityContentBlueprint.dataRefs.filterFunction,\n ),\n output.get(\n EntityContentBlueprint.dataRefs.filterExpression,\n ),\n )}\n >\n {output.get(coreExtensionData.reactElement)}\n </EntityLayout.Route>\n );\n })}\n </EntityLayout>\n </AsyncEntityProvider>\n );\n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AA;AAAA;AAEL,CAAC;AAED,YAAe,CAAC,aAAa,iBAAiB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.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 { convertLegacyRouteRefs } from '@backstage/core-compat-api';\nimport { createFrontendPlugin } from '@backstage/frontend-plugin-api';\n\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\n\nimport {\n createComponentRouteRef,\n createFromTemplateRouteRef,\n rootRouteRef,\n unregisterRedirectRouteRef,\n viewTechDocRouteRef,\n} from '../routes';\n\nimport apis from './apis';\nimport pages from './pages';\nimport filters from './filters';\nimport navItems from './navItems';\nimport entityCards from './entityCards';\nimport entityContents from './entityContents';\nimport searchResultItems from './searchResultItems';\n\n/** @alpha */\nexport default createFrontendPlugin({\n id: 'catalog',\n routes: convertLegacyRouteRefs({\n catalogIndex: rootRouteRef,\n catalogEntity: entityRouteRef,\n }),\n externalRoutes: convertLegacyRouteRefs({\n viewTechDoc: viewTechDocRouteRef,\n createComponent: createComponentRouteRef,\n createFromTemplate: createFromTemplateRouteRef,\n unregisterRedirect: unregisterRedirectRouteRef,\n }),\n extensions: [\n ...apis,\n ...pages,\n ...filters,\n ...navItems,\n ...entityCards,\n ...entityContents,\n ...searchResultItems,\n ],\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAsCA,aAAe,oBAAqB,CAAA;AAAA,EAClC,EAAI,EAAA,SAAA;AAAA,EACJ,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,YAAc,EAAA,YAAA;AAAA,IACd,aAAe,EAAA
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.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 { convertLegacyRouteRefs } from '@backstage/core-compat-api';\nimport { createFrontendPlugin } from '@backstage/frontend-plugin-api';\n\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\n\nimport {\n createComponentRouteRef,\n createFromTemplateRouteRef,\n rootRouteRef,\n unregisterRedirectRouteRef,\n viewTechDocRouteRef,\n} from '../routes';\n\nimport apis from './apis';\nimport pages from './pages';\nimport filters from './filters';\nimport navItems from './navItems';\nimport entityCards from './entityCards';\nimport entityContents from './entityContents';\nimport searchResultItems from './searchResultItems';\n\n/** @alpha */\nexport default createFrontendPlugin({\n id: 'catalog',\n routes: convertLegacyRouteRefs({\n catalogIndex: rootRouteRef,\n catalogEntity: entityRouteRef,\n }),\n externalRoutes: convertLegacyRouteRefs({\n viewTechDoc: viewTechDocRouteRef,\n createComponent: createComponentRouteRef,\n createFromTemplate: createFromTemplateRouteRef,\n unregisterRedirect: unregisterRedirectRouteRef,\n }),\n extensions: [\n ...apis,\n ...pages,\n ...filters,\n ...navItems,\n ...entityCards,\n ...entityContents,\n ...searchResultItems,\n ],\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAsCA,aAAe,oBAAqB,CAAA;AAAA,EAClC,EAAI,EAAA,SAAA;AAAA,EACJ,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,YAAc,EAAA,YAAA;AAAA,IACd,aAAe,EAAA;AAAA,GAChB,CAAA;AAAA,EACD,gBAAgB,sBAAuB,CAAA;AAAA,IACrC,WAAa,EAAA,mBAAA;AAAA,IACb,eAAiB,EAAA,uBAAA;AAAA,IACjB,kBAAoB,EAAA,0BAAA;AAAA,IACpB,kBAAoB,EAAA;AAAA,GACrB,CAAA;AAAA,EACD,UAAY,EAAA;AAAA,IACV,GAAG,IAAA;AAAA,IACH,GAAG,KAAA;AAAA,IACH,GAAG,OAAA;AAAA,IACH,GAAG,QAAA;AAAA,IACH,GAAG,WAAA;AAAA,IACH,GAAG,cAAA;AAAA,IACH,GAAG;AAAA;AAEP,CAAC,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchResultItems.esm.js","sources":["../../src/alpha/searchResultItems.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 { SearchResultListItemBlueprint } from '@backstage/plugin-search-react/alpha';\n\nexport const catalogSearchResultListItem = SearchResultListItemBlueprint.make({\n params: {\n predicate: result => result.type === 'software-catalog',\n component: () =>\n import('../components/CatalogSearchResultListItem').then(\n m => m.CatalogSearchResultListItem,\n ),\n },\n});\n\nexport default [catalogSearchResultListItem];\n"],"names":[],"mappings":";;AAkBa,MAAA,2BAAA,GAA8B,8BAA8B,IAAK,CAAA;AAAA,EAC5E,MAAQ,EAAA;AAAA,IACN,SAAA,EAAW,CAAU,MAAA,KAAA,MAAA,CAAO,IAAS,KAAA,kBAAA;AAAA,IACrC,SAAW,EAAA,MACT,OAAO,wDAA2C,CAAE,CAAA,IAAA;AAAA,MAClD,OAAK,CAAE,CAAA
|
|
1
|
+
{"version":3,"file":"searchResultItems.esm.js","sources":["../../src/alpha/searchResultItems.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 { SearchResultListItemBlueprint } from '@backstage/plugin-search-react/alpha';\n\nexport const catalogSearchResultListItem = SearchResultListItemBlueprint.make({\n params: {\n predicate: result => result.type === 'software-catalog',\n component: () =>\n import('../components/CatalogSearchResultListItem').then(\n m => m.CatalogSearchResultListItem,\n ),\n },\n});\n\nexport default [catalogSearchResultListItem];\n"],"names":[],"mappings":";;AAkBa,MAAA,2BAAA,GAA8B,8BAA8B,IAAK,CAAA;AAAA,EAC5E,MAAQ,EAAA;AAAA,IACN,SAAA,EAAW,CAAU,MAAA,KAAA,MAAA,CAAO,IAAS,KAAA,kBAAA;AAAA,IACrC,SAAW,EAAA,MACT,OAAO,wDAA2C,CAAE,CAAA,IAAA;AAAA,MAClD,OAAK,CAAE,CAAA;AAAA;AACT;AAEN,CAAC;AAED,wBAAe,CAAC,2BAA2B,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.esm.js","sources":["../../src/alpha/translation.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 */\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 & zoo to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,wBAAwB,oBAAqB,CAAA;AAAA,EACxD,EAAI,EAAA,SAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,SAAW,EAAA;AAAA,MACT,KAAO,EAAA,CAAA,mBAAA,CAAA;AAAA,MACP,iBAAmB,EAAA,QAAA;AAAA,MACnB,oBAAsB,EAAA
|
|
1
|
+
{"version":3,"file":"translation.esm.js","sources":["../../src/alpha/translation.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 */\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 & zoo to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,wBAAwB,oBAAqB,CAAA;AAAA,EACxD,EAAI,EAAA,SAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,SAAW,EAAA;AAAA,MACT,KAAO,EAAA,CAAA,mBAAA,CAAA;AAAA,MACP,iBAAmB,EAAA,QAAA;AAAA,MACnB,oBAAsB,EAAA;AAAA,KACxB;AAAA,IACA,SAAW,EAAA;AAAA,MACT,KAAO,EAAA,OAAA;AAAA,MACP,kBAAoB,EAAA,yBAAA;AAAA,MACpB,eAAiB,EAAA,eAAA;AAAA,MACjB,wBAA0B,EAAA,0BAAA;AAAA,MAC1B,uBAAyB,EAAA,mBAAA;AAAA,MACzB,cAAgB,EAAA,iBAAA;AAAA,MAChB,YAAc,EAAA,eAAA;AAAA,MACd,UAAY,EAAA,aAAA;AAAA,MACZ,gBAAkB,EAAA;AAAA,QAChB,KAAO,EAAA,aAAA;AAAA,QACP,KAAO,EAAA;AAAA,OACT;AAAA,MACA,UAAY,EAAA;AAAA,QACV,KAAO,EAAA,OAAA;AAAA,QACP,KAAO,EAAA;AAAA,OACT;AAAA,MACA,WAAa,EAAA;AAAA,QACX,KAAO,EAAA,QAAA;AAAA,QACP,KAAO,EAAA;AAAA,OACT;AAAA,MACA,WAAa,EAAA;AAAA,QACX,KAAO,EAAA,QAAA;AAAA,QACP,KAAO,EAAA;AAAA,OACT;AAAA,MACA,oBAAsB,EAAA;AAAA,QACpB,KAAO,EAAA,kBAAA;AAAA,QACP,KAAO,EAAA;AAAA,OACT;AAAA,M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@
|
|
|
1
|
-
{"version":3,"file":"DefaultEntityPresentationApi.esm.js","sources":["../../../src/apis/EntityPresentationApi/DefaultEntityPresentationApi.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 */\n\nimport {\n Entity,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { IconComponent } from '@backstage/core-plugin-api';\nimport {\n CatalogApi,\n EntityPresentationApi,\n EntityRefPresentation,\n EntityRefPresentationSnapshot,\n} from '@backstage/plugin-catalog-react';\nimport { durationToMilliseconds, HumanDuration } from '@backstage/types';\nimport DataLoader from 'dataloader';\nimport ExpiryMap from 'expiry-map';\nimport ObservableImpl from 'zen-observable';\nimport {\n createDefaultRenderer,\n DEFAULT_BATCH_DELAY,\n DEFAULT_CACHE_TTL,\n DEFAULT_ICONS,\n} from './defaults';\n\n/**\n * A custom renderer for the {@link DefaultEntityPresentationApi}.\n *\n * @public\n */\nexport interface DefaultEntityPresentationApiRenderer {\n /**\n * Whether to request the entity from the catalog API asynchronously.\n *\n * @remarks\n *\n * If this is set to true, entity data will be streamed in from the catalog\n * whenever needed, and the render function may be called more than once:\n * first when no entity data existed (or with old cached data), and then again\n * at a later point when data is loaded from the catalog that proved to be\n * different from the old one.\n *\n * @defaultValue true\n */\n async?: boolean;\n\n /**\n * The actual render function.\n *\n * @remarks\n *\n * This function may be called multiple times.\n *\n * The loading flag signals that the framework MAY be trying to load more\n * entity data from the catalog and call the render function again, if it\n * succeeds. In some cases you may want to render a loading state in that\n * case.\n *\n * The entity may or may not be given. If the caller of the presentation API\n * did present an entity upfront, then that's what will be passed in here.\n * Otherwise, it may be a server-side entity that either comes from a local\n * cache or directly from the server.\n *\n * In either case, the renderer should return a presentation that is the most\n * useful possible for the end user, given the data that is available.\n */\n render: (options: {\n entityRef: string;\n loading: boolean;\n entity: Entity | undefined;\n context: {\n defaultKind?: string;\n defaultNamespace?: string;\n };\n }) => {\n snapshot: Omit<EntityRefPresentationSnapshot, 'entityRef'>;\n };\n}\n\n/**\n * Options for the {@link DefaultEntityPresentationApi}.\n *\n * @public\n */\nexport interface DefaultEntityPresentationApiOptions {\n /**\n * The catalog API to use. If you want to use any asynchronous features, you\n * must supply one.\n */\n catalogApi?: CatalogApi;\n\n /**\n * When to expire entities that have been loaded from the catalog API and\n * cached for a while.\n *\n * @defaultValue 10 seconds\n * @remarks\n *\n * The higher this value, the lower the load on the catalog API, but also the\n * higher the risk of users seeing stale data.\n */\n cacheTtl?: HumanDuration;\n\n /**\n * For how long to wait before sending a batch of entity references to the\n * catalog API.\n *\n * @defaultValue 50 milliseconds\n * @remarks\n *\n * The higher this value, the greater the chance of batching up requests from\n * across a page, but also the longer the lag time before displaying accurate\n * information.\n */\n batchDelay?: HumanDuration;\n\n /**\n * A mapping from kinds to icons.\n *\n * @remarks\n *\n * The keys are kinds (case insensitive) that map to icon values to represent\n * kinds by. These are merged with the default set of icons.\n */\n kindIcons?: Record<string, IconComponent>;\n\n /**\n * A custom renderer, if any.\n */\n renderer?: DefaultEntityPresentationApiRenderer;\n}\n\ninterface CacheEntry {\n updatedAt: number;\n entity: Entity | undefined;\n}\n\n/**\n * Default implementation of the {@link @backstage/plugin-catalog-react#EntityPresentationApi}.\n *\n * @public\n */\nexport class DefaultEntityPresentationApi implements EntityPresentationApi {\n /**\n * Creates a new presentation API that does not reach out to the catalog.\n */\n static createLocal(): EntityPresentationApi {\n return new DefaultEntityPresentationApi({\n renderer: createDefaultRenderer({ async: false }),\n });\n }\n\n /**\n * Creates a new presentation API that calls out to the catalog as needed to\n * get additional information about entities.\n */\n static create(\n options: DefaultEntityPresentationApiOptions,\n ): EntityPresentationApi {\n return new DefaultEntityPresentationApi(options);\n }\n\n // This cache holds on to all entity data ever loaded, no matter how old. Each\n // entry is tagged with a timestamp of when it was inserted. We use this map\n // to be able to always render SOME data even though the information is old.\n // Entities change very rarely, so it's likely that the rendered information\n // was perfectly fine in the first place.\n readonly #cache: Map<string, CacheEntry>;\n readonly #cacheTtlMs: number;\n readonly #loader: DataLoader<string, Entity | undefined> | undefined;\n readonly #kindIcons: Record<string, IconComponent>; // lowercased kinds\n readonly #renderer: DefaultEntityPresentationApiRenderer;\n\n private constructor(options: DefaultEntityPresentationApiOptions) {\n const cacheTtl = options.cacheTtl ?? DEFAULT_CACHE_TTL;\n const batchDelay = options.batchDelay ?? DEFAULT_BATCH_DELAY;\n const renderer = options.renderer ?? createDefaultRenderer({ async: true });\n\n const kindIcons: Record<string, IconComponent> = {};\n Object.entries(DEFAULT_ICONS).forEach(([kind, icon]) => {\n kindIcons[kind.toLocaleLowerCase('en-US')] = icon;\n });\n Object.entries(options.kindIcons ?? {}).forEach(([kind, icon]) => {\n kindIcons[kind.toLocaleLowerCase('en-US')] = icon;\n });\n\n if (renderer.async) {\n if (!options.catalogApi) {\n throw new TypeError(`Asynchronous rendering requires a catalog API`);\n }\n this.#loader = this.#createLoader({\n cacheTtl,\n batchDelay,\n renderer,\n catalogApi: options.catalogApi,\n });\n }\n\n this.#cacheTtlMs = durationToMilliseconds(cacheTtl);\n this.#cache = new Map();\n this.#kindIcons = kindIcons;\n this.#renderer = renderer;\n }\n\n /** {@inheritdoc @backstage/plugin-catalog-react#EntityPresentationApi.forEntity} */\n forEntity(\n entityOrRef: Entity | string,\n context?: {\n defaultKind?: string;\n defaultNamespace?: string;\n },\n ): EntityRefPresentation {\n const { entityRef, kind, entity, needsLoad } =\n this.#getEntityForInitialRender(entityOrRef);\n\n // Make a wrapping helper for rendering\n const render = (options: {\n loading: boolean;\n entity?: Entity;\n }): EntityRefPresentationSnapshot => {\n const { snapshot } = this.#renderer.render({\n entityRef: entityRef,\n loading: options.loading,\n entity: options.entity,\n context: context || {},\n });\n return {\n ...snapshot,\n entityRef: entityRef,\n Icon: this.#maybeFallbackIcon(snapshot.Icon, kind),\n };\n };\n\n // First the initial render\n let initialSnapshot: EntityRefPresentationSnapshot;\n try {\n initialSnapshot = render({\n loading: needsLoad,\n entity: entity,\n });\n } catch {\n // This is what gets presented if the renderer throws an error\n initialSnapshot = {\n primaryTitle: entityRef,\n entityRef: entityRef,\n };\n }\n\n if (!needsLoad) {\n return {\n snapshot: initialSnapshot,\n promise: Promise.resolve(initialSnapshot),\n };\n }\n\n // Load the entity and render it\n const maybeUpdatedSnapshot = Promise.resolve()\n .then(() => {\n return this.#loader?.load(entityRef);\n })\n .then(newEntity => {\n // We re-render no matter if we get back a new entity or the old\n // one or nothing, because of the now false loading state - in\n // case the renderer outputs different data depending on that\n return render({\n loading: false,\n entity: newEntity ?? entity,\n });\n })\n .catch(() => {\n // Intentionally ignored - we do not propagate errors to the\n // caller here. The presentation API should be error free and\n // always return SOMETHING that makes sense to render, and we have\n // already ensured above that the initial snapshot was that.\n return undefined;\n });\n\n const observable = new ObservableImpl<EntityRefPresentationSnapshot>(\n subscriber => {\n let aborted = false;\n\n maybeUpdatedSnapshot\n .then(updatedSnapshot => {\n if (updatedSnapshot) {\n subscriber.next(updatedSnapshot);\n }\n })\n .finally(() => {\n if (!aborted) {\n subscriber.complete();\n }\n });\n\n return () => {\n aborted = true;\n };\n },\n );\n\n const promise = maybeUpdatedSnapshot.then(updatedSnapshot => {\n return updatedSnapshot ?? initialSnapshot;\n });\n\n return {\n snapshot: initialSnapshot,\n update$: observable,\n promise: promise,\n };\n }\n\n #getEntityForInitialRender(entityOrRef: Entity | string): {\n entity: Entity | undefined;\n kind: string;\n entityRef: string;\n needsLoad: boolean;\n } {\n // If we were given an entity in the first place, we use it for a single\n // pass of rendering and assume that it's up to date and not partial (i.e.\n // we expect that it wasn't fetched in such a way that the required fields\n // of the renderer were excluded)\n if (typeof entityOrRef !== 'string') {\n return {\n entity: entityOrRef,\n kind: entityOrRef.kind,\n entityRef: stringifyEntityRef(entityOrRef),\n needsLoad: false,\n };\n }\n\n const cached = this.#cache.get(entityOrRef);\n const cachedEntity: Entity | undefined = cached?.entity;\n const cacheNeedsUpdate =\n !cached || Date.now() - cached.updatedAt > this.#cacheTtlMs;\n const needsLoad =\n cacheNeedsUpdate &&\n this.#renderer.async !== false &&\n this.#loader !== undefined;\n\n return {\n entity: cachedEntity,\n kind: parseEntityRef(entityOrRef).kind,\n entityRef: entityOrRef,\n needsLoad,\n };\n }\n\n #createLoader(options: {\n catalogApi: CatalogApi;\n cacheTtl: HumanDuration;\n batchDelay: HumanDuration;\n renderer: DefaultEntityPresentationApiRenderer;\n }): DataLoader<string, Entity | undefined> {\n const cacheTtlMs = durationToMilliseconds(options.cacheTtl);\n const batchDelayMs = durationToMilliseconds(options.batchDelay);\n\n return new DataLoader(\n async (entityRefs: readonly string[]) => {\n const { items } = await options.catalogApi!.getEntitiesByRefs({\n entityRefs: entityRefs as string[],\n fields: [\n 'kind',\n 'metadata.name',\n 'metadata.namespace',\n 'metadata.title',\n 'metadata.description',\n 'spec.profile.displayName',\n 'spec.type',\n ],\n });\n\n const now = Date.now();\n entityRefs.forEach((entityRef, index) => {\n this.#cache.set(entityRef, {\n updatedAt: now,\n entity: items[index],\n });\n });\n\n return items;\n },\n {\n name: 'DefaultEntityPresentationApi',\n // This cache is the one that the data loader uses internally for\n // memoizing requests; essentially what it achieves is that multiple\n // requests for the same entity ref will be batched up into a single\n // request and then the resulting promises are held on to. We put an\n // expiring map here, which makes it so that it re-fetches data with the\n // expiry cadence of that map. Otherwise it would only fetch a given ref\n // once and then never try again. This cache does therefore not fulfill\n // the same purpose as the one that is in the root of the class.\n cacheMap: new ExpiryMap(cacheTtlMs),\n maxBatchSize: 100,\n batchScheduleFn: batchDelayMs\n ? cb => setTimeout(cb, batchDelayMs)\n : undefined,\n },\n );\n }\n\n #maybeFallbackIcon(\n renderedIcon: IconComponent | false | undefined,\n kind: string,\n ): IconComponent | false | undefined {\n if (renderedIcon) {\n return renderedIcon;\n } else if (renderedIcon === false) {\n return false;\n }\n\n return this.#kindIcons[kind.toLocaleLowerCase('en-US')];\n }\n}\n"],"names":[],"mappings":";;;;;;;AA4JO,MAAM,4BAA8D,CAAA;AAAA;AAAA;AAAA;AAAA,EAIzE,OAAO,WAAqC,GAAA;AAC1C,IAAA,OAAO,IAAI,4BAA6B,CAAA;AAAA,MACtC,QAAU,EAAA,qBAAA,CAAsB,EAAE,KAAA,EAAO,OAAO,CAAA;AAAA,KACjD,CAAA,CAAA;AAAA,GACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,OACL,OACuB,EAAA;AACvB,IAAO,OAAA,IAAI,6BAA6B,OAAO,CAAA,CAAA;AAAA,GACjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOS,MAAA,CAAA;AAAA,EACA,WAAA,CAAA;AAAA,EACA,OAAA,CAAA;AAAA,EACA,UAAA,CAAA;AAAA;AAAA,EACA,SAAA,CAAA;AAAA,EAED,YAAY,OAA8C,EAAA;AAChE,IAAM,MAAA,QAAA,GAAW,QAAQ,QAAY,IAAA,iBAAA,CAAA;AACrC,IAAM,MAAA,UAAA,GAAa,QAAQ,UAAc,IAAA,mBAAA,CAAA;AACzC,IAAA,MAAM,WAAW,OAAQ,CAAA,QAAA,IAAY,sBAAsB,EAAE,KAAA,EAAO,MAAM,CAAA,CAAA;AAE1E,IAAA,MAAM,YAA2C,EAAC,CAAA;AAClD,IAAO,MAAA,CAAA,OAAA,CAAQ,aAAa,CAAE,CAAA,OAAA,CAAQ,CAAC,CAAC,IAAA,EAAM,IAAI,CAAM,KAAA;AACtD,MAAA,SAAA,CAAU,IAAK,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAI,GAAA,IAAA,CAAA;AAAA,KAC9C,CAAA,CAAA;AACD,IAAO,MAAA,CAAA,OAAA,CA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EAAI,YAAY,CACjC,GAAA,KAAA,CAAA;AAAA,OACN;AAAA,KACF,CAAA;AAAA,GACF;AAAA,EAEA,kBAAA,CACE,cACA,IACmC,EAAA;AACnC,IAAA,IAAI,YAAc,EAAA;AAChB,MAAO,OAAA,YAAA,CAAA;AAAA,KACT,MAAA,IAAW,iBAAiB,KAAO,EAAA;AACjC,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IAAA,OAAO,IAAK,CAAA,UAAA,CAAW,IAAK,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA,CAAA;AAAA,GACxD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"DefaultEntityPresentationApi.esm.js","sources":["../../../src/apis/EntityPresentationApi/DefaultEntityPresentationApi.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 */\n\nimport {\n Entity,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { IconComponent } from '@backstage/core-plugin-api';\nimport {\n CatalogApi,\n EntityPresentationApi,\n EntityRefPresentation,\n EntityRefPresentationSnapshot,\n} from '@backstage/plugin-catalog-react';\nimport { durationToMilliseconds, HumanDuration } from '@backstage/types';\nimport DataLoader from 'dataloader';\nimport ExpiryMap from 'expiry-map';\nimport ObservableImpl from 'zen-observable';\nimport {\n createDefaultRenderer,\n DEFAULT_BATCH_DELAY,\n DEFAULT_CACHE_TTL,\n DEFAULT_ICONS,\n} from './defaults';\n\n/**\n * A custom renderer for the {@link DefaultEntityPresentationApi}.\n *\n * @public\n */\nexport interface DefaultEntityPresentationApiRenderer {\n /**\n * Whether to request the entity from the catalog API asynchronously.\n *\n * @remarks\n *\n * If this is set to true, entity data will be streamed in from the catalog\n * whenever needed, and the render function may be called more than once:\n * first when no entity data existed (or with old cached data), and then again\n * at a later point when data is loaded from the catalog that proved to be\n * different from the old one.\n *\n * @defaultValue true\n */\n async?: boolean;\n\n /**\n * The actual render function.\n *\n * @remarks\n *\n * This function may be called multiple times.\n *\n * The loading flag signals that the framework MAY be trying to load more\n * entity data from the catalog and call the render function again, if it\n * succeeds. In some cases you may want to render a loading state in that\n * case.\n *\n * The entity may or may not be given. If the caller of the presentation API\n * did present an entity upfront, then that's what will be passed in here.\n * Otherwise, it may be a server-side entity that either comes from a local\n * cache or directly from the server.\n *\n * In either case, the renderer should return a presentation that is the most\n * useful possible for the end user, given the data that is available.\n */\n render: (options: {\n entityRef: string;\n loading: boolean;\n entity: Entity | undefined;\n context: {\n defaultKind?: string;\n defaultNamespace?: string;\n };\n }) => {\n snapshot: Omit<EntityRefPresentationSnapshot, 'entityRef'>;\n };\n}\n\n/**\n * Options for the {@link DefaultEntityPresentationApi}.\n *\n * @public\n */\nexport interface DefaultEntityPresentationApiOptions {\n /**\n * The catalog API to use. If you want to use any asynchronous features, you\n * must supply one.\n */\n catalogApi?: CatalogApi;\n\n /**\n * When to expire entities that have been loaded from the catalog API and\n * cached for a while.\n *\n * @defaultValue 10 seconds\n * @remarks\n *\n * The higher this value, the lower the load on the catalog API, but also the\n * higher the risk of users seeing stale data.\n */\n cacheTtl?: HumanDuration;\n\n /**\n * For how long to wait before sending a batch of entity references to the\n * catalog API.\n *\n * @defaultValue 50 milliseconds\n * @remarks\n *\n * The higher this value, the greater the chance of batching up requests from\n * across a page, but also the longer the lag time before displaying accurate\n * information.\n */\n batchDelay?: HumanDuration;\n\n /**\n * A mapping from kinds to icons.\n *\n * @remarks\n *\n * The keys are kinds (case insensitive) that map to icon values to represent\n * kinds by. These are merged with the default set of icons.\n */\n kindIcons?: Record<string, IconComponent>;\n\n /**\n * A custom renderer, if any.\n */\n renderer?: DefaultEntityPresentationApiRenderer;\n}\n\ninterface CacheEntry {\n updatedAt: number;\n entity: Entity | undefined;\n}\n\n/**\n * Default implementation of the {@link @backstage/plugin-catalog-react#EntityPresentationApi}.\n *\n * @public\n */\nexport class DefaultEntityPresentationApi implements EntityPresentationApi {\n /**\n * Creates a new presentation API that does not reach out to the catalog.\n */\n static createLocal(): EntityPresentationApi {\n return new DefaultEntityPresentationApi({\n renderer: createDefaultRenderer({ async: false }),\n });\n }\n\n /**\n * Creates a new presentation API that calls out to the catalog as needed to\n * get additional information about entities.\n */\n static create(\n options: DefaultEntityPresentationApiOptions,\n ): EntityPresentationApi {\n return new DefaultEntityPresentationApi(options);\n }\n\n // This cache holds on to all entity data ever loaded, no matter how old. Each\n // entry is tagged with a timestamp of when it was inserted. We use this map\n // to be able to always render SOME data even though the information is old.\n // Entities change very rarely, so it's likely that the rendered information\n // was perfectly fine in the first place.\n readonly #cache: Map<string, CacheEntry>;\n readonly #cacheTtlMs: number;\n readonly #loader: DataLoader<string, Entity | undefined> | undefined;\n readonly #kindIcons: Record<string, IconComponent>; // lowercased kinds\n readonly #renderer: DefaultEntityPresentationApiRenderer;\n\n private constructor(options: DefaultEntityPresentationApiOptions) {\n const cacheTtl = options.cacheTtl ?? DEFAULT_CACHE_TTL;\n const batchDelay = options.batchDelay ?? DEFAULT_BATCH_DELAY;\n const renderer = options.renderer ?? createDefaultRenderer({ async: true });\n\n const kindIcons: Record<string, IconComponent> = {};\n Object.entries(DEFAULT_ICONS).forEach(([kind, icon]) => {\n kindIcons[kind.toLocaleLowerCase('en-US')] = icon;\n });\n Object.entries(options.kindIcons ?? {}).forEach(([kind, icon]) => {\n kindIcons[kind.toLocaleLowerCase('en-US')] = icon;\n });\n\n if (renderer.async) {\n if (!options.catalogApi) {\n throw new TypeError(`Asynchronous rendering requires a catalog API`);\n }\n this.#loader = this.#createLoader({\n cacheTtl,\n batchDelay,\n renderer,\n catalogApi: options.catalogApi,\n });\n }\n\n this.#cacheTtlMs = durationToMilliseconds(cacheTtl);\n this.#cache = new Map();\n this.#kindIcons = kindIcons;\n this.#renderer = renderer;\n }\n\n /** {@inheritdoc @backstage/plugin-catalog-react#EntityPresentationApi.forEntity} */\n forEntity(\n entityOrRef: Entity | string,\n context?: {\n defaultKind?: string;\n defaultNamespace?: string;\n },\n ): EntityRefPresentation {\n const { entityRef, kind, entity, needsLoad } =\n this.#getEntityForInitialRender(entityOrRef);\n\n // Make a wrapping helper for rendering\n const render = (options: {\n loading: boolean;\n entity?: Entity;\n }): EntityRefPresentationSnapshot => {\n const { snapshot } = this.#renderer.render({\n entityRef: entityRef,\n loading: options.loading,\n entity: options.entity,\n context: context || {},\n });\n return {\n ...snapshot,\n entityRef: entityRef,\n Icon: this.#maybeFallbackIcon(snapshot.Icon, kind),\n };\n };\n\n // First the initial render\n let initialSnapshot: EntityRefPresentationSnapshot;\n try {\n initialSnapshot = render({\n loading: needsLoad,\n entity: entity,\n });\n } catch {\n // This is what gets presented if the renderer throws an error\n initialSnapshot = {\n primaryTitle: entityRef,\n entityRef: entityRef,\n };\n }\n\n if (!needsLoad) {\n return {\n snapshot: initialSnapshot,\n promise: Promise.resolve(initialSnapshot),\n };\n }\n\n // Load the entity and render it\n const maybeUpdatedSnapshot = Promise.resolve()\n .then(() => {\n return this.#loader?.load(entityRef);\n })\n .then(newEntity => {\n // We re-render no matter if we get back a new entity or the old\n // one or nothing, because of the now false loading state - in\n // case the renderer outputs different data depending on that\n return render({\n loading: false,\n entity: newEntity ?? entity,\n });\n })\n .catch(() => {\n // Intentionally ignored - we do not propagate errors to the\n // caller here. The presentation API should be error free and\n // always return SOMETHING that makes sense to render, and we have\n // already ensured above that the initial snapshot was that.\n return undefined;\n });\n\n const observable = new ObservableImpl<EntityRefPresentationSnapshot>(\n subscriber => {\n let aborted = false;\n\n maybeUpdatedSnapshot\n .then(updatedSnapshot => {\n if (updatedSnapshot) {\n subscriber.next(updatedSnapshot);\n }\n })\n .finally(() => {\n if (!aborted) {\n subscriber.complete();\n }\n });\n\n return () => {\n aborted = true;\n };\n },\n );\n\n const promise = maybeUpdatedSnapshot.then(updatedSnapshot => {\n return updatedSnapshot ?? initialSnapshot;\n });\n\n return {\n snapshot: initialSnapshot,\n update$: observable,\n promise: promise,\n };\n }\n\n #getEntityForInitialRender(entityOrRef: Entity | string): {\n entity: Entity | undefined;\n kind: string;\n entityRef: string;\n needsLoad: boolean;\n } {\n // If we were given an entity in the first place, we use it for a single\n // pass of rendering and assume that it's up to date and not partial (i.e.\n // we expect that it wasn't fetched in such a way that the required fields\n // of the renderer were excluded)\n if (typeof entityOrRef !== 'string') {\n return {\n entity: entityOrRef,\n kind: entityOrRef.kind,\n entityRef: stringifyEntityRef(entityOrRef),\n needsLoad: false,\n };\n }\n\n const cached = this.#cache.get(entityOrRef);\n const cachedEntity: Entity | undefined = cached?.entity;\n const cacheNeedsUpdate =\n !cached || Date.now() - cached.updatedAt > this.#cacheTtlMs;\n const needsLoad =\n cacheNeedsUpdate &&\n this.#renderer.async !== false &&\n this.#loader !== undefined;\n\n return {\n entity: cachedEntity,\n kind: parseEntityRef(entityOrRef).kind,\n entityRef: entityOrRef,\n needsLoad,\n };\n }\n\n #createLoader(options: {\n catalogApi: CatalogApi;\n cacheTtl: HumanDuration;\n batchDelay: HumanDuration;\n renderer: DefaultEntityPresentationApiRenderer;\n }): DataLoader<string, Entity | undefined> {\n const cacheTtlMs = durationToMilliseconds(options.cacheTtl);\n const batchDelayMs = durationToMilliseconds(options.batchDelay);\n\n return new DataLoader(\n async (entityRefs: readonly string[]) => {\n const { items } = await options.catalogApi!.getEntitiesByRefs({\n entityRefs: entityRefs as string[],\n fields: [\n 'kind',\n 'metadata.name',\n 'metadata.namespace',\n 'metadata.title',\n 'metadata.description',\n 'spec.profile.displayName',\n 'spec.type',\n ],\n });\n\n const now = Date.now();\n entityRefs.forEach((entityRef, index) => {\n this.#cache.set(entityRef, {\n updatedAt: now,\n entity: items[index],\n });\n });\n\n return items;\n },\n {\n name: 'DefaultEntityPresentationApi',\n // This cache is the one that the data loader uses internally for\n // memoizing requests; essentially what it achieves is that multiple\n // requests for the same entity ref will be batched up into a single\n // request and then the resulting promises are held on to. We put an\n // expiring map here, which makes it so that it re-fetches data with the\n // expiry cadence of that map. Otherwise it would only fetch a given ref\n // once and then never try again. This cache does therefore not fulfill\n // the same purpose as the one that is in the root of the class.\n cacheMap: new ExpiryMap(cacheTtlMs),\n maxBatchSize: 100,\n batchScheduleFn: batchDelayMs\n ? cb => setTimeout(cb, batchDelayMs)\n : undefined,\n },\n );\n }\n\n #maybeFallbackIcon(\n renderedIcon: IconComponent | false | undefined,\n kind: string,\n ): IconComponent | false | undefined {\n if (renderedIcon) {\n return renderedIcon;\n } else if (renderedIcon === false) {\n return false;\n }\n\n return this.#kindIcons[kind.toLocaleLowerCase('en-US')];\n }\n}\n"],"names":[],"mappings":";;;;;;;AA4JO,MAAM,4BAA8D,CAAA;AAAA;AAAA;AAAA;AAAA,EAIzE,OAAO,WAAqC,GAAA;AAC1C,IAAA,OAAO,IAAI,4BAA6B,CAAA;AAAA,MACtC,QAAU,EAAA,qBAAA,CAAsB,EAAE,KAAA,EAAO,OAAO;AAAA,KACjD,CAAA;AAAA;AACH;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,OACL,OACuB,EAAA;AACvB,IAAO,OAAA,IAAI,6BAA6B,OAAO,CAAA;AAAA;AACjD;AAAA;AAAA;AAAA;AAAA;AAAA,EAOS,MAAA;AAAA,EACA,WAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA;AAAA,EACA,SAAA;AAAA,EAED,YAAY,OAA8C,EAAA;AAChE,IAAM,MAAA,QAAA,GAAW,QAAQ,QAAY,IAAA,iBAAA;AACrC,IAAM,MAAA,UAAA,GAAa,QAAQ,UAAc,IAAA,mBAAA;AACzC,IAAA,MAAM,WAAW,OAAQ,CAAA,QAAA,IAAY,sBAAsB,EAAE,KAAA,EAAO,MAAM,CAAA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AAChB,MAAO,OAAA,YAAA;AAAA,KACT,MAAA,IAAW,iBAAiB,KAAO,EAAA;AACjC,MAAO,OAAA,KAAA;AAAA;AAGT,IAAA,OAAO,IAAK,CAAA,UAAA,CAAW,IAAK,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AAAA;AAE1D;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.esm.js","sources":["../../../src/apis/EntityPresentationApi/defaults.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 { IconComponent } from '@backstage/core-plugin-api';\nimport { defaultEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { HumanDuration } from '@backstage/types';\nimport ApartmentIcon from '@material-ui/icons/Apartment';\nimport CategoryIcon from '@material-ui/icons/Category';\nimport ExtensionIcon from '@material-ui/icons/Extension';\nimport FeaturedPlayListIcon from '@material-ui/icons/FeaturedPlayList';\nimport LocationOnIcon from '@material-ui/icons/LocationOn';\nimport MemoryIcon from '@material-ui/icons/Memory';\nimport PeopleIcon from '@material-ui/icons/People';\nimport PersonIcon from '@material-ui/icons/Person';\nimport StorageIcon from '@material-ui/icons/Storage';\nimport { DefaultEntityPresentationApiRenderer } from './DefaultEntityPresentationApi';\n\nexport const DEFAULT_CACHE_TTL: HumanDuration = { seconds: 10 };\n\nexport const DEFAULT_BATCH_DELAY: HumanDuration = { milliseconds: 50 };\n\nexport const DEFAULT_ICONS: Record<string, IconComponent> = {\n api: ExtensionIcon,\n component: MemoryIcon,\n system: CategoryIcon,\n resource: StorageIcon,\n domain: ApartmentIcon,\n location: LocationOnIcon,\n user: PersonIcon,\n group: PeopleIcon,\n template: FeaturedPlayListIcon,\n};\n\nexport function createDefaultRenderer(options: {\n async: boolean;\n}): DefaultEntityPresentationApiRenderer {\n return {\n async: options.async,\n\n render: ({ entityRef, entity, context }) => {\n const presentation = defaultEntityPresentation(\n entity || entityRef,\n context,\n );\n return {\n snapshot: presentation,\n loadEntity: options.async,\n };\n },\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;AA8Ba,MAAA,iBAAA,GAAmC,EAAE,OAAA,EAAS,EAAG
|
|
1
|
+
{"version":3,"file":"defaults.esm.js","sources":["../../../src/apis/EntityPresentationApi/defaults.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 { IconComponent } from '@backstage/core-plugin-api';\nimport { defaultEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { HumanDuration } from '@backstage/types';\nimport ApartmentIcon from '@material-ui/icons/Apartment';\nimport CategoryIcon from '@material-ui/icons/Category';\nimport ExtensionIcon from '@material-ui/icons/Extension';\nimport FeaturedPlayListIcon from '@material-ui/icons/FeaturedPlayList';\nimport LocationOnIcon from '@material-ui/icons/LocationOn';\nimport MemoryIcon from '@material-ui/icons/Memory';\nimport PeopleIcon from '@material-ui/icons/People';\nimport PersonIcon from '@material-ui/icons/Person';\nimport StorageIcon from '@material-ui/icons/Storage';\nimport { DefaultEntityPresentationApiRenderer } from './DefaultEntityPresentationApi';\n\nexport const DEFAULT_CACHE_TTL: HumanDuration = { seconds: 10 };\n\nexport const DEFAULT_BATCH_DELAY: HumanDuration = { milliseconds: 50 };\n\nexport const DEFAULT_ICONS: Record<string, IconComponent> = {\n api: ExtensionIcon,\n component: MemoryIcon,\n system: CategoryIcon,\n resource: StorageIcon,\n domain: ApartmentIcon,\n location: LocationOnIcon,\n user: PersonIcon,\n group: PeopleIcon,\n template: FeaturedPlayListIcon,\n};\n\nexport function createDefaultRenderer(options: {\n async: boolean;\n}): DefaultEntityPresentationApiRenderer {\n return {\n async: options.async,\n\n render: ({ entityRef, entity, context }) => {\n const presentation = defaultEntityPresentation(\n entity || entityRef,\n context,\n );\n return {\n snapshot: presentation,\n loadEntity: options.async,\n };\n },\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;AA8Ba,MAAA,iBAAA,GAAmC,EAAE,OAAA,EAAS,EAAG;AAEjD,MAAA,mBAAA,GAAqC,EAAE,YAAA,EAAc,EAAG;AAE9D,MAAM,aAA+C,GAAA;AAAA,EAC1D,GAAK,EAAA,aAAA;AAAA,EACL,SAAW,EAAA,UAAA;AAAA,EACX,MAAQ,EAAA,YAAA;AAAA,EACR,QAAU,EAAA,WAAA;AAAA,EACV,MAAQ,EAAA,aAAA;AAAA,EACR,QAAU,EAAA,cAAA;AAAA,EACV,IAAM,EAAA,UAAA;AAAA,EACN,KAAO,EAAA,UAAA;AAAA,EACP,QAAU,EAAA;AACZ;AAEO,SAAS,sBAAsB,OAEG,EAAA;AACvC,EAAO,OAAA;AAAA,IACL,OAAO,OAAQ,CAAA,KAAA;AAAA,IAEf,QAAQ,CAAC,EAAE,SAAW,EAAA,MAAA,EAAQ,SAAc,KAAA;AAC1C,MAAA,MAAM,YAAe,GAAA,yBAAA;AAAA,QACnB,MAAU,IAAA,SAAA;AAAA,QACV;AAAA,OACF;AACA,MAAO,OAAA;AAAA,QACL,QAAU,EAAA,YAAA;AAAA,QACV,YAAY,OAAQ,CAAA;AAAA,OACtB;AAAA;AACF,GACF;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultStarredEntitiesApi.esm.js","sources":["../../../src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { StorageApi } from '@backstage/core-plugin-api';\nimport { StarredEntitiesApi } from '@backstage/plugin-catalog-react';\nimport { Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\nimport { performMigrationToTheNewBucket } from './migration';\n\n/**\n * Default implementation of the StarredEntitiesApi that is backed by the StorageApi.\n *\n * @public\n */\nexport class DefaultStarredEntitiesApi implements StarredEntitiesApi {\n private readonly settingsStore: StorageApi;\n private starredEntities: Set<string>;\n\n constructor(opts: { storageApi: StorageApi }) {\n // no need to await. The updated content will be caught by the observe$\n performMigrationToTheNewBucket(opts).then();\n\n this.settingsStore = opts.storageApi.forBucket('starredEntities');\n\n this.starredEntities = new Set(\n this.settingsStore.snapshot<string[]>('entityRefs').value ?? [],\n );\n\n this.settingsStore.observe$<string[]>('entityRefs').subscribe({\n next: next => {\n this.starredEntities = new Set(next.value ?? []);\n this.notifyChanges();\n },\n });\n }\n\n async toggleStarred(entityRef: string): Promise<void> {\n if (this.starredEntities.has(entityRef)) {\n this.starredEntities.delete(entityRef);\n } else {\n this.starredEntities.add(entityRef);\n }\n\n await this.settingsStore.set(\n 'entityRefs',\n Array.from(this.starredEntities),\n );\n }\n\n starredEntitie$(): Observable<Set<string>> {\n return this.observable;\n }\n\n private readonly subscribers = new Set<\n ZenObservable.SubscriptionObserver<Set<string>>\n >();\n\n private readonly observable = new ObservableImpl<Set<string>>(subscriber => {\n // forward the the latest value\n subscriber.next(new Set(this.starredEntities));\n\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n });\n\n private notifyChanges() {\n for (const subscription of this.subscribers) {\n subscription.next(new Set(this.starredEntities));\n }\n }\n}\n"],"names":[],"mappings":";;;AA2BO,MAAM,yBAAwD,CAAA;AAAA,EAClD,aAAA
|
|
1
|
+
{"version":3,"file":"DefaultStarredEntitiesApi.esm.js","sources":["../../../src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { StorageApi } from '@backstage/core-plugin-api';\nimport { StarredEntitiesApi } from '@backstage/plugin-catalog-react';\nimport { Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\nimport { performMigrationToTheNewBucket } from './migration';\n\n/**\n * Default implementation of the StarredEntitiesApi that is backed by the StorageApi.\n *\n * @public\n */\nexport class DefaultStarredEntitiesApi implements StarredEntitiesApi {\n private readonly settingsStore: StorageApi;\n private starredEntities: Set<string>;\n\n constructor(opts: { storageApi: StorageApi }) {\n // no need to await. The updated content will be caught by the observe$\n performMigrationToTheNewBucket(opts).then();\n\n this.settingsStore = opts.storageApi.forBucket('starredEntities');\n\n this.starredEntities = new Set(\n this.settingsStore.snapshot<string[]>('entityRefs').value ?? [],\n );\n\n this.settingsStore.observe$<string[]>('entityRefs').subscribe({\n next: next => {\n this.starredEntities = new Set(next.value ?? []);\n this.notifyChanges();\n },\n });\n }\n\n async toggleStarred(entityRef: string): Promise<void> {\n if (this.starredEntities.has(entityRef)) {\n this.starredEntities.delete(entityRef);\n } else {\n this.starredEntities.add(entityRef);\n }\n\n await this.settingsStore.set(\n 'entityRefs',\n Array.from(this.starredEntities),\n );\n }\n\n starredEntitie$(): Observable<Set<string>> {\n return this.observable;\n }\n\n private readonly subscribers = new Set<\n ZenObservable.SubscriptionObserver<Set<string>>\n >();\n\n private readonly observable = new ObservableImpl<Set<string>>(subscriber => {\n // forward the the latest value\n subscriber.next(new Set(this.starredEntities));\n\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n });\n\n private notifyChanges() {\n for (const subscription of this.subscribers) {\n subscription.next(new Set(this.starredEntities));\n }\n }\n}\n"],"names":[],"mappings":";;;AA2BO,MAAM,yBAAwD,CAAA;AAAA,EAClD,aAAA;AAAA,EACT,eAAA;AAAA,EAER,YAAY,IAAkC,EAAA;AAE5C,IAA+B,8BAAA,CAAA,IAAI,EAAE,IAAK,EAAA;AAE1C,IAAA,IAAA,CAAK,aAAgB,GAAA,IAAA,CAAK,UAAW,CAAA,SAAA,CAAU,iBAAiB,CAAA;AAEhE,IAAA,IAAA,CAAK,kBAAkB,IAAI,GAAA;AAAA,MACzB,KAAK,aAAc,CAAA,QAAA,CAAmB,YAAY,CAAA,CAAE,SAAS;AAAC,KAChE;AAEA,IAAA,IAAA,CAAK,aAAc,CAAA,QAAA,CAAmB,YAAY,CAAA,CAAE,SAAU,CAAA;AAAA,MAC5D,MAAM,CAAQ,IAAA,KAAA;AACZ,QAAA,IAAA,CAAK,kBAAkB,IAAI,GAAA,CAAI,IAAK,CAAA,KAAA,IAAS,EAAE,CAAA;AAC/C,QAAA,IAAA,CAAK,aAAc,EAAA;AAAA;AACrB,KACD,CAAA;AAAA;AACH,EAEA,MAAM,cAAc,SAAkC,EAAA;AACpD,IAAA,IAAI,IAAK,CAAA,eAAA,CAAgB,GAAI,CAAA,SAAS,CAAG,EAAA;AACvC,MAAK,IAAA,CAAA,eAAA,CAAgB,OAAO,SAAS,CAAA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