import {z} from 'zod' export type V1StateAbbreviation = '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' | 'PR' | 'VI' | 'AE' | 'AA' | 'AP' | 'GU' | 'AS'; export type V1BusinessStructure = 'SOLE_PROPRIETORSHIP' | 'GENERAL_PARTNERSHIP' | 'LLC' | 'LLP' | 'LLLP' | 'LP' | 'C_CORPORATION' | 'S_CORPORATION' | 'B_CORPORATION' | 'NONPROFIT' | 'COOPERATIVE' | 'TRUST' | 'PROFESSIONAL_ASSOCIATION' | 'PROFESSIONAL_CORPORATION' | 'TRADE_NAME' | 'BANK' | 'CREDIT_UNION' | 'INSURANCE' | 'OTHER'; export type V1LienFilingOrganizationRecordOwnerParty = {mailing_address?: (string | null) | undefined, city?: (string | null) | undefined, state?: (V1StateAbbreviation | null) | undefined, postal_code?: (string | null) | undefined, organization_name?: (string | null) | undefined, organization_type?: (V1BusinessStructure | null) | undefined, type: 'ORGANIZATION'}; export type V1LienFilingIndividualRecordOwnerParty = {mailing_address?: (string | null) | undefined, city?: (string | null) | undefined, state?: (V1StateAbbreviation | null) | undefined, postal_code?: (string | null) | undefined, suffix?: (string | null) | undefined, last_name?: (string | null) | undefined, first_name?: (string | null) | undefined, middle_name?: (string | null) | undefined, type: 'INDIVIDUAL'}; export type V1LienFilingRealEstateInfo = {type: 'FILE_IN_REAL_ESTATE_RECORDS', covers_timber?: (boolean | null) | undefined, covers_as_extracted_collateral?: (boolean | null) | undefined, filed_as_fixture?: (boolean | null) | undefined, real_estate_record_owner?: (V1LienFilingOrganizationRecordOwnerParty | V1LienFilingIndividualRecordOwnerParty | null) | undefined, real_estate_description?: (string | null) | undefined}; export type V1LienFilingNoRealEstateInfo = {type: 'NO_REAL_ESTATE_INFO'}; export type V1LienFilingUCC3TerminationAction = {type: 'TERMINATION'}; export type V1LienFilingUCC3ContinuationAction = {type: 'CONTINUATION'}; export type V1LienFilingOrganizationSecuredParty = {mailing_address?: (string | null) | undefined, city?: (string | null) | undefined, state?: (V1StateAbbreviation | null) | undefined, postal_code?: (string | null) | undefined, masked?: (boolean | null) | undefined, is_assignor?: (boolean | null) | undefined, organization_name?: (string | null) | undefined, organization_type?: (V1BusinessStructure | null) | undefined, type: 'ORGANIZATION'}; export type StateAbbreviation = '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' | 'PR' | 'VI' | 'AE' | 'AA' | 'AP' | 'GU' | 'AS'; export type V1LienFilingIndividualSecuredParty = {mailing_address?: (string | null) | undefined, city?: (string | null) | undefined, state?: (StateAbbreviation | null) | undefined, postal_code?: (string | null) | undefined, masked?: (boolean | null) | undefined, is_assignor?: (boolean | null) | undefined, suffix?: (string | null) | undefined, last_name?: (string | null) | undefined, first_name?: (string | null) | undefined, middle_name?: (string | null) | undefined, type: 'INDIVIDUAL'}; export type V1LienFilingCollateralStatementDesignation = 'NONE' | 'TRUST' | 'PERSONAL_REPRESENTATIVE'; export type V1LienFilingCollateralStatementText = {collateral_statement_designation?: (V1LienFilingCollateralStatementDesignation | null) | undefined, text?: (string | null) | undefined, type: 'TEXT'}; export type LienFilingCollateralStatementDesignation = 'NONE' | 'TRUST' | 'PERSONAL_REPRESENTATIVE'; export type V1LienFilingCollateralStatementAttachmentsRequest = {collateral_statement_designation?: (LienFilingCollateralStatementDesignation | null) | undefined, type: 'ATTACHMENTS'}; export type V1LienFilingUCC3PartialAssignment = {type: 'PARTIAL', secured_parties?: (Array | null) | undefined, collateral_statements?: (V1LienFilingCollateralStatementText | V1LienFilingCollateralStatementAttachmentsRequest | null) | undefined}; export type V1LienFilingUCC3FullAssignment = {type: 'FULL', secured_parties?: (Array | null) | undefined}; export type V1LienFilingUCC3AssignmentAction = {type: 'ASSIGNMENT', assignment?: (V1LienFilingUCC3PartialAssignment | V1LienFilingUCC3FullAssignment) | undefined}; export type LienPartyDebtorCapacity = 'ESTATE' | 'TRUST' | 'TRUSTEE' | 'NONE_OF_THE_ABOVE'; export type BusinessStructure = 'SOLE_PROPRIETORSHIP' | 'GENERAL_PARTNERSHIP' | 'LLC' | 'LLP' | 'LLLP' | 'LP' | 'C_CORPORATION' | 'S_CORPORATION' | 'B_CORPORATION' | 'NONPROFIT' | 'COOPERATIVE' | 'TRUST' | 'PROFESSIONAL_ASSOCIATION' | 'PROFESSIONAL_CORPORATION' | 'TRADE_NAME' | 'BANK' | 'CREDIT_UNION' | 'INSURANCE' | 'OTHER'; export type V1LienFilingOrganizationDebtorParty = {mailing_address?: (string | null) | undefined, city?: (string | null) | undefined, state?: (StateAbbreviation | null) | undefined, postal_code?: (string | null) | undefined, capacity?: LienPartyDebtorCapacity | undefined, organization_name?: (string | null) | undefined, organization_type?: (BusinessStructure | null) | undefined, type: 'ORGANIZATION'}; export type V1LienFilingIndividualDebtorParty = {mailing_address?: (string | null) | undefined, city?: (string | null) | undefined, state?: (StateAbbreviation | null) | undefined, postal_code?: (string | null) | undefined, capacity?: LienPartyDebtorCapacity | undefined, suffix?: (string | null) | undefined, last_name?: (string | null) | undefined, first_name?: (string | null) | undefined, middle_name?: (string | null) | undefined, type: 'INDIVIDUAL'}; export type V1LienFilingUCC3AddDebtorAmendment = {type: 'ADD', debtors?: (Array | null) | undefined}; export type V1LienFilingUCC3AmendingDebtor = {amending_debtor_id: string, new_debtor: V1LienFilingOrganizationDebtorParty | V1LienFilingIndividualDebtorParty}; export type V1LienFilingUCC3EditDebtorAmendment = {type: 'EDIT', amending_debtors?: (Array | null) | undefined}; export type V1LienFilingUCC3DeleteDebtorAmendment = {type: 'DELETE', deleted_debtor_ids?: (Array | null) | undefined}; export type V1LienFilingUCC3DebtorAmendmentAction = {type: 'DEBTOR_AMENDMENT', amendment?: (V1LienFilingUCC3AddDebtorAmendment | V1LienFilingUCC3EditDebtorAmendment | V1LienFilingUCC3DeleteDebtorAmendment | null) | undefined}; export type V1LienFilingUCC3AddSecuredPartyAmendment = {type: 'ADD', secured_parties?: (Array | null) | undefined}; export type V1LienFilingUCC3AmendingSecuredParty = {amending_secured_party_id: string, new_secured_party: V1LienFilingOrganizationSecuredParty | V1LienFilingIndividualSecuredParty}; export type V1LienFilingUCC3EditSecuredPartyAmendment = {type: 'EDIT', amending_secured_parties?: (Array | null) | undefined}; export type V1LienFilingUCC3DeleteSecuredPartyAmendment = {type: 'DELETE', deleted_secured_party_ids?: (Array | null) | undefined}; export type V1LienFilingUCC3SecuredPartyAmendmentAction = {type: 'SECURED_PARTY_AMENDMENT', amendment?: (V1LienFilingUCC3AddSecuredPartyAmendment | V1LienFilingUCC3EditSecuredPartyAmendment | V1LienFilingUCC3DeleteSecuredPartyAmendment | null) | undefined}; export type LienFilingCollateralAmendmentType = 'ADD' | 'RESTATE' | 'DELETE'; export type V1LienFilingUCC3CollateralAmendmentAction = {type: 'COLLATERAL_AMENDMENT', collateral_amendment_type?: LienFilingCollateralAmendmentType | undefined, collateral_statements?: (V1LienFilingCollateralStatementText | V1LienFilingCollateralStatementAttachmentsRequest | null) | undefined}; export type V1LienFilingUCC3AuthorizingPartyDebtor = {role?: 'Debtor' | undefined, id: string}; export type V1LienFilingUCC3AuthorizingPartySecuredParty = {role?: 'Secured Party' | undefined, id: string}; export type V1LienFilingSubmissionCreateUCC3Request = {reference_data?: (string | null) | undefined, submission_filing_name?: (string | null) | undefined, search_to_reflect?: (boolean | null) | undefined, email_contact?: (string | null) | undefined, real_estate_info?: (V1LienFilingRealEstateInfo | V1LienFilingNoRealEstateInfo | null) | undefined, miscellaneous_info?: (string | null) | undefined, filing_type: 'UCC3', amendment_action?: (V1LienFilingUCC3TerminationAction | V1LienFilingUCC3ContinuationAction | V1LienFilingUCC3AssignmentAction | V1LienFilingUCC3DebtorAmendmentAction | V1LienFilingUCC3SecuredPartyAmendmentAction | V1LienFilingUCC3CollateralAmendmentAction | null) | undefined, authorizing_party?: (V1LienFilingUCC3AuthorizingPartyDebtor | V1LienFilingUCC3AuthorizingPartySecuredParty | null) | undefined}; export type CreateApiLienSubmissionsFilingIdAmendArgs = {filing_id: string, body: V1LienFilingSubmissionCreateUCC3Request}; export type CreateApiLienSubmissionsFilingIdAmendOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; export const v1StateAbbreviation = 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", "PR", "VI", "AE", "AA", "AP", "GU", "AS"]); export const v1BusinessStructure = z.enum(["SOLE_PROPRIETORSHIP", "GENERAL_PARTNERSHIP", "LLC", "LLP", "LLLP", "LP", "C_CORPORATION", "S_CORPORATION", "B_CORPORATION", "NONPROFIT", "COOPERATIVE", "TRUST", "PROFESSIONAL_ASSOCIATION", "PROFESSIONAL_CORPORATION", "TRADE_NAME", "BANK", "CREDIT_UNION", "INSURANCE", "OTHER"]); export const v1LienFilingOrganizationRecordOwnerParty = z.object({mailing_address: z.string().max(128).nullable().optional(), city: z.string().max(128).nullable().optional(), state: v1StateAbbreviation.nullable().optional(), postal_code: z.string().max(16).nullable().optional(), organization_name: z.string().max(128).nullable().optional(), organization_type: v1BusinessStructure.nullable().optional(), type: z.literal("ORGANIZATION")}); export const v1LienFilingIndividualRecordOwnerParty = z.object({mailing_address: z.string().max(128).nullable().optional(), city: z.string().max(128).nullable().optional(), state: v1StateAbbreviation.nullable().optional(), postal_code: z.string().max(16).nullable().optional(), suffix: z.string().max(16).nullable().optional(), last_name: z.string().max(16).nullable().optional(), first_name: z.string().max(16).nullable().optional(), middle_name: z.string().max(16).nullable().optional(), type: z.literal("INDIVIDUAL")}); export const v1LienFilingRealEstateInfo = z.object({type: z.literal("FILE_IN_REAL_ESTATE_RECORDS"), covers_timber: z.boolean().nullable().optional(), covers_as_extracted_collateral: z.boolean().nullable().optional(), filed_as_fixture: z.boolean().nullable().optional(), real_estate_record_owner: z.union([v1LienFilingOrganizationRecordOwnerParty, v1LienFilingIndividualRecordOwnerParty]).nullable().optional(), real_estate_description: z.string().max(1024).nullable().optional()}); export const v1LienFilingNoRealEstateInfo = z.object({type: z.literal("NO_REAL_ESTATE_INFO")}); export const v1LienFilingUCC3TerminationAction = z.object({type: z.literal("TERMINATION")}); export const v1LienFilingUCC3ContinuationAction = z.object({type: z.literal("CONTINUATION")}); export const v1LienFilingOrganizationSecuredPartyResponse = z.object({id: z.string().optional(), mailing_address: z.string().max(128).nullable().optional(), city: z.string().max(128).nullable().optional(), state: v1StateAbbreviation.nullable().optional(), postal_code: z.string().max(16).nullable().optional(), masked: z.boolean().nullable().optional(), is_assignor: z.boolean().nullable().optional(), organization_name: z.string().max(128).nullable().optional(), organization_type: v1BusinessStructure.nullable().optional(), type: z.literal("ORGANIZATION"), role: z.literal("Secured Party")}); export const v1LienFilingIndividualSecuredPartyResponse = z.object({id: z.string().optional(), mailing_address: z.string().max(128).nullable().optional(), city: z.string().max(128).nullable().optional(), state: v1StateAbbreviation.nullable().optional(), postal_code: z.string().max(16).nullable().optional(), masked: z.boolean().nullable().optional(), is_assignor: z.boolean().nullable().optional(), suffix: z.string().max(16).nullable().optional(), last_name: z.string().max(16).nullable().optional(), first_name: z.string().max(16).nullable().optional(), middle_name: z.string().max(16).nullable().optional(), type: z.literal("INDIVIDUAL"), role: z.literal("Secured Party")}); export const v1LienFilingCollateralStatementDesignation = z.enum(["NONE", "TRUST", "PERSONAL_REPRESENTATIVE"]); export const v1LienFilingCollateralStatementText = z.object({collateral_statement_designation: v1LienFilingCollateralStatementDesignation.nullable().optional(), text: z.string().nullable().optional(), type: z.literal("TEXT")}); export const v1LienFilingAttachment = z.object({id: z.string(), document_filename: z.string().max(256)}); export const v1LienFilingCollateralStatementAttachmentsResponse = z.object({collateral_statement_designation: v1LienFilingCollateralStatementDesignation.nullable().optional(), attachments: z.array(v1LienFilingAttachment).optional(), type: z.literal("ATTACHMENTS")}); export const v1LienFilingUCC3PartialAssignmentResponse = z.object({type: z.literal("PARTIAL"), secured_parties: z.array(z.discriminatedUnion("type", [v1LienFilingOrganizationSecuredPartyResponse, v1LienFilingIndividualSecuredPartyResponse])).nullable().optional(), collateral_statements: z.union([v1LienFilingCollateralStatementText, v1LienFilingCollateralStatementAttachmentsResponse]).nullable().optional()}); export const v1LienFilingUCC3FullAssignmentResponse = z.object({type: z.literal("FULL"), secured_parties: z.array(z.discriminatedUnion("type", [v1LienFilingOrganizationSecuredPartyResponse, v1LienFilingIndividualSecuredPartyResponse])).nullable().optional()}); export const v1LienFilingUCC3AssignmentActionResponse = z.object({type: z.literal("ASSIGNMENT"), assignment: z.discriminatedUnion("type", [v1LienFilingUCC3PartialAssignmentResponse, v1LienFilingUCC3FullAssignmentResponse]).optional()}); export const v1LienPartyDebtorCapacity = z.enum(["ESTATE", "TRUST", "TRUSTEE", "NONE_OF_THE_ABOVE"]); export const v1LienFilingOrganizationDebtorPartyResponse = z.object({id: z.string().optional(), mailing_address: z.string().max(128).nullable().optional(), city: z.string().max(128).nullable().optional(), state: v1StateAbbreviation.nullable().optional(), postal_code: z.string().max(16).nullable().optional(), capacity: v1LienPartyDebtorCapacity.optional(), organization_name: z.string().max(128).nullable().optional(), organization_type: v1BusinessStructure.nullable().optional(), type: z.literal("ORGANIZATION"), role: z.literal("Debtor")}); export const v1LienFilingIndividualDebtorPartyResponse = z.object({id: z.string().optional(), mailing_address: z.string().max(128).nullable().optional(), city: z.string().max(128).nullable().optional(), state: v1StateAbbreviation.nullable().optional(), postal_code: z.string().max(16).nullable().optional(), capacity: v1LienPartyDebtorCapacity.optional(), suffix: z.string().max(16).nullable().optional(), last_name: z.string().max(16).nullable().optional(), first_name: z.string().max(16).nullable().optional(), middle_name: z.string().max(16).nullable().optional(), type: z.literal("INDIVIDUAL"), role: z.literal("Debtor")}); export const v1LienFilingUCC3AddDebtorAmendmentResponse = z.object({type: z.literal("ADD"), debtors: z.array(z.discriminatedUnion("type", [v1LienFilingOrganizationDebtorPartyResponse, v1LienFilingIndividualDebtorPartyResponse])).optional()}); export const v1LienFilingAssignedBusinessDebtorPartyResponse = z.object({id: z.string().optional(), mailing_address: z.string().max(128).nullable().optional(), city: z.string().max(128).nullable().optional(), state: v1StateAbbreviation.nullable().optional(), postal_code: z.string().max(16).nullable().optional(), organization_name: z.string().max(128).nullable().optional(), organization_type: v1BusinessStructure.nullable().optional(), type: z.literal("ORGANIZATION"), capacity: v1LienPartyDebtorCapacity.optional(), business_id: z.string().optional(), role: z.literal("Debtor")}); export const v1LienFilingAssignedPersonDebtorPartyResponse = z.object({id: z.string().optional(), mailing_address: z.string().max(128).nullable().optional(), city: z.string().max(128).nullable().optional(), state: v1StateAbbreviation.nullable().optional(), postal_code: z.string().max(16).nullable().optional(), suffix: z.string().max(16).nullable().optional(), last_name: z.string().max(16).nullable().optional(), first_name: z.string().max(16).nullable().optional(), middle_name: z.string().max(16).nullable().optional(), type: z.literal("INDIVIDUAL"), capacity: v1LienPartyDebtorCapacity.optional(), person_id: z.string().optional(), role: z.literal("Debtor")}); export const v1LienFilingUCC3AmendingDebtorResponse = z.object({amending_debtor: z.union([v1LienFilingOrganizationDebtorPartyResponse, v1LienFilingIndividualDebtorPartyResponse, v1LienFilingAssignedBusinessDebtorPartyResponse, v1LienFilingAssignedPersonDebtorPartyResponse]), new_debtor: z.discriminatedUnion("type", [v1LienFilingOrganizationDebtorPartyResponse, v1LienFilingIndividualDebtorPartyResponse])}); export const v1LienFilingUCC3EditDebtorAmendmentResponse = z.object({type: z.literal("EDIT"), amending_debtors: z.array(v1LienFilingUCC3AmendingDebtorResponse).optional()}); export const v1LienFilingUCC3DeleteDebtorAmendmentResponse = z.object({type: z.literal("DELETE"), deleted_debtors: z.array(z.union([v1LienFilingOrganizationDebtorPartyResponse, v1LienFilingIndividualDebtorPartyResponse, v1LienFilingAssignedBusinessDebtorPartyResponse, v1LienFilingAssignedPersonDebtorPartyResponse])).optional()}); export const v1LienFilingUCC3DebtorAmendmentActionResponse = z.object({type: z.literal("DEBTOR_AMENDMENT"), amendment: z.union([v1LienFilingUCC3AddDebtorAmendmentResponse, v1LienFilingUCC3EditDebtorAmendmentResponse, v1LienFilingUCC3DeleteDebtorAmendmentResponse]).nullable().optional()}); export const v1LienFilingUCC3AddSecuredPartyAmendmentResponse = z.object({type: z.literal("ADD"), secured_parties: z.array(z.discriminatedUnion("type", [v1LienFilingOrganizationSecuredPartyResponse, v1LienFilingIndividualSecuredPartyResponse])).optional()}); export const v1LienFilingUCC3AmendingSecuredPartyResponse = z.object({amending_secured_party: z.union([v1LienFilingOrganizationSecuredPartyResponse, v1LienFilingIndividualSecuredPartyResponse]), new_secured_party: z.discriminatedUnion("type", [v1LienFilingOrganizationSecuredPartyResponse, v1LienFilingIndividualSecuredPartyResponse])}); export const v1LienFilingUCC3EditSecuredPartyAmendmentResponse = z.object({type: z.literal("EDIT"), amending_secured_parties: z.array(v1LienFilingUCC3AmendingSecuredPartyResponse).nullable().optional()}); export const v1LienFilingUCC3DeleteSecuredPartyAmendmentResponse = z.object({type: z.literal("DELETE"), deleted_secured_parties: z.array(z.union([v1LienFilingOrganizationSecuredPartyResponse, v1LienFilingIndividualSecuredPartyResponse])).optional()}); export const v1LienFilingUCC3SecuredPartyAmendmentActionResponse = z.object({type: z.literal("SECURED_PARTY_AMENDMENT"), amendment: z.union([v1LienFilingUCC3AddSecuredPartyAmendmentResponse, v1LienFilingUCC3EditSecuredPartyAmendmentResponse, v1LienFilingUCC3DeleteSecuredPartyAmendmentResponse]).nullable().optional()}); export const v1LienFilingCollateralAmendmentType = z.enum(["ADD", "RESTATE", "DELETE"]); export const v1LienFilingUCC3CollateralAmendmentActionResponse = z.object({type: z.literal("COLLATERAL_AMENDMENT"), collateral_amendment_type: v1LienFilingCollateralAmendmentType.optional(), collateral_statements: z.discriminatedUnion("type", [v1LienFilingCollateralStatementText, v1LienFilingCollateralStatementAttachmentsResponse]).optional()}); export const lienFilingSubmissionStatus = z.enum(["Draft", "Requested", "InReview", "NeedsAttention", "Submitted", "Filed", "Cancelled"]); export const v1LienFilingAlternativeNameDesignation = z.enum(["AGLIEN", "BAILEE_BAILOR", "CONSIGNEE_CONSIGNOR", "LESSEE_LESSOR", "NON_UCC_FILING", "SELLER_BUYER", "LICENSEE", "DEBTOR_SECURED_PARTY"]); export const v1LienFilingAlternativeType = z.enum(["TRANSMITTING_UTILITY", "MANUFACTURED_HOME", "PUBLIC_FINANCE", "NOT_APPLICABLE"]); export const v1LienFilingTaxExemptReason = z.enum(["DEBTOR_COOPERATIVE_MARKETING_ASSOCIATION", "DEBTOR_CREDIT_UNION", "DEBTOR_TELEPHONE_COOPERATIVE", "GOVERNMENT_AGENCY", "JUDGEMENT_LIEN", "MUNICIPALITY", "REORGANIZATION", "SECURITIES", "STATE_AGENCY", "NOT_EXEMPT"]); export const v1LienFilingSubmissionStatus = z.enum(["Draft", "Requested", "InReview", "NeedsAttention", "Submitted", "Filed", "Cancelled"]); export const v1LienFilingSubmissionUCC1Response = z.object({reference_data: z.string().max(128).nullable().optional(), submission_filing_name: z.string().max(128).nullable().optional(), search_to_reflect: z.boolean().nullable().optional(), email_contact: z.string().max(256).nullable().optional(), real_estate_info: z.union([v1LienFilingRealEstateInfo, v1LienFilingNoRealEstateInfo]).nullable().optional(), miscellaneous_info: z.string().max(256).nullable().optional(), filing_type: z.literal("UCC1"), state: v1StateAbbreviation.nullable().optional(), jurisdiction_county: z.string().max(128).nullable().optional(), assigned_business_debtor: v1LienFilingAssignedBusinessDebtorPartyResponse.nullable().optional(), assigned_debtor: z.union([v1LienFilingAssignedBusinessDebtorPartyResponse, v1LienFilingAssignedPersonDebtorPartyResponse]).nullable().optional(), debtors: z.array(z.discriminatedUnion("type", [v1LienFilingOrganizationDebtorPartyResponse, v1LienFilingIndividualDebtorPartyResponse])).nullable().optional(), secured_parties: z.array(z.discriminatedUnion("type", [v1LienFilingOrganizationSecuredPartyResponse, v1LienFilingIndividualSecuredPartyResponse])).nullable().optional(), collateral_statements: z.discriminatedUnion("type", [v1LienFilingCollateralStatementText, v1LienFilingCollateralStatementAttachmentsResponse]).optional(), alternative_name_designation: v1LienFilingAlternativeNameDesignation.nullable().optional(), alternative_filing_type: v1LienFilingAlternativeType.nullable().optional(), principal_indebted_amount: z.string().nullable().optional(), documentary_tax_stamp_required: z.boolean().nullable().optional(), tax_exempt_reason: v1LienFilingTaxExemptReason.nullable().optional(), id: z.string().optional(), filing_status: v1LienFilingSubmissionStatus.optional(), filing_number: z.string().max(128).nullable().optional(), filing_date: z.string().nullable().optional(), lapse_date: z.string().nullable().optional(), has_downloadable_document: z.boolean().optional()}); export const v1LienFilingSubmissionUCC3Response = z.object({reference_data: z.string().max(128).nullable().optional(), submission_filing_name: z.string().max(128).nullable().optional(), search_to_reflect: z.boolean().nullable().optional(), email_contact: z.string().max(256).nullable().optional(), real_estate_info: z.union([v1LienFilingRealEstateInfo, v1LienFilingNoRealEstateInfo]).nullable().optional(), miscellaneous_info: z.string().max(256).nullable().optional(), filing_type: z.literal("UCC3"), amendment_action: z.union([v1LienFilingUCC3TerminationAction, v1LienFilingUCC3ContinuationAction, v1LienFilingUCC3AssignmentActionResponse, v1LienFilingUCC3DebtorAmendmentActionResponse, v1LienFilingUCC3SecuredPartyAmendmentActionResponse, v1LienFilingUCC3CollateralAmendmentActionResponse]).nullable().optional(), authorizing_party: z.union([v1LienFilingOrganizationSecuredPartyResponse, v1LienFilingIndividualSecuredPartyResponse, v1LienFilingOrganizationDebtorPartyResponse, v1LienFilingIndividualDebtorPartyResponse, v1LienFilingAssignedBusinessDebtorPartyResponse, v1LienFilingAssignedPersonDebtorPartyResponse]).nullable().optional(), id: z.string().optional(), filing_status: lienFilingSubmissionStatus.optional(), filing_number: z.string().max(128).nullable().optional(), filing_date: z.string().nullable().optional(), lapse_date: z.string().nullable().optional(), has_downloadable_document: z.boolean().optional(), amending_filing: v1LienFilingSubmissionUCC1Response.optional()}); 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 }; /** * Create New Ucc3 Lien Filing Submission * * POST /lien_submissions/{filing_id}/amend */ export const createApiLienSubmissionsFilingIdAmend = async (args: CreateApiLienSubmissionsFilingIdAmendArgs, options?: CreateApiLienSubmissionsFilingIdAmendOptions) => { const {baseUrl = "https://api.baselayer.com", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (APIKeyHeader !== undefined) headers.set("X-API-Key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/lien_submissions/${encodeURIComponent(String(args.filing_id))}/amend${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(v1LienFilingSubmissionUCC3Response, await res.json()) };