/** * Model types for profiling request management. * * Represents `pnova__Profiling_Request__c` records used by the * ProfileRequestService to list and cancel queued profiling requests. * * @module models/profile-request-types */ /** * Status values for a profiling request record. * * The ISV `Prop_RequestStatus__c` restricted picklist has exactly 4 values. * Source: Profiling_Request__c/fields/Prop_RequestStatus__c.field-meta.xml */ export type ProfileRequestStatus = 'Queued' | 'Canceled' | 'Completed' | 'Rejected'; /** * Statuses that are eligible for cancellation. * * Only Queued requests can be cancelled. All other statuses are terminal. */ export declare const CANCELLABLE_STATUSES: ProfileRequestStatus[]; /** * Statuses that are eligible for deletion. * * Only Canceled and Rejected requests can be deleted — these never produced * a summary. Completed requests are protected because reprofiling resolves * the profiling user from the most recently completed request. Completed * requests are cascade-deleted when their summary is purged. */ export declare const DELETABLE_STATUSES: ProfileRequestStatus[]; /** * Represents a Salesforce profiling request record (pnova__Profiling_Request__c). */ export type IProfileRequest = { /** Salesforce record ID */ id: string; /** Request name/identifier */ name: string; /** Current status: Queued, Canceled, Completed, Rejected */ status: ProfileRequestStatus; /** Associated profiling definition ID */ definitionId: string; /** Associated definition name */ definitionName: string; /** Object API name being profiled */ objectName: string; /** When the request was created (ISO 8601) */ createdDate: string; /** When the request was last modified (ISO 8601) */ lastModifiedDate: string; /** User who submitted the request */ submittedBy: string; }; /** * Options for listing profiling requests. */ export type ProfileRequestListOptions = { /** Filter by status */ status?: ProfileRequestStatus | ProfileRequestStatus[]; /** Pagination limit (default 25, max 200) */ limit?: number; /** Pagination offset */ offset?: number; }; /** * Options for cancelling profiling requests. */ export type ProfileRequestCancelOptions = { /** Cancel all cancellable requests */ all?: boolean; /** Cancel specific request IDs */ requestIds?: string[]; /** Dry run -- return what would be canceled without acting */ dryRun?: boolean; }; /** * Result of a cancel operation. */ export type ProfileRequestCancelResult = { /** Requests that were canceled (or would be in dry-run) */ cancelled: IProfileRequest[]; /** Requests that failed to cancel */ failed: Array<{ id: string; error: string; }>; /** Whether this was a dry run */ dryRun: boolean; /** Total count of cancellable requests found */ totalCancellable: number; }; /** * Options for deleting profiling requests. */ export type ProfileRequestDeleteOptions = { /** Delete all deletable (Canceled and Rejected) requests */ all?: boolean; /** Delete specific request IDs */ requestIds?: string[]; /** Dry run -- return what would be deleted without acting */ dryRun?: boolean; }; /** * Result of a delete operation. */ export type ProfileRequestDeleteResult = { /** Requests that were deleted (or would be in dry-run) */ deleted: IProfileRequest[]; /** Requests that failed to delete */ failed: Array<{ id: string; error: string; }>; /** Whether this was a dry run */ dryRun: boolean; /** Total count of deletable requests found */ totalDeletable: number; };