{"version":3,"file":"alpha-update-api-key.mjs","names":[],"sources":["../../src/actions/alpha-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 SupabaseAlphaUpdateApiKeyInput = z.object({\n  id: z.string().describe(\"The unique identifier of the API key that needs to be updated.\"),\n  ref: z.string().describe(\"The unique reference ID of the Supabase project to which the API key belongs.\"),\n  description: z.string().describe(\"Optional new description for the API key.\").optional(),\n}).describe(\"Request to update an API key, specifying the project (`ref`), key (`id`), and optionally a new `description`.\");\nconst SupabaseAlphaUpdateApiKey_ApiKeyTypeSchema = z.enum([\"legacy\", \"publishable\", \"secret\"]).describe(\"API key type returned by Supabase.\");\nexport const SupabaseAlphaUpdateApiKeyOutput = z.object({\n  id: z.string().describe(\"Unique identifier of the API key.\").nullable(),\n  hash: z.string().describe(\"A hash (e.g., SHA-256) of the key used for secure identification and logging.\").nullable(),\n  name: z.string().describe(\"Human-readable name for the API key.\").nullable(),\n  type: SupabaseAlphaUpdateApiKey_ApiKeyTypeSchema.nullable(),\n  prefix: z.string().describe(\"Non-sensitive prefix used to identify the key without revealing its full value.\").nullable(),\n  api_key: z.string().describe(\"Full API key value. Returned only when the reveal query parameter is true and the caller has sufficient privileges. Otherwise this field may be omitted.\").nullable().optional(),\n  updated_at: z.string().describe(\"Timestamp when the API key was last updated (ISO 8601).\").nullable(),\n  description: z.string().describe(\"Optional description for the API key.\").nullable().optional(),\n  inserted_at: z.string().describe(\"Timestamp when the API key was created (ISO 8601).\").nullable(),\n  secret_jwt_template: z.record(z.string(), z.unknown()).describe(\"Optional template for minting short-lived JWTs when using secret-type keys. Keys are implementation-defined; for example, it may include 'role'.\").nullable().optional(),\n}).passthrough().describe(\"The updated API key resource.\\n\\nMatches Supabase Management API update API key response. The `api_key` field\\nis conditionally included only when the request includes `reveal=true` and\\nthe caller has sufficient privileges.\");\n\nexport const supabaseAlphaUpdateApiKey: AppAction<\n  typeof SupabaseAlphaUpdateApiKeyInput,\n  typeof SupabaseAlphaUpdateApiKeyOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_ALPHA_UPDATE_API_KEY\", {\n  slug: \"supabase-alpha-update-api-key\",\n  name: \"Update an API key for the project\",\n  description: \"Updates an existing Supabase project API key's `description` and/or `secret_jwt_template` (which defines its `role`); does not regenerate the key string.\",\n  input: SupabaseAlphaUpdateApiKeyInput,\n  output: SupabaseAlphaUpdateApiKeyOutput,\n});\n"],"mappings":";;;;AAMA,MAAa,iCAAiC,EAAE,OAAO;CACrD,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,gEAAgE;CACxF,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,+EAA+E;CACxG,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,2CAA2C,CAAC,CAAC,SAAS;AACzF,CAAC,CAAC,CAAC,SAAS,+GAA+G;AAC3H,MAAM,6CAA6C,EAAE,KAAK;CAAC;CAAU;CAAe;AAAQ,CAAC,CAAC,CAAC,SAAS,oCAAoC;AAc5I,MAAa,4BAIT,OAAO,iCAAiC;CAC1C,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAtB6C,EAAE,OAAO;EACtD,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC,CAAC,CAAC,SAAS;EACtE,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,+EAA+E,CAAC,CAAC,SAAS;EACpH,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,sCAAsC,CAAC,CAAC,SAAS;EAC3E,MAAM,2CAA2C,SAAS;EAC1D,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,iFAAiF,CAAC,CAAC,SAAS;EACxH,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,0JAA0J,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EAC7M,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS,yDAAyD,CAAC,CAAC,S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