@kyverno/backstage-plugin-policy-reporter-common 2.2.0 → 2.4.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,17 @@
1
1
  # @kyverno/backstage-plugin-policy-reporter-common
2
2
 
3
+ ## 2.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e0e8462: Backstage verion bump to v1.50.4
8
+
9
+ ## 2.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 4b09f8c: Backstage verion bump to v1.48.5
14
+
3
15
  ## 2.2.0
4
16
 
5
17
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"annotations.cjs.js","sources":["../src/annotations.ts"],"sourcesContent":["// The resource to display policies\nexport const KYVERNO_RESOURCE_NAME_ANNOTATION = 'kyverno.io/resource-name';\n\n// The kind of the resource to display policies\nexport const KYVERNO_KIND_ANNOTATION = 'kyverno.io/kind';\n\n// The namespace of the resource to display policies\nexport const KYVERNO_NAMESPACE_ANNOTATION = 'kyverno.io/namespace';\n\n// The namespace of the resource to display policies\nexport const KUBERNETES_NAMESPACE_ANNOTATION =\n 'backstage.io/kubernetes-namespace';\n\n// The endpoint for the Policy Reporter API\n// EXAMPLE: https://kyverno.io/policy-reporter/api/\nexport const KYVERNO_ENDPOINT_ANNOTATION = 'kyverno.io/endpoint';\n"],"names":[],"mappings":";;AACO,MAAM,gCAAmC,GAAA;AAGzC,MAAM,uBAA0B,GAAA;AAGhC,MAAM,4BAA+B,GAAA;AAGrC,MAAM,+BACX,GAAA;AAIK,MAAM,2BAA8B,GAAA;;;;;;;;"}
1
+ {"version":3,"file":"annotations.cjs.js","sources":["../src/annotations.ts"],"sourcesContent":["// The resource to display policies\nexport const KYVERNO_RESOURCE_NAME_ANNOTATION = 'kyverno.io/resource-name';\n\n// The kind of the resource to display policies\nexport const KYVERNO_KIND_ANNOTATION = 'kyverno.io/kind';\n\n// The namespace of the resource to display policies\nexport const KYVERNO_NAMESPACE_ANNOTATION = 'kyverno.io/namespace';\n\n// The namespace of the resource to display policies\nexport const KUBERNETES_NAMESPACE_ANNOTATION =\n 'backstage.io/kubernetes-namespace';\n\n// The endpoint for the Policy Reporter API\n// EXAMPLE: https://kyverno.io/policy-reporter/api/\nexport const KYVERNO_ENDPOINT_ANNOTATION = 'kyverno.io/endpoint';\n"],"names":[],"mappings":";;AACO,MAAM,gCAAA,GAAmC;AAGzC,MAAM,uBAAA,GAA0B;AAGhC,MAAM,4BAAA,GAA+B;AAGrC,MAAM,+BAAA,GACX;AAIK,MAAM,2BAAA,GAA8B;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"annotations.esm.js","sources":["../src/annotations.ts"],"sourcesContent":["// The resource to display policies\nexport const KYVERNO_RESOURCE_NAME_ANNOTATION = 'kyverno.io/resource-name';\n\n// The kind of the resource to display policies\nexport const KYVERNO_KIND_ANNOTATION = 'kyverno.io/kind';\n\n// The namespace of the resource to display policies\nexport const KYVERNO_NAMESPACE_ANNOTATION = 'kyverno.io/namespace';\n\n// The namespace of the resource to display policies\nexport const KUBERNETES_NAMESPACE_ANNOTATION =\n 'backstage.io/kubernetes-namespace';\n\n// The endpoint for the Policy Reporter API\n// EXAMPLE: https://kyverno.io/policy-reporter/api/\nexport const KYVERNO_ENDPOINT_ANNOTATION = 'kyverno.io/endpoint';\n"],"names":[],"mappings":"AACO,MAAM,gCAAmC,GAAA;AAGzC,MAAM,uBAA0B,GAAA;AAGhC,MAAM,4BAA+B,GAAA;AAGrC,MAAM,+BACX,GAAA;AAIK,MAAM,2BAA8B,GAAA;;;;"}
1
+ {"version":3,"file":"annotations.esm.js","sources":["../src/annotations.ts"],"sourcesContent":["// The resource to display policies\nexport const KYVERNO_RESOURCE_NAME_ANNOTATION = 'kyverno.io/resource-name';\n\n// The kind of the resource to display policies\nexport const KYVERNO_KIND_ANNOTATION = 'kyverno.io/kind';\n\n// The namespace of the resource to display policies\nexport const KYVERNO_NAMESPACE_ANNOTATION = 'kyverno.io/namespace';\n\n// The namespace of the resource to display policies\nexport const KUBERNETES_NAMESPACE_ANNOTATION =\n 'backstage.io/kubernetes-namespace';\n\n// The endpoint for the Policy Reporter API\n// EXAMPLE: https://kyverno.io/policy-reporter/api/\nexport const KYVERNO_ENDPOINT_ANNOTATION = 'kyverno.io/endpoint';\n"],"names":[],"mappings":"AACO,MAAM,gCAAA,GAAmC;AAGzC,MAAM,uBAAA,GAA0B;AAGhC,MAAM,4BAAA,GAA+B;AAGrC,MAAM,+BAAA,GACX;AAIK,MAAM,2BAAA,GAA8B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Api.client.cjs.js","sources":["../../../../../src/schema/openapi/generated/apis/Api.client.ts"],"sourcesContent":["//\n\n// ******************************************************************\n// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *\n// ******************************************************************\nimport { DiscoveryApi } from '../types/discovery';\nimport { FetchApi } from '../types/fetch';\nimport crossFetch from 'cross-fetch';\nimport { pluginId } from '../pluginId';\nimport * as parser from 'uri-template';\nimport { Direction } from '../models/Direction.model';\nimport { ResultList } from '../models/ResultList.model';\nimport { Severity } from '../models/Severity.model';\nimport { Status } from '../models/Status.model';\n\n/**\n * Wraps the Response type to convey a type on the json call.\n *\n * @public\n */\nexport type TypedResponse<T> = Omit<Response, 'json'> & {\n json: () => Promise<T>;\n};\n\n/**\n * Options you can pass into a request for additional information.\n *\n * @public\n */\nexport interface RequestOptions {\n token?: string;\n}\n/**\n * @public\n */\nexport type GetNamespacedResults = {\n query: {\n environment: string;\n sources?: Array<string>;\n namespaces?: Array<string>;\n kinds?: Array<string>;\n resources?: Array<string>;\n categories?: Array<string>;\n policies?: Array<string>;\n status?: Array<Status>;\n severities?: Array<Severity>;\n search?: string;\n labels?: Array<string>;\n page?: number;\n offset?: number;\n direction?: Direction;\n };\n};\n/**\n * @public\n */\nexport type GetNamespaces = {\n query: {\n environment: string;\n sources?: Array<string>;\n categories?: Array<string>;\n policies?: Array<string>;\n };\n};\n\n/**\n * @public\n */\nexport class DefaultApiClient {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n\n constructor(options: {\n discoveryApi: { getBaseUrl(pluginId: string): Promise<string> };\n fetchApi?: { fetch: typeof fetch };\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi || { fetch: crossFetch };\n }\n\n /**\n * Retrieves policy results for a specific environment with optional filtering and pagination\n * Get namespaced policy results\n * @param environment - The environment entity reference (URL encoded)\n * @param sources - Filter by a list of sources\n * @param namespaces - Filter by a list of namespaces\n * @param kinds - Filter by a list of Kubernetes resource kinds\n * @param resources - Filter by a list of resources\n * @param categories - Filter by a list of categories\n * @param policies - Filter by a list of policies\n * @param status - Filter by policy result status\n * @param severities - Filter by severity levels\n * @param search - Search string to filter results\n * @param labels - Filter by label-value pairs\n * @param page - Requested list page number\n * @param offset - Number of results per page\n * @param direction - Sort direction for results\n */\n public async getNamespacedResults(\n // @ts-ignore\n request: GetNamespacedResults,\n options?: RequestOptions,\n ): Promise<TypedResponse<ResultList>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/namespaced-resources/results{?environment,sources*,namespaces*,kinds*,resources*,categories*,policies*,status*,severities*,search,labels*,page,offset,direction}`;\n\n const uri = parser.parse(uriTemplate).expand({\n ...request.query,\n });\n\n return await this.fetchApi.fetch(`${baseUrl}${uri}`, {\n headers: {\n 'Content-Type': 'application/json',\n ...(options?.token && { Authorization: `Bearer ${options?.token}` }),\n },\n method: 'GET',\n });\n }\n\n /**\n * Retrieves a list of namespaces from the policies\n * Get namespaces\n * @param environment - The environment entity reference (URL encoded)\n * @param sources - Filter by a list of sources\n * @param categories - Filter by a list of categories\n * @param policies - Filter by a list of policies\n */\n public async getNamespaces(\n // @ts-ignore\n request: GetNamespaces,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaces{?environment,sources*,categories*,policies*}`;\n\n const uri = parser.parse(uriTemplate).expand({\n ...request.query,\n });\n\n return await this.fetchApi.fetch(`${baseUrl}${uri}`, {\n headers: {\n 'Content-Type': 'application/json',\n ...(options?.token && { Authorization: `Bearer ${options?.token}` }),\n },\n method: 'GET',\n });\n }\n}\n"],"names":["crossFetch","pluginId","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEO,MAAM,gBAAiB,CAAA;AAAA,EACX,YAAA;AAAA,EACA,QAAA;AAAA,EAEjB,YAAY,OAGT,EAAA;AACD,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,YAAA;AAC5B,IAAA,IAAA,CAAK,QAAW,GAAA,OAAA,CAAQ,QAAY,IAAA,EAAE,OAAOA,2BAAW,EAAA;AAAA;AAC1D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBA,MAAa,oBAEX,CAAA,OAAA,EACA,OACoC,EAAA;AACpC,IAAA,MAAM,OAAU,GAAA,MAAM,IAAK,CAAA,YAAA,CAAa,WAAWC,iBAAQ,CAAA;AAE3D,IAAA,MAAM,WAAc,GAAA,CAAA,iKAAA,CAAA;AAEpB,IAAA,MAAM,GAAM,GAAAC,iBAAA,CAAO,KAAM,CAAA,WAAW,EAAE,MAAO,CAAA;AAAA,MAC3C,GAAG,OAAQ,CAAA;AAAA,KACZ,CAAA;AAED,IAAO,OAAA,MAAM,KAAK,QAAS,CAAA,KAAA,CAAM,GAAG,OAAO,CAAA,EAAG,GAAG,CAAI,CAAA,EAAA;AAAA,MACnD,OAAS,EAAA;AAAA,QACP,cAAgB,EAAA,kBAAA;AAAA,QAChB,GAAI,SAAS,KAAS,IAAA,EAAE,eAAe,CAAU,OAAA,EAAA,OAAA,EAAS,KAAK,CAAG,CAAA;AAAA,OACpE;AAAA,MACA,MAAQ,EAAA;AAAA,KACT,CAAA;AAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,aAEX,CAAA,OAAA,EACA,OACuC,EAAA;AACvC,IAAA,MAAM,OAAU,GAAA,MAAM,IAAK,CAAA,YAAA,CAAa,WAAWD,iBAAQ,CAAA;AAE3D,IAAA,MAAM,WAAc,GAAA,CAAA,2DAAA,CAAA;AAEpB,IAAA,MAAM,GAAM,GAAAC,iBAAA,CAAO,KAAM,CAAA,WAAW,EAAE,MAAO,CAAA;AAAA,MAC3C,GAAG,OAAQ,CAAA;AAAA,KACZ,CAAA;AAED,IAAO,OAAA,MAAM,KAAK,QAAS,CAAA,KAAA,CAAM,GAAG,OAAO,CAAA,EAAG,GAAG,CAAI,CAAA,EAAA;AAAA,MACnD,OAAS,EAAA;AAAA,QACP,cAAgB,EAAA,kBAAA;AAAA,QAChB,GAAI,SAAS,KAAS,IAAA,EAAE,eAAe,CAAU,OAAA,EAAA,OAAA,EAAS,KAAK,CAAG,CAAA;AAAA,OACpE;AAAA,MACA,MAAQ,EAAA;AAAA,KACT,CAAA;AAAA;AAEL;;;;"}
1
+ {"version":3,"file":"Api.client.cjs.js","sources":["../../../../../src/schema/openapi/generated/apis/Api.client.ts"],"sourcesContent":["//\n\n// ******************************************************************\n// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *\n// ******************************************************************\nimport { DiscoveryApi } from '../types/discovery';\nimport { FetchApi } from '../types/fetch';\nimport crossFetch from 'cross-fetch';\nimport { pluginId } from '../pluginId';\nimport * as parser from 'uri-template';\nimport { Direction } from '../models/Direction.model';\nimport { ResultList } from '../models/ResultList.model';\nimport { Severity } from '../models/Severity.model';\nimport { Status } from '../models/Status.model';\n\n/**\n * Wraps the Response type to convey a type on the json call.\n *\n * @public\n */\nexport type TypedResponse<T> = Omit<Response, 'json'> & {\n json: () => Promise<T>;\n};\n\n/**\n * Options you can pass into a request for additional information.\n *\n * @public\n */\nexport interface RequestOptions {\n token?: string;\n}\n/**\n * @public\n */\nexport type GetNamespacedResults = {\n query: {\n environment: string;\n sources?: Array<string>;\n namespaces?: Array<string>;\n kinds?: Array<string>;\n resources?: Array<string>;\n categories?: Array<string>;\n policies?: Array<string>;\n status?: Array<Status>;\n severities?: Array<Severity>;\n search?: string;\n labels?: Array<string>;\n page?: number;\n offset?: number;\n direction?: Direction;\n };\n};\n/**\n * @public\n */\nexport type GetNamespaces = {\n query: {\n environment: string;\n sources?: Array<string>;\n categories?: Array<string>;\n policies?: Array<string>;\n };\n};\n\n/**\n * @public\n */\nexport class DefaultApiClient {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n\n constructor(options: {\n discoveryApi: { getBaseUrl(pluginId: string): Promise<string> };\n fetchApi?: { fetch: typeof fetch };\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi || { fetch: crossFetch };\n }\n\n /**\n * Retrieves policy results for a specific environment with optional filtering and pagination\n * Get namespaced policy results\n * @param environment - The environment entity reference (URL encoded)\n * @param sources - Filter by a list of sources\n * @param namespaces - Filter by a list of namespaces\n * @param kinds - Filter by a list of Kubernetes resource kinds\n * @param resources - Filter by a list of resources\n * @param categories - Filter by a list of categories\n * @param policies - Filter by a list of policies\n * @param status - Filter by policy result status\n * @param severities - Filter by severity levels\n * @param search - Search string to filter results\n * @param labels - Filter by label-value pairs\n * @param page - Requested list page number\n * @param offset - Number of results per page\n * @param direction - Sort direction for results\n */\n public async getNamespacedResults(\n // @ts-ignore\n request: GetNamespacedResults,\n options?: RequestOptions,\n ): Promise<TypedResponse<ResultList>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/namespaced-resources/results{?environment,sources*,namespaces*,kinds*,resources*,categories*,policies*,status*,severities*,search,labels*,page,offset,direction}`;\n\n const uri = parser.parse(uriTemplate).expand({\n ...request.query,\n });\n\n return await this.fetchApi.fetch(`${baseUrl}${uri}`, {\n headers: {\n 'Content-Type': 'application/json',\n ...(options?.token && { Authorization: `Bearer ${options?.token}` }),\n },\n method: 'GET',\n });\n }\n\n /**\n * Retrieves a list of namespaces from the policies\n * Get namespaces\n * @param environment - The environment entity reference (URL encoded)\n * @param sources - Filter by a list of sources\n * @param categories - Filter by a list of categories\n * @param policies - Filter by a list of policies\n */\n public async getNamespaces(\n // @ts-ignore\n request: GetNamespaces,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaces{?environment,sources*,categories*,policies*}`;\n\n const uri = parser.parse(uriTemplate).expand({\n ...request.query,\n });\n\n return await this.fetchApi.fetch(`${baseUrl}${uri}`, {\n headers: {\n 'Content-Type': 'application/json',\n ...(options?.token && { Authorization: `Bearer ${options?.token}` }),\n },\n method: 'GET',\n });\n }\n}\n"],"names":["crossFetch","pluginId","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEO,MAAM,gBAAA,CAAiB;AAAA,EACX,YAAA;AAAA,EACA,QAAA;AAAA,EAEjB,YAAY,OAAA,EAGT;AACD,IAAA,IAAA,CAAK,eAAe,OAAA,CAAQ,YAAA;AAC5B,IAAA,IAAA,CAAK,QAAA,GAAW,OAAA,CAAQ,QAAA,IAAY,EAAE,OAAOA,2BAAA,EAAW;AAAA,EAC1D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBA,MAAa,oBAAA,CAEX,OAAA,EACA,OAAA,EACoC;AACpC,IAAA,MAAM,OAAA,GAAU,MAAM,IAAA,CAAK,YAAA,CAAa,WAAWC,iBAAQ,CAAA;AAE3D,IAAA,MAAM,WAAA,GAAc,CAAA,iKAAA,CAAA;AAEpB,IAAA,MAAM,GAAA,GAAMC,iBAAA,CAAO,KAAA,CAAM,WAAW,EAAE,MAAA,CAAO;AAAA,MAC3C,GAAG,OAAA,CAAQ;AAAA,KACZ,CAAA;AAED,IAAA,OAAO,MAAM,KAAK,QAAA,CAAS,KAAA,CAAM,GAAG,OAAO,CAAA,EAAG,GAAG,CAAA,CAAA,EAAI;AAAA,MACnD,OAAA,EAAS;AAAA,QACP,cAAA,EAAgB,kBAAA;AAAA,QAChB,GAAI,SAAS,KAAA,IAAS,EAAE,eAAe,CAAA,OAAA,EAAU,OAAA,EAAS,KAAK,CAAA,CAAA;AAAG,OACpE;AAAA,MACA,MAAA,EAAQ;AAAA,KACT,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,aAAA,CAEX,OAAA,EACA,OAAA,EACuC;AACvC,IAAA,MAAM,OAAA,GAAU,MAAM,IAAA,CAAK,YAAA,CAAa,WAAWD,iBAAQ,CAAA;AAE3D,IAAA,MAAM,WAAA,GAAc,CAAA,2DAAA,CAAA;AAEpB,IAAA,MAAM,GAAA,GAAMC,iBAAA,CAAO,KAAA,CAAM,WAAW,EAAE,MAAA,CAAO;AAAA,MAC3C,GAAG,OAAA,CAAQ;AAAA,KACZ,CAAA;AAED,IAAA,OAAO,MAAM,KAAK,QAAA,CAAS,KAAA,CAAM,GAAG,OAAO,CAAA,EAAG,GAAG,CAAA,CAAA,EAAI;AAAA,MACnD,OAAA,EAAS;AAAA,QACP,cAAA,EAAgB,kBAAA;AAAA,QAChB,GAAI,SAAS,KAAA,IAAS,EAAE,eAAe,CAAA,OAAA,EAAU,OAAA,EAAS,KAAK,CAAA,CAAA;AAAG,OACpE;AAAA,MACA,MAAA,EAAQ;AAAA,KACT,CAAA;AAAA,EACH;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Api.client.esm.js","sources":["../../../../../src/schema/openapi/generated/apis/Api.client.ts"],"sourcesContent":["//\n\n// ******************************************************************\n// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *\n// ******************************************************************\nimport { DiscoveryApi } from '../types/discovery';\nimport { FetchApi } from '../types/fetch';\nimport crossFetch from 'cross-fetch';\nimport { pluginId } from '../pluginId';\nimport * as parser from 'uri-template';\nimport { Direction } from '../models/Direction.model';\nimport { ResultList } from '../models/ResultList.model';\nimport { Severity } from '../models/Severity.model';\nimport { Status } from '../models/Status.model';\n\n/**\n * Wraps the Response type to convey a type on the json call.\n *\n * @public\n */\nexport type TypedResponse<T> = Omit<Response, 'json'> & {\n json: () => Promise<T>;\n};\n\n/**\n * Options you can pass into a request for additional information.\n *\n * @public\n */\nexport interface RequestOptions {\n token?: string;\n}\n/**\n * @public\n */\nexport type GetNamespacedResults = {\n query: {\n environment: string;\n sources?: Array<string>;\n namespaces?: Array<string>;\n kinds?: Array<string>;\n resources?: Array<string>;\n categories?: Array<string>;\n policies?: Array<string>;\n status?: Array<Status>;\n severities?: Array<Severity>;\n search?: string;\n labels?: Array<string>;\n page?: number;\n offset?: number;\n direction?: Direction;\n };\n};\n/**\n * @public\n */\nexport type GetNamespaces = {\n query: {\n environment: string;\n sources?: Array<string>;\n categories?: Array<string>;\n policies?: Array<string>;\n };\n};\n\n/**\n * @public\n */\nexport class DefaultApiClient {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n\n constructor(options: {\n discoveryApi: { getBaseUrl(pluginId: string): Promise<string> };\n fetchApi?: { fetch: typeof fetch };\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi || { fetch: crossFetch };\n }\n\n /**\n * Retrieves policy results for a specific environment with optional filtering and pagination\n * Get namespaced policy results\n * @param environment - The environment entity reference (URL encoded)\n * @param sources - Filter by a list of sources\n * @param namespaces - Filter by a list of namespaces\n * @param kinds - Filter by a list of Kubernetes resource kinds\n * @param resources - Filter by a list of resources\n * @param categories - Filter by a list of categories\n * @param policies - Filter by a list of policies\n * @param status - Filter by policy result status\n * @param severities - Filter by severity levels\n * @param search - Search string to filter results\n * @param labels - Filter by label-value pairs\n * @param page - Requested list page number\n * @param offset - Number of results per page\n * @param direction - Sort direction for results\n */\n public async getNamespacedResults(\n // @ts-ignore\n request: GetNamespacedResults,\n options?: RequestOptions,\n ): Promise<TypedResponse<ResultList>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/namespaced-resources/results{?environment,sources*,namespaces*,kinds*,resources*,categories*,policies*,status*,severities*,search,labels*,page,offset,direction}`;\n\n const uri = parser.parse(uriTemplate).expand({\n ...request.query,\n });\n\n return await this.fetchApi.fetch(`${baseUrl}${uri}`, {\n headers: {\n 'Content-Type': 'application/json',\n ...(options?.token && { Authorization: `Bearer ${options?.token}` }),\n },\n method: 'GET',\n });\n }\n\n /**\n * Retrieves a list of namespaces from the policies\n * Get namespaces\n * @param environment - The environment entity reference (URL encoded)\n * @param sources - Filter by a list of sources\n * @param categories - Filter by a list of categories\n * @param policies - Filter by a list of policies\n */\n public async getNamespaces(\n // @ts-ignore\n request: GetNamespaces,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaces{?environment,sources*,categories*,policies*}`;\n\n const uri = parser.parse(uriTemplate).expand({\n ...request.query,\n });\n\n return await this.fetchApi.fetch(`${baseUrl}${uri}`, {\n headers: {\n 'Content-Type': 'application/json',\n ...(options?.token && { Authorization: `Bearer ${options?.token}` }),\n },\n method: 'GET',\n });\n }\n}\n"],"names":[],"mappings":";;;;AAoEO,MAAM,gBAAiB,CAAA;AAAA,EACX,YAAA;AAAA,EACA,QAAA;AAAA,EAEjB,YAAY,OAGT,EAAA;AACD,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,YAAA;AAC5B,IAAA,IAAA,CAAK,QAAW,GAAA,OAAA,CAAQ,QAAY,IAAA,EAAE,OAAO,UAAW,EAAA;AAAA;AAC1D;AAAA;AAAA;A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AAAA,QAChB,GAAI,SAAS,KAAS,IAAA,EAAE,eAAe,CAAU,OAAA,EAAA,OAAA,EAAS,KAAK,CAAG,CAAA;AAAA,OACpE;AAAA,MACA,MAAQ,EAAA;AAAA,KACT,CAAA;AAAA;AAEL;;;;"}
1
+ {"version":3,"file":"Api.client.esm.js","sources":["../../../../../src/schema/openapi/generated/apis/Api.client.ts"],"sourcesContent":["//\n\n// ******************************************************************\n// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *\n// ******************************************************************\nimport { DiscoveryApi } from '../types/discovery';\nimport { FetchApi } from '../types/fetch';\nimport crossFetch from 'cross-fetch';\nimport { pluginId } from '../pluginId';\nimport * as parser from 'uri-template';\nimport { Direction } from '../models/Direction.model';\nimport { ResultList } from '../models/ResultList.model';\nimport { Severity } from '../models/Severity.model';\nimport { Status } from '../models/Status.model';\n\n/**\n * Wraps the Response type to convey a type on the json call.\n *\n * @public\n */\nexport type TypedResponse<T> = Omit<Response, 'json'> & {\n json: () => Promise<T>;\n};\n\n/**\n * Options you can pass into a request for additional information.\n *\n * @public\n */\nexport interface RequestOptions {\n token?: string;\n}\n/**\n * @public\n */\nexport type GetNamespacedResults = {\n query: {\n environment: string;\n sources?: Array<string>;\n namespaces?: Array<string>;\n kinds?: Array<string>;\n resources?: Array<string>;\n categories?: Array<string>;\n policies?: Array<string>;\n status?: Array<Status>;\n severities?: Array<Severity>;\n search?: string;\n labels?: Array<string>;\n page?: number;\n offset?: number;\n direction?: Direction;\n };\n};\n/**\n * @public\n */\nexport type GetNamespaces = {\n query: {\n environment: string;\n sources?: Array<string>;\n categories?: Array<string>;\n policies?: Array<string>;\n };\n};\n\n/**\n * @public\n */\nexport class DefaultApiClient {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n\n constructor(options: {\n discoveryApi: { getBaseUrl(pluginId: string): Promise<string> };\n fetchApi?: { fetch: typeof fetch };\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi || { fetch: crossFetch };\n }\n\n /**\n * Retrieves policy results for a specific environment with optional filtering and pagination\n * Get namespaced policy results\n * @param environment - The environment entity reference (URL encoded)\n * @param sources - Filter by a list of sources\n * @param namespaces - Filter by a list of namespaces\n * @param kinds - Filter by a list of Kubernetes resource kinds\n * @param resources - Filter by a list of resources\n * @param categories - Filter by a list of categories\n * @param policies - Filter by a list of policies\n * @param status - Filter by policy result status\n * @param severities - Filter by severity levels\n * @param search - Search string to filter results\n * @param labels - Filter by label-value pairs\n * @param page - Requested list page number\n * @param offset - Number of results per page\n * @param direction - Sort direction for results\n */\n public async getNamespacedResults(\n // @ts-ignore\n request: GetNamespacedResults,\n options?: RequestOptions,\n ): Promise<TypedResponse<ResultList>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/namespaced-resources/results{?environment,sources*,namespaces*,kinds*,resources*,categories*,policies*,status*,severities*,search,labels*,page,offset,direction}`;\n\n const uri = parser.parse(uriTemplate).expand({\n ...request.query,\n });\n\n return await this.fetchApi.fetch(`${baseUrl}${uri}`, {\n headers: {\n 'Content-Type': 'application/json',\n ...(options?.token && { Authorization: `Bearer ${options?.token}` }),\n },\n method: 'GET',\n });\n }\n\n /**\n * Retrieves a list of namespaces from the policies\n * Get namespaces\n * @param environment - The environment entity reference (URL encoded)\n * @param sources - Filter by a list of sources\n * @param categories - Filter by a list of categories\n * @param policies - Filter by a list of policies\n */\n public async getNamespaces(\n // @ts-ignore\n request: GetNamespaces,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaces{?environment,sources*,categories*,policies*}`;\n\n const uri = parser.parse(uriTemplate).expand({\n ...request.query,\n });\n\n return await this.fetchApi.fetch(`${baseUrl}${uri}`, {\n headers: {\n 'Content-Type': 'application/json',\n ...(options?.token && { Authorization: `Bearer ${options?.token}` }),\n },\n method: 'GET',\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AAA,CAAA;AAEpB,IAAA,MAAM,GAAA,GAAM,MAAA,CAAO,KAAA,CAAM,WAAW,EAAE,MAAA,CAAO;AAAA,MAC3C,GAAG,OAAA,CAAQ;AAAA,KACZ,CAAA;AAED,IAAA,OAAO,MAAM,KAAK,QAAA,CAAS,KAAA,CAAM,GAAG,OAAO,CAAA,EAAG,GAAG,CAAA,CAAA,EAAI;AAAA,MACnD,OAAA,EAAS;AAAA,QACP,cAAA,EAAgB,kBAAA;AAAA,QAChB,GAAI,SAAS,KAAA,IAAS,EAAE,eAAe,CAAA,OAAA,EAAU,OAAA,EAAS,KAAK,CAAA,CAAA;AAAG,OACpE;AAAA,MACA,MAAA,EAAQ;AAAA,KACT,CAAA;AAAA,EACH;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"pluginId.cjs.js","sources":["../../../../src/schema/openapi/generated/pluginId.ts"],"sourcesContent":["export const pluginId = 'policy-reporter';\n"],"names":[],"mappings":";;AAAO,MAAM,QAAW,GAAA;;;;"}
1
+ {"version":3,"file":"pluginId.cjs.js","sources":["../../../../src/schema/openapi/generated/pluginId.ts"],"sourcesContent":["export const pluginId = 'policy-reporter';\n"],"names":[],"mappings":";;AAAO,MAAM,QAAA,GAAW;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"pluginId.esm.js","sources":["../../../../src/schema/openapi/generated/pluginId.ts"],"sourcesContent":["export const pluginId = 'policy-reporter';\n"],"names":[],"mappings":"AAAO,MAAM,QAAW,GAAA;;;;"}
1
+ {"version":3,"file":"pluginId.esm.js","sources":["../../../../src/schema/openapi/generated/pluginId.ts"],"sourcesContent":["export const pluginId = 'policy-reporter';\n"],"names":[],"mappings":"AAAO,MAAM,QAAA,GAAW;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kyverno/backstage-plugin-policy-reporter-common",
3
3
  "description": "Common functionalities for the policy-reporter plugin",
4
- "version": "2.2.0",
4
+ "version": "2.4.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -40,7 +40,7 @@
40
40
  "postpack": "backstage-cli package postpack"
41
41
  },
42
42
  "devDependencies": {
43
- "@backstage/cli": "^0.34.3"
43
+ "@backstage/cli": "^0.36.1"
44
44
  },
45
45
  "files": [
46
46
  "dist"