{"version":3,"file":"patch-network-restrictions.mjs","names":[],"sources":["../../src/actions/patch-network-restrictions.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 SupabasePatchNetworkRestrictionsInput = z.object({\n  add: z.object({\n  dbAllowedCidrs: z.array(z.string()).describe(\"List of IPv4 CIDR blocks to add or remove. Each entry should be a valid CIDR notation (e.g., '192.168.1.0/24', '10.0.0.0/8').\").optional(),\n  dbAllowedCidrsV6: z.array(z.string()).describe(\"List of IPv6 CIDR blocks to add or remove. Each entry should be a valid IPv6 CIDR notation (e.g., '2001:0db8::/32').\").optional(),\n}).describe(\"Modification request for adding or removing network restriction CIDRs.\").optional(),\n  ref: z.string().describe(\"Unique reference ID of the Supabase project (visible in project URL).\"),\n  remove: z.object({\n  dbAllowedCidrs: z.array(z.string()).describe(\"List of IPv4 CIDR blocks to add or remove. Each entry should be a valid CIDR notation (e.g., '192.168.1.0/24', '10.0.0.0/8').\").optional(),\n  dbAllowedCidrsV6: z.array(z.string()).describe(\"List of IPv6 CIDR blocks to add or remove. Each entry should be a valid IPv6 CIDR notation (e.g., '2001:0db8::/32').\").optional(),\n}).describe(\"Modification request for adding or removing network restriction CIDRs.\").optional(),\n}).describe(\"Request to update project's network restrictions by adding or removing CIDRs.\");\nconst SupabasePatchNetworkRestrictions_DbAllowedCidrEntrySchema = z.object({\n  type: z.string().describe(\"The type of IP address: 'v4' for IPv4 or 'v6' for IPv6.\").nullable().optional(),\n  address: z.string().describe(\"The CIDR block (e.g., '192.168.1.0/24' for IPv4 or '2001:0db8::/32' for IPv6).\").nullable().optional(),\n  description: z.string().describe(\"Optional description or label for this CIDR entry.\").nullable().optional(),\n}).passthrough().describe(\"Individual CIDR entry in the network restrictions configuration.\");\nconst SupabasePatchNetworkRestrictions_NetworkRestrictionsConfigSchema = z.object({\n  dbAllowedCidrs: z.array(SupabasePatchNetworkRestrictions_DbAllowedCidrEntrySchema).describe(\"List of allowed IPv4 and IPv6 CIDR entries for database access.\").nullable().optional(),\n}).passthrough().describe(\"Current network restriction configuration with allowed CIDR ranges.\");\nconst SupabasePatchNetworkRestrictions_StatusSchema = z.enum([\"stored\", \"applied\"]).describe(\"Application status of network restrictions.\");\nconst SupabasePatchNetworkRestrictions_NetworkRestrictionsOldConfigSchema = z.object({\n  dbAllowedCidrs: z.array(SupabasePatchNetworkRestrictions_DbAllowedCidrEntrySchema).describe(\"List of allowed IPv4 and IPv6 CIDR entries that were active before this update.\").nullable().optional(),\n}).passthrough().describe(\"Previous network restriction configuration before the update.\");\nconst SupabasePatchNetworkRestrictions_EntitlementSchema = z.enum([\"disallowed\", \"allowed\"]).describe(\"Project's entitlement status for the network restrictions feature.\");\nexport const SupabasePatchNetworkRestrictionsOutput = z.object({\n  config: SupabasePatchNetworkRestrictions_NetworkRestrictionsConfigSchema.nullable(),\n  status: SupabasePatchNetworkRestrictions_StatusSchema.nullable(),\n  applied_at: z.string().describe(\"Timestamp when the configuration was applied (ISO 8601 format).\").nullable().optional(),\n  old_config: SupabasePatchNetworkRestrictions_NetworkRestrictionsOldConfigSchema.nullable().optional(),\n  updated_at: z.string().describe(\"Timestamp when the configuration was last updated (ISO 8601 format).\").nullable().optional(),\n  entitlement: SupabasePatchNetworkRestrictions_EntitlementSchema.nullable(),\n}).passthrough().describe(\"Response after updating network restrictions with add/remove operations.\");\n\nexport const supabasePatchNetworkRestrictions: AppAction<\n  typeof SupabasePatchNetworkRestrictionsInput,\n  typeof SupabasePatchNetworkRestrictionsOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_PATCH_NETWORK_RESTRICTIONS\", {\n  slug: \"supabase-patch-network-restrictions\",\n  name: \"Patch project network restrictions\",\n  description: \"Updates project's network restrictions by incrementally adding or removing IPv4/IPv6 CIDR blocks. Use when you need to modify existing restrictions without replacing the entire configuration.\",\n  input: SupabasePatchNetworkRestrictionsInput,\n  output: SupabasePatchNetworkRestr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