timonel 2.8.0-beta.5 → 2.8.1
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 +11 -21
- package/README.md +12 -55
- package/dist/cli.d.ts.map +1 -0
- package/dist/{src/cli.js → cli.js} +115 -82
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/{src/lib → lib}/helm.d.ts +234 -4
- package/dist/lib/helm.d.ts.map +1 -0
- package/dist/{src/lib → lib}/helm.js +309 -20
- package/dist/lib/helm.js.map +1 -0
- package/dist/lib/helmChartWriter.d.ts.map +1 -0
- package/dist/{src/lib → lib}/helmChartWriter.js +5 -19
- package/dist/lib/helmChartWriter.js.map +1 -0
- package/dist/{src/lib → lib}/resources/baseResourceProvider.d.ts +1 -1
- package/dist/lib/resources/baseResourceProvider.d.ts.map +1 -0
- package/dist/lib/resources/baseResourceProvider.js.map +1 -0
- package/dist/{src/lib → lib}/resources/cloud/aws/awsResources.d.ts +5 -14
- package/dist/lib/resources/cloud/aws/awsResources.d.ts.map +1 -0
- package/dist/{src/lib → lib}/resources/cloud/aws/awsResources.js +63 -78
- package/dist/lib/resources/cloud/aws/awsResources.js.map +1 -0
- package/dist/lib/resources/cloud/aws/karpenterResources.d.ts.map +1 -0
- package/dist/lib/resources/cloud/aws/karpenterResources.js.map +1 -0
- package/dist/lib/rutter.d.ts +445 -0
- package/dist/lib/rutter.d.ts.map +1 -0
- package/dist/lib/rutter.js +585 -0
- package/dist/lib/rutter.js.map +1 -0
- package/dist/{src/lib → lib}/security.d.ts +2 -72
- package/dist/lib/security.d.ts.map +1 -0
- package/dist/lib/security.js +390 -0
- package/dist/lib/security.js.map +1 -0
- package/dist/lib/umbrella.d.ts.map +1 -0
- package/dist/lib/umbrella.js.map +1 -0
- package/dist/{src/lib → lib}/umbrellaRutter.d.ts +1 -1
- package/dist/lib/umbrellaRutter.d.ts.map +1 -0
- package/dist/lib/umbrellaRutter.js.map +1 -0
- package/dist/{src/lib → lib}/utils/helmHelpers.d.ts +2 -12
- package/dist/lib/utils/helmHelpers.d.ts.map +1 -0
- package/dist/{src/lib → lib}/utils/helmHelpers.js +2 -46
- package/dist/lib/utils/helmHelpers.js.map +1 -0
- package/package.json +3 -4
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js.map +0 -1
- package/dist/src/index.d.ts +0 -23
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -15
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib/constants.d.ts +0 -142
- package/dist/src/lib/constants.d.ts.map +0 -1
- package/dist/src/lib/constants.js +0 -167
- package/dist/src/lib/constants.js.map +0 -1
- package/dist/src/lib/helm.d.ts.map +0 -1
- package/dist/src/lib/helm.js.map +0 -1
- package/dist/src/lib/helmChartWriter.d.ts.map +0 -1
- package/dist/src/lib/helmChartWriter.js.map +0 -1
- package/dist/src/lib/resources/autoscaling/autoscalingResources.d.ts +0 -248
- package/dist/src/lib/resources/autoscaling/autoscalingResources.d.ts.map +0 -1
- package/dist/src/lib/resources/autoscaling/autoscalingResources.js +0 -81
- package/dist/src/lib/resources/autoscaling/autoscalingResources.js.map +0 -1
- package/dist/src/lib/resources/baseResourceProvider.d.ts.map +0 -1
- package/dist/src/lib/resources/baseResourceProvider.js.map +0 -1
- package/dist/src/lib/resources/cloud/aws/awsResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/aws/awsResources.js.map +0 -1
- package/dist/src/lib/resources/cloud/aws/karpenterResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/aws/karpenterResources.js.map +0 -1
- package/dist/src/lib/resources/cloud/azure/azureResources.d.ts +0 -169
- package/dist/src/lib/resources/cloud/azure/azureResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/azure/azureResources.js +0 -218
- package/dist/src/lib/resources/cloud/azure/azureResources.js.map +0 -1
- package/dist/src/lib/resources/cloud/gcp/gcpResources.d.ts +0 -164
- package/dist/src/lib/resources/cloud/gcp/gcpResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/gcp/gcpResources.js +0 -192
- package/dist/src/lib/resources/cloud/gcp/gcpResources.js.map +0 -1
- package/dist/src/lib/resources/core/coreResources.d.ts +0 -790
- package/dist/src/lib/resources/core/coreResources.d.ts.map +0 -1
- package/dist/src/lib/resources/core/coreResources.js +0 -1115
- package/dist/src/lib/resources/core/coreResources.js.map +0 -1
- package/dist/src/lib/resources/core/storageResources.d.ts +0 -133
- package/dist/src/lib/resources/core/storageResources.d.ts.map +0 -1
- package/dist/src/lib/resources/core/storageResources.js +0 -120
- package/dist/src/lib/resources/core/storageResources.js.map +0 -1
- package/dist/src/lib/resources/network/networkResources.d.ts +0 -515
- package/dist/src/lib/resources/network/networkResources.d.ts.map +0 -1
- package/dist/src/lib/resources/network/networkResources.js +0 -784
- package/dist/src/lib/resources/network/networkResources.js.map +0 -1
- package/dist/src/lib/resources/security/encryption.d.ts +0 -290
- package/dist/src/lib/resources/security/encryption.d.ts.map +0 -1
- package/dist/src/lib/resources/security/encryption.js +0 -295
- package/dist/src/lib/resources/security/encryption.js.map +0 -1
- package/dist/src/lib/resources/security/index.d.ts +0 -6
- package/dist/src/lib/resources/security/index.d.ts.map +0 -1
- package/dist/src/lib/resources/security/index.js +0 -6
- package/dist/src/lib/resources/security/index.js.map +0 -1
- package/dist/src/lib/resources/validation/validationResources.d.ts +0 -26
- package/dist/src/lib/resources/validation/validationResources.d.ts.map +0 -1
- package/dist/src/lib/resources/validation/validationResources.js +0 -33
- package/dist/src/lib/resources/validation/validationResources.js.map +0 -1
- package/dist/src/lib/rutter.d.ts +0 -1106
- package/dist/src/lib/rutter.d.ts.map +0 -1
- package/dist/src/lib/rutter.js +0 -1295
- package/dist/src/lib/rutter.js.map +0 -1
- package/dist/src/lib/security.d.ts.map +0 -1
- package/dist/src/lib/security.js +0 -569
- package/dist/src/lib/security.js.map +0 -1
- package/dist/src/lib/umbrella.d.ts.map +0 -1
- package/dist/src/lib/umbrella.js.map +0 -1
- package/dist/src/lib/umbrellaRutter.d.ts.map +0 -1
- package/dist/src/lib/umbrellaRutter.js.map +0 -1
- package/dist/src/lib/utils/helmHelpers.d.ts.map +0 -1
- package/dist/src/lib/utils/helmHelpers.js.map +0 -1
- package/dist/src/lib/utils/podTemplates.d.ts +0 -192
- package/dist/src/lib/utils/podTemplates.d.ts.map +0 -1
- package/dist/src/lib/utils/podTemplates.js +0 -331
- package/dist/src/lib/utils/podTemplates.js.map +0 -1
- package/dist/src/lib/utils/resourceNaming.d.ts +0 -57
- package/dist/src/lib/utils/resourceNaming.d.ts.map +0 -1
- package/dist/src/lib/utils/resourceNaming.js +0 -82
- package/dist/src/lib/utils/resourceNaming.js.map +0 -1
- /package/dist/{src/cli.d.ts → cli.d.ts} +0 -0
- /package/dist/{src/lib → lib}/helmChartWriter.d.ts +0 -0
- /package/dist/{src/lib → lib}/resources/baseResourceProvider.js +0 -0
- /package/dist/{src/lib → lib}/resources/cloud/aws/karpenterResources.d.ts +0 -0
- /package/dist/{src/lib → lib}/resources/cloud/aws/karpenterResources.js +0 -0
- /package/dist/{src/lib → lib}/umbrella.d.ts +0 -0
- /package/dist/{src/lib → lib}/umbrella.js +0 -0
- /package/dist/{src/lib → lib}/umbrellaRutter.js +0 -0
|
@@ -150,6 +150,47 @@ export declare function template(name: string, context?: string): string;
|
|
|
150
150
|
* @since 0.1.0
|
|
151
151
|
*/
|
|
152
152
|
export declare function include(name: string, context?: string): string;
|
|
153
|
+
/**
|
|
154
|
+
* Branded types for better type safety in Helm template paths
|
|
155
|
+
* @since 1.1.0
|
|
156
|
+
*/
|
|
157
|
+
export type HelmPath = string & {
|
|
158
|
+
readonly __brand: unique symbol;
|
|
159
|
+
};
|
|
160
|
+
export type NumberPath = HelmPath & {
|
|
161
|
+
readonly __numberType: unique symbol;
|
|
162
|
+
};
|
|
163
|
+
export type BooleanPath = HelmPath & {
|
|
164
|
+
readonly __booleanType: unique symbol;
|
|
165
|
+
};
|
|
166
|
+
export type StringPath = HelmPath & {
|
|
167
|
+
readonly __stringType: unique symbol;
|
|
168
|
+
};
|
|
169
|
+
export type FloatPath = HelmPath & {
|
|
170
|
+
readonly __floatType: unique symbol;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Configuration options for typed reference creation
|
|
174
|
+
* @since 1.1.0
|
|
175
|
+
*/
|
|
176
|
+
interface TypedRefOptions {
|
|
177
|
+
/** Whether to include default value handling */
|
|
178
|
+
withDefault?: boolean;
|
|
179
|
+
/** Default value to use if the path is not set */
|
|
180
|
+
defaultValue?: string | number | boolean;
|
|
181
|
+
/** Whether to quote string values */
|
|
182
|
+
quote?: boolean;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Factory function to create typed Helm value references with reduced code duplication
|
|
186
|
+
* @param path - The path to the value in the Helm values
|
|
187
|
+
* @param type - The expected type of the value
|
|
188
|
+
* @param options - Additional options for reference creation
|
|
189
|
+
* @returns A string that can be used in Helm templates
|
|
190
|
+
* @throws {Error} If the path is invalid
|
|
191
|
+
* @since 1.1.0
|
|
192
|
+
*/
|
|
193
|
+
export declare function createTypedRef(path: string, type: 'number' | 'boolean' | 'string' | 'float', options?: TypedRefOptions): string;
|
|
153
194
|
/**
|
|
154
195
|
* Creates a numeric reference from .Values with int cast
|
|
155
196
|
*
|
|
@@ -157,6 +198,7 @@ export declare function include(name: string, context?: string): string;
|
|
|
157
198
|
* truncating any decimal places.
|
|
158
199
|
*
|
|
159
200
|
* @param {string} path - Path to the value using dot notation
|
|
201
|
+
* @param {TypedRefOptions} [options] - Additional options for reference creation
|
|
160
202
|
* @returns {string} Helm template expression with int cast
|
|
161
203
|
* @throws {Error} If the path is not valid for Helm templates
|
|
162
204
|
*
|
|
@@ -168,11 +210,12 @@ export declare function include(name: string, context?: string): string;
|
|
|
168
210
|
*
|
|
169
211
|
* @since 0.1.0
|
|
170
212
|
*/
|
|
171
|
-
export declare function numberRef(path: string): string;
|
|
213
|
+
export declare function numberRef(path: string, options?: TypedRefOptions): string;
|
|
172
214
|
/**
|
|
173
215
|
* Creates a boolean reference from .Values with toBool cast
|
|
174
216
|
*
|
|
175
217
|
* @param {string} path - Path to the value using dot notation
|
|
218
|
+
* @param {TypedRefOptions} [options] - Additional options for reference creation
|
|
176
219
|
* @returns {string} Helm template expression with toBool cast
|
|
177
220
|
* @throws {Error} If the path is not valid for Helm templates
|
|
178
221
|
*
|
|
@@ -184,11 +227,12 @@ export declare function numberRef(path: string): string;
|
|
|
184
227
|
*
|
|
185
228
|
* @since 0.1.0
|
|
186
229
|
*/
|
|
187
|
-
export declare function boolRef(path: string): string;
|
|
230
|
+
export declare function boolRef(path: string, options?: TypedRefOptions): string;
|
|
188
231
|
/**
|
|
189
232
|
* Creates a string reference from .Values with toString cast
|
|
190
233
|
*
|
|
191
234
|
* @param {string} path - Path to the value using dot notation
|
|
235
|
+
* @param {TypedRefOptions} [options] - Additional options for reference creation
|
|
192
236
|
* @returns {string} Helm template expression with toString cast
|
|
193
237
|
* @throws {Error} If the path is not valid for Helm templates
|
|
194
238
|
*
|
|
@@ -200,11 +244,12 @@ export declare function boolRef(path: string): string;
|
|
|
200
244
|
*
|
|
201
245
|
* @since 0.1.0
|
|
202
246
|
*/
|
|
203
|
-
export declare function stringRef(path: string): string;
|
|
247
|
+
export declare function stringRef(path: string, options?: TypedRefOptions): string;
|
|
204
248
|
/**
|
|
205
249
|
* Creates a float reference from .Values with float64 cast
|
|
206
250
|
*
|
|
207
251
|
* @param {string} path - Path to the value using dot notation
|
|
252
|
+
* @param {TypedRefOptions} [options] - Additional options for reference creation
|
|
208
253
|
* @returns {string} Helm template expression with float64 cast
|
|
209
254
|
* @throws {Error} If the path is not valid for Helm templates
|
|
210
255
|
*
|
|
@@ -216,7 +261,7 @@ export declare function stringRef(path: string): string;
|
|
|
216
261
|
*
|
|
217
262
|
* @since 0.1.0
|
|
218
263
|
*/
|
|
219
|
-
export declare function floatRef(path: string): string;
|
|
264
|
+
export declare function floatRef(path: string, options?: TypedRefOptions): string;
|
|
220
265
|
/**
|
|
221
266
|
* Creates a conditional reference to a value in .Values
|
|
222
267
|
*
|
|
@@ -237,6 +282,32 @@ export declare function floatRef(path: string): string;
|
|
|
237
282
|
* @since 2.6.0
|
|
238
283
|
*/
|
|
239
284
|
export declare function conditionalRef(path: string, condition: string): string;
|
|
285
|
+
/**
|
|
286
|
+
* Wraps a complete YAML manifest in a Helm conditional
|
|
287
|
+
*
|
|
288
|
+
* Generates a Helm template that conditionally renders an entire
|
|
289
|
+
* Kubernetes manifest based on a values condition.
|
|
290
|
+
*
|
|
291
|
+
* @param {string} yamlContent - Complete YAML manifest content
|
|
292
|
+
* @param {string} condition - Path to the condition value
|
|
293
|
+
* @returns {string} YAML content wrapped in Helm conditional
|
|
294
|
+
* @throws {Error} If the condition path is not valid for Helm templates
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* ```typescript
|
|
298
|
+
* const namespaceYaml = `
|
|
299
|
+
* apiVersion: v1
|
|
300
|
+
* kind: Namespace
|
|
301
|
+
* metadata:
|
|
302
|
+
* name: my-namespace
|
|
303
|
+
* `;
|
|
304
|
+
* const conditionalNamespace = conditionalManifest(namespaceYaml, 'createNamespace');
|
|
305
|
+
* // Returns: '{{ if .Values.createNamespace }}\napiVersion: v1\nkind: Namespace...{{ end }}'
|
|
306
|
+
* ```
|
|
307
|
+
*
|
|
308
|
+
* @since 2.7.4
|
|
309
|
+
*/
|
|
310
|
+
export declare function conditionalManifest(yamlContent: string, condition: string): string;
|
|
240
311
|
/**
|
|
241
312
|
* Creates a reference to a value in .Values with a default fallback
|
|
242
313
|
*
|
|
@@ -295,4 +366,163 @@ export declare function base64Ref(path: string): string;
|
|
|
295
366
|
* @since 2.6.0
|
|
296
367
|
*/
|
|
297
368
|
export declare function jsonRef(path: string): string;
|
|
369
|
+
/**
|
|
370
|
+
* Flow Control Functions for Helm Templates
|
|
371
|
+
*
|
|
372
|
+
* These functions provide programmatic access to Helm's flow control structures:
|
|
373
|
+
* if/else, with, and range for conditional logic and iteration.
|
|
374
|
+
*
|
|
375
|
+
* @since 1.4.0
|
|
376
|
+
*/
|
|
377
|
+
/**
|
|
378
|
+
* Creates a conditional if block in Helm templates
|
|
379
|
+
*
|
|
380
|
+
* Generates Helm template expressions for conditional logic using if/else/end.
|
|
381
|
+
* Supports complex conditions with comparison operators and pipeline expressions.
|
|
382
|
+
*
|
|
383
|
+
* @param {string} condition - The condition to evaluate (e.g., 'eq .Values.env "production"')
|
|
384
|
+
* @param {string} content - Content to include when condition is true
|
|
385
|
+
* @param {string} [elseContent] - Optional content for else block
|
|
386
|
+
* @returns {string} Complete Helm if/else template block
|
|
387
|
+
* @throws {Error} If condition contains potentially unsafe template expressions
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* ```typescript
|
|
391
|
+
* const conditionalConfig = helmIf(
|
|
392
|
+
* 'eq .Values.environment "production"',
|
|
393
|
+
* 'replicas: 3\nresources:\n limits:\n memory: "1Gi"',
|
|
394
|
+
* 'replicas: 1\nresources:\n limits:\n memory: "512Mi"'
|
|
395
|
+
* );
|
|
396
|
+
* // Returns:
|
|
397
|
+
* // {{- if eq .Values.environment "production" }}
|
|
398
|
+
* // replicas: 3
|
|
399
|
+
* // resources:
|
|
400
|
+
* // limits:
|
|
401
|
+
* // memory: "1Gi"
|
|
402
|
+
* // {{- else }}
|
|
403
|
+
* // replicas: 1
|
|
404
|
+
* // resources:
|
|
405
|
+
* // limits:
|
|
406
|
+
* // memory: "512Mi"
|
|
407
|
+
* // {{- end }}
|
|
408
|
+
* ```
|
|
409
|
+
*
|
|
410
|
+
* @since 2.8.0
|
|
411
|
+
*/
|
|
412
|
+
export declare function helmIf(condition: string, content: string, elseContent?: string): string;
|
|
413
|
+
/**
|
|
414
|
+
* Creates a with block for scoped template context
|
|
415
|
+
*
|
|
416
|
+
* Generates Helm template expressions using 'with' to change the template context.
|
|
417
|
+
* Useful for accessing nested values without repeating the full path.
|
|
418
|
+
*
|
|
419
|
+
* @param {string} path - Path to set as new context (e.g., '.Values.database')
|
|
420
|
+
* @param {string} content - Content to render within the new context
|
|
421
|
+
* @param {string} [elseContent] - Optional content when path is empty/nil
|
|
422
|
+
* @returns {string} Complete Helm with/else/end template block
|
|
423
|
+
* @throws {Error} If path is not valid for Helm templates
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
* ```typescript
|
|
427
|
+
* const dbConfig = helmWith(
|
|
428
|
+
* '.Values.database',
|
|
429
|
+
* 'host: {{ .host }}\nport: {{ .port }}\nname: {{ .name }}',
|
|
430
|
+
* 'host: "localhost"\nport: 5432\nname: "defaultdb"'
|
|
431
|
+
* );
|
|
432
|
+
* // Returns:
|
|
433
|
+
* // {{- with .Values.database }}
|
|
434
|
+
* // host: {{ .host }}
|
|
435
|
+
* // port: {{ .port }}
|
|
436
|
+
* // name: {{ .name }}
|
|
437
|
+
* // {{- else }}
|
|
438
|
+
* // host: "localhost"
|
|
439
|
+
* // port: 5432
|
|
440
|
+
* // name: "defaultdb"
|
|
441
|
+
* // {{- end }}
|
|
442
|
+
* ```
|
|
443
|
+
*
|
|
444
|
+
* @since 2.8.0
|
|
445
|
+
*/
|
|
446
|
+
export declare function helmWith(path: string, content: string, elseContent?: string): string;
|
|
447
|
+
/**
|
|
448
|
+
* Creates a range loop for iterating over collections
|
|
449
|
+
*
|
|
450
|
+
* Generates Helm template expressions using 'range' to iterate over lists, maps, or other collections.
|
|
451
|
+
* Supports both simple iteration and key-value iteration for maps.
|
|
452
|
+
*
|
|
453
|
+
* @param {string} collection - Collection to iterate over (e.g., '.Values.items')
|
|
454
|
+
* @param {string} content - Content template for each iteration
|
|
455
|
+
* @param {object} [options] - Configuration options for the range loop
|
|
456
|
+
* @param {boolean} [options.keyValue=false] - Whether to iterate with key-value pairs
|
|
457
|
+
* @param {string} [options.keyVar='$key'] - Variable name for keys in key-value iteration
|
|
458
|
+
* @param {string} [options.valueVar='$value'] - Variable name for values in key-value iteration
|
|
459
|
+
* @param {string} [options.indexVar='$index'] - Variable name for index in indexed iteration
|
|
460
|
+
* @param {string} [options.itemVar='$item'] - Variable name for items in simple iteration
|
|
461
|
+
* @returns {string} Complete Helm range/end template block
|
|
462
|
+
* @throws {Error} If collection path is not valid
|
|
463
|
+
*
|
|
464
|
+
* @example
|
|
465
|
+
* ```typescript
|
|
466
|
+
* // Simple list iteration
|
|
467
|
+
* const serviceList = helmRange(
|
|
468
|
+
* '.Values.services',
|
|
469
|
+
* '- name: {{ .name }}\n port: {{ .port }}'
|
|
470
|
+
* );
|
|
471
|
+
*
|
|
472
|
+
* // Key-value map iteration
|
|
473
|
+
* const envVars = helmRange(
|
|
474
|
+
* '.Values.env',
|
|
475
|
+
* '- name: {{ $key }}\n value: {{ $value | quote }}',
|
|
476
|
+
* { keyValue: true }
|
|
477
|
+
* );
|
|
478
|
+
*
|
|
479
|
+
* // Indexed iteration
|
|
480
|
+
* const indexedItems = helmRange(
|
|
481
|
+
* '.Values.items',
|
|
482
|
+
* '{{ $index }}: {{ $item }}',
|
|
483
|
+
* { indexVar: '$i', itemVar: '$val' }
|
|
484
|
+
* );
|
|
485
|
+
* ```
|
|
486
|
+
*
|
|
487
|
+
* @since 2.8.0
|
|
488
|
+
*/
|
|
489
|
+
export declare function helmRange(collection: string, content: string, options?: {
|
|
490
|
+
keyValue?: boolean;
|
|
491
|
+
keyVar?: string;
|
|
492
|
+
valueVar?: string;
|
|
493
|
+
indexVar?: string;
|
|
494
|
+
itemVar?: string;
|
|
495
|
+
}): string;
|
|
496
|
+
/**
|
|
497
|
+
* Creates a complex conditional with multiple else-if branches
|
|
498
|
+
*
|
|
499
|
+
* Generates Helm template expressions for complex conditional logic with multiple branches.
|
|
500
|
+
* Useful for handling multiple environment configurations or feature flags.
|
|
501
|
+
*
|
|
502
|
+
* @param {Array<{condition: string, content: string}>} branches - Array of condition-content pairs
|
|
503
|
+
* @param {string} [defaultContent] - Default content when no conditions match
|
|
504
|
+
* @returns {string} Complete Helm if/else-if/else/end template block
|
|
505
|
+
* @throws {Error} If branches array is empty or contains invalid conditions
|
|
506
|
+
*
|
|
507
|
+
* @example
|
|
508
|
+
* ```typescript
|
|
509
|
+
* const envConfig = helmIfElseIf([
|
|
510
|
+
* {
|
|
511
|
+
* condition: 'eq .Values.environment "production"',
|
|
512
|
+
* content: 'replicas: 5\nresources.limits.memory: "2Gi"'
|
|
513
|
+
* },
|
|
514
|
+
* {
|
|
515
|
+
* condition: 'eq .Values.environment "staging"',
|
|
516
|
+
* content: 'replicas: 2\nresources.limits.memory: "1Gi"'
|
|
517
|
+
* }
|
|
518
|
+
* ], 'replicas: 1\nresources.limits.memory: "512Mi"');
|
|
519
|
+
* ```
|
|
520
|
+
*
|
|
521
|
+
* @since 2.8.0
|
|
522
|
+
*/
|
|
523
|
+
export declare function helmIfElseIf(branches: Array<{
|
|
524
|
+
condition: string;
|
|
525
|
+
content: string;
|
|
526
|
+
}>, defaultContent?: string): string;
|
|
527
|
+
export {};
|
|
298
528
|
//# sourceMappingURL=helm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helm.d.ts","sourceRoot":"","sources":["../../src/lib/helm.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK9C;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAQxE;AAeD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,IAAI;IACf,wCAAwC;;IAExC,oCAAoC;;IAEpC,0CAA0C;;IAE1C,kDAAkD;;CAEnD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GA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