import { ApiTriggerType } from '../types/api/index.js'; import type { DatabaseEngine } from './capacityPolicy.js'; export declare const LIFECYCLE_TERMINAL_STATES: readonly ["ready", "failed", "cancelled"]; export declare const LIFECYCLE_NON_TERMINAL_STATES: readonly ["pending", "provisioning", "migrating", "retiring"]; export declare const LIFECYCLE_STATES: readonly ["pending", "provisioning", "migrating", "retiring", "ready", "failed", "cancelled"]; export declare const LIFECYCLE_MIGRATION_STATES: readonly ["pending", "migrated", "failed"]; export declare const LIFECYCLE_OPERATIONS: readonly ["ensure_database", "migrate_schema", "retire_database", "ensure_physical_database_instance"]; export declare const DATABASE_LIFECYCLE_MANAGED_BY = "database_lifecycle"; export declare const NATIVE_DB_AUTH_DESCRIPTOR_VERSION: 3; export declare const NATIVE_DB_CONNECTOR_ROLE_NAME_PREFIX = "superblocks-native-db-connector"; export declare const NATIVE_DB_IAM_AUTH_MODE: "aws_iam_role"; export declare const NATIVE_DB_IDENTIFIER_HASH_DOMAIN = "superblocks-native-db:v1"; export declare const DATABASE_LIFECYCLE_CAPABILITY_MANAGED_IAM_V1 = "managed-IAM-v1"; export declare function isLifecycleManagedIntegrationAllowedForApiTrigger(triggerType: ApiTriggerType, managedBy: string | null | undefined): boolean; export declare const DATABASE_LIFECYCLE_TAG_OPERATIONS = "databaseLifecycle:operations"; export declare const DATABASE_LIFECYCLE_TAG_ENGINES = "databaseLifecycle:engines"; export declare const DATABASE_LIFECYCLE_TAG_CAPABILITIES = "databaseLifecycle:capabilities"; export { CapacityPolicyValidationError, DATABASE_ENGINES, DATABASE_LIFECYCLE_TAG_CAPACITY_POLICIES, PHYSICAL_DATABASE_CAPACITY_THRESHOLD_TYPES, computePhysicalDatabasePoolKey, encodeCapacityPolicyTag, parseCapacityPolicyTag, parseCapacityPolicyTags, validateCapacityPolicyCompatibility, type DatabaseEngine, type PhysicalDatabaseCapacityPolicy, type PhysicalDatabaseCapacityThresholdType, type PhysicalDatabasePoolKey } from './capacityPolicy.js'; export { DATABASE_LIFECYCLE_TAG_AGENT_NAME, PhysicalPoolIdentityError, parsePhysicalPoolAgentNameTag } from './physicalPoolIdentity.js'; export type LifecycleOperation = (typeof LIFECYCLE_OPERATIONS)[number]; export type LifecycleTerminalState = (typeof LIFECYCLE_TERMINAL_STATES)[number]; export type LifecycleNonTerminalState = (typeof LIFECYCLE_NON_TERMINAL_STATES)[number]; export type LifecycleState = (typeof LIFECYCLE_STATES)[number]; export type LifecycleMigrationState = (typeof LIFECYCLE_MIGRATION_STATES)[number]; export declare const LIFECYCLE_ERROR_CODES: readonly ["unsupported_provider_capability", "backend_locked", "policy_blocked", "credential_resolution_failed", "terraform_failed", "migration_failed", "callback_failed", "stale_dispatch"]; export type LifecycleErrorCode = (typeof LIFECYCLE_ERROR_CODES)[number]; export type PhysicalMasterCredentialRef = { resolver: 'aws_secrets_manager'; ref: string; field?: string; }; export type NativeDbIamDescriptor = { application_id: string; auth_descriptor_version: typeof NATIVE_DB_AUTH_DESCRIPTOR_VERSION; auth_mode: typeof NATIVE_DB_IAM_AUTH_MODE; aws_account_id: string; binding_id: string; cluster_resource_id: string; connector_role_arn: string; database: string; host: string; port: number; region: string; username: string; }; export type DatabaseRequirement = { logicalName: string; engine: DatabaseEngine; version?: string; sizing?: Record; extensions?: readonly string[]; replicaCount?: number; migrationDirectory?: string; }; type DatabaseBindingBase = { id: string; bindingKey: string; requirementKey: string; logicalName: string; applicationId: string; profile: string; desiredSpecHash: string; migrationState: LifecycleMigrationState; }; export type ReadyDatabaseBinding = DatabaseBindingBase & { lifecycleState: 'ready'; connectionMetadata: Record; }; export type IncompleteDatabaseBinding = DatabaseBindingBase & { lifecycleState: Exclude; connectionMetadata?: Record; }; export type DatabaseBinding = ReadyDatabaseBinding | IncompleteDatabaseBinding; export declare function isReadyDatabaseBinding(binding: DatabaseBinding): binding is ReadyDatabaseBinding; export type LifecycleRequest = { id: string; operation: LifecycleOperation; bindingKey: string; requirementKey: string; desiredSpecHash: string; state: LifecycleState; }; export declare const PHYSICAL_DATABASE_INSTANCE_STATUSES: readonly ["active", "draining", "retired"]; export type PhysicalDatabaseInstanceStatus = (typeof PHYSICAL_DATABASE_INSTANCE_STATUSES)[number]; export type PhysicalDatabaseInstance = { id: string; organizationId: string; region: string; engine: DatabaseEngine; provisionResourceKey: string; endpoint: string; masterCredentialRef: PhysicalMasterCredentialRef; capacityMax: number; capacityUsed: number; status: PhysicalDatabaseInstanceStatus; agentName?: string; metadata: Record; created?: Date; updated?: Date; }; export type LifecycleMigration = { version: string; filename: string; sql: string; }; export { analyzeDestructiveMigrations, DESTRUCTIVE_MIGRATION_ACK_REQUIRED, DESTRUCTIVE_MIGRATION_ACK_REQUIRED_MESSAGE, DESTRUCTIVE_MIGRATION_SCAN_UNAVAILABLE } from './destructiveMigrations.js'; export type { DestructiveMigrationFile, DestructiveMigrationFinding, DestructiveMigrationKind } from './destructiveMigrations.js'; export type LifecycleDispatchContinuation = { currentState?: string; physicalInstanceId?: string; physicalTerraformResourceKey?: string; reservationId?: string; stateLockRecoveryAuthorized?: boolean; }; export declare const PHYSICAL_POOL_PROVISIONING_STATUSES: readonly ["not_started", "provisioning", "active", "failed"]; export type PhysicalPoolProvisioningStatus = (typeof PHYSICAL_POOL_PROVISIONING_STATUSES)[number]; export type PhysicalPoolProvisioningActor = { displayName: string; id: string; }; export type PhysicalPoolProvisioningError = { code: string; message: string; }; export type PhysicalPoolProvisioningState = { alreadyInProgress?: boolean; completedAt?: string; error?: PhysicalPoolProvisioningError; physicalDatabaseInstanceId?: string; provisioningId?: string; startedAt?: string; startedBy?: PhysicalPoolProvisioningActor; status: PhysicalPoolProvisioningStatus; }; export type PhysicalPoolInstanceSummary = { capacityMax: number; capacityUsed: number; endpoint: string; id: string; region: string; status: PhysicalDatabaseInstanceStatus; }; export type PhysicalPoolSummary = { agentName: string; engine: DatabaseEngine; instances: PhysicalPoolInstanceSummary[]; provisioning: PhysicalPoolProvisioningState; }; export type LifecycleDispatchPayload = { applicationId: string; bindingId: string; bindingKey: string; connectionMetadata?: Record; continuation?: LifecycleDispatchContinuation; desiredSpec: DatabaseRequirement; desiredSpecHash: string; environment?: string; migrations?: LifecycleMigration[]; operation: LifecycleOperation; profile: string; provisioningId?: string; requestId: string; resourceKey: string; }; export declare function physicalPoolProvisioningResourceKey(provisioningId: string): string; export declare function computeRequirementKey(requirement: Pick): string; export declare function computeBindingKey(input: { organizationId: string; applicationId: string; profile: string; }): string; export declare function computeLegacyBindingKeyWithoutOrganization(input: { applicationId: string; profile: string; }): string; export declare function computeDesiredSpecHash(requirement: DatabaseRequirement): Promise; export declare function nativeDbIamSessionPolicy(descriptor: NativeDbIamDescriptor): string; export declare function parseNativeDbIamDescriptor(value: unknown): NativeDbIamDescriptor | undefined; export declare function computeNativeDbApplicationToken(trustedApplicationId: string): Promise; export declare function computeNativeDbProfileToken(profile: string): Promise; export declare function computeResourceKey(input: { organizationId: string; applicationId: string; requirementKey: string; profile: string; actorScope?: string; }): string; export declare function isTerminalLifecycleState(state: LifecycleState): state is LifecycleTerminalState; export declare function redactLifecycleSecrets(value: T): T; export declare const SECRET_KEY_PATTERN: RegExp; export declare const CREDENTIAL_BEARING_DSN_SCHEMES: readonly ["postgres", "postgresql", "mysql", "mariadb", "mongodb", "mongodb+srv", "redis", "rediss", "amqp", "amqps", "kafka"]; export declare function isSecretKey(key: string): boolean; export declare function containsCredentialMaterial(value: string): boolean; //# sourceMappingURL=index.d.ts.map