{"version":3,"file":"create-sso-provider.cjs","names":["z","action"],"sources":["../../src/actions/create-sso-provider.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 SupabaseCreateSsoProviderInput = z.object({\n  ref: z.string().describe(\"Unique reference ID of the Supabase project.\"),\n  type: z.enum([\"saml\"]).describe(\"Type of the SSO provider; 'saml' (SAML 2.0) is the only supported value.\"),\n  domains: z.array(z.string()).describe(\"Email domains to associate with this SSO provider; users from these domains will be directed here for authentication.\").optional(),\n  metadata_url: z.string().describe(\"URL to fetch SAML 2.0 metadata XML. Provide this or `metadata_xml`.\").optional(),\n  metadata_xml: z.string().describe(\"SAML 2.0 metadata XML document as a string. Provide this or `metadata_url`.\").optional(),\n  attribute__mapping__keys: z.record(z.string(), z.unknown()).describe(\"Maps SAML assertion attributes to custom Supabase JWT claims. Keys are JWT claim names; values specify SAML attribute extraction rules (e.g., `name`, `names`, `default`, `array`).\").optional(),\n}).describe(\"Request for creating a new SSO provider.\");\nconst SupabaseCreateSsoProvider_AttributeMappingSchema = z.object({\n  keys: z.record(z.string(), z.unknown()).describe(\"A dictionary where each key is the destination attribute name and the value defines how it is resolved from SAML assertion attributes.\"),\n}).passthrough();\nconst SupabaseCreateSsoProvider_SamlSchema = z.object({\n  id: z.string().describe(\"Unique identifier of the SAML configuration.\").nullable(),\n  entity_id: z.string().describe(\"The SAML Identity Provider (IdP) Entity ID parsed from the IdP metadata.\").nullable(),\n  metadata_url: z.string().describe(\"URL to the IdP metadata document when configuration is provided by URL. Null if configuration is provided via metadata_xml.\").nullable().optional(),\n  metadata_xml: z.string().describe(\"Raw SAML IdP metadata XML when configuration is provided inline. Null if configuration is provided via metadata_url.\").nullable().optional(),\n  name_id_format: z.string().describe(\"Optional SAML NameID format used for authentication (for example, 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified').\").nullable().optional(),\n  attribute_mapping: SupabaseCreateSsoProvider_AttributeMappingSchema.nullable(),\n}).passthrough();\nconst SupabaseCreateSsoProvider_DomainSchema = z.object({\n  id: z.string().describe(\"Unique identifier of the domain association record.\").nullable(),\n  domain: z.string().describe(\"Email domain associated with the SSO provider (for example, 'example.com').\").nullable(),\n  created_at: z.string().describe(\"Timestamp when the domain association was created.\").nullable(),\n  updated_at: z.string().describe(\"Timestamp when the domain association was last updated.\").nullable(),\n}).passthrough();\nexport const SupabaseCreateSsoProviderOutput = z.object({\n  id: z.string().describe(\"Unique identifier of the SSO provider.\").nullable(),\n  saml: SupabaseCreateSsoProvider_SamlSchema.nullable(),\n  domains: z.array(SupabaseCreateSsoProvider_DomainSchema).describe(\"Email domains associated with this SSO provider. Users with matching email domains are eligible to sign in via this provider.\"),\n  created_at: z.string().describe(\"Timestamp when the SSO provider was created.\").nullable(),\n  updated_at: z.string().describe(\"Timestamp when the SSO provider was last updated.\").nullable(),\n}).passthrough().describe(\"Response body returned when creating a new SAML SSO provider for a Supabase project.\\n\\nFlattened to return the API object directly (no data wrapper), per platform conventions.\");\n\nexport const supabaseCreateSsoProvider: AppAction<\n  typeof SupabaseCreateSsoProviderInput,\n  typeof SupabaseCreateSsoProviderOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_CREATE_SSO_PROVIDER\", {\n  slug: \"supabase-create-sso-provider\",\n  name: \"Create SSO provider configuration\",\n  description: \"Creates a new SAML 2.0 Single Sign-On (SSO) provider for a Supabase project, requiring either `metadata_xml` or `metadata_url` for SAML IdP configuration.\",\n  input: SupabaseCreateSsoProviderInput,\n  output: SupabaseCreateSsoProviderOutput,\n});\n"],"mappings":";;;;AAMA,MAAa,iCAAiCA,IAAAA,EAAE,OAAO;CACrD,KAAKA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,8CAA8C;CACvE,MAAMA,IAAAA,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,0EAA0E;CAC1G,SAASA,IAAAA,EAAE,MAAMA,IAA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