@rockcarver/frodo-lib
Version:
A library to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.
167 lines • 7.77 kB
TypeScript
import { IdObjectSkeletonInterface, PatchOperationInterface } from '../api/ApiTypes';
import { State } from '../shared/State';
export type ManagedObject = {
/**
* Create managed object
* @param {string} type managed object type, e.g. teammember or alpha_user
* @param {IdObjectSkeletonInterface} moData managed object data
* @param {string} id managed object _id
*/
createManagedObject(type: string, moData: IdObjectSkeletonInterface, id?: string): Promise<IdObjectSkeletonInterface>;
/**
* Read managed object
* @param {string} type managed object type, e.g. alpha_user or user
* @param {string} id managed object id
* @param {string[]} id array of fields to include
* @returns {Promise<IdObjectSkeletonInterface>} a promise that resolves to an IdObjectSkeletonInterface
*/
readManagedObject(type: string, id: string, fields: string[]): Promise<IdObjectSkeletonInterface>;
/**
* Read all managed object of the specified type
* @param {string} type managed object type, e.g. alpha_user or user
* @param {string[]} fields array of fields to return
* @returns {Promise<IdObjectSkeletonInterface[]>} a promise that resolves to an array of IdObjectSkeletonInterfaces
*/
readManagedObjects(type: string, fields: string[]): Promise<IdObjectSkeletonInterface[]>;
/**
* Update managed object
* @param {string} type managed object type, e.g. alpha_user or user
* @param {string} id managed object id
* @param {IdObjectSkeletonInterface} moData managed object data
* @returns {Promise<IdObjectSkeletonInterface>} a promise that resolves to an IdObjectSkeletonInterface
*/
updateManagedObject(type: string, id: string, moData: IdObjectSkeletonInterface): Promise<IdObjectSkeletonInterface>;
/**
* Partially update managed object through a collection of patch operations.
* @param {string} type managed object type, e.g. alpha_user or user
* @param {string} id managed object id
* @param {PatchOperationInterface[]} operations collection of patch operations to perform on the object
* @param {string} rev managed object revision
* @returns {Promise<IdObjectSkeletonInterface>} a promise that resolves to an IdObjectSkeletonInterface
*/
updateManagedObjectProperties(type: string, id: string, operations: PatchOperationInterface[], rev?: string): Promise<IdObjectSkeletonInterface>;
/**
* Partially update multiple managed object through a collection of patch operations.
* @param {string} type managed object type, e.g. alpha_user or user
* @param {string} filter CREST search filter
* @param {PatchOperationInterface[]} operations collection of patch operations to perform on the object
* @param {string} rev managed object revision
* @param {number} pageSize page size
* @returns {Promise<IdObjectSkeletonInterface>} a promise that resolves to an IdObjectSkeletonInterface
*/
updateManagedObjectsProperties(type: string, filter: string, operations: PatchOperationInterface[], rev?: string, pageSize?: number): Promise<IdObjectSkeletonInterface[]>;
/**
* Delete managed object
* @param {string} type managed object type, e.g. alpha_user or user
* @param {string} id managed object id
* @returns {Promise<IdObjectSkeletonInterface>} a promise that resolves to an IdObjectSkeletonInterface
*/
deleteManagedObject(type: string, id: string): Promise<IdObjectSkeletonInterface>;
/**
* Delete managed objects by filter
* @param {string} type managed object type, e.g. alpha_user or user
* @param {string} filter filter
* @returns {Promise<number>} a promise that resolves the number of deleted objects
*/
deleteManagedObjects(type: string, filter: string): Promise<number>;
/**
* Query managed objects
* @param {string} type managed object type, e.g. alpha_user or user
* @param {string} filter CREST search filter
* @param {string[]} fields array of fields to return
* @return {Promise<IdObjectSkeletonInterface[]>} a promise resolving to an array of managed objects
*/
queryManagedObjects(type: string, filter?: string, fields?: string[], pageSize?: number): Promise<IdObjectSkeletonInterface[]>;
/**
* Resolve a managed object's uuid to a human readable username
* @param {string} type managed object type, e.g. teammember or alpha_user
* @param {string} id managed object _id
* @returns {Promise<string>} resolved username or uuid if any error occurs during reslution
*/
resolveUserName(type: string, id: string): Promise<string>;
/**
* Resolve a managed object's uuid to a human readable full name
* @param {string} type managed object type, e.g. teammember or alpha_user
* @param {string} id managed object _id
* @returns {Promise<string>} resolved full name or uuid if any error occurs during reslution
*/
resolveFullName(type: string, id: string): Promise<string>;
/**
* Resolve a perpetrator's uuid to a human readable string identifying the perpetrator
* @param {string} id managed object _id
* @returns {Promise<string>} resolved perpetrator descriptive string or uuid if any error occurs during reslution
*/
resolvePerpetratorUuid(id: string): Promise<string>;
};
declare const _default: (state: State) => ManagedObject;
export default _default;
export declare function createManagedObject({ type, id, moData, state, }: {
type: string;
id?: string;
moData: IdObjectSkeletonInterface;
state: State;
}): Promise<IdObjectSkeletonInterface>;
export declare function readManagedObject({ type, id, fields, state, }: {
type: string;
id: string;
fields: string[];
state: State;
}): Promise<IdObjectSkeletonInterface>;
export declare function readManagedObjects({ type, fields, state, }: {
type: string;
fields: string[];
state: State;
}): Promise<IdObjectSkeletonInterface[]>;
export declare function updateManagedObject({ type, id, moData, state, }: {
type: string;
id: string;
moData: IdObjectSkeletonInterface;
state: State;
}): Promise<IdObjectSkeletonInterface>;
export declare function updateManagedObjectProperties({ type, id, operations, rev, state, }: {
type: string;
id: string;
operations: PatchOperationInterface[];
rev?: string;
state: State;
}): Promise<IdObjectSkeletonInterface>;
export declare function updateManagedObjectsProperties({ type, filter, operations, rev, pageSize, state, }: {
type: string;
filter: string;
operations: PatchOperationInterface[];
rev?: string;
pageSize?: number;
state: State;
}): Promise<IdObjectSkeletonInterface[]>;
export declare function deleteManagedObject({ type, id, state, }: {
type: string;
id: string;
state: State;
}): Promise<IdObjectSkeletonInterface>;
export declare function deleteManagedObjects({ type, filter, state, }: {
type: string;
filter: string;
state: State;
}): Promise<number>;
export declare function queryManagedObjects({ type, filter, fields, pageSize, state, }: {
type: string;
filter?: string;
fields?: string[];
pageSize?: number;
state: State;
}): Promise<IdObjectSkeletonInterface[]>;
export declare function resolveUserName({ type, id, state, }: {
type: string;
id: string;
state: State;
}): Promise<string>;
export declare function resolveFullName({ type, id, state, }: {
type: string;
id: string;
state: State;
}): Promise<string>;
export declare function resolvePerpetratorUuid({ id, state, }: {
id: string;
state: State;
}): Promise<string>;
//# sourceMappingURL=ManagedObjectOps.d.ts.map