@pagerduty/backstage-plugin 0.15.5 → 0.15.6
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/config.d.ts +1 -1
- package/dist/api/client.esm.js.map +1 -1
- package/dist/components/ChangeEvents/ChangeEventEmptyState.esm.js +12 -9
- package/dist/components/ChangeEvents/ChangeEventEmptyState.esm.js.map +1 -1
- package/dist/components/ChangeEvents/ChangeEventForbiddenState.esm.js +12 -9
- package/dist/components/ChangeEvents/ChangeEventForbiddenState.esm.js.map +1 -1
- package/dist/components/ChangeEvents/ChangeEventListItem.esm.js +37 -25
- package/dist/components/ChangeEvents/ChangeEventListItem.esm.js.map +1 -1
- package/dist/components/ChangeEvents/ChangeEvents.esm.js +13 -9
- package/dist/components/ChangeEvents/ChangeEvents.esm.js.map +1 -1
- package/dist/components/EntityPagerDutyCard/index.esm.js +2 -2
- package/dist/components/EntityPagerDutyCard/index.esm.js.map +1 -1
- package/dist/components/EntityPagerDutySmallCard/index.esm.js +2 -2
- package/dist/components/EntityPagerDutySmallCard/index.esm.js.map +1 -1
- package/dist/components/Errors/ForbiddenError.esm.js +6 -6
- package/dist/components/Errors/ForbiddenError.esm.js.map +1 -1
- package/dist/components/Errors/MissingTokenError.esm.js +6 -6
- package/dist/components/Errors/MissingTokenError.esm.js.map +1 -1
- package/dist/components/Errors/ServiceNotFoundError.esm.js +6 -6
- package/dist/components/Errors/ServiceNotFoundError.esm.js.map +1 -1
- package/dist/components/Escalation/EscalationPolicy.esm.js +21 -18
- package/dist/components/Escalation/EscalationPolicy.esm.js.map +1 -1
- package/dist/components/Escalation/EscalationUser.esm.js +48 -39
- package/dist/components/Escalation/EscalationUser.esm.js.map +1 -1
- package/dist/components/Escalation/EscalationUsersEmptyState.esm.js +5 -2
- package/dist/components/Escalation/EscalationUsersEmptyState.esm.js.map +1 -1
- package/dist/components/Escalation/EscalationUsersForbiddenState.esm.js +5 -2
- package/dist/components/Escalation/EscalationUsersForbiddenState.esm.js.map +1 -1
- package/dist/components/HomePagePagerDutyCard/Content.esm.js +2 -2
- package/dist/components/HomePagePagerDutyCard/Content.esm.js.map +1 -1
- package/dist/components/Icons/index.esm.js +2 -2
- package/dist/components/Icons/index.esm.js.map +1 -1
- package/dist/components/Incident/IncidentEmptyState.esm.js +15 -13
- package/dist/components/Incident/IncidentEmptyState.esm.js.map +1 -1
- package/dist/components/Incident/IncidentForbiddenState.esm.js +12 -9
- package/dist/components/Incident/IncidentForbiddenState.esm.js.map +1 -1
- package/dist/components/Incident/IncidentListItem.esm.js +53 -40
- package/dist/components/Incident/IncidentListItem.esm.js.map +1 -1
- package/dist/components/Incident/Incidents.esm.js +10 -6
- package/dist/components/Incident/Incidents.esm.js.map +1 -1
- package/dist/components/PagerDutyCard/index.esm.js +115 -81
- package/dist/components/PagerDutyCard/index.esm.js.map +1 -1
- package/dist/components/PagerDutyCardCommon/InsightsCard.esm.js +8 -2
- package/dist/components/PagerDutyCardCommon/InsightsCard.esm.js.map +1 -1
- package/dist/components/PagerDutyCardCommon/OpenServiceButton.esm.js +9 -6
- package/dist/components/PagerDutyCardCommon/OpenServiceButton.esm.js.map +1 -1
- package/dist/components/PagerDutyCardCommon/ServiceStandardsCard.esm.js +34 -16
- package/dist/components/PagerDutyCardCommon/ServiceStandardsCard.esm.js.map +1 -1
- package/dist/components/PagerDutyCardCommon/StatusCard.esm.js +10 -6
- package/dist/components/PagerDutyCardCommon/StatusCard.esm.js.map +1 -1
- package/dist/components/PagerDutyCardCommon/TriggerIncidentButton.esm.js +27 -20
- package/dist/components/PagerDutyCardCommon/TriggerIncidentButton.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/MappingTable.esm.js +39 -31
- package/dist/components/PagerDutyPage/MappingTable.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/ServiceMappingComponent.esm.js +3 -2
- package/dist/components/PagerDutyPage/ServiceMappingComponent.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/index.esm.js +85 -50
- package/dist/components/PagerDutyPage/index.esm.js.map +1 -1
- package/dist/components/PagerDutySmallCard/index.esm.js +116 -89
- package/dist/components/PagerDutySmallCard/index.esm.js.map +1 -1
- package/dist/components/TriggerButton/index.esm.js +23 -19
- package/dist/components/TriggerButton/index.esm.js.map +1 -1
- package/dist/components/TriggerDialog/TriggerDialog.esm.js +56 -36
- package/dist/components/TriggerDialog/TriggerDialog.esm.js.map +1 -1
- package/dist/components/constants.esm.js.map +1 -1
- package/dist/components/pagerDutyEntity.esm.js +1 -1
- package/dist/components/pagerDutyEntity.esm.js.map +1 -1
- package/dist/deprecated.esm.js +1 -2
- package/dist/deprecated.esm.js.map +1 -1
- package/dist/hooks/index.esm.js.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/plugin.esm.js +2 -2
- package/dist/plugin.esm.js.map +1 -1
- package/package.json +19 -28
- package/CHANGELOG.md +0 -1390
- package/LICENSE +0 -201
- package/README.md +0 -51
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/components/TriggerButton/index.tsx"],"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\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/components/TriggerButton/index.tsx"],"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\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { useCallback, ReactNode, useState } from 'react';\nimport { makeStyles, Button } from '@material-ui/core';\nimport { BackstageTheme } from '@backstage/theme';\n\nimport { usePagerdutyEntity } from '../../hooks';\nimport { TriggerDialog } from '../TriggerDialog';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n buttonStyle: {\n backgroundColor: theme.palette.error.main,\n color: theme.palette.error.contrastText,\n '&:hover': {\n backgroundColor: theme.palette.error.dark,\n },\n },\n}));\n\n/** @public */\nexport function TriggerButton(props: { children?: ReactNode }) {\n const { buttonStyle } = useStyles();\n const { integrationKey, name } = usePagerdutyEntity();\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n const showDialog = useCallback(() => {\n setDialogShown(true);\n }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const disabled = !integrationKey;\n return (\n <>\n <Button\n onClick={showDialog}\n variant=\"contained\"\n className={disabled ? '' : buttonStyle}\n disabled={disabled}\n >\n {integrationKey\n ? props.children ?? 'Create new incident'\n : 'Missing integration key'}\n </Button>\n {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n serviceName={name}\n />\n )}\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;AAwBA,MAAM,SAAA,GAAY,WAA2B,CAAA,KAAA,MAAU;AAAA,EACrD,WAAA,EAAa;AAAA,IACX,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,KAAA,CAAM,IAAA;AAAA,IACrC,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,KAAA,CAAM,YAAA;AAAA,IAC3B,SAAA,EAAW;AAAA,MACT,eAAA,EAAiB,KAAA,CAAM,OAAA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
|
import { Dialog, DialogTitle, DialogContent, Typography, TextField, DialogActions, Button, CircularProgress } from '@material-ui/core';
|
|
3
4
|
import useAsyncFn from 'react-use/lib/useAsyncFn';
|
|
4
5
|
import { pagerDutyApiRef } from '../../api/client.esm.js';
|
|
@@ -54,41 +55,60 @@ const TriggerDialog = ({
|
|
|
54
55
|
severity: "error"
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
58
|
+
return /* @__PURE__ */ jsxs(Dialog, { maxWidth: "md", open: showDialog, onClose: handleDialog, fullWidth: true, children: [
|
|
59
|
+
/* @__PURE__ */ jsxs(DialogTitle, { children: [
|
|
60
|
+
"This action will trigger an incident for ",
|
|
61
|
+
/* @__PURE__ */ jsxs("strong", { children: [
|
|
62
|
+
'"',
|
|
63
|
+
serviceName,
|
|
64
|
+
'"'
|
|
65
|
+
] }),
|
|
66
|
+
"."
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(Alert, { severity: "info", children: /* @__PURE__ */ jsx(Typography, { variant: "body1", align: "justify", children: `If the issue you are seeing does not need urgent attention, please get in touch with the responsible team using their preferred communications channel. You can find information about the owner of this entity in the "About" card. If the issue is urgent, please don't hesitate to trigger the alert.` }) }),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
Typography,
|
|
72
|
+
{
|
|
73
|
+
variant: "body1",
|
|
74
|
+
style: { marginTop: "1em" },
|
|
75
|
+
gutterBottom: true,
|
|
76
|
+
align: "justify",
|
|
77
|
+
children: "Please describe the problem you want to report. Be as descriptive as possible. Your signed in user and a reference to the current page will automatically be amended to the alarm so that the receiver can reach out to you if necessary."
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
TextField,
|
|
82
|
+
{
|
|
83
|
+
inputProps: { "data-testid": "trigger-input" },
|
|
84
|
+
id: "description",
|
|
85
|
+
multiline: true,
|
|
86
|
+
fullWidth: true,
|
|
87
|
+
minRows: 4,
|
|
88
|
+
margin: "normal",
|
|
89
|
+
label: "Problem description",
|
|
90
|
+
variant: "outlined",
|
|
91
|
+
onChange: descriptionChanged
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
Button,
|
|
98
|
+
{
|
|
99
|
+
"data-testid": "trigger-button",
|
|
100
|
+
id: "trigger",
|
|
101
|
+
color: "secondary",
|
|
102
|
+
disabled: !description || loading,
|
|
103
|
+
variant: "contained",
|
|
104
|
+
onClick: () => handleTriggerAlarm(description),
|
|
105
|
+
endIcon: loading && /* @__PURE__ */ jsx(CircularProgress, { size: 16 }),
|
|
106
|
+
children: "Trigger Incident"
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsx(Button, { id: "close", color: "primary", onClick: handleDialog, children: "Close" })
|
|
110
|
+
] })
|
|
111
|
+
] });
|
|
92
112
|
};
|
|
93
113
|
|
|
94
114
|
export { TriggerDialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerDialog.esm.js","sources":["../../../src/components/TriggerDialog/TriggerDialog.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useState, useEffect } from 'react';\nimport {\n Dialog,\n DialogTitle,\n TextField,\n DialogActions,\n Button,\n DialogContent,\n Typography,\n CircularProgress,\n} from '@material-ui/core';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\nimport {\n useApi,\n alertApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { DEFAULT_NAMESPACE, parseEntityRef } from '@backstage/catalog-model';\n\ntype Props = {\n showDialog: boolean;\n handleDialog: () => void;\n onIncidentCreated?: () => void;\n serviceName: string;\n integrationKey: string;\n};\n\nexport const TriggerDialog = ({\n showDialog,\n handleDialog,\n onIncidentCreated: onIncidentCreated,\n serviceName,\n integrationKey,\n}: Props) => {\n const alertApi = useApi(alertApiRef);\n const identityApi = useApi(identityApiRef);\n const api = useApi(pagerDutyApiRef);\n const [description, setDescription] = useState<string>('');\n\n const [{ value, loading, error }, handleTriggerAlarm] = useAsyncFn(\n async (descriptions: string) => {\n const { userEntityRef } = await identityApi.getBackstageIdentity();\n const { name: userName } = parseEntityRef(userEntityRef, {\n defaultKind: 'User',\n defaultNamespace: DEFAULT_NAMESPACE,\n });\n return await api.triggerAlarm({\n integrationKey: integrationKey as string,\n source: window.location.toString(),\n description: descriptions,\n userName,\n });\n },\n );\n\n const descriptionChanged = (\n event: React.ChangeEvent<HTMLTextAreaElement>,\n ) => {\n setDescription(event.target.value);\n };\n\n useEffect(() => {\n if (value) {\n (async () => {\n alertApi.post({\n message: `Alarm successfully triggered`,\n });\n\n // clear description state\n setDescription(\"\");\n\n handleDialog();\n\n // The pager duty API isn't always returning the newly created alarm immediately\n await new Promise(resolve => setTimeout(resolve, 1000));\n onIncidentCreated?.();\n })();\n }\n }, [value, alertApi, handleDialog, onIncidentCreated]);\n\n if (error) {\n alertApi.post({\n message: `Failed to trigger alarm. ${error.message}`,\n severity: 'error',\n });\n }\n\n return (\n <Dialog maxWidth=\"md\" open={showDialog} onClose={handleDialog} fullWidth>\n <DialogTitle>\n This action will trigger an incident for <strong>\"{serviceName}\"</strong>.\n </DialogTitle>\n <DialogContent>\n <Alert severity=\"info\">\n <Typography variant=\"body1\" align=\"justify\">\n If the issue you are seeing does not need urgent attention, please\n get in touch with the responsible team using their preferred\n communications channel. You can find information about the owner of\n this entity in the \"About\" card. If the issue is urgent, please\n don't hesitate to trigger the alert.\n </Typography>\n </Alert>\n <Typography\n variant=\"body1\"\n style={{ marginTop: '1em' }}\n gutterBottom\n align=\"justify\"\n >\n Please describe the problem you want to report. Be as descriptive as\n possible. Your signed in user and a reference to the current page will\n automatically be amended to the alarm so that the receiver can reach\n out to you if necessary.\n </Typography>\n <TextField\n inputProps={{ 'data-testid': 'trigger-input' }}\n id=\"description\"\n multiline\n fullWidth\n minRows={4}\n margin=\"normal\"\n label=\"Problem description\"\n variant=\"outlined\"\n onChange={descriptionChanged}\n />\n </DialogContent>\n <DialogActions>\n <Button\n data-testid=\"trigger-button\"\n id=\"trigger\"\n color=\"secondary\"\n disabled={!description || loading}\n variant=\"contained\"\n onClick={() => handleTriggerAlarm(description)}\n endIcon={loading && <CircularProgress size={16} />}\n >\n Trigger Incident\n </Button>\n <Button id=\"close\" color=\"primary\" onClick={handleDialog}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TriggerDialog.esm.js","sources":["../../../src/components/TriggerDialog/TriggerDialog.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useState, useEffect } from 'react';\nimport {\n Dialog,\n DialogTitle,\n TextField,\n DialogActions,\n Button,\n DialogContent,\n Typography,\n CircularProgress,\n} from '@material-ui/core';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\nimport {\n useApi,\n alertApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { DEFAULT_NAMESPACE, parseEntityRef } from '@backstage/catalog-model';\n\ntype Props = {\n showDialog: boolean;\n handleDialog: () => void;\n onIncidentCreated?: () => void;\n serviceName: string;\n integrationKey: string;\n};\n\nexport const TriggerDialog = ({\n showDialog,\n handleDialog,\n onIncidentCreated: onIncidentCreated,\n serviceName,\n integrationKey,\n}: Props) => {\n const alertApi = useApi(alertApiRef);\n const identityApi = useApi(identityApiRef);\n const api = useApi(pagerDutyApiRef);\n const [description, setDescription] = useState<string>('');\n\n const [{ value, loading, error }, handleTriggerAlarm] = useAsyncFn(\n async (descriptions: string) => {\n const { userEntityRef } = await identityApi.getBackstageIdentity();\n const { name: userName } = parseEntityRef(userEntityRef, {\n defaultKind: 'User',\n defaultNamespace: DEFAULT_NAMESPACE,\n });\n return await api.triggerAlarm({\n integrationKey: integrationKey as string,\n source: window.location.toString(),\n description: descriptions,\n userName,\n });\n },\n );\n\n const descriptionChanged = (\n event: React.ChangeEvent<HTMLTextAreaElement>,\n ) => {\n setDescription(event.target.value);\n };\n\n useEffect(() => {\n if (value) {\n (async () => {\n alertApi.post({\n message: `Alarm successfully triggered`,\n });\n\n // clear description state\n setDescription(\"\");\n\n handleDialog();\n\n // The pager duty API isn't always returning the newly created alarm immediately\n await new Promise(resolve => setTimeout(resolve, 1000));\n onIncidentCreated?.();\n })();\n }\n }, [value, alertApi, handleDialog, onIncidentCreated]);\n\n if (error) {\n alertApi.post({\n message: `Failed to trigger alarm. ${error.message}`,\n severity: 'error',\n });\n }\n\n return (\n <Dialog maxWidth=\"md\" open={showDialog} onClose={handleDialog} fullWidth>\n <DialogTitle>\n This action will trigger an incident for <strong>\"{serviceName}\"</strong>.\n </DialogTitle>\n <DialogContent>\n <Alert severity=\"info\">\n <Typography variant=\"body1\" align=\"justify\">\n If the issue you are seeing does not need urgent attention, please\n get in touch with the responsible team using their preferred\n communications channel. You can find information about the owner of\n this entity in the \"About\" card. If the issue is urgent, please\n don't hesitate to trigger the alert.\n </Typography>\n </Alert>\n <Typography\n variant=\"body1\"\n style={{ marginTop: '1em' }}\n gutterBottom\n align=\"justify\"\n >\n Please describe the problem you want to report. Be as descriptive as\n possible. Your signed in user and a reference to the current page will\n automatically be amended to the alarm so that the receiver can reach\n out to you if necessary.\n </Typography>\n <TextField\n inputProps={{ 'data-testid': 'trigger-input' }}\n id=\"description\"\n multiline\n fullWidth\n minRows={4}\n margin=\"normal\"\n label=\"Problem description\"\n variant=\"outlined\"\n onChange={descriptionChanged}\n />\n </DialogContent>\n <DialogActions>\n <Button\n data-testid=\"trigger-button\"\n id=\"trigger\"\n color=\"secondary\"\n disabled={!description || loading}\n variant=\"contained\"\n onClick={() => handleTriggerAlarm(description)}\n endIcon={loading && <CircularProgress size={16} />}\n >\n Trigger Incident\n </Button>\n <Button id=\"close\" color=\"primary\" onClick={handleDialog}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA8CO,MAAM,gBAAgB,CAAC;AAAA,EAC5B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AAAA,OAKD;AAAA,sBACA,GAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UACC,UAAA,EAAY,EAAE,aAAA,EAAe,eAAA,EAAgB;AAAA,UAC7C,EAAA,EAAG,aAAA;AAAA,UACH,SAAA,EAAS,IAAA;AAAA,UACT,SAAA,EAAS,IAAA;AAAA,UACT,OAAA,EAAS,CAAA;AAAA,UACT,MAAA,EAAO,QAAA;AAAA,UACP,KAAA,EAAM,qBAAA;AAAA,UACN,OAAA,EAAQ,UAAA;AAAA,UACR,QAAA,EAAU;AAAA;AAAA;AACZ,KAAA,EACF,CAAA;AAAA,yBACC,aAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,aAAA,EAAY,gBAAA;AAAA,UACZ,EAAA,EAAG,SAAA;AAAA,UACH,KAAA,EAAM,WAAA;AAAA,UACN,QAAA,EAAU,CAAC,WAAA,IAAe,OAAA;AAAA,UAC1B,OAAA,EAAQ,WAAA;AAAA,UACR,OAAA,EAAS,MAAM,kBAAA,CAAmB,WAAW,CAAA;AAAA,UAC7C,OAAA,EAAS,OAAA,oBAAW,GAAA,CAAC,gBAAA,EAAA,EAAiB,MAAM,EAAA,EAAI,CAAA;AAAA,UACjD,QAAA,EAAA;AAAA;AAAA,OAED;AAAA,sBACA,GAAA,CAAC,UAAO,EAAA,EAAG,OAAA,EAAQ,OAAM,SAAA,EAAU,OAAA,EAAS,cAAc,QAAA,EAAA,OAAA,EAE1D;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.esm.js","sources":["../../src/components/constants.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 */\nexport const PAGERDUTY_INTEGRATION_KEY = 'pagerduty.com/integration-key';\nexport const PAGERDUTY_SERVICE_ID = 'pagerduty.com/service-id';\nexport const PAGERDUTY_ACCOUNT_NAME = 'pagerduty.com/account';\n"],"names":[],"mappings":"AAeO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.esm.js","sources":["../../src/components/constants.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 */\nexport const PAGERDUTY_INTEGRATION_KEY = 'pagerduty.com/integration-key';\nexport const PAGERDUTY_SERVICE_ID = 'pagerduty.com/service-id';\nexport const PAGERDUTY_ACCOUNT_NAME = 'pagerduty.com/account';\n"],"names":[],"mappings":"AAeO,MAAM,yBAAA,GAA4B;AAClC,MAAM,oBAAA,GAAuB;AAC7B,MAAM,sBAAA,GAAyB;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID
|
|
1
|
+
import { PAGERDUTY_ACCOUNT_NAME, PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from './constants.esm.js';
|
|
2
2
|
|
|
3
3
|
function getPagerDutyEntity(entity) {
|
|
4
4
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagerDutyEntity.esm.js","sources":["../../src/components/pagerDutyEntity.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { PagerDutyEntity } from '../types';\nimport { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID, PAGERDUTY_ACCOUNT_NAME } from './constants';\n\nexport function getPagerDutyEntity(entity: Entity): PagerDutyEntity {\n const {\n [PAGERDUTY_INTEGRATION_KEY]: integrationKey,\n [PAGERDUTY_SERVICE_ID]: serviceId,\n [PAGERDUTY_ACCOUNT_NAME]: account,\n } = entity.metadata.annotations || ({} as Record<string, string>);\n const name = entity.metadata.name;\n\n return { integrationKey, serviceId, account, name };\n}\n"],"names":[],"mappings":";;AAoBO,SAAS,mBAAmB,
|
|
1
|
+
{"version":3,"file":"pagerDutyEntity.esm.js","sources":["../../src/components/pagerDutyEntity.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { PagerDutyEntity } from '../types';\nimport { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID, PAGERDUTY_ACCOUNT_NAME } from './constants';\n\nexport function getPagerDutyEntity(entity: Entity): PagerDutyEntity {\n const {\n [PAGERDUTY_INTEGRATION_KEY]: integrationKey,\n [PAGERDUTY_SERVICE_ID]: serviceId,\n [PAGERDUTY_ACCOUNT_NAME]: account,\n } = entity.metadata.annotations || ({} as Record<string, string>);\n const name = entity.metadata.name;\n\n return { integrationKey, serviceId, account, name };\n}\n"],"names":[],"mappings":";;AAoBO,SAAS,mBAAmB,MAAA,EAAiC;AAClE,EAAA,MAAM;AAAA,IACJ,CAAC,yBAAyB,GAAG,cAAA;AAAA,IAC7B,CAAC,oBAAoB,GAAG,SAAA;AAAA,IACxB,CAAC,sBAAsB,GAAG;AAAA,GAC5B,GAAI,MAAA,CAAO,QAAA,CAAS,WAAA,IAAgB,EAAC;AACrC,EAAA,MAAM,IAAA,GAAO,OAAO,QAAA,CAAS,IAAA;AAE7B,EAAA,OAAO,EAAE,cAAA,EAAgB,SAAA,EAAW,OAAA,EAAS,IAAA,EAAK;AACpD;;;;"}
|
package/dist/deprecated.esm.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { EntityPagerDutyCard } from './components/EntityPagerDutyCard/index.esm.js';
|
|
2
|
-
import 'react';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
3
|
import '@backstage/plugin-catalog-react';
|
|
4
4
|
import './components/PagerDutySmallCard/index.esm.js';
|
|
5
|
-
import './assets/PD-Icon.svg';
|
|
6
5
|
import './components/TriggerButton/index.esm.js';
|
|
7
6
|
|
|
8
7
|
const PagerDutyCard = EntityPagerDutyCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated.esm.js","sources":["../src/deprecated.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 { EntityPagerDutyCardProps, EntityPagerDutyCard } from './components';\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCard\n */\nexport const PagerDutyCard = EntityPagerDutyCard;\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCardProps\n */\nexport type PagerDutyCardProps = EntityPagerDutyCardProps;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deprecated.esm.js","sources":["../src/deprecated.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 { EntityPagerDutyCardProps, EntityPagerDutyCard } from './components';\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCard\n */\nexport const PagerDutyCard = EntityPagerDutyCard;\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCardProps\n */\nexport type PagerDutyCardProps = EntityPagerDutyCardProps;\n"],"names":[],"mappings":";;;;;;AAsBO,MAAM,aAAA,GAAgB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../src/hooks/index.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { PagerDutyEntity } from '../types';\nimport { getPagerDutyEntity } from '../components/pagerDutyEntity';\n\nexport function usePagerdutyEntity(): PagerDutyEntity {\n const { entity } = useEntity();\n\n return getPagerDutyEntity(entity);\n}\n"],"names":[],"mappings":";;;AAoBO,SAAS,
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../src/hooks/index.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { PagerDutyEntity } from '../types';\nimport { getPagerDutyEntity } from '../components/pagerDutyEntity';\n\nexport function usePagerdutyEntity(): PagerDutyEntity {\n const { entity } = useEntity();\n\n return getPagerDutyEntity(entity);\n}\n"],"names":[],"mappings":";;;AAoBO,SAAS,kBAAA,GAAsC;AACpD,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAE7B,EAAA,OAAO,mBAAmB,MAAM,CAAA;AAClC;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as _backstage_plugin_home_react from '@backstage/plugin-home-react';
|
|
3
2
|
import { Entity } from '@backstage/catalog-model';
|
|
4
|
-
import * as
|
|
5
|
-
import React__default, { ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
4
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
7
5
|
import { DiscoveryApi, FetchApi, ConfigApi } from '@backstage/core-plugin-api';
|
|
8
|
-
import {
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
import { PagerDutySetting, PagerDutyEntityMappingsResponse, PagerDutyServiceResponse, PagerDutyIncidentsResponse, PagerDutyChangeEventsResponse, PagerDutyServiceStandardsResponse, PagerDutyServiceMetricsResponse, PagerDutyUser } from 'common';
|
|
9
8
|
|
|
10
9
|
/** @public */
|
|
11
10
|
declare const isPluginApplicableToEntity$1: (entity: Entity) => boolean;
|
|
@@ -41,21 +40,21 @@ type HomePagePagerDutyCardProps = PagerDutyEntity & {
|
|
|
41
40
|
/** @public */
|
|
42
41
|
declare const pagerDutyPlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}, {}>;
|
|
43
42
|
/** @public */
|
|
44
|
-
declare const PagerDutyPage: () =>
|
|
43
|
+
declare const PagerDutyPage: () => react_jsx_runtime.JSX.Element;
|
|
45
44
|
/** @public */
|
|
46
|
-
declare const EntityPagerDutyCard: (props: EntityPagerDutyCardProps) =>
|
|
45
|
+
declare const EntityPagerDutyCard: (props: EntityPagerDutyCardProps) => react_jsx_runtime.JSX.Element;
|
|
47
46
|
/** @public */
|
|
48
|
-
declare const EntityPagerDutySmallCard: (props: EntityPagerDutySmallCardProps) =>
|
|
47
|
+
declare const EntityPagerDutySmallCard: (props: EntityPagerDutySmallCardProps) => react_jsx_runtime.JSX.Element;
|
|
49
48
|
/** @public */
|
|
50
|
-
declare const HomePagePagerDutyCard: (props: _backstage_plugin_home_react.CardExtensionProps<HomePagePagerDutyCardProps>) =>
|
|
49
|
+
declare const HomePagePagerDutyCard: (props: _backstage_plugin_home_react.CardExtensionProps<HomePagePagerDutyCardProps>) => react_jsx_runtime.JSX.Element;
|
|
51
50
|
|
|
52
51
|
/** @public */
|
|
53
|
-
declare function PagerDutyIcon():
|
|
52
|
+
declare function PagerDutyIcon(): react_jsx_runtime.JSX.Element;
|
|
54
53
|
|
|
55
54
|
/** @public */
|
|
56
55
|
declare function TriggerButton(props: {
|
|
57
56
|
children?: ReactNode;
|
|
58
|
-
}):
|
|
57
|
+
}): react_jsx_runtime.JSX.Element;
|
|
59
58
|
|
|
60
59
|
/** @public */
|
|
61
60
|
type PagerDutyTriggerAlarmRequest = {
|
|
@@ -172,11 +171,12 @@ declare class PagerDutyClient implements PagerDutyApi {
|
|
|
172
171
|
* @public
|
|
173
172
|
* @deprecated Please use EntityPagerDutyCard
|
|
174
173
|
*/
|
|
175
|
-
declare const PagerDutyCard: (props: EntityPagerDutyCardProps) =>
|
|
174
|
+
declare const PagerDutyCard: (props: EntityPagerDutyCardProps) => react_jsx_runtime.JSX.Element;
|
|
176
175
|
/**
|
|
177
176
|
* @public
|
|
178
177
|
* @deprecated Please use EntityPagerDutyCardProps
|
|
179
178
|
*/
|
|
180
179
|
type PagerDutyCardProps = EntityPagerDutyCardProps;
|
|
181
180
|
|
|
182
|
-
export { EntityPagerDutyCard,
|
|
181
|
+
export { EntityPagerDutyCard, EntityPagerDutySmallCard, HomePagePagerDutyCard, PagerDutyCard, PagerDutyClient, PagerDutyIcon, PagerDutyPage, TriggerButton, UnauthorizedError, isPluginApplicableToEntity as isPagerDutyAvailable, isPluginApplicableToEntity$1 as isPagerDutySmallCardAvailable, isPluginApplicableToEntity, pagerDutyApiRef, pagerDutyPlugin, pagerDutyPlugin as plugin };
|
|
182
|
+
export type { EntityPagerDutyCardProps, EntityPagerDutySmallCardProps, HomePagePagerDutyCardProps, PagerDutyApi, PagerDutyCardProps, PagerDutyClientApiConfig, PagerDutyClientApiDependencies, PagerDutyEntity, PagerDutyTriggerAlarmRequest };
|
package/dist/plugin.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createRouteRef, createPlugin, createApiFactory,
|
|
1
|
+
import { PagerDutyClient, pagerDutyApiRef } from './api/client.esm.js';
|
|
2
|
+
import { createRouteRef, createPlugin, createApiFactory, fetchApiRef, configApiRef, discoveryApiRef, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
|
|
3
3
|
import { createCardExtension } from '@backstage/plugin-home-react';
|
|
4
4
|
|
|
5
5
|
const rootRouteRef = createRouteRef({
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { pagerDutyApiRef, PagerDutyClient } from './api';\nimport {\n createApiFactory,\n createPlugin,\n createRouteRef,\n discoveryApiRef,\n fetchApiRef,\n configApiRef,\n createComponentExtension,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\nimport { createCardExtension } from '@backstage/plugin-home-react';\nimport { HomePagePagerDutyCardProps } from './components/HomePagePagerDutyCard/Content';\n\nexport const rootRouteRef = createRouteRef({\n id: 'pagerduty',\n});\n\n/** @public */\nexport const pagerDutyPlugin = createPlugin({\n id: 'pagerduty',\n apis: [\n createApiFactory({\n api: pagerDutyApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n configApi: configApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ configApi, discoveryApi, fetchApi }) =>\n PagerDutyClient.fromConfig(configApi, { discoveryApi, fetchApi }),\n }),\n ],\n});\n\n/** @public */\nexport const PagerDutyPage = pagerDutyPlugin.provide(\n createRoutableExtension({\n name: 'PagerDutyPage',\n component: () => import('./components/PagerDutyPage').then(m => m.PagerDutyPage),\n mountPoint: rootRouteRef,\n })\n)\n\n/** @public */\nexport const EntityPagerDutyCard = pagerDutyPlugin.provide(\n createComponentExtension({\n name: 'EntityPagerDutyCard',\n component: {\n lazy: () =>\n import('./components/EntityPagerDutyCard').then(\n m => m.EntityPagerDutyCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityPagerDutySmallCard = pagerDutyPlugin.provide(\n createComponentExtension({\n name: 'EntityPagerDutySmallCard',\n component: {\n lazy: () =>\n import('./components/EntityPagerDutySmallCard').then(\n m => m.EntityPagerDutySmallCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const HomePagePagerDutyCard = pagerDutyPlugin.provide(\n createCardExtension<HomePagePagerDutyCardProps>({\n name: 'HomePagePagerDutyCard',\n title: 'PagerDuty Homepage Card',\n components: () => import('./components/HomePagePagerDutyCard'),\n settings: {\n schema: {\n title: 'PagerDuty',\n type: 'object',\n properties: {\n integrationKey: {\n title: 'PagerDuty integration key',\n type: 'string',\n },\n serviceId: {\n title: 'PagerDuty service id',\n type: 'string',\n },\n name: {\n title: 'PagerDuty service name',\n type: 'string',\n },\n },\n },\n },\n }),\n);\n"],"names":[],"mappings":";;;;AA6BO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { pagerDutyApiRef, PagerDutyClient } from './api';\nimport {\n createApiFactory,\n createPlugin,\n createRouteRef,\n discoveryApiRef,\n fetchApiRef,\n configApiRef,\n createComponentExtension,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\nimport { createCardExtension } from '@backstage/plugin-home-react';\nimport { HomePagePagerDutyCardProps } from './components/HomePagePagerDutyCard/Content';\n\nexport const rootRouteRef = createRouteRef({\n id: 'pagerduty',\n});\n\n/** @public */\nexport const pagerDutyPlugin = createPlugin({\n id: 'pagerduty',\n apis: [\n createApiFactory({\n api: pagerDutyApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n configApi: configApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ configApi, discoveryApi, fetchApi }) =>\n PagerDutyClient.fromConfig(configApi, { discoveryApi, fetchApi }),\n }),\n ],\n});\n\n/** @public */\nexport const PagerDutyPage = pagerDutyPlugin.provide(\n createRoutableExtension({\n name: 'PagerDutyPage',\n component: () => import('./components/PagerDutyPage').then(m => m.PagerDutyPage),\n mountPoint: rootRouteRef,\n })\n)\n\n/** @public */\nexport const EntityPagerDutyCard = pagerDutyPlugin.provide(\n createComponentExtension({\n name: 'EntityPagerDutyCard',\n component: {\n lazy: () =>\n import('./components/EntityPagerDutyCard').then(\n m => m.EntityPagerDutyCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityPagerDutySmallCard = pagerDutyPlugin.provide(\n createComponentExtension({\n name: 'EntityPagerDutySmallCard',\n component: {\n lazy: () =>\n import('./components/EntityPagerDutySmallCard').then(\n m => m.EntityPagerDutySmallCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const HomePagePagerDutyCard = pagerDutyPlugin.provide(\n createCardExtension<HomePagePagerDutyCardProps>({\n name: 'HomePagePagerDutyCard',\n title: 'PagerDuty Homepage Card',\n components: () => import('./components/HomePagePagerDutyCard'),\n settings: {\n schema: {\n title: 'PagerDuty',\n type: 'object',\n properties: {\n integrationKey: {\n title: 'PagerDuty integration key',\n type: 'string',\n },\n serviceId: {\n title: 'PagerDuty service id',\n type: 'string',\n },\n name: {\n title: 'PagerDuty service name',\n type: 'string',\n },\n },\n },\n },\n }),\n);\n"],"names":[],"mappings":";;;;AA6BO,MAAM,eAAe,cAAA,CAAe;AAAA,EACzC,E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AAA,IAC9C,IAAA,EAAM,uBAAA;AAAA,IACN,KAAA,EAAO,yBAAA;AAAA,IACP,UAAA,EAAY,MAAM,OAAO,iDAAoC,CAAA;AAAA,IAC7D,QAAA,EAAU;AAAA,MACR,MAAA,EAAQ;AAAA,QACN,KAAA,EAAO,WAAA;AAAA,QACP,IAAA,EAAM,QAAA;AAAA,QACN,UAAA,EAAY;AAAA,UACV,cAAA,EAAgB;AAAA,YACd,KAAA,EAAO,2BAAA;AAAA,YACP,IAAA,EAAM;AAAA,WACR;AAAA,UACA,SAAA,EAAW;AAAA,YACT,KAAA,EAAO,sBAAA;AAAA,YACP,IAAA,EAAM;AAAA,WACR;AAAA,UACA,IAAA,EAAM;AAAA,YACJ,KAAA,EAAO,wBAAA;AAAA,YACP,IAAA,EAAM;AAAA;AACR;AACF;AACF;AACF,GACD;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagerduty/backstage-plugin",
|
|
3
3
|
"description": "A Backstage plugin that integrates towards PagerDuty",
|
|
4
|
-
"version": "0.15.
|
|
5
|
-
"main": "dist/index.
|
|
4
|
+
"version": "0.15.6",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public",
|
|
10
|
-
"main": "dist/index.
|
|
10
|
+
"main": "dist/index.cjs.js",
|
|
11
11
|
"types": "dist/index.d.ts"
|
|
12
12
|
},
|
|
13
13
|
"backstage": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"pluginId": "pagerduty",
|
|
16
16
|
"pluginPackages": [
|
|
17
17
|
"@pagerduty/backstage-plugin",
|
|
18
|
-
"
|
|
18
|
+
"common",
|
|
19
19
|
"@pagerduty/backstage-plugin-backend"
|
|
20
20
|
]
|
|
21
21
|
},
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"pagerduty"
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
|
-
"build": "
|
|
34
|
+
"build": "backstage-cli package build && copyfiles -u 1 src/assets/*.svg ./",
|
|
35
35
|
"start": "backstage-cli package start",
|
|
36
36
|
"lint": "backstage-cli package lint",
|
|
37
37
|
"test": "backstage-cli package test",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"@mui/icons-material": "^5.15.19",
|
|
57
57
|
"@mui/material": "^5.15.19",
|
|
58
58
|
"@mui/x-date-pickers": "^7.6.1",
|
|
59
|
-
"@pagerduty/backstage-plugin-common": "^0.2.1",
|
|
60
59
|
"@tanstack/react-query": "^5.40.1",
|
|
61
60
|
"classnames": "^2.2.6",
|
|
61
|
+
"common": "workspace:^",
|
|
62
62
|
"luxon": "^3.4.1",
|
|
63
63
|
"material-react-table": "^2.13.0",
|
|
64
64
|
"react-use": "^17.2.4",
|
|
@@ -71,28 +71,13 @@
|
|
|
71
71
|
"react-router-dom": "^6.3.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@backstage/cli": "^0.
|
|
74
|
+
"@backstage/cli": "^0.33.0",
|
|
75
75
|
"@backstage/core-app-api": "^1.14.0",
|
|
76
76
|
"@backstage/dev-utils": "^1.0.35",
|
|
77
77
|
"@backstage/test-utils": "^1.5.8",
|
|
78
|
-
"@
|
|
79
|
-
"@
|
|
80
|
-
"
|
|
81
|
-
"@testing-library/jest-dom": "^5.10.1",
|
|
82
|
-
"@testing-library/react": "^12.1.3",
|
|
83
|
-
"@testing-library/user-event": "^14.0.0",
|
|
84
|
-
"@types/jest": "^29.5.12",
|
|
85
|
-
"@types/luxon": "^3.3.1",
|
|
86
|
-
"@types/node": "^16.11.26",
|
|
87
|
-
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
88
|
-
"@types/uuid": "^10.0.0",
|
|
89
|
-
"copyfiles": "^2.4.1",
|
|
90
|
-
"msw": "^1.2.4",
|
|
91
|
-
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
92
|
-
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
93
|
-
"react-router-dom": "6.0.0-beta.0 || ^6.3.0",
|
|
94
|
-
"ts-jest": "^29.1.4",
|
|
95
|
-
"typescript": "^4.8.4"
|
|
78
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
79
|
+
"@types/copyfiles": "^2",
|
|
80
|
+
"copyfiles": "^2.4.1"
|
|
96
81
|
},
|
|
97
82
|
"files": [
|
|
98
83
|
"dist/**/*",
|
|
@@ -100,6 +85,12 @@
|
|
|
100
85
|
"assets/**/*"
|
|
101
86
|
],
|
|
102
87
|
"configSchema": "config.d.ts",
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
|
|
88
|
+
"module": "./dist/index.esm.js",
|
|
89
|
+
"typesVersions": {
|
|
90
|
+
"*": {
|
|
91
|
+
"package.json": [
|
|
92
|
+
"package.json"
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|