/** * @module minions-sdk/lifecycle * Minion lifecycle utilities — create, update, soft delete, hard delete, restore. */ import type { Minion, CreateMinionInput, UpdateMinionInput, MinionType, ValidationResult } from '../types/index.js'; import type { RelationGraph } from '../relations/index.js'; /** * Create a new Minion instance from input, generating id and timestamps. * Validates fields against the provided MinionType schema. * @param input - The creation input * @param type - The MinionType to validate against * @returns An object with the created minion and any validation result */ export declare function createMinion(input: CreateMinionInput, type: MinionType): { minion: Minion; validation: ValidationResult; }; /** * Update an existing Minion with new values. * Validates updated fields against the provided MinionType schema. * @param minion - The existing minion * @param input - The update input * @param type - The MinionType to validate against * @returns An object with the updated minion and any validation result */ export declare function updateMinion(minion: Minion, input: UpdateMinionInput, type: MinionType): { minion: Minion; validation: ValidationResult; }; /** * Soft-delete a minion by setting deletedAt/deletedBy. * @param minion - The minion to soft-delete * @param deletedBy - Optional identifier of who deleted it * @returns The soft-deleted minion */ export declare function softDelete(minion: Minion, deletedBy?: string): Minion; /** * Hard-delete a minion by removing all of its relations from the graph. * * **Important:** This function only cleans up the relation graph. The caller * is responsible for removing the minion object itself from whatever storage * layer is in use (array, database, etc.). * * @param minion - The minion to hard-delete * @param graph - The RelationGraph to clean up */ export declare function hardDelete(minion: Minion, graph: RelationGraph): void; /** * Restore a soft-deleted minion. * @param minion - The soft-deleted minion * @returns The restored minion */ export declare function restoreMinion(minion: Minion): Minion; /** * Apply default values from the schema to a fields object. */ export declare function applyDefaults(fields: Record, type: MinionType): Record; //# sourceMappingURL=index.d.ts.map