@backstage/plugin-kubernetes-common 0.9.12-next.1 → 0.9.13-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,20 @@
1
1
  # @backstage/plugin-kubernetes-common
2
2
 
3
+ ## 0.9.13-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - d9a57de: Add `KubernetesWatcher` interface for streaming Kubernetes resource changes via an async iterator. The watcher is separated from `KubernetesFetcher` because watching is a long-lived streaming connection that only works with server-side auth providers. Watch supports all event types (ADDED, MODIFIED, DELETED, BOOKMARK, ERROR) with errors yielded as data rather than thrown.
8
+
9
+ ## 0.9.12
10
+
11
+ ### Patch Changes
12
+
13
+ - ab1cdbb: Removed a handful of internal imports that referenced the package by its own name. Value imports were switched to relative paths, and type-only imports to `import type`. These self-referential imports could trigger circular initialization errors in bundled ESM and when the package was loaded via `jest.requireActual` — most visibly `Cannot access '_AppRootElementBlueprintesm' before initialization` from `@backstage/frontend-plugin-api`. There are no user-facing API changes.
14
+ - Updated dependencies
15
+ - @backstage/catalog-model@1.9.0
16
+ - @backstage/plugin-permission-common@0.9.9
17
+
3
18
  ## 0.9.12-next.1
4
19
 
5
20
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -237,6 +237,55 @@ interface GroupedResponses extends DeploymentResources {
237
237
  persistentVolumes: V1PersistentVolume[];
238
238
  persistentVolumeClaims: V1PersistentVolumeClaim[];
239
239
  }
240
+ /**
241
+ * Kubernetes watch event types from the API
242
+ * @public
243
+ */
244
+ type KubernetesWatchEventType = 'ADDED' | 'MODIFIED' | 'DELETED' | 'BOOKMARK' | 'ERROR';
245
+ /**
246
+ * Watch event emitted by the Kubernetes watch stream
247
+ * @public
248
+ */
249
+ type KubernetesWatchEvent = {
250
+ type: Exclude<KubernetesWatchEventType, 'ERROR'>;
251
+ object: JsonObject;
252
+ resourceVersion?: string;
253
+ } | {
254
+ type: 'ERROR';
255
+ error: KubernetesFetchError;
256
+ };
257
+ /**
258
+ * Options for watching Kubernetes resources
259
+ * @public
260
+ */
261
+ interface KubernetesWatchOptions {
262
+ /** Namespace to watch resources in (optional for cluster-scoped resources) */
263
+ namespace?: string;
264
+ /** Label selector to filter resources */
265
+ labelSelector?: string;
266
+ /** Resource version to start watching from */
267
+ resourceVersion?: string;
268
+ /** Timeout in seconds for the watch operation */
269
+ timeoutSeconds?: number;
270
+ /** Allow watch bookmarks (for efficient resource version tracking) */
271
+ allowWatchBookmarks?: boolean;
272
+ /**
273
+ * When true, the watch stream begins with synthetic events that reproduce
274
+ * the current state of the collection, followed by a bookmark with the
275
+ * annotation `k8s.io/initial-events-end`. Requires `allowWatchBookmarks`
276
+ * and `resourceVersionMatch` set to `'NotOlderThan'`.
277
+ * See KEP-3157 (watch-list). Supported in Kubernetes 1.32+ (Beta).
278
+ */
279
+ sendInitialEvents?: boolean;
280
+ /**
281
+ * How the resourceVersion constraint is applied. Set to `'NotOlderThan'`
282
+ * when using `sendInitialEvents` so the server can serve from its watch
283
+ * cache rather than quorum-reading etcd.
284
+ */
285
+ resourceVersionMatch?: 'NotOlderThan' | 'Exact';
286
+ /** AbortSignal to cancel the watch from outside the iteration loop */
287
+ signal?: AbortSignal;
288
+ }
240
289
 
241
290
  /**
242
291
  * The annotation key used to identify Kubernetes resources in Backstage.
@@ -432,4 +481,4 @@ declare const detectErrors: (objects: ObjectsByEntityResponse$1) => DetectedErro
432
481
  declare const groupResponses: (fetchResponse: FetchResponse$1[]) => GroupedResponses;
433
482
 
434
483
  export { ANNOTATION_KUBERNETES_API_SERVER, ANNOTATION_KUBERNETES_API_SERVER_CA, ANNOTATION_KUBERNETES_AUTH_PROVIDER, ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE, ANNOTATION_KUBERNETES_AWS_CLUSTER_ID, ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID, ANNOTATION_KUBERNETES_DASHBOARD_APP, ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS, ANNOTATION_KUBERNETES_DASHBOARD_URL, ANNOTATION_KUBERNETES_OIDC_TOKEN_PROVIDER, ANNOTATION_KUBERNETES_SKIP_METRICS_LOOKUP, ANNOTATION_KUBERNETES_SKIP_TLS_VERIFY, KUBERNETES_ANNOTATION, KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION, SERVICEACCOUNT_CA_PATH, detectErrors, groupResponses, kubernetesClustersReadPermission, kubernetesPermissions, kubernetesProxyPermission, kubernetesResourcesReadPermission };
435
- export type { AuthProviderType, ClientContainerStatus, ClientCurrentResourceUsage, ClientPodStatus, ClusterAttributes, ClusterObjects, ConfigMapFetchResponse, CronJobsFetchResponse, CustomObjectsByEntityRequest, CustomResourceFetchResponse, CustomResourceMatcher, DaemonSetsFetchResponse, DeploymentFetchResponse, DeploymentResources, DetectedError, DetectedErrorsByCluster, DocsSolution, ErrorMapper, ErrorSeverity, EventsSolution, FetchResponse, GroupedResponses, HorizontalPodAutoscalersFetchResponse, IngressesFetchResponse, JobsFetchResponse, KubernetesErrorTypes, KubernetesFetchError, KubernetesRequestAuth, KubernetesRequestBody, LimitRangeFetchResponse, LogSolution, ObjectsByEntityResponse, PersistentVolumeClaimsFetchResponse, PersistentVolumeFetchResponse, PodFetchResponse, PodStatusFetchResponse, ProposedFix, ProposedFixBase, RawFetchError, ReplicaSetsFetchResponse, ResourceQuotaFetchResponse, ResourceRef, SecretFetchResponse, SecretsFetchResponse, ServiceFetchResponse, StatefulSetsFetchResponse, StatusError, WorkloadsByEntityRequest };
484
+ export type { AuthProviderType, ClientContainerStatus, ClientCurrentResourceUsage, ClientPodStatus, ClusterAttributes, ClusterObjects, ConfigMapFetchResponse, CronJobsFetchResponse, CustomObjectsByEntityRequest, CustomResourceFetchResponse, CustomResourceMatcher, DaemonSetsFetchResponse, DeploymentFetchResponse, DeploymentResources, DetectedError, DetectedErrorsByCluster, DocsSolution, ErrorMapper, ErrorSeverity, EventsSolution, FetchResponse, GroupedResponses, HorizontalPodAutoscalersFetchResponse, IngressesFetchResponse, JobsFetchResponse, KubernetesErrorTypes, KubernetesFetchError, KubernetesRequestAuth, KubernetesRequestBody, KubernetesWatchEvent, KubernetesWatchEventType, KubernetesWatchOptions, LimitRangeFetchResponse, LogSolution, ObjectsByEntityResponse, PersistentVolumeClaimsFetchResponse, PersistentVolumeFetchResponse, PodFetchResponse, PodStatusFetchResponse, ProposedFix, ProposedFixBase, RawFetchError, ReplicaSetsFetchResponse, ResourceQuotaFetchResponse, ResourceRef, SecretFetchResponse, SecretsFetchResponse, ServiceFetchResponse, StatefulSetsFetchResponse, StatusError, WorkloadsByEntityRequest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-kubernetes-common",
3
- "version": "0.9.12-next.1",
3
+ "version": "0.9.13-next.0",
4
4
  "description": "Common functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend plugin",
5
5
  "backstage": {
6
6
  "role": "common-library",
@@ -52,8 +52,8 @@
52
52
  ]
53
53
  },
54
54
  "dependencies": {
55
- "@backstage/catalog-model": "1.8.1-next.1",
56
- "@backstage/plugin-permission-common": "0.9.9-next.1",
55
+ "@backstage/catalog-model": "1.10.0",
56
+ "@backstage/plugin-permission-common": "0.9.10",
57
57
  "@backstage/types": "1.2.2",
58
58
  "@kubernetes/client-node": "1.4.0",
59
59
  "kubernetes-models": "^4.3.1",
@@ -61,7 +61,7 @@
61
61
  "luxon": "^3.0.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@backstage/cli": "0.36.2-next.1"
64
+ "@backstage/cli": "0.36.6-next.0"
65
65
  },
66
66
  "typesVersions": {
67
67
  "*": {