@pagerduty/backstage-plugin 0.15.10-next.0 → 0.16.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.
Files changed (107) hide show
  1. package/assets/PD-Green.svg +21 -0
  2. package/assets/PD-Icon.svg +13 -0
  3. package/assets/PD-White.svg +21 -0
  4. package/assets/emptystate.svg +6 -0
  5. package/assets/forbiddenstate.svg +25 -0
  6. package/dist/alpha/api.esm.js +22 -0
  7. package/dist/alpha/api.esm.js.map +1 -0
  8. package/dist/alpha/entity-cards.esm.js +69 -0
  9. package/dist/alpha/entity-cards.esm.js.map +1 -0
  10. package/dist/alpha/nav-items.esm.js +21 -0
  11. package/dist/alpha/nav-items.esm.js.map +1 -0
  12. package/dist/alpha/pages.esm.js +15 -0
  13. package/dist/alpha/pages.esm.js.map +1 -0
  14. package/dist/alpha/plugin.esm.js +26 -0
  15. package/dist/alpha/plugin.esm.js.map +1 -0
  16. package/dist/alpha.d.ts +139 -0
  17. package/dist/alpha.esm.js +2 -0
  18. package/dist/alpha.esm.js.map +1 -0
  19. package/dist/api/client.esm.js +225 -0
  20. package/dist/api/client.esm.js.map +1 -0
  21. package/dist/assets/PD-Green.svg +21 -0
  22. package/dist/assets/PD-Icon.svg +13 -0
  23. package/dist/assets/PD-White.svg +21 -0
  24. package/dist/assets/emptystate.svg +6 -0
  25. package/dist/assets/forbiddenstate.svg +25 -0
  26. package/dist/components/ChangeEvents/ChangeEventEmptyState.esm.js +29 -0
  27. package/dist/components/ChangeEvents/ChangeEventEmptyState.esm.js.map +1 -0
  28. package/dist/components/ChangeEvents/ChangeEventForbiddenState.esm.js +29 -0
  29. package/dist/components/ChangeEvents/ChangeEventForbiddenState.esm.js.map +1 -0
  30. package/dist/components/ChangeEvents/ChangeEventListItem.esm.js +85 -0
  31. package/dist/components/ChangeEvents/ChangeEventListItem.esm.js.map +1 -0
  32. package/dist/components/ChangeEvents/ChangeEvents.esm.js +60 -0
  33. package/dist/components/ChangeEvents/ChangeEvents.esm.js.map +1 -0
  34. package/dist/components/EntityPagerDutyCard/index.esm.js +29 -0
  35. package/dist/components/EntityPagerDutyCard/index.esm.js.map +1 -0
  36. package/dist/components/EntityPagerDutySmallCard/index.esm.js +29 -0
  37. package/dist/components/EntityPagerDutySmallCard/index.esm.js.map +1 -0
  38. package/dist/components/Errors/ForbiddenError.esm.js +24 -0
  39. package/dist/components/Errors/ForbiddenError.esm.js.map +1 -0
  40. package/dist/components/Errors/MissingTokenError.esm.js +24 -0
  41. package/dist/components/Errors/MissingTokenError.esm.js.map +1 -0
  42. package/dist/components/Errors/ServiceNotFoundError.esm.js +24 -0
  43. package/dist/components/Errors/ServiceNotFoundError.esm.js.map +1 -0
  44. package/dist/components/Escalation/EscalationPolicy.esm.js +53 -0
  45. package/dist/components/Escalation/EscalationPolicy.esm.js.map +1 -0
  46. package/dist/components/Escalation/EscalationUser.esm.js +97 -0
  47. package/dist/components/Escalation/EscalationUser.esm.js.map +1 -0
  48. package/dist/components/Escalation/EscalationUsersEmptyState.esm.js +23 -0
  49. package/dist/components/Escalation/EscalationUsersEmptyState.esm.js.map +1 -0
  50. package/dist/components/Escalation/EscalationUsersForbiddenState.esm.js +23 -0
  51. package/dist/components/Escalation/EscalationUsersForbiddenState.esm.js.map +1 -0
  52. package/dist/components/HomePagePagerDutyCard/Content.esm.js +9 -0
  53. package/dist/components/HomePagePagerDutyCard/Content.esm.js.map +1 -0
  54. package/dist/components/HomePagePagerDutyCard/index.esm.js +2 -0
  55. package/dist/components/HomePagePagerDutyCard/index.esm.js.map +1 -0
  56. package/dist/components/Icons/index.esm.js +9 -0
  57. package/dist/components/Icons/index.esm.js.map +1 -0
  58. package/dist/components/Incident/IncidentEmptyState.esm.js +29 -0
  59. package/dist/components/Incident/IncidentEmptyState.esm.js.map +1 -0
  60. package/dist/components/Incident/IncidentForbiddenState.esm.js +29 -0
  61. package/dist/components/Incident/IncidentForbiddenState.esm.js.map +1 -0
  62. package/dist/components/Incident/IncidentListItem.esm.js +128 -0
  63. package/dist/components/Incident/IncidentListItem.esm.js.map +1 -0
  64. package/dist/components/Incident/Incidents.esm.js +54 -0
  65. package/dist/components/Incident/Incidents.esm.js.map +1 -0
  66. package/dist/components/PagerDutyCard/index.esm.js +231 -0
  67. package/dist/components/PagerDutyCard/index.esm.js.map +1 -0
  68. package/dist/components/PagerDutyCardCommon/InsightsCard.esm.js +42 -0
  69. package/dist/components/PagerDutyCardCommon/InsightsCard.esm.js.map +1 -0
  70. package/dist/components/PagerDutyCardCommon/OpenServiceButton.esm.js +43 -0
  71. package/dist/components/PagerDutyCardCommon/OpenServiceButton.esm.js.map +1 -0
  72. package/dist/components/PagerDutyCardCommon/ServiceStandardsCard.esm.js +134 -0
  73. package/dist/components/PagerDutyCardCommon/ServiceStandardsCard.esm.js.map +1 -0
  74. package/dist/components/PagerDutyCardCommon/StatusCard.esm.js +109 -0
  75. package/dist/components/PagerDutyCardCommon/StatusCard.esm.js.map +1 -0
  76. package/dist/components/PagerDutyCardCommon/TriggerIncidentButton.esm.js +66 -0
  77. package/dist/components/PagerDutyCardCommon/TriggerIncidentButton.esm.js.map +1 -0
  78. package/dist/components/PagerDutyPage/MappingTable.esm.js +282 -0
  79. package/dist/components/PagerDutyPage/MappingTable.esm.js.map +1 -0
  80. package/dist/components/PagerDutyPage/ServiceMappingComponent.esm.js +50 -0
  81. package/dist/components/PagerDutyPage/ServiceMappingComponent.esm.js.map +1 -0
  82. package/dist/components/PagerDutyPage/index.esm.js +117 -0
  83. package/dist/components/PagerDutyPage/index.esm.js.map +1 -0
  84. package/dist/components/PagerDutySmallCard/index.esm.js +227 -0
  85. package/dist/components/PagerDutySmallCard/index.esm.js.map +1 -0
  86. package/dist/components/TriggerButton/index.esm.js +51 -0
  87. package/dist/components/TriggerButton/index.esm.js.map +1 -0
  88. package/dist/components/TriggerDialog/TriggerDialog.esm.js +120 -0
  89. package/dist/components/TriggerDialog/TriggerDialog.esm.js.map +1 -0
  90. package/dist/components/constants.esm.js +6 -0
  91. package/dist/components/constants.esm.js.map +1 -0
  92. package/dist/components/pagerDutyEntity.esm.js +14 -0
  93. package/dist/components/pagerDutyEntity.esm.js.map +1 -0
  94. package/dist/deprecated.esm.js +10 -0
  95. package/dist/deprecated.esm.js.map +1 -0
  96. package/dist/hooks/index.esm.js +10 -0
  97. package/dist/hooks/index.esm.js.map +1 -0
  98. package/dist/index.d.ts +182 -0
  99. package/dist/index.esm.js +8 -0
  100. package/dist/index.esm.js.map +1 -0
  101. package/dist/package.json.esm.js +133 -0
  102. package/dist/package.json.esm.js.map +1 -0
  103. package/dist/plugin.esm.js +76 -0
  104. package/dist/plugin.esm.js.map +1 -0
  105. package/dist/routes.esm.js +6 -0
  106. package/dist/routes.esm.js.map +1 -0
  107. package/package.json +19 -7
@@ -0,0 +1,120 @@
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useState, useEffect } from 'react';
3
+ import { useTheme, Dialog, DialogTitle, DialogContent, Typography, TextField, DialogActions, CircularProgress } from '@material-ui/core';
4
+ import useAsyncFn from 'react-use/lib/useAsyncFn';
5
+ import { pagerDutyApiRef } from '../../api/client.esm.js';
6
+ import { Alert } from '@material-ui/lab';
7
+ import { useApi, alertApiRef, identityApiRef } from '@backstage/core-plugin-api';
8
+ import { parseEntityRef, DEFAULT_NAMESPACE } from '@backstage/catalog-model';
9
+ import { Button } from '@backstage/ui';
10
+
11
+ const TriggerDialog = ({
12
+ showDialog,
13
+ handleDialog,
14
+ onIncidentCreated,
15
+ serviceName,
16
+ integrationKey
17
+ }) => {
18
+ const alertApi = useApi(alertApiRef);
19
+ const identityApi = useApi(identityApiRef);
20
+ const api = useApi(pagerDutyApiRef);
21
+ const [description, setDescription] = useState("");
22
+ const theme = useTheme();
23
+ const [{ value, loading, error }, handleTriggerAlarm] = useAsyncFn(
24
+ async (descriptions) => {
25
+ const { userEntityRef } = await identityApi.getBackstageIdentity();
26
+ const { name: userName } = parseEntityRef(userEntityRef, {
27
+ defaultKind: "User",
28
+ defaultNamespace: DEFAULT_NAMESPACE
29
+ });
30
+ return await api.triggerAlarm({
31
+ integrationKey,
32
+ source: window.location.toString(),
33
+ description: descriptions,
34
+ userName
35
+ });
36
+ }
37
+ );
38
+ const descriptionChanged = (event) => {
39
+ setDescription(event.target.value);
40
+ };
41
+ useEffect(() => {
42
+ if (value) {
43
+ (async () => {
44
+ alertApi.post({
45
+ message: `Alarm successfully triggered`
46
+ });
47
+ setDescription("");
48
+ handleDialog();
49
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
50
+ onIncidentCreated?.();
51
+ })();
52
+ }
53
+ }, [value, alertApi, handleDialog, onIncidentCreated]);
54
+ if (error) {
55
+ alertApi.post({
56
+ message: `Failed to trigger alarm. ${error.message}`,
57
+ severity: "error"
58
+ });
59
+ }
60
+ return /* @__PURE__ */ jsxs(Dialog, { maxWidth: "md", open: showDialog, onClose: handleDialog, fullWidth: true, children: [
61
+ /* @__PURE__ */ jsxs(DialogTitle, { children: [
62
+ "This action will trigger an incident for",
63
+ " ",
64
+ /* @__PURE__ */ jsxs("strong", { children: [
65
+ '"',
66
+ serviceName,
67
+ '"'
68
+ ] }),
69
+ "."
70
+ ] }),
71
+ /* @__PURE__ */ jsxs(DialogContent, { children: [
72
+ /* @__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.` }) }),
73
+ /* @__PURE__ */ jsx(
74
+ Typography,
75
+ {
76
+ variant: "body1",
77
+ style: { marginTop: "1em" },
78
+ gutterBottom: true,
79
+ align: "justify",
80
+ 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."
81
+ }
82
+ ),
83
+ /* @__PURE__ */ jsx(
84
+ TextField,
85
+ {
86
+ inputProps: { "data-testid": "trigger-input" },
87
+ id: "description",
88
+ multiline: true,
89
+ fullWidth: true,
90
+ minRows: 4,
91
+ margin: "normal",
92
+ label: "Problem description",
93
+ variant: "outlined",
94
+ onChange: descriptionChanged
95
+ }
96
+ )
97
+ ] }),
98
+ /* @__PURE__ */ jsxs(DialogActions, { children: [
99
+ /* @__PURE__ */ jsx(
100
+ Button,
101
+ {
102
+ "data-testid": "trigger-button",
103
+ id: "trigger",
104
+ style: {
105
+ background: !description || loading ? theme.palette.action.disabled : theme.palette.secondary.main
106
+ },
107
+ isDisabled: !description || loading,
108
+ variant: "primary",
109
+ onClick: () => handleTriggerAlarm(description),
110
+ iconEnd: loading ? /* @__PURE__ */ jsx(CircularProgress, { size: 16 }) : /* @__PURE__ */ jsx(Fragment, {}),
111
+ children: "TRIGGER INCIDENT"
112
+ }
113
+ ),
114
+ /* @__PURE__ */ jsx(Button, { id: "close", onClick: handleDialog, children: "CLOSE" })
115
+ ] })
116
+ ] });
117
+ };
118
+
119
+ export { TriggerDialog };
120
+ //# sourceMappingURL=TriggerDialog.esm.js.map
@@ -0,0 +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 { useState, useEffect } from 'react';\nimport {\n Dialog,\n DialogTitle,\n TextField,\n DialogActions,\n DialogContent,\n Typography,\n CircularProgress,\n useTheme,\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';\nimport { Button } from '@backstage/ui';\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 const theme = useTheme();\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{' '}\n <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 style={{\n background:\n !description || loading\n ? theme.palette.action.disabled\n : theme.palette.secondary.main,\n }}\n isDisabled={!description || loading}\n variant=\"primary\"\n onClick={() => handleTriggerAlarm(description)}\n iconEnd={loading ? <CircularProgress size={16} /> : <></>}\n >\n TRIGGER INCIDENT\n </Button>\n <Button id=\"close\" onClick={handleDialog}>\n CLOSE\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,6 @@
1
+ const PAGERDUTY_INTEGRATION_KEY = "pagerduty.com/integration-key";
2
+ const PAGERDUTY_SERVICE_ID = "pagerduty.com/service-id";
3
+ const PAGERDUTY_ACCOUNT_NAME = "pagerduty.com/account";
4
+
5
+ export { PAGERDUTY_ACCOUNT_NAME, PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID };
6
+ //# sourceMappingURL=constants.esm.js.map
@@ -0,0 +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,yBAAA,GAA4B;AAClC,MAAM,oBAAA,GAAuB;AAC7B,MAAM,sBAAA,GAAyB;;;;"}
@@ -0,0 +1,14 @@
1
+ import { PAGERDUTY_ACCOUNT_NAME, PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from './constants.esm.js';
2
+
3
+ function getPagerDutyEntity(entity) {
4
+ const {
5
+ [PAGERDUTY_INTEGRATION_KEY]: integrationKey,
6
+ [PAGERDUTY_SERVICE_ID]: serviceId,
7
+ [PAGERDUTY_ACCOUNT_NAME]: account
8
+ } = entity.metadata.annotations || {};
9
+ const name = entity.metadata.name;
10
+ return { integrationKey, serviceId, account, name };
11
+ }
12
+
13
+ export { getPagerDutyEntity };
14
+ //# sourceMappingURL=pagerDutyEntity.esm.js.map
@@ -0,0 +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 {\n PAGERDUTY_INTEGRATION_KEY,\n PAGERDUTY_SERVICE_ID,\n PAGERDUTY_ACCOUNT_NAME,\n} 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":";;AAwBO,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;;;;"}
@@ -0,0 +1,10 @@
1
+ import { EntityPagerDutyCard } from './components/EntityPagerDutyCard/index.esm.js';
2
+ import 'react/jsx-runtime';
3
+ import '@backstage/plugin-catalog-react';
4
+ import './components/PagerDutySmallCard/index.esm.js';
5
+ import './components/TriggerButton/index.esm.js';
6
+
7
+ const PagerDutyCard = EntityPagerDutyCard;
8
+
9
+ export { PagerDutyCard };
10
+ //# sourceMappingURL=deprecated.esm.js.map
@@ -0,0 +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":";;;;;;AAsBO,MAAM,aAAA,GAAgB;;;;"}
@@ -0,0 +1,10 @@
1
+ import { useEntity } from '@backstage/plugin-catalog-react';
2
+ import { getPagerDutyEntity } from '../components/pagerDutyEntity.esm.js';
3
+
4
+ function usePagerdutyEntity() {
5
+ const { entity } = useEntity();
6
+ return getPagerDutyEntity(entity);
7
+ }
8
+
9
+ export { usePagerdutyEntity };
10
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +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,kBAAA,GAAsC;AACpD,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAE7B,EAAA,OAAO,mBAAmB,MAAM,CAAA;AAClC;;;;"}
@@ -0,0 +1,182 @@
1
+ import * as _backstage_plugin_home_react from '@backstage/plugin-home-react';
2
+ import { Entity } from '@backstage/catalog-model';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
5
+ import { DiscoveryApi, FetchApi, ConfigApi } from '@backstage/core-plugin-api';
6
+ import { ReactNode } from 'react';
7
+ import { PagerDutySetting, PagerDutyEntityMappingsResponse, PagerDutyServiceResponse, PagerDutyIncidentsResponse, PagerDutyChangeEventsResponse, PagerDutyServiceStandardsResponse, PagerDutyServiceMetricsResponse, PagerDutyUser } from '@pagerduty/backstage-plugin-common';
8
+
9
+ /** @public */
10
+ declare const isPluginApplicableToEntity$1: (entity: Entity) => boolean;
11
+ /** @public */
12
+ type EntityPagerDutySmallCardProps = {
13
+ readOnly?: boolean;
14
+ disableInsights?: boolean;
15
+ disableOnCall?: boolean;
16
+ };
17
+
18
+ /** @public */
19
+ declare const isPluginApplicableToEntity: (entity: Entity) => boolean;
20
+ /** @public */
21
+ type EntityPagerDutyCardProps = {
22
+ readOnly?: boolean;
23
+ disableChangeEvents?: boolean;
24
+ disableOnCall?: boolean;
25
+ };
26
+
27
+ /** @public */
28
+ type PagerDutyEntity = {
29
+ integrationKey?: string;
30
+ serviceId?: string;
31
+ account?: string;
32
+ name: string;
33
+ };
34
+
35
+ /** @public */
36
+ type HomePagePagerDutyCardProps = PagerDutyEntity & {
37
+ readOnly?: boolean;
38
+ };
39
+
40
+ /** @public */
41
+ declare const pagerDutyPlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}, {}>;
42
+ /** @public */
43
+ declare const PagerDutyPage: () => react_jsx_runtime.JSX.Element;
44
+ /** @public */
45
+ declare const EntityPagerDutyCard: (props: EntityPagerDutyCardProps) => react_jsx_runtime.JSX.Element | null;
46
+ /** @public */
47
+ declare const EntityPagerDutySmallCard: (props: EntityPagerDutySmallCardProps) => react_jsx_runtime.JSX.Element | null;
48
+ /** @public */
49
+ declare const HomePagePagerDutyCard: (props: _backstage_plugin_home_react.CardExtensionProps<HomePagePagerDutyCardProps>) => react_jsx_runtime.JSX.Element;
50
+
51
+ /** @public */
52
+ declare function PagerDutyIcon(): react_jsx_runtime.JSX.Element;
53
+
54
+ /** @public */
55
+ declare function TriggerButton(props: {
56
+ children?: ReactNode;
57
+ }): react_jsx_runtime.JSX.Element;
58
+
59
+ /** @public */
60
+ type PagerDutyTriggerAlarmRequest = {
61
+ integrationKey: string;
62
+ source: string;
63
+ description: string;
64
+ userName: string;
65
+ };
66
+ /** @public */
67
+ interface PagerDutyApi {
68
+ /**
69
+ * Fetches PagerDuty setting from store.
70
+ *
71
+ */
72
+ getSetting(id: string): Promise<PagerDutySetting>;
73
+ /**
74
+ * Stores PagerDuty setting in the database.
75
+ *
76
+ */
77
+ storeSettings(settings: PagerDutySetting[]): Promise<Response>;
78
+ /**
79
+ * Fetches all entity mappings.
80
+ *
81
+ */
82
+ getEntityMappings(): Promise<PagerDutyEntityMappingsResponse>;
83
+ /**
84
+ * Stores the service mapping in the database.
85
+ *
86
+ */
87
+ storeServiceMapping(serviceId: string, integrationKey: string, entityRef: string, account: string): Promise<Response>;
88
+ /**
89
+ * Fetches the service for the provided pager duty Entity.
90
+ *
91
+ */
92
+ getServiceByPagerDutyEntity(pagerDutyEntity: PagerDutyEntity): Promise<PagerDutyServiceResponse>;
93
+ /**
94
+ * Fetches the service for the provided Entity.
95
+ *
96
+ */
97
+ getServiceByEntity(entity: Entity): Promise<PagerDutyServiceResponse>;
98
+ /**
99
+ * Fetches service with the provided service id.
100
+ *
101
+ */
102
+ getServiceById(serviceId: string, account?: string): Promise<PagerDutyServiceResponse>;
103
+ /**
104
+ * Fetches a list of incidents a provided service has.
105
+ *
106
+ */
107
+ getIncidentsByServiceId(serviceId: string, account?: string): Promise<PagerDutyIncidentsResponse>;
108
+ /**
109
+ * Fetches a list of change events a provided service has.
110
+ *
111
+ */
112
+ getChangeEventsByServiceId(serviceId: string, account?: string): Promise<PagerDutyChangeEventsResponse>;
113
+ /**
114
+ * Fetches a list of standards for a provided service.
115
+ *
116
+ */
117
+ getServiceStandardsByServiceId(serviceId: string, account?: string): Promise<PagerDutyServiceStandardsResponse>;
118
+ /**
119
+ * Fetches a list of metrics for a provided service.
120
+ *
121
+ */
122
+ getServiceMetricsByServiceId(serviceId: string, account?: string): Promise<PagerDutyServiceMetricsResponse>;
123
+ /**
124
+ * Fetches the list of users in an escalation policy.
125
+ *
126
+ */
127
+ getOnCallByPolicyId(policyId: string, account?: string): Promise<PagerDutyUser[]>;
128
+ /**
129
+ * Triggers an incident to whoever is on-call.
130
+ */
131
+ triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise<Response>;
132
+ }
133
+ /** @public */
134
+ type PagerDutyClientApiDependencies = {
135
+ discoveryApi: DiscoveryApi;
136
+ fetchApi: FetchApi;
137
+ };
138
+ /** @public */
139
+ type PagerDutyClientApiConfig = PagerDutyClientApiDependencies & {
140
+ eventsBaseUrl?: string;
141
+ };
142
+
143
+ /** @public */
144
+ declare class UnauthorizedError extends Error {
145
+ }
146
+ /** @public */
147
+ declare const pagerDutyApiRef: _backstage_core_plugin_api.ApiRef<PagerDutyApi>;
148
+ /** @public */
149
+ declare class PagerDutyClient implements PagerDutyApi {
150
+ private readonly config;
151
+ static fromConfig(configApi: ConfigApi, dependencies: PagerDutyClientApiDependencies): PagerDutyClient;
152
+ constructor(config: PagerDutyClientApiConfig);
153
+ getServiceByPagerDutyEntity(pagerDutyEntity: PagerDutyEntity): Promise<PagerDutyServiceResponse>;
154
+ getSetting(id: string): Promise<PagerDutySetting>;
155
+ storeSettings(settings: PagerDutySetting[]): Promise<Response>;
156
+ getEntityMappings(): Promise<PagerDutyEntityMappingsResponse>;
157
+ storeServiceMapping(serviceId: string, integrationKey: string, backstageEntityRef: string, account: string): Promise<Response>;
158
+ getServiceByEntity(entity: Entity): Promise<PagerDutyServiceResponse>;
159
+ getServiceById(serviceId: string, account?: string): Promise<PagerDutyServiceResponse>;
160
+ getIncidentsByServiceId(serviceId: string, account?: string): Promise<PagerDutyIncidentsResponse>;
161
+ getChangeEventsByServiceId(serviceId: string, account?: string): Promise<PagerDutyChangeEventsResponse>;
162
+ getServiceStandardsByServiceId(serviceId: string, account?: string): Promise<PagerDutyServiceStandardsResponse>;
163
+ getServiceMetricsByServiceId(serviceId: string, account?: string): Promise<PagerDutyServiceMetricsResponse>;
164
+ getOnCallByPolicyId(policyId: string, account?: string): Promise<PagerDutyUser[]>;
165
+ triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise<Response>;
166
+ private findByUrl;
167
+ private request;
168
+ }
169
+
170
+ /**
171
+ * @public
172
+ * @deprecated Please use EntityPagerDutyCard
173
+ */
174
+ declare const PagerDutyCard: (props: EntityPagerDutyCardProps) => react_jsx_runtime.JSX.Element | null;
175
+ /**
176
+ * @public
177
+ * @deprecated Please use EntityPagerDutyCardProps
178
+ */
179
+ type PagerDutyCardProps = EntityPagerDutyCardProps;
180
+
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 };
@@ -0,0 +1,8 @@
1
+ export { EntityPagerDutyCard, EntityPagerDutySmallCard, HomePagePagerDutyCard, PagerDutyPage, pagerDutyPlugin, pagerDutyPlugin as plugin } from './plugin.esm.js';
2
+ export { isPluginApplicableToEntity as isPagerDutyAvailable, isPluginApplicableToEntity } from './components/EntityPagerDutyCard/index.esm.js';
3
+ export { isPluginApplicableToEntity as isPagerDutySmallCardAvailable } from './components/EntityPagerDutySmallCard/index.esm.js';
4
+ export { PagerDutyIcon } from './components/Icons/index.esm.js';
5
+ export { TriggerButton } from './components/TriggerButton/index.esm.js';
6
+ export { PagerDutyClient, UnauthorizedError, pagerDutyApiRef } from './api/client.esm.js';
7
+ export { PagerDutyCard } from './deprecated.esm.js';
8
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -0,0 +1,133 @@
1
+ var name = "@pagerduty/backstage-plugin";
2
+ var description = "A Backstage plugin that integrates towards PagerDuty";
3
+ var version = "0.16.0";
4
+ var main = "dist/index.esm.js";
5
+ var types = "dist/index.d.ts";
6
+ var license = "Apache-2.0";
7
+ var publishConfig = {
8
+ access: "public"
9
+ };
10
+ var backstage = {
11
+ pluginId: "pagerduty",
12
+ role: "frontend-plugin",
13
+ pluginPackages: [
14
+ "@pagerduty/backstage-plugin",
15
+ "@pagerduty/backstage-plugin-common",
16
+ "@pagerduty/backstage-plugin-backend"
17
+ ]
18
+ };
19
+ var homepage = "https://github.com/pagerduty/backstage-plugin";
20
+ var repository = {
21
+ type: "git",
22
+ url: "https://github.com/pagerduty/backstage-plugin.git",
23
+ directory: "."
24
+ };
25
+ var keywords = [
26
+ "backstage",
27
+ "plugin",
28
+ "pagerduty"
29
+ ];
30
+ var sideEffects = false;
31
+ var scripts = {
32
+ build: "backstage-cli package build && copyfiles -u 1 src/assets/*.svg ./",
33
+ start: "backstage-cli package start --config ./dev/app-config.yaml",
34
+ lint: "backstage-cli package lint",
35
+ test: "backstage-cli package test",
36
+ prepare: "husky install",
37
+ prepack: "node ../../scripts/replace-versions.js backstage-plugin && backstage-cli package prepack",
38
+ postpack: "backstage-cli package postpack",
39
+ clean: "backstage-cli package clean"
40
+ };
41
+ var dependencies = {
42
+ "@backstage/catalog-client": "^1.12.0",
43
+ "@backstage/catalog-model": "^1.7.5",
44
+ "@backstage/core-compat-api": "^0.5.2",
45
+ "@backstage/core-components": "^0.18.0",
46
+ "@backstage/core-plugin-api": "^1.11.0",
47
+ "@backstage/errors": "^1.2.7",
48
+ "@backstage/frontend-plugin-api": "^0.12.0",
49
+ "@backstage/plugin-catalog": "^1.31.3",
50
+ "@backstage/plugin-catalog-react": "^1.21.0",
51
+ "@backstage/plugin-home-react": "^0.1.30",
52
+ "@backstage/theme": "^0.5.6",
53
+ "@backstage/ui": "^0.6.1",
54
+ "@emotion/react": "^11.11.4",
55
+ "@emotion/styled": "^11.11.5",
56
+ "@material-ui/core": "^4.12.2",
57
+ "@material-ui/icons": "^4.9.1",
58
+ "@material-ui/lab": "4.0.0-alpha.61",
59
+ "@mui/icons-material": "^5.15.19",
60
+ "@mui/material": "^5.15.19",
61
+ "@mui/x-date-pickers": "^7.6.1",
62
+ "@pagerduty/backstage-plugin-common": "workspace:~",
63
+ "@tanstack/react-query": "^5.40.1",
64
+ classnames: "^2.2.6",
65
+ luxon: "^3.4.1",
66
+ "material-react-table": "^2.13.0",
67
+ "react-use": "^17.2.4",
68
+ uuid: "^10.0.0",
69
+ "validate-color": "^2.2.4"
70
+ };
71
+ var peerDependencies = {
72
+ react: "^18.0.0 || ^20.0.0",
73
+ "react-dom": "^18.0.0 || ^20.0.0",
74
+ "react-router-dom": "^6.3.0"
75
+ };
76
+ var devDependencies = {
77
+ "@backstage/cli": "^0.34.3",
78
+ "@backstage/core-app-api": "^1.19.0",
79
+ "@backstage/dev-utils": "^1.1.14",
80
+ "@backstage/frontend-defaults": "^0.3.1",
81
+ "@backstage/test-utils": "^1.7.11",
82
+ "@testing-library/jest-dom": "^6.6.3",
83
+ "@types/copyfiles": "^2",
84
+ copyfiles: "^2.4.1"
85
+ };
86
+ var files = [
87
+ "dist/**/*",
88
+ "config.d.ts",
89
+ "assets/**/*"
90
+ ];
91
+ var exports = {
92
+ ".": "./src/index.ts",
93
+ "./alpha": "./src/alpha/index.ts",
94
+ "./package.json": "./package.json"
95
+ };
96
+ var typesVersions = {
97
+ "*": {
98
+ alpha: [
99
+ "src/alpha/index.ts"
100
+ ],
101
+ "package.json": [
102
+ "package.json"
103
+ ]
104
+ }
105
+ };
106
+ var configSchema = "config.d.ts";
107
+ var module = "./dist/index.esm.js";
108
+ var _package = {
109
+ name: name,
110
+ description: description,
111
+ version: version,
112
+ main: main,
113
+ types: types,
114
+ license: license,
115
+ publishConfig: publishConfig,
116
+ backstage: backstage,
117
+ homepage: homepage,
118
+ repository: repository,
119
+ keywords: keywords,
120
+ sideEffects: sideEffects,
121
+ scripts: scripts,
122
+ dependencies: dependencies,
123
+ peerDependencies: peerDependencies,
124
+ devDependencies: devDependencies,
125
+ files: files,
126
+ exports: exports,
127
+ typesVersions: typesVersions,
128
+ configSchema: configSchema,
129
+ module: module
130
+ };
131
+
132
+ export { backstage, configSchema, _package as default, dependencies, description, devDependencies, exports, files, homepage, keywords, license, main, module, name, peerDependencies, publishConfig, repository, scripts, sideEffects, types, typesVersions, version };
133
+ //# sourceMappingURL=package.json.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,76 @@
1
+ import { PagerDutyClient, pagerDutyApiRef } from './api/client.esm.js';
2
+ import { createPlugin, createApiFactory, fetchApiRef, configApiRef, discoveryApiRef, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
3
+ import { createCardExtension } from '@backstage/plugin-home-react';
4
+ import { rootRouteRef } from './routes.esm.js';
5
+
6
+ const pagerDutyPlugin = createPlugin({
7
+ id: "pagerduty",
8
+ apis: [
9
+ createApiFactory({
10
+ api: pagerDutyApiRef,
11
+ deps: {
12
+ discoveryApi: discoveryApiRef,
13
+ configApi: configApiRef,
14
+ fetchApi: fetchApiRef
15
+ },
16
+ factory: ({ configApi, discoveryApi, fetchApi }) => PagerDutyClient.fromConfig(configApi, { discoveryApi, fetchApi })
17
+ })
18
+ ]
19
+ });
20
+ const PagerDutyPage = pagerDutyPlugin.provide(
21
+ createRoutableExtension({
22
+ name: "PagerDutyPage",
23
+ component: () => import('./components/PagerDutyPage/index.esm.js').then((m) => m.PagerDutyPage),
24
+ mountPoint: rootRouteRef
25
+ })
26
+ );
27
+ const EntityPagerDutyCard = pagerDutyPlugin.provide(
28
+ createComponentExtension({
29
+ name: "EntityPagerDutyCard",
30
+ component: {
31
+ lazy: () => import('./components/EntityPagerDutyCard/index.esm.js').then(
32
+ (m) => m.EntityPagerDutyCard
33
+ )
34
+ }
35
+ })
36
+ );
37
+ const EntityPagerDutySmallCard = pagerDutyPlugin.provide(
38
+ createComponentExtension({
39
+ name: "EntityPagerDutySmallCard",
40
+ component: {
41
+ lazy: () => import('./components/EntityPagerDutySmallCard/index.esm.js').then(
42
+ (m) => m.EntityPagerDutySmallCard
43
+ )
44
+ }
45
+ })
46
+ );
47
+ const HomePagePagerDutyCard = pagerDutyPlugin.provide(
48
+ createCardExtension({
49
+ name: "HomePagePagerDutyCard",
50
+ title: "PagerDuty Homepage Card",
51
+ components: () => import('./components/HomePagePagerDutyCard/index.esm.js'),
52
+ settings: {
53
+ schema: {
54
+ title: "PagerDuty",
55
+ type: "object",
56
+ properties: {
57
+ integrationKey: {
58
+ title: "PagerDuty integration key",
59
+ type: "string"
60
+ },
61
+ serviceId: {
62
+ title: "PagerDuty service id",
63
+ type: "string"
64
+ },
65
+ name: {
66
+ title: "PagerDuty service name",
67
+ type: "string"
68
+ }
69
+ }
70
+ }
71
+ }
72
+ })
73
+ );
74
+
75
+ export { EntityPagerDutyCard, EntityPagerDutySmallCard, HomePagePagerDutyCard, PagerDutyPage, pagerDutyPlugin };
76
+ //# sourceMappingURL=plugin.esm.js.map
@@ -0,0 +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 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';\nimport { rootRouteRef } from './routes';\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: () =>\n 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":";;;;;AA+BO,MAAM,kBAAkB,YAAA,CAAa;AAAA,EAC1C,EAAA,EAAI,WAAA;AAAA,EACJ,IAAA,EAAM;AAAA,IACJ,gBAAA,CAAiB;AAAA,MACf,GAAA,EAAK,eAAA;AAAA,MACL,IAAA,EAAM;AAAA,QACJ,YAAA,EAAc,eAAA;AAAA,QACd,SAAA,EAAW,YAAA;AAAA,QACX,QAAA,EAAU;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,SAAA,EAAW,YAAA,EAAc,QAAA,EAAS,KAC5C,eAAA,CAAgB,UAAA,CAAW,SAAA,EAAW,EAAE,YAAA,EAAc,UAAU;AAAA,KACnE;AAAA;AAEL,CAAC;AAGM,MAAM,gBAAgB,eAAA,CAAgB,OAAA;AAAA,EAC3C,uBAAA,CAAwB;AAAA,IACtB,IAAA,EAAM,eAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,yCAA4B,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,aAAa,CAAA;AAAA,IAChE,UAAA,EAAY;AAAA,GACb;AACH;AAGO,MAAM,sBAAsB,eAAA,CAAgB,OAAA;AAAA,EACjD,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,qBAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,+CAAkC,CAAA,CAAE,IAAA;AAAA,QACzC,OAAK,CAAA,CAAE;AAAA;AACT;AACJ,GACD;AACH;AAGO,MAAM,2BAA2B,eAAA,CAAgB,OAAA;AAAA,EACtD,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,0BAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,oDAAuC,CAAA,CAAE,IAAA;AAAA,QAC9C,OAAK,CAAA,CAAE;AAAA;AACT;AACJ,GACD;AACH;AAGO,MAAM,wBAAwB,eAAA,CAAgB,OAAA;AAAA,EACnD,mBAAA,CAAgD;AAAA,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;;;;"}
@@ -0,0 +1,6 @@
1
+ import { createRouteRef } from '@backstage/core-plugin-api';
2
+
3
+ const rootRouteRef = createRouteRef({ id: "pagerduty" });
4
+
5
+ export { rootRouteRef };
6
+ //# sourceMappingURL=routes.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.esm.js","sources":["../src/routes.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 { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({ id: 'pagerduty' });\n"],"names":[],"mappings":";;AAkBO,MAAM,YAAA,GAAe,cAAA,CAAe,EAAE,EAAA,EAAI,aAAa;;;;"}