@pagerduty/backstage-plugin 0.19.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/alpha/pages.esm.js +41 -4
  3. package/dist/alpha/pages.esm.js.map +1 -1
  4. package/dist/alpha/plugin.esm.js +4 -3
  5. package/dist/alpha/plugin.esm.js.map +1 -1
  6. package/dist/alpha.d.ts +105 -26
  7. package/dist/api/client.esm.js +145 -3
  8. package/dist/api/client.esm.js.map +1 -1
  9. package/dist/components/PagerDutyPage/AutomaticMappingsDialog.esm.js +86 -40
  10. package/dist/components/PagerDutyPage/AutomaticMappingsDialog.esm.js.map +1 -1
  11. package/dist/components/PagerDutyPage/ConfigurationPage.esm.js +119 -0
  12. package/dist/components/PagerDutyPage/ConfigurationPage.esm.js.map +1 -0
  13. package/dist/components/PagerDutyPage/CustomFieldModal.esm.js +152 -0
  14. package/dist/components/PagerDutyPage/CustomFieldModal.esm.js.map +1 -0
  15. package/dist/components/PagerDutyPage/CustomFields/ButtonTabs.esm.js +51 -0
  16. package/dist/components/PagerDutyPage/CustomFields/ButtonTabs.esm.js.map +1 -0
  17. package/dist/components/PagerDutyPage/CustomFields/CustomFieldsEmptyState.esm.js +46 -0
  18. package/dist/components/PagerDutyPage/CustomFields/CustomFieldsEmptyState.esm.js.map +1 -0
  19. package/dist/components/PagerDutyPage/CustomFields/CustomFieldsTabPanel.esm.js +154 -0
  20. package/dist/components/PagerDutyPage/CustomFields/CustomFieldsTabPanel.esm.js.map +1 -0
  21. package/dist/components/PagerDutyPage/CustomFields/DeleteCustomFieldDialog.esm.js +63 -0
  22. package/dist/components/PagerDutyPage/CustomFields/DeleteCustomFieldDialog.esm.js.map +1 -0
  23. package/dist/components/PagerDutyPage/CustomFields/SyncLogsFilters.esm.js +126 -0
  24. package/dist/components/PagerDutyPage/CustomFields/SyncLogsFilters.esm.js.map +1 -0
  25. package/dist/components/PagerDutyPage/CustomFields/SyncLogsTab.esm.js +285 -0
  26. package/dist/components/PagerDutyPage/CustomFields/SyncLogsTab.esm.js.map +1 -0
  27. package/dist/components/PagerDutyPage/CustomFields/customFieldErrors.esm.js +13 -0
  28. package/dist/components/PagerDutyPage/CustomFields/customFieldErrors.esm.js.map +1 -0
  29. package/dist/components/PagerDutyPage/CustomFields.esm.js +192 -0
  30. package/dist/components/PagerDutyPage/CustomFields.esm.js.map +1 -0
  31. package/dist/components/PagerDutyPage/MappingsDialog.esm.js +2 -0
  32. package/dist/components/PagerDutyPage/MappingsDialog.esm.js.map +1 -1
  33. package/dist/components/PagerDutyPage/MappingsTable/MappingsTable.esm.js +1 -1
  34. package/dist/components/PagerDutyPage/MappingsTable/MappingsTable.esm.js.map +1 -1
  35. package/dist/components/PagerDutyPage/MappingsTable/MappingsTableContent.esm.js +15 -3
  36. package/dist/components/PagerDutyPage/MappingsTable/MappingsTableContent.esm.js.map +1 -1
  37. package/dist/components/PagerDutyPage/MappingsTable/NameCell.esm.js +35 -0
  38. package/dist/components/PagerDutyPage/MappingsTable/NameCell.esm.js.map +1 -0
  39. package/dist/components/PagerDutyPage/MappingsTable/TableSkeleton.esm.js +26 -29
  40. package/dist/components/PagerDutyPage/MappingsTable/TableSkeleton.esm.js.map +1 -1
  41. package/dist/components/PagerDutyPage/ServiceMappingPage.esm.js +22 -0
  42. package/dist/components/PagerDutyPage/ServiceMappingPage.esm.js.map +1 -0
  43. package/dist/components/PagerDutyPage/index.esm.js +12 -127
  44. package/dist/components/PagerDutyPage/index.esm.js.map +1 -1
  45. package/dist/index.d.ts +60 -8
  46. package/dist/package.json.esm.js +1 -1
  47. package/package.json +17 -17
  48. package/dist/alpha/nav-items.esm.js +0 -21
  49. package/dist/alpha/nav-items.esm.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @backstage/plugin-pagerduty
2
2
 
3
+ ## 0.21.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bee64f1: Release the service mappings feature
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [bee64f1]
12
+ - @pagerduty/backstage-plugin-common@0.5.0
13
+
14
+ ## 0.20.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 9941800: Refactor the service mappings screen and add an auto-matching functionality to mass map PagerDuty service to Backstage entities
19
+
20
+ ### Patch Changes
21
+
22
+ - ef0af04: Moved to a process/polling based loading of the automatic mapping matches
23
+ - Updated dependencies [9941800]
24
+ - Updated dependencies [ef0af04]
25
+ - @pagerduty/backstage-plugin-common@0.4.0
26
+
3
27
  ## 0.19.0
4
28
 
5
29
  ### Minor Changes
@@ -1,15 +1,52 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { convertLegacyRouteRef } from '@backstage/core-compat-api';
3
3
  import { rootRouteRef } from '../routes.esm.js';
4
- import { PageBlueprint } from '@backstage/frontend-plugin-api';
4
+ import { PageBlueprint, SubPageBlueprint } from '@backstage/frontend-plugin-api';
5
+ import '@backstage/plugin-catalog-react';
6
+ import '../components/PagerDutyCard/index.esm.js';
7
+ import '../components/PagerDutySmallCard/index.esm.js';
8
+ import { PagerDutyIcon } from '../components/Icons/index.esm.js';
9
+ import '../components/TriggerButton/index.esm.js';
5
10
 
6
11
  const pagerDutyPage = PageBlueprint.make({
7
12
  params: {
8
13
  path: "/pagerduty",
9
- routeRef: convertLegacyRouteRef(rootRouteRef),
10
- loader: () => import('../components/PagerDutyPage/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.PagerDutyPage, {}))
14
+ title: "PagerDuty",
15
+ icon: /* @__PURE__ */ jsx(PagerDutyIcon, {}),
16
+ routeRef: convertLegacyRouteRef(rootRouteRef)
17
+ // No `loader` here on purpose: when a page has a loader the frontend
18
+ // system renders only that content and ignores the `pages` input. Omitting
19
+ // it makes the attached SubPageBlueprint extensions render as tabs, with
20
+ // the index route redirecting to the first tab (Service Mapping).
21
+ }
22
+ });
23
+ const pagerDutyServiceMappingSubPage = SubPageBlueprint.make({
24
+ name: "service-mapping",
25
+ attachTo: { id: "page:pagerduty", input: "pages" },
26
+ params: {
27
+ path: "service-mapping",
28
+ title: "Service Mapping",
29
+ loader: () => import('../components/PagerDutyPage/ServiceMappingPage.esm.js').then((m) => /* @__PURE__ */ jsx(m.ServiceMappingPage, {}))
30
+ }
31
+ });
32
+ const pagerDutyCustomFieldsSubPage = SubPageBlueprint.make({
33
+ name: "custom-fields",
34
+ attachTo: { id: "page:pagerduty", input: "pages" },
35
+ params: {
36
+ path: "custom-fields",
37
+ title: "Custom Fields",
38
+ loader: () => import('../components/PagerDutyPage/CustomFields.esm.js').then((m) => /* @__PURE__ */ jsx(m.CustomFields, {}))
39
+ }
40
+ });
41
+ const pagerDutyConfigurationSubPage = SubPageBlueprint.make({
42
+ name: "configuration",
43
+ attachTo: { id: "page:pagerduty", input: "pages" },
44
+ params: {
45
+ path: "settings",
46
+ title: "Configuration",
47
+ loader: () => import('../components/PagerDutyPage/ConfigurationPage.esm.js').then((m) => /* @__PURE__ */ jsx(m.ConfigurationPage, {}))
11
48
  }
12
49
  });
13
50
 
14
- export { pagerDutyPage };
51
+ export { pagerDutyConfigurationSubPage, pagerDutyCustomFieldsSubPage, pagerDutyPage, pagerDutyServiceMappingSubPage };
15
52
  //# sourceMappingURL=pages.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pages.esm.js","sources":["../../src/alpha/pages.tsx"],"sourcesContent":["import { convertLegacyRouteRef } from '@backstage/core-compat-api';\nimport { rootRouteRef } from '../routes';\nimport { PageBlueprint } from '@backstage/frontend-plugin-api';\n\n/** @alpha */\nexport const pagerDutyPage = PageBlueprint.make({\n params: {\n path: '/pagerduty',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: () => \n import('../components/PagerDutyPage').then(m => <m.PagerDutyPage />),\n }\n});\n"],"names":[],"mappings":";;;;;AAKO,MAAM,aAAA,GAAgB,cAAc,IAAA,CAAK;AAAA,EAC9C,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,YAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,MAAA,EAAQ,MACN,OAAO,0CAA6B,CAAA,CAAE,IAAA,CAAK,CAAA,CAAA,qBAAK,GAAA,CAAC,CAAA,CAAE,aAAA,EAAF,EAAgB,CAAE;AAAA;AAEzE,CAAC;;;;"}
1
+ {"version":3,"file":"pages.esm.js","sources":["../../src/alpha/pages.tsx"],"sourcesContent":["import { convertLegacyRouteRef } from '@backstage/core-compat-api';\nimport { rootRouteRef } from '../routes';\nimport { PageBlueprint, SubPageBlueprint } from '@backstage/frontend-plugin-api';\nimport { PagerDutyIcon } from '../components';\n\n/** @alpha */\nexport const pagerDutyPage = PageBlueprint.make({\n params: {\n path: '/pagerduty',\n title: 'PagerDuty',\n icon: <PagerDutyIcon />,\n routeRef: convertLegacyRouteRef(rootRouteRef),\n // No `loader` here on purpose: when a page has a loader the frontend\n // system renders only that content and ignores the `pages` input. Omitting\n // it makes the attached SubPageBlueprint extensions render as tabs, with\n // the index route redirecting to the first tab (Service Mapping).\n },\n});\n\n/** @alpha */\nexport const pagerDutyServiceMappingSubPage = SubPageBlueprint.make({\n name: 'service-mapping',\n attachTo: { id: 'page:pagerduty', input: 'pages' },\n params: {\n path: 'service-mapping',\n title: 'Service Mapping',\n loader: () =>\n import('../components/PagerDutyPage/ServiceMappingPage').then(m => (\n <m.ServiceMappingPage />\n )),\n },\n});\n\n/** @alpha */\nexport const pagerDutyCustomFieldsSubPage = SubPageBlueprint.make({\n name: 'custom-fields',\n attachTo: { id: 'page:pagerduty', input: 'pages' },\n params: {\n path: 'custom-fields',\n title: 'Custom Fields',\n loader: () =>\n import('../components/PagerDutyPage/CustomFields').then(m => (\n <m.CustomFields />\n )),\n },\n});\n\n/** @alpha */\nexport const pagerDutyConfigurationSubPage = SubPageBlueprint.make({\n name: 'configuration',\n attachTo: { id: 'page:pagerduty', input: 'pages' },\n params: {\n path: 'settings',\n title: 'Configuration',\n loader: () =>\n import('../components/PagerDutyPage/ConfigurationPage').then(m => (\n <m.ConfigurationPage />\n )),\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAMO,MAAM,aAAA,GAAgB,cAAc,IAAA,CAAK;AAAA,EAC9C,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,YAAA;AAAA,IACN,KAAA,EAAO,WAAA;AAAA,IACP,IAAA,sBAAO,aAAA,EAAA,EAAc,CAAA;AAAA,IACrB,QAAA,EAAU,sBAAsB,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAMhD,CAAC;AAGM,MAAM,8BAAA,GAAiC,iBAAiB,IAAA,CAAK;AAAA,EAClE,IAAA,EAAM,iBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,gBAAA,EAAkB,OAAO,OAAA,EAAQ;AAAA,EACjD,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,iBAAA;AAAA,IACN,KAAA,EAAO,iBAAA;AAAA,IACP,MAAA,EAAQ,MACN,OAAO,uDAAgD,CAAA,CAAE,IAAA,CAAK,CAAA,CAAA,qBAC5D,GAAA,CAAC,CAAA,CAAE,kBAAA,EAAF,EAAqB,CACvB;AAAA;AAEP,CAAC;AAGM,MAAM,4BAAA,GAA+B,iBAAiB,IAAA,CAAK;AAAA,EAChE,IAAA,EAAM,eAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,gBAAA,EAAkB,OAAO,OAAA,EAAQ;AAAA,EACjD,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,eAAA;AAAA,IACN,KAAA,EAAO,eAAA;AAAA,IACP,MAAA,EAAQ,MACN,OAAO,iDAA0C,CAAA,CAAE,IAAA,CAAK,CAAA,CAAA,qBACtD,GAAA,CAAC,CAAA,CAAE,YAAA,EAAF,EAAe,CACjB;AAAA;AAEP,CAAC;AAGM,MAAM,6BAAA,GAAgC,iBAAiB,IAAA,CAAK;AAAA,EACjE,IAAA,EAAM,eAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,gBAAA,EAAkB,OAAO,OAAA,EAAQ;AAAA,EACjD,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,UAAA;AAAA,IACN,KAAA,EAAO,eAAA;AAAA,IACP,MAAA,EAAQ,MACN,OAAO,sDAA+C,CAAA,CAAE,IAAA,CAAK,CAAA,CAAA,qBAC3D,GAAA,CAAC,CAAA,CAAE,iBAAA,EAAF,EAAoB,CACtB;AAAA;AAEP,CAAC;;;;"}
@@ -1,8 +1,7 @@
1
1
  import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
2
2
  import { pagerDutyEntityCard, pagerDutyEntitySmallCard } from './entity-cards.esm.js';
3
3
  import { pagerDutyApi } from './api.esm.js';
4
- import { pagerDutyPage } from './pages.esm.js';
5
- import { pagerDutyNavBarItem } from './nav-items.esm.js';
4
+ import { pagerDutyPage, pagerDutyServiceMappingSubPage, pagerDutyCustomFieldsSubPage, pagerDutyConfigurationSubPage } from './pages.esm.js';
6
5
  import { convertLegacyRouteRefs } from '@backstage/core-compat-api';
7
6
  import { rootRouteRef } from '../routes.esm.js';
8
7
 
@@ -14,7 +13,9 @@ const pagerDutyPlugin = createFrontendPlugin({
14
13
  pagerDutyEntitySmallCard,
15
14
  pagerDutyApi,
16
15
  pagerDutyPage,
17
- pagerDutyNavBarItem
16
+ pagerDutyServiceMappingSubPage,
17
+ pagerDutyCustomFieldsSubPage,
18
+ pagerDutyConfigurationSubPage
18
19
  ],
19
20
  routes: convertLegacyRouteRefs({
20
21
  root: rootRouteRef
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFrontendPlugin } from \"@backstage/frontend-plugin-api\";\nimport { pagerDutyEntityCard, pagerDutyEntitySmallCard } from \"../alpha/entity-cards\";\nimport { pagerDutyApi } from \"../alpha/api\";\nimport { pagerDutyPage } from \"../alpha/pages\";\nimport { pagerDutyNavBarItem } from \"../alpha/nav-items\";\nimport { convertLegacyRouteRefs } from \"@backstage/core-compat-api\";\nimport { rootRouteRef } from \"../routes\";\n\n/** @alpha */\nexport const pagerDutyPlugin = createFrontendPlugin({\n pluginId: 'pagerduty',\n info: { packageJson: () => import('../../package.json')},\n extensions: [\n pagerDutyEntityCard,\n pagerDutyEntitySmallCard,\n pagerDutyApi,\n pagerDutyPage,\n pagerDutyNavBarItem\n ],\n routes: convertLegacyRouteRefs({\n root: rootRouteRef\n })\n});\n"],"names":[],"mappings":";;;;;;;;AAyBO,MAAM,kBAAkB,oBAAA,CAAqB;AAAA,EAClD,QAAA,EAAU,WAAA;AAAA,EACV,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,wBAAoB,CAAA,EAAC;AAAA,EACvD,UAAA,EAAY;AAAA,IACV,mBAAA;AAAA,IACA,wBAAA;AAAA,IACA,YAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,QAAQ,sBAAA,CAAuB;AAAA,IAC7B,IAAA,EAAM;AAAA,GACP;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFrontendPlugin } from \"@backstage/frontend-plugin-api\";\nimport { pagerDutyEntityCard, pagerDutyEntitySmallCard } from \"../alpha/entity-cards\";\nimport { pagerDutyApi } from \"../alpha/api\";\nimport {\n pagerDutyPage,\n pagerDutyServiceMappingSubPage,\n pagerDutyCustomFieldsSubPage,\n pagerDutyConfigurationSubPage,\n} from \"../alpha/pages\";\nimport { convertLegacyRouteRefs } from \"@backstage/core-compat-api\";\nimport { rootRouteRef } from \"../routes\";\n\n/** @alpha */\nexport const pagerDutyPlugin = createFrontendPlugin({\n pluginId: 'pagerduty',\n info: { packageJson: () => import('../../package.json')},\n extensions: [\n pagerDutyEntityCard,\n pagerDutyEntitySmallCard,\n pagerDutyApi,\n pagerDutyPage,\n pagerDutyServiceMappingSubPage,\n pagerDutyCustomFieldsSubPage,\n pagerDutyConfigurationSubPage,\n ],\n routes: convertLegacyRouteRefs({\n root: rootRouteRef\n })\n});\n"],"names":[],"mappings":";;;;;;;AA6BO,MAAM,kBAAkB,oBAAA,CAAqB;AAAA,EAClD,QAAA,EAAU,WAAA;AAAA,EACV,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,wBAAoB,CAAA,EAAC;AAAA,EACvD,UAAA,EAAY;AAAA,IACV,mBAAA;AAAA,IACA,wBAAA;AAAA,IACA,YAAA;AAAA,IACA,aAAA;AAAA,IACA,8BAAA;AAAA,IACA,4BAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,QAAQ,sBAAA,CAAuB;AAAA,IAC7B,IAAA,EAAM;AAAA,GACP;AACH,CAAC;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -1,6 +1,7 @@
1
+ import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
1
2
  import * as _backstage_catalog_model from '@backstage/catalog-model';
2
3
  import * as react from 'react';
3
- import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
4
+ import * as _backstage_filter_predicates from '@backstage/filter-predicates';
4
5
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
5
6
 
6
7
  /** @alpha */
@@ -21,15 +22,15 @@ declare const pagerDutyPlugin: _backstage_frontend_plugin_api.OverridableFronten
21
22
  readOnly: boolean | undefined;
22
23
  disableChangeEvents: boolean | undefined;
23
24
  disableOnCall: boolean | undefined;
24
- filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
25
- type: "content" | "summary" | "info" | undefined;
25
+ filter: _backstage_filter_predicates.FilterPredicate | undefined;
26
+ type: "content" | "info" | undefined;
26
27
  };
27
28
  configInput: {
28
29
  readOnly?: boolean | undefined;
29
30
  disableChangeEvents?: boolean | undefined;
30
31
  disableOnCall?: boolean | undefined;
31
- filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
32
- type?: "content" | "summary" | "info" | undefined | undefined;
32
+ filter?: _backstage_filter_predicates.FilterPredicate | undefined;
33
+ type?: "content" | "info" | undefined | undefined;
33
34
  };
34
35
  output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
35
36
  optional: true;
@@ -43,7 +44,7 @@ declare const pagerDutyPlugin: _backstage_frontend_plugin_api.OverridableFronten
43
44
  name: "EntityPagerDutyCard";
44
45
  params: {
45
46
  loader: () => Promise<JSX.Element>;
46
- filter?: string | _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean);
47
+ filter?: string | _backstage_filter_predicates.FilterPredicate | ((entity: _backstage_catalog_model.Entity) => boolean);
47
48
  type?: _backstage_plugin_catalog_react_alpha.EntityCardType;
48
49
  };
49
50
  }>;
@@ -52,15 +53,15 @@ declare const pagerDutyPlugin: _backstage_frontend_plugin_api.OverridableFronten
52
53
  readOnly: boolean | undefined;
53
54
  disableOnCall: boolean | undefined;
54
55
  disableInsights: boolean | undefined;
55
- filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
56
- type: "content" | "summary" | "info" | undefined;
56
+ filter: _backstage_filter_predicates.FilterPredicate | undefined;
57
+ type: "content" | "info" | undefined;
57
58
  };
58
59
  configInput: {
59
60
  readOnly?: boolean | undefined;
60
61
  disableOnCall?: boolean | undefined;
61
62
  disableInsights?: boolean | undefined;
62
- filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
63
- type?: "content" | "summary" | "info" | undefined | undefined;
63
+ filter?: _backstage_filter_predicates.FilterPredicate | undefined;
64
+ type?: "content" | "info" | undefined | undefined;
64
65
  };
65
66
  output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
66
67
  optional: true;
@@ -74,43 +75,121 @@ declare const pagerDutyPlugin: _backstage_frontend_plugin_api.OverridableFronten
74
75
  name: "EntityPagerDutySmallCard";
75
76
  params: {
76
77
  loader: () => Promise<JSX.Element>;
77
- filter?: string | _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean);
78
+ filter?: string | _backstage_filter_predicates.FilterPredicate | ((entity: _backstage_catalog_model.Entity) => boolean);
78
79
  type?: _backstage_plugin_catalog_react_alpha.EntityCardType;
79
80
  };
80
81
  }>;
81
- "nav-item:pagerduty/PagerDutyNavBarItem": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
82
- kind: "nav-item";
83
- name: "PagerDutyNavBarItem";
84
- config: {};
85
- configInput: {};
86
- output: _backstage_frontend_plugin_api.ExtensionDataRef<{
82
+ "page:pagerduty": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
83
+ kind: "page";
84
+ name: undefined;
85
+ config: {
86
+ path: string | undefined;
87
+ title: string | undefined;
88
+ };
89
+ configInput: {
90
+ path?: string | undefined;
91
+ title?: string | undefined;
92
+ };
93
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
94
+ optional: true;
95
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.title", {
96
+ optional: true;
97
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
98
+ optional: true;
99
+ }>;
100
+ inputs: {
101
+ pages: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
102
+ optional: true;
103
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.title", {
104
+ optional: true;
105
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
106
+ optional: true;
107
+ }>, {
108
+ singleton: false;
109
+ optional: false;
110
+ internal: false;
111
+ }>;
112
+ };
113
+ params: {
114
+ path: string;
115
+ title?: string;
116
+ icon?: _backstage_frontend_plugin_api.IconElement;
117
+ loader?: () => Promise<react.JSX.Element>;
118
+ routeRef?: _backstage_frontend_plugin_api.RouteRef;
119
+ noHeader?: boolean;
120
+ };
121
+ }>;
122
+ "sub-page:pagerduty/configuration": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
123
+ kind: "sub-page";
124
+ name: "configuration";
125
+ config: {
126
+ path: string | undefined;
127
+ title: string | undefined;
128
+ };
129
+ configInput: {
130
+ path?: string | undefined;
131
+ title?: string | undefined;
132
+ };
133
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
134
+ optional: true;
135
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.title", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
136
+ optional: true;
137
+ }>;
138
+ inputs: {};
139
+ params: {
140
+ path: string;
87
141
  title: string;
88
- icon: _backstage_frontend_plugin_api.IconComponent;
89
- routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
90
- }, "core.nav-item.target", {}>;
142
+ icon?: _backstage_frontend_plugin_api.IconElement;
143
+ loader: () => Promise<JSX.Element>;
144
+ routeRef?: _backstage_frontend_plugin_api.RouteRef;
145
+ };
146
+ }>;
147
+ "sub-page:pagerduty/custom-fields": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
148
+ kind: "sub-page";
149
+ name: "custom-fields";
150
+ config: {
151
+ path: string | undefined;
152
+ title: string | undefined;
153
+ };
154
+ configInput: {
155
+ path?: string | undefined;
156
+ title?: string | undefined;
157
+ };
158
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
159
+ optional: true;
160
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.title", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
161
+ optional: true;
162
+ }>;
91
163
  inputs: {};
92
164
  params: {
165
+ path: string;
93
166
  title: string;
94
- icon: _backstage_frontend_plugin_api.IconComponent;
95
- routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
167
+ icon?: _backstage_frontend_plugin_api.IconElement;
168
+ loader: () => Promise<JSX.Element>;
169
+ routeRef?: _backstage_frontend_plugin_api.RouteRef;
96
170
  };
97
171
  }>;
98
- "page:pagerduty": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
99
- kind: "page";
100
- name: undefined;
172
+ "sub-page:pagerduty/service-mapping": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
173
+ kind: "sub-page";
174
+ name: "service-mapping";
101
175
  config: {
102
176
  path: string | undefined;
177
+ title: string | undefined;
103
178
  };
104
179
  configInput: {
105
180
  path?: string | undefined;
181
+ title?: string | undefined;
106
182
  };
107
183
  output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
108
184
  optional: true;
185
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.title", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
186
+ optional: true;
109
187
  }>;
110
188
  inputs: {};
111
189
  params: {
112
- defaultPath?: [Error: `Use the 'path' param instead`];
113
190
  path: string;
191
+ title: string;
192
+ icon?: _backstage_frontend_plugin_api.IconElement;
114
193
  loader: () => Promise<JSX.Element>;
115
194
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
116
195
  };
@@ -9,6 +9,22 @@ class ForbiddenError extends Error {
9
9
  const pagerDutyApiRef = createApiRef({
10
10
  id: "plugin.pagerduty.api"
11
11
  });
12
+ function parseCustomFieldError(error, fallbackMessage) {
13
+ if (error instanceof Error) {
14
+ const msg = error.message;
15
+ if (msg.includes("already been taken")) {
16
+ return { status: "error", data: null, error: "A custom field with this name already exists" };
17
+ }
18
+ if (msg.toLowerCase().includes("entity path already exists")) {
19
+ return { status: "error", data: null, error: "A custom field with this entity path already exists" };
20
+ }
21
+ if (msg.toLowerCase().includes("limit reached")) {
22
+ return { status: "error", data: null, error: "Custom field limit reached. Maximum number of custom fields has been exceeded." };
23
+ }
24
+ return { status: "error", data: null, error: msg };
25
+ }
26
+ return { status: "error", data: null, error: fallbackMessage };
27
+ }
12
28
  class PagerDutyClient {
13
29
  constructor(config) {
14
30
  this.config = config;
@@ -268,12 +284,12 @@ class PagerDutyClient {
268
284
  const url = this.config.eventsBaseUrl ?? "https://events.pagerduty.com/v2";
269
285
  return this.request(`${url}/enqueue`, options);
270
286
  }
271
- async autoMatchEntityMappings(options) {
287
+ async startAutoMatchEntityMappings(options) {
272
288
  const url = `${await this.config.discoveryApi.getBaseUrl(
273
289
  "pagerduty"
274
- )}/mapping/entity/auto-match`;
290
+ )}/mapping/entity/auto-match/start`;
275
291
  const body = JSON.stringify({
276
- team: options.team === "all" ? void 0 : options.team,
292
+ team: options.team,
277
293
  threshold: options.threshold,
278
294
  bestOnly: true,
279
295
  account: options.account
@@ -289,6 +305,12 @@ class PagerDutyClient {
289
305
  const response = await this.request(url, requestOptions);
290
306
  return response.json();
291
307
  }
308
+ async getAutoMatchStatus(jobId) {
309
+ const url = `${await this.config.discoveryApi.getBaseUrl(
310
+ "pagerduty"
311
+ )}/mapping/entity/auto-match/${encodeURIComponent(jobId)}`;
312
+ return await this.findByUrl(url);
313
+ }
292
314
  async getAccounts() {
293
315
  const url = `${await this.config.discoveryApi.getBaseUrl(
294
316
  "pagerduty"
@@ -296,6 +318,126 @@ class PagerDutyClient {
296
318
  const response = await this.findByUrl(url);
297
319
  return response.accounts;
298
320
  }
321
+ async createCustomField(request, account) {
322
+ const body = JSON.stringify(request);
323
+ const options = {
324
+ method: "POST",
325
+ headers: {
326
+ "Content-Type": "application/json; charset=UTF-8",
327
+ Accept: "application/json, text/plain, */*"
328
+ },
329
+ body
330
+ };
331
+ let url = `${await this.config.discoveryApi.getBaseUrl(
332
+ "pagerduty"
333
+ )}/custom-fields`;
334
+ if (account) {
335
+ url = url.concat(`?account=${account}`);
336
+ }
337
+ try {
338
+ const response = await this.request(url, options);
339
+ const result = await response.json();
340
+ return { status: "ok", data: result.customField, error: null };
341
+ } catch (error) {
342
+ return parseCustomFieldError(error, "Failed to create custom field");
343
+ }
344
+ }
345
+ async getCustomFields(account) {
346
+ let url = `${await this.config.discoveryApi.getBaseUrl(
347
+ "pagerduty"
348
+ )}/custom-fields`;
349
+ if (account) {
350
+ url = url.concat(`?account=${account}`);
351
+ }
352
+ return await this.findByUrl(url);
353
+ }
354
+ async getSyncLogs(account, options) {
355
+ const params = new URLSearchParams();
356
+ if (account) params.set("account", account);
357
+ if (options?.limit) params.set("limit", String(options.limit));
358
+ if (options?.offset !== void 0) params.set("offset", String(options.offset));
359
+ if (options?.search) params.set("search", options.search);
360
+ if (options?.severity) params.set("severity", options.severity);
361
+ if (options?.customFieldName) params.set("customFieldName", options.customFieldName);
362
+ if (options?.entityPath) params.set("entityPath", options.entityPath);
363
+ if (options?.serviceName) params.set("serviceName", options.serviceName);
364
+ const query = params.toString() ? `?${params.toString()}` : "";
365
+ const url = `${await this.config.discoveryApi.getBaseUrl(
366
+ "pagerduty"
367
+ )}/custom-fields/sync-logs${query}`;
368
+ return await this.findByUrl(url);
369
+ }
370
+ async updateCustomField(id, request, account) {
371
+ const body = JSON.stringify(request);
372
+ const options = {
373
+ method: "PUT",
374
+ headers: {
375
+ "Content-Type": "application/json; charset=UTF-8",
376
+ Accept: "application/json, text/plain, */*"
377
+ },
378
+ body
379
+ };
380
+ let url = `${await this.config.discoveryApi.getBaseUrl(
381
+ "pagerduty"
382
+ )}/custom-fields/${id}`;
383
+ if (account) {
384
+ url = url.concat(`?account=${account}`);
385
+ }
386
+ try {
387
+ const response = await this.request(url, options);
388
+ const result = await response.json();
389
+ return { status: "ok", data: result.customField, error: null };
390
+ } catch (error) {
391
+ return parseCustomFieldError(error, "Failed to update custom field");
392
+ }
393
+ }
394
+ async setCustomFieldEnabled(id, enabled, account) {
395
+ const options = {
396
+ method: "PATCH",
397
+ headers: {
398
+ "Content-Type": "application/json; charset=UTF-8",
399
+ Accept: "application/json, text/plain, */*"
400
+ },
401
+ body: JSON.stringify({ enabled })
402
+ };
403
+ let url = `${await this.config.discoveryApi.getBaseUrl(
404
+ "pagerduty"
405
+ )}/custom-fields/${id}/enabled`;
406
+ if (account) {
407
+ url = url.concat(`?account=${account}`);
408
+ }
409
+ try {
410
+ const response = await this.request(url, options);
411
+ const result = await response.json();
412
+ return { status: "ok", data: result.customField, error: null };
413
+ } catch (error) {
414
+ return parseCustomFieldError(
415
+ error,
416
+ `Failed to ${enabled ? "enable" : "disable"} custom field`
417
+ );
418
+ }
419
+ }
420
+ async deleteCustomField(id, account) {
421
+ const options = {
422
+ method: "DELETE",
423
+ headers: {
424
+ Accept: "application/json, text/plain, */*"
425
+ }
426
+ };
427
+ let url = `${await this.config.discoveryApi.getBaseUrl(
428
+ "pagerduty"
429
+ )}/custom-fields/${id}`;
430
+ if (account) {
431
+ url = url.concat(`?account=${account}`);
432
+ }
433
+ try {
434
+ await this.request(url, options);
435
+ return { status: "ok", data: void 0, error: null };
436
+ } catch (error) {
437
+ const result = parseCustomFieldError(error, "Failed to delete custom field");
438
+ return { status: "error", data: null, error: result.error };
439
+ }
440
+ }
299
441
  async findByUrl(url) {
300
442
  const options = {
301
443
  method: "GET",