@backstage-community/plugin-multi-source-security-viewer 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +253 -0
  3. package/dist/api/github.esm.js +114 -0
  4. package/dist/api/github.esm.js.map +1 -0
  5. package/dist/api/gitlab.esm.js +84 -0
  6. package/dist/api/gitlab.esm.js.map +1 -0
  7. package/dist/api/jenkins.esm.js +119 -0
  8. package/dist/api/jenkins.esm.js.map +1 -0
  9. package/dist/components/DialogLauncher/DialogLauncher.esm.js +27 -0
  10. package/dist/components/DialogLauncher/DialogLauncher.esm.js.map +1 -0
  11. package/dist/components/EmptyState/EmptyState.esm.js +51 -0
  12. package/dist/components/EmptyState/EmptyState.esm.js.map +1 -0
  13. package/dist/components/EmptyState/EmptyStateNoData.esm.js +15 -0
  14. package/dist/components/EmptyState/EmptyStateNoData.esm.js.map +1 -0
  15. package/dist/components/EmptyState/EmptyStateNoMatch.esm.js +16 -0
  16. package/dist/components/EmptyState/EmptyStateNoMatch.esm.js.map +1 -0
  17. package/dist/components/EmptyState/EmptyStateSpinner.esm.js +19 -0
  18. package/dist/components/EmptyState/EmptyStateSpinner.esm.js.map +1 -0
  19. package/dist/components/Icons/CriticalIcon.esm.js +18 -0
  20. package/dist/components/Icons/CriticalIcon.esm.js.map +1 -0
  21. package/dist/components/Icons/EqualsIcon.esm.js +18 -0
  22. package/dist/components/Icons/EqualsIcon.esm.js.map +1 -0
  23. package/dist/components/Icons/IconWithValue.esm.js +16 -0
  24. package/dist/components/Icons/IconWithValue.esm.js.map +1 -0
  25. package/dist/components/Icons/LogsIcon.esm.js +33 -0
  26. package/dist/components/Icons/LogsIcon.esm.js.map +1 -0
  27. package/dist/components/Icons/OutputIcon.esm.js +30 -0
  28. package/dist/components/Icons/OutputIcon.esm.js.map +1 -0
  29. package/dist/components/Icons/SBOMLink.esm.js +32 -0
  30. package/dist/components/Icons/SBOMLink.esm.js.map +1 -0
  31. package/dist/components/PermissionAlert/PermissionAlert.esm.js +9 -0
  32. package/dist/components/PermissionAlert/PermissionAlert.esm.js.map +1 -0
  33. package/dist/components/PipelineRunList/PipelineRunList.esm.js +72 -0
  34. package/dist/components/PipelineRunList/PipelineRunList.esm.js.map +1 -0
  35. package/dist/components/PipelineRunList/PipelineRunOutput.esm.js +23 -0
  36. package/dist/components/PipelineRunList/PipelineRunOutput.esm.js.map +1 -0
  37. package/dist/components/PipelineRunList/PipelineRunSBOMLink.esm.js +51 -0
  38. package/dist/components/PipelineRunList/PipelineRunSBOMLink.esm.js.map +1 -0
  39. package/dist/components/PipelineRunList/PipelineRunTable.esm.js +32 -0
  40. package/dist/components/PipelineRunList/PipelineRunTable.esm.js.map +1 -0
  41. package/dist/components/PipelineRunList/PipelineRunTableBody.esm.js +12 -0
  42. package/dist/components/PipelineRunList/PipelineRunTableBody.esm.js.map +1 -0
  43. package/dist/components/PipelineRunList/PipelineRunTableColumns.esm.js +50 -0
  44. package/dist/components/PipelineRunList/PipelineRunTableColumns.esm.js.map +1 -0
  45. package/dist/components/PipelineRunList/PipelineRunTablePagination.esm.js +130 -0
  46. package/dist/components/PipelineRunList/PipelineRunTablePagination.esm.js.map +1 -0
  47. package/dist/components/PipelineRunList/PipelineRunTableRow.esm.js +81 -0
  48. package/dist/components/PipelineRunList/PipelineRunTableRow.esm.js.map +1 -0
  49. package/dist/components/PipelineRunList/PipelineRunTableRowActions.esm.js +87 -0
  50. package/dist/components/PipelineRunList/PipelineRunTableRowActions.esm.js.map +1 -0
  51. package/dist/components/PipelineRunList/PipelineRunToolbar.esm.js +76 -0
  52. package/dist/components/PipelineRunList/PipelineRunToolbar.esm.js.map +1 -0
  53. package/dist/components/PipelineRunLogs/PipelineRunLogs.esm.js +34 -0
  54. package/dist/components/PipelineRunLogs/PipelineRunLogs.esm.js.map +1 -0
  55. package/dist/components/PipelineRunLogs/PipelineRunLogsDownloader.esm.js +46 -0
  56. package/dist/components/PipelineRunLogs/PipelineRunLogsDownloader.esm.js.map +1 -0
  57. package/dist/components/PipelineRunLogs/PipelineRunStepViewer.esm.js +19 -0
  58. package/dist/components/PipelineRunLogs/PipelineRunStepViewer.esm.js.map +1 -0
  59. package/dist/components/PipelineRunLogs/PipelineRunStepper.esm.js +19 -0
  60. package/dist/components/PipelineRunLogs/PipelineRunStepper.esm.js.map +1 -0
  61. package/dist/components/Router.esm.js +72 -0
  62. package/dist/components/Router.esm.js.map +1 -0
  63. package/dist/components/SecurityViewer/SecurityViewerGithubActionsDetail.esm.js +19 -0
  64. package/dist/components/SecurityViewer/SecurityViewerGithubActionsDetail.esm.js.map +1 -0
  65. package/dist/components/SecurityViewer/SecurityViewerJenkinsDetail.esm.js +19 -0
  66. package/dist/components/SecurityViewer/SecurityViewerJenkinsDetail.esm.js.map +1 -0
  67. package/dist/components/SecurityViewer/SecurityViewerMultiCIPipelines.esm.js +52 -0
  68. package/dist/components/SecurityViewer/SecurityViewerMultiCIPipelines.esm.js.map +1 -0
  69. package/dist/components/SecurityViewer/SecurityViewerPipelineDetailList.esm.js +31 -0
  70. package/dist/components/SecurityViewer/SecurityViewerPipelineDetailList.esm.js.map +1 -0
  71. package/dist/components/SecurityViewer/SecurityViewerPipelineSummaryList.esm.js +32 -0
  72. package/dist/components/SecurityViewer/SecurityViewerPipelineSummaryList.esm.js.map +1 -0
  73. package/dist/components/SecurityViewer/SecurityViewerTabbedMultiCISummaryList.esm.js +26 -0
  74. package/dist/components/SecurityViewer/SecurityViewerTabbedMultiCISummaryList.esm.js.map +1 -0
  75. package/dist/hooks/useDarkTheme.esm.js +21 -0
  76. package/dist/hooks/useDarkTheme.esm.js.map +1 -0
  77. package/dist/hooks/useMssvViewPermisson.esm.js +12 -0
  78. package/dist/hooks/useMssvViewPermisson.esm.js.map +1 -0
  79. package/dist/hooks/usePipelineDetail.esm.js +39 -0
  80. package/dist/hooks/usePipelineDetail.esm.js.map +1 -0
  81. package/dist/hooks/usePipelineSummary.esm.js +38 -0
  82. package/dist/hooks/usePipelineSummary.esm.js.map +1 -0
  83. package/dist/index.d.ts +15 -0
  84. package/dist/index.esm.js +2 -0
  85. package/dist/index.esm.js.map +1 -0
  86. package/dist/models/pipelineRunResult.esm.js +99 -0
  87. package/dist/models/pipelineRunResult.esm.js.map +1 -0
  88. package/dist/plugin.esm.js +81 -0
  89. package/dist/plugin.esm.js.map +1 -0
  90. package/dist/routes.esm.js +18 -0
  91. package/dist/routes.esm.js.map +1 -0
  92. package/dist/types/pipelinerun.esm.js +42 -0
  93. package/dist/types/pipelinerun.esm.js.map +1 -0
  94. package/dist/utils/logs.esm.js +35 -0
  95. package/dist/utils/logs.esm.js.map +1 -0
  96. package/package.json +95 -0
@@ -0,0 +1,19 @@
1
+ import { Box, Stepper, Step, StepButton, StepLabel } from '@material-ui/core';
2
+ import React from 'react';
3
+
4
+ const PipelineRunStepper = ({
5
+ steps,
6
+ activeStep,
7
+ handleStepChange
8
+ }) => {
9
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { sx: { maxWidth: 400 } }, /* @__PURE__ */ React.createElement(Stepper, { activeStep, orientation: "vertical", nonLinear: true }, steps.map((step, index) => /* @__PURE__ */ React.createElement(Step, { key: index }, /* @__PURE__ */ React.createElement(StepButton, { onClick: () => handleStepChange(index) }, /* @__PURE__ */ React.createElement(
10
+ StepLabel,
11
+ {
12
+ "data-testid": "step-label"
13
+ },
14
+ step.name
15
+ )))))));
16
+ };
17
+
18
+ export { PipelineRunStepper };
19
+ //# sourceMappingURL=PipelineRunStepper.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PipelineRunStepper.esm.js","sources":["../../../src/components/PipelineRunLogs/PipelineRunStepper.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 */\nimport { Box, Step, StepButton, StepLabel, Stepper } from '@material-ui/core';\nimport React from 'react';\nimport { PipelineRunLogStep } from '../../types/pipelinerun';\n\ninterface PipelineRunStepperProps {\n steps: PipelineRunLogStep[];\n activeStep: number;\n handleStepChange: (step: number) => void;\n}\n\nexport const PipelineRunStepper: React.FC<PipelineRunStepperProps> = ({\n steps,\n activeStep,\n handleStepChange,\n}) => {\n return (\n <React.Fragment>\n <Box sx={{ maxWidth: 400 }}>\n <Stepper activeStep={activeStep} orientation=\"vertical\" nonLinear>\n {steps.map((step, index) => (\n <Step key={index}>\n <StepButton onClick={() => handleStepChange(index)}>\n <StepLabel\n data-testid=\"step-label\"\n // TODO: Needs EYECATCHER implementation for reporting step status\n // StepIconProps={{\n // completed: index < activeStep,\n // error: index > activeStep,\n // active: index === activeStep,\n // }}\n >\n {step.name}\n </StepLabel>\n </StepButton>\n </Step>\n ))}\n </Stepper>\n </Box>\n </React.Fragment>\n );\n};\n"],"names":[],"mappings":";;;AAyBO,MAAM,qBAAwD,CAAC;AAAA,EACpE,KAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,KAAA,CAAM,QAAN,EAAA,IAAA,sCACE,GAAI,EAAA,EAAA,EAAA,EAAI,EAAE,QAAA,EAAU,GAAI,EAAA,EAAA,kBACtB,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,YAAwB,WAAY,EAAA,UAAA,EAAW,SAAS,EAAA,IAAA,EAAA,EAC9D,KAAM,CAAA,GAAA,CAAI,CAAC,IAAA,EAAM,0BACf,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,GAAK,EAAA,KAAA,EAAA,sCACR,UAAW,EAAA,EAAA,OAAA,EAAS,MAAM,gBAAA,CAAiB,KAAK,CAC/C,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,aAAY,EAAA;AAAA,KAAA;AAAA,IAQX,IAAK,CAAA;AAAA,GAEV,CACF,CACD,CACH,CACF,CACF,CAAA;AAEJ;;;;"}
@@ -0,0 +1,72 @@
1
+ import React from 'react';
2
+ import { Routes, Route } from 'react-router-dom';
3
+ import { jenkinsJobRunRouteRef, githubActionsJobRouteRef } from '../routes.esm.js';
4
+ import { useEntity } from '@backstage/plugin-catalog-react';
5
+ import { mssvJenkinsApiRef } from '../api/jenkins.esm.js';
6
+ import { isJenkinsAvailable } from '@backstage-community/plugin-jenkins';
7
+ import { mssvGithubActionsApiRef } from '../api/github.esm.js';
8
+ import { isGithubActionsAvailable } from '@backstage-community/plugin-github-actions';
9
+ import { mssvGitlabCIApiRef } from '../api/gitlab.esm.js';
10
+ import { isGitlabAvailable } from '@immobiliarelabs/backstage-plugin-gitlab';
11
+ import { SecurityViewerMultiCIPipelines } from './SecurityViewer/SecurityViewerMultiCIPipelines.esm.js';
12
+
13
+ const AVAILABLE_APIS = [
14
+ {
15
+ title: "Jenkins",
16
+ apiRef: mssvJenkinsApiRef,
17
+ availabilityCallback: isJenkinsAvailable
18
+ },
19
+ {
20
+ title: "Github Actions",
21
+ apiRef: mssvGithubActionsApiRef,
22
+ availabilityCallback: isGithubActionsAvailable
23
+ },
24
+ {
25
+ title: "Gitlab CI",
26
+ apiRef: mssvGitlabCIApiRef,
27
+ availabilityCallback: isGitlabAvailable
28
+ }
29
+ ];
30
+ const Router = () => {
31
+ const { entity } = useEntity();
32
+ const multiCIConfig = AVAILABLE_APIS.reduce((acc, api) => {
33
+ if (api.availabilityCallback(entity)) {
34
+ acc.push({ title: api.title, apiRef: api.apiRef });
35
+ }
36
+ return acc;
37
+ }, []);
38
+ return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(
39
+ Route,
40
+ {
41
+ path: "/",
42
+ element: /* @__PURE__ */ React.createElement(SecurityViewerMultiCIPipelines, { multiCIConfig })
43
+ }
44
+ ), /* @__PURE__ */ React.createElement(
45
+ Route,
46
+ {
47
+ path: `${jenkinsJobRunRouteRef.path}`,
48
+ element: /* @__PURE__ */ React.createElement(
49
+ SecurityViewerMultiCIPipelines,
50
+ {
51
+ multiCIConfig,
52
+ isJenkinsDetail: true
53
+ }
54
+ )
55
+ }
56
+ ), /* @__PURE__ */ React.createElement(
57
+ Route,
58
+ {
59
+ path: `${githubActionsJobRouteRef.path}`,
60
+ element: /* @__PURE__ */ React.createElement(
61
+ SecurityViewerMultiCIPipelines,
62
+ {
63
+ multiCIConfig,
64
+ isGithubActionsDetail: true
65
+ }
66
+ )
67
+ }
68
+ ));
69
+ };
70
+
71
+ export { Router };
72
+ //# sourceMappingURL=Router.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Router.esm.js","sources":["../../src/components/Router.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 */\nimport React from 'react';\nimport { Route, Routes } from 'react-router-dom';\nimport { githubActionsJobRouteRef, jenkinsJobRunRouteRef } from '../routes';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { ApiRef } from '@backstage/core-plugin-api/index';\nimport { Entity } from '@backstage/catalog-model';\nimport { mssvJenkinsApiRef } from '../api/jenkins';\nimport { isJenkinsAvailable } from '@backstage-community/plugin-jenkins';\nimport { mssvGithubActionsApiRef } from '../api/github';\nimport { isGithubActionsAvailable } from '@backstage-community/plugin-github-actions';\nimport { mssvGitlabCIApiRef } from '../api/gitlab';\nimport { isGitlabAvailable } from '@immobiliarelabs/backstage-plugin-gitlab';\nimport { MultiCIConfig } from '../types/multiCI';\nimport { SecurityViewerMultiCIPipelines } from './SecurityViewer/SecurityViewerMultiCIPipelines';\n\ntype ApiItem = {\n title: string;\n apiRef: ApiRef<any>;\n availabilityCallback: (entity: Entity) => boolean;\n};\n\nconst AVAILABLE_APIS: ApiItem[] = [\n {\n title: 'Jenkins',\n apiRef: mssvJenkinsApiRef,\n availabilityCallback: isJenkinsAvailable,\n },\n {\n title: 'Github Actions',\n apiRef: mssvGithubActionsApiRef,\n availabilityCallback: isGithubActionsAvailable,\n },\n {\n title: 'Gitlab CI',\n apiRef: mssvGitlabCIApiRef,\n availabilityCallback: isGitlabAvailable,\n },\n];\n\nexport const Router = () => {\n const { entity } = useEntity();\n const multiCIConfig = AVAILABLE_APIS.reduce((acc, api: ApiItem) => {\n if (api.availabilityCallback(entity)) {\n acc.push({ title: api.title, apiRef: api.apiRef });\n }\n return acc;\n }, [] as MultiCIConfig[]);\n\n return (\n <Routes>\n <Route\n path=\"/\"\n element={\n <SecurityViewerMultiCIPipelines multiCIConfig={multiCIConfig} />\n }\n />\n <Route\n path={`${jenkinsJobRunRouteRef.path}`}\n element={\n <SecurityViewerMultiCIPipelines\n multiCIConfig={multiCIConfig}\n isJenkinsDetail\n />\n }\n />\n <Route\n path={`${githubActionsJobRouteRef.path}`}\n element={\n <SecurityViewerMultiCIPipelines\n multiCIConfig={multiCIConfig}\n isGithubActionsDetail\n />\n }\n />\n </Routes>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAoCA,MAAM,cAA4B,GAAA;AAAA,EAChC;AAAA,IACE,KAAO,EAAA,SAAA;AAAA,IACP,MAAQ,EAAA,iBAAA;AAAA,IACR,oBAAsB,EAAA;AAAA,GACxB;AAAA,EACA;AAAA,IACE,KAAO,EAAA,gBAAA;AAAA,IACP,MAAQ,EAAA,uBAAA;AAAA,IACR,oBAAsB,EAAA;AAAA,GACxB;AAAA,EACA;AAAA,IACE,KAAO,EAAA,WAAA;AAAA,IACP,MAAQ,EAAA,kBAAA;AAAA,IACR,oBAAsB,EAAA;AAAA;AAE1B,CAAA;AAEO,MAAM,SAAS,MAAM;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAA,MAAM,aAAgB,GAAA,cAAA,CAAe,MAAO,CAAA,CAAC,KAAK,GAAiB,KAAA;AACjE,IAAI,IAAA,GAAA,CAAI,oBAAqB,CAAA,MAAM,CAAG,EAAA;AACpC,MAAI,GAAA,CAAA,IAAA,CAAK,EAAE,KAAO,EAAA,GAAA,CAAI,OAAO,MAAQ,EAAA,GAAA,CAAI,QAAQ,CAAA;AAAA;AAEnD,IAAO,OAAA,GAAA;AAAA,GACT,EAAG,EAAqB,CAAA;AAExB,EAAA,2CACG,MACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAK,EAAA,GAAA;AAAA,MACL,OAAA,kBACG,KAAA,CAAA,aAAA,CAAA,8BAAA,EAAA,EAA+B,aAA8B,EAAA;AAAA;AAAA,GAGlE,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAM,CAAG,EAAA,qBAAA,CAAsB,IAAI,CAAA,CAAA;AAAA,MACnC,OACE,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,8BAAA;AAAA,QAAA;AAAA,UACC,aAAA;AAAA,UACA,eAAe,EAAA;AAAA;AAAA;AACjB;AAAA,GAGJ,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAM,CAAG,EAAA,wBAAA,CAAyB,IAAI,CAAA,CAAA;AAAA,MACtC,OACE,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,8BAAA;AAAA,QAAA;AAAA,UACC,aAAA;AAAA,UACA,qBAAqB,EAAA;AAAA;AAAA;AACvB;AAAA,GAGN,CAAA;AAEJ;;;;"}
@@ -0,0 +1,19 @@
1
+ import { useRouteRefParams } from '@backstage/core-plugin-api';
2
+ import React from 'react';
3
+ import { githubActionsJobRouteRef } from '../../routes.esm.js';
4
+ import { SecurityViewerPipelineDetailList } from './SecurityViewerPipelineDetailList.esm.js';
5
+ import { mssvGithubActionsApiRef } from '../../api/github.esm.js';
6
+
7
+ const SecurityViewerGithubActionsDetail = () => {
8
+ const { id } = useRouteRefParams(githubActionsJobRouteRef);
9
+ return /* @__PURE__ */ React.createElement(
10
+ SecurityViewerPipelineDetailList,
11
+ {
12
+ jobRef: `${id}`,
13
+ apiRef: mssvGithubActionsApiRef
14
+ }
15
+ );
16
+ };
17
+
18
+ export { SecurityViewerGithubActionsDetail };
19
+ //# sourceMappingURL=SecurityViewerGithubActionsDetail.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityViewerGithubActionsDetail.esm.js","sources":["../../../src/components/SecurityViewer/SecurityViewerGithubActionsDetail.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 */\nimport { useRouteRefParams } from '@backstage/core-plugin-api';\nimport React from 'react';\nimport { githubActionsJobRouteRef } from '../../routes';\nimport { SecurityViewerPipelineDetailList } from './SecurityViewerPipelineDetailList';\nimport { mssvGithubActionsApiRef } from '../../api/github';\n\nexport const SecurityViewerGithubActionsDetail = () => {\n const { id } = useRouteRefParams(githubActionsJobRouteRef);\n return (\n <SecurityViewerPipelineDetailList\n jobRef={`${id}`}\n apiRef={mssvGithubActionsApiRef}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AAqBO,MAAM,oCAAoC,MAAM;AACrD,EAAA,MAAM,EAAE,EAAA,EAAO,GAAA,iBAAA,CAAkB,wBAAwB,CAAA;AACzD,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,gCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,GAAG,EAAE,CAAA,CAAA;AAAA,MACb,MAAQ,EAAA;AAAA;AAAA,GACV;AAEJ;;;;"}
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { SecurityViewerPipelineDetailList } from './SecurityViewerPipelineDetailList.esm.js';
3
+ import { mssvJenkinsApiRef } from '../../api/jenkins.esm.js';
4
+ import { jenkinsJobRunRouteRef } from '../../routes.esm.js';
5
+ import { useRouteRefParams } from '@backstage/core-plugin-api';
6
+
7
+ const SecurityViewerJenkinsDetail = () => {
8
+ const { jobFullName } = useRouteRefParams(jenkinsJobRunRouteRef);
9
+ return /* @__PURE__ */ React.createElement(
10
+ SecurityViewerPipelineDetailList,
11
+ {
12
+ jobRef: `${jobFullName}`,
13
+ apiRef: mssvJenkinsApiRef
14
+ }
15
+ );
16
+ };
17
+
18
+ export { SecurityViewerJenkinsDetail };
19
+ //# sourceMappingURL=SecurityViewerJenkinsDetail.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityViewerJenkinsDetail.esm.js","sources":["../../../src/components/SecurityViewer/SecurityViewerJenkinsDetail.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 */\nimport React from 'react';\nimport { SecurityViewerPipelineDetailList } from './SecurityViewerPipelineDetailList';\nimport { mssvJenkinsApiRef } from '../../api/jenkins';\nimport { jenkinsJobRunRouteRef } from '../../routes';\nimport { useRouteRefParams } from '@backstage/core-plugin-api';\n\nexport const SecurityViewerJenkinsDetail = () => {\n const { jobFullName } = useRouteRefParams(jenkinsJobRunRouteRef);\n return (\n <SecurityViewerPipelineDetailList\n jobRef={`${jobFullName}`}\n apiRef={mssvJenkinsApiRef}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AAqBO,MAAM,8BAA8B,MAAM;AAC/C,EAAA,MAAM,EAAE,WAAA,EAAgB,GAAA,iBAAA,CAAkB,qBAAqB,CAAA;AAC/D,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,gCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,GAAG,WAAW,CAAA,CAAA;AAAA,MACtB,MAAQ,EAAA;AAAA;AAAA,GACV;AAEJ;;;;"}
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { ErrorBoundary } from '@backstage/core-components';
3
+ import { makeStyles, Box, Paper, Typography } from '@material-ui/core';
4
+ import Grid from '@mui/material/Grid';
5
+ import { useDarkTheme } from '../../hooks/useDarkTheme.esm.js';
6
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
7
+ import { SecurityViewerTabbedMultiCISummaryList } from './SecurityViewerTabbedMultiCISummaryList.esm.js';
8
+ import { SecurityViewerJenkinsDetail } from './SecurityViewerJenkinsDetail.esm.js';
9
+ import { SecurityViewerGithubActionsDetail } from './SecurityViewerGithubActionsDetail.esm.js';
10
+ import { useMssvViewPermission } from '../../hooks/useMssvViewPermisson.esm.js';
11
+ import PermissionAlert from '../PermissionAlert/PermissionAlert.esm.js';
12
+ import { EmptyStateSpinner } from '../EmptyState/EmptyStateSpinner.esm.js';
13
+
14
+ const useStyles = makeStyles((theme) => ({
15
+ root: {
16
+ alignItems: "start"
17
+ },
18
+ title: {
19
+ margin: theme.spacing(0, 0, 2, 2),
20
+ fontWeight: 700
21
+ },
22
+ titleBox: {
23
+ marginTop: theme.spacing(2)
24
+ }
25
+ }));
26
+ const SecurityViewerMultiCIPipelines = ({ multiCIConfig, isJenkinsDetail, isGithubActionsDetail }) => {
27
+ useDarkTheme();
28
+ const classes = useStyles();
29
+ const queryClient = new QueryClient();
30
+ const isSummary = !isJenkinsDetail && !isGithubActionsDetail;
31
+ const { allowed: hasViewPermission, loading: viewPermissionLoading } = useMssvViewPermission();
32
+ if (!hasViewPermission) {
33
+ return viewPermissionLoading ? /* @__PURE__ */ React.createElement(EmptyStateSpinner, null) : /* @__PURE__ */ React.createElement(PermissionAlert, null);
34
+ }
35
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { className: classes.root }, /* @__PURE__ */ React.createElement(Paper, null, /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Box, { className: classes.titleBox }, /* @__PURE__ */ React.createElement(
36
+ Typography,
37
+ {
38
+ variant: "h4",
39
+ component: "h4",
40
+ className: classes.title
41
+ },
42
+ "Security Information"
43
+ ))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(ErrorBoundary, null, /* @__PURE__ */ React.createElement(QueryClientProvider, { client: queryClient }, isJenkinsDetail && /* @__PURE__ */ React.createElement(SecurityViewerJenkinsDetail, null), isGithubActionsDetail && /* @__PURE__ */ React.createElement(SecurityViewerGithubActionsDetail, null), isSummary && /* @__PURE__ */ React.createElement(
44
+ SecurityViewerTabbedMultiCISummaryList,
45
+ {
46
+ multiCIConfig
47
+ }
48
+ ))))))));
49
+ };
50
+
51
+ export { SecurityViewerMultiCIPipelines };
52
+ //# sourceMappingURL=SecurityViewerMultiCIPipelines.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityViewerMultiCIPipelines.esm.js","sources":["../../../src/components/SecurityViewer/SecurityViewerMultiCIPipelines.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 */\nimport React from 'react';\nimport { ErrorBoundary } from '@backstage/core-components';\nimport { Box, Paper, Typography, makeStyles, Theme } from '@material-ui/core';\nimport Grid from '@mui/material/Grid';\nimport { useDarkTheme } from '../../hooks/useDarkTheme';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { SecurityViewerTabbedMultiCISummaryList } from './SecurityViewerTabbedMultiCISummaryList';\nimport { MultiCIConfig } from '../../types/multiCI';\nimport { SecurityViewerJenkinsDetail } from './SecurityViewerJenkinsDetail';\nimport { SecurityViewerGithubActionsDetail } from './SecurityViewerGithubActionsDetail';\nimport { useMssvViewPermission } from '../../hooks/useMssvViewPermisson';\nimport PermissionAlert from '../PermissionAlert/PermissionAlert';\nimport { EmptyStateSpinner } from '../EmptyState/EmptyStateSpinner';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n root: {\n alignItems: 'start',\n },\n title: {\n margin: theme.spacing(0, 0, 2, 2),\n fontWeight: 700,\n },\n titleBox: {\n marginTop: theme.spacing(2),\n },\n}));\n\ntype SecurityViewerMultiCIPipelinesProps = {\n multiCIConfig: MultiCIConfig[];\n isJenkinsDetail?: boolean;\n isGithubActionsDetail?: boolean;\n};\n\nexport const SecurityViewerMultiCIPipelines: React.FC<\n SecurityViewerMultiCIPipelinesProps\n> = ({ multiCIConfig, isJenkinsDetail, isGithubActionsDetail }) => {\n useDarkTheme();\n const classes = useStyles();\n const queryClient = new QueryClient();\n const isSummary = !isJenkinsDetail && !isGithubActionsDetail;\n const { allowed: hasViewPermission, loading: viewPermissionLoading } =\n useMssvViewPermission();\n\n if (!hasViewPermission) {\n return viewPermissionLoading ? <EmptyStateSpinner /> : <PermissionAlert />;\n }\n\n return (\n <React.Fragment>\n <Box className={classes.root}>\n <Paper>\n <Grid container>\n <Grid item xs={12}>\n <Box className={classes.titleBox}>\n <Typography\n variant=\"h4\"\n component=\"h4\"\n className={classes.title}\n >\n Security Information\n </Typography>\n </Box>\n </Grid>\n <Grid item xs={12}>\n <ErrorBoundary>\n <QueryClientProvider client={queryClient}>\n {isJenkinsDetail && <SecurityViewerJenkinsDetail />}\n {isGithubActionsDetail && (\n <SecurityViewerGithubActionsDetail />\n )}\n {isSummary && (\n <SecurityViewerTabbedMultiCISummaryList\n multiCIConfig={multiCIConfig}\n />\n )}\n </QueryClientProvider>\n </ErrorBoundary>\n </Grid>\n </Grid>\n </Paper>\n </Box>\n </React.Fragment>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AA6BA,MAAM,SAAA,GAAY,UAAW,CAAA,CAAC,KAAkB,MAAA;AAAA,EAC9C,IAAM,EAAA;AAAA,IACJ,UAAY,EAAA;AAAA,GACd;AAAA,EACA,KAAO,EAAA;AAAA,IACL,QAAQ,KAAM,CAAA,OAAA,CAAQ,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAAA,IAChC,UAAY,EAAA;AAAA,GACd;AAAA,EACA,QAAU,EAAA;AAAA,IACR,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAE9B,CAAE,CAAA,CAAA;AAQK,MAAM,iCAET,CAAC,EAAE,aAAe,EAAA,eAAA,EAAiB,uBAA4B,KAAA;AACjE,EAAa,YAAA,EAAA;AACb,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,WAAA,GAAc,IAAI,WAAY,EAAA;AACpC,EAAM,MAAA,SAAA,GAAY,CAAC,eAAA,IAAmB,CAAC,qBAAA;AACvC,EAAA,MAAM,EAAE,OAAS,EAAA,iBAAA,EAAmB,OAAS,EAAA,qBAAA,KAC3C,qBAAsB,EAAA;AAExB,EAAA,IAAI,CAAC,iBAAmB,EAAA;AACtB,IAAA,OAAO,qBAAwB,mBAAA,KAAA,CAAA,aAAA,CAAC,iBAAkB,EAAA,IAAA,CAAA,uCAAM,eAAgB,EAAA,IAAA,CAAA;AAAA;AAG1E,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,KAAM,CAAA,QAAA,EAAN,IACC,kBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,SAAW,EAAA,OAAA,CAAQ,IACtB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,SAAS,EAAA,IAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,QACtB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,IAAA;AAAA,MACR,SAAU,EAAA,IAAA;AAAA,MACV,WAAW,OAAQ,CAAA;AAAA,KAAA;AAAA,IACpB;AAAA,GAGH,CACF,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAA,sCACE,mBAAoB,EAAA,EAAA,MAAA,EAAQ,WAC1B,EAAA,EAAA,eAAA,oBAAoB,KAAA,CAAA,aAAA,CAAA,2BAAA,EAAA,IAA4B,GAChD,qBACC,oBAAA,KAAA,CAAA,aAAA,CAAC,iCAAkC,EAAA,IAAA,CAAA,EAEpC,SACC,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,sCAAA;AAAA,IAAA;AAAA,MACC;AAAA;AAAA,GAGN,CACF,CACF,CACF,CACF,CACF,CACF,CAAA;AAEJ;;;;"}
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { PipelineRunList } from '../PipelineRunList/PipelineRunList.esm.js';
3
+ import { usePipelineDetail } from '../../hooks/usePipelineDetail.esm.js';
4
+
5
+ const SecurityViewerPipelineDetailList = ({ jobRef, apiRef }) => {
6
+ const [page, setPage] = React.useState(0);
7
+ const [pageSize, setPageSize] = React.useState(5);
8
+ const [pipelineDetailRuns, totalCount, loading, error] = usePipelineDetail(
9
+ apiRef,
10
+ jobRef,
11
+ page,
12
+ pageSize
13
+ );
14
+ const onUpdatePagination = (newPage, newPageSize) => {
15
+ setPage(newPage);
16
+ setPageSize(newPageSize);
17
+ };
18
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
19
+ PipelineRunList,
20
+ {
21
+ data: pipelineDetailRuns,
22
+ totalCount,
23
+ loading,
24
+ error,
25
+ onUpdatePagination
26
+ }
27
+ ));
28
+ };
29
+
30
+ export { SecurityViewerPipelineDetailList };
31
+ //# sourceMappingURL=SecurityViewerPipelineDetailList.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityViewerPipelineDetailList.esm.js","sources":["../../../src/components/SecurityViewer/SecurityViewerPipelineDetailList.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 */\nimport React from 'react';\nimport { PipelineRunList } from '../PipelineRunList/PipelineRunList';\nimport { usePipelineDetail } from '../../hooks/usePipelineDetail';\nimport { ApiRef } from '@backstage/core-plugin-api';\nimport { MssvApi } from '../../api/mssv';\n\ntype SecurityViewerPipelineDetailListProps = {\n jobRef: string;\n apiRef: ApiRef<MssvApi>;\n};\n\nexport const SecurityViewerPipelineDetailList: React.FC<\n SecurityViewerPipelineDetailListProps\n> = ({ jobRef, apiRef }) => {\n const [page, setPage] = React.useState(0);\n const [pageSize, setPageSize] = React.useState(5);\n const [pipelineDetailRuns, totalCount, loading, error] = usePipelineDetail(\n apiRef,\n jobRef,\n page,\n pageSize,\n );\n\n const onUpdatePagination = (newPage: number, newPageSize: number) => {\n setPage(newPage);\n setPageSize(newPageSize);\n };\n\n return (\n <React.Fragment>\n <PipelineRunList\n data={pipelineDetailRuns}\n totalCount={totalCount}\n loading={loading}\n error={error}\n onUpdatePagination={onUpdatePagination}\n />\n </React.Fragment>\n );\n};\n"],"names":[],"mappings":";;;;AA0BO,MAAM,gCAET,GAAA,CAAC,EAAE,MAAA,EAAQ,QAAa,KAAA;AAC1B,EAAA,MAAM,CAAC,IAAM,EAAA,OAAO,CAAI,GAAA,KAAA,CAAM,SAAS,CAAC,CAAA;AACxC,EAAA,MAAM,CAAC,QAAU,EAAA,WAAW,CAAI,GAAA,KAAA,CAAM,SAAS,CAAC,CAAA;AAChD,EAAA,MAAM,CAAC,kBAAA,EAAoB,UAAY,EAAA,OAAA,EAAS,KAAK,CAAI,GAAA,iBAAA;AAAA,IACvD,MAAA;AAAA,IACA,MAAA;AAAA,IACA,IAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAM,MAAA,kBAAA,GAAqB,CAAC,OAAA,EAAiB,WAAwB,KAAA;AACnE,IAAA,OAAA,CAAQ,OAAO,CAAA;AACf,IAAA,WAAA,CAAY,WAAW,CAAA;AAAA,GACzB;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,KAAM,CAAA,QAAA,EAAN,IACC,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,IAAM,EAAA,kBAAA;AAAA,MACN,UAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA;AAAA;AAAA,GAEJ,CAAA;AAEJ;;;;"}
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { PipelineRunList } from '../PipelineRunList/PipelineRunList.esm.js';
3
+ import { usePipelineSummary } from '../../hooks/usePipelineSummary.esm.js';
4
+
5
+ const SecurityViewerPipelineSummary = ({
6
+ apiRef
7
+ }) => {
8
+ const [page, setPage] = React.useState(0);
9
+ const [pageSize, setPageSize] = React.useState(5);
10
+ const [pipelineSummary, totalCount, loading, error] = usePipelineSummary(
11
+ apiRef,
12
+ page,
13
+ pageSize
14
+ );
15
+ const onUpdatePagination = (newPage, newPageSize) => {
16
+ setPage(newPage);
17
+ setPageSize(newPageSize);
18
+ };
19
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
20
+ PipelineRunList,
21
+ {
22
+ data: pipelineSummary,
23
+ totalCount,
24
+ loading,
25
+ error,
26
+ onUpdatePagination
27
+ }
28
+ ));
29
+ };
30
+
31
+ export { SecurityViewerPipelineSummary };
32
+ //# sourceMappingURL=SecurityViewerPipelineSummaryList.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityViewerPipelineSummaryList.esm.js","sources":["../../../src/components/SecurityViewer/SecurityViewerPipelineSummaryList.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 */\nimport React from 'react';\nimport { ApiRef } from '@backstage/core-plugin-api';\nimport { PipelineRunList } from '../PipelineRunList/PipelineRunList';\nimport { usePipelineSummary } from '../../hooks/usePipelineSummary';\nimport { MssvApi } from '../../api/mssv';\n\nexport const SecurityViewerPipelineSummary = ({\n apiRef,\n}: {\n apiRef: ApiRef<MssvApi>;\n}) => {\n const [page, setPage] = React.useState<number>(0);\n const [pageSize, setPageSize] = React.useState<number>(5);\n const [pipelineSummary, totalCount, loading, error] = usePipelineSummary(\n apiRef,\n page,\n pageSize,\n );\n const onUpdatePagination = (newPage: number, newPageSize: number) => {\n setPage(newPage);\n setPageSize(newPageSize);\n };\n\n return (\n <React.Fragment>\n <PipelineRunList\n data={pipelineSummary}\n totalCount={totalCount}\n loading={loading}\n error={error}\n onUpdatePagination={onUpdatePagination}\n />\n </React.Fragment>\n );\n};\n"],"names":[],"mappings":";;;;AAqBO,MAAM,gCAAgC,CAAC;AAAA,EAC5C;AACF,CAEM,KAAA;AACJ,EAAA,MAAM,CAAC,IAAM,EAAA,OAAO,CAAI,GAAA,KAAA,CAAM,SAAiB,CAAC,CAAA;AAChD,EAAA,MAAM,CAAC,QAAU,EAAA,WAAW,CAAI,GAAA,KAAA,CAAM,SAAiB,CAAC,CAAA;AACxD,EAAA,MAAM,CAAC,eAAA,EAAiB,UAAY,EAAA,OAAA,EAAS,KAAK,CAAI,GAAA,kBAAA;AAAA,IACpD,MAAA;AAAA,IACA,IAAA;AAAA,IACA;AAAA,GACF;AACA,EAAM,MAAA,kBAAA,GAAqB,CAAC,OAAA,EAAiB,WAAwB,KAAA;AACnE,IAAA,OAAA,CAAQ,OAAO,CAAA;AACf,IAAA,WAAA,CAAY,WAAW,CAAA;AAAA,GACzB;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,KAAM,CAAA,QAAA,EAAN,IACC,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,IAAM,EAAA,eAAA;AAAA,MACN,UAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA;AAAA;AAAA,GAEJ,CAAA;AAEJ;;;;"}
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { makeStyles, Box, Tabs, Tab } from '@material-ui/core';
3
+ import { SecurityViewerPipelineSummary } from './SecurityViewerPipelineSummaryList.esm.js';
4
+
5
+ const useStyles = makeStyles((theme) => ({
6
+ tabbedContent: {
7
+ marginTop: theme.spacing(4)
8
+ }
9
+ }));
10
+ const SecurityViewerTabbedMultiCISummaryList = ({ multiCIConfig }) => {
11
+ const classes = useStyles();
12
+ const [tabValue, setTabValue] = React.useState(0);
13
+ const handleChange = (_event, newValue) => {
14
+ setTabValue(newValue);
15
+ };
16
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Tabs, { value: tabValue, onChange: handleChange, "aria-label": "Multi CI" }, (multiCIConfig ?? []).map((config, index) => /* @__PURE__ */ React.createElement(Tab, { label: config.title, key: index, "aria-label": config.title }))), /* @__PURE__ */ React.createElement(Box, { className: classes.tabbedContent }, (multiCIConfig ?? []).map((_, index) => /* @__PURE__ */ React.createElement(Box, { key: `security-viewer-box-${index}` }, tabValue === index && /* @__PURE__ */ React.createElement(
17
+ SecurityViewerPipelineSummary,
18
+ {
19
+ key: `security-viewer-summary-${index}`,
20
+ apiRef: multiCIConfig[index].apiRef
21
+ }
22
+ ))))));
23
+ };
24
+
25
+ export { SecurityViewerTabbedMultiCISummaryList };
26
+ //# sourceMappingURL=SecurityViewerTabbedMultiCISummaryList.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityViewerTabbedMultiCISummaryList.esm.js","sources":["../../../src/components/SecurityViewer/SecurityViewerTabbedMultiCISummaryList.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 */\nimport React from 'react';\nimport { Box, Tabs, Tab, makeStyles, Theme } from '@material-ui/core';\nimport { MultiCIConfig } from '../../types/multiCI';\nimport { SecurityViewerPipelineSummary } from './SecurityViewerPipelineSummaryList';\n\ntype SecurityViewerTabbedMultiCISummaryListProps = {\n multiCIConfig: MultiCIConfig[];\n};\n\nconst useStyles = makeStyles((theme: Theme) => ({\n tabbedContent: {\n marginTop: theme.spacing(4),\n },\n}));\n\nexport const SecurityViewerTabbedMultiCISummaryList: React.FC<\n SecurityViewerTabbedMultiCISummaryListProps\n> = ({ multiCIConfig }) => {\n const classes = useStyles();\n const [tabValue, setTabValue] = React.useState(0);\n const handleChange = (\n _event: React.ChangeEvent<{}> | React.SyntheticEvent,\n newValue: number,\n ) => {\n setTabValue(newValue);\n };\n\n return (\n <React.Fragment>\n <Box>\n <Tabs value={tabValue} onChange={handleChange} aria-label=\"Multi CI\">\n {(multiCIConfig ?? []).map((config, index) => (\n <Tab label={config.title} key={index} aria-label={config.title} />\n ))}\n </Tabs>\n\n <Box className={classes.tabbedContent}>\n {(multiCIConfig ?? []).map((_, index) => (\n <Box key={`security-viewer-box-${index}`}>\n {tabValue === index && (\n <SecurityViewerPipelineSummary\n key={`security-viewer-summary-${index}`}\n apiRef={multiCIConfig[index].apiRef}\n />\n )}\n </Box>\n ))}\n </Box>\n </Box>\n </React.Fragment>\n );\n};\n"],"names":[],"mappings":";;;;AAwBA,MAAM,SAAA,GAAY,UAAW,CAAA,CAAC,KAAkB,MAAA;AAAA,EAC9C,aAAe,EAAA;AAAA,IACb,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAE9B,CAAE,CAAA,CAAA;AAEK,MAAM,sCAET,GAAA,CAAC,EAAE,aAAA,EAAoB,KAAA;AACzB,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAA,MAAM,CAAC,QAAU,EAAA,WAAW,CAAI,GAAA,KAAA,CAAM,SAAS,CAAC,CAAA;AAChD,EAAM,MAAA,YAAA,GAAe,CACnB,MAAA,EACA,QACG,KAAA;AACH,IAAA,WAAA,CAAY,QAAQ,CAAA;AAAA,GACtB;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,KAAM,CAAA,QAAA,EAAN,IACC,kBAAA,KAAA,CAAA,aAAA,CAAC,2BACE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,KAAO,EAAA,QAAA,EAAU,QAAU,EAAA,YAAA,EAAc,cAAW,UACtD,EAAA,EAAA,CAAA,aAAA,IAAiB,EAAC,EAAG,GAAI,CAAA,CAAC,QAAQ,KAClC,qBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,KAAA,EAAO,MAAO,CAAA,KAAA,EAAO,KAAK,KAAO,EAAA,YAAA,EAAY,MAAO,CAAA,KAAA,EAAO,CACjE,CACH,mBAEC,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,aACpB,EAAA,EAAA,CAAA,aAAA,IAAiB,EAAI,EAAA,GAAA,CAAI,CAAC,CAAA,EAAG,KAC7B,qBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,GAAA,EAAK,CAAuB,oBAAA,EAAA,KAAK,CACnC,CAAA,EAAA,EAAA,QAAA,KAAa,KACZ,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,6BAAA;AAAA,IAAA;AAAA,MACC,GAAA,EAAK,2BAA2B,KAAK,CAAA,CAAA;AAAA,MACrC,MAAA,EAAQ,aAAc,CAAA,KAAK,CAAE,CAAA;AAAA;AAAA,GAGnC,CACD,CACH,CACF,CACF,CAAA;AAEJ;;;;"}
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { useTheme } from '@material-ui/core/styles';
3
+
4
+ const THEME_DARK = "dark";
5
+ const THEME_DARK_CLASS = "pf-v6-theme-dark";
6
+ const useDarkTheme = () => {
7
+ const {
8
+ palette: { type }
9
+ } = useTheme();
10
+ React.useEffect(() => {
11
+ const htmlTagElement = document.documentElement;
12
+ if (type === THEME_DARK) {
13
+ htmlTagElement.classList.add(THEME_DARK_CLASS);
14
+ } else {
15
+ htmlTagElement.classList.remove(THEME_DARK_CLASS);
16
+ }
17
+ }, [type]);
18
+ };
19
+
20
+ export { useDarkTheme };
21
+ //# sourceMappingURL=useDarkTheme.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDarkTheme.esm.js","sources":["../../src/hooks/useDarkTheme.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 */\nimport React from 'react';\nimport { useTheme } from '@material-ui/core/styles';\n\nconst THEME_DARK = 'dark';\nconst THEME_DARK_CLASS = 'pf-v6-theme-dark';\n\nexport const useDarkTheme = () => {\n const {\n palette: { type },\n } = useTheme();\n\n React.useEffect(() => {\n const htmlTagElement = document.documentElement;\n if (type === THEME_DARK) {\n htmlTagElement.classList.add(THEME_DARK_CLASS);\n } else {\n htmlTagElement.classList.remove(THEME_DARK_CLASS);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [type]);\n};\n"],"names":[],"mappings":";;;AAkBA,MAAM,UAAa,GAAA,MAAA;AACnB,MAAM,gBAAmB,GAAA,kBAAA;AAElB,MAAM,eAAe,MAAM;AAChC,EAAM,MAAA;AAAA,IACJ,OAAA,EAAS,EAAE,IAAK;AAAA,MACd,QAAS,EAAA;AAEb,EAAA,KAAA,CAAM,UAAU,MAAM;AACpB,IAAA,MAAM,iBAAiB,QAAS,CAAA,eAAA;AAChC,IAAA,IAAI,SAAS,UAAY,EAAA;AACvB,MAAe,cAAA,CAAA,SAAA,CAAU,IAAI,gBAAgB,CAAA;AAAA,KACxC,MAAA;AACL,MAAe,cAAA,CAAA,SAAA,CAAU,OAAO,gBAAgB,CAAA;AAAA;AAClD,GAEF,EAAG,CAAC,IAAI,CAAC,CAAA;AACX;;;;"}
@@ -0,0 +1,12 @@
1
+ import { usePermission } from '@backstage/plugin-permission-react';
2
+ import { mssvViewPermission } from '@backstage-community/plugin-multi-source-security-viewer-common';
3
+
4
+ const useMssvViewPermission = () => {
5
+ const mssvViewPermissionResult = usePermission({
6
+ permission: mssvViewPermission
7
+ });
8
+ return mssvViewPermissionResult;
9
+ };
10
+
11
+ export { useMssvViewPermission };
12
+ //# sourceMappingURL=useMssvViewPermisson.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMssvViewPermisson.esm.js","sources":["../../src/hooks/useMssvViewPermisson.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { mssvViewPermission } from '@backstage-community/plugin-multi-source-security-viewer-common';\n\nexport const useMssvViewPermission = () => {\n const mssvViewPermissionResult = usePermission({\n permission: mssvViewPermission,\n });\n\n return mssvViewPermissionResult;\n};\n"],"names":[],"mappings":";;;AAkBO,MAAM,wBAAwB,MAAM;AACzC,EAAA,MAAM,2BAA2B,aAAc,CAAA;AAAA,IAC7C,UAAY,EAAA;AAAA,GACb,CAAA;AAED,EAAO,OAAA,wBAAA;AACT;;;;"}
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { useEntity } from '@backstage/plugin-catalog-react';
3
+ import { useApi, errorApiRef } from '@backstage/core-plugin-api';
4
+ import { useQuery } from '@tanstack/react-query';
5
+ import { useLocation } from 'react-router-dom';
6
+
7
+ const usePipelineDetail = (apiRef, ref, page, pageSize) => {
8
+ const { entity } = useEntity();
9
+ const api = useApi(apiRef);
10
+ const location = useLocation();
11
+ const errorApi = useApi(errorApiRef);
12
+ const queryFn = async () => {
13
+ try {
14
+ return await api.getPipelineDetail({ entity, ref, page, pageSize }) || [];
15
+ } catch (e) {
16
+ errorApi.post(e);
17
+ }
18
+ return [];
19
+ };
20
+ const { data, isLoading, error } = useQuery({
21
+ queryKey: [
22
+ `${location.pathname}_${apiRef.id}_pipelineDetail`,
23
+ ref,
24
+ page,
25
+ pageSize
26
+ ],
27
+ queryFn
28
+ });
29
+ const { results, totalCount } = data ?? {
30
+ results: null,
31
+ totalCount: 0
32
+ };
33
+ return React.useMemo(() => {
34
+ return [results, totalCount, isLoading, error];
35
+ }, [results, totalCount, isLoading, error]);
36
+ };
37
+
38
+ export { usePipelineDetail };
39
+ //# sourceMappingURL=usePipelineDetail.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePipelineDetail.esm.js","sources":["../../src/hooks/usePipelineDetail.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 */\nimport React from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { ApiRef, errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useQuery } from '@tanstack/react-query';\nimport { PipelineRunResult } from '../models/pipelineRunResult';\nimport { MssvApi, MssvApiResponse } from '../api/mssv';\nimport { useLocation } from 'react-router-dom';\n\nexport const usePipelineDetail = (\n apiRef: ApiRef<MssvApi>,\n ref: string,\n page: number,\n pageSize: number,\n): [PipelineRunResult[] | null, number, boolean, Error | null] => {\n const { entity } = useEntity();\n const api = useApi(apiRef);\n const location = useLocation();\n const errorApi = useApi(errorApiRef);\n\n const queryFn = async () => {\n try {\n return (\n (await api.getPipelineDetail({ entity, ref, page, pageSize })) || []\n );\n } catch (e) {\n errorApi.post(e);\n }\n return [];\n };\n\n const { data, isLoading, error } = useQuery({\n queryKey: [\n `${location.pathname}_${apiRef.id}_pipelineDetail`,\n ref,\n page,\n pageSize,\n ],\n queryFn,\n });\n\n const { results, totalCount } = (data as MssvApiResponse) ?? {\n results: null,\n totalCount: 0,\n };\n\n return React.useMemo(() => {\n return [results, totalCount, isLoading, error];\n }, [results, totalCount, isLoading, error]);\n};\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,iBAAoB,GAAA,CAC/B,MACA,EAAA,GAAA,EACA,MACA,QACgE,KAAA;AAChE,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAM,MAAA,GAAA,GAAM,OAAO,MAAM,CAAA;AACzB,EAAA,MAAM,WAAW,WAAY,EAAA;AAC7B,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AAEnC,EAAA,MAAM,UAAU,YAAY;AAC1B,IAAI,IAAA;AACF,MACG,OAAA,MAAM,GAAI,CAAA,iBAAA,CAAkB,EAAE,MAAA,EAAQ,KAAK,IAAM,EAAA,QAAA,EAAU,CAAA,IAAM,EAAC;AAAA,aAE9D,CAAG,EAAA;AACV,MAAA,QAAA,CAAS,KAAK,CAAC,CAAA;AAAA;AAEjB,IAAA,OAAO,EAAC;AAAA,GACV;AAEA,EAAA,MAAM,EAAE,IAAA,EAAM,SAAW,EAAA,KAAA,KAAU,QAAS,CAAA;AAAA,IAC1C,QAAU,EAAA;AAAA,MACR,CAAG,EAAA,QAAA,CAAS,QAAQ,CAAA,CAAA,EAAI,OAAO,EAAE,CAAA,eAAA,CAAA;AAAA,MACjC,GAAA;AAAA,MACA,IAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,MAAM,EAAE,OAAA,EAAS,UAAW,EAAA,GAAK,IAA4B,IAAA;AAAA,IAC3D,OAAS,EAAA,IAAA;AAAA,IACT,UAAY,EAAA;AAAA,GACd;AAEA,EAAO,OAAA,KAAA,CAAM,QAAQ,MAAM;AACzB,IAAA,OAAO,CAAC,OAAA,EAAS,UAAY,EAAA,SAAA,EAAW,KAAK,CAAA;AAAA,KAC5C,CAAC,OAAA,EAAS,UAAY,EAAA,SAAA,EAAW,KAAK,CAAC,CAAA;AAC5C;;;;"}
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { useEntity } from '@backstage/plugin-catalog-react';
3
+ import { useApi, errorApiRef } from '@backstage/core-plugin-api';
4
+ import { useQuery } from '@tanstack/react-query';
5
+ import { useLocation } from 'react-router-dom';
6
+
7
+ const usePipelineSummary = (apiRef, page, pageSize) => {
8
+ const { entity } = useEntity();
9
+ const api = useApi(apiRef);
10
+ const location = useLocation();
11
+ const errorApi = useApi(errorApiRef);
12
+ const queryFn = async () => {
13
+ try {
14
+ return await api.getPipelineSummary({ entity, page, pageSize }) || [];
15
+ } catch (e) {
16
+ errorApi.post(e);
17
+ }
18
+ return [];
19
+ };
20
+ const { data, isLoading, error } = useQuery({
21
+ queryKey: [
22
+ `${location.pathname}_${apiRef.id}_pipelineSummary`,
23
+ page,
24
+ pageSize
25
+ ],
26
+ queryFn
27
+ });
28
+ const { results, totalCount } = data ?? {
29
+ results: null,
30
+ totalCount: 0
31
+ };
32
+ return React.useMemo(() => {
33
+ return [results, totalCount, isLoading, error];
34
+ }, [results, totalCount, isLoading, error]);
35
+ };
36
+
37
+ export { usePipelineSummary };
38
+ //# sourceMappingURL=usePipelineSummary.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePipelineSummary.esm.js","sources":["../../src/hooks/usePipelineSummary.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 */\nimport React from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { ApiRef, errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useQuery } from '@tanstack/react-query';\nimport { PipelineRunResult } from '../models/pipelineRunResult';\nimport { MssvApi, MssvApiResponse } from '../api/mssv';\nimport { useLocation } from 'react-router-dom';\n\nexport const usePipelineSummary = (\n apiRef: ApiRef<MssvApi>,\n page: number,\n pageSize: number,\n): [PipelineRunResult[] | null, number, boolean, Error | null] => {\n const { entity } = useEntity();\n const api = useApi(apiRef);\n const location = useLocation();\n const errorApi = useApi(errorApiRef);\n\n const queryFn = async () => {\n try {\n return (await api.getPipelineSummary({ entity, page, pageSize })) || [];\n } catch (e) {\n errorApi.post(e);\n }\n return [];\n };\n\n const { data, isLoading, error } = useQuery({\n queryKey: [\n `${location.pathname}_${apiRef.id}_pipelineSummary`,\n page,\n pageSize,\n ],\n queryFn,\n });\n\n const { results, totalCount } = (data as MssvApiResponse) ?? {\n results: null,\n totalCount: 0,\n };\n\n return React.useMemo(() => {\n return [results, totalCount, isLoading, error];\n }, [results, totalCount, isLoading, error]);\n};\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,kBAAqB,GAAA,CAChC,MACA,EAAA,IAAA,EACA,QACgE,KAAA;AAChE,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAM,MAAA,GAAA,GAAM,OAAO,MAAM,CAAA;AACzB,EAAA,MAAM,WAAW,WAAY,EAAA;AAC7B,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AAEnC,EAAA,MAAM,UAAU,YAAY;AAC1B,IAAI,IAAA;AACF,MAAQ,OAAA,MAAM,IAAI,kBAAmB,CAAA,EAAE,QAAQ,IAAM,EAAA,QAAA,EAAU,CAAA,IAAM,EAAC;AAAA,aAC/D,CAAG,EAAA;AACV,MAAA,QAAA,CAAS,KAAK,CAAC,CAAA;AAAA;AAEjB,IAAA,OAAO,EAAC;AAAA,GACV;AAEA,EAAA,MAAM,EAAE,IAAA,EAAM,SAAW,EAAA,KAAA,KAAU,QAAS,CAAA;AAAA,IAC1C,QAAU,EAAA;AAAA,MACR,CAAG,EAAA,QAAA,CAAS,QAAQ,CAAA,CAAA,EAAI,OAAO,EAAE,CAAA,gBAAA,CAAA;AAAA,MACjC,IAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,MAAM,EAAE,OAAA,EAAS,UAAW,EAAA,GAAK,IAA4B,IAAA;AAAA,IAC3D,OAAS,EAAA,IAAA;AAAA,IACT,UAAY,EAAA;AAAA,GACd;AAEA,EAAO,OAAA,KAAA,CAAM,QAAQ,MAAM;AACzB,IAAA,OAAO,CAAC,OAAA,EAAS,UAAY,EAAA,SAAA,EAAW,KAAK,CAAA;AAAA,KAC5C,CAAC,OAAA,EAAS,UAAY,EAAA,SAAA,EAAW,KAAK,CAAC,CAAA;AAC5C;;;;"}
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import * as react from 'react';
3
+ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
4
+ import { Entity } from '@backstage/catalog-model';
5
+
6
+ /** @public */
7
+ declare const multiSourceSecurityViewerPlugin: _backstage_core_plugin_api.BackstagePlugin<{
8
+ entityContent: _backstage_core_plugin_api.RouteRef<undefined>;
9
+ }, {}, {}>;
10
+ /** @public */
11
+ declare const isMultiCIAvailable: (entity: Entity) => boolean;
12
+ /** @public */
13
+ declare const EntityMultiCIPipelinesContent: () => react.JSX.Element;
14
+
15
+ export { EntityMultiCIPipelinesContent, isMultiCIAvailable, multiSourceSecurityViewerPlugin };
@@ -0,0 +1,2 @@
1
+ export { EntityMultiCIPipelinesContent, isMultiCIAvailable, multiSourceSecurityViewerPlugin } from './plugin.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,99 @@
1
+ import { transformECResult } from '@aonic-ui/pipelines';
2
+ import { RunStatus } from '../types/pipelinerun.esm.js';
3
+ import { cleanLogs, extractJSON, extractPipelineSteps } from '../utils/logs.esm.js';
4
+ import { isNumber, isEmpty } from 'lodash';
5
+
6
+ class PipelineRunResult {
7
+ /**
8
+ * Underlying data structure
9
+ */
10
+ data;
11
+ constructor(data) {
12
+ this.data = data;
13
+ }
14
+ get id() {
15
+ return isNumber(this.data?.id) ? this.data.id : this.data?.displayName || "N/A";
16
+ }
17
+ get type() {
18
+ return this?.tpaLink ? "Promote" : "Build";
19
+ }
20
+ get status() {
21
+ return this.data?.status || RunStatus.Unknown;
22
+ }
23
+ get logs() {
24
+ return cleanLogs(this.data?.logs || "");
25
+ }
26
+ get critical() {
27
+ return this.acsImageScanResult?.result?.summary?.CRITICAL ?? "N/A";
28
+ }
29
+ get important() {
30
+ return this.acsImageScanResult?.result?.summary?.IMPORTANT ?? "N/A";
31
+ }
32
+ get moderate() {
33
+ return this.acsImageScanResult?.result?.summary?.MODERATE ?? "N/A";
34
+ }
35
+ get low() {
36
+ return this.acsImageScanResult?.result?.summary?.LOW ?? "N/A";
37
+ }
38
+ get enterpriseContractPolicies() {
39
+ const data = extractJSON(
40
+ this.logs,
41
+ "EC_EYECATCHER_BEGIN",
42
+ "EC_EYECATCHER_END"
43
+ );
44
+ return transformECResult(data ?? {});
45
+ }
46
+ get acsImageScanResult() {
47
+ return extractJSON(
48
+ this.logs,
49
+ "ACS_IMAGE_SCAN_EYECATCHER_BEGIN",
50
+ "ACS_IMAGE_SCAN_EYECATCHER_END"
51
+ );
52
+ }
53
+ get acsImageCheckResults() {
54
+ return extractJSON(
55
+ this.logs,
56
+ "ACS_IMAGE_CHECK_EYECATCHER_BEGIN",
57
+ "ACS_IMAGE_CHECK_EYECATCHER_END"
58
+ );
59
+ }
60
+ get acsDeploymentCheckResults() {
61
+ return extractJSON(
62
+ this.logs,
63
+ "ACS_DEPLOY_EYECATCHER_BEGIN",
64
+ "ACS_DEPLOY_EYECATCHER_END"
65
+ );
66
+ }
67
+ get hasNoScanResults() {
68
+ return [
69
+ this.enterpriseContractPolicies,
70
+ this.acsImageScanResult,
71
+ this.acsImageCheckResults,
72
+ this.acsDeploymentCheckResults
73
+ ].every((value) => isEmpty(value));
74
+ }
75
+ get steps() {
76
+ return extractPipelineSteps(this.logs) || [];
77
+ }
78
+ get hasSteps() {
79
+ return this.steps.length > 0;
80
+ }
81
+ stepLogs(step) {
82
+ const found = this.steps.filter((v) => v.name === step);
83
+ return found ? found[0]?.logs ?? "" : "";
84
+ }
85
+ get tpaLink() {
86
+ const link = extractJSON(
87
+ this.logs,
88
+ "TPA_SBOM_URL_EYECATCHER_BEGIN",
89
+ "TPA_SBOM_URL_EYECATCHER_END"
90
+ );
91
+ return link?.TPA_SBOM_URL;
92
+ }
93
+ get isBuild() {
94
+ return this.type === "Build";
95
+ }
96
+ }
97
+
98
+ export { PipelineRunResult };
99
+ //# sourceMappingURL=pipelineRunResult.esm.js.map