kubernetes-fluent-client 3.5.1 → 3.5.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.
@@ -372,7 +372,7 @@ class Watcher {
372
372
  }
373
373
  const now = Date.now();
374
374
  // If the last seen time is greater than the limit, trigger a resync
375
- if (this.#lastSeenTime == OVERRIDE || now - this.#lastSeenTime > this.#lastSeenLimit) {
375
+ if (this.#lastSeenTime === OVERRIDE || now - this.#lastSeenTime > this.#lastSeenLimit) {
376
376
  // Reset the last seen time to now to allow the resync to be called again in case of failure
377
377
  this.#lastSeenTime = now;
378
378
  // If there are more attempts, retry the watch (undefined is unlimited retries)
@@ -35,10 +35,9 @@ export declare function prepareInputData(name: string, schema: string): Promise<
35
35
  * Generates TypeScript types using quicktype.
36
36
  *
37
37
  * @param inputData - The input data for quicktype.
38
- * @param opts - The options for generating the TypeScript types.
39
38
  * @returns A promise that resolves to an array of generated TypeScript type lines.
40
39
  */
41
- export declare function generateTypes(inputData: InputData, opts: GenerateOptions): Promise<string[]>;
40
+ export declare function generateTypes(inputData: InputData): Promise<string[]>;
42
41
  /**
43
42
  * Writes the processed lines to the output file.
44
43
  *
@@ -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,YAAY,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,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,MA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Ac,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
@@ -75,7 +75,7 @@ async function convertCRDtoTS(crd, opts) {
75
75
  const schema = JSON.stringify(match.schema.openAPIV3Schema);
76
76
  opts.logFn(`- Generating ${crd.spec.group}/${match.name} types for ${name}`);
77
77
  const inputData = await prepareInputData(name, schema);
78
- const generatedTypes = await generateTypes(inputData, opts);
78
+ const generatedTypes = await generateTypes(inputData);
79
79
  const fileName = `${name.toLowerCase()}-${match.name.toLowerCase()}`;
80
80
  writeGeneratedFile(fileName, opts.directory || "", generatedTypes, opts.language || "ts");
81
81
  results[fileName] = generatedTypes;
@@ -104,16 +104,14 @@ async function prepareInputData(name, schema) {
104
104
  * Generates TypeScript types using quicktype.
105
105
  *
106
106
  * @param inputData - The input data for quicktype.
107
- * @param opts - The options for generating the TypeScript types.
108
107
  * @returns A promise that resolves to an array of generated TypeScript type lines.
109
108
  */
110
- async function generateTypes(inputData, opts) {
109
+ async function generateTypes(inputData) {
111
110
  // If the language is not specified, default to TypeScript
112
- const language = opts.language || "ts";
113
111
  // Generate the types
114
112
  const out = await (0, quicktype_core_1.quicktype)({
115
113
  inputData,
116
- lang: language,
114
+ lang: "ts",
117
115
  rendererOptions: { "just-types": "true" },
118
116
  });
119
117
  return out.lines;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kubernetes-fluent-client",
3
- "version": "3.5.1",
3
+ "version": "3.5.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",
@@ -53,7 +53,7 @@
53
53
  "fast-json-patch": "3.1.1",
54
54
  "http-status-codes": "2.3.0",
55
55
  "node-fetch": "2.7.0",
56
- "quicktype-core": "23.0.171",
56
+ "quicktype-core": "23.1.1",
57
57
  "type-fest": "^4.39.1",
58
58
  "undici": "^7.7.0",
59
59
  "yargs": "17.7.2"
@@ -68,9 +68,9 @@
68
68
  "@types/readable-stream": "4.0.18",
69
69
  "@types/urijs": "^1.19.25",
70
70
  "@types/yargs": "17.0.33",
71
- "@typescript-eslint/eslint-plugin": "8.30.1",
72
- "@typescript-eslint/parser": "8.30.1",
73
- "eslint-plugin-jsdoc": "50.6.9",
71
+ "@typescript-eslint/eslint-plugin": "8.31.1",
72
+ "@typescript-eslint/parser": "8.31.1",
73
+ "eslint-plugin-jsdoc": "50.6.11",
74
74
  "globals": "^16.0.0",
75
75
  "husky": "^9.1.6",
76
76
  "jest": "29.7.0",
@@ -467,7 +467,7 @@ export class Watcher<T extends GenericClass> {
467
467
  const now = Date.now();
468
468
 
469
469
  // If the last seen time is greater than the limit, trigger a resync
470
- if (this.#lastSeenTime == OVERRIDE || now - this.#lastSeenTime > this.#lastSeenLimit) {
470
+ if (this.#lastSeenTime === OVERRIDE || now - this.#lastSeenTime > this.#lastSeenLimit) {
471
471
  // Reset the last seen time to now to allow the resync to be called again in case of failure
472
472
  this.#lastSeenTime = now;
473
473
 
package/src/generate.ts CHANGED
@@ -73,7 +73,7 @@ export async function convertCRDtoTS(
73
73
  opts.logFn(`- Generating ${crd.spec.group}/${match.name} types for ${name}`);
74
74
 
75
75
  const inputData = await prepareInputData(name, schema);
76
- const generatedTypes = await generateTypes(inputData, opts);
76
+ const generatedTypes = await generateTypes(inputData);
77
77
 
78
78
  const fileName = `${name.toLowerCase()}-${match.name.toLowerCase()}`;
79
79
  writeGeneratedFile(fileName, opts.directory || "", generatedTypes, opts.language || "ts");
@@ -110,20 +110,15 @@ export async function prepareInputData(name: string, schema: string): Promise<In
110
110
  * Generates TypeScript types using quicktype.
111
111
  *
112
112
  * @param inputData - The input data for quicktype.
113
- * @param opts - The options for generating the TypeScript types.
114
113
  * @returns A promise that resolves to an array of generated TypeScript type lines.
115
114
  */
116
- export async function generateTypes(
117
- inputData: InputData,
118
- opts: GenerateOptions,
119
- ): Promise<string[]> {
115
+ export async function generateTypes(inputData: InputData): Promise<string[]> {
120
116
  // If the language is not specified, default to TypeScript
121
- const language = opts.language || "ts";
122
117
 
123
118
  // Generate the types
124
119
  const out = await quicktype({
125
120
  inputData,
126
- lang: language,
121
+ lang: "ts",
127
122
  rendererOptions: { "just-types": "true" },
128
123
  });
129
124