25 lines
841 B
TypeScript
25 lines
841 B
TypeScript
export declare enum FormatType {
|
|
"JSON" = 0,
|
|
"XML" = 1
|
|
}
|
|
/**
|
|
* Takes content as string and format type (xml, json).
|
|
* Exposes getSecret method to get value of specific secret in object and set it as secret.
|
|
*/
|
|
export declare class SecretParser {
|
|
private dom;
|
|
private contentType;
|
|
constructor(content: string, contentType: FormatType);
|
|
/**
|
|
*
|
|
* @param key jsonpath or xpath depending on content type
|
|
* @param isSecret should the value parsed be a secret. Deafult: true
|
|
* @param variableName optional. If provided value will be exported with this variable name
|
|
* @returns a string value or empty string if key not found
|
|
*/
|
|
getSecret(key: string, isSecret?: boolean, variableName?: string): string;
|
|
private extractJsonPath;
|
|
private extractXmlPath;
|
|
private handleSecret;
|
|
}
|