{"version":3,"file":"alpha-update-api-key.cjs","names":["z","action"],"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,iCAAiCA,IAAAA,EAAE,OAAO;CACrD,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,gEAAgE;CACxF,KAAKA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,+EAA+E;CACxG,aAAaA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,2CAA2C,CAAC,CAAC,SAAS;AACzF,CAAC,CAAC,CAAC,SAAS,+GAA+G;AAC3H,MAAM,6CAA6CA,IAAAA,EAAE,KAAK;CAAC;CAAU;CAAe;AAAQ,CAAC,CAAC,CAAC,SAAS,oCAAoC;AAC5I,MAAa,kCAAkCA,IAAAA,EAAE,OAAO;CACtD,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC,CAAC,CAAC,SAAS;CACtE,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,+EAA+E,CAAC,CAAC,SAAS;CACpH,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,sCAAsC,CAAC,CAAC,SAAS;CAC3E,MAAM,2CAA2C,SAAS;CAC1D,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,iFAAiF,CAAC,CAAC,SAAS;CACxH,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,0JAA0J,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC7M,YAAYA,IAAAA,EAAE,OAAO,CAAC,CA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