@pagerduty/backstage-plugin 0.15.0-next.9 → 0.15.1-next.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/dist/api/client.esm.js +24 -6
- package/dist/api/client.esm.js.map +1 -1
- package/dist/components/ChangeEvents/ChangeEvents.esm.js +1 -1
- package/dist/components/ChangeEvents/ChangeEvents.esm.js.map +1 -1
- package/dist/components/EntityPagerDutyCard/index.esm.js +3 -6
- package/dist/components/EntityPagerDutyCard/index.esm.js.map +1 -1
- package/dist/components/EntityPagerDutySmallCard/index.esm.js +3 -6
- package/dist/components/EntityPagerDutySmallCard/index.esm.js.map +1 -1
- package/dist/components/Escalation/EscalationPolicy.esm.js +1 -1
- package/dist/components/Escalation/EscalationPolicy.esm.js.map +1 -1
- package/dist/components/Incident/IncidentListItem.esm.js +2 -3
- package/dist/components/Incident/IncidentListItem.esm.js.map +1 -1
- package/dist/components/Incident/Incidents.esm.js +1 -1
- package/dist/components/Incident/Incidents.esm.js.map +1 -1
- package/dist/components/PagerDutyCard/index.esm.js +6 -7
- package/dist/components/PagerDutyCard/index.esm.js.map +1 -1
- package/dist/components/PagerDutyCardCommon/ServiceStandardsCard.esm.js +1 -1
- package/dist/components/PagerDutyCardCommon/ServiceStandardsCard.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/MappingTable.esm.js +19 -9
- package/dist/components/PagerDutyPage/MappingTable.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/ServiceMappingComponent.esm.js +11 -11
- package/dist/components/PagerDutyPage/ServiceMappingComponent.esm.js.map +1 -1
- package/dist/components/PagerDutyPage/index.esm.js +91 -30
- package/dist/components/PagerDutyPage/index.esm.js.map +1 -1
- package/dist/components/PagerDutySmallCard/index.esm.js +6 -7
- package/dist/components/PagerDutySmallCard/index.esm.js.map +1 -1
- package/dist/components/TriggerButton/index.esm.js +1 -2
- package/dist/components/TriggerButton/index.esm.js.map +1 -1
- package/dist/components/TriggerDialog/TriggerDialog.esm.js +1 -1
- package/dist/components/TriggerDialog/TriggerDialog.esm.js.map +1 -1
- package/dist/index.d.ts +13 -1
- package/package.json +14 -12
|
@@ -13,7 +13,6 @@ const useStyles = makeStyles((theme) => ({
|
|
|
13
13
|
}
|
|
14
14
|
}));
|
|
15
15
|
function TriggerButton(props) {
|
|
16
|
-
var _a;
|
|
17
16
|
const { buttonStyle } = useStyles();
|
|
18
17
|
const { integrationKey, name } = usePagerdutyEntity();
|
|
19
18
|
const [dialogShown, setDialogShown] = useState(false);
|
|
@@ -32,7 +31,7 @@ function TriggerButton(props) {
|
|
|
32
31
|
className: disabled ? "" : buttonStyle,
|
|
33
32
|
disabled
|
|
34
33
|
},
|
|
35
|
-
integrationKey ?
|
|
34
|
+
integrationKey ? props.children ?? "Create new incident" : "Missing integration key"
|
|
36
35
|
), integrationKey && /* @__PURE__ */ React.createElement(
|
|
37
36
|
TriggerDialog,
|
|
38
37
|
{
|
|
@@ -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 React, { 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,CAAU,KAAA,MAAA;AAAA,EACrD,WAAa,EAAA;AAAA,IACX,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,KAAM,CAAA,IAAA;AAAA,IACrC,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,KAAM,CAAA,YAAA;AAAA,IAC3B,SAAW,EAAA;AAAA,MACT,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,KAAM,CAAA,IAAA;AAAA,KACvC;AAAA,GACF;AACF,CAAE,CAAA,CAAA,CAAA;AAGK,SAAS,cAAc,KAAiC,EAAA;
|
|
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 React, { 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,CAAU,KAAA,MAAA;AAAA,EACrD,WAAa,EAAA;AAAA,IACX,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,KAAM,CAAA,IAAA;AAAA,IACrC,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,KAAM,CAAA,YAAA;AAAA,IAC3B,SAAW,EAAA;AAAA,MACT,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,KAAM,CAAA,IAAA;AAAA,KACvC;AAAA,GACF;AACF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
46
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
47
|
-
onIncidentCreated
|
|
47
|
+
onIncidentCreated?.();
|
|
48
48
|
})();
|
|
49
49
|
}
|
|
50
50
|
}, [value, alertApi, handleDialog, onIncidentCreated]);
|
|
@@ -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":";;;;;;;;AA8CO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,UAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AACF,CAAa,KAAA;AACX,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA,CAAA;AACnC,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA,CAAA;AACzC,EAAM,MAAA,GAAA,GAAM,OAAO,eAAe,CAAA,CAAA;AAClC,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAiB,EAAE,CAAA,CAAA;AAEzD,EAAA,MAAM,CAAC,EAAE,KAAA,EAAO,SAAS,KAAM,EAAA,EAAG,kBAAkB,CAAI,GAAA,UAAA;AAAA,IACtD,OAAO,YAAyB,KAAA;AAC9B,MAAA,MAAM,EAAE,aAAA,EAAkB,GAAA,MAAM,YAAY,oBAAqB,EAAA,CAAA;AACjE,MAAA,MAAM,EAAE,IAAA,EAAM,QAAS,EAAA,GAAI,eAAe,aAAe,EAAA;AAAA,QACvD,WAAa,EAAA,MAAA;AAAA,QACb,gBAAkB,EAAA,iBAAA;AAAA,OACnB,CAAA,CAAA;AACD,MAAO,OAAA,MAAM,IAAI,YAAa,CAAA;AAAA,QAC5B,cAAA;AAAA,QACA,MAAA,EAAQ,MAAO,CAAA,QAAA,CAAS,QAAS,EAAA;AAAA,QACjC,WAAa,EAAA,YAAA;AAAA,QACb,QAAA;AAAA,OACD,CAAA,CAAA;AAAA,KACH;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,kBAAA,GAAqB,CACzB,KACG,KAAA;AACH,IAAe,cAAA,CAAA,KAAA,CAAM,OAAO,KAAK,CAAA,CAAA;AAAA,GACnC,CAAA;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,CAAC,YAAY;AACX,QAAA,QAAA,CAAS,IAAK,CAAA;AAAA,UACZ,OAAS,EAAA,CAAA,4BAAA,CAAA;AAAA,SACV,CAAA,CAAA;AAGD,QAAA,cAAA,CAAe,EAAE,CAAA,CAAA;AAEjB,QAAa,YAAA,EAAA,CAAA;AAGb,QAAA,MAAM,IAAI,OAAQ,CAAA,CAAA,OAAA,KAAW,UAAW,CAAA,OAAA,EAAS,GAAI,CAAC,CAAA,CAAA;AACtD,
|
|
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,UAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AACF,CAAa,KAAA;AACX,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA,CAAA;AACnC,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA,CAAA;AACzC,EAAM,MAAA,GAAA,GAAM,OAAO,eAAe,CAAA,CAAA;AAClC,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAiB,EAAE,CAAA,CAAA;AAEzD,EAAA,MAAM,CAAC,EAAE,KAAA,EAAO,SAAS,KAAM,EAAA,EAAG,kBAAkB,CAAI,GAAA,UAAA;AAAA,IACtD,OAAO,YAAyB,KAAA;AAC9B,MAAA,MAAM,EAAE,aAAA,EAAkB,GAAA,MAAM,YAAY,oBAAqB,EAAA,CAAA;AACjE,MAAA,MAAM,EAAE,IAAA,EAAM,QAAS,EAAA,GAAI,eAAe,aAAe,EAAA;AAAA,QACvD,WAAa,EAAA,MAAA;AAAA,QACb,gBAAkB,EAAA,iBAAA;AAAA,OACnB,CAAA,CAAA;AACD,MAAO,OAAA,MAAM,IAAI,YAAa,CAAA;AAAA,QAC5B,cAA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AW,CAAA;AAAA,MAC7C,OAAS,EAAA,OAAA,oBAAY,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA,EAAiB,MAAM,EAAI,EAAA,CAAA;AAAA,KAAA;AAAA,IACjD,kBAAA;AAAA,GAED,kBACC,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAO,EAAG,EAAA,OAAA,EAAQ,KAAM,EAAA,SAAA,EAAU,OAAS,EAAA,YAAA,EAAA,EAAc,OAE1D,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import React__default, { ReactNode } from 'react';
|
|
6
6
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
7
7
|
import { DiscoveryApi, FetchApi, ConfigApi } from '@backstage/core-plugin-api';
|
|
8
|
-
import { PagerDutyEntityMappingsResponse, PagerDutyServiceResponse, PagerDutyIncidentsResponse, PagerDutyChangeEventsResponse, PagerDutyServiceStandardsResponse, PagerDutyServiceMetricsResponse, PagerDutyUser } from '@pagerduty/backstage-plugin-common';
|
|
8
|
+
import { PagerDutySetting, PagerDutyEntityMappingsResponse, PagerDutyServiceResponse, PagerDutyIncidentsResponse, PagerDutyChangeEventsResponse, PagerDutyServiceStandardsResponse, PagerDutyServiceMetricsResponse, PagerDutyUser } from '@pagerduty/backstage-plugin-common';
|
|
9
9
|
|
|
10
10
|
/** @public */
|
|
11
11
|
declare const isPluginApplicableToEntity$1: (entity: Entity) => boolean;
|
|
@@ -66,6 +66,16 @@ type PagerDutyTriggerAlarmRequest = {
|
|
|
66
66
|
};
|
|
67
67
|
/** @public */
|
|
68
68
|
interface PagerDutyApi {
|
|
69
|
+
/**
|
|
70
|
+
* Fetches PagerDuty setting from store.
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
getSetting(id: string): Promise<PagerDutySetting>;
|
|
74
|
+
/**
|
|
75
|
+
* Stores PagerDuty setting in the database.
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
storeSettings(settings: PagerDutySetting[]): Promise<Response>;
|
|
69
79
|
/**
|
|
70
80
|
* Fetches all entity mappings.
|
|
71
81
|
*
|
|
@@ -142,6 +152,8 @@ declare class PagerDutyClient implements PagerDutyApi {
|
|
|
142
152
|
static fromConfig(configApi: ConfigApi, dependencies: PagerDutyClientApiDependencies): PagerDutyClient;
|
|
143
153
|
constructor(config: PagerDutyClientApiConfig);
|
|
144
154
|
getServiceByPagerDutyEntity(pagerDutyEntity: PagerDutyEntity): Promise<PagerDutyServiceResponse>;
|
|
155
|
+
getSetting(id: string): Promise<PagerDutySetting>;
|
|
156
|
+
storeSettings(settings: PagerDutySetting[]): Promise<Response>;
|
|
145
157
|
getEntityMappings(): Promise<PagerDutyEntityMappingsResponse>;
|
|
146
158
|
storeServiceMapping(serviceId: string, integrationKey: string, backstageEntityRef: string, account: string): Promise<Response>;
|
|
147
159
|
getServiceByEntity(entity: Entity): Promise<PagerDutyServiceResponse>;
|
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.15.
|
|
4
|
+
"version": "0.15.1-next.0",
|
|
5
5
|
"main": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
"types": "dist/index.d.ts"
|
|
12
12
|
},
|
|
13
13
|
"backstage": {
|
|
14
|
-
"role": "frontend-plugin"
|
|
14
|
+
"role": "frontend-plugin",
|
|
15
|
+
"pluginId": "pagerduty",
|
|
16
|
+
"pluginPackages": "pagerduty"
|
|
15
17
|
},
|
|
16
18
|
"homepage": "https://github.com/pagerduty/backstage-plugin",
|
|
17
19
|
"repository": {
|
|
@@ -34,12 +36,12 @@
|
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
38
|
"@backstage/catalog-model": "^1.5.0",
|
|
37
|
-
"@backstage/core-components": "^0.14.
|
|
38
|
-
"@backstage/core-plugin-api": "^1.9.
|
|
39
|
+
"@backstage/core-components": "^0.14.9",
|
|
40
|
+
"@backstage/core-plugin-api": "^1.9.3",
|
|
39
41
|
"@backstage/errors": "^1.2.4",
|
|
40
|
-
"@backstage/plugin-catalog-react": "^1.12.
|
|
41
|
-
"@backstage/plugin-home-react": "^0.1.
|
|
42
|
-
"@backstage/theme": "^0.5.
|
|
42
|
+
"@backstage/plugin-catalog-react": "^1.12.2",
|
|
43
|
+
"@backstage/plugin-home-react": "^0.1.15",
|
|
44
|
+
"@backstage/theme": "^0.5.6",
|
|
43
45
|
"@emotion/react": "^11.11.4",
|
|
44
46
|
"@emotion/styled": "^11.11.5",
|
|
45
47
|
"@material-ui/core": "^4.12.2",
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
"@mui/icons-material": "^5.15.19",
|
|
49
51
|
"@mui/material": "^5.15.19",
|
|
50
52
|
"@mui/x-date-pickers": "^7.6.1",
|
|
51
|
-
"@pagerduty/backstage-plugin-common": "0.2.1
|
|
53
|
+
"@pagerduty/backstage-plugin-common": "0.2.1",
|
|
52
54
|
"@tanstack/react-query": "^5.40.1",
|
|
53
55
|
"classnames": "^2.2.6",
|
|
54
56
|
"luxon": "^3.4.1",
|
|
@@ -63,10 +65,10 @@
|
|
|
63
65
|
"react-router-dom": "^6.3.0"
|
|
64
66
|
},
|
|
65
67
|
"devDependencies": {
|
|
66
|
-
"@backstage/cli": "^0.26.
|
|
67
|
-
"@backstage/core-app-api": "^1.
|
|
68
|
-
"@backstage/dev-utils": "^1.0.
|
|
69
|
-
"@backstage/test-utils": "^1.5.
|
|
68
|
+
"@backstage/cli": "^0.26.11",
|
|
69
|
+
"@backstage/core-app-api": "^1.14.0",
|
|
70
|
+
"@backstage/dev-utils": "^1.0.35",
|
|
71
|
+
"@backstage/test-utils": "^1.5.8",
|
|
70
72
|
"@commitlint/cli": "^17.7.1",
|
|
71
73
|
"@commitlint/config-conventional": "^17.7.0",
|
|
72
74
|
"@testing-library/dom": "^8.0.0",
|