@rockcarver/frodo-lib
Version:
A library to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.
273 lines • 10.7 kB
TypeScript
import { type NodeSkeleton, type NodeTypeSkeleton } from '../api/NodeApi';
import { State } from '../shared/State';
import { ExportMetaData } from './OpsTypes';
export type Node = {
/**
* Read all node types
* @returns {Promise<any>} a promise that resolves to an array of node type objects
*/
readNodeTypes(): Promise<any>;
/**
* Read all nodes
* @returns {Promise<NodeSkeleton[]>} a promise that resolves to an object containing an array of node objects
*/
readNodes(): Promise<NodeSkeleton[]>;
/**
* Read all nodes by type
* @param {string} nodeType node type
* @returns {Promise<NodeSkeleton[]>} a promise that resolves to an object containing an array of node objects of the requested type
*/
readNodesByType(nodeType: string): Promise<NodeSkeleton[]>;
/**
* Read node by uuid and type
* @param {string} nodeId node uuid
* @param {string} nodeType node type
* @returns {Promise<NodeSkeleton>} a promise that resolves to a node object
*/
readNode(nodeId: string, nodeType: string): Promise<NodeSkeleton>;
/**
* Export all nodes
* @returns {Promise<NodeExportInterface>} a promise that resolves to an array of node objects
*/
exportNodes(): Promise<NodeExportInterface>;
/**
* Create node by type
* @param {string} nodeType node type
* @param {NodeSkeleton} nodeData node object
* @returns {Promise<NodeSkeleton>} a promise that resolves to an object containing a node object
*/
createNode(nodeType: string, nodeData: NodeSkeleton): Promise<NodeSkeleton>;
/**
* Update or create node by uuid and type
* @param {string} nodeId node uuid
* @param {string} nodeType node type
* @param {NodeSkeleton} nodeData node object
* @returns {Promise<NodeSkeleton>} a promise that resolves to an object containing a node object
*/
updateNode(nodeId: string, nodeType: string, nodeData: NodeSkeleton): Promise<NodeSkeleton>;
/**
* Delete node by uuid and type
* @param {string} nodeId node uuid
* @param {string} nodeType node type
* @returns {Promise<NodeSkeleton>} a promise that resolves to an object containing a node object
*/
deleteNode(nodeId: string, nodeType: string): Promise<NodeSkeleton>;
/**
* Find all node configuration objects that are no longer referenced by any tree
* @returns {Promise<NodeSkeleton[]>} a promise that resolves to an array of orphaned nodes
*/
findOrphanedNodes(): Promise<NodeSkeleton[]>;
/**
* Remove orphaned nodes
* @param {NodeSkeleton[]} orphanedNodes Pass in an array of orphaned node configuration objects to remove
* @returns {Promise<NodeSkeleton[]>} a promise that resolves to an array nodes that encountered errors deleting
*/
removeOrphanedNodes(orphanedNodes: NodeSkeleton[]): Promise<NodeSkeleton[]>;
/**
* Analyze if a node type is premium.
* @param {string} nodeType Node type
* @returns {boolean} True if the node type is premium, false otherwise.
*/
isPremiumNode(nodeType: string): boolean;
/**
* Analyze if a node type is a cloud-only node.
* @param {string} nodeType Node type
* @returns {boolean} True if the node type is cloud-only, false otherwise.
*/
isCloudOnlyNode(nodeType: string): boolean;
/**
* Analyze if a node type is a cloud-excluded node. Cloud excluded nodes are OOTB nodes in self-hosted AM deployments but have been excluded in cloud.
* @param {string} nodeType node type.
* @returns {boolean} True if node type is cloud-excluded, false otherwise.
*/
isCloudExcludedNode(nodeType: string): boolean;
/**
* Analyze if a node type has been deprecated
* @param {string} nodeType node type.
* @returns {boolean} True if node type is deprecated, false otherwise.
*/
isDeprecatedNode(nodeType: string): boolean;
/**
* Analyze if a node is custom.
* @param {string} nodeType Node type
* @returns {boolean} True if the node type is custom, false otherwise.
*/
isCustomNode(nodeType: string): boolean;
/**
* Get a node's classifications, which can be one or multiple of:
* - standard: can run on any instance of a ForgeRock platform
* - cloud: utilize nodes, which are exclusively available in the ForgeRock Identity Cloud
* - premium: utilizes nodes, which come at a premium
* @param {string} nodeType Node type
* @returns {NodeClassificationType[]} an array of one or multiple classifications
*/
getNodeClassification(nodeType: string): NodeClassificationType[];
};
declare const _default: (state: State) => Node;
export default _default;
export interface NodeExportInterface {
meta?: ExportMetaData;
node: Record<string, NodeSkeleton>;
}
/**
* Create an empty node export template
* @returns {NodeExportInterface} an empty node export template
*/
export declare function createNodeExportTemplate({ state, }: {
state: State;
}): NodeExportInterface;
export type NodeClassificationType = 'standard' | 'custom' | 'cloud' | 'excluded' | 'premium' | 'deprecated';
export declare enum NodeClassification {
STANDARD = "standard",
CUSTOM = "custom",
CLOUD = "cloud",
EXCLUDED = "excluded",
PREMIUM = "premium",
DEPRECATED = "deprecated"
}
/**
* Read all node types
* @returns {Promise<NodeTypeSkeleton[]>} a promise that resolves to an array of node type objects
*/
export declare function readNodeTypes({ state, }: {
state: State;
}): Promise<NodeTypeSkeleton[]>;
/**
* Get all nodes
* @returns {Promise<NodeSkeleton[]>} a promise that resolves to an object containing an array of node objects
*/
export declare function readNodes({ state, }: {
state: State;
}): Promise<NodeSkeleton[]>;
/**
* Read all nodes by type
* @param {string} nodeType node type
* @returns {Promise<NodeSkeleton[]>} a promise that resolves to an object containing an array of node objects of the requested type
*/
export declare function readNodesByType({ nodeType, state, }: {
nodeType: string;
state: State;
}): Promise<NodeSkeleton[]>;
/**
* Read node
* @param {String} nodeId node uuid
* @param {String} nodeType node type
* @returns {Promise} a promise that resolves to a node object
*/
export declare function readNode({ nodeId, nodeType, state, }: {
nodeId: string;
nodeType: string;
state: State;
}): Promise<NodeSkeleton>;
/**
* Export all nodes
* @returns {Promise<NodeExportInterface>} a promise that resolves to an array of node objects
*/
export declare function exportNodes({ state, }: {
state: State;
}): Promise<NodeExportInterface>;
/**
* Create node
* @param {string} nodeId node uuid
* @param {string} nodeType node type
* @param {NodeSkeleton} nodeData node object
* @returns {Promise<NodeSkeleton>} a promise that resolves to an object containing a node object
*/
export declare function createNode({ nodeId, nodeType, nodeData, state, }: {
nodeId?: string;
nodeType: string;
nodeData: NodeSkeleton;
state: State;
}): Promise<NodeSkeleton>;
/**
* Put node by uuid and type
* @param {string} nodeId node uuid
* @param {string} nodeType node type
* @param {object} nodeData node object
* @returns {Promise} a promise that resolves to an object containing a node object
*/
export declare function updateNode({ nodeId, nodeType, nodeData, state, }: {
nodeId: string;
nodeType: string;
nodeData: NodeSkeleton;
state: State;
}): Promise<NodeSkeleton>;
/**
* Delete node by uuid and type
* @param {String} nodeId node uuid
* @param {String} nodeType node type
* @returns {Promise} a promise that resolves to an object containing a node object
*/
export declare function deleteNode({ nodeId, nodeType, state, }: {
nodeId: string;
nodeType: string;
state: State;
}): Promise<NodeSkeleton>;
/**
* Find all node configuration objects that are no longer referenced by any tree
* @returns {Promise<NodeSkeleton[]>} a promise that resolves to an array of orphaned nodes
*/
export declare function findOrphanedNodes({ state, }: {
state: State;
}): Promise<NodeSkeleton[]>;
/**
* Remove orphaned nodes
* @param {NodeSkeleton[]} orphanedNodes Pass in an array of orphaned node configuration objects to remove
* @returns {Promise<NodeSkeleton[]>} a promise that resolves to an array nodes that encountered errors deleting
*/
export declare function removeOrphanedNodes({ orphanedNodes, state, }: {
orphanedNodes: NodeSkeleton[];
state: State;
}): Promise<NodeSkeleton[]>;
/**
* Analyze if a node is a premium node.
* @param {string} nodeType Node type
* @returns {boolean} True if the node type is premium, false otherwise.
*/
export declare function isPremiumNode(nodeType: string): boolean;
/**
* Analyze if a node is a cloud-only node.
* @param {string} nodeType Node type
* @returns {boolean} True if the node type is cloud-only, false otherwise.
*/
export declare function isCloudOnlyNode(nodeType: string): boolean;
/**
* Analyze if a node is a cloud-excluded node. Cloud excluded nodes are OOTB nodes in self-hosted AM deployments but have been excluded in cloud.
* @param {{string, State}} param0 object containing node type and state.
* @returns {boolean} True if node type is cloud-excluded, false otherwise.
*/
export declare function isCloudExcludedNode({ nodeType, state, }: {
nodeType: string;
state: State;
}): boolean;
/**
* Analyze if node has been deprecated
* @param {{string, State}} param0 object containing node type and state.
* @returns {boolean} True if node type is deprecated, false otherwise.
*/
export declare function isDeprecatedNode({ nodeType, state, }: {
nodeType: string;
state: State;
}): boolean;
/**
* Analyze if a node is custom.
* @param {string} nodeType Node type
* @returns {boolean} True if the node type is custom, false otherwise.
*/
export declare function isCustomNode({ nodeType, state, }: {
nodeType: string;
state: State;
}): boolean;
/**
* Get a node's classifications, which can be one or multiple of:
* - standard: can run on any instance of a ForgeRock platform
* - cloud: utilize nodes, which are exclusively available in the ForgeRock Identity Cloud
* - premium: utilizes nodes, which come at a premium
* @param {string} nodeType Node type
* @returns {NodeClassification[]} an array of one or multiple classifications
*/
export declare function getNodeClassification({ nodeType, state, }: {
nodeType: string;
state: State;
}): NodeClassificationType[];
//# sourceMappingURL=NodeOps.d.ts.map