import { IdObjectSkeletonInterface } from '../api/ApiTypes'; import { type ManagedObjectPatchOperationInterface } from '../api/ManagedObjectApi'; 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; /** * 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} a promise that resolves to an IdObjectSkeletonInterface */ readManagedObject(type: string, id: string, fields: string[]): Promise; /** * 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} a promise that resolves to an array of IdObjectSkeletonInterfaces */ readManagedObjects(type: string, fields: string[]): Promise; /** * 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} a promise that resolves to an IdObjectSkeletonInterface */ updateManagedObject(type: string, id: string, moData: IdObjectSkeletonInterface): Promise; /** * 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 {ManagedObjectPatchOperationInterface[]} operations collection of patch operations to perform on the object * @param {string} rev managed object revision * @returns {Promise} a promise that resolves to an IdObjectSkeletonInterface */ updateManagedObjectProperties(type: string, id: string, operations: ManagedObjectPatchOperationInterface[], rev?: string): Promise; /** * 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 {ManagedObjectPatchOperationInterface[]} operations collection of patch operations to perform on the object * @param {string} rev managed object revision * @param {number} pageSize page size * @returns {Promise} a promise that resolves to an IdObjectSkeletonInterface */ updateManagedObjectsProperties(type: string, filter: string, operations: ManagedObjectPatchOperationInterface[], rev?: string, pageSize?: number): Promise; /** * Delete managed object * @param {string} type managed object type, e.g. alpha_user or user * @param {string} id managed object id * @returns {Promise} a promise that resolves to an IdObjectSkeletonInterface */ deleteManagedObject(type: string, id: string): Promise; /** * Delete managed objects by filter * @param {string} type managed object type, e.g. alpha_user or user * @param {string} filter filter * @returns {Promise} a promise that resolves the number of deleted objects */ deleteManagedObjects(type: string, filter: string): Promise; /** * 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} a promise resolving to an array of managed objects */ queryManagedObjects(type: string, filter?: string, fields?: string[], pageSize?: number): Promise; /** * 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} resolved username or uuid if any error occurs during reslution */ resolveUserName(type: string, id: string): Promise; /** * 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} resolved full name or uuid if any error occurs during reslution */ resolveFullName(type: string, id: string): Promise; /** * Resolve a perpetrator's uuid to a human readable string identifying the perpetrator * @param {string} id managed object _id * @returns {Promise} resolved perpetrator descriptive string or uuid if any error occurs during reslution */ resolvePerpetratorUuid(id: string): Promise; }; 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; export declare function readManagedObject({ type, id, fields, state, }: { type: string; id: string; fields: string[]; state: State; }): Promise; export declare function readManagedObjects({ type, fields, state, }: { type: string; fields: string[]; state: State; }): Promise; export declare function updateManagedObject({ type, id, moData, state, }: { type: string; id: string; moData: IdObjectSkeletonInterface; state: State; }): Promise; export declare function updateManagedObjectProperties({ type, id, operations, rev, state, }: { type: string; id: string; operations: ManagedObjectPatchOperationInterface[]; rev?: string; state: State; }): Promise; export declare function updateManagedObjectsProperties({ type, filter, operations, rev, pageSize, state, }: { type: string; filter: string; operations: ManagedObjectPatchOperationInterface[]; rev?: string; pageSize?: number; state: State; }): Promise; export declare function deleteManagedObject({ type, id, state, }: { type: string; id: string; state: State; }): Promise; export declare function deleteManagedObjects({ type, filter, state, }: { type: string; filter: string; state: State; }): Promise; export declare function queryManagedObjects({ type, filter, fields, pageSize, state, }: { type: string; filter?: string; fields?: string[]; pageSize?: number; state: State; }): Promise; export declare function resolveUserName({ type, id, state, }: { type: string; id: string; state: State; }): Promise; export declare function resolveFullName({ type, id, state, }: { type: string; id: string; state: State; }): Promise; export declare function resolvePerpetratorUuid({ id, state, }: { id: string; state: State; }): Promise; //# sourceMappingURL=ManagedObjectOps.d.ts.map