33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
/**
|
|
* Helpers for audit logs with before/after snapshots of changed fields.
|
|
*/
|
|
export type AuditFieldDiff<T extends Record<string, unknown>> = {
|
|
changed: string[];
|
|
before: Partial<T>;
|
|
after: Partial<T>;
|
|
};
|
|
/** Builds a before/after diff for the given keys when values differ. */
|
|
export declare function diffFields<T extends Record<string, unknown>>(before: T, after: T, keys: (keyof T)[]): AuditFieldDiff<T> | null;
|
|
/** Picks a subset of fields from a settings or config object. */
|
|
export declare function pickFields<T extends Record<string, unknown>>(source: T, keys: (keyof T)[]): Partial<T>;
|
|
export declare function userAccountFlagsSnapshot(user: {
|
|
is_enabled: boolean;
|
|
is_account_non_expired: boolean;
|
|
is_account_non_locked: boolean;
|
|
is_credentials_non_expired: boolean;
|
|
}): {
|
|
is_enabled: boolean;
|
|
is_account_non_expired: boolean;
|
|
is_account_non_locked: boolean;
|
|
is_credentials_non_expired: boolean;
|
|
};
|
|
export declare function userSecurityFlagsSnapshot(user: {
|
|
withdrawals_suspended: boolean;
|
|
under_surveillance: boolean;
|
|
security_suspended_at: Date | null;
|
|
}): {
|
|
withdrawals_suspended: boolean;
|
|
under_surveillance: boolean;
|
|
security_suspended_at: string | null;
|
|
};
|
|
//# sourceMappingURL=auditDiff.d.ts.map
|