{"version":3,"file":"list-sql-snippets.mjs","names":[],"sources":["../../src/actions/list-sql-snippets.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 SupabaseListSqlSnippetsInput = z.object({\n  project_ref: z.string().describe(\"The unique identifier for your Supabase project. It is a 20-digit string used to reference and manage your project in API endpoints. This can be found in Supabase Studio under Settings > General > Project Settings > Reference ID.\").optional(),\n}).describe(\"Request schema for `ListSqlSnippets`\");\nconst SupabaseListSqlSnippets_TypeSchema = z.enum([\"sql\"]);\nconst SupabaseListSqlSnippets_OwnerSchema = z.object({\n  id: z.number().int().nullable(),\n  username: z.string().nullable(),\n}).passthrough();\nconst SupabaseListSqlSnippets_ProjectSchema = z.object({\n  id: z.number().int().nullable(),\n  name: z.string().nullable(),\n}).passthrough();\nconst SupabaseListSqlSnippets_UpdatedBySchema = z.object({\n  id: z.number().int().nullable(),\n  username: z.string().nullable(),\n}).passthrough();\nconst SupabaseListSqlSnippets_VisibilitySchema = z.enum([\"user\", \"project\", \"org\", \"public\"]);\nconst SupabaseListSqlSnippets_DatumSchema = z.object({\n  id: z.string().nullable(),\n  name: z.string().nullable(),\n  type: SupabaseListSqlSnippets_TypeSchema.nullable(),\n  owner: SupabaseListSqlSnippets_OwnerSchema.nullable(),\n  project: SupabaseListSqlSnippets_ProjectSchema.nullable(),\n  favorite: z.boolean().nullable().optional(),\n  updated_at: z.string().nullable(),\n  updated_by: SupabaseListSqlSnippets_UpdatedBySchema.nullable(),\n  visibility: SupabaseListSqlSnippets_VisibilitySchema.nullable(),\n  description: z.string().nullable().optional(),\n  inserted_at: z.string().nullable(),\n}).passthrough();\nexport const SupabaseListSqlSnippetsOutput = z.object({\n  data: z.array(SupabaseListSqlSnippets_DatumSchema).describe(\"A paginated list of SQL snippet summaries. Empty if the user has no snippets.\"),\n  cursor: z.string().describe(\"Opaque pagination cursor for fetching the next page of results. Present when more pages are available.\").nullable().optional(),\n}).passthrough().describe(\"Response schema for `ListSqlSnippets`.\\n\\nMatches the Supabase Management API response: an object with\\n- data: array of snippet summaries\\n- cursor: optional string for pagination\");\n\nexport const supabaseListSqlSnippets: AppAction<\n  typeof SupabaseListSqlSnippetsInput,\n  typeof SupabaseListSqlSnippetsOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_LIST_SQL_SNIPPETS\", {\n  slug: \"supabase-list-sql-snippets\",\n  name: \"List SQL snippets for the logged in user\",\n  description: \"Retrieves a list of SQL snippets for the logged-in user, optionally filtered by a specific Supabase project if `project_ref` is provided.\",\n  input: SupabaseListSqlSnippetsInput,\n  output: SupabaseListSqlSnippetsOutput,\n});\n"],"mappings":";;;;AAMA,MAAa,+BAA+B,EAAE,OAAO,EACnD,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,uOAAuO,CAAC,CAAC,SAAS,EACrR,CAAC,CAAC,CAAC,SAAS,sCAAsC;AAClD,MAAM,qCAAqC,EAAE,KAAK,CAAC,KAAK,CAAC;AACzD,MAAM,sCAAsC,EAAE,OAAO;CACnD,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;CAC9B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC,CAAC,CAAC,YAAY;AACf,MAAM,wCAAwC,EAAE,OAAO;CACrD,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;CAC9B,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;AAC5B,CAAC,CAAC,CAAC,YAAY;AACf,MAAM,0CAA0C,EAAE,OAAO;CACvD,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;CAC9B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC,CAAC,CAAC,YAAY;AACf,MAAM,2CAA2C,EAAE,KAAK;CAAC;CAAQ;CAAW;CAAO;AAAQ,CAAC;AAC5F,MAAM,sCAAsC,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