@rockcarver/frodo-lib
Version:
A library to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.
197 lines • 8.82 kB
TypeScript
import { VariableExpressionType, VariableSkeleton } from '../../api/cloud/VariablesApi';
import { State } from '../../shared/State';
import { ExportMetaData } from '../OpsTypes';
export type Variable = {
/**
* Read variable by id/name
* @param {string} variableId variable id/name
* @param {boolean} noDecode Do not decode value (default: false)
* @returns {Promise<VariableSkeleton>} a promise that resolves to a variable object
*/
readVariable(variableId: string, noDecode?: boolean): Promise<VariableSkeleton>;
/**
* Read all variables
* @param {boolean} noDecode Do not decode values (default: false)
* @returns {Promise<VariableSkeleton[]>} a promise that resolves to an array of variable objects
*/
readVariables(noDecode?: boolean): Promise<VariableSkeleton[]>;
/**
* Export variable. The response can be saved to file as is.
* @param {string} variableId variable id/name
* @param {boolean} noDecode Do not decode value (default: false)
* @returns {Promise<VariablesExportInterface>} Promise resolving to a VariablesExportInterface object.
*/
exportVariable(variableId: string, noDecode?: boolean): Promise<VariablesExportInterface>;
/**
* Export all variables
* @param {boolean} noDecode Do not decode values (default: false)
* @returns {Promise<VariablesExportInterface>} Promise resolving to an VariablesExportInterface object.
*/
exportVariables(noDecode?: boolean): Promise<VariablesExportInterface>;
/**
* Import variable by id
* @param {string} variableId variable id/name
* @param {VariablesExportInterface} importData import data
* @returns {Promise<VariableSkeleton>} imported variable object
*/
importVariable(variableId: string, importData: VariablesExportInterface): Promise<VariableSkeleton>;
/**
* Import variables
* @param {VariablesExportInterface} importData import data
* @returns {Promise<VariableSkeleton[]>} array of imported variable objects
*/
importVariables(importData: VariablesExportInterface): Promise<VariableSkeleton[]>;
/**
* Create variable
* @param {string} variableId variable id/name
* @param {string} value variable value
* @param {string} description variable description
* @param {VariableExpressionType} expressionType type of the value
* @param {boolean} noEncode do not encode if passing a pre-encoded (base64) value
* @returns {Promise<VariableSkeleton>} a promise that resolves to a variable object
*/
createVariable(variableId: string, value: string, description: string, expressionType?: VariableExpressionType, noEncode?: boolean): Promise<VariableSkeleton>;
/**
* Update or create variable
* @param {string} variableId variable id/name
* @param {string} value variable value
* @param {string} description variable description
* @param {VariableExpressionType} expressionType type of the value
* @param {boolean} noEncode do not encode if passing a pre-encoded (base64) value
* @returns {Promise<VariableSkeleton>} a promise that resolves to a variable object
*/
updateVariable(variableId: string, value: string, description: string, expressionType?: VariableExpressionType, noEncode?: boolean): Promise<VariableSkeleton>;
/**
* Update variable description
* @param {string} variableId variable id/name
* @param {string} description variable description
* @returns {Promise<VariableSkeleton>} a promise that resolves to a status object
*/
updateVariableDescription(variableId: string, description: string): Promise<VariableSkeleton>;
/**
* Delete variable by id/name
* @param {string} variableId variable id/name
* @returns {Promise<VariableSkeleton>} a promise that resolves to a variable object
*/
deleteVariable(variableId: string): Promise<VariableSkeleton>;
/**
* Get variable by id/name
* @param {string} variableId variable id/name
* @returns {Promise<VariableSkeleton>} a promise that resolves to a variable object
* @deprecated since v2.0.0 use {@link Variable.readVariable | readVariable} instead
* ```javascript
* readVariable(variableId: string): Promise<VariableSkeleton>
* ```
* @group Deprecated
*/
getVariable(variableId: string): Promise<VariableSkeleton>;
/**
* Get all variables
* @returns {Promise<VariableSkeleton[]>} a promise that resolves to an array of variable objects
* @deprecated since v2.0.0 use {@link Variable.readVariables | readVariables} instead
* ```javascript
* readVariables(): Promise<VariableSkeleton[]>
* ```
* @group Deprecated
*/
getVariables(): Promise<VariableSkeleton[]>;
/**
* Create variable
* @param {string} variableId variable id/name
* @param {string} valueBase64 base64-encoded variable value
* @param {string} description variable description
* @param {VariableExpressionType} expressionType type of the value
* @returns {Promise<VariableSkeleton>} a promise that resolves to a variable object
* @deprecated since v2.0.0 use {@link Variable.createVariable | createVariable} instead
* ```javascript
* createVariable(variableId: string, value: string, description: string, expressionType?: VariableExpressionType): Promise<VariableSkeleton>
* ```
* @group Deprecated
*/
putVariable(variableId: string, valueBase64: string, description: string, expressionType?: VariableExpressionType): Promise<VariableSkeleton>;
/**
* Set variable description
* @param {string} variableId variable id/name
* @param {string} description variable description
* @returns {Promise<any>} a promise that resolves to an empty string
* @deprecated since v2.0.0 use {@link Variable.updateVariableDescription | updateVariableDescription} instead
* ```javascript
* updateVariableDescription(variableId: string, description: string): Promise<any>
* ```
* @group Deprecated
*/
setVariableDescription(variableId: string, description: string): Promise<any>;
};
declare const _default: (state: State) => Variable;
export default _default;
export interface VariablesExportInterface {
meta?: ExportMetaData;
variable: Record<string, VariableSkeleton>;
}
export declare function createVariablesExportTemplate({ state, }: {
state: State;
}): VariablesExportInterface;
export declare function readVariable({ variableId, noDecode, state, }: {
variableId: string;
noDecode?: boolean;
state: State;
}): Promise<VariableSkeleton>;
export declare function readVariables({ noDecode, state, }: {
noDecode?: boolean;
state: State;
}): Promise<VariableSkeleton[]>;
export declare function exportVariable({ variableId, noDecode, state, }: {
variableId: string;
noDecode: boolean;
state: State;
}): Promise<VariablesExportInterface>;
export declare function exportVariables({ noDecode, state, }: {
noDecode: boolean;
state: State;
}): Promise<VariablesExportInterface>;
/**
* Import variable
* @param {string} variableId variable id/name
* @param {VariablesExportInterface} importData import data
* @returns {Promise<VariableSkeleton[]>} array of imported variable objects
*/
export declare function importVariable({ variableId, importData, state, }: {
variableId?: string;
importData: VariablesExportInterface;
state: State;
}): Promise<VariableSkeleton>;
/**
* Import variables
* @param {VariablesExportInterface} importData import data
* @returns {Promise<VariableSkeleton[]>} array of imported variable objects
*/
export declare function importVariables({ importData, state, }: {
importData: VariablesExportInterface;
state: State;
}): Promise<VariableSkeleton[]>;
export declare function createVariable({ variableId, value, description, expressionType, noEncode, state, }: {
variableId: string;
value: string;
description?: string;
expressionType?: VariableExpressionType;
noEncode?: boolean;
state: State;
}): Promise<VariableSkeleton>;
export declare function updateVariable({ variableId, value, description, expressionType, noEncode, state, }: {
variableId: string;
value: string;
description?: string;
expressionType?: VariableExpressionType;
noEncode?: boolean;
state: State;
}): Promise<VariableSkeleton>;
export declare function updateVariableDescription({ variableId, description, state, }: {
variableId: string;
description: string;
state: State;
}): Promise<any>;
export declare function deleteVariable({ variableId, state, }: {
variableId: string;
state: State;
}): Promise<VariableSkeleton>;
//# sourceMappingURL=VariablesOps.d.ts.map