@kyverno/backstage-plugin-policy-reporter-common 2.4.0 → 2.5.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,16 @@
1
1
  # @kyverno/backstage-plugin-policy-reporter-common
2
2
 
3
+ ## 2.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 256fb9a: Added source filtering to the PolicyReportsPage. Users can now filter the list of policy reports by selecting one or more sources from the selected cluster.
8
+ - 2f4ac45: Added policy filtering to the PolicyReportsPage. Users can now filter the list of policy reports by selecting one or more policies from the selected cluster.
9
+ - d598ade: Added category filtering to the PolicyReportsPage. Users can now filter the list of policy reports by selecting one or more categories from the selected cluster.
10
+ - a664d0c: Added kind filtering to the PolicyReportsPage. Users can now filter the list of policy reports by selecting one or more kinds from the selected cluster.
11
+ - 880eecc: Backstage version bump to v1.51.1
12
+ - 44c5238: Backstage version bump to v1.52.0
13
+
3
14
  ## 2.4.0
4
15
 
5
16
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -102,6 +102,26 @@ type TypedResponse<T> = Omit<Response, 'json'> & {
102
102
  interface RequestOptions {
103
103
  token?: string;
104
104
  }
105
+ /**
106
+ * @public
107
+ */
108
+ type GetCategories = {
109
+ query: {
110
+ environment: string;
111
+ sources?: Array<string>;
112
+ namespaces?: Array<string>;
113
+ };
114
+ };
115
+ /**
116
+ * @public
117
+ */
118
+ type GetKinds = {
119
+ query: {
120
+ environment: string;
121
+ sources?: Array<string>;
122
+ namespaces?: Array<string>;
123
+ };
124
+ };
105
125
  /**
106
126
  * @public
107
127
  */
@@ -134,6 +154,25 @@ type GetNamespaces = {
134
154
  policies?: Array<string>;
135
155
  };
136
156
  };
157
+ /**
158
+ * @public
159
+ */
160
+ type GetPolicies = {
161
+ query: {
162
+ environment: string;
163
+ sources?: Array<string>;
164
+ namespaces?: Array<string>;
165
+ categories?: Array<string>;
166
+ };
167
+ };
168
+ /**
169
+ * @public
170
+ */
171
+ type GetSources = {
172
+ query: {
173
+ environment: string;
174
+ };
175
+ };
137
176
  /**
138
177
  * @public
139
178
  */
@@ -148,6 +187,22 @@ declare class DefaultApiClient {
148
187
  fetch: typeof fetch;
149
188
  };
150
189
  });
190
+ /**
191
+ * List of all Categories with namespace scoped results
192
+ * Get categories
193
+ * @param environment - The environment entity reference (URL encoded)
194
+ * @param sources - Filter by a list of sources
195
+ * @param namespaces - Filter by a list of namespaces
196
+ */
197
+ getCategories(request: GetCategories, options?: RequestOptions): Promise<TypedResponse<Array<string>>>;
198
+ /**
199
+ * List of all Kubernetes resource kinds with namespace scoped results
200
+ * Get kinds
201
+ * @param environment - The environment entity reference (URL encoded)
202
+ * @param sources - Filter by a list of sources
203
+ * @param namespaces - Filter by a list of namespaces
204
+ */
205
+ getKinds(request: GetKinds, options?: RequestOptions): Promise<TypedResponse<Array<string>>>;
151
206
  /**
152
207
  * Retrieves policy results for a specific environment with optional filtering and pagination
153
208
  * Get namespaced policy results
@@ -176,6 +231,21 @@ declare class DefaultApiClient {
176
231
  * @param policies - Filter by a list of policies
177
232
  */
178
233
  getNamespaces(request: GetNamespaces, options?: RequestOptions): Promise<TypedResponse<Array<string>>>;
234
+ /**
235
+ * List of all Policies with namespace scoped results
236
+ * Get policies with namespaced policy results
237
+ * @param environment - The environment entity reference (URL encoded)
238
+ * @param sources - Filter by a list of sources
239
+ * @param namespaces - Filter by a list of namespaces
240
+ * @param categories - Filter by a list of categories
241
+ */
242
+ getPolicies(request: GetPolicies, options?: RequestOptions): Promise<TypedResponse<Array<string>>>;
243
+ /**
244
+ * List of all Sources with namespace scoped results
245
+ * Get sources
246
+ * @param environment - The environment entity reference (URL encoded)
247
+ */
248
+ getSources(request: GetSources, options?: RequestOptions): Promise<TypedResponse<Array<string>>>;
179
249
  }
180
250
 
181
251
  /**
@@ -255,4 +325,4 @@ interface RequestError {
255
325
  error: string;
256
326
  }
257
327
 
258
- export { DefaultApiClient, type Direction, type Environment, type Filter, type GetNamespacedResults, type GetNamespaces, KUBERNETES_NAMESPACE_ANNOTATION, KYVERNO_ENDPOINT_ANNOTATION, KYVERNO_KIND_ANNOTATION, KYVERNO_NAMESPACE_ANNOTATION, KYVERNO_RESOURCE_NAME_ANNOTATION, type ListResult, type Pagination, type RequestError, type RequestOptions, type ResultList, type Severity, type Status, type TypedResponse };
328
+ export { DefaultApiClient, type Direction, type Environment, type Filter, type GetCategories, type GetKinds, type GetNamespacedResults, type GetNamespaces, type GetPolicies, type GetSources, KUBERNETES_NAMESPACE_ANNOTATION, KYVERNO_ENDPOINT_ANNOTATION, KYVERNO_KIND_ANNOTATION, KYVERNO_NAMESPACE_ANNOTATION, KYVERNO_RESOURCE_NAME_ANNOTATION, type ListResult, type Pagination, type RequestError, type RequestOptions, type ResultList, type Severity, type Status, type TypedResponse };
@@ -34,6 +34,48 @@ class DefaultApiClient {
34
34
  this.discoveryApi = options.discoveryApi;
35
35
  this.fetchApi = options.fetchApi || { fetch: crossFetch__default.default };
36
36
  }
37
+ /**
38
+ * List of all Categories with namespace scoped results
39
+ * Get categories
40
+ * @param environment - The environment entity reference (URL encoded)
41
+ * @param sources - Filter by a list of sources
42
+ * @param namespaces - Filter by a list of namespaces
43
+ */
44
+ async getCategories(request, options) {
45
+ const baseUrl = await this.discoveryApi.getBaseUrl(pluginId.pluginId);
46
+ const uriTemplate = `/v1/namespaced-resources/categories{?environment,sources*,namespaces*}`;
47
+ const uri = parser__namespace.parse(uriTemplate).expand({
48
+ ...request.query
49
+ });
50
+ return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
51
+ headers: {
52
+ "Content-Type": "application/json",
53
+ ...options?.token && { Authorization: `Bearer ${options?.token}` }
54
+ },
55
+ method: "GET"
56
+ });
57
+ }
58
+ /**
59
+ * List of all Kubernetes resource kinds with namespace scoped results
60
+ * Get kinds
61
+ * @param environment - The environment entity reference (URL encoded)
62
+ * @param sources - Filter by a list of sources
63
+ * @param namespaces - Filter by a list of namespaces
64
+ */
65
+ async getKinds(request, options) {
66
+ const baseUrl = await this.discoveryApi.getBaseUrl(pluginId.pluginId);
67
+ const uriTemplate = `/v1/namespaced-resources/kinds{?environment,sources*,namespaces*}`;
68
+ const uri = parser__namespace.parse(uriTemplate).expand({
69
+ ...request.query
70
+ });
71
+ return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
72
+ headers: {
73
+ "Content-Type": "application/json",
74
+ ...options?.token && { Authorization: `Bearer ${options?.token}` }
75
+ },
76
+ method: "GET"
77
+ });
78
+ }
37
79
  /**
38
80
  * Retrieves policy results for a specific environment with optional filtering and pagination
39
81
  * Get namespaced policy results
@@ -88,6 +130,47 @@ class DefaultApiClient {
88
130
  method: "GET"
89
131
  });
90
132
  }
133
+ /**
134
+ * List of all Policies with namespace scoped results
135
+ * Get policies with namespaced policy results
136
+ * @param environment - The environment entity reference (URL encoded)
137
+ * @param sources - Filter by a list of sources
138
+ * @param namespaces - Filter by a list of namespaces
139
+ * @param categories - Filter by a list of categories
140
+ */
141
+ async getPolicies(request, options) {
142
+ const baseUrl = await this.discoveryApi.getBaseUrl(pluginId.pluginId);
143
+ const uriTemplate = `/v1/namespaced-resources/policies{?environment,sources*,namespaces*,categories*}`;
144
+ const uri = parser__namespace.parse(uriTemplate).expand({
145
+ ...request.query
146
+ });
147
+ return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
148
+ headers: {
149
+ "Content-Type": "application/json",
150
+ ...options?.token && { Authorization: `Bearer ${options?.token}` }
151
+ },
152
+ method: "GET"
153
+ });
154
+ }
155
+ /**
156
+ * List of all Sources with namespace scoped results
157
+ * Get sources
158
+ * @param environment - The environment entity reference (URL encoded)
159
+ */
160
+ async getSources(request, options) {
161
+ const baseUrl = await this.discoveryApi.getBaseUrl(pluginId.pluginId);
162
+ const uriTemplate = `/v1/namespaced-resources/sources{?environment}`;
163
+ const uri = parser__namespace.parse(uriTemplate).expand({
164
+ ...request.query
165
+ });
166
+ return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
167
+ headers: {
168
+ "Content-Type": "application/json",
169
+ ...options?.token && { Authorization: `Bearer ${options?.token}` }
170
+ },
171
+ method: "GET"
172
+ });
173
+ }
91
174
  }
92
175
 
93
176
  exports.DefaultApiClient = DefaultApiClient;
@@ -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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AAa,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
+ {"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// ******************************************************************\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 GetCategories = {\n query: {\n environment: string;\n sources?: Array<string>;\n namespaces?: Array<string>;\n };\n};\n/**\n * @public\n */\nexport type GetKinds = {\n query: {\n environment: string;\n sources?: Array<string>;\n namespaces?: Array<string>;\n };\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 * @public\n */\nexport type GetPolicies = {\n query: {\n environment: string;\n sources?: Array<string>;\n namespaces?: Array<string>;\n categories?: Array<string>;\n };\n};\n/**\n * @public\n */\nexport type GetSources = {\n query: {\n environment: 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 * List of all Categories with namespace scoped results\n * Get categories\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 */\n public async getCategories(\n // @ts-ignore\n request: GetCategories,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaced-resources/categories{?environment,sources*,namespaces*}`;\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 * List of all Kubernetes resource kinds with namespace scoped results\n * Get kinds\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 */\n public async getKinds(\n // @ts-ignore\n request: GetKinds,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaced-resources/kinds{?environment,sources*,namespaces*}`;\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 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 /**\n * List of all Policies with namespace scoped results\n * Get policies with 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 categories - Filter by a list of categories\n */\n public async getPolicies(\n // @ts-ignore\n request: GetPolicies,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaced-resources/policies{?environment,sources*,namespaces*,categories*}`;\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 * List of all Sources with namespace scoped results\n * Get sources\n * @param environment - The environment entity reference (URL encoded)\n */\n public async getSources(\n // @ts-ignore\n request: GetSources,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaced-resources/sources{?environment}`;\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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,KAAK,CAAA,CAAA;AAAG,OACpE;AAAA,MACA,MAAA,EAAQ;AAAA,KACT,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAa,UAAA,CAEX,OAAA,EACA,OAAA,EACuC;AACvC,IAAA,MAAM,OAAA,GAAU,MAAM,IAAA,CAAK,YAAA,CAAa,WAAWD,iBAAQ,CAAA;AAE3D,IAAA,MAAM,WAAA,GAAc,CAAA,8CAAA,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;;;;"}
@@ -9,6 +9,48 @@ class DefaultApiClient {
9
9
  this.discoveryApi = options.discoveryApi;
10
10
  this.fetchApi = options.fetchApi || { fetch: crossFetch };
11
11
  }
12
+ /**
13
+ * List of all Categories with namespace scoped results
14
+ * Get categories
15
+ * @param environment - The environment entity reference (URL encoded)
16
+ * @param sources - Filter by a list of sources
17
+ * @param namespaces - Filter by a list of namespaces
18
+ */
19
+ async getCategories(request, options) {
20
+ const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
21
+ const uriTemplate = `/v1/namespaced-resources/categories{?environment,sources*,namespaces*}`;
22
+ const uri = parser.parse(uriTemplate).expand({
23
+ ...request.query
24
+ });
25
+ return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
26
+ headers: {
27
+ "Content-Type": "application/json",
28
+ ...options?.token && { Authorization: `Bearer ${options?.token}` }
29
+ },
30
+ method: "GET"
31
+ });
32
+ }
33
+ /**
34
+ * List of all Kubernetes resource kinds with namespace scoped results
35
+ * Get kinds
36
+ * @param environment - The environment entity reference (URL encoded)
37
+ * @param sources - Filter by a list of sources
38
+ * @param namespaces - Filter by a list of namespaces
39
+ */
40
+ async getKinds(request, options) {
41
+ const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
42
+ const uriTemplate = `/v1/namespaced-resources/kinds{?environment,sources*,namespaces*}`;
43
+ const uri = parser.parse(uriTemplate).expand({
44
+ ...request.query
45
+ });
46
+ return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
47
+ headers: {
48
+ "Content-Type": "application/json",
49
+ ...options?.token && { Authorization: `Bearer ${options?.token}` }
50
+ },
51
+ method: "GET"
52
+ });
53
+ }
12
54
  /**
13
55
  * Retrieves policy results for a specific environment with optional filtering and pagination
14
56
  * Get namespaced policy results
@@ -63,6 +105,47 @@ class DefaultApiClient {
63
105
  method: "GET"
64
106
  });
65
107
  }
108
+ /**
109
+ * List of all Policies with namespace scoped results
110
+ * Get policies with namespaced policy results
111
+ * @param environment - The environment entity reference (URL encoded)
112
+ * @param sources - Filter by a list of sources
113
+ * @param namespaces - Filter by a list of namespaces
114
+ * @param categories - Filter by a list of categories
115
+ */
116
+ async getPolicies(request, options) {
117
+ const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
118
+ const uriTemplate = `/v1/namespaced-resources/policies{?environment,sources*,namespaces*,categories*}`;
119
+ const uri = parser.parse(uriTemplate).expand({
120
+ ...request.query
121
+ });
122
+ return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
123
+ headers: {
124
+ "Content-Type": "application/json",
125
+ ...options?.token && { Authorization: `Bearer ${options?.token}` }
126
+ },
127
+ method: "GET"
128
+ });
129
+ }
130
+ /**
131
+ * List of all Sources with namespace scoped results
132
+ * Get sources
133
+ * @param environment - The environment entity reference (URL encoded)
134
+ */
135
+ async getSources(request, options) {
136
+ const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
137
+ const uriTemplate = `/v1/namespaced-resources/sources{?environment}`;
138
+ const uri = parser.parse(uriTemplate).expand({
139
+ ...request.query
140
+ });
141
+ return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
142
+ headers: {
143
+ "Content-Type": "application/json",
144
+ ...options?.token && { Authorization: `Bearer ${options?.token}` }
145
+ },
146
+ method: "GET"
147
+ });
148
+ }
66
149
  }
67
150
 
68
151
  export { DefaultApiClient };
@@ -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,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,OAAO,UAAA,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,WAAW,QAAQ,CAAA;AAE3D,IAAA,MAAM,WAAA,GAAc,CAAA,iKAAA,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;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,WAAW,QAAQ,CAAA;AAE3D,IAAA,MAAM,WAAA,GAAc,CAAA,2DAAA,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
+ {"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// ******************************************************************\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 GetCategories = {\n query: {\n environment: string;\n sources?: Array<string>;\n namespaces?: Array<string>;\n };\n};\n/**\n * @public\n */\nexport type GetKinds = {\n query: {\n environment: string;\n sources?: Array<string>;\n namespaces?: Array<string>;\n };\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 * @public\n */\nexport type GetPolicies = {\n query: {\n environment: string;\n sources?: Array<string>;\n namespaces?: Array<string>;\n categories?: Array<string>;\n };\n};\n/**\n * @public\n */\nexport type GetSources = {\n query: {\n environment: 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 * List of all Categories with namespace scoped results\n * Get categories\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 */\n public async getCategories(\n // @ts-ignore\n request: GetCategories,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaced-resources/categories{?environment,sources*,namespaces*}`;\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 * List of all Kubernetes resource kinds with namespace scoped results\n * Get kinds\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 */\n public async getKinds(\n // @ts-ignore\n request: GetKinds,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaced-resources/kinds{?environment,sources*,namespaces*}`;\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 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 /**\n * List of all Policies with namespace scoped results\n * Get policies with 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 categories - Filter by a list of categories\n */\n public async getPolicies(\n // @ts-ignore\n request: GetPolicies,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaced-resources/policies{?environment,sources*,namespaces*,categories*}`;\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 * List of all Sources with namespace scoped results\n * Get sources\n * @param environment - The environment entity reference (URL encoded)\n */\n public async getSources(\n // @ts-ignore\n request: GetSources,\n options?: RequestOptions,\n ): Promise<TypedResponse<Array<string>>> {\n const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);\n\n const uriTemplate = `/v1/namespaced-resources/sources{?environment}`;\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":";;;;AA4GO,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,OAAO,UAAA,EAAW;AAAA,EAC1D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAa,aAAA,CAEX,OAAA,EACA,OAAA,EACuC;AACvC,IAAA,MAAM,OAAA,GAAU,MAAM,IAAA,CAAK,YAAA,CAAa,WAAW,QAAQ,CAAA;AAE3D,IAAA,MAAM,WAAA,GAAc,CAAA,sEAAA,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAa,QAAA,CAEX,OAAA,EACA,OAAA,EACuC;AACvC,IAAA,MAAM,OAAA,GAAU,MAAM,IAAA,CAAK,YAAA,CAAa,WAAW,QAAQ,CAAA;AAE3D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AE,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,EAOA,MAAa,UAAA,CAEX,OAAA,EACA,OAAA,EACuC;AACvC,IAAA,MAAM,OAAA,GAAU,MAAM,IAAA,CAAK,YAAA,CAAa,WAAW,QAAQ,CAAA;AAE3D,IAAA,MAAM,WAAA,GAAc,CAAA,8CAAA,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;;;;"}
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.4.0",
4
+ "version": "2.5.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -23,7 +23,8 @@
23
23
  "access": "public",
24
24
  "main": "dist/index.cjs.js",
25
25
  "module": "dist/index.esm.js",
26
- "types": "dist/index.d.ts"
26
+ "types": "dist/index.d.ts",
27
+ "provenance": true
27
28
  },
28
29
  "repository": {
29
30
  "type": "git",
@@ -40,7 +41,7 @@
40
41
  "postpack": "backstage-cli package postpack"
41
42
  },
42
43
  "devDependencies": {
43
- "@backstage/cli": "^0.36.1"
44
+ "@backstage/cli": "^0.36.3"
44
45
  },
45
46
  "files": [
46
47
  "dist"
@@ -56,5 +57,6 @@
56
57
  ]
57
58
  }
58
59
  },
59
- "module": "dist/index.esm.js"
60
+ "module": "dist/index.esm.js",
61
+ "provenance": true
60
62
  }