kubernetes-fluent-client 3.6.0 → 3.6.2
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/dist/cli.js +6 -4
- package/dist/fluent/index.d.ts +3 -3
- package/dist/fluent/index.d.ts.map +1 -1
- package/dist/fluent/index.js +7 -7
- package/dist/fluent/shared-types.d.ts +1 -1
- package/dist/fluent/shared-types.d.ts.map +1 -1
- package/dist/fluent/types.d.ts +3 -3
- package/dist/fluent/types.d.ts.map +1 -1
- package/dist/fluent/utils.d.ts +2 -2
- package/dist/fluent/utils.d.ts.map +1 -1
- package/dist/fluent/utils.js +3 -3
- package/dist/fluent/watch.d.ts +2 -2
- package/dist/fluent/watch.d.ts.map +1 -1
- package/dist/fluent/watch.js +3 -3
- package/dist/generate.d.ts +2 -2
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +3 -3
- package/dist/index.d.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/kinds.d.ts +1 -1
- package/dist/kinds.d.ts.map +1 -1
- package/dist/normalization.d.ts +1 -1
- package/dist/normalization.d.ts.map +1 -1
- package/dist/postProcessing.d.ts +2 -2
- package/dist/postProcessing.d.ts.map +1 -1
- package/dist/postProcessing.js +8 -4
- package/dist/upstream.d.ts +1 -1
- package/dist/upstream.d.ts.map +1 -1
- package/dist/upstream.js +1 -1
- package/package.json +7 -9
- package/src/cli.ts +6 -4
- package/src/fluent/index.ts +9 -9
- package/src/fluent/shared-types.ts +1 -1
- package/src/fluent/types.ts +3 -3
- package/src/fluent/utils.ts +4 -4
- package/src/fluent/watch.ts +10 -4
- package/src/generate.ts +4 -4
- package/src/index.ts +10 -10
- package/src/kinds.ts +1 -1
- package/src/normalization.ts +1 -1
- package/src/postProcessing.ts +17 -6
- package/src/upstream.ts +1 -1
package/dist/cli.js
CHANGED
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: 2023-Present The Kubernetes Fluent Client Authors
|
|
4
4
|
import { hideBin } from "yargs/helpers";
|
|
5
5
|
import yargs from "yargs/yargs";
|
|
6
|
-
import { generate } from "./generate";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { generate } from "./generate.js";
|
|
7
|
+
import { postProcessing } from "./postProcessing.js";
|
|
8
|
+
import { createRequire } from "node:module";
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
const { version } = require("../package.json");
|
|
9
11
|
void yargs(hideBin(process.argv))
|
|
10
|
-
.version("version", "Display version number",
|
|
12
|
+
.version("version", "Display version number", `${version}`)
|
|
11
13
|
.alias("version", "V")
|
|
12
14
|
.command("crd [source] [directory]", "generate usable types from a K8s CRD", yargs => {
|
|
13
15
|
return yargs
|
package/dist/fluent/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { KubernetesObject } from "@kubernetes/client-node";
|
|
2
|
-
import { GenericClass } from "../types";
|
|
3
|
-
import { K8sInit } from "./types";
|
|
4
|
-
import { Filters } from "./shared-types";
|
|
2
|
+
import { GenericClass } from "../types.js";
|
|
3
|
+
import { K8sInit } from "./types.js";
|
|
4
|
+
import { Filters } from "./shared-types.js";
|
|
5
5
|
/**
|
|
6
6
|
* Kubernetes fluent API inspired by Kubectl. Pass in a model, then call filters and actions on it.
|
|
7
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fluent/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAwB,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAOjF,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fluent/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAwB,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAOjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAS,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAuC,MAAM,mBAAmB,CAAC;AAKjF;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC,EACtF,KAAK,EAAE,CAAC,EACR,OAAO,GAAE,OAAY,GACpB,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAyRf"}
|
package/dist/fluent/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// SPDX-FileCopyrightText: 2023-Present The Kubernetes Fluent Client Authors
|
|
3
3
|
import { StatusCodes } from "http-status-codes";
|
|
4
|
-
import { fetch } from "../fetch";
|
|
5
|
-
import { modelToGroupVersionKind } from "../kinds";
|
|
6
|
-
import { FetchMethods } from "./shared-types";
|
|
7
|
-
import { k8sCfg, k8sExec } from "./utils";
|
|
8
|
-
import { Watcher } from "./watch";
|
|
9
|
-
import { hasLogs } from "../helpers";
|
|
10
|
-
import { Pod } from "../upstream";
|
|
4
|
+
import { fetch } from "../fetch.js";
|
|
5
|
+
import { modelToGroupVersionKind } from "../kinds.js";
|
|
6
|
+
import { FetchMethods } from "./shared-types.js";
|
|
7
|
+
import { k8sCfg, k8sExec } from "./utils.js";
|
|
8
|
+
import { Watcher } from "./watch.js";
|
|
9
|
+
import { hasLogs } from "../helpers.js";
|
|
10
|
+
import { Pod } from "../upstream.js";
|
|
11
11
|
/**
|
|
12
12
|
* Kubernetes fluent API inspired by Kubectl. Pass in a model, then call filters and actions on it.
|
|
13
13
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-types.d.ts","sourceRoot":"","sources":["../../src/fluent/shared-types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":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;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB"}
|
package/dist/fluent/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { KubernetesListObject, KubernetesObject } from "@kubernetes/client-node";
|
|
2
2
|
import { Operation } from "fast-json-patch";
|
|
3
3
|
import type { PartialDeep } from "type-fest";
|
|
4
|
-
import { GenericClass } from "../types";
|
|
5
|
-
import { WatchCfg, Watcher } from "./watch";
|
|
4
|
+
import { GenericClass } from "../types.js";
|
|
5
|
+
import { WatchCfg, Watcher } from "./watch.js";
|
|
6
6
|
import https from "https";
|
|
7
7
|
import { SecureClientSessionOptions } from "http2";
|
|
8
|
-
import { WatchAction, FetchMethods, ApplyCfg } from "./shared-types";
|
|
8
|
+
import { WatchAction, FetchMethods, ApplyCfg } from "./shared-types.js";
|
|
9
9
|
export type WatcherType<T extends GenericClass> = Watcher<T>;
|
|
10
10
|
/**
|
|
11
11
|
* Agent options for the the http2Watch
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/fluent/types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/fluent/types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE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E,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAClE,CAAC;AAEF,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,gBAAgB,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAC5F,oBAAoB,CAAC,CAAC,CAAC,GAAG;IACxB;;;;;OAKG;IACH,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC1D,CAAC;AAGJ,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,MAAM,GACvC,CAAC,SAAS,MAAM,GAAG,MAAM,GACvB,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,EAAE,GACpC,KAAK,GACP,KAAK,CAAC;AAEV,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAC7D,KAAK,GACL,CAAC,SAAS,MAAM,GACd;KACG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK;CACpF,CAAC,MAAM,CAAC,CAAC,GACV,EAAE,CAAC"}
|
package/dist/fluent/utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RequestInit } from "node-fetch";
|
|
2
2
|
import { URL } from "url";
|
|
3
3
|
import { Dispatcher } from "undici";
|
|
4
|
-
import { GenericClass } from "../types";
|
|
5
|
-
import { ApplyCfg, Filters, K8sConfigPromise, FetchMethods } from "./shared-types";
|
|
4
|
+
import { GenericClass } from "../types.js";
|
|
5
|
+
import { ApplyCfg, Filters, K8sConfigPromise, FetchMethods } from "./shared-types.js";
|
|
6
6
|
/**
|
|
7
7
|
* Get the headers for a request
|
|
8
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fluent/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAS,UAAU,EAAE,MAAM,QAAQ,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fluent/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAS,UAAU,EAAE,MAAM,QAAQ,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMtF;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkBvF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,CAqBvE;AACD;;;;GAIG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMvD;AACD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,YAAY,EAChD,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,OAAO,EAChB,WAAW,UAAQ,OAwDpB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CA+BnE;AASD;;;;;;;;;;GAUG;AACH,wBAAsB,OAAO,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,EACrD,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,EACrB,QAAQ,GAAE,QAA2B,cA+DtC"}
|
package/dist/fluent/utils.js
CHANGED
|
@@ -4,9 +4,9 @@ import { KubeConfig, PatchStrategy } from "@kubernetes/client-node";
|
|
|
4
4
|
import { URL } from "url";
|
|
5
5
|
import { Agent } from "undici";
|
|
6
6
|
import { Agent as httpsAgent } from "https";
|
|
7
|
-
import { fetch } from "../fetch";
|
|
8
|
-
import { modelToGroupVersionKind } from "../kinds";
|
|
9
|
-
import { FetchMethods } from "./shared-types";
|
|
7
|
+
import { fetch } from "../fetch.js";
|
|
8
|
+
import { modelToGroupVersionKind } from "../kinds.js";
|
|
9
|
+
import { FetchMethods } from "./shared-types.js";
|
|
10
10
|
import fs from "fs";
|
|
11
11
|
const SSA_CONTENT_TYPE = "application/apply-patch+yaml";
|
|
12
12
|
const K8S_SA_TOKEN_PATH = "/var/run/secrets/kubernetes.io/serviceaccount/token";
|
package/dist/fluent/watch.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from "events";
|
|
2
|
-
import { GenericClass } from "../types";
|
|
3
|
-
import { WatchAction, Filters } from "./shared-types";
|
|
2
|
+
import { GenericClass } from "../types.js";
|
|
3
|
+
import { WatchAction, Filters } from "./shared-types.js";
|
|
4
4
|
export declare enum WatchEvent {
|
|
5
5
|
/** Watch is connected successfully */
|
|
6
6
|
CONNECT = "connect",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/fluent/watch.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,EAAE,YAAY,EAAwB,MAAM,
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/fluent/watch.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,EAAE,YAAY,EAAwB,MAAM,aAAa,CAAC;AAGjE,OAAO,EAGL,WAAW,EACX,OAAO,EAER,MAAM,mBAAmB,CAAC;AAC3B,oBAAY,UAAU;IACpB,sCAAsC;IACtC,OAAO,YAAY;IACnB,2BAA2B;IAC3B,aAAa,kBAAkB;IAC/B,kDAAkD;IAClD,UAAU,eAAe;IACzB,0BAA0B;IAC1B,SAAS,cAAc;IACvB,8BAA8B;IAC9B,OAAO,YAAY;IACnB,sBAAsB;IACtB,KAAK,UAAU;IACf,mCAAmC;IACnC,IAAI,SAAS;IACb,wCAAwC;IACxC,oBAAoB,yBAAyB;IAC7C,qCAAqC;IACrC,iBAAiB,sBAAsB;IACvC,kCAAkC;IAClC,IAAI,SAAS;IACb,2BAA2B;IAC3B,UAAU,eAAe;IACzB,mBAAmB;IACnB,UAAU,eAAe;IACzB,qCAAqC;IACrC,wBAAwB,6BAA6B;IACrD,iCAAiC;IACjC,eAAe,oBAAoB;CACpC;AAED,4CAA4C;AAC5C,MAAM,MAAM,QAAQ,GAAG;IACrB,+HAA+H;IAC/H,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+FAA+F;IAC/F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wHAAwH;IACxH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAKF,iDAAiD;AACjD,qBAAa,OAAO,CAAC,CAAC,SAAS,YAAY;;IAyBzC,YAAY,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC;IAc9B;;;;;;;;;;;OAWG;gBACS,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAE,QAAa;IA0CzF;;;;OAIG;IACU,KAAK,IAAI,OAAO,CAAC,eAAe,CAAC;IAO9C,gGAAgG;IACzF,KAAK;IAQZ;;;;;;OAMG;IACH,IAAW,MAAM,IAAI,YAAY,CAEhC;CA0VF"}
|
package/dist/fluent/watch.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// SPDX-FileCopyrightText: 2023-Present The Kubernetes Fluent Client Authors
|
|
3
3
|
import { EventEmitter } from "events";
|
|
4
4
|
import { fetch } from "undici";
|
|
5
|
-
import { fetch as wrappedFetch } from "../fetch";
|
|
6
|
-
import { k8sCfg, pathBuilder, getHeaders } from "./utils";
|
|
5
|
+
import { fetch as wrappedFetch } from "../fetch.js";
|
|
6
|
+
import { k8sCfg, pathBuilder, getHeaders } from "./utils.js";
|
|
7
7
|
import { Readable } from "stream";
|
|
8
|
-
import { WatchPhase, FetchMethods } from "./shared-types";
|
|
8
|
+
import { WatchPhase, FetchMethods, } from "./shared-types.js";
|
|
9
9
|
export var WatchEvent;
|
|
10
10
|
(function (WatchEvent) {
|
|
11
11
|
/** Watch is connected successfully */
|
package/dist/generate.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputData, TargetLanguage } from "quicktype-core";
|
|
2
|
-
import { CustomResourceDefinition } from "./upstream";
|
|
3
|
-
import { LogFn } from "./types";
|
|
2
|
+
import { CustomResourceDefinition } from "./upstream.js";
|
|
3
|
+
import { LogFn } from "./types.js";
|
|
4
4
|
export interface GenerateOptions {
|
|
5
5
|
source: string;
|
|
6
6
|
directory?: string;
|
package/dist/generate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,SAAS,EAET,cAAc,EAEf,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,SAAS,EAET,cAAc,EAEf,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,wBAAwB,EAC7B,IAAI,EAAE,eAAe,GACpB,OAAO,CACR;IACE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,wBAAwB,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,EAAE,CACJ,CAuCA;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAYvF;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAW3E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,MAAM,GAAG,cAAc,GAChC,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC,CA0B/F;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI,CAMtD;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAC5D;IACE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,wBAAwB,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,EAAE,CACJ,CA8BA"}
|
package/dist/generate.js
CHANGED
|
@@ -4,9 +4,9 @@ import { loadAllYaml } from "@kubernetes/client-node";
|
|
|
4
4
|
import * as fs from "fs";
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import { FetchingJSONSchemaStore, InputData, JSONSchemaInput, quicktype, } from "quicktype-core";
|
|
7
|
-
import { fetch } from "./fetch";
|
|
8
|
-
import { K8s } from "./fluent";
|
|
9
|
-
import { CustomResourceDefinition } from "./upstream";
|
|
7
|
+
import { fetch } from "./fetch.js";
|
|
8
|
+
import { K8s } from "./fluent/index.js";
|
|
9
|
+
import { CustomResourceDefinition } from "./upstream.js";
|
|
10
10
|
/**
|
|
11
11
|
* Converts a CustomResourceDefinition to TypeScript types
|
|
12
12
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "./patch";
|
|
2
|
-
import * as kind from "./upstream";
|
|
1
|
+
import "./patch.js";
|
|
2
|
+
import * as kind from "./upstream.js";
|
|
3
3
|
/** kind is a collection of K8s types to be used within a K8s call: `K8s(kind.Secret).Apply({})`. */
|
|
4
4
|
export { kind };
|
|
5
|
-
export { fetch } from "./fetch";
|
|
5
|
+
export { fetch } from "./fetch.js";
|
|
6
6
|
export { StatusCodes as fetchStatus } from "http-status-codes";
|
|
7
|
-
export { WatchCfg, WatchEvent } from "./fluent/watch";
|
|
8
|
-
export { K8s } from "./fluent";
|
|
9
|
-
export { RegisterKind, modelToGroupVersionKind } from "./kinds";
|
|
10
|
-
export { GenericKind } from "./types";
|
|
11
|
-
export * from "./types";
|
|
12
|
-
export * as models from "@kubernetes/client-node/dist/gen/models/all";
|
|
13
|
-
export { fromEnv, waitForCluster } from "./helpers";
|
|
7
|
+
export { WatchCfg, WatchEvent } from "./fluent/watch.js";
|
|
8
|
+
export { K8s } from "./fluent/index.js";
|
|
9
|
+
export { RegisterKind, modelToGroupVersionKind } from "./kinds.js";
|
|
10
|
+
export { GenericKind } from "./types.js";
|
|
11
|
+
export * from "./types.js";
|
|
12
|
+
export * as models from "@kubernetes/client-node/dist/gen/models/all.js";
|
|
13
|
+
export { fromEnv, waitForCluster } from "./helpers.js";
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,CAAC;AAGpB,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,oGAAoG;AACpG,OAAO,EAAE,IAAI,EAAE,CAAC;AAGhB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAGnE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,cAAc,YAAY,CAAC;AAG3B,OAAO,KAAK,MAAM,MAAM,gDAAgD,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// SPDX-FileCopyrightText: 2023-Present The Kubernetes Fluent Client Authors
|
|
3
|
-
import "./patch";
|
|
3
|
+
import "./patch.js";
|
|
4
4
|
// Export kinds as a single object
|
|
5
|
-
import * as kind from "./upstream";
|
|
5
|
+
import * as kind from "./upstream.js";
|
|
6
6
|
/** kind is a collection of K8s types to be used within a K8s call: `K8s(kind.Secret).Apply({})`. */
|
|
7
7
|
export { kind };
|
|
8
8
|
// Export the node-fetch wrapper
|
|
9
|
-
export { fetch } from "./fetch";
|
|
9
|
+
export { fetch } from "./fetch.js";
|
|
10
10
|
// Export the HTTP status codes
|
|
11
11
|
export { StatusCodes as fetchStatus } from "http-status-codes";
|
|
12
12
|
// Export the Watch Config and Event types
|
|
13
|
-
export { WatchEvent } from "./fluent/watch";
|
|
13
|
+
export { WatchEvent } from "./fluent/watch.js";
|
|
14
14
|
// Export the fluent API entrypoint
|
|
15
|
-
export { K8s } from "./fluent";
|
|
15
|
+
export { K8s } from "./fluent/index.js";
|
|
16
16
|
// Export helpers for working with K8s types
|
|
17
|
-
export { RegisterKind, modelToGroupVersionKind } from "./kinds";
|
|
17
|
+
export { RegisterKind, modelToGroupVersionKind } from "./kinds.js";
|
|
18
18
|
// Export the GenericKind interface for CRD registration
|
|
19
|
-
export { GenericKind } from "./types";
|
|
20
|
-
export * from "./types";
|
|
19
|
+
export { GenericKind } from "./types.js";
|
|
20
|
+
export * from "./types.js";
|
|
21
21
|
// Export the upstream raw models
|
|
22
|
-
export * as models from "@kubernetes/client-node/dist/gen/models/all";
|
|
23
|
-
export { fromEnv, waitForCluster } from "./helpers";
|
|
22
|
+
export * as models from "@kubernetes/client-node/dist/gen/models/all.js";
|
|
23
|
+
export { fromEnv, waitForCluster } from "./helpers.js";
|
package/dist/kinds.d.ts
CHANGED
package/dist/kinds.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAukB5D;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAErE;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,YAAY,EAAE,kBAAkB,gBAAgB,SAUnF,CAAC"}
|
package/dist/normalization.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalization.d.ts","sourceRoot":"","sources":["../src/normalization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"normalization.d.ts","sourceRoot":"","sources":["../src/normalization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAE9D;AAED;;;;;GAKG;AACH,w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G;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIvD"}
|
package/dist/postProcessing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GenerateOptions } from "./generate";
|
|
2
|
-
import { CustomResourceDefinition } from "./upstream";
|
|
1
|
+
import { GenerateOptions } from "./generate.js";
|
|
2
|
+
import { CustomResourceDefinition } from "./upstream.js";
|
|
3
3
|
type CRDResult = {
|
|
4
4
|
name: string;
|
|
5
5
|
crd: CustomResourceDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postProcessing.d.ts","sourceRoot":"","sources":["../src/postProcessing.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"postProcessing.d.ts","sourceRoot":"","sources":["../src/postProcessing.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAMzD,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,wBAAwB,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAIvF;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,iBAalF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAahF;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,MAAM,EAAE,EACf,aAAa,EAAE,MAAM,CAAC,MAAM,E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AAE,GAAG,CAAC,MAAM,CAAC,GAC3B,kBAAkB,CAgBpB;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,QAGpF"}
|
package/dist/postProcessing.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-FileCopyrightText: 2023-Present The Kubernetes Fluent Client Authors
|
|
3
3
|
import * as fs from "fs";
|
|
4
4
|
import * as path from "path";
|
|
5
|
-
import { GenericKind } from "./types";
|
|
6
|
-
import { modifyAndNormalizeClassProperties, normalizeIndentationAndSpacing } from "./normalization";
|
|
5
|
+
import { GenericKind } from "./types.js";
|
|
6
|
+
import { modifyAndNormalizeClassProperties, normalizeIndentationAndSpacing, } from "./normalization.js";
|
|
7
7
|
const genericKindProperties = getGenericKindProperties();
|
|
8
8
|
/**
|
|
9
9
|
* Performs post-processing on generated TypeScript files.
|
|
@@ -136,8 +136,12 @@ export function applyCRDPostProcessing(content, name, crd, version, opts) {
|
|
|
136
136
|
* @returns An array of property names that belong to `GenericKind`.
|
|
137
137
|
*/
|
|
138
138
|
export function getGenericKindProperties() {
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
// Ensure we always include standard Kubernetes resource properties
|
|
140
|
+
const standardProperties = ["kind", "apiVersion", "metadata"];
|
|
141
|
+
// Get actual properties from GenericKind
|
|
142
|
+
const instanceProperties = Object.getOwnPropertyNames(new GenericKind()).filter(prop => prop !== "[key: string]");
|
|
143
|
+
// Combine both sets of properties, removing duplicates
|
|
144
|
+
return Array.from(new Set([...standardProperties, ...instanceProperties]));
|
|
141
145
|
}
|
|
142
146
|
/**
|
|
143
147
|
* Collects interface names from TypeScript file lines.
|
package/dist/upstream.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** a is a collection of K8s types to be used within an action: `When(a.Configmap)` */
|
|
2
2
|
export { CoreV1Event as CoreEvent, EventsV1Event as Event, V1APIService as APIService, V1CSIDriver as CSIDriver, V1CertificateSigningRequest as CertificateSigningRequest, V1ClusterRole as ClusterRole, V1ClusterRoleBinding as ClusterRoleBinding, V1ConfigMap as ConfigMap, V1ControllerRevision as ControllerRevision, V1CronJob as CronJob, V1CustomResourceDefinition as CustomResourceDefinition, V1DaemonSet as DaemonSet, V1Deployment as Deployment, V1EndpointSlice as EndpointSlice, V1Endpoints as Endpoints, V1HorizontalPodAutoscaler as HorizontalPodAutoscaler, V1Ingress as Ingress, V1IngressClass as IngressClass, V1Job as Job, V1LimitRange as LimitRange, V1LocalSubjectAccessReview as LocalSubjectAccessReview, V1MutatingWebhookConfiguration as MutatingWebhookConfiguration, V1Namespace as Namespace, V1NetworkPolicy as NetworkPolicy, V1Node as Node, V1PersistentVolume as PersistentVolume, V1PersistentVolumeClaim as PersistentVolumeClaim, V1Pod as Pod, V1PodDisruptionBudget as PodDisruptionBudget, V1PodTemplate as PodTemplate, V1ReplicaSet as ReplicaSet, V1ReplicationController as ReplicationController, V1ResourceQuota as ResourceQuota, V1Role as Role, V1RoleBinding as RoleBinding, V1RuntimeClass as RuntimeClass, V1Secret as Secret, V1SelfSubjectAccessReview as SelfSubjectAccessReview, V1SelfSubjectRulesReview as SelfSubjectRulesReview, V1Service as Service, V1ServiceAccount as ServiceAccount, V1StatefulSet as StatefulSet, V1StorageClass as StorageClass, V1SubjectAccessReview as SubjectAccessReview, V1TokenReview as TokenReview, V1ValidatingWebhookConfiguration as ValidatingWebhookConfiguration, V1VolumeAttachment as VolumeAttachment, } from "@kubernetes/client-node";
|
|
3
|
-
export { GenericKind } from "./types";
|
|
3
|
+
export { GenericKind } from "./types.js";
|
|
4
4
|
//# sourceMappingURL=upstream.d.ts.map
|
package/dist/upstream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upstream.d.ts","sourceRoot":"","sources":["../src/upstream.ts"],"names":[],"mappings":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pB,gBAAgB,IAAI,cAAc,EAClC,aAAa,IAAI,WAAW,EAC5B,cAAc,IAAI,YAAY,EAC9B,qBAAqB,IAAI,mBAAmB,EAC5C,aAAa,IAAI,WAAW,EAC5B,gCAAgC,IAAI,8BAA8B,EAClE,kBAAkB,IAAI,gBAAgB,GACvC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/upstream.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
// SPDX-FileCopyrightText: 2023-Present The Kubernetes Fluent Client Authors
|
|
3
3
|
/** a is a collection of K8s types to be used within an action: `When(a.Configmap)` */
|
|
4
4
|
export { CoreV1Event as CoreEvent, EventsV1Event as Event, V1APIService as APIService, V1CSIDriver as CSIDriver, V1CertificateSigningRequest as CertificateSigningRequest, V1ClusterRole as ClusterRole, V1ClusterRoleBinding as ClusterRoleBinding, V1ConfigMap as ConfigMap, V1ControllerRevision as ControllerRevision, V1CronJob as CronJob, V1CustomResourceDefinition as CustomResourceDefinition, V1DaemonSet as DaemonSet, V1Deployment as Deployment, V1EndpointSlice as EndpointSlice, V1Endpoints as Endpoints, V1HorizontalPodAutoscaler as HorizontalPodAutoscaler, V1Ingress as Ingress, V1IngressClass as IngressClass, V1Job as Job, V1LimitRange as LimitRange, V1LocalSubjectAccessReview as LocalSubjectAccessReview, V1MutatingWebhookConfiguration as MutatingWebhookConfiguration, V1Namespace as Namespace, V1NetworkPolicy as NetworkPolicy, V1Node as Node, V1PersistentVolume as PersistentVolume, V1PersistentVolumeClaim as PersistentVolumeClaim, V1Pod as Pod, V1PodDisruptionBudget as PodDisruptionBudget, V1PodTemplate as PodTemplate, V1ReplicaSet as ReplicaSet, V1ReplicationController as ReplicationController, V1ResourceQuota as ResourceQuota, V1Role as Role, V1RoleBinding as RoleBinding, V1RuntimeClass as RuntimeClass, V1Secret as Secret, V1SelfSubjectAccessReview as SelfSubjectAccessReview, V1SelfSubjectRulesReview as SelfSubjectRulesReview, V1Service as Service, V1ServiceAccount as ServiceAccount, V1StatefulSet as StatefulSet, V1StorageClass as StorageClass, V1SubjectAccessReview as SubjectAccessReview, V1TokenReview as TokenReview, V1ValidatingWebhookConfiguration as ValidatingWebhookConfiguration, V1VolumeAttachment as VolumeAttachment, } from "@kubernetes/client-node";
|
|
5
|
-
export { GenericKind } from "./types";
|
|
5
|
+
export { GenericKind } from "./types.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kubernetes-fluent-client",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.2",
|
|
4
4
|
"description": "A @kubernetes/client-node fluent API wrapper that leverages K8s Server Side Apply.",
|
|
5
5
|
"bin": "./dist/cli.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"prebuild": "rm -rf dist",
|
|
39
39
|
"build": "tsc",
|
|
40
40
|
"semantic-release": "semantic-release",
|
|
41
|
-
"test": "
|
|
42
|
-
"test:e2e": "
|
|
43
|
-
"test:e2e:prep-crds": "kubectl apply -f test/ && npx
|
|
41
|
+
"test": "vitest src run --coverage",
|
|
42
|
+
"test:e2e": "vitest run e2e/",
|
|
43
|
+
"test:e2e:prep-crds": "kubectl apply -f test/ && npx tsx src/cli.ts crd ./test/datastore.crd.yaml e2e && npx tsx src/cli.ts crd https://raw.githubusercontent.com/defenseunicorns/kubernetes-fluent-client/refs/heads/main/test/webapp.crd.yaml e2e",
|
|
44
44
|
"test:e2e:prep-cluster": "k3d cluster create kfc-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system",
|
|
45
45
|
"test:e2e:prep-image": "npm run build && npm pack && npm i kubernetes-fluent-client-0.0.0-development.tgz --no-save",
|
|
46
|
-
"test:e2e:run": "npm run test:e2e:prep-cluster && npm run test:e2e:prep-crds && npm run test:e2e:prep-image &&
|
|
46
|
+
"test:e2e:run": "npm run test:e2e:prep-cluster && npm run test:e2e:prep-crds && npm run test:e2e:prep-image && npm run test:e2e && npm run test:e2e:cleanup",
|
|
47
47
|
"test:e2e:cleanup": "k3d cluster delete kfc-dev",
|
|
48
48
|
"format:check": "eslint src e2e && prettier . --check",
|
|
49
49
|
"format:fix": "eslint --fix src e2e && prettier . --write",
|
|
@@ -57,14 +57,13 @@
|
|
|
57
57
|
"quicktype-core": "23.2.5",
|
|
58
58
|
"type-fest": "^4.39.1",
|
|
59
59
|
"undici": "^7.7.0",
|
|
60
|
-
"yargs": "
|
|
60
|
+
"yargs": "18.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@commitlint/cli": "19.8.1",
|
|
64
64
|
"@commitlint/config-conventional": "19.8.1",
|
|
65
65
|
"@eslint/eslintrc": "^3.1.0",
|
|
66
66
|
"@eslint/js": "^9.14.0",
|
|
67
|
-
"@jest/globals": "29.7.0",
|
|
68
67
|
"@types/byline": "4.2.36",
|
|
69
68
|
"@types/readable-stream": "4.0.21",
|
|
70
69
|
"@types/urijs": "^1.19.25",
|
|
@@ -72,14 +71,13 @@
|
|
|
72
71
|
"@types/yargs": "17.0.33",
|
|
73
72
|
"@typescript-eslint/eslint-plugin": "8.33.1",
|
|
74
73
|
"@typescript-eslint/parser": "8.33.1",
|
|
74
|
+
"@vitest/coverage-v8": "^3.2.1",
|
|
75
75
|
"eslint-plugin-jsdoc": "50.7.1",
|
|
76
76
|
"globals": "^16.0.0",
|
|
77
77
|
"husky": "^9.1.6",
|
|
78
|
-
"jest": "29.7.0",
|
|
79
78
|
"lint-staged": "^16.0.0",
|
|
80
79
|
"prettier": "3.5.3",
|
|
81
80
|
"semantic-release": "24.2.5",
|
|
82
|
-
"ts-jest": "29.3.4",
|
|
83
81
|
"typescript": "5.8.3",
|
|
84
82
|
"vitest": "^3.2.1"
|
|
85
83
|
},
|
package/src/cli.ts
CHANGED
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
import { hideBin } from "yargs/helpers";
|
|
7
7
|
import yargs from "yargs/yargs";
|
|
8
|
-
import { GenerateOptions, generate } from "./generate";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { GenerateOptions, generate } from "./generate.js";
|
|
9
|
+
import { postProcessing } from "./postProcessing.js";
|
|
10
|
+
import { createRequire } from "node:module";
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
const { version } = require("../package.json");
|
|
11
13
|
|
|
12
14
|
void yargs(hideBin(process.argv))
|
|
13
|
-
.version("version", "Display version number",
|
|
15
|
+
.version("version", "Display version number", `${version}`)
|
|
14
16
|
.alias("version", "V")
|
|
15
17
|
.command(
|
|
16
18
|
"crd [source] [directory]",
|
package/src/fluent/index.ts
CHANGED
|
@@ -6,15 +6,15 @@ import { Operation } from "fast-json-patch";
|
|
|
6
6
|
import { StatusCodes } from "http-status-codes";
|
|
7
7
|
import type { PartialDeep } from "type-fest";
|
|
8
8
|
|
|
9
|
-
import { fetch } from "../fetch";
|
|
10
|
-
import { modelToGroupVersionKind } from "../kinds";
|
|
11
|
-
import { GenericClass } from "../types";
|
|
12
|
-
import { K8sInit, Paths } from "./types";
|
|
13
|
-
import { Filters, WatchAction, FetchMethods, ApplyCfg } from "./shared-types";
|
|
14
|
-
import { k8sCfg, k8sExec } from "./utils";
|
|
15
|
-
import { WatchCfg, Watcher } from "./watch";
|
|
16
|
-
import { hasLogs } from "../helpers";
|
|
17
|
-
import { Pod, type Service, type ReplicaSet } from "../upstream";
|
|
9
|
+
import { fetch } from "../fetch.js";
|
|
10
|
+
import { modelToGroupVersionKind } from "../kinds.js";
|
|
11
|
+
import { GenericClass } from "../types.js";
|
|
12
|
+
import { K8sInit, Paths } from "./types.js";
|
|
13
|
+
import { Filters, WatchAction, FetchMethods, ApplyCfg } from "./shared-types.js";
|
|
14
|
+
import { k8sCfg, k8sExec } from "./utils.js";
|
|
15
|
+
import { WatchCfg, Watcher } from "./watch.js";
|
|
16
|
+
import { hasLogs } from "../helpers.js";
|
|
17
|
+
import { Pod, type Service, type ReplicaSet } from "../upstream.js";
|
|
18
18
|
/**
|
|
19
19
|
* Kubernetes fluent API inspired by Kubectl. Pass in a model, then call filters and actions on it.
|
|
20
20
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// SPDX-FileCopyrightText: 2023-Present The Kubernetes Fluent Client Authors
|
|
3
|
-
import { GenericClass, GroupVersionKind } from "../types";
|
|
3
|
+
import { GenericClass, GroupVersionKind } from "../types.js";
|
|
4
4
|
import { RequestInit } from "undici";
|
|
5
5
|
import { KubernetesObject } from "@kubernetes/client-node";
|
|
6
6
|
/**
|
package/src/fluent/types.ts
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
import { KubernetesListObject, KubernetesObject } from "@kubernetes/client-node";
|
|
5
5
|
import { Operation } from "fast-json-patch";
|
|
6
6
|
import type { PartialDeep } from "type-fest";
|
|
7
|
-
import { GenericClass } from "../types";
|
|
8
|
-
import { WatchCfg, Watcher } from "./watch";
|
|
7
|
+
import { GenericClass } from "../types.js";
|
|
8
|
+
import { WatchCfg, Watcher } from "./watch.js";
|
|
9
9
|
import https from "https";
|
|
10
10
|
import { SecureClientSessionOptions } from "http2";
|
|
11
|
-
import { WatchAction, FetchMethods, ApplyCfg } from "./shared-types";
|
|
11
|
+
import { WatchAction, FetchMethods, ApplyCfg } from "./shared-types.js";
|
|
12
12
|
/*
|
|
13
13
|
* Watch Class Type - Used in Pepr Watch Processor
|
|
14
14
|
*/
|
package/src/fluent/utils.ts
CHANGED
|
@@ -6,10 +6,10 @@ import { RequestInit } from "node-fetch";
|
|
|
6
6
|
import { URL } from "url";
|
|
7
7
|
import { Agent, Dispatcher } from "undici";
|
|
8
8
|
import { Agent as httpsAgent } from "https";
|
|
9
|
-
import { fetch } from "../fetch";
|
|
10
|
-
import { modelToGroupVersionKind } from "../kinds";
|
|
11
|
-
import { GenericClass } from "../types";
|
|
12
|
-
import { ApplyCfg, Filters, K8sConfigPromise, FetchMethods } from "./shared-types";
|
|
9
|
+
import { fetch } from "../fetch.js";
|
|
10
|
+
import { modelToGroupVersionKind } from "../kinds.js";
|
|
11
|
+
import { GenericClass } from "../types.js";
|
|
12
|
+
import { ApplyCfg, Filters, K8sConfigPromise, FetchMethods } from "./shared-types.js";
|
|
13
13
|
import fs from "fs";
|
|
14
14
|
import { V1Eviction as Eviction } from "@kubernetes/client-node";
|
|
15
15
|
const SSA_CONTENT_TYPE = "application/apply-patch+yaml";
|
package/src/fluent/watch.ts
CHANGED
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
|
|
4
4
|
import { EventEmitter } from "events";
|
|
5
5
|
import { fetch } from "undici";
|
|
6
|
-
import { fetch as wrappedFetch } from "../fetch";
|
|
7
|
-
import { GenericClass, KubernetesListObject } from "../types";
|
|
8
|
-
import { k8sCfg, pathBuilder, getHeaders } from "./utils";
|
|
6
|
+
import { fetch as wrappedFetch } from "../fetch.js";
|
|
7
|
+
import { GenericClass, KubernetesListObject } from "../types.js";
|
|
8
|
+
import { k8sCfg, pathBuilder, getHeaders } from "./utils.js";
|
|
9
9
|
import { Readable } from "stream";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
K8sConfigPromise,
|
|
12
|
+
WatchPhase,
|
|
13
|
+
WatchAction,
|
|
14
|
+
Filters,
|
|
15
|
+
FetchMethods,
|
|
16
|
+
} from "./shared-types.js";
|
|
11
17
|
export enum WatchEvent {
|
|
12
18
|
/** Watch is connected successfully */
|
|
13
19
|
CONNECT = "connect",
|
package/src/generate.ts
CHANGED
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
quicktype,
|
|
13
13
|
} from "quicktype-core";
|
|
14
14
|
|
|
15
|
-
import { fetch } from "./fetch";
|
|
16
|
-
import { K8s } from "./fluent";
|
|
17
|
-
import { CustomResourceDefinition } from "./upstream";
|
|
18
|
-
import { LogFn } from "./types";
|
|
15
|
+
import { fetch } from "./fetch.js";
|
|
16
|
+
import { K8s } from "./fluent/index.js";
|
|
17
|
+
import { CustomResourceDefinition } from "./upstream.js";
|
|
18
|
+
import { LogFn } from "./types.js";
|
|
19
19
|
|
|
20
20
|
export interface GenerateOptions {
|
|
21
21
|
source: string; // URL, file path, or K8s CRD name
|
package/src/index.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// SPDX-FileCopyrightText: 2023-Present The Kubernetes Fluent Client Authors
|
|
3
3
|
|
|
4
|
-
import "./patch";
|
|
4
|
+
import "./patch.js";
|
|
5
5
|
|
|
6
6
|
// Export kinds as a single object
|
|
7
|
-
import * as kind from "./upstream";
|
|
7
|
+
import * as kind from "./upstream.js";
|
|
8
8
|
|
|
9
9
|
/** kind is a collection of K8s types to be used within a K8s call: `K8s(kind.Secret).Apply({})`. */
|
|
10
10
|
export { kind };
|
|
11
11
|
|
|
12
12
|
// Export the node-fetch wrapper
|
|
13
|
-
export { fetch } from "./fetch";
|
|
13
|
+
export { fetch } from "./fetch.js";
|
|
14
14
|
|
|
15
15
|
// Export the HTTP status codes
|
|
16
16
|
export { StatusCodes as fetchStatus } from "http-status-codes";
|
|
17
17
|
|
|
18
18
|
// Export the Watch Config and Event types
|
|
19
|
-
export { WatchCfg, WatchEvent } from "./fluent/watch";
|
|
19
|
+
export { WatchCfg, WatchEvent } from "./fluent/watch.js";
|
|
20
20
|
|
|
21
21
|
// Export the fluent API entrypoint
|
|
22
|
-
export { K8s } from "./fluent";
|
|
22
|
+
export { K8s } from "./fluent/index.js";
|
|
23
23
|
|
|
24
24
|
// Export helpers for working with K8s types
|
|
25
|
-
export { RegisterKind, modelToGroupVersionKind } from "./kinds";
|
|
25
|
+
export { RegisterKind, modelToGroupVersionKind } from "./kinds.js";
|
|
26
26
|
|
|
27
27
|
// Export the GenericKind interface for CRD registration
|
|
28
|
-
export { GenericKind } from "./types";
|
|
28
|
+
export { GenericKind } from "./types.js";
|
|
29
29
|
|
|
30
|
-
export * from "./types";
|
|
30
|
+
export * from "./types.js";
|
|
31
31
|
|
|
32
32
|
// Export the upstream raw models
|
|
33
|
-
export * as models from "@kubernetes/client-node/dist/gen/models/all";
|
|
33
|
+
export * as models from "@kubernetes/client-node/dist/gen/models/all.js";
|
|
34
34
|
|
|
35
|
-
export { fromEnv, waitForCluster } from "./helpers";
|
|
35
|
+
export { fromEnv, waitForCluster } from "./helpers.js";
|
package/src/kinds.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// SPDX-FileCopyrightText: 2023-Present The Kubernetes Fluent Client Authors
|
|
3
3
|
|
|
4
|
-
import { GenericClass, GroupVersionKind } from "./types";
|
|
4
|
+
import { GenericClass, GroupVersionKind } from "./types.js";
|
|
5
5
|
|
|
6
6
|
const gvkMap: Record<string, GroupVersionKind> = {
|
|
7
7
|
/**
|
package/src/normalization.ts
CHANGED
package/src/postProcessing.ts
CHANGED
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
import * as fs from "fs";
|
|
5
5
|
import * as path from "path";
|
|
6
|
-
import { GenerateOptions } from "./generate";
|
|
7
|
-
import { GenericKind } from "./types";
|
|
8
|
-
import { CustomResourceDefinition } from "./upstream";
|
|
9
|
-
import {
|
|
6
|
+
import { GenerateOptions } from "./generate.js";
|
|
7
|
+
import { GenericKind } from "./types.js";
|
|
8
|
+
import { CustomResourceDefinition } from "./upstream.js";
|
|
9
|
+
import {
|
|
10
|
+
modifyAndNormalizeClassProperties,
|
|
11
|
+
normalizeIndentationAndSpacing,
|
|
12
|
+
} from "./normalization.js";
|
|
10
13
|
|
|
11
14
|
type CRDResult = {
|
|
12
15
|
name: string;
|
|
@@ -178,8 +181,16 @@ export function applyCRDPostProcessing(
|
|
|
178
181
|
* @returns An array of property names that belong to `GenericKind`.
|
|
179
182
|
*/
|
|
180
183
|
export function getGenericKindProperties(): string[] {
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
// Ensure we always include standard Kubernetes resource properties
|
|
185
|
+
const standardProperties = ["kind", "apiVersion", "metadata"];
|
|
186
|
+
|
|
187
|
+
// Get actual properties from GenericKind
|
|
188
|
+
const instanceProperties = Object.getOwnPropertyNames(new GenericKind()).filter(
|
|
189
|
+
prop => prop !== "[key: string]",
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
// Combine both sets of properties, removing duplicates
|
|
193
|
+
return Array.from(new Set([...standardProperties, ...instanceProperties]));
|
|
183
194
|
}
|
|
184
195
|
|
|
185
196
|
/**
|
package/src/upstream.ts
CHANGED