/**
 * Core Utilities
 *
 * Shared utility functions used across the BFF.
 */

// Array utilities
export { chunkArray, groupBy, uniqueBy, normalizeToArray } from "./array.util.js";

// Error utilities
export { extractErrorMessage } from "./error.util.js";
export {
  safeOperation,
  OperationCriticality,
  type SafeOperationOptions,
  type SafeOperationResult,
} from "./safe-operation.util.js";

// Retry utilities
export {
  withRetry,
  withRetrySafe,
  sleep,
  calculateBackoffDelay,
  getRateLimitDelay,
  RetryableErrors,
  type RetryOptions,
  type RetryResult,
} from "./retry.util.js";

// Validation utilities
export { parseUuidOrThrow } from "./validation.util.js";

// SSO utilities
export { sanitizeWhmcsRedirectPath } from "./sso.util.js";
