@backstage/plugin-catalog-backend-module-puppetdb 0.2.17-next.1 → 0.2.18-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-backend-module-puppetdb
|
|
2
2
|
|
|
3
|
+
## 0.2.18-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a307700: Fixed crash when `latest_report_status` is undefined
|
|
8
|
+
|
|
9
|
+
## 0.2.17
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @backstage/backend-plugin-api@1.6.0
|
|
15
|
+
- @backstage/plugin-catalog-node@1.20.1
|
|
16
|
+
|
|
3
17
|
## 0.2.17-next.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -18,10 +18,10 @@ const defaultResourceTransformer = async (node, _config) => {
|
|
|
18
18
|
},
|
|
19
19
|
namespace: catalogModel.DEFAULT_NAMESPACE,
|
|
20
20
|
description: node.facts?.data?.find((e) => e.name === "ipaddress")?.value?.toString(),
|
|
21
|
-
tags:
|
|
22
|
-
kernel
|
|
23
|
-
latest_report_status
|
|
24
|
-
]
|
|
21
|
+
tags: [
|
|
22
|
+
kernel?.toString().toLocaleLowerCase("en-US"),
|
|
23
|
+
latest_report_status?.toString().toLocaleLowerCase("en-US")
|
|
24
|
+
].filter((tag) => Boolean(tag))
|
|
25
25
|
},
|
|
26
26
|
spec: {
|
|
27
27
|
type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.cjs.js","sources":["../../src/puppet/transformers.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceTransformer } from './types';\nimport { DEFAULT_NAMESPACE, ResourceEntity } from '@backstage/catalog-model';\nimport { ANNOTATION_PUPPET_CERTNAME, DEFAULT_ENTITY_OWNER } from './constants';\n\n/**\n * A default implementation of the {@link ResourceTransformer}.\n *\n * @param node - The found PuppetDB node entry in its source format. This is the entry that you want to transform.\n * @param _config - The configuration for the entity provider.\n *\n * @returns A `ResourceEntity`.\n *\n * @public\n */\nexport const defaultResourceTransformer: ResourceTransformer = async (\n node,\n _config,\n): Promise<ResourceEntity | undefined> => {\n const certName = node.certname.toLocaleLowerCase('en-US');\n const type = node.facts?.data?.find(e => e.name === 'is_virtual')?.value\n ? 'virtual-machine'\n : 'physical-server';\n const kernel = node.facts?.data?.find(e => e.name === 'kernel')?.value;\n const latest_report_status = node.latest_report_status;\n\n return {\n apiVersion: 'backstage.io/v1beta1',\n kind: 'Resource',\n metadata: {\n name: certName,\n annotations: {\n [ANNOTATION_PUPPET_CERTNAME]: certName,\n },\n namespace: DEFAULT_NAMESPACE,\n description: node.facts?.data\n ?.find(e => e.name === 'ipaddress')\n ?.value?.toString(),\n tags:
|
|
1
|
+
{"version":3,"file":"transformers.cjs.js","sources":["../../src/puppet/transformers.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceTransformer } from './types';\nimport { DEFAULT_NAMESPACE, ResourceEntity } from '@backstage/catalog-model';\nimport { ANNOTATION_PUPPET_CERTNAME, DEFAULT_ENTITY_OWNER } from './constants';\n\n/**\n * A default implementation of the {@link ResourceTransformer}.\n *\n * @param node - The found PuppetDB node entry in its source format. This is the entry that you want to transform.\n * @param _config - The configuration for the entity provider.\n *\n * @returns A `ResourceEntity`.\n *\n * @public\n */\nexport const defaultResourceTransformer: ResourceTransformer = async (\n node,\n _config,\n): Promise<ResourceEntity | undefined> => {\n const certName = node.certname.toLocaleLowerCase('en-US');\n const type = node.facts?.data?.find(e => e.name === 'is_virtual')?.value\n ? 'virtual-machine'\n : 'physical-server';\n const kernel = node.facts?.data?.find(e => e.name === 'kernel')?.value;\n const latest_report_status = node.latest_report_status;\n\n return {\n apiVersion: 'backstage.io/v1beta1',\n kind: 'Resource',\n metadata: {\n name: certName,\n annotations: {\n [ANNOTATION_PUPPET_CERTNAME]: certName,\n },\n namespace: DEFAULT_NAMESPACE,\n description: node.facts?.data\n ?.find(e => e.name === 'ipaddress')\n ?.value?.toString(),\n tags: [\n kernel?.toString().toLocaleLowerCase('en-US'),\n latest_report_status?.toString().toLocaleLowerCase('en-US'),\n ].filter((tag): tag is string => Boolean(tag)),\n },\n spec: {\n type: type,\n owner: DEFAULT_ENTITY_OWNER,\n dependsOn: [],\n dependencyOf: [],\n },\n };\n};\n"],"names":["ANNOTATION_PUPPET_CERTNAME","DEFAULT_NAMESPACE","DEFAULT_ENTITY_OWNER"],"mappings":";;;;;AA8BO,MAAM,0BAAA,GAAkD,OAC7D,IAAA,EACA,OAAA,KACwC;AACxC,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,QAAA,CAAS,iBAAA,CAAkB,OAAO,CAAA;AACxD,EAAA,MAAM,IAAA,GAAO,IAAA,CAAK,KAAA,EAAO,IAAA,EAAM,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,KAAS,YAAY,CAAA,EAAG,KAAA,GAC/D,iBAAA,GACA,iBAAA;AACJ,EAAA,MAAM,MAAA,GAAS,KAAK,KAAA,EAAO,IAAA,EAAM,KAAK,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,KAAS,QAAQ,CAAA,EAAG,KAAA;AACjE,EAAA,MAAM,uBAAuB,IAAA,CAAK,oBAAA;AAElC,EAAA,OAAO;AAAA,IACL,UAAA,EAAY,sBAAA;AAAA,IACZ,IAAA,EAAM,UAAA;AAAA,IACN,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,QACX,CAACA,oCAA0B,GAAG;AAAA,OAChC;AAAA,MACA,SAAA,EAAWC,8BAAA;AAAA,MACX,WAAA,EAAa,IAAA,CAAK,KAAA,EAAO,IAAA,EACrB,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,KAAS,WAAW,CAAA,EAChC,KAAA,EAAO,QAAA,EAAS;AAAA,MACpB,IAAA,EAAM;AAAA,QACJ,MAAA,EAAQ,QAAA,EAAS,CAAE,iBAAA,CAAkB,OAAO,CAAA;AAAA,QAC5C,oBAAA,EAAsB,QAAA,EAAS,CAAE,iBAAA,CAAkB,OAAO;AAAA,QAC1D,MAAA,CAAO,CAAC,GAAA,KAAuB,OAAA,CAAQ,GAAG,CAAC;AAAA,KAC/C;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,IAAA;AAAA,MACA,KAAA,EAAOC,8BAAA;AAAA,MACP,WAAW,EAAC;AAAA,MACZ,cAAc;AAAC;AACjB,GACF;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-backend-module-puppetdb",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18-next.0",
|
|
4
4
|
"description": "A Backstage catalog backend module that helps integrate towards PuppetDB",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -57,18 +57,18 @@
|
|
|
57
57
|
"test": "backstage-cli package test"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@backstage/backend-plugin-api": "1.6.0
|
|
60
|
+
"@backstage/backend-plugin-api": "1.6.0",
|
|
61
61
|
"@backstage/catalog-model": "1.7.6",
|
|
62
62
|
"@backstage/config": "1.3.6",
|
|
63
63
|
"@backstage/errors": "1.2.7",
|
|
64
|
-
"@backstage/plugin-catalog-node": "1.20.1
|
|
64
|
+
"@backstage/plugin-catalog-node": "1.20.1",
|
|
65
65
|
"@backstage/types": "1.2.2",
|
|
66
66
|
"lodash": "^4.17.21",
|
|
67
67
|
"uuid": "^11.0.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@backstage/backend-test-utils": "1.10.
|
|
71
|
-
"@backstage/cli": "0.35.
|
|
70
|
+
"@backstage/backend-test-utils": "1.10.3-next.1",
|
|
71
|
+
"@backstage/cli": "0.35.2-next.1",
|
|
72
72
|
"@types/lodash": "^4.14.151",
|
|
73
73
|
"msw": "^1.0.0"
|
|
74
74
|
},
|