@backstage-community/plugin-dynatrace 10.0.7 → 10.1.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/CHANGELOG.md +12 -0
- package/dist/api/DynatraceApi.esm.js.map +1 -1
- package/dist/api/DynatraceClient.esm.js.map +1 -1
- package/dist/components/DynatraceTab/DynatraceTab.esm.js.map +1 -1
- package/dist/components/Problems/ProblemStatus/ProblemStatus.esm.js.map +1 -1
- package/dist/components/Problems/ProblemsList/ProblemsList.esm.js.map +1 -1
- package/dist/components/Problems/ProblemsTable/ProblemsTable.esm.js.map +1 -1
- package/dist/components/Synthetics/SyntheticsCard/SyntheticsCard.esm.js.map +1 -1
- package/dist/components/Synthetics/SyntheticsLocation/SyntheticsLocation.esm.js.map +1 -1
- package/dist/constants.esm.js.map +1 -1
- package/dist/plugin.esm.js.map +1 -1
- package/dist/routes.esm.js.map +1 -1
- package/package.json +17 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @backstage-community/plugin-dynatrace
|
|
2
2
|
|
|
3
|
+
## 10.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 667ee65: Backstage version bump to v1.34.1
|
|
8
|
+
|
|
9
|
+
## 10.0.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 18c224d: Backstage version bump to v1.32.2
|
|
14
|
+
|
|
3
15
|
## 10.0.7
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynatraceApi.esm.js","sources":["../../src/api/DynatraceApi.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { createApiRef } from '@backstage/core-plugin-api';\n\nexport type DynatraceEntity = {\n entityId: {\n id: string;\n type: string;\n };\n name: string;\n};\n\nexport type DynatraceProblem = {\n problemId: string;\n impactLevel: string;\n status: string;\n startTime: number;\n endTime: number;\n title: string;\n severityLevel: string;\n rootCauseEntity: DynatraceEntity;\n affectedEntities: Array<DynatraceEntity>;\n};\n\ntype SyntheticRequestResults = {\n startTimestamp: number;\n};\n\nexport interface DynatraceSyntheticResults {\n monitorId: string;\n locationsExecutionResults: [\n {\n locationId: number;\n executionId: string;\n requestResults: Array<SyntheticRequestResults>;\n },\n ];\n}\n\nexport interface DynatraceSyntheticLocationInfo {\n entityId: string;\n name: string;\n city: string;\n browserType: string;\n}\n\nexport interface DynatraceProblems {\n problems: Array<DynatraceProblem>;\n totalCount: number;\n pageSize: number;\n}\n\nexport const dynatraceApiRef = createApiRef<DynatraceApi>({\n id: 'plugin.dynatrace.service',\n});\n\nexport type DynatraceApi = {\n getDynatraceProblems(\n dynatraceEntityId: string,\n ): Promise<DynatraceProblems | undefined>;\n getDynatraceSyntheticFailures(\n syntheticsId: string,\n ): Promise<DynatraceSyntheticResults | undefined>;\n getDynatraceSyntheticLocationInfo(\n syntheticLocationId: string,\n ): Promise<DynatraceSyntheticLocationInfo | undefined>;\n};\n"],"names":[],"mappings":";;AAiEO,MAAM,kBAAkB,YAA2B,CAAA;AAAA,EACxD,EAAI,EAAA
|
|
1
|
+
{"version":3,"file":"DynatraceApi.esm.js","sources":["../../src/api/DynatraceApi.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { createApiRef } from '@backstage/core-plugin-api';\n\nexport type DynatraceEntity = {\n entityId: {\n id: string;\n type: string;\n };\n name: string;\n};\n\nexport type DynatraceProblem = {\n problemId: string;\n impactLevel: string;\n status: string;\n startTime: number;\n endTime: number;\n title: string;\n severityLevel: string;\n rootCauseEntity: DynatraceEntity;\n affectedEntities: Array<DynatraceEntity>;\n};\n\ntype SyntheticRequestResults = {\n startTimestamp: number;\n};\n\nexport interface DynatraceSyntheticResults {\n monitorId: string;\n locationsExecutionResults: [\n {\n locationId: number;\n executionId: string;\n requestResults: Array<SyntheticRequestResults>;\n },\n ];\n}\n\nexport interface DynatraceSyntheticLocationInfo {\n entityId: string;\n name: string;\n city: string;\n browserType: string;\n}\n\nexport interface DynatraceProblems {\n problems: Array<DynatraceProblem>;\n totalCount: number;\n pageSize: number;\n}\n\nexport const dynatraceApiRef = createApiRef<DynatraceApi>({\n id: 'plugin.dynatrace.service',\n});\n\nexport type DynatraceApi = {\n getDynatraceProblems(\n dynatraceEntityId: string,\n ): Promise<DynatraceProblems | undefined>;\n getDynatraceSyntheticFailures(\n syntheticsId: string,\n ): Promise<DynatraceSyntheticResults | undefined>;\n getDynatraceSyntheticLocationInfo(\n syntheticLocationId: string,\n ): Promise<DynatraceSyntheticLocationInfo | undefined>;\n};\n"],"names":[],"mappings":";;AAiEO,MAAM,kBAAkB,YAA2B,CAAA;AAAA,EACxD,EAAI,EAAA;AACN,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynatraceClient.esm.js","sources":["../../src/api/DynatraceClient.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {\n DynatraceProblems,\n DynatraceApi,\n DynatraceSyntheticResults,\n DynatraceSyntheticLocationInfo,\n} from './DynatraceApi';\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\n\nexport class DynatraceClient implements DynatraceApi {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n\n constructor({\n discoveryApi,\n fetchApi,\n }: {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n }) {\n this.discoveryApi = discoveryApi;\n this.fetchApi = fetchApi;\n }\n\n private async callApi<T>(\n path: string,\n query: { [key in string]: any },\n ): Promise<T | undefined> {\n const apiUrl = `${await this.discoveryApi.getBaseUrl('proxy')}/dynatrace`;\n const response = await this.fetchApi.fetch(\n `${apiUrl}/${path}?${new URLSearchParams(query).toString()}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n },\n },\n );\n if (response.status === 200) {\n return (await response.json()) as T;\n }\n throw new Error(\n `Dynatrace API call failed: ${response.status}:${response.statusText}`,\n );\n }\n\n async getDynatraceSyntheticFailures(\n syntheticsId: string,\n ): Promise<DynatraceSyntheticResults | undefined> {\n if (!syntheticsId) {\n throw new Error('Dynatrace syntheticId is required');\n }\n\n return this.callApi(\n `synthetic/execution/${encodeURIComponent(syntheticsId)}/FAILED`,\n {},\n );\n }\n\n async getDynatraceSyntheticLocationInfo(\n syntheticLocationId: string,\n ): Promise<DynatraceSyntheticLocationInfo | undefined> {\n if (!syntheticLocationId) {\n throw new Error('Dynatrace syntheticLocationId is required');\n }\n\n return this.callApi(\n `synthetic/locations/${encodeURIComponent(syntheticLocationId)}`,\n {},\n );\n }\n\n async getDynatraceProblems(\n dynatraceEntityId: string,\n ): Promise<DynatraceProblems | undefined> {\n if (!dynatraceEntityId) {\n throw new Error('Dynatrace entity id is required');\n }\n\n return this.callApi('problems', {\n entitySelector: `entityId(${dynatraceEntityId})`,\n });\n }\n}\n"],"names":[],"mappings":"AAuBO,MAAM,eAAwC,CAAA;AAAA,EACnD,YAAA
|
|
1
|
+
{"version":3,"file":"DynatraceClient.esm.js","sources":["../../src/api/DynatraceClient.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {\n DynatraceProblems,\n DynatraceApi,\n DynatraceSyntheticResults,\n DynatraceSyntheticLocationInfo,\n} from './DynatraceApi';\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\n\nexport class DynatraceClient implements DynatraceApi {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n\n constructor({\n discoveryApi,\n fetchApi,\n }: {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n }) {\n this.discoveryApi = discoveryApi;\n this.fetchApi = fetchApi;\n }\n\n private async callApi<T>(\n path: string,\n query: { [key in string]: any },\n ): Promise<T | undefined> {\n const apiUrl = `${await this.discoveryApi.getBaseUrl('proxy')}/dynatrace`;\n const response = await this.fetchApi.fetch(\n `${apiUrl}/${path}?${new URLSearchParams(query).toString()}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n },\n },\n );\n if (response.status === 200) {\n return (await response.json()) as T;\n }\n throw new Error(\n `Dynatrace API call failed: ${response.status}:${response.statusText}`,\n );\n }\n\n async getDynatraceSyntheticFailures(\n syntheticsId: string,\n ): Promise<DynatraceSyntheticResults | undefined> {\n if (!syntheticsId) {\n throw new Error('Dynatrace syntheticId is required');\n }\n\n return this.callApi(\n `synthetic/execution/${encodeURIComponent(syntheticsId)}/FAILED`,\n {},\n );\n }\n\n async getDynatraceSyntheticLocationInfo(\n syntheticLocationId: string,\n ): Promise<DynatraceSyntheticLocationInfo | undefined> {\n if (!syntheticLocationId) {\n throw new Error('Dynatrace syntheticLocationId is required');\n }\n\n return this.callApi(\n `synthetic/locations/${encodeURIComponent(syntheticLocationId)}`,\n {},\n );\n }\n\n async getDynatraceProblems(\n dynatraceEntityId: string,\n ): Promise<DynatraceProblems | undefined> {\n if (!dynatraceEntityId) {\n throw new Error('Dynatrace entity id is required');\n }\n\n return this.callApi('problems', {\n entitySelector: `entityId(${dynatraceEntityId})`,\n });\n }\n}\n"],"names":[],"mappings":"AAuBO,MAAM,eAAwC,CAAA;AAAA,EACnD,YAAA;AAAA,EACA,QAAA;AAAA,EAEA,WAAY,CAAA;AAAA,IACV,YAAA;AAAA,IACA;AAAA,GAIC,EAAA;AACD,IAAA,IAAA,CAAK,YAAe,GAAA,YAAA;AACpB,IAAA,IAAA,CAAK,QAAW,GAAA,QAAA;AAAA;AAClB,EAEA,MAAc,OACZ,CAAA,IAAA,EACA,KACwB,EAAA;AACxB,IAAA,MAAM,SAAS,CAAG,EAAA,MAAM,KAAK,YAAa,CAAA,UAAA,CAAW,OAAO,CAAC,CAAA,UAAA,CAAA;AAC7D,IAAM,MAAA,QAAA,GAAW,MAAM,IAAA,CAAK,QAAS,CAAA,KAAA;AAAA,MACnC,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,EAAI,IAAI,eAAgB,CAAA,KAAK,CAAE,CAAA,QAAA,EAAU,CAAA,CAAA;AAAA,MAC1D;AAAA,QACE,OAAS,EAAA;AAAA,UACP,cAAgB,EAAA;AAAA;AAClB;AACF,KACF;AACA,IAAI,IAAA,QAAA,CAAS,WAAW,GAAK,EAAA;AAC3B,MAAQ,OAAA,MAAM,SAAS,IAAK,EAAA;AAAA;AAE9B,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAA8B,2BAAA,EAAA,QAAA,CAAS,MAAM,CAAA,CAAA,EAAI,SAAS,UAAU,CAAA;AAAA,KACtE;AAAA;AACF,EAEA,MAAM,8BACJ,YACgD,EAAA;AAChD,IAAA,IAAI,CAAC,YAAc,EAAA;AACjB,MAAM,MAAA,IAAI,MAAM,mCAAmC,CAAA;AAAA;AAGrD,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA,MACV,CAAA,oBAAA,EAAuB,kBAAmB,CAAA,YAAY,CAAC,CAAA,OAAA,CAAA;AAAA,MACvD;AAAC,KACH;AAAA;AACF,EAEA,MAAM,kCACJ,mBACqD,EAAA;AACrD,IAAA,IAAI,CAAC,mBAAqB,EAAA;AACxB,MAAM,MAAA,IAAI,MAAM,2CAA2C,CAAA;AAAA;AAG7D,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA,MACV,CAAA,oBAAA,EAAuB,kBAAmB,CAAA,mBAAmB,CAAC,CAAA,CAAA;AAAA,MAC9D;AAAC,KACH;AAAA;AACF,EAEA,MAAM,qBACJ,iBACwC,EAAA;AACxC,IAAA,IAAI,CAAC,iBAAmB,EAAA;AACtB,MAAM,MAAA,IAAI,MAAM,iCAAiC,CAAA;AAAA;AAGnD,IAAO,OAAA,IAAA,CAAK,QAAQ,UAAY,EAAA;AAAA,MAC9B,cAAA,EAAgB,YAAY,iBAAiB,CAAA,CAAA;AAAA,KAC9C,CAAA;AAAA;AAEL;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynatraceTab.esm.js","sources":["../../../src/components/DynatraceTab/DynatraceTab.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport { Page, Content } from '@backstage/core-components';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport { ProblemsList } from '../Problems/ProblemsList';\nimport { SyntheticsCard } from '../Synthetics/SyntheticsCard';\nimport { isDynatraceAvailable } from '../../plugin';\nimport {\n DYNATRACE_ID_ANNOTATION,\n DYNATRACE_SYNTHETICS_ANNOTATION,\n} from '../../constants';\n\nexport const DynatraceTab = () => {\n const { entity } = useEntity();\n\n if (!isDynatraceAvailable(entity)) {\n return <MissingAnnotationEmptyState annotation={DYNATRACE_ID_ANNOTATION} />;\n }\n\n const dynatraceEntityId: string =\n entity?.metadata.annotations?.[DYNATRACE_ID_ANNOTATION]!;\n\n const syntheticsIds: string =\n entity?.metadata.annotations?.[DYNATRACE_SYNTHETICS_ANNOTATION]!;\n\n return (\n <Page themeId=\"tool\">\n <Content>\n <Grid container spacing={2}>\n {dynatraceEntityId ? (\n <Grid item xs={12} lg={12}>\n <ProblemsList dynatraceEntityId={dynatraceEntityId} />\n </Grid>\n ) : (\n ''\n )}\n {syntheticsIds\n ?.split(/[ ,]/)\n .filter(Boolean)\n .map(id => {\n return (\n <Grid item xs={12} lg={12}>\n <SyntheticsCard syntheticsId={id} />\n </Grid>\n );\n })}\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,eAAe,MAAM;AAChC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA
|
|
1
|
+
{"version":3,"file":"DynatraceTab.esm.js","sources":["../../../src/components/DynatraceTab/DynatraceTab.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport { Page, Content } from '@backstage/core-components';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport { ProblemsList } from '../Problems/ProblemsList';\nimport { SyntheticsCard } from '../Synthetics/SyntheticsCard';\nimport { isDynatraceAvailable } from '../../plugin';\nimport {\n DYNATRACE_ID_ANNOTATION,\n DYNATRACE_SYNTHETICS_ANNOTATION,\n} from '../../constants';\n\nexport const DynatraceTab = () => {\n const { entity } = useEntity();\n\n if (!isDynatraceAvailable(entity)) {\n return <MissingAnnotationEmptyState annotation={DYNATRACE_ID_ANNOTATION} />;\n }\n\n const dynatraceEntityId: string =\n entity?.metadata.annotations?.[DYNATRACE_ID_ANNOTATION]!;\n\n const syntheticsIds: string =\n entity?.metadata.annotations?.[DYNATRACE_SYNTHETICS_ANNOTATION]!;\n\n return (\n <Page themeId=\"tool\">\n <Content>\n <Grid container spacing={2}>\n {dynatraceEntityId ? (\n <Grid item xs={12} lg={12}>\n <ProblemsList dynatraceEntityId={dynatraceEntityId} />\n </Grid>\n ) : (\n ''\n )}\n {syntheticsIds\n ?.split(/[ ,]/)\n .filter(Boolean)\n .map(id => {\n return (\n <Grid item xs={12} lg={12}>\n <SyntheticsCard syntheticsId={id} />\n </Grid>\n );\n })}\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,eAAe,MAAM;AAChC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAE7B,EAAI,IAAA,CAAC,oBAAqB,CAAA,MAAM,CAAG,EAAA;AACjC,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,2BAA4B,EAAA,EAAA,UAAA,EAAY,uBAAyB,EAAA,CAAA;AAAA;AAG3E,EAAA,MAAM,iBACJ,GAAA,MAAA,EAAQ,QAAS,CAAA,WAAA,GAAc,uBAAuB,CAAA;AAExD,EAAA,MAAM,aACJ,GAAA,MAAA,EAAQ,QAAS,CAAA,WAAA,GAAc,+BAA+B,CAAA;AAEhE,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,OAAQ,EAAA,MAAA,EAAA,sCACX,OACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,MAAC,OAAS,EAAA,CAAA,EAAA,EACtB,iBACC,mBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAI,IAAI,EACrB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,YAAa,EAAA,EAAA,iBAAA,EAAsC,CACtD,CAEA,GAAA,EAAA,EAED,aACG,EAAA,KAAA,CAAM,MAAM,CACb,CAAA,MAAA,CAAO,OAAO,CAAA,CACd,IAAI,CAAM,EAAA,KAAA;AACT,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAI,EAAI,EAAA,EAAA,EAAA,kBACpB,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,EAAe,YAAc,EAAA,EAAA,EAAI,CACpC,CAAA;AAAA,GAEH,CACL,CACF,CACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProblemStatus.esm.js","sources":["../../../../src/components/Problems/ProblemStatus/ProblemStatus.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport { DynatraceProblem } from '../../../api/DynatraceApi';\nimport { StatusError, StatusOK } from '@backstage/core-components';\n\nexport const ProblemStatus = ({ status }: Partial<DynatraceProblem>) => {\n switch (status?.toLocaleLowerCase()) {\n case 'open':\n return (\n <>\n <StatusError />\n Open\n </>\n );\n case 'closed':\n return (\n <>\n <StatusOK />\n Closed\n </>\n );\n default:\n return <></>;\n }\n};\n"],"names":[],"mappings":";;;AAmBO,MAAM,aAAgB,GAAA,CAAC,EAAE,MAAA,EAAwC,KAAA;AACtE,EAAQ,QAAA,MAAA,EAAQ,mBAAqB;AAAA,IACnC,KAAK,MAAA;AACH,MAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAY,EAAA,IAAA,CAAA,EAAE,MAEjB,CAAA
|
|
1
|
+
{"version":3,"file":"ProblemStatus.esm.js","sources":["../../../../src/components/Problems/ProblemStatus/ProblemStatus.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport { DynatraceProblem } from '../../../api/DynatraceApi';\nimport { StatusError, StatusOK } from '@backstage/core-components';\n\nexport const ProblemStatus = ({ status }: Partial<DynatraceProblem>) => {\n switch (status?.toLocaleLowerCase()) {\n case 'open':\n return (\n <>\n <StatusError />\n Open\n </>\n );\n case 'closed':\n return (\n <>\n <StatusOK />\n Closed\n </>\n );\n default:\n return <></>;\n }\n};\n"],"names":[],"mappings":";;;AAmBO,MAAM,aAAgB,GAAA,CAAC,EAAE,MAAA,EAAwC,KAAA;AACtE,EAAQ,QAAA,MAAA,EAAQ,mBAAqB;AAAA,IACnC,KAAK,MAAA;AACH,MAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAY,EAAA,IAAA,CAAA,EAAE,MAEjB,CAAA;AAAA,IAEJ,KAAK,QAAA;AACH,MAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,IAAA,CAAA,EAAE,QAEd,CAAA;AAAA,IAEJ;AACE,MAAA,uBAAS,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,CAAA;AAAA;AAEf;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProblemsList.esm.js","sources":["../../../../src/components/Problems/ProblemsList/ProblemsList.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n Progress,\n ResponseErrorPanel,\n EmptyState,\n} from '@backstage/core-components';\nimport { useApi, configApiRef } from '@backstage/core-plugin-api';\nimport { ProblemsTable } from '../ProblemsTable';\nimport { dynatraceApiRef, DynatraceProblem } from '../../../api';\nimport { InfoCard } from '@backstage/core-components';\n\ntype ProblemsListProps = {\n dynatraceEntityId: string;\n};\n\nconst cardContents = (\n problems: DynatraceProblem[],\n dynatraceBaseUrl: string,\n) => {\n return problems.length ? (\n <ProblemsTable\n problems={problems || []}\n dynatraceBaseUrl={dynatraceBaseUrl}\n />\n ) : (\n <EmptyState title=\"No Problems to Report!\" missing=\"data\" />\n );\n};\n\nconst dynatraceEntityPrefixes = (idPrefix: string): string => {\n switch (idPrefix) {\n case 'APPLICATION':\n return '#uemapplications/uemappmetrics;uemapplicationId=';\n\n case 'SERVICE':\n return '#services/serviceOverview;id=';\n\n case `MOBILE_APPLICATION`:\n return '#mobileappoverview;appID=';\n\n case 'SYNTHETIC_TEST':\n return 'ui/browser-monitor/';\n\n case 'KUBERNETES_CLUSTER':\n return 'ui/kubernetes/';\n\n case 'PROCESS_GROUP_INSTANCE':\n return '#processdetails;id=';\n\n default:\n return 'ui/entity/';\n }\n};\n\nexport const ProblemsList = (props: ProblemsListProps) => {\n const { dynatraceEntityId } = props;\n const configApi = useApi(configApiRef);\n const dynatraceApi = useApi(dynatraceApiRef);\n const dynatraceBaseUrl = configApi.getString('dynatrace.baseUrl');\n\n const { value, loading, error } = useAsync(async () => {\n return dynatraceApi.getDynatraceProblems(dynatraceEntityId);\n }, [dynatraceApi, dynatraceEntityId]);\n const problems = value?.problems;\n\n const deepLinkPrefix = dynatraceEntityPrefixes(\n `${dynatraceEntityId.split('-')[0]}`,\n );\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n return (\n <InfoCard\n title=\"Problems\"\n subheader={`Last 2 hours - ${dynatraceEntityId}`}\n deepLink={{\n title: 'View Entity in Dynatrace',\n link: `${dynatraceBaseUrl}/${deepLinkPrefix}${dynatraceEntityId}`,\n }}\n >\n {cardContents(problems || [], dynatraceBaseUrl)}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA+BA,MAAM,YAAA,GAAe,CACnB,QAAA,EACA,gBACG,KAAA;AACH,EAAA,OAAO,SAAS,MACd,mBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAU,YAAY,EAAC;AAAA,MACvB
|
|
1
|
+
{"version":3,"file":"ProblemsList.esm.js","sources":["../../../../src/components/Problems/ProblemsList/ProblemsList.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n Progress,\n ResponseErrorPanel,\n EmptyState,\n} from '@backstage/core-components';\nimport { useApi, configApiRef } from '@backstage/core-plugin-api';\nimport { ProblemsTable } from '../ProblemsTable';\nimport { dynatraceApiRef, DynatraceProblem } from '../../../api';\nimport { InfoCard } from '@backstage/core-components';\n\ntype ProblemsListProps = {\n dynatraceEntityId: string;\n};\n\nconst cardContents = (\n problems: DynatraceProblem[],\n dynatraceBaseUrl: string,\n) => {\n return problems.length ? (\n <ProblemsTable\n problems={problems || []}\n dynatraceBaseUrl={dynatraceBaseUrl}\n />\n ) : (\n <EmptyState title=\"No Problems to Report!\" missing=\"data\" />\n );\n};\n\nconst dynatraceEntityPrefixes = (idPrefix: string): string => {\n switch (idPrefix) {\n case 'APPLICATION':\n return '#uemapplications/uemappmetrics;uemapplicationId=';\n\n case 'SERVICE':\n return '#services/serviceOverview;id=';\n\n case `MOBILE_APPLICATION`:\n return '#mobileappoverview;appID=';\n\n case 'SYNTHETIC_TEST':\n return 'ui/browser-monitor/';\n\n case 'KUBERNETES_CLUSTER':\n return 'ui/kubernetes/';\n\n case 'PROCESS_GROUP_INSTANCE':\n return '#processdetails;id=';\n\n default:\n return 'ui/entity/';\n }\n};\n\nexport const ProblemsList = (props: ProblemsListProps) => {\n const { dynatraceEntityId } = props;\n const configApi = useApi(configApiRef);\n const dynatraceApi = useApi(dynatraceApiRef);\n const dynatraceBaseUrl = configApi.getString('dynatrace.baseUrl');\n\n const { value, loading, error } = useAsync(async () => {\n return dynatraceApi.getDynatraceProblems(dynatraceEntityId);\n }, [dynatraceApi, dynatraceEntityId]);\n const problems = value?.problems;\n\n const deepLinkPrefix = dynatraceEntityPrefixes(\n `${dynatraceEntityId.split('-')[0]}`,\n );\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n return (\n <InfoCard\n title=\"Problems\"\n subheader={`Last 2 hours - ${dynatraceEntityId}`}\n deepLink={{\n title: 'View Entity in Dynatrace',\n link: `${dynatraceBaseUrl}/${deepLinkPrefix}${dynatraceEntityId}`,\n }}\n >\n {cardContents(problems || [], dynatraceBaseUrl)}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA+BA,MAAM,YAAA,GAAe,CACnB,QAAA,EACA,gBACG,KAAA;AACH,EAAA,OAAO,SAAS,MACd,mBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAU,YAAY,EAAC;AAAA,MACvB;AAAA;AAAA,sBAGD,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,KAAM,EAAA,wBAAA,EAAyB,SAAQ,MAAO,EAAA,CAAA;AAE9D,CAAA;AAEA,MAAM,uBAAA,GAA0B,CAAC,QAA6B,KAAA;AAC5D,EAAA,QAAQ,QAAU;AAAA,IAChB,KAAK,aAAA;AACH,MAAO,OAAA,kDAAA;AAAA,IAET,KAAK,SAAA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C,QAAU,EAAA;AAAA,QACR,KAAO,EAAA,0BAAA;AAAA,QACP,MAAM,CAAG,EAAA,gBAAgB,CAAI,CAAA,EAAA,cAAc,GAAG,iBAAiB,CAAA;AAAA;AACjE,KAAA;AAAA,IAEC,YAAa,CAAA,QAAA,IAAY,EAAC,EAAG,gBAAgB;AAAA,GAChD;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProblemsTable.esm.js","sources":["../../../../src/components/Problems/ProblemsTable/ProblemsTable.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport { Table, TableColumn } from '@backstage/core-components';\nimport { DynatraceProblem } from '../../../api/DynatraceApi';\nimport { ProblemStatus } from '../ProblemStatus';\nimport { Link } from '@backstage/core-components';\n\ntype ProblemsTableProps = {\n problems: DynatraceProblem[];\n dynatraceBaseUrl: string;\n};\n\nconst parseTimestamp = (timestamp: number | undefined) => {\n return timestamp ? new Date(timestamp).toLocaleString() : 'N/A';\n};\n\nexport const ProblemsTable = (props: ProblemsTableProps) => {\n const { problems, dynatraceBaseUrl } = props;\n const columns: TableColumn[] = [\n {\n title: 'Title',\n field: 'title',\n render: (row: Partial<DynatraceProblem>) => (\n <Link\n to={`${dynatraceBaseUrl}/#problems/problemdetails;pid=${row.problemId}`}\n >\n {row.title}\n </Link>\n ),\n },\n {\n title: 'Status',\n field: 'status',\n render: (row: Partial<DynatraceProblem>) => (\n <ProblemStatus status={row.status} />\n ),\n },\n { title: 'Severity', field: 'severityLevel' },\n {\n title: 'Root Cause',\n field: 'rootCauseEntity',\n render: (row: Partial<DynatraceProblem>) => row.rootCauseEntity?.name,\n },\n {\n title: 'Affected',\n field: 'affectedEntities',\n render: (row: Partial<DynatraceProblem>) =>\n row.affectedEntities?.map(e => e.name),\n },\n {\n title: 'Start Time',\n field: 'startTime',\n render: (row: Partial<DynatraceProblem>) => parseTimestamp(row.startTime),\n },\n {\n title: 'End Time',\n field: 'endTime',\n render: (row: Partial<DynatraceProblem>) =>\n row.endTime === -1 ? 'ongoing' : parseTimestamp(row.endTime),\n },\n ];\n\n return (\n <Table\n options={{ search: true, paging: true }}\n columns={columns}\n data={problems.map(p => {\n return { ...p, id: p.problemId };\n })}\n />\n );\n};\n"],"names":[],"mappings":";;;;AA0BA,MAAM,cAAA,GAAiB,CAAC,SAAkC,KAAA;AACxD,EAAA,OAAO,YAAY,IAAI,IAAA,CAAK,SAAS,CAAA,CAAE,gBAAmB,GAAA,KAAA
|
|
1
|
+
{"version":3,"file":"ProblemsTable.esm.js","sources":["../../../../src/components/Problems/ProblemsTable/ProblemsTable.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport { Table, TableColumn } from '@backstage/core-components';\nimport { DynatraceProblem } from '../../../api/DynatraceApi';\nimport { ProblemStatus } from '../ProblemStatus';\nimport { Link } from '@backstage/core-components';\n\ntype ProblemsTableProps = {\n problems: DynatraceProblem[];\n dynatraceBaseUrl: string;\n};\n\nconst parseTimestamp = (timestamp: number | undefined) => {\n return timestamp ? new Date(timestamp).toLocaleString() : 'N/A';\n};\n\nexport const ProblemsTable = (props: ProblemsTableProps) => {\n const { problems, dynatraceBaseUrl } = props;\n const columns: TableColumn[] = [\n {\n title: 'Title',\n field: 'title',\n render: (row: Partial<DynatraceProblem>) => (\n <Link\n to={`${dynatraceBaseUrl}/#problems/problemdetails;pid=${row.problemId}`}\n >\n {row.title}\n </Link>\n ),\n },\n {\n title: 'Status',\n field: 'status',\n render: (row: Partial<DynatraceProblem>) => (\n <ProblemStatus status={row.status} />\n ),\n },\n { title: 'Severity', field: 'severityLevel' },\n {\n title: 'Root Cause',\n field: 'rootCauseEntity',\n render: (row: Partial<DynatraceProblem>) => row.rootCauseEntity?.name,\n },\n {\n title: 'Affected',\n field: 'affectedEntities',\n render: (row: Partial<DynatraceProblem>) =>\n row.affectedEntities?.map(e => e.name),\n },\n {\n title: 'Start Time',\n field: 'startTime',\n render: (row: Partial<DynatraceProblem>) => parseTimestamp(row.startTime),\n },\n {\n title: 'End Time',\n field: 'endTime',\n render: (row: Partial<DynatraceProblem>) =>\n row.endTime === -1 ? 'ongoing' : parseTimestamp(row.endTime),\n },\n ];\n\n return (\n <Table\n options={{ search: true, paging: true }}\n columns={columns}\n data={problems.map(p => {\n return { ...p, id: p.problemId };\n })}\n />\n );\n};\n"],"names":[],"mappings":";;;;AA0BA,MAAM,cAAA,GAAiB,CAAC,SAAkC,KAAA;AACxD,EAAA,OAAO,YAAY,IAAI,IAAA,CAAK,SAAS,CAAA,CAAE,gBAAmB,GAAA,KAAA;AAC5D,CAAA;AAEa,MAAA,aAAA,GAAgB,CAAC,KAA8B,KAAA;AAC1D,EAAM,MAAA,EAAE,QAAU,EAAA,gBAAA,EAAqB,GAAA,KAAA;AACvC,EAAA,MAAM,OAAyB,GAAA;AAAA,IAC7B;AAAA,MACE,KAAO,EAAA,OAAA;AAAA,MACP,KAAO,EAAA,OAAA;AAAA,MACP,MAAA,EAAQ,CAAC,GACP,qBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,EAAI,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S,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA;AACtB,QAAA,OAAO,EAAE,GAAG,CAAG,EAAA,EAAA,EAAI,EAAE,SAAU,EAAA;AAAA,OAChC;AAAA;AAAA,GACH;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyntheticsCard.esm.js","sources":["../../../../src/components/Synthetics/SyntheticsCard/SyntheticsCard.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { InfoCard } from '@backstage/core-components';\nimport { useApi, configApiRef } from '@backstage/core-plugin-api';\nimport { dynatraceApiRef } from '../../../api';\nimport { SyntheticsLocation } from '../SyntheticsLocation';\n\ntype SyntheticsCardProps = {\n syntheticsId: string;\n};\n\nconst dynatraceMonitorPrefixes = (idPrefix: string): string => {\n switch (idPrefix) {\n case 'HTTP_CHECK':\n return 'ui/http-monitor';\n case 'BROWSER_MONITOR':\n return 'ui/browser-monitor';\n case 'SYNTHETIC_TEST':\n return 'ui/browser-monitor';\n default:\n throw new Error('Invalid synthetic Id');\n }\n};\n\nexport const SyntheticsCard = (props: SyntheticsCardProps) => {\n const { syntheticsId } = props;\n const configApi = useApi(configApiRef);\n const dynatraceApi = useApi(dynatraceApiRef);\n const dynatraceBaseUrl = configApi.getString('dynatrace.baseUrl');\n\n const { value, loading, error } = useAsync(async () => {\n return dynatraceApi.getDynatraceSyntheticFailures(syntheticsId);\n }, [dynatraceApi, syntheticsId]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const deepLinkPrefix = dynatraceMonitorPrefixes(\n `${syntheticsId.split('-')[0]}`,\n );\n\n const lastFailed = value?.locationsExecutionResults.map(l => {\n return {\n timestamp: l.requestResults[0].startTimestamp,\n location: Number(l.locationId).toString(16),\n };\n });\n\n return (\n <InfoCard\n title=\"Synthetics\"\n subheader={`Recent Activity for Monitor ${syntheticsId}`}\n deepLink={{\n title: 'View this Synthetic in Dynatrace',\n link: `${dynatraceBaseUrl}/${deepLinkPrefix}/${syntheticsId}`,\n }}\n >\n {lastFailed?.map(l => {\n return (\n <SyntheticsLocation\n key={l.location}\n lastFailedTimestamp={new Date(l.timestamp)}\n locationId={l.location}\n />\n );\n })}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA2BA,MAAM,wBAAA,GAA2B,CAAC,QAA6B,KAAA;AAC7D,EAAA,QAAQ,QAAU;AAAA,IAChB,KAAK,YAAA;AACH,MAAO,OAAA,iBAAA
|
|
1
|
+
{"version":3,"file":"SyntheticsCard.esm.js","sources":["../../../../src/components/Synthetics/SyntheticsCard/SyntheticsCard.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { InfoCard } from '@backstage/core-components';\nimport { useApi, configApiRef } from '@backstage/core-plugin-api';\nimport { dynatraceApiRef } from '../../../api';\nimport { SyntheticsLocation } from '../SyntheticsLocation';\n\ntype SyntheticsCardProps = {\n syntheticsId: string;\n};\n\nconst dynatraceMonitorPrefixes = (idPrefix: string): string => {\n switch (idPrefix) {\n case 'HTTP_CHECK':\n return 'ui/http-monitor';\n case 'BROWSER_MONITOR':\n return 'ui/browser-monitor';\n case 'SYNTHETIC_TEST':\n return 'ui/browser-monitor';\n default:\n throw new Error('Invalid synthetic Id');\n }\n};\n\nexport const SyntheticsCard = (props: SyntheticsCardProps) => {\n const { syntheticsId } = props;\n const configApi = useApi(configApiRef);\n const dynatraceApi = useApi(dynatraceApiRef);\n const dynatraceBaseUrl = configApi.getString('dynatrace.baseUrl');\n\n const { value, loading, error } = useAsync(async () => {\n return dynatraceApi.getDynatraceSyntheticFailures(syntheticsId);\n }, [dynatraceApi, syntheticsId]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const deepLinkPrefix = dynatraceMonitorPrefixes(\n `${syntheticsId.split('-')[0]}`,\n );\n\n const lastFailed = value?.locationsExecutionResults.map(l => {\n return {\n timestamp: l.requestResults[0].startTimestamp,\n location: Number(l.locationId).toString(16),\n };\n });\n\n return (\n <InfoCard\n title=\"Synthetics\"\n subheader={`Recent Activity for Monitor ${syntheticsId}`}\n deepLink={{\n title: 'View this Synthetic in Dynatrace',\n link: `${dynatraceBaseUrl}/${deepLinkPrefix}/${syntheticsId}`,\n }}\n >\n {lastFailed?.map(l => {\n return (\n <SyntheticsLocation\n key={l.location}\n lastFailedTimestamp={new Date(l.timestamp)}\n locationId={l.location}\n />\n );\n })}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA2BA,MAAM,wBAAA,GAA2B,CAAC,QAA6B,KAAA;AAC7D,EAAA,QAAQ,QAAU;AAAA,IAChB,KAAK,YAAA;AACH,MAAO,OAAA,iBAAA;AAAA,IACT,KAAK,iBAAA;AACH,MAAO,OAAA,oBAAA;AAAA,IACT,KAAK,gBAAA;AACH,MAAO,OAAA,oBAA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Y,CAAA,CAAA;AAAA,MACtD,QAAU,EAAA;AAAA,QACR,KAAO,EAAA,kCAAA;AAAA,QACP,MAAM,CAAG,EAAA,gBAAgB,CAAI,CAAA,EAAA,cAAc,IAAI,YAAY,CAAA;AAAA;AAC7D,KAAA;AAAA,IAEC,UAAA,EAAY,IAAI,CAAK,CAAA,KAAA;AACpB,MACE,uBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,KAAK,CAAE,CAAA,QAAA;AAAA,UACP,mBAAqB,EAAA,IAAI,IAAK,CAAA,CAAA,CAAE,SAAS,CAAA;AAAA,UACzC,YAAY,CAAE,CAAA;AAAA;AAAA,OAChB;AAAA,KAEH;AAAA,GACH;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyntheticsLocation.esm.js","sources":["../../../../src/components/Synthetics/SyntheticsLocation/SyntheticsLocation.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport Chip from '@material-ui/core/Chip';\nimport { dynatraceApiRef } from '../../../api';\n\ntype SyntheticsLocationProps = {\n lastFailedTimestamp: Date;\n locationId: string;\n key: string;\n};\n\nconst failedInLastXHours = (timestamp: Date, offset: number): boolean => {\n if (offset < 0 || offset > 24)\n throw new Error('offset must be between 0 and 24');\n return timestamp > new Date(new Date().getTime() - 1000 * 60 * 60 * offset);\n};\n\nconst chipColor = (timestamp: Date): string => {\n if (failedInLastXHours(timestamp, 1)) {\n return 'salmon';\n }\n if (failedInLastXHours(timestamp, 6)) {\n return 'sandybrown';\n }\n if (failedInLastXHours(timestamp, 24)) {\n return 'palegoldenrod';\n }\n return 'lightgreen';\n};\n\nexport const SyntheticsLocation = (props: SyntheticsLocationProps) => {\n const { lastFailedTimestamp, locationId } = props;\n const dynatraceApi = useApi(dynatraceApiRef);\n const { value, loading, error } = useAsync(async () => {\n return dynatraceApi.getDynatraceSyntheticLocationInfo(\n `SYNTHETIC_LOCATION-00000000000000${locationId}`,\n );\n });\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <Chip\n label={`${value?.name}${\n failedInLastXHours(new Date(lastFailedTimestamp), 24)\n ? `: failed @ ${lastFailedTimestamp.toLocaleTimeString()}`\n : ''\n }`}\n size=\"medium\"\n style={{ backgroundColor: chipColor(lastFailedTimestamp) }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AA6BA,MAAM,kBAAA,GAAqB,CAAC,SAAA,EAAiB,MAA4B,KAAA;AACvE,EAAI,IAAA,MAAA,GAAS,KAAK,MAAS,GAAA,EAAA;AACzB,IAAM,MAAA,IAAI,MAAM,iCAAiC,CAAA
|
|
1
|
+
{"version":3,"file":"SyntheticsLocation.esm.js","sources":["../../../../src/components/Synthetics/SyntheticsLocation/SyntheticsLocation.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport Chip from '@material-ui/core/Chip';\nimport { dynatraceApiRef } from '../../../api';\n\ntype SyntheticsLocationProps = {\n lastFailedTimestamp: Date;\n locationId: string;\n key: string;\n};\n\nconst failedInLastXHours = (timestamp: Date, offset: number): boolean => {\n if (offset < 0 || offset > 24)\n throw new Error('offset must be between 0 and 24');\n return timestamp > new Date(new Date().getTime() - 1000 * 60 * 60 * offset);\n};\n\nconst chipColor = (timestamp: Date): string => {\n if (failedInLastXHours(timestamp, 1)) {\n return 'salmon';\n }\n if (failedInLastXHours(timestamp, 6)) {\n return 'sandybrown';\n }\n if (failedInLastXHours(timestamp, 24)) {\n return 'palegoldenrod';\n }\n return 'lightgreen';\n};\n\nexport const SyntheticsLocation = (props: SyntheticsLocationProps) => {\n const { lastFailedTimestamp, locationId } = props;\n const dynatraceApi = useApi(dynatraceApiRef);\n const { value, loading, error } = useAsync(async () => {\n return dynatraceApi.getDynatraceSyntheticLocationInfo(\n `SYNTHETIC_LOCATION-00000000000000${locationId}`,\n );\n });\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <Chip\n label={`${value?.name}${\n failedInLastXHours(new Date(lastFailedTimestamp), 24)\n ? `: failed @ ${lastFailedTimestamp.toLocaleTimeString()}`\n : ''\n }`}\n size=\"medium\"\n style={{ backgroundColor: chipColor(lastFailedTimestamp) }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AA6BA,MAAM,kBAAA,GAAqB,CAAC,SAAA,EAAiB,MAA4B,KAAA;AACvE,EAAI,IAAA,MAAA,GAAS,KAAK,MAAS,GAAA,EAAA;AACzB,IAAM,MAAA,IAAI,MAAM,iCAAiC,CAAA;AACnD,EAAO,OAAA,SAAA,GAAY,IAAI,IAAA,CAAA,iBAAS,IAAA,IAAA,EAAO,EAAA,OAAA,EAAY,GAAA,GAAA,GAAO,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AA,SAAA,CAAU,mBAAmB,CAAE;AAAA;AAAA,GAC3D;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.esm.js","sources":["../src/constants.ts"],"sourcesContent":["/*\n * Copyright 2022 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 DYNATRACE_ID_ANNOTATION = 'dynatrace.com/dynatrace-entity-id';\nexport const DYNATRACE_SYNTHETICS_ANNOTATION = 'dynatrace.com/synthetics-ids';\n"],"names":[],"mappings":"AAeO,MAAM,uBAA0B,GAAA
|
|
1
|
+
{"version":3,"file":"constants.esm.js","sources":["../src/constants.ts"],"sourcesContent":["/*\n * Copyright 2022 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 DYNATRACE_ID_ANNOTATION = 'dynatrace.com/dynatrace-entity-id';\nexport const DYNATRACE_SYNTHETICS_ANNOTATION = 'dynatrace.com/synthetics-ids';\n"],"names":[],"mappings":"AAeO,MAAM,uBAA0B,GAAA;AAChC,MAAM,+BAAkC,GAAA;;;;"}
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { dynatraceApiRef, DynatraceClient } from './api';\nimport {\n createApiFactory,\n createPlugin,\n discoveryApiRef,\n fetchApiRef,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\nimport { Entity } from '@backstage/catalog-model';\nimport {\n DYNATRACE_ID_ANNOTATION,\n DYNATRACE_SYNTHETICS_ANNOTATION,\n} from './constants';\n\nimport { rootRouteRef } from './routes';\n\n/**\n * Create the Dynatrace plugin.\n * @public\n */\nexport const dynatracePlugin = createPlugin({\n id: 'dynatrace',\n apis: [\n createApiFactory({\n api: dynatraceApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new DynatraceClient({\n discoveryApi,\n fetchApi,\n }),\n }),\n ],\n});\n\n/**\n * Checks if the entity has a dynatrace id annotation.\n * @public\n * @param entity - The entity to check for the dynatrace id annotation.\n */\nexport const isDynatraceAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[DYNATRACE_ID_ANNOTATION]) ||\n Boolean(entity.metadata.annotations?.[DYNATRACE_SYNTHETICS_ANNOTATION]);\n\n/**\n * Creates a routable extension for the dynatrace plugin tab.\n * @public\n */\nexport const DynatraceTab = dynatracePlugin.provide(\n createRoutableExtension({\n name: 'DynatraceTab',\n component: () =>\n import('./components/DynatraceTab').then(m => m.DynatraceTab),\n mountPoint: rootRouteRef,\n }),\n);\n"],"names":[],"mappings":";;;;;;AAqCO,MAAM,kBAAkB,YAAa,CAAA;AAAA,EAC1C,EAAI,EAAA,WAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,eAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { dynatraceApiRef, DynatraceClient } from './api';\nimport {\n createApiFactory,\n createPlugin,\n discoveryApiRef,\n fetchApiRef,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\nimport { Entity } from '@backstage/catalog-model';\nimport {\n DYNATRACE_ID_ANNOTATION,\n DYNATRACE_SYNTHETICS_ANNOTATION,\n} from './constants';\n\nimport { rootRouteRef } from './routes';\n\n/**\n * Create the Dynatrace plugin.\n * @public\n */\nexport const dynatracePlugin = createPlugin({\n id: 'dynatrace',\n apis: [\n createApiFactory({\n api: dynatraceApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new DynatraceClient({\n discoveryApi,\n fetchApi,\n }),\n }),\n ],\n});\n\n/**\n * Checks if the entity has a dynatrace id annotation.\n * @public\n * @param entity - The entity to check for the dynatrace id annotation.\n */\nexport const isDynatraceAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[DYNATRACE_ID_ANNOTATION]) ||\n Boolean(entity.metadata.annotations?.[DYNATRACE_SYNTHETICS_ANNOTATION]);\n\n/**\n * Creates a routable extension for the dynatrace plugin tab.\n * @public\n */\nexport const DynatraceTab = dynatracePlugin.provide(\n createRoutableExtension({\n name: 'DynatraceTab',\n component: () =>\n import('./components/DynatraceTab').then(m => m.DynatraceTab),\n mountPoint: rootRouteRef,\n }),\n);\n"],"names":[],"mappings":";;;;;;AAqCO,MAAM,kBAAkB,YAAa,CAAA;AAAA,EAC1C,EAAI,EAAA,WAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,eAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,SAAS,CAAC,EAAE,cAAc,QAAS,EAAA,KACjC,IAAI,eAAgB,CAAA;AAAA,QAClB,YAAA;AAAA,QACA;AAAA,OACD;AAAA,KACJ;AAAA;AAEL,CAAC;AAOM,MAAM,oBAAuB,GAAA,CAAC,MACnC,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,uBAAuB,CAAC,KAC9D,OAAQ,CAAA,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,+BAA+B,CAAC;AAMjE,MAAM,eAAe,eAAgB,CAAA,OAAA;AAAA,EAC1C,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,cAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,wCAA2B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,YAAY,CAAA;AAAA,IAC9D,UAAY,EAAA;AAAA,GACb;AACH;;;;"}
|
package/dist/routes.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'dynatrace',\n});\n"],"names":[],"mappings":";;AAiBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA
|
|
1
|
+
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'dynatrace',\n});\n"],"names":[],"mappings":";;AAiBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA;AACN,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-dynatrace",
|
|
3
|
-
"version": "10.0
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "dynatrace",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"test": "backstage-cli package test"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@backstage/catalog-model": "^1.7.
|
|
41
|
-
"@backstage/core-components": "^0.
|
|
42
|
-
"@backstage/core-plugin-api": "^1.
|
|
40
|
+
"@backstage/catalog-model": "^1.7.2",
|
|
41
|
+
"@backstage/core-components": "^0.16.2",
|
|
42
|
+
"@backstage/core-plugin-api": "^1.10.2",
|
|
43
43
|
"@material-ui/core": "^4.12.2",
|
|
44
44
|
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
45
45
|
"react-use": "^17.2.4"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@backstage/cli": "^0.
|
|
49
|
-
"@backstage/core-app-api": "^1.15.
|
|
50
|
-
"@backstage/dev-utils": "^1.1.
|
|
51
|
-
"@backstage/plugin-catalog-react": "^1.
|
|
52
|
-
"@backstage/test-utils": "^1.
|
|
48
|
+
"@backstage/cli": "^0.29.4",
|
|
49
|
+
"@backstage/core-app-api": "^1.15.3",
|
|
50
|
+
"@backstage/dev-utils": "^1.1.5",
|
|
51
|
+
"@backstage/plugin-catalog-react": "^1.15.0",
|
|
52
|
+
"@backstage/test-utils": "^1.7.3",
|
|
53
53
|
"@testing-library/dom": "^10.0.0",
|
|
54
54
|
"@testing-library/jest-dom": "^6.0.0",
|
|
55
55
|
"@testing-library/react": "^15.0.0",
|
|
@@ -60,11 +60,18 @@
|
|
|
60
60
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@backstage/plugin-catalog-react": "^1.
|
|
63
|
+
"@backstage/plugin-catalog-react": "^1.15.0",
|
|
64
64
|
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
65
65
|
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
66
66
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
67
67
|
},
|
|
68
68
|
"configSchema": "config.d.ts",
|
|
69
|
+
"typesVersions": {
|
|
70
|
+
"*": {
|
|
71
|
+
"index": [
|
|
72
|
+
"dist/index.d.ts"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
},
|
|
69
76
|
"module": "./dist/index.esm.js"
|
|
70
77
|
}
|