@pagerduty/backstage-plugin 0.14.0 → 0.14.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.
|
@@ -21,18 +21,19 @@ const ServiceMappingComponent = () => {
|
|
|
21
21
|
}).then((result) => {
|
|
22
22
|
const entities = [];
|
|
23
23
|
result.items.forEach((entity) => {
|
|
24
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
25
|
-
const annotations =
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
25
|
+
const annotations = {
|
|
26
|
+
"pagerduty.com/integration-key": (_c = (_b = (_a = entity.metadata) == null ? void 0 : _a.annotations) == null ? void 0 : _b["pagerduty.com/integration-key"]) != null ? _c : "",
|
|
27
|
+
"pagerduty.com/service-id": (_f = (_e = (_d = entity.metadata) == null ? void 0 : _d.annotations) == null ? void 0 : _e["pagerduty.com/service-id"]) != null ? _f : ""
|
|
28
|
+
};
|
|
28
29
|
entities.push({
|
|
29
|
-
name: (
|
|
30
|
-
id: (
|
|
31
|
-
namespace: (
|
|
32
|
-
type: (
|
|
33
|
-
system: JSON.stringify((
|
|
34
|
-
owner: JSON.stringify((
|
|
35
|
-
lifecycle: JSON.stringify((
|
|
30
|
+
name: (_g = entity.metadata) == null ? void 0 : _g.name,
|
|
31
|
+
id: (_i = (_h = entity.metadata) == null ? void 0 : _h.uid) != null ? _i : "",
|
|
32
|
+
namespace: (_k = (_j = entity.metadata) == null ? void 0 : _j.namespace) != null ? _k : "",
|
|
33
|
+
type: (_l = entity.kind) != null ? _l : "",
|
|
34
|
+
system: ((_m = entity.spec) == null ? void 0 : _m.system) ? JSON.stringify((_n = entity.spec) == null ? void 0 : _n.system) : "",
|
|
35
|
+
owner: ((_o = entity.spec) == null ? void 0 : _o.owner) ? JSON.stringify((_p = entity.spec) == null ? void 0 : _p.owner) : "",
|
|
36
|
+
lifecycle: ((_q = entity.spec) == null ? void 0 : _q.lifecycle) ? JSON.stringify((_r = entity.spec) == null ? void 0 : _r.lifecycle) : "",
|
|
36
37
|
annotations
|
|
37
38
|
});
|
|
38
39
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceMappingComponent.esm.js","sources":["../../../src/components/PagerDutyPage/ServiceMappingComponent.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { PagerDutyEntityMapping } from \"@pagerduty/backstage-plugin-common\";\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { pagerDutyApiRef } from \"../../api\";\nimport { catalogApiRef } from \"@backstage/plugin-catalog-react\";\nimport { MappingTable } from \"./MappingTable\";\nimport { BackstageEntity, Annotations } from \"../types\";\n\nexport const ServiceMappingComponent = () => {\n const [entityMappings, setEntityMappings] = useState<\n PagerDutyEntityMapping[]\n >([]);\n const [catalogEntities, setCatalogEntities] = useState<BackstageEntity[]>([]);\n\n const pagerDutyApi = useApi(pagerDutyApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n // call fetchMappings() and fetchCatalogEntities() on useEffect hook\n useEffect(() => {\n function fetchMappings() {\n pagerDutyApi.getEntityMappings().then((result) => {\n setEntityMappings(result.mappings);\n });\n }\n\n function fetchCatalogEntities() {\n catalogApi\n .getEntities({\n filter: { kind: \"Component\" },\n })\n .then((result) => {\n const entities: BackstageEntity[] = [];\n result.items.forEach((entity
|
|
1
|
+
{"version":3,"file":"ServiceMappingComponent.esm.js","sources":["../../../src/components/PagerDutyPage/ServiceMappingComponent.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { PagerDutyEntityMapping } from \"@pagerduty/backstage-plugin-common\";\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { pagerDutyApiRef } from \"../../api\";\nimport { catalogApiRef } from \"@backstage/plugin-catalog-react\";\nimport { MappingTable } from \"./MappingTable\";\nimport { BackstageEntity, Annotations } from \"../types\";\n\nexport const ServiceMappingComponent = () => {\n const [entityMappings, setEntityMappings] = useState<\n PagerDutyEntityMapping[]\n >([]);\n const [catalogEntities, setCatalogEntities] = useState<BackstageEntity[]>([]);\n\n const pagerDutyApi = useApi(pagerDutyApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n // call fetchMappings() and fetchCatalogEntities() on useEffect hook\n useEffect(() => {\n function fetchMappings() {\n pagerDutyApi.getEntityMappings().then((result) => {\n setEntityMappings(result.mappings);\n });\n }\n\n function fetchCatalogEntities() {\n catalogApi\n .getEntities({\n filter: { kind: \"Component\" },\n })\n .then((result) => {\n const entities: BackstageEntity[] = [];\n result.items.forEach((entity) => {\n const annotations: Annotations = {\n \"pagerduty.com/integration-key\": entity.metadata?.annotations?.[\"pagerduty.com/integration-key\"] ?? \"\",\n \"pagerduty.com/service-id\": entity.metadata?.annotations?.[\"pagerduty.com/service-id\"] ?? \"\",\n };\n\n entities.push({\n name: entity.metadata?.name,\n id: entity.metadata?.uid ?? \"\",\n namespace: entity.metadata?.namespace ?? \"\",\n type: entity.kind ?? \"\",\n system: entity.spec?.system\n ? JSON.stringify(entity.spec?.system)\n : \"\",\n owner:\n entity.spec?.owner ? JSON.stringify(entity.spec?.owner) : \"\",\n lifecycle: entity.spec?.lifecycle ? JSON.stringify(entity.spec?.lifecycle) : \"\",\n annotations: annotations,\n });\n });\n\n setCatalogEntities(entities);\n });\n }\n\n fetchMappings();\n fetchCatalogEntities();\n }, [catalogApi, pagerDutyApi]);\n\n \n return (\n <MappingTable mappings={entityMappings} catalogEntities={catalogEntities} />\n );\n};\n"],"names":[],"mappings":";;;;;;AAQO,MAAM,0BAA0B,MAAM;AAC3C,EAAA,MAAM,CAAC,cAAgB,EAAA,iBAAiB,CAAI,GAAA,QAAA,CAE1C,EAAE,CAAA,CAAA;AACJ,EAAA,MAAM,CAAC,eAAiB,EAAA,kBAAkB,CAAI,GAAA,QAAA,CAA4B,EAAE,CAAA,CAAA;AAE5E,EAAM,MAAA,YAAA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