@jfvilas/plugin-kwirth-common 0.12.4 → 0.12.6
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/README.md +1 -1
- package/dist/Tools.esm.js +37 -0
- package/dist/Tools.esm.js.map +1 -0
- package/dist/index.cjs.js +37 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# Kwirth Backstage Common
|
|
2
|
-
This repo contains common objects for use both at
|
|
2
|
+
This repo contains common objects for use both at frontend and backend Backstage Kwirth plugins.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const getVersion = async (discoveryApi, fetchApi) => {
|
|
2
|
+
try {
|
|
3
|
+
const baseUrl = await discoveryApi.getBaseUrl("kwirth");
|
|
4
|
+
const targetUrl = `${baseUrl}/version`;
|
|
5
|
+
const result = await fetchApi.fetch(targetUrl);
|
|
6
|
+
const data = await result.json();
|
|
7
|
+
if (!result.ok) {
|
|
8
|
+
throw new Error(`getVersion error: not ok`);
|
|
9
|
+
}
|
|
10
|
+
return data.version;
|
|
11
|
+
} catch (err) {
|
|
12
|
+
throw new Error(`getVersion error: ${err}`);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const requestAccess = async (discoveryApi, fetchApi, entity, channel, scopes) => {
|
|
16
|
+
try {
|
|
17
|
+
const baseUrl = await discoveryApi.getBaseUrl("kwirth");
|
|
18
|
+
var targetUrl = new URL(`${baseUrl}/access`);
|
|
19
|
+
targetUrl.searchParams.append("scopes", scopes.join(","));
|
|
20
|
+
targetUrl.searchParams.append("channel", channel);
|
|
21
|
+
var payload = JSON.stringify(entity);
|
|
22
|
+
const result = await fetchApi.fetch(targetUrl, { method: "POST", body: payload, headers: { "Content-Type": "application/json" } });
|
|
23
|
+
const data = await result.json();
|
|
24
|
+
for (var c of data) {
|
|
25
|
+
c.accessKeys = new Map(JSON.parse(c.accessKeys));
|
|
26
|
+
}
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
throw new Error(`requestAccess error: not ok`);
|
|
29
|
+
}
|
|
30
|
+
return data;
|
|
31
|
+
} catch (err) {
|
|
32
|
+
throw new Error(`requestAccess error: ${err}`);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { getVersion, requestAccess };
|
|
37
|
+
//# sourceMappingURL=Tools.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tools.esm.js","sources":["../src/Tools.ts"],"sourcesContent":["import { Entity } from '@backstage/catalog-model/index'\r\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api'\r\nimport { InstanceConfigScopeEnum } from '@jfvilas/kwirth-common'\r\nimport { ClusterValidPods } from './Resources'\r\n\r\nexport const getVersion = async (discoveryApi:DiscoveryApi, fetchApi:FetchApi) : Promise<string> => {\r\n try {\r\n const baseUrl = await discoveryApi.getBaseUrl('kwirth')\r\n const targetUrl = `${baseUrl}/version`\r\n\r\n const result = await fetchApi.fetch(targetUrl)\r\n const data = await result.json()\r\n\r\n if (!result.ok) {\r\n throw new Error(`getVersion error: not ok`)\r\n }\r\n return data.version\r\n }\r\n catch (err) {\r\n throw new Error(`getVersion error: ${err}`)\r\n }\r\n }\r\n\r\nexport const requestAccess = async (discoveryApi:DiscoveryApi, fetchApi:FetchApi, entity:Entity, channel:string, scopes:InstanceConfigScopeEnum[]): Promise<ClusterValidPods[]> => {\r\n try {\r\n const baseUrl = await discoveryApi.getBaseUrl('kwirth')\r\n var targetUrl:URL= new URL (`${baseUrl}/access`)\r\n targetUrl.searchParams.append('scopes',scopes.join(','))\r\n targetUrl.searchParams.append('channel',channel)\r\n\r\n var payload=JSON.stringify(entity)\r\n const result = await fetchApi.fetch(targetUrl, {method:'POST', body:payload, headers:{'Content-Type':'application/json'}})\r\n const data = await result.json() as ClusterValidPods[]\r\n\r\n // we reconstruct the 'Map' from string of arrays\r\n for (var c of data) {\r\n c.accessKeys = new Map(JSON.parse(((c as any).accessKeys)))\r\n }\r\n if (!result.ok) {\r\n throw new Error(`requestAccess error: not ok`)\r\n }\r\n return data\r\n }\r\n catch (err) {\r\n throw new Error(`requestAccess error: ${err}`)\r\n }\r\n }\r\n"],"names":[],"mappings":"AAKa,MAAA,UAAA,GAAa,OAAO,YAAA,EAA2B,QAAwC,KAAA;AAC5F,EAAI,IAAA;AACA,IAAA,MAAM,OAAU,GAAA,MAAM,YAAa,CAAA,UAAA,CAAW,QAAQ,CAAA;AACtD,IAAM,MAAA,SAAA,GAAY,GAAG,OAAO,CAAA,QAAA,CAAA;AAE5B,IAAA,MAAM,MAAS,GAAA,MAAM,QAAS,CAAA,KAAA,CAAM,SAAS,CAAA;AAC7C,IAAM,MAAA,IAAA,GAAO,MAAM,MAAA,CAAO,IAAK,EAAA;AAE/B,IAAI,IAAA,CAAC,OAAO,EAAI,EAAA;AACZ,MAAM,MAAA,IAAI,MAAM,CAA0B,wBAAA,CAAA,CAAA;AAAA;AAE9C,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA,WAET,GAAK,EAAA;AACR,IAAA,MAAM,IAAI,KAAA,CAAM,CAAqB,kBAAA,EAAA,GAAG,CAAE,CAAA,CAAA;AAAA;AAElD;AAEG,MAAM,gBAAgB,OAAO,YAAA,EAA2B,QAAmB,EAAA,MAAA,EAAe,SAAgB,MAAkE,KAAA;AAC3K,EAAI,IAAA;AACA,IAAA,MAAM,OAAU,GAAA,MAAM,YAAa,CAAA,UAAA,CAAW,QAAQ,CAAA;AACtD,IAAA,IAAI,SAAe,GAAA,IAAI,GAAK,CAAA,CAAA,EAAG,OAAO,CAAS,OAAA,CAAA,CAAA;AAC/C,IAAA,SAAA,CAAU,aAAa,MAAO,CAAA,QAAA,EAAS,MAAO,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA;AACvD,IAAU,SAAA,CAAA,YAAA,CAAa,MAAO,CAAA,SAAA,EAAU,OAAO,CAAA;AAE/C,IAAI,IAAA,OAAA,GAAQ,IAAK,CAAA,SAAA,CAAU,MAAM,CAAA;AACjC,IAAA,MAAM,MAAS,GAAA,MAAM,QAAS,CAAA,KAAA,CAAM,WAAW,EAAC,MAAA,EAAO,MAAQ,EAAA,IAAA,EAAK,SAAS,OAAQ,EAAA,EAAC,cAAe,EAAA,kBAAA,IAAoB,CAAA;AACzH,IAAM,MAAA,IAAA,GAAO,MAAM,MAAA,CAAO,IAAK,EAAA;AAG/B,IAAA,KAAA,IAAS,KAAK,IAAM,EAAA;AAChB,MAAA,CAAA,CAAE,aAAa,IAAI,GAAA,CAAI,KAAK,KAAQ,CAAA,CAAA,CAAU,UAAW,CAAC,CAAA;AAAA;AAE9D,IAAI,IAAA,CAAC,OAAO,EAAI,EAAA;AACZ,MAAM,MAAA,IAAI,MAAM,CAA6B,2BAAA,CAAA,CAAA;AAAA;AAEjD,IAAO,OAAA,IAAA;AAAA,WAEJ,GAAK,EAAA;AACR,IAAA,MAAM,IAAI,KAAA,CAAM,CAAwB,qBAAA,EAAA,GAAG,CAAE,CAAA,CAAA;AAAA;AAErD;;;;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const getVersion = async (discoveryApi, fetchApi) => {
|
|
4
|
+
try {
|
|
5
|
+
const baseUrl = await discoveryApi.getBaseUrl("kwirth");
|
|
6
|
+
const targetUrl = `${baseUrl}/version`;
|
|
7
|
+
const result = await fetchApi.fetch(targetUrl);
|
|
8
|
+
const data = await result.json();
|
|
9
|
+
if (!result.ok) {
|
|
10
|
+
throw new Error(`getVersion error: not ok`);
|
|
11
|
+
}
|
|
12
|
+
return data.version;
|
|
13
|
+
} catch (err) {
|
|
14
|
+
throw new Error(`getVersion error: ${err}`);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const requestAccess = async (discoveryApi, fetchApi, entity, channel, scopes) => {
|
|
18
|
+
try {
|
|
19
|
+
const baseUrl = await discoveryApi.getBaseUrl("kwirth");
|
|
20
|
+
var targetUrl = new URL(`${baseUrl}/access`);
|
|
21
|
+
targetUrl.searchParams.append("scopes", scopes.join(","));
|
|
22
|
+
targetUrl.searchParams.append("channel", channel);
|
|
23
|
+
var payload = JSON.stringify(entity);
|
|
24
|
+
const result = await fetchApi.fetch(targetUrl, { method: "POST", body: payload, headers: { "Content-Type": "application/json" } });
|
|
25
|
+
const data = await result.json();
|
|
26
|
+
for (var c of data) {
|
|
27
|
+
c.accessKeys = new Map(JSON.parse(c.accessKeys));
|
|
28
|
+
}
|
|
29
|
+
if (!result.ok) {
|
|
30
|
+
throw new Error(`requestAccess error: not ok`);
|
|
31
|
+
}
|
|
32
|
+
return data;
|
|
33
|
+
} catch (err) {
|
|
34
|
+
throw new Error(`requestAccess error: ${err}`);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
3
38
|
const ANNOTATION_KWIRTH_LOCATION = "backstage.io/kubernetes-id";
|
|
4
39
|
const isKwirthAvailable = (entity) => {
|
|
5
40
|
if (!entity.metadata.annotations) return false;
|
|
@@ -7,5 +42,7 @@ const isKwirthAvailable = (entity) => {
|
|
|
7
42
|
};
|
|
8
43
|
|
|
9
44
|
exports.ANNOTATION_KWIRTH_LOCATION = ANNOTATION_KWIRTH_LOCATION;
|
|
45
|
+
exports.getVersion = getVersion;
|
|
10
46
|
exports.isKwirthAvailable = isKwirthAvailable;
|
|
47
|
+
exports.requestAccess = requestAccess;
|
|
11
48
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/index.ts"],"sourcesContent":["/*\r\nCopyright 2024 Julio Fernandez\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nimport { Entity } from '@backstage/catalog-model';\r\nexport * from './Resources';\r\n\r\n/**\r\n * Kwirth annotation.\r\n */\r\nexport const ANNOTATION_KWIRTH_LOCATION = 'backstage.io/kubernetes-id';\r\n\r\n/**\r\n * Function to know if an entity has Kwirth.\r\n */\r\nexport const isKwirthAvailable = (entity: Entity) => {\r\n if (!entity.metadata.annotations) return false;\r\n return Boolean (entity.metadata.annotations[ANNOTATION_KWIRTH_LOCATION]);\r\n}\r\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/Tools.ts","../src/index.ts"],"sourcesContent":["import { Entity } from '@backstage/catalog-model/index'\r\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api'\r\nimport { InstanceConfigScopeEnum } from '@jfvilas/kwirth-common'\r\nimport { ClusterValidPods } from './Resources'\r\n\r\nexport const getVersion = async (discoveryApi:DiscoveryApi, fetchApi:FetchApi) : Promise<string> => {\r\n try {\r\n const baseUrl = await discoveryApi.getBaseUrl('kwirth')\r\n const targetUrl = `${baseUrl}/version`\r\n\r\n const result = await fetchApi.fetch(targetUrl)\r\n const data = await result.json()\r\n\r\n if (!result.ok) {\r\n throw new Error(`getVersion error: not ok`)\r\n }\r\n return data.version\r\n }\r\n catch (err) {\r\n throw new Error(`getVersion error: ${err}`)\r\n }\r\n }\r\n\r\nexport const requestAccess = async (discoveryApi:DiscoveryApi, fetchApi:FetchApi, entity:Entity, channel:string, scopes:InstanceConfigScopeEnum[]): Promise<ClusterValidPods[]> => {\r\n try {\r\n const baseUrl = await discoveryApi.getBaseUrl('kwirth')\r\n var targetUrl:URL= new URL (`${baseUrl}/access`)\r\n targetUrl.searchParams.append('scopes',scopes.join(','))\r\n targetUrl.searchParams.append('channel',channel)\r\n\r\n var payload=JSON.stringify(entity)\r\n const result = await fetchApi.fetch(targetUrl, {method:'POST', body:payload, headers:{'Content-Type':'application/json'}})\r\n const data = await result.json() as ClusterValidPods[]\r\n\r\n // we reconstruct the 'Map' from string of arrays\r\n for (var c of data) {\r\n c.accessKeys = new Map(JSON.parse(((c as any).accessKeys)))\r\n }\r\n if (!result.ok) {\r\n throw new Error(`requestAccess error: not ok`)\r\n }\r\n return data\r\n }\r\n catch (err) {\r\n throw new Error(`requestAccess error: ${err}`)\r\n }\r\n }\r\n","/*\r\nCopyright 2024 Julio Fernandez\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nimport { Entity } from '@backstage/catalog-model';\r\nexport * from './Resources';\r\nexport * from './InterfacesFront';\r\nexport * from './Tools';\r\n\r\n/**\r\n * Kwirth annotation.\r\n */\r\nexport const ANNOTATION_KWIRTH_LOCATION = 'backstage.io/kubernetes-id';\r\n\r\n/**\r\n * Function to know if an entity has Kwirth.\r\n */\r\nexport const isKwirthAvailable = (entity: Entity) => {\r\n if (!entity.metadata.annotations) return false;\r\n return Boolean (entity.metadata.annotations[ANNOTATION_KWIRTH_LOCATION]);\r\n}\r\n"],"names":[],"mappings":";;AAKa,MAAA,UAAA,GAAa,OAAO,YAAA,EAA2B,QAAwC,KAAA;AAC5F,EAAI,IAAA;AACA,IAAA,MAAM,OAAU,GAAA,MAAM,YAAa,CAAA,UAAA,CAAW,QAAQ,CAAA;AACtD,IAAM,MAAA,SAAA,GAAY,GAAG,OAAO,CAAA,QAAA,CAAA;AAE5B,IAAA,MAAM,MAAS,GAAA,MAAM,QAAS,CAAA,KAAA,CAAM,SAAS,CAAA;AAC7C,IAAM,MAAA,IAAA,GAAO,MAAM,MAAA,CAAO,IAAK,EAAA;AAE/B,IAAI,IAAA,CAAC,OAAO,EAAI,EAAA;AACZ,MAAM,MAAA,IAAI,MAAM,CAA0B,wBAAA,CAAA,CAAA;AAAA;AAE9C,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA,WAET,GAAK,EAAA;AACR,IAAA,MAAM,IAAI,KAAA,CAAM,CAAqB,kBAAA,EAAA,GAAG,CAAE,CAAA,CAAA;AAAA;AAElD;AAEG,MAAM,gBAAgB,OAAO,YAAA,EAA2B,QAAmB,EAAA,MAAA,EAAe,SAAgB,MAAkE,KAAA;AAC3K,EAAI,IAAA;AACA,IAAA,MAAM,OAAU,GAAA,MAAM,YAAa,CAAA,UAAA,CAAW,QAAQ,CAAA;AACtD,IAAA,IAAI,SAAe,GAAA,IAAI,GAAK,CAAA,CAAA,EAAG,OAAO,CAAS,OAAA,CAAA,CAAA;AAC/C,IAAA,SAAA,CAAU,aAAa,MAAO,CAAA,QAAA,EAAS,MAAO,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA;AACvD,IAAU,SAAA,CAAA,YAAA,CAAa,MAAO,CAAA,SAAA,EAAU,OAAO,CAAA;AAE/C,IAAI,IAAA,OAAA,GAAQ,IAAK,CAAA,SAAA,CAAU,MAAM,CAAA;AACjC,IAAA,MAAM,MAAS,GAAA,MAAM,QAAS,CAAA,KAAA,CAAM,WAAW,EAAC,MAAA,EAAO,MAAQ,EAAA,IAAA,EAAK,SAAS,OAAQ,EAAA,EAAC,cAAe,EAAA,kBAAA,IAAoB,CAAA;AACzH,IAAM,MAAA,IAAA,GAAO,MAAM,MAAA,CAAO,IAAK,EAAA;AAG/B,IAAA,KAAA,IAAS,KAAK,IAAM,EAAA;AAChB,MAAA,CAAA,CAAE,aAAa,IAAI,GAAA,CAAI,KAAK,KAAQ,CAAA,CAAA,CAAU,UAAW,CAAC,CAAA;AAAA;AAE9D,IAAI,IAAA,CAAC,OAAO,EAAI,EAAA;AACZ,MAAM,MAAA,IAAI,MAAM,CAA6B,2BAAA,CAAA,CAAA;AAAA;AAEjD,IAAO,OAAA,IAAA;AAAA,WAEJ,GAAK,EAAA;AACR,IAAA,MAAM,IAAI,KAAA,CAAM,CAAwB,qBAAA,EAAA,GAAG,CAAE,CAAA,CAAA;AAAA;AAErD;;ACvBG,MAAM,0BAA6B,GAAA;AAK7B,MAAA,iBAAA,GAAoB,CAAC,MAAmB,KAAA;AACnD,EAAA,IAAI,CAAC,MAAA,CAAO,QAAS,CAAA,WAAA,EAAoB,OAAA,KAAA;AACzC,EAAA,OAAO,OAAS,CAAA,MAAA,CAAO,QAAS,CAAA,WAAA,CAAY,0BAA0B,CAAC,CAAA;AACzE;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entity } from '@backstage/catalog-model';
|
|
2
|
-
import { InstanceConfigScopeEnum, AccessKey } from '@jfvilas/kwirth-common';
|
|
2
|
+
import { InstanceConfigScopeEnum, AccessKey, InstanceMessageTypeEnum, SignalMessageLevelEnum } from '@jfvilas/kwirth-common';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @interface PodData contains data related on oaccessing one pod for doing someting
|
|
@@ -27,6 +27,20 @@ interface ClusterValidPods {
|
|
|
27
27
|
accessKeys: Map<InstanceConfigScopeEnum, AccessKey>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
interface ILogLine {
|
|
31
|
+
namespace: string;
|
|
32
|
+
pod: string;
|
|
33
|
+
container: string;
|
|
34
|
+
timestamp?: Date;
|
|
35
|
+
type: string;
|
|
36
|
+
text: string;
|
|
37
|
+
}
|
|
38
|
+
interface IStatusLine {
|
|
39
|
+
type: InstanceMessageTypeEnum;
|
|
40
|
+
level: SignalMessageLevelEnum;
|
|
41
|
+
text: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
30
44
|
/**
|
|
31
45
|
* Kwirth annotation.
|
|
32
46
|
*/
|
|
@@ -37,4 +51,4 @@ declare const ANNOTATION_KWIRTH_LOCATION = "backstage.io/kubernetes-id";
|
|
|
37
51
|
declare const isKwirthAvailable: (entity: Entity) => boolean;
|
|
38
52
|
|
|
39
53
|
export { ANNOTATION_KWIRTH_LOCATION, isKwirthAvailable };
|
|
40
|
-
export type { ClusterValidPods, PodData };
|
|
54
|
+
export type { ClusterValidPods, ILogLine, IStatusLine, PodData };
|
package/dist/index.esm.js
CHANGED
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["/*\r\nCopyright 2024 Julio Fernandez\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nimport { Entity } from '@backstage/catalog-model';\r\nexport * from './Resources';\r\n\r\n/**\r\n * Kwirth annotation.\r\n */\r\nexport const ANNOTATION_KWIRTH_LOCATION = 'backstage.io/kubernetes-id';\r\n\r\n/**\r\n * Function to know if an entity has Kwirth.\r\n */\r\nexport const isKwirthAvailable = (entity: Entity) => {\r\n if (!entity.metadata.annotations) return false;\r\n return Boolean (entity.metadata.annotations[ANNOTATION_KWIRTH_LOCATION]);\r\n}\r\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["/*\r\nCopyright 2024 Julio Fernandez\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nimport { Entity } from '@backstage/catalog-model';\r\nexport * from './Resources';\r\nexport * from './InterfacesFront';\r\nexport * from './Tools';\r\n\r\n/**\r\n * Kwirth annotation.\r\n */\r\nexport const ANNOTATION_KWIRTH_LOCATION = 'backstage.io/kubernetes-id';\r\n\r\n/**\r\n * Function to know if an entity has Kwirth.\r\n */\r\nexport const isKwirthAvailable = (entity: Entity) => {\r\n if (!entity.metadata.annotations) return false;\r\n return Boolean (entity.metadata.annotations[ANNOTATION_KWIRTH_LOCATION]);\r\n}\r\n"],"names":[],"mappings":";;AAuBO,MAAM,0BAA6B,GAAA;AAK7B,MAAA,iBAAA,GAAoB,CAAC,MAAmB,KAAA;AACnD,EAAA,IAAI,CAAC,MAAA,CAAO,QAAS,CAAA,WAAA,EAAoB,OAAA,KAAA;AACzC,EAAA,OAAO,OAAS,CAAA,MAAA,CAAO,QAAS,CAAA,WAAA,CAAY,0BAA0B,CAAC,CAAA;AACzE;;;;"}
|