{"version":3,"file":"update-api-key.cjs","names":["z","action"],"sources":["../../src/actions/update-api-key.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 SupabaseUpdateApiKeyInput = z.object({\n  id: z.string().describe(\"UUID of the API key to update (must be UUID format from publishable/secret type keys, not legacy key names like 'anon' or 'service_role'). You can get this ID from the List Project API Keys or Get Project API Key actions.\"),\n  ref: z.string().describe(\"The unique reference ID (20 alphanumeric characters) of your Supabase project. You can find this in your project's dashboard URL or by calling the List All Projects action.\"),\n  name: z.string().describe(\"New name for the API key. Must be 4-64 characters long and follow the pattern: lowercase letters, numbers, and underscores only, starting with a letter or underscore (e.g., 'my_api_key_2024').\").optional(),\n  reveal: z.boolean().describe(\"If true, reveals the full API key value in the response. If false or omitted, secret key values will be partially redacted. Per Supabase's security model, secrets are hidden by default.\").optional(),\n  description: z.string().describe(\"Optional new description for the API key to help identify its purpose or usage context.\").optional(),\n  secret_jwt_template: z.object({\n  role: z.string().describe(\"Default role claim applied when using the key (commonly 'anon' or 'service_role' for JWT keys).\").optional(),\n}).passthrough().describe(\"Template for claims/config associated with JWT-style keys.\").optional(),\n}).describe(\"Request schema for updating a Supabase project API key.\");\nconst SupabaseUpdateApiKey_SecretJwtTemplateSchema = z.object({\n  role: z.string().describe(\"Default role claim applied when using the key (commonly 'anon' or 'service_role' for JWT keys).\").nullable().optional(),\n}).passthrough().describe(\"Template for claims/config associated with JWT-style keys.\");\nexport const SupabaseUpdateApiKeyOutput = z.object({\n  id: z.string().describe(\"Unique identifier of the API key (UUID or legacy identifier).\").nullable().optional(),\n  hash: z.string().describe(\"Server-side hash of the API key material, used for lookup and auditing.\").nullable().optional(),\n  name: z.string().describe(\"Display name assigned to the API key (e.g., 'anon', 'service_role', or a custom name).\").nullable(),\n  type: z.string().describe(\"Category of API key. One of: 'publishable', 'secret', or 'legacy'.\").nullable().optional(),\n  prefix: z.string().describe(\"Human-readable key prefix used for display/matching (e.g., sb_publishable_..., sb_secret_...).\").nullable().optional(),\n  api_key: z.string().describe(\"Full API key value. Returned only when 'reveal=true' is provided by an authorized caller; otherwise omitted or redacted.\").nullable().optional(),\n  updated_at: z.string().describe(\"RFC 3339 timestamp when the API key was last updated (e.g., 2021-12-31T23:34:00Z).\").nullable().optional(),\n  description: z.string().describe(\"Optional description for the API key. Legacy keys commonly indicate their role; modern keys may be null.\").nullable().optional(),\n  inserted_at: z.string().describe(\"RFC 3339 timestamp when the API key was created (e.g., 2021-12-31T23:34:00Z).\").nullable().optional(),\n  secret_jwt_template: SupabaseUpdateApiKey_SecretJwtTemplateSchema.nullable().optional(),\n}).passthrough().describe(\"Response schema containing the updated API key details.\");\n\nexport const supabaseUpdateApiKey: AppAction<\n  typeof SupabaseUpdateApiKeyInput,\n  typeof SupabaseUpdateApiKeyOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_UPDATE_API_KEY\", {\n  slug: \"supabase-update-api-key\",\n  name: \"Update API key\",\n  description: \"Updates an existing Supabase project API key's metadata including name, description, and JWT template configuration. This action modifies key properties without regenerating the actual key value. Use this action when you need to change a key's display name, update its description for better organization, or modify the JWT role template for secret-type keys. Note: This does not rotate or regenerate the key string itself - the key value remains unchanged unless explicitly revealed with reveal=true.\",\n  input: SupabaseUpdateApiKeyInput,\n  output: SupabaseUpdateApiKeyOutput,\n});\n"],"mappings":";;;;AAMA,MAAa,4BAA4BA,IAAAA,EAAE,OAAO;CAChD,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,+NAA+N;CACvP,KAAKA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,8KAA8K;CACvM,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,kMAAkM,CAAC,CAAC,SAAS;CACvO,QAAQA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,2LAA2L,CAAC,CAAC,SAAS;CACnO,aAAaA,IAAAA,EAAE,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