kubricate
Version:
A TypeScript framework for building reusable, type-safe Kubernetes infrastructure — without the YAML mess.
36 lines • 1.59 kB
TypeScript
import type { BaseLogger } from '@kubricate/core';
import type { BaseStack } from '../stack/BaseStack.js';
import type { ResourceEntry } from '../stack/ResourceComposer.js';
import type { KubricateConfig } from '../types.js';
export declare function getClassName(obj: unknown): string;
/**
* Utility functions for type validation.
*
* @param value - The value to check.
* @param type - The expected type of the value.
* @throws TypeError if the value is not of the expected type.
*/
export declare function validateString(value: unknown): asserts value is string;
export declare function getStackName(stack: BaseStack): string;
export interface StackInfo {
name: string;
type: string;
kinds: {
id: string;
kind: string;
}[];
}
export declare function extractKindFromResourceEntry(entry: ResourceEntry): string;
export declare function extractStackInfo(name: string, stack: BaseStack): StackInfo;
export declare function extractStackInfoFromConfig(config: KubricateConfig): StackInfo[];
export type Subcommand = 'generate' | 'secret validate' | 'secret apply';
export declare function verboseCliConfig(options: Record<string, unknown>, logger: BaseLogger, subcommand?: Subcommand): void;
/**
* Validate Stack Id or Resource Id
* @param input * @returns {string} - The sanitized string.
*
* @ref https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
* The limit characters for labels is 63.
*/
export declare function validateId(input: string, subject?: string): void;
//# sourceMappingURL=utils.d.ts.map