import {z} from 'zod' export type GetApiAccountsEntitiesIdOptions = {baseUrl: string, OAuth?: string | undefined, fetch?: typeof fetch | undefined}; export const gBCompanyFull30 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.enum(["AED", "AUD", "CAD", "CHF", "CZK", "DKK", "EUR", "GBP", "HKD", "JPY", "KWD", "NOK", "NZD", "PLN", "RON", "SEK", "SGD", "USD", "ZAR"]))}), contact_details: z.object({phone: z.object({country_code: z.enum(["GI", "CH", "GG", "IM", "JE", "GB"]), number: z.string().min(7).max(11)}).optional(), email_addresses: z.object({primary: z.unknown()}).optional(), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional(), message: z.string().optional()})).optional(), company: z.object({legal_name: z.string().min(2).max(300), trading_name: z.string().min(2).max(300), business_registration_number: z.unknown(), date_of_incorporation: z.object({day: z.number().int().gte(1).lte(31).optional(), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1500).lte(2999)}), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(5).max(8), country: z.string().min(2).max(2)}), representatives: z.array(z.union([z.object({id: z.unknown(), individual: z.object({first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), place_of_birth: z.object({country: z.string().min(2).max(2)}), national_id_number: z.unknown(), email_address: z.unknown(), phone: z.object({country_code: z.enum(["AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BA", "BW", "BR", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CO", "KM", "CD", "CG", "CK", "CR", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FO", "FJ", "FI", "FR", "GF", "PF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "SX", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "BQ", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UY", "UZ", "VU", "VA", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]), number: z.string().min(5).max(16)}).optional(), address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)})}), company_position: z.enum(["ceo", "cfo", "coo", "managing_member", "general_partner", "president", "vice_president", "treasurer", "other_senior_management", "other_executive_officer", "other_non_executive_non_senior"]).optional(), roles: z.array(z.enum(["ubo", "authorised_signatory", "director", "control_person"])), ownership_percentage: z.number().int().gte(25).lte(100).optional(), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()}).optional(), certified_authorised_signatory: z.object({type: z.literal("power_of_attorney"), front: z.string().min(31).max(31)}).optional()}).optional()}), z.object({id: z.unknown(), company: z.object({legal_name: z.string().min(2).max(300), trading_name: z.string().min(2).max(300), registered_address: z.object({address_line1: z.string().min(1).max(300).optional(), address_line2: z.unknown(), city: z.string().min(2).max(300).optional(), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16).optional(), country: z.string().min(2).max(2)})}), ownership_percentage: z.number().int().gte(25).lte(100).optional()})])), business_type: z.enum(["individual_or_sole_proprietorship", "limited_company", "public_limited_company", "limited_partnership", "general_partnership", "scottish_limited_partnership", "government_agency", "non_profit_entity", "trust", "club_or_society", "unincorporated_association"])}), processing_details: z.object({settlement_country: z.string().min(2).max(2), target_countries: z.array(z.string().min(2).max(2)), annual_processing_volume: z.number().int().gte(0), average_transaction_value: z.number().int().gte(0), highest_transaction_value: z.number().int().gte(0), currency: z.literal("GBP")}), documents: z.object({company_verification: z.object({type: z.literal("incorporation_document"), front: z.string().min(31).max(31)}).optional(), articles_of_association: z.object({type: z.enum(["memorandum_of_association", "articles_of_association"]), front: z.string().min(31).max(31)}), bank_verification: z.object({type: z.enum(["bank_statement", "bank_letter"]), front: z.string().min(31).max(31)}).optional(), shareholder_structure: z.object({type: z.literal("certified_shareholder_structure"), front: z.string().min(31).max(31)}), proof_of_legality: z.object({type: z.literal("proof_of_legality"), front: z.string().min(31).max(31)}).optional(), proof_of_principal_address: z.object({type: z.literal("proof_of_address"), front: z.string().min(31).max(31)}).optional(), additional_document1: z.object({front: z.string().min(31).max(31)}).optional(), additional_document2: z.object({front: z.string().min(31).max(31)}).optional(), additional_document3: z.object({front: z.string().min(31).max(31)}).optional()})}); export const eEACompanyFull30 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.enum(["AED", "AUD", "CAD", "CHF", "CZK", "DKK", "EUR", "GBP", "HKD", "JPY", "NOK", "NZD", "PLN", "RON", "SEK", "SGD", "USD", "ZAR"]))}), contact_details: z.object({phone: z.object({country_code: z.enum(["GR", "NL", "BE", "FR", "ES", "PT", "LU", "IE", "IS", "MT", "CY", "FI", "BG", "HU", "LT", "LV", "EE", "AD", "HR", "SI", "IT", "RO", "CZ", "SK", "LI", "AT", "DK", "SE", "NO", "PL", "DE"]), number: z.string().min(6).max(13)}).optional(), email_addresses: z.object({primary: z.unknown()}).optional(), invitee: z.object({email: z.unknown()}).optional()}).optional(), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional(), message: z.string().optional()})).optional(), company: z.object({legal_name: z.string().min(2).max(300), trading_name: z.string().min(2).max(300), business_registration_number: z.unknown(), date_of_incorporation: z.object({day: z.number().int().gte(1).lte(31).optional(), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1500).lte(2999)}), regulatory_licence_number: z.unknown(), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), representatives: z.array(z.union([z.object({id: z.unknown(), individual: z.object({first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), place_of_birth: z.object({country: z.string().min(2).max(2)}), national_id_number: z.unknown(), email_address: z.unknown(), phone: z.object({country_code: z.enum(["AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BA", "BW", "BR", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CO", "KM", "CD", "CG", "CK", "CR", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FO", "FJ", "FI", "FR", "GF", "PF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "BQ", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UY", "UZ", "VU", "VA", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]), number: z.string().min(5).max(16)}).optional(), address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)})}), company_position: z.enum(["ceo", "cfo", "coo", "managing_member", "general_partner", "president", "vice_president", "treasurer", "other_senior_management", "other_executive_officer", "other_non_executive_non_senior"]).optional(), roles: z.array(z.enum(["ubo", "legal_representative", "authorised_signatory", "control_person"])), ownership_percentage: z.number().int().gte(25).lte(100).optional(), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()}).optional(), certified_authorised_signatory: z.object({type: z.literal("power_of_attorney"), front: z.string().min(31).max(31)}).optional()}).optional()}), z.object({id: z.unknown(), company: z.object({legal_name: z.string().min(2).max(300), trading_name: z.string().min(2).max(300), registered_address: z.object({address_line1: z.string().min(1).max(300).optional(), address_line2: z.unknown(), city: z.string().min(2).max(300).optional(), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16).optional(), country: z.string().min(2).max(2)})}), ownership_percentage: z.number().int().gte(25).lte(100).optional()})])), business_type: z.enum(["individual_or_sole_proprietorship", "limited_company", "public_limited_company", "limited_partnership", "general_partnership", "government_agency", "non_profit_entity", "trust", "club_or_society", "unincorporated_association"])}), processing_details: z.object({settlement_country: z.string().min(2).max(2), target_countries: z.array(z.string().min(2).max(2)), annual_processing_volume: z.number().int().gte(0), average_transaction_value: z.number().int().gte(0), highest_transaction_value: z.number().int().gte(0), currency: z.literal("EUR")}), documents: z.object({company_verification: z.object({type: z.literal("incorporation_document"), front: z.string().min(31).max(31)}), articles_of_association: z.object({type: z.enum(["memorandum_of_association", "articles_of_association"]), front: z.string().min(31).max(31)}), bank_verification: z.object({type: z.enum(["bank_statement", "bank_letter"]), front: z.string().min(31).max(31)}), shareholder_structure: z.object({type: z.literal("certified_shareholder_structure"), front: z.string().min(31).max(31)}), proof_of_legality: z.object({type: z.literal("proof_of_legality"), front: z.string().min(31).max(31)}).optional(), proof_of_principal_address: z.object({type: z.literal("proof_of_address"), front: z.string().min(31).max(31)}).optional(), additional_document1: z.object({front: z.string().min(31).max(31)}).optional(), additional_document2: z.object({front: z.string().min(31).max(31)}).optional(), additional_document3: z.object({front: z.string().min(31).max(31)}).optional()})}); export const uSCompanyFull30 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.literal("USD"))}), contact_details: z.object({phone: z.object({country_code: z.literal("US"), number: z.string().min(10).max(16)}).optional(), email_addresses: z.object({primary: z.unknown()}).optional(), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional(), message: z.string().optional()})).optional(), company: z.object({legal_name: z.string().min(2).max(300), trading_name: z.string().min(2).max(300), business_registration_number: z.unknown(), date_of_incorporation: z.object({day: z.number().int().gte(1).lte(31).optional(), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1500).lte(2999)}), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.enum(["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AS", "GU", "MP", "PR", "VI", "UM"]), zip: z.string().min(5).max(10), country: z.string().min(2).max(2)}), representatives: z.array(z.object({id: z.unknown(), individual: z.object({first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), place_of_birth: z.object({country: z.string().min(2).max(2)}), national_id_number: z.unknown(), email_address: z.unknown(), phone: z.object({country_code: z.enum(["AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BA", "BW", "BR", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CO", "KM", "CD", "CG", "CK", "CR", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FO", "FJ", "FI", "FR", "GF", "PF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "BQ", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UY", "UZ", "VU", "VA", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]), number: z.string().min(5).max(16)}).optional(), address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)})}), company_position: z.enum(["ceo", "cfo", "coo", "managing_member", "general_partner", "president", "vice_president", "treasurer", "other_senior_management", "other_executive_officer", "other_non_executive_non_senior"]).optional(), roles: z.array(z.enum(["ubo", "authorised_signatory", "control_person"])), ownership_percentage: z.number().int().gte(25).lte(100).optional(), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()}).optional(), certified_authorised_signatory: z.object({type: z.literal("power_of_attorney"), front: z.string().min(31).max(31)}).optional()}).optional()})), business_type: z.enum(["individual_or_sole_proprietorship", "private_corporation", "limited_liability_corporation", "publicly_traded_corporation", "limited_partnership", "non_profit_entity", "government_agency", "regulated_financial_institution", "sec_registered_entity", "cftc_registered_entity"])}), processing_details: z.object({settlement_country: z.string().min(2).max(2), target_countries: z.array(z.string().min(2).max(2)), annual_processing_volume: z.number().int().gte(0), average_transaction_value: z.number().int().gte(0), highest_transaction_value: z.number().int().gte(0), currency: z.literal("USD")}), documents: z.object({tax_verification: z.object({type: z.literal("ein_letter"), front: z.string().min(31).max(31)}).optional(), company_verification: z.object({type: z.literal("incorporation_document"), front: z.string().min(31).max(31)}).optional(), articles_of_association: z.object({type: z.enum(["memorandum_of_association", "articles_of_association"]), front: z.string().min(31).max(31)}).optional(), bank_verification: z.object({type: z.enum(["bank_statement", "bank_letter", "voided_check"]), front: z.string().min(31).max(31)}).optional(), shareholder_structure: z.object({type: z.literal("certified_shareholder_structure"), front: z.string().min(31).max(31)}).optional(), proof_of_legality: z.object({type: z.literal("proof_of_legality"), front: z.string().min(31).max(31)}).optional(), proof_of_principal_address: z.object({type: z.literal("proof_of_address"), front: z.string().min(31).max(31)}).optional(), additional_document1: z.object({front: z.string().min(31).max(31)}).optional(), additional_document2: z.object({front: z.string().min(31).max(31)}).optional(), additional_document3: z.object({front: z.string().min(31).max(31)}).optional()})}); export const gBCompanyFull20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.enum(["AED", "AUD", "CAD", "CHF", "CZK", "DKK", "EUR", "GBP", "HKD", "JPY", "KWD", "NOK", "NZD", "PLN", "RON", "SEK", "SGD", "USD", "ZAR"])).optional()}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), company: z.object({legal_name: z.string().min(2).max(300), trading_name: z.string().min(2).max(300), business_registration_number: z.unknown(), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(5).max(8), country: z.string().min(2).max(2)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(5).max(8), country: z.string().min(2).max(2)}), representatives: z.array(z.object({id: z.unknown(), first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})}).optional(), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), phone: z.object({number: z.unknown()}).optional(), address: z.object({address_line1: z.string().min(1).max(300).optional(), address_line2: z.unknown(), city: z.string().min(2).max(300).optional(), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16).optional(), country: z.string().min(2).max(2)}), roles: z.array(z.enum(["ubo", "authorised_signatory"]))})), date_of_incorporation: z.object({day: z.number().int().gte(1).lte(31).optional(), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1500).lte(2999)}).optional()}), documents: z.object({company_verification: z.object({type: z.literal("incorporation_document"), front: z.string().min(31).max(31)})}).optional()}); export const eEACompanyFull20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.enum(["AED", "AUD", "CAD", "CHF", "CZK", "DKK", "EUR", "GBP", "HKD", "JPY", "NOK", "NZD", "PLN", "RON", "SEK", "SGD", "USD", "ZAR"])).optional()}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), company: z.object({legal_name: z.string().min(2).max(300), trading_name: z.string().min(2).max(300), business_registration_number: z.unknown(), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), representatives: z.array(z.object({id: z.unknown(), first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), phone: z.object({number: z.unknown()}).optional(), address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), place_of_birth: z.object({country: z.string().min(2).max(2)}), roles: z.array(z.enum(["ubo", "legal_representative"])), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})})})), financial_details: z.object({annual_processing_volume: z.number().int().gte(0), average_transaction_value: z.number().int().gte(0), highest_transaction_value: z.number().int().gte(0), currency: z.literal("EUR").optional()}), business_type: z.enum(["general_partnership", "limited_partnership", "public_limited_company", "limited_company", "professional_association", "unincorporated_association", "auto_entrepreneur"]), date_of_incorporation: z.object({day: z.number().int().gte(1).lte(31).optional(), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1500).lte(2999)}).optional()}), documents: z.object({company_verification: z.object({type: z.literal("incorporation_document"), front: z.string().min(31).max(31)}), bank_verification: z.object({type: z.enum(["bank_statement", "bank_letter"]), front: z.string().min(31).max(31)}).optional(), financial_verification: z.object({type: z.literal("financial_statement"), front: z.string().min(31).max(31)}).optional()})}); export const uSCompanyFull20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.literal("USD")).optional()}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), company: z.object({legal_name: z.string().min(2).max(300), trading_name: z.string().min(2).max(300), business_registration_number: z.string().min(9).max(9), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.enum(["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AS", "GU", "MP", "PR", "VI", "UM"]), zip: z.string().min(5).max(10), country: z.string().min(2).max(2)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.enum(["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AS", "GU", "MP", "PR", "VI", "UM"]), zip: z.string().min(5).max(10), country: z.string().min(2).max(2)}), representatives: z.array(z.object({id: z.unknown(), first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), identification: z.object({national_id_number: z.unknown()}), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), phone: z.object({number: z.unknown()}).optional(), address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})}).optional(), roles: z.array(z.enum(["ubo", "authorised_signatory", "control_person"]))})), business_type: z.enum(["private_corporation", "publicly_traded_corporation", "government_agency", "individual_or_sole_proprietorship", "limited_liability_corporation", "limited_partnership", "non_profit_entity", "sec_registered_entity", "cftc_registered_entity", "regulated_financial_institution"]), financial_details: z.object({annual_processing_volume: z.number().int().gte(0), average_transaction_value: z.number().int().gte(0), highest_transaction_value: z.number().int().gte(0), currency: z.literal("USD")}), date_of_incorporation: z.object({day: z.number().int().gte(1).lte(31).optional(), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1500).lte(2999)}).optional()}), documents: z.object({company_verification: z.object({type: z.enum(["incorporation_document", "articles_of_association"]), front: z.string().min(31).max(31)}).optional(), tax_verification: z.object({type: z.literal("ein_letter"), front: z.string().min(31).max(31)}).optional()}).optional()}); export const gBCompanyLite20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown())}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), company: z.object({legal_name: z.string().min(2).max(300), trading_name: z.string().min(2).max(300), business_registration_number: z.unknown(), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(5).max(8), country: z.string().min(2).max(2)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(5).max(8), country: z.string().min(2).max(2)}), representatives: z.array(z.object({id: z.unknown(), first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})}).optional(), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}).optional(), phone: z.object({number: z.unknown()}).optional(), address: z.object({address_line1: z.string().min(1).max(300).optional(), address_line2: z.unknown(), city: z.string().min(2).max(300).optional(), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16).optional(), country: z.string().min(2).max(2)}), roles: z.array(z.enum(["ubo", "authorised_signatory"]))}))}), documents: z.object({company_verification: z.object({type: z.literal("incorporation_document"), front: z.string().min(31).max(31)}).optional()}).optional()}); export const eEACompanyLite20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown())}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), company: z.object({legal_name: z.string().min(2).max(300), trading_name: z.string().min(2).max(300), business_registration_number: z.unknown(), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), representatives: z.array(z.object({id: z.unknown(), first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})}).optional(), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}).optional(), phone: z.object({number: z.unknown()}).optional(), address: z.object({address_line1: z.string().min(1).max(300).optional(), address_line2: z.unknown(), city: z.string().min(2).max(300).optional(), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16).optional(), country: z.string().min(2).max(2)}), place_of_birth: z.object({country: z.string().min(2).max(2)}).optional(), roles: z.array(z.enum(["ubo", "legal_representative"])).optional()})), financial_details: z.object({annual_processing_volume: z.number().int().gte(0).optional(), average_transaction_value: z.number().int().gte(0).optional(), highest_transaction_value: z.number().int().gte(0).optional(), currency: z.literal("EUR").optional()}).optional(), business_type: z.enum(["general_partnership", "limited_partnership", "public_limited_company", "limited_company", "professional_association", "unincorporated_association", "auto_entrepreneur"]).optional()}), documents: z.object({company_verification: z.object({type: z.literal("incorporation_document"), front: z.string().min(31).max(31)}).optional(), bank_verification: z.object({type: z.literal("bank_statement"), front: z.string().min(31).max(31)}).optional(), financial_verification: z.object({type: z.literal("financial_statement"), front: z.string().min(31).max(31)}).optional()}).optional()}); export const uSCompanyLite20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown())}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), company: z.object({legal_name: z.string().min(2).max(300), trading_name: z.string().min(2).max(300), business_registration_number: z.string().min(9).max(9).optional(), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.enum(["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AS", "GU", "MP", "PR", "VI", "UM"]), zip: z.string().min(5).max(10), country: z.string().min(2).max(2)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.enum(["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AS", "GU", "MP", "PR", "VI", "UM"]), zip: z.string().min(5).max(10), country: z.string().min(2).max(2)}), representatives: z.array(z.object({first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), identification: z.object({national_id_number: z.unknown()}).optional(), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}).optional(), phone: z.object({number: z.unknown()}).optional(), address: z.object({address_line1: z.string().min(1).max(300).optional(), address_line2: z.unknown(), city: z.string().min(2).max(300).optional(), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16).optional(), country: z.string().min(2).max(2)}), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})}).optional(), roles: z.array(z.enum(["ubo", "authorised_signatory", "control_person"])).optional()})), business_type: z.enum(["private_corporation", "publicly_traded_corporation", "government_agency", "individual_or_sole_proprietorship", "limited_liability_corporation", "limited_partnership", "non_profit_entity", "sec_registered_entity", "cftc_registered_entity", "regulated_financial_institution"]).optional(), financial_details: z.object({annual_processing_volume: z.number().int().gte(0).optional(), average_transaction_value: z.number().int().gte(0).optional(), highest_transaction_value: z.number().int().gte(0).optional(), currency: z.literal("USD").optional()}).optional()}), documents: z.object({company_verification: z.object({type: z.enum(["incorporation_document", "articles_of_association"]), front: z.string().min(31).max(31)}).optional(), tax_verification: z.object({type: z.literal("ein_letter"), front: z.string().min(31).max(31)}).optional()}).optional()}); export const gBSoleTraderFull30 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.enum(["AED", "AUD", "CAD", "CHF", "CZK", "DKK", "EUR", "GBP", "HKD", "JPY", "KWD", "NOK", "NZD", "PLN", "RON", "SEK", "SGD", "USD", "ZAR"]))}), contact_details: z.object({phone: z.object({country_code: z.enum(["GI", "CH", "GG", "IM", "JE", "GB"]), number: z.string().min(7).max(11)}).optional(), email_addresses: z.object({primary: z.unknown()}).optional(), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional(), message: z.string().optional()})).optional(), company: z.object({trading_name: z.string().min(2).max(300), date_of_incorporation: z.object({day: z.number().int().gte(1).lte(31).optional(), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1500).lte(2999)}), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(5).max(8), country: z.string().min(2).max(2)}), representatives: z.array(z.object({id: z.unknown(), individual: z.object({first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), place_of_birth: z.object({country: z.string().min(2).max(2)}), national_id_number: z.unknown(), email_address: z.unknown(), phone: z.object({country_code: z.enum(["AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BA", "BW", "BR", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CO", "KM", "CD", "CG", "CK", "CR", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FO", "FJ", "FI", "FR", "GF", "PF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "BQ", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UY", "UZ", "VU", "VA", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]), number: z.string().min(5).max(16)}).optional(), address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)})}), roles: z.array(z.literal("ubo")), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})})})), business_type: z.enum(["individual_or_sole_proprietorship", "limited_company", "public_limited_company", "limited_partnership", "general_partnership", "scottish_limited_partnership", "government_agency", "non_profit_entity", "trust", "club_or_society", "unincorporated_association"])}), processing_details: z.object({settlement_country: z.string().min(2).max(2), target_countries: z.array(z.string().min(2).max(2)), annual_processing_volume: z.number().int().gte(0), average_transaction_value: z.number().int().gte(0), highest_transaction_value: z.number().int().gte(0), currency: z.literal("GBP")}), documents: z.object({bank_verification: z.object({type: z.enum(["bank_statement", "bank_letter"]), front: z.string().min(31).max(31)}), additional_document1: z.object({front: z.string().min(31).max(31)}).optional(), additional_document2: z.object({front: z.string().min(31).max(31)}).optional(), additional_document3: z.object({front: z.string().min(31).max(31)}).optional()})}); export const eEASoleTraderFull30 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.enum(["AED", "AUD", "CAD", "CHF", "CZK", "DKK", "EUR", "GBP", "HKD", "JPY", "NOK", "NZD", "PLN", "RON", "SEK", "SGD", "USD", "ZAR"]))}), contact_details: z.object({phone: z.object({country_code: z.enum(["GR", "NL", "BE", "FR", "ES", "PT", "LU", "IE", "IS", "MT", "CY", "FI", "BG", "HU", "LT", "LV", "EE", "AD", "HR", "SI", "IT", "RO", "CZ", "SK", "LI", "AT", "DK", "SE", "NO", "PL", "DE"]), number: z.string().min(6).max(13)}).optional(), email_addresses: z.object({primary: z.unknown()}).optional(), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional(), message: z.string().optional()})).optional(), company: z.object({trading_name: z.string().min(2).max(300), is_registered_company: z.boolean().optional(), business_registration_number: z.string().min(2).max(39).optional(), date_of_incorporation: z.object({day: z.number().int().gte(1).lte(31).optional(), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1500).lte(2999)}), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), representatives: z.array(z.object({id: z.unknown(), individual: z.object({first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), place_of_birth: z.object({country: z.string().min(2).max(2)}), national_id_number: z.unknown(), email_address: z.unknown(), phone: z.object({country_code: z.enum(["AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BA", "BW", "BR", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CO", "KM", "CD", "CG", "CK", "CR", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FO", "FJ", "FI", "FR", "GF", "PF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "BQ", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UY", "UZ", "VU", "VA", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]), number: z.string().min(5).max(16)}).optional(), address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)})}), roles: z.array(z.literal("ubo")), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()}), proof_of_residential_address: z.object({type: z.literal("proof_of_address"), front: z.string().min(31).max(31)}), proof_of_registration: z.object({type: z.enum(["extract_from_trade_register", "other"]), front: z.string().min(31).max(31)})})})), business_type: z.enum(["individual_or_sole_proprietorship", "limited_company", "public_limited_company", "limited_partnership", "general_partnership", "government_agency", "non_profit_entity", "trust", "club_or_society", "unincorporated_association"])}), processing_details: z.object({settlement_country: z.string().min(2).max(2), target_countries: z.array(z.string().min(2).max(2)), annual_processing_volume: z.number().int().gte(0), average_transaction_value: z.number().int().gte(0), highest_transaction_value: z.number().int().gte(0), currency: z.literal("EUR")}), documents: z.object({bank_verification: z.object({type: z.enum(["bank_statement", "bank_letter"]), front: z.string().min(31).max(31)}), additional_document1: z.object({front: z.string().min(31).max(31)}).optional(), additional_document2: z.object({front: z.string().min(31).max(31)}).optional(), additional_document3: z.object({front: z.string().min(31).max(31)}).optional()})}); export const uSSoleTraderFull30 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.literal("USD"))}), contact_details: z.object({phone: z.object({country_code: z.literal("US"), number: z.string().min(10).max(16)}).optional(), email_addresses: z.object({primary: z.unknown()}).optional(), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional(), message: z.string().optional()})).optional(), company: z.object({trading_name: z.string().min(2).max(300), date_of_incorporation: z.object({day: z.number().int().gte(1).lte(31).optional(), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1500).lte(2999)}), principal_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.enum(["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AS", "GU", "MP", "PR", "VI", "UM"]), zip: z.string().min(5).max(10), country: z.string().min(2).max(2)}), representatives: z.array(z.object({id: z.unknown(), individual: z.object({first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), place_of_birth: z.object({country: z.string().min(2).max(2)}), national_id_number: z.unknown(), email_address: z.unknown(), phone: z.object({country_code: z.enum(["AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BA", "BW", "BR", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CO", "KM", "CD", "CG", "CK", "CR", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FO", "FJ", "FI", "FR", "GF", "PF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "BQ", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UY", "UZ", "VU", "VA", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]), number: z.string().min(5).max(16)}).optional(), address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)})}), roles: z.array(z.literal("ubo")), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})})})), business_type: z.enum(["individual_or_sole_proprietorship", "private_corporation", "limited_liability_corporation", "publicly_traded_corporation", "limited_partnership", "non_profit_entity", "government_agency", "regulated_financial_institution", "sec_registered_entity", "cftc_registered_entity"])}), processing_details: z.object({settlement_country: z.string().min(2).max(2), target_countries: z.array(z.string().min(2).max(2)), annual_processing_volume: z.number().int().gte(0), average_transaction_value: z.number().int().gte(0), highest_transaction_value: z.number().int().gte(0), currency: z.literal("USD")}), documents: z.object({bank_verification: z.object({type: z.enum(["bank_statement", "bank_letter", "voided_check"]), front: z.string().min(31).max(31)}), additional_document1: z.object({front: z.string().min(31).max(31)}).optional(), additional_document2: z.object({front: z.string().min(31).max(31)}).optional(), additional_document3: z.object({front: z.string().min(31).max(31)}).optional()})}); export const gBSoleTraderFull20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.enum(["AED", "AUD", "CAD", "CHF", "CZK", "DKK", "EUR", "GBP", "HKD", "JPY", "KWD", "NOK", "NZD", "PLN", "RON", "SEK", "SGD", "USD", "ZAR"])).optional()}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), individual: z.object({trading_name: z.string().min(2).max(300), first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(5).max(8), country: z.string().min(2).max(2)})}), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})}).optional()}); export const eEASoleTraderFull20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.enum(["AED", "AUD", "CAD", "CHF", "CZK", "DKK", "EUR", "GBP", "HKD", "JPY", "NOK", "NZD", "PLN", "RON", "SEK", "SGD", "USD", "ZAR"])).optional()}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), individual: z.object({trading_name: z.string().min(2).max(300), is_registered_company: z.boolean().optional(), business_registration_number: z.string().min(2).max(39).optional(), national_tax_id: z.string().min(2).max(16).optional(), first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), place_of_birth: z.object({country: z.string().min(2).max(2)})}), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})})}); export const uSSoleTraderFull20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown()), default_holding_currency: z.unknown(), holding_currencies: z.array(z.literal("USD")).optional()}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})}).optional(), individual: z.object({trading_name: z.string().min(2).max(300), first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.enum(["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AS", "GU", "MP", "PR", "VI", "UM"]), zip: z.string().min(5).max(10), country: z.string().min(2).max(2)}), identification: z.object({national_id_number: z.unknown()}), financial_details: z.object({annual_processing_volume: z.number().int().gte(0), average_transaction_value: z.number().int().gte(0), highest_transaction_value: z.number().int().gte(0), currency: z.literal("USD")})})}); export const gBSoleTraderLite20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown())}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})}).optional(), individual: z.object({trading_name: z.string().min(2).max(300), first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}).optional(), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(5).max(8), country: z.string().min(2).max(2)})})}); export const eEASoleTraderLite20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown())}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})}).optional(), individual: z.object({trading_name: z.string().min(2).max(300), is_registered_company: z.boolean().optional(), business_registration_number: z.string().min(2).max(39).optional(), national_tax_id: z.string().min(2).max(16).optional(), first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.string().min(1).max(300).optional(), zip: z.string().min(1).max(16), country: z.string().min(2).max(2)}), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), place_of_birth: z.object({country: z.string().min(2).max(2)})})}); export const uSSoleTraderLite20 = z.object({reference: z.string().min(1).max(50), status: z.string().optional(), is_draft: z.boolean().optional(), profile: z.object({urls: z.array(z.string().min(4).max(300)), mccs: z.array(z.unknown())}), contact_details: z.object({phone: z.object({number: z.unknown()}), email_addresses: z.object({primary: z.unknown()}), invitee: z.object({email: z.unknown()}).optional()}), capabilities: z.object({}).optional(), requirements_due: z.array(z.object({field: z.string().optional(), reason: z.string().optional()})).optional(), instruments: z.array(z.object({})).optional(), documents: z.object({identity_verification: z.object({type: z.enum(["passport", "national_identity_card", "driving_license", "citizen_card", "residence_permit", "electoral_id"]), front: z.string().min(31).max(31), back: z.string().min(31).max(31).optional()})}).optional(), individual: z.object({trading_name: z.string().min(2).max(300), first_name: z.string().min(2).max(50), middle_name: z.string().min(2).max(50).optional(), last_name: z.string().min(2).max(50), date_of_birth: z.object({day: z.number().int().gte(1).lte(31), month: z.number().int().gte(1).lte(12), year: z.number().int().gte(1900).lte(2999)}), registered_address: z.object({address_line1: z.string().min(1).max(300), address_line2: z.unknown(), city: z.string().min(2).max(300), state: z.enum(["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AS", "GU", "MP", "PR", "VI", "UM"]), zip: z.string().min(5).max(10), country: z.string().min(2).max(2)}), identification: z.object({national_id_number: z.unknown()}).optional(), financial_details: z.object({annual_processing_volume: z.number().int().gte(0).optional(), average_transaction_value: z.number().int().gte(0).optional(), highest_transaction_value: z.number().int().gte(0).optional(), currency: z.literal("USD").optional()}).optional()})}); export const getApiAccountsEntitiesIdResponse = z.union([gBCompanyFull30, eEACompanyFull30, uSCompanyFull30, gBCompanyFull20, eEACompanyFull20, uSCompanyFull20, gBCompanyLite20, eEACompanyLite20, uSCompanyLite20, gBSoleTraderFull30, eEASoleTraderFull30, uSSoleTraderFull30, gBSoleTraderFull20, eEASoleTraderFull20, uSSoleTraderFull20, gBSoleTraderLite20, eEASoleTraderLite20, uSSoleTraderLite20]); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Get entity details * * GET /accounts/entities/{id} */ export const getApiAccountsEntitiesId = async (options: GetApiAccountsEntitiesIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (OAuth !== undefined) headers.set('authorization', `Bearer ${OAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/accounts/entities/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(getApiAccountsEntitiesIdResponse, await res.json()) };