{"version":3,"file":"update-project-postgres-config.mjs","names":[],"sources":["../../src/actions/update-project-postgres-config.ts"],"sourcesContent":["import type { AppAction } from \"@keystrokehq/keystroke/app\";\nimport { z } from \"zod\";\n\nimport { action } from \"../action\";\nimport { supabase } from \"../app\";\n\nexport const SupabaseUpdateProjectPostgresConfigInput = z.object({\n  ref: z.string().describe(\"The unique reference ID of the Supabase project.\"),\n  work_mem: z.string().describe(\"Memory for internal sorts and hash tables before writing to temp disk files (e.g., '4MB', '64MB').\").optional(),\n  max_wal_size: z.string().describe(\"WAL size that triggers a checkpoint (e.g., '1GB', '2048MB').\").optional(),\n  wal_keep_size: z.string().describe(\"Minimum size of past WAL log segments in pg_wal for standby servers (e.g., '128MB', '512MB'); replaces older wal_keep_segments.\").optional(),\n  shared_buffers: z.string().describe(\"Memory for shared memory buffers (e.g., '128MB', '1GB').\").optional(),\n  max_connections: z.number().int().describe(\"Maximum concurrent database connections. Typically between 1 and 262143.\").optional(),\n  statement_timeout: z.string().describe(\"Maximum allowed duration for any SQL statement (e.g., '10000ms', '30s'); '0' typically disables timeout.\").optional(),\n  effective_cache_size: z.string().describe(\"Estimated disk cache size for a single query (e.g., '4GB', '512MB').\").optional(),\n  maintenance_work_mem: z.string().describe(\"Maximum memory for maintenance operations like VACUUM, CREATE INDEX (e.g., '64MB', '1GB').\").optional(),\n  max_parallel_workers: z.number().int().describe(\"Maximum workers the system can support for parallel queries. Typically between 0 and 1024.\").optional(),\n  max_worker_processes: z.number().int().describe(\"Maximum background processes the system can support. Typically between 0 and 262143.\").optional(),\n  max_slot_wal_keep_size: z.string().describe(\"Maximum WAL file size replication slots can retain in pg_wal (e.g., '1GB', '512MB'). '0' might mean unlimited; check PostgreSQL docs.\").optional(),\n  session_replication_role: z.enum([\"local\", \"origin\", \"replica\"]).describe(\"Controls firing of replication-related triggers and rules for the current session.\").optional(),\n  max_locks_per_transaction: z.number().int().describe(\"Controls the average number of object locks allocated per transaction. Typically between 10 and 2147483640.\").optional(),\n  max_standby_archive_delay: z.string().describe(\"Maximum delay before canceling queries on a hot standby server processing archived WAL data (e.g., '30s', '0ms' to disable).\").optional(),\n  max_standby_streaming_delay: z.string().describe(\"Maximum delay before canceling queries on a hot standby server processing streamed WAL data (e.g., '30s', '0ms' to disable).\").optional(),\n  max_parallel_workers_per_gather: z.number().int().describe(\"Maximum workers for a single Gather or Gather Merge node in a parallel query. Typically between 0 and 1024.\").optional(),\n  max_parallel_maintenance_workers: z.number().int().describe(\"Maximum parallel processes for a single maintenance utility command. Typically between 0 and 1024.\").optional(),\n}).describe(\"Request schema for `UpdateProjectPostgresConfig`\");\nconst SupabaseUpdateProjectPostgresConfig_SessionReplicationRoleSchema = z.enum([\"origin\", \"replica\", \"local\"]);\nexport const SupabaseUpdateProjectPostgresConfigOutput = z.object({\n  work_mem: z.string().describe(\"Max memory per sort/hash operation before using temp files (e.g., '64MB').\").nullable(),\n  max_wal_size: z.string().describe(\"Soft upper limit on total WAL size (e.g., '2GB').\").nullable(),\n  wal_keep_size: z.string().describe(\"Amount of WAL to keep for standbys (e.g., '1024MB').\").nullable(),\n  shared_buffers: z.string().describe(\"Memory used for shared buffers (commonly ~25% of RAM), e.g., '2GB'.\").nullable(),\n  max_connections: z.number().int().describe(\"Maximum number of concurrent database connections.\").nullable(),\n  max_wal_senders: z.number().int().describe(\"Maximum number of concurrent connections from standby/backup clients.\").nullable(),\n  statement_timeout: z.string().describe(\"Max duration of any statement before abort (e.g., '30s'); '0' disables.\").nullable(),\n  wal_sender_timeout: z.string().describe(\"Max time to wait for WAL sender activity before terminating (e.g., '60s').\").nullable(),\n  effective_cache_size: z.string().describe(\"Planner hint for OS+DB cache size. Accepts memory units (e.g., '4GB').\").nullable(),\n  maintenance_work_mem: z.string().describe(\"Max memory per maintenance operation (e.g., '1GB').\").nullable(),\n  max_parallel_workers: z.number().int().describe(\"Maximum number of parallel workers the system can support at once.\").nullable(),\n  max_worker_processes: z.number().int().describe(\"Maximum number of background processes the server can support.\").nullable(),\n  max_replication_slots: z.number().int().describe(\"Maximum number of replication slots (physical + logical).\").nullable(),\n  max_slot_wal_keep_size: z.string().describe(\"Max WAL size to keep for replication slots before removal (e.g., '4GB').\").nullable(),\n  track_commit_timestamp: z.boolean().describe(\"Whether commit timestamps are tracked for all transactions.\").nullable(),\n  session_replication_role: SupabaseUpdateProjectPostgresConfig_SessionReplicationRoleSchema.nullable(),\n  logical_decoding_work_mem: z.string().describe(\"Max memory used for logical decoding per slot (e.g., '64MB').\").nullable(),\n  max_locks_per_transaction: z.number().int().describe(\"Average number of object locks allocated per transaction.\").nullable(),\n  max_standby_archive_delay: z.string().describe(\"Max delay when applying archived WAL on standby before canceling queries (e.g., '30s').\").nullable(),\n  track_activity_query_size: z.string().describe(\"Max length in bytes of query strings tracked in pg_stat_activity (e.g., '2048').\").nullable(),\n  max_standby_streaming_delay: z.string().describe(\"Max delay when applying streamed WAL on standby before canceling queries (e.g., '30s').\").nullable(),\n  max_parallel_workers_per_gather: z.number().int().describe(\"Max parallel workers started by a single Gather/Gather Merge node.\").nullable(),\n  max_parallel_maintenance_workers: z.number().int().describe(\"Maximum parallel workers for a single maintenance command (e.g., VACUUM).\").nullable(),\n}).passthrough().describe(\"Response schema for `UpdateProjectPostgresConfig`.\\n\\nMatches the response body returned by PUT /v1/projects/{ref}/config/database/postgres\\nand returns the updated Postgres configuration object directly (no wrapper).\");\n\nexport const supabaseUpdateProjectPostgresConfig: AppAction<\n  typeof SupabaseUpdateProjectPostgresConfigInput,\n  typeof SupabaseUpdateProjectPostgresConfigOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_UPDATE_PROJECT_POSTGRES_CONFIG\", {\n  slug: \"supabase-update-project-postgres-config\",\n  name: \"Update project's postgres config\",\n  description: \"Updates specified PostgreSQL configuration parameters for an existing Supabase project (`ref`) to optimize database performance; note that unspecified parameters remain unchanged, and caution is advised as incorrect settings can impact stability or require a restart.\",\n  input: SupabaseUpdateProjectPostgresConfigInput,\n  output: SupabaseUpdateProjectP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