/** Durable values. add must atomically create only when the key is absent. */ type ArcaStore = { get(key: string): Promise; set(key: string, value: string): Promise; add(key: string, value: string): Promise; delete?(key: string): Promise; withLock?(key: string, fn: () => Promise): Promise; }; /** Target environment for ARCA services. */ type ArcaEnvironment = "production" | "test"; /** All ARCA service identifiers, including WSAA. */ type ArcaServiceName = "wsaa" | "wsfe" | "wsmtxca" | "padron-a5" | "padron-a13"; /** ARCA service identifiers excluding the WSAA authentication service. */ type ArcaServiceTarget = Exclude; /** Padron-specific service identifiers. */ type ArcaPadronServiceName = Extract; /** WSAA service identifiers used for authentication scoping. */ type ArcaWsaaServiceId = "wsfe" | "wsmtxca" | "ws_sr_constancia_inscripcion" | "ws_sr_padron_a13"; type ArcaLogLevel = "debug" | "info" | "warn" | "error"; type ArcaLoggerConfig = { disabled?: boolean; level?: ArcaLogLevel; log?: (level: ArcaLogLevel, message: string, ...args: unknown[]) => void; }; type ArcaWsaaSessionKey = { environment: ArcaEnvironment; service: ArcaWsaaServiceId; certificateFingerprint: string; }; type ArcaWsaaSessionStore = { get(key: ArcaWsaaSessionKey): Promise; set(key: ArcaWsaaSessionKey, credentials: ArcaAuthCredentials): Promise; delete?(key: ArcaWsaaSessionKey): Promise; withLock?(key: ArcaWsaaSessionKey, fn: () => Promise): Promise; }; /** Configuration required to create an ARCA client. */ type ArcaClientConfig = { taxId: string; certificatePem: string; privateKeyPem: string; environment: ArcaEnvironment; store?: ArcaStore; timeout?: number; retries?: number; retryDelay?: number; logger?: ArcaLoggerConfig; wsaaSessionStore?: ArcaWsaaSessionStore; }; /** Credentials returned by a WSAA login. */ type ArcaAuthCredentials = { token: string; sign: string; expiresAt: string; }; type ArcaRepresentedTaxId = number | string | undefined; type ArcaSoapResponse = { service: ArcaServiceName; operation: string; raw: string; result: TResult; }; type ArcaAuthOptions = { forceRefresh?: boolean; representedTaxId?: ArcaRepresentedTaxId; /** Aborts login, submission and consultation with the caller's deadline. */ abortSignal?: AbortSignal; }; type ArcaSoapExecutionOptions = { service: ArcaServiceName; operation: string; /** Overrides client-level retries for this operation. Use zero for fiscal authorization. */ retries?: number; bodyElementName?: string; bodyElementNamespaceMode?: "default" | "prefix"; body: TBody; signal?: AbortSignal; }; type ArcaClientOptions = Omit & Partial>; export type { ArcaClientOptions as A, ArcaClientConfig as a, ArcaServiceName as b, ArcaSoapExecutionOptions as c, ArcaSoapResponse as d, ArcaWsaaServiceId as e, ArcaAuthOptions as f, ArcaAuthCredentials as g, ArcaEnvironment as h, ArcaStore as i, ArcaWsaaSessionStore as j, ArcaLogLevel as k, ArcaLoggerConfig as l, ArcaPadronServiceName as m, ArcaRepresentedTaxId as n, ArcaServiceTarget as o, ArcaWsaaSessionKey as p };