@pagerduty/backstage-plugin 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/alpha/pages.esm.js +41 -4
- package/dist/alpha/pages.esm.js.map +1 -1
- package/dist/alpha/plugin.esm.js +4 -3
- package/dist/alpha/plugin.esm.js.map +1 -1
- package/dist/alpha.d.ts +105 -26
- package/dist/api/client.esm.js +145 -3
- package/dist/api/client.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/AutomaticMappingsDialog.esm.js +86 -40
- package/dist/components/PagerDutyPage/AutomaticMappingsDialog.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/ConfigurationPage.esm.js +119 -0
- package/dist/components/PagerDutyPage/ConfigurationPage.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/CustomFieldModal.esm.js +152 -0
- package/dist/components/PagerDutyPage/CustomFieldModal.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/CustomFields/ButtonTabs.esm.js +51 -0
- package/dist/components/PagerDutyPage/CustomFields/ButtonTabs.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/CustomFields/CustomFieldsEmptyState.esm.js +46 -0
- package/dist/components/PagerDutyPage/CustomFields/CustomFieldsEmptyState.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/CustomFields/CustomFieldsTabPanel.esm.js +154 -0
- package/dist/components/PagerDutyPage/CustomFields/CustomFieldsTabPanel.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/CustomFields/DeleteCustomFieldDialog.esm.js +63 -0
- package/dist/components/PagerDutyPage/CustomFields/DeleteCustomFieldDialog.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/CustomFields/SyncLogsFilters.esm.js +126 -0
- package/dist/components/PagerDutyPage/CustomFields/SyncLogsFilters.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/CustomFields/SyncLogsTab.esm.js +285 -0
- package/dist/components/PagerDutyPage/CustomFields/SyncLogsTab.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/CustomFields/customFieldErrors.esm.js +13 -0
- package/dist/components/PagerDutyPage/CustomFields/customFieldErrors.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/CustomFields.esm.js +192 -0
- package/dist/components/PagerDutyPage/CustomFields.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/MappingsDialog.esm.js +2 -0
- package/dist/components/PagerDutyPage/MappingsDialog.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/MappingsTable/MappingsTable.esm.js +1 -1
- package/dist/components/PagerDutyPage/MappingsTable/MappingsTable.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/MappingsTable/MappingsTableContent.esm.js +15 -3
- package/dist/components/PagerDutyPage/MappingsTable/MappingsTableContent.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/MappingsTable/NameCell.esm.js +35 -0
- package/dist/components/PagerDutyPage/MappingsTable/NameCell.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/MappingsTable/TableSkeleton.esm.js +26 -29
- package/dist/components/PagerDutyPage/MappingsTable/TableSkeleton.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/ServiceMappingPage.esm.js +22 -0
- package/dist/components/PagerDutyPage/ServiceMappingPage.esm.js.map +1 -0
- package/dist/components/PagerDutyPage/index.esm.js +12 -127
- package/dist/components/PagerDutyPage/index.esm.js.map +1 -1
- package/dist/index.d.ts +60 -8
- package/dist/package.json.esm.js +1 -1
- package/package.json +17 -17
- package/dist/alpha/nav-items.esm.js +0 -21
- package/dist/alpha/nav-items.esm.js.map +0 -1
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Box, Flex, Skeleton } from '@backstage/ui';
|
|
2
|
+
import { Box, Flex, Text, Skeleton } from '@backstage/ui';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const DEFAULT_COLUMNS = [
|
|
5
|
+
{ label: "Name", width: "25%" },
|
|
6
|
+
{ label: "Team", width: "20%" },
|
|
7
|
+
{ label: "PagerDuty service", width: "25%" },
|
|
8
|
+
{ label: "Status", width: "20%" },
|
|
9
|
+
{ label: "Actions", width: "10%" }
|
|
10
|
+
];
|
|
11
|
+
function TableSkeleton({
|
|
12
|
+
columns = DEFAULT_COLUMNS,
|
|
13
|
+
rowCount = 10
|
|
14
|
+
} = {}) {
|
|
15
|
+
return /* @__PURE__ */ jsxs(Box, { "data-testid": "mappings-table-skeleton", style: { width: "100%" }, children: [
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
7
17
|
Flex,
|
|
8
18
|
{
|
|
9
19
|
gap: "4",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
backgroundColor: "var(--bui-bg-surface-0)"
|
|
14
|
-
},
|
|
15
|
-
children: [
|
|
16
|
-
/* @__PURE__ */ jsx(Skeleton, { style: { height: "20px", width: "15%" } }),
|
|
17
|
-
/* @__PURE__ */ jsx(Skeleton, { style: { height: "20px", width: "15%" } }),
|
|
18
|
-
/* @__PURE__ */ jsx(Skeleton, { style: { height: "20px", width: "20%" } }),
|
|
19
|
-
/* @__PURE__ */ jsx(Skeleton, { style: { height: "20px", width: "12%" } }),
|
|
20
|
-
/* @__PURE__ */ jsx(Skeleton, { style: { height: "20px", width: "12%" } }),
|
|
21
|
-
/* @__PURE__ */ jsx(Skeleton, { style: { height: "20px", width: "12%" } }),
|
|
22
|
-
/* @__PURE__ */ jsx(Skeleton, { style: { height: "20px", width: "10%" } })
|
|
23
|
-
]
|
|
20
|
+
mt: "10px",
|
|
21
|
+
pl: "10px",
|
|
22
|
+
children: columns.map((column) => /* @__PURE__ */ jsx(Box, { style: { width: column.width }, children: /* @__PURE__ */ jsx(Text, { weight: "bold", variant: "body-medium", children: column.label }) }, column.label))
|
|
24
23
|
}
|
|
25
24
|
),
|
|
26
|
-
[...Array(
|
|
25
|
+
[...Array(rowCount)].map((_, rowIndex) => /* @__PURE__ */ jsx(
|
|
27
26
|
Flex,
|
|
28
27
|
{
|
|
29
28
|
gap: "4",
|
|
@@ -31,17 +30,15 @@ function TableSkeleton() {
|
|
|
31
30
|
padding: "1rem",
|
|
32
31
|
borderBottom: "1px solid var(--bui-border-neutral-subtle)"
|
|
33
32
|
},
|
|
34
|
-
children:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/* @__PURE__ */ jsx(Skeleton, { style: { height: "16px", width: "10%" } })
|
|
42
|
-
]
|
|
33
|
+
children: columns.map((column) => /* @__PURE__ */ jsx(
|
|
34
|
+
Skeleton,
|
|
35
|
+
{
|
|
36
|
+
style: { height: "16px", width: column.width }
|
|
37
|
+
},
|
|
38
|
+
column.label
|
|
39
|
+
))
|
|
43
40
|
},
|
|
44
|
-
|
|
41
|
+
rowIndex
|
|
45
42
|
))
|
|
46
43
|
] });
|
|
47
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableSkeleton.esm.js","sources":["../../../../src/components/PagerDutyPage/MappingsTable/TableSkeleton.tsx"],"sourcesContent":["import { Box, Flex, Skeleton } from '@backstage/ui';\n\
|
|
1
|
+
{"version":3,"file":"TableSkeleton.esm.js","sources":["../../../../src/components/PagerDutyPage/MappingsTable/TableSkeleton.tsx"],"sourcesContent":["import { Box, Flex, Skeleton, Text } from '@backstage/ui';\n\ninterface SkeletonColumn {\n /** Column header label, matching the real table's column. */\n label: string;\n /** Column width as a CSS width value. */\n width: string;\n}\n\ninterface TableSkeletonProps {\n /**\n * Columns to render. The labels match the real table's headers and are shown\n * as-is; only the row cells are skeletons.\n */\n columns?: SkeletonColumn[];\n /** Number of placeholder rows to render. */\n rowCount?: number;\n}\n\nconst DEFAULT_COLUMNS: SkeletonColumn[] = [\n { label: 'Name', width: '25%' },\n { label: 'Team', width: '20%' },\n { label: 'PagerDuty service', width: '25%' },\n { label: 'Status', width: '20%' },\n { label: 'Actions', width: '10%' },\n];\n\nexport function TableSkeleton({\n columns = DEFAULT_COLUMNS,\n rowCount = 10,\n}: TableSkeletonProps = {}) {\n return (\n <Box data-testid=\"mappings-table-skeleton\" style={{ width: '100%' }}>\n <Flex\n gap=\"4\"\n mt=\"10px\"\n pl=\"10px\"\n >\n {columns.map(column => (\n <Box key={column.label} style={{ width: column.width }}>\n <Text weight=\"bold\" variant=\"body-medium\">\n {column.label}\n </Text>\n </Box>\n ))}\n </Flex>\n\n {[...Array(rowCount)].map((_, rowIndex) => (\n <Flex\n key={rowIndex}\n gap=\"4\"\n style={{\n padding: '1rem',\n borderBottom: '1px solid var(--bui-border-neutral-subtle)',\n }}\n >\n {columns.map(column => (\n <Skeleton\n key={column.label}\n style={{ height: '16px', width: column.width }}\n />\n ))}\n </Flex>\n ))}\n </Box>\n );\n}\n"],"names":[],"mappings":";;;AAmBA,MAAM,eAAA,GAAoC;AAAA,EACxC,EAAE,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAM;AAAA,EAC9B,EAAE,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAM;AAAA,EAC9B,EAAE,KAAA,EAAO,mBAAA,EAAqB,KAAA,EAAO,KAAA,EAAM;AAAA,EAC3C,EAAE,KAAA,EAAO,QAAA,EAAU,KAAA,EAAO,KAAA,EAAM;AAAA,EAChC,EAAE,KAAA,EAAO,SAAA,EAAW,KAAA,EAAO,KAAA;AAC7B,CAAA;AAEO,SAAS,aAAA,CAAc;AAAA,EAC5B,OAAA,GAAU,eAAA;AAAA,EACV,QAAA,GAAW;AACb,CAAA,GAAwB,EAAC,EAAG;AAC1B,EAAA,uBACE,IAAA,CAAC,OAAI,aAAA,EAAY,yBAAA,EAA0B,OAAO,EAAE,KAAA,EAAO,QAAO,EAChE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,GAAA,EAAI,GAAA;AAAA,QACJ,EAAA,EAAG,MAAA;AAAA,QACH,EAAA,EAAG,MAAA;AAAA,QAEF,QAAA,EAAA,OAAA,CAAQ,IAAI,CAAA,MAAA,qBACX,GAAA,CAAC,OAAuB,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA,CAAO,KAAA,EAAM,EACnD,8BAAC,IAAA,EAAA,EAAK,MAAA,EAAO,QAAO,OAAA,EAAQ,aAAA,EACzB,iBAAO,KAAA,EACV,CAAA,EAAA,EAHQ,MAAA,CAAO,KAIjB,CACD;AAAA;AAAA,KACH;AAAA,IAEC,CAAC,GAAG,KAAA,CAAM,QAAQ,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,CAAA,EAAG,QAAA,qBAC5B,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QAEC,GAAA,EAAI,GAAA;AAAA,QACJ,KAAA,EAAO;AAAA,UACL,OAAA,EAAS,MAAA;AAAA,UACT,YAAA,EAAc;AAAA,SAChB;AAAA,QAEC,QAAA,EAAA,OAAA,CAAQ,IAAI,CAAA,MAAA,qBACX,GAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YAEC,OAAO,EAAE,MAAA,EAAQ,MAAA,EAAQ,KAAA,EAAO,OAAO,KAAA;AAAM,WAAA;AAAA,UADxC,MAAA,CAAO;AAAA,SAGf;AAAA,OAAA;AAAA,MAZI;AAAA,KAcR;AAAA,GAAA,EACH,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Box, Alert } from '@backstage/ui';
|
|
3
|
+
import { ServiceMappingComponent } from './ServiceMappingComponent.esm.js';
|
|
4
|
+
|
|
5
|
+
const ServiceMappingPage = () => {
|
|
6
|
+
return /* @__PURE__ */ jsxs(Box, { pl: "20px", pr: "20px", children: [
|
|
7
|
+
/* @__PURE__ */ jsx(
|
|
8
|
+
Alert,
|
|
9
|
+
{
|
|
10
|
+
status: "info",
|
|
11
|
+
icon: true,
|
|
12
|
+
title: "Easily map your existing PagerDuty services to entities in Backstage without the need to add anotations to all your projects.",
|
|
13
|
+
description: "Warning: Only 1:1 mapping is allowed at this time.",
|
|
14
|
+
style: { marginBottom: "8px" }
|
|
15
|
+
}
|
|
16
|
+
),
|
|
17
|
+
/* @__PURE__ */ jsx(ServiceMappingComponent, {})
|
|
18
|
+
] });
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { ServiceMappingPage };
|
|
22
|
+
//# sourceMappingURL=ServiceMappingPage.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServiceMappingPage.esm.js","sources":["../../../src/components/PagerDutyPage/ServiceMappingPage.tsx"],"sourcesContent":["import { Alert, Box } from '@backstage/ui';\nimport { ServiceMappingComponent } from './ServiceMappingComponent';\n\n/** @public */\nexport const ServiceMappingPage = () => {\n return (\n <Box pl=\"20px\" pr=\"20px\">\n <Alert\n status=\"info\"\n icon\n title=\"Easily map your existing PagerDuty services to entities in Backstage without the need to add anotations to all your projects.\"\n description=\"Warning: Only 1:1 mapping is allowed at this time.\"\n style={{marginBottom: '8px'}}\n />\n\n <ServiceMappingComponent />\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;AAIO,MAAM,qBAAqB,MAAM;AACtC,EAAA,uBACE,IAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAG,MAAA,EAAO,IAAG,MAAA,EAChB,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,MAAA,EAAO,MAAA;AAAA,QACP,IAAA,EAAI,IAAA;AAAA,QACJ,KAAA,EAAM,+HAAA;AAAA,QACN,WAAA,EAAY,oDAAA;AAAA,QACZ,KAAA,EAAO,EAAC,YAAA,EAAc,KAAA;AAAK;AAAA,KAC7B;AAAA,wBAEC,uBAAA,EAAA,EAAwB;AAAA,GAAA,EAC3B,CAAA;AAEJ;;;;"}
|
|
@@ -1,132 +1,17 @@
|
|
|
1
|
-
import { jsxs, jsx
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { makeStyles, CardContent, Typography, createStyles } from '@material-ui/core';
|
|
4
|
-
import { Card, Flex, Text, RadioGroup, Radio } from '@backstage/ui';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
2
|
import { Page, Header, Content, TabbedLayout } from '@backstage/core-components';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { NotFoundError } from '@backstage/errors';
|
|
3
|
+
import { ServiceMappingPage } from './ServiceMappingPage.esm.js';
|
|
4
|
+
import { CustomFields } from './CustomFields.esm.js';
|
|
5
|
+
import { ConfigurationPage } from './ConfigurationPage.esm.js';
|
|
10
6
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
marginTop: "16px"
|
|
20
|
-
},
|
|
21
|
-
linkStyles: {
|
|
22
|
-
color: "cadetblue"
|
|
23
|
-
},
|
|
24
|
-
descriptionCard: {
|
|
25
|
-
marginBottom: "24px",
|
|
26
|
-
borderRadius: "8px"
|
|
27
|
-
},
|
|
28
|
-
descriptionText: {
|
|
29
|
-
fontSize: "16px",
|
|
30
|
-
color: theme.palette.text.primary,
|
|
31
|
-
lineHeight: 1.5,
|
|
32
|
-
marginBottom: "4px"
|
|
33
|
-
},
|
|
34
|
-
warningText: {
|
|
35
|
-
fontSize: "16px",
|
|
36
|
-
color: theme.palette.text.primary,
|
|
37
|
-
lineHeight: 1.5
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
);
|
|
41
|
-
const PagerDutyPage = () => {
|
|
42
|
-
const { cardStyles, textContainerStyles, linkStyles, descriptionCard, descriptionText, warningText } = useStyles();
|
|
43
|
-
const pagerDutyApi = useApi(pagerDutyApiRef);
|
|
44
|
-
const [
|
|
45
|
-
selectedServiceDependencyStrategy,
|
|
46
|
-
setSelectedServiceDependencyStrategy
|
|
47
|
-
] = useState("disabled");
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
function fetchSetting() {
|
|
50
|
-
pagerDutyApi.getSetting(SERVICE_DEPENDENCY_SYNC_STRATEGY).then((result) => {
|
|
51
|
-
if (result !== void 0) {
|
|
52
|
-
setSelectedServiceDependencyStrategy(result.value);
|
|
53
|
-
}
|
|
54
|
-
}).catch((error) => {
|
|
55
|
-
if (error instanceof NotFoundError) {
|
|
56
|
-
setSelectedServiceDependencyStrategy("disabled");
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
fetchSetting();
|
|
61
|
-
}, [pagerDutyApi]);
|
|
62
|
-
const handleChange = (value) => {
|
|
63
|
-
setSelectedServiceDependencyStrategy(value);
|
|
64
|
-
pagerDutyApi.storeSettings([
|
|
65
|
-
{
|
|
66
|
-
id: SERVICE_DEPENDENCY_SYNC_STRATEGY,
|
|
67
|
-
value
|
|
68
|
-
}
|
|
69
|
-
]);
|
|
70
|
-
};
|
|
71
|
-
return /* @__PURE__ */ jsxs(Page, { themeId: "home", children: [
|
|
72
|
-
/* @__PURE__ */ jsx(Header, { title: "PagerDuty", subtitle: "Advanced configurations" }),
|
|
73
|
-
/* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(TabbedLayout, { children: [
|
|
74
|
-
/* @__PURE__ */ jsx(TabbedLayout.Route, { path: "/service-mapping", title: "Service Mapping", children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75
|
-
/* @__PURE__ */ jsx(Card, { className: descriptionCard, children: /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
76
|
-
/* @__PURE__ */ jsx(Text, { className: descriptionText, children: "Easily map your existing PagerDuty services to entities in Backstage without the need to add anotations to all your projects." }),
|
|
77
|
-
/* @__PURE__ */ jsxs(Text, { className: warningText, children: [
|
|
78
|
-
/* @__PURE__ */ jsx("strong", { children: "Warning:" }),
|
|
79
|
-
" Only 1:1 mapping is allowed at this time."
|
|
80
|
-
] })
|
|
81
|
-
] }) }) }),
|
|
82
|
-
/* @__PURE__ */ jsx(ServiceMappingComponent, {})
|
|
83
|
-
] }) }),
|
|
84
|
-
/* @__PURE__ */ jsx(TabbedLayout.Route, { path: "/settings", title: "Configuration", children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
85
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h4", children: "Plugin configuration" }),
|
|
86
|
-
/* @__PURE__ */ jsx(Typography, { children: "Configure your PagerDuty plugin configuration here" }),
|
|
87
|
-
/* @__PURE__ */ jsxs(
|
|
88
|
-
Card,
|
|
89
|
-
{
|
|
90
|
-
title: "Service dependency synchronization preferences",
|
|
91
|
-
className: cardStyles,
|
|
92
|
-
children: [
|
|
93
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Service dependency synchronization strategy" }),
|
|
94
|
-
/* @__PURE__ */ jsxs(
|
|
95
|
-
RadioGroup,
|
|
96
|
-
{
|
|
97
|
-
label: "Select the main source of truth for your service dependencies",
|
|
98
|
-
value: selectedServiceDependencyStrategy,
|
|
99
|
-
onChange: (value) => handleChange(value),
|
|
100
|
-
children: [
|
|
101
|
-
/* @__PURE__ */ jsx(Radio, { value: "backstage" /* backstage */, children: "Backstage" }),
|
|
102
|
-
/* @__PURE__ */ jsx(Radio, { value: "pagerduty" /* pagerduty */, children: "PagerDuty" }),
|
|
103
|
-
/* @__PURE__ */ jsx(Radio, { value: "both" /* both */, children: "Both" }),
|
|
104
|
-
/* @__PURE__ */ jsx(Radio, { value: "disabled" /* disabled */, children: "Disabled" })
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
/* @__PURE__ */ jsx("div", { className: textContainerStyles, children: /* @__PURE__ */ jsxs(Typography, { children: [
|
|
109
|
-
/* @__PURE__ */ jsx("b", { children: "Warning: " }),
|
|
110
|
-
"Changing this setting will affect how your service dependencies are synchronized and may cause data loss. Check the",
|
|
111
|
-
" ",
|
|
112
|
-
/* @__PURE__ */ jsx(
|
|
113
|
-
"a",
|
|
114
|
-
{
|
|
115
|
-
className: linkStyles,
|
|
116
|
-
href: "https://pagerduty.github.io/backstage-plugin-docs/index.html",
|
|
117
|
-
children: "documentation"
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
" ",
|
|
121
|
-
"for more information."
|
|
122
|
-
] }) })
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
)
|
|
126
|
-
] }) })
|
|
127
|
-
] }) })
|
|
128
|
-
] });
|
|
129
|
-
};
|
|
7
|
+
const PagerDutyPage = () => /* @__PURE__ */ jsxs(Page, { themeId: "home", children: [
|
|
8
|
+
/* @__PURE__ */ jsx(Header, { title: "PagerDuty", subtitle: "Advanced configurations" }),
|
|
9
|
+
/* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(TabbedLayout, { children: [
|
|
10
|
+
/* @__PURE__ */ jsx(TabbedLayout.Route, { path: "/service-mapping", title: "Service Mapping", children: /* @__PURE__ */ jsx(ServiceMappingPage, {}) }),
|
|
11
|
+
/* @__PURE__ */ jsx(TabbedLayout.Route, { path: "/custom-fields", title: "Custom Fields", children: /* @__PURE__ */ jsx(CustomFields, {}) }),
|
|
12
|
+
/* @__PURE__ */ jsx(TabbedLayout.Route, { path: "/settings", title: "Configuration", children: /* @__PURE__ */ jsx(ConfigurationPage, {}) })
|
|
13
|
+
] }) })
|
|
14
|
+
] });
|
|
130
15
|
|
|
131
16
|
export { PagerDutyPage };
|
|
132
17
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/components/PagerDutyPage/index.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/components/PagerDutyPage/index.tsx"],"sourcesContent":["import { Header, Page, Content, TabbedLayout } from '@backstage/core-components';\nimport { ServiceMappingPage } from './ServiceMappingPage';\nimport { CustomFields } from './CustomFields';\nimport { ConfigurationPage } from './ConfigurationPage';\n\n/** @public */\nexport const PagerDutyPage = () => (\n <Page themeId=\"home\">\n <Header title=\"PagerDuty\" subtitle=\"Advanced configurations\" />\n <Content>\n <TabbedLayout>\n <TabbedLayout.Route path=\"/service-mapping\" title=\"Service Mapping\">\n <ServiceMappingPage />\n </TabbedLayout.Route>\n <TabbedLayout.Route path=\"/custom-fields\" title=\"Custom Fields\">\n <CustomFields />\n </TabbedLayout.Route>\n <TabbedLayout.Route path=\"/settings\" title=\"Configuration\">\n <ConfigurationPage />\n </TabbedLayout.Route>\n </TabbedLayout>\n </Content>\n </Page>\n);\n"],"names":[],"mappings":";;;;;;AAMO,MAAM,aAAA,GAAgB,sBAC3B,IAAA,CAAC,IAAA,EAAA,EAAK,SAAQ,MAAA,EACZ,QAAA,EAAA;AAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,KAAA,EAAM,WAAA,EAAY,QAAA,EAAS,yBAAA,EAA0B,CAAA;AAAA,kBAC7D,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,IAAA,CAAC,YAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,YAAA,CAAa,OAAb,EAAmB,IAAA,EAAK,oBAAmB,KAAA,EAAM,iBAAA,EAChD,QAAA,kBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,CAAA,EACtB,CAAA;AAAA,oBACA,GAAA,CAAC,YAAA,CAAa,KAAA,EAAb,EAAmB,IAAA,EAAK,kBAAiB,KAAA,EAAM,eAAA,EAC9C,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,CAAA,EAChB,CAAA;AAAA,oBACA,GAAA,CAAC,YAAA,CAAa,KAAA,EAAb,EAAmB,IAAA,EAAK,aAAY,KAAA,EAAM,eAAA,EACzC,QAAA,kBAAA,GAAA,CAAC,iBAAA,EAAA,EAAkB,CAAA,EACrB;AAAA,GAAA,EACF,CAAA,EACF;AAAA,CAAA,EACF;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
4
4
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
5
5
|
import { DiscoveryApi, FetchApi, ConfigApi } from '@backstage/core-plugin-api';
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
|
-
import
|
|
8
|
-
import { PagerDutySetting, PagerDutyEnhancedEntityMappingsResponse, PagerDutyServiceResponse, PagerDutyIncidentsResponse, PagerDutyChangeEventsResponse, PagerDutyService, PagerDutyTeam, PagerDutyServiceStandardsResponse, PagerDutyServiceMetricsResponse, PagerDutyUser, AutoMatchEntityMappingsResponse } from '@pagerduty/backstage-plugin-common';
|
|
7
|
+
import { PagerDutySetting, PagerDutyEnhancedEntityMappingsResponse, PagerDutyServiceResponse, PagerDutyIncidentsResponse, PagerDutyChangeEventsResponse, PagerDutyService, PagerDutyTeam, PagerDutyServiceStandardsResponse, PagerDutyServiceMetricsResponse, PagerDutyUser, AutoMatchStartResponse, AutoMatchStatusResponse, BackstageCustomFieldCreateRequest, BackstageCustomField, BackstageCustomFieldsResponse, BackstageCustomFieldUpdateRequest, CustomFieldSyncLogFilters, CustomFieldSyncLogsResponse } from '@pagerduty/backstage-plugin-common';
|
|
9
8
|
export { AutoMatchBackstageComponent, AutoMatchEntityMapping, AutoMatchEntityMappingsResponse, AutoMatchPagerDutyService, AutoMatchScoreBreakdown, AutoMatchStatistics } from '@pagerduty/backstage-plugin-common';
|
|
10
9
|
|
|
11
10
|
/** @public */
|
|
@@ -195,13 +194,17 @@ interface PagerDutyApi {
|
|
|
195
194
|
*/
|
|
196
195
|
triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise<Response>;
|
|
197
196
|
/**
|
|
198
|
-
*
|
|
197
|
+
* Starts an async auto-match job and returns a jobId to poll.
|
|
199
198
|
*/
|
|
200
|
-
|
|
199
|
+
startAutoMatchEntityMappings(options: {
|
|
201
200
|
team?: string;
|
|
202
201
|
threshold: number;
|
|
203
202
|
account?: string;
|
|
204
|
-
}): Promise<
|
|
203
|
+
}): Promise<AutoMatchStartResponse>;
|
|
204
|
+
/**
|
|
205
|
+
* Fetches the current status (and result, when complete) of an auto-match job.
|
|
206
|
+
*/
|
|
207
|
+
getAutoMatchStatus(jobId: string): Promise<AutoMatchStatusResponse>;
|
|
205
208
|
/**
|
|
206
209
|
* Fetches the list of configured PagerDuty accounts.
|
|
207
210
|
*/
|
|
@@ -209,6 +212,35 @@ interface PagerDutyApi {
|
|
|
209
212
|
id: string;
|
|
210
213
|
isDefault: boolean;
|
|
211
214
|
}>>;
|
|
215
|
+
/**
|
|
216
|
+
* Creates a custom field in PagerDuty and stores the mapping.
|
|
217
|
+
*/
|
|
218
|
+
createCustomField(request: BackstageCustomFieldCreateRequest, account?: string): Promise<Result<BackstageCustomField>>;
|
|
219
|
+
/**
|
|
220
|
+
* Fetches all custom fields.
|
|
221
|
+
*/
|
|
222
|
+
getCustomFields(account?: string): Promise<BackstageCustomFieldsResponse>;
|
|
223
|
+
/**
|
|
224
|
+
* Updates an existing custom field mapping.
|
|
225
|
+
*/
|
|
226
|
+
updateCustomField(id: number, request: BackstageCustomFieldUpdateRequest, account?: string): Promise<Result<BackstageCustomField>>;
|
|
227
|
+
/**
|
|
228
|
+
* Enables or disables a custom field. Disabled fields are not synced to
|
|
229
|
+
* PagerDuty and do not count against the PagerDuty custom field hard limit.
|
|
230
|
+
*/
|
|
231
|
+
setCustomFieldEnabled(id: number, enabled: boolean, account?: string): Promise<Result<BackstageCustomField>>;
|
|
232
|
+
/**
|
|
233
|
+
* Deletes a custom field from both Backstage and PagerDuty, reclaiming the slot.
|
|
234
|
+
*/
|
|
235
|
+
deleteCustomField(id: number, account?: string): Promise<Result<void>>;
|
|
236
|
+
/**
|
|
237
|
+
* Fetches sync logs (paginated, filtered) along with the distinct
|
|
238
|
+
* filter values for the given account.
|
|
239
|
+
*/
|
|
240
|
+
getSyncLogs(account?: string, options?: {
|
|
241
|
+
limit?: number;
|
|
242
|
+
offset?: number;
|
|
243
|
+
} & CustomFieldSyncLogFilters): Promise<CustomFieldSyncLogsResponse>;
|
|
212
244
|
}
|
|
213
245
|
/** @public */
|
|
214
246
|
type PagerDutyClientApiDependencies = {
|
|
@@ -219,12 +251,22 @@ type PagerDutyClientApiDependencies = {
|
|
|
219
251
|
type PagerDutyClientApiConfig = PagerDutyClientApiDependencies & {
|
|
220
252
|
eventsBaseUrl?: string;
|
|
221
253
|
};
|
|
254
|
+
/** @public */
|
|
255
|
+
type Result<T> = {
|
|
256
|
+
status: 'ok';
|
|
257
|
+
data: T;
|
|
258
|
+
error: null;
|
|
259
|
+
} | {
|
|
260
|
+
status: 'error';
|
|
261
|
+
data: null;
|
|
262
|
+
error: string;
|
|
263
|
+
};
|
|
222
264
|
|
|
223
265
|
/** @public */
|
|
224
266
|
declare class UnauthorizedError extends Error {
|
|
225
267
|
}
|
|
226
268
|
/** @public */
|
|
227
|
-
declare const pagerDutyApiRef:
|
|
269
|
+
declare const pagerDutyApiRef: _backstage_core_plugin_api.ApiRef<PagerDutyApi>;
|
|
228
270
|
/** @public */
|
|
229
271
|
declare class PagerDutyClient implements PagerDutyApi {
|
|
230
272
|
private readonly config;
|
|
@@ -275,15 +317,25 @@ declare class PagerDutyClient implements PagerDutyApi {
|
|
|
275
317
|
getServiceMetricsByServiceId(serviceId: string, account?: string): Promise<PagerDutyServiceMetricsResponse>;
|
|
276
318
|
getOnCallByPolicyId(policyId: string, account?: string): Promise<PagerDutyUser[]>;
|
|
277
319
|
triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise<Response>;
|
|
278
|
-
|
|
320
|
+
startAutoMatchEntityMappings(options: {
|
|
279
321
|
team?: string;
|
|
280
322
|
threshold: number;
|
|
281
323
|
account?: string;
|
|
282
|
-
}): Promise<
|
|
324
|
+
}): Promise<AutoMatchStartResponse>;
|
|
325
|
+
getAutoMatchStatus(jobId: string): Promise<AutoMatchStatusResponse>;
|
|
283
326
|
getAccounts(): Promise<Array<{
|
|
284
327
|
id: string;
|
|
285
328
|
isDefault: boolean;
|
|
286
329
|
}>>;
|
|
330
|
+
createCustomField(request: BackstageCustomFieldCreateRequest, account?: string): Promise<Result<BackstageCustomField>>;
|
|
331
|
+
getCustomFields(account?: string): Promise<BackstageCustomFieldsResponse>;
|
|
332
|
+
getSyncLogs(account?: string, options?: {
|
|
333
|
+
limit?: number;
|
|
334
|
+
offset?: number;
|
|
335
|
+
} & CustomFieldSyncLogFilters): Promise<CustomFieldSyncLogsResponse>;
|
|
336
|
+
updateCustomField(id: number, request: BackstageCustomFieldUpdateRequest, account?: string): Promise<Result<BackstageCustomField>>;
|
|
337
|
+
setCustomFieldEnabled(id: number, enabled: boolean, account?: string): Promise<Result<BackstageCustomField>>;
|
|
338
|
+
deleteCustomField(id: number, account?: string): Promise<Result<void>>;
|
|
287
339
|
private findByUrl;
|
|
288
340
|
private request;
|
|
289
341
|
}
|
package/dist/package.json.esm.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagerduty/backstage-plugin",
|
|
3
3
|
"description": "A Backstage plugin that integrates towards PagerDuty",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.21.0",
|
|
5
5
|
"main": "./dist/index.esm.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
"clean": "backstage-cli package clean"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@backstage/catalog-model": "^1.
|
|
47
|
-
"@backstage/core-compat-api": "^0.5.
|
|
48
|
-
"@backstage/core-components": "^0.18.
|
|
49
|
-
"@backstage/core-plugin-api": "^1.12.
|
|
50
|
-
"@backstage/errors": "^1.
|
|
51
|
-
"@backstage/frontend-plugin-api": "^0.
|
|
52
|
-
"@backstage/plugin-catalog": "^
|
|
53
|
-
"@backstage/plugin-catalog-react": "^
|
|
54
|
-
"@backstage/plugin-home-react": "^0.1.
|
|
55
|
-
"@backstage/theme": "^0.7.
|
|
56
|
-
"@backstage/ui": "^0.
|
|
46
|
+
"@backstage/catalog-model": "^1.9.0",
|
|
47
|
+
"@backstage/core-compat-api": "^0.5.11",
|
|
48
|
+
"@backstage/core-components": "^0.18.10",
|
|
49
|
+
"@backstage/core-plugin-api": "^1.12.6",
|
|
50
|
+
"@backstage/errors": "^1.3.1",
|
|
51
|
+
"@backstage/frontend-plugin-api": "^0.17.1",
|
|
52
|
+
"@backstage/plugin-catalog": "^2.0.5",
|
|
53
|
+
"@backstage/plugin-catalog-react": "^3.0.0",
|
|
54
|
+
"@backstage/plugin-home-react": "^0.1.38",
|
|
55
|
+
"@backstage/theme": "^0.7.3",
|
|
56
|
+
"@backstage/ui": "^0.15.0",
|
|
57
57
|
"@emotion/react": "^11.11.4",
|
|
58
58
|
"@emotion/styled": "^11.11.5",
|
|
59
59
|
"@material-ui/core": "^4.12.2",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@mui/icons-material": "^5.15.19",
|
|
63
63
|
"@mui/material": "^5.15.19",
|
|
64
64
|
"@mui/x-date-pickers": "^7.6.1",
|
|
65
|
-
"@pagerduty/backstage-plugin-common": "~0.
|
|
65
|
+
"@pagerduty/backstage-plugin-common": "~0.5.0",
|
|
66
66
|
"@tanstack/react-query": "^5.40.1",
|
|
67
67
|
"luxon": "^3.4.1",
|
|
68
68
|
"material-react-table": "^2.13.0",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"react-router-dom": "^6.3.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@backstage/cli": "^0.
|
|
79
|
-
"@backstage/core-app-api": "^1.
|
|
80
|
-
"@backstage/frontend-defaults": "^0.
|
|
81
|
-
"@backstage/test-utils": "^1.7.
|
|
78
|
+
"@backstage/cli": "^0.36.2",
|
|
79
|
+
"@backstage/core-app-api": "^1.20.1",
|
|
80
|
+
"@backstage/frontend-defaults": "^0.5.2",
|
|
81
|
+
"@backstage/test-utils": "^1.7.18",
|
|
82
82
|
"@testing-library/jest-dom": "^6.6.3",
|
|
83
83
|
"@types/copyfiles": "^2",
|
|
84
84
|
"copyfiles": "^2.4.1",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { NavItemBlueprint } from '@backstage/frontend-plugin-api';
|
|
2
|
-
import { rootRouteRef } from '../routes.esm.js';
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
|
-
import '@backstage/plugin-catalog-react';
|
|
5
|
-
import '../components/PagerDutyCard/index.esm.js';
|
|
6
|
-
import '../components/PagerDutySmallCard/index.esm.js';
|
|
7
|
-
import { PagerDutyIcon } from '../components/Icons/index.esm.js';
|
|
8
|
-
import '../components/TriggerButton/index.esm.js';
|
|
9
|
-
import { convertLegacyRouteRef } from '@backstage/core-compat-api';
|
|
10
|
-
|
|
11
|
-
const pagerDutyNavBarItem = NavItemBlueprint.make({
|
|
12
|
-
name: "PagerDutyNavBarItem",
|
|
13
|
-
params: {
|
|
14
|
-
title: "PagerDuty",
|
|
15
|
-
icon: PagerDutyIcon,
|
|
16
|
-
routeRef: convertLegacyRouteRef(rootRouteRef)
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export { pagerDutyNavBarItem };
|
|
21
|
-
//# sourceMappingURL=nav-items.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nav-items.esm.js","sources":["../../src/alpha/nav-items.tsx"],"sourcesContent":["import { NavItemBlueprint } from \"@backstage/frontend-plugin-api\";\nimport { rootRouteRef } from \"../routes\";\nimport { PagerDutyIcon } from \"../components\";\nimport { convertLegacyRouteRef } from \"@backstage/core-compat-api\";\n\n/** @alpha */\nexport const pagerDutyNavBarItem = NavItemBlueprint.make({\n name: 'PagerDutyNavBarItem',\n params: {\n title: 'PagerDuty',\n icon: PagerDutyIcon,\n routeRef: convertLegacyRouteRef(rootRouteRef),\n }\n});\n"],"names":[],"mappings":";;;;;;;;;;AAMO,MAAM,mBAAA,GAAsB,iBAAiB,IAAA,CAAK;AAAA,EACvD,IAAA,EAAM,qBAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO,WAAA;AAAA,IACP,IAAA,EAAM,aAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,YAAY;AAAA;AAEhD,CAAC;;;;"}
|