/** * TSC (Tarjetas de Servicio y Crédito) Clients Resource * * Extends MexClientsResource with TSC-specific behavior. * TSC clients have the same fields as Mexico clients (no additional activity fields). * Returns MexTSCClient models. */ import type { AtomicBatchResult, ClientRelationshipType, ClientSort, CreateBankAccountInput, CreateClientInput, CreateContactMethodInput, CreateMexAddressInput, CreateTSCClientInput, LinkedClient as LinkedClientInput, ListOptions, PaginatedResponse, PartialBatchResult, SyncCreateDocumentInput, SyncItem, SyncResult, SyncUpdateDocumentInput, TSCClientFilter, TSCClientSort, UpdateBankAccountInput, UpdateClientInput, UpdateContactMethodInput, UpdateMexAddressInput, UpdateTSCClientInput, UpsertResult, UpsertTSCClientInput } from "@artu-ai/shared"; import { type ClientData, ContactMethod, Document, LinkedClient, MexAddress, MexBankAccount, MexTSCClient } from "../../../../models"; import { type ClientIncludeMap } from "../../../clients"; import type { RelatedPartyParent, RelatedPartySubresource } from "../../../related-parties/base"; import { AVClientsResource } from "../clients"; /** * TSC (Tarjetas de Servicio y Crédito) scoped clients resource. * * @example * ```typescript * const tscSdk = new ComplianceSDK({ * apiKey, * environment: "test", * scope: "MX", * actividadVulnerable: CodigoActividad.TSC, * }); * * const client = await tscSdk.clients.create({ * type: ClientType.Person, * name: "Juan García", * rfc: "GAJL850101ABC", * }); * * // Returns MexTSCClient * ``` */ export declare class TSCClientsResource extends AVClientsResource { readonly legalRepresentatives: RelatedPartySubresource; readonly controllingBeneficiaries: RelatedPartySubresource; protected relatedPartyParent(): RelatedPartyParent; create(data: CreateTSCClientInput): Promise; retrieve(id: string, options?: { include?: ClientIncludeMap; crossScope?: boolean; }): Promise; retrieveByExternalId(externalId: string, opts?: { crossScope?: boolean; }): Promise; update(id: string, data: UpdateTSCClientInput): Promise; /** * Lists TSC clients with optional filtering. * * Accepts flattened TSC filter (MX fields at root level) and automatically * transforms to nested format before calling the API. */ list(options?: ListOptions & { includePrimaryContacts?: boolean; includeNonPrimary?: boolean; crossScope?: boolean; }): Promise>; /** * Iterates over TSC clients. * * Accepts flattened TSC filter (MX fields at root level) and automatically * transforms to nested format before calling the API. */ iterate(options?: { filter?: TSCClientFilter; sort?: TSCClientSort; pageSize?: number; crossScope?: boolean; }): AsyncGenerator; /** * Counts TSC clients matching the given filter. * * @param filter - Optional filter criteria (with TSC fields at root level) * @returns The count of matching clients */ count(filter?: TSCClientFilter, options?: { includeNonPrimary?: boolean; crossScope?: boolean; }): Promise; createMany(clients: CreateTSCClientInput[], options?: { atomic?: true; }): Promise>; createMany(clients: CreateTSCClientInput[], options: { atomic: false; }): Promise>; updateMany(updates: { id: string; data: UpdateTSCClientInput; }[], options?: { atomic?: true; }): Promise>; updateMany(updates: { id: string; data: UpdateTSCClientInput; }[], options: { atomic: false; }): Promise>; /** * Creates or updates a TSC client by externalId. * * @param data - Client upsert data with TSC fields at root level (must include externalId) * @returns The created or updated client with action indicator */ upsertByExternalId(data: UpsertTSCClientInput): Promise>; /** * Creates or updates multiple TSC clients by externalId. * * @param clients - Array of client upsert data (each must include externalId) * @param options - Batch options (atomic: true by default) * @returns Atomic result with data array, or partial result with succeeded/failed */ upsertManyByExternalId(clients: UpsertTSCClientInput[], options?: { atomic?: true; }): Promise>>; upsertManyByExternalId(clients: UpsertTSCClientInput[], options: { atomic: false; }): Promise>>; linkClient(parentClientId: string, childClientId: string, relationshipType: ClientRelationshipType, metadata?: Record): Promise; unlinkClient(parentClientId: string, childClientId: string, relationshipType: ClientRelationshipType): Promise; listLinkedClients(parentClientId: string, relationshipType?: ClientRelationshipType): Promise; setLinkedClients(parentClientId: string, linkedClients: LinkedClientInput[]): Promise; syncAll(clientId: undefined, data: { client: CreateTSCClientInput; addresses?: SyncItem[]; contactMethods?: SyncItem[]; bankAccounts?: SyncItem[]; documents?: SyncItem[]; linkedClients?: LinkedClientInput[]; }, options?: { replaceMode?: boolean; }): Promise<{ client: MexTSCClient; addresses: SyncResult; contactMethods: SyncResult; bankAccounts: SyncResult; documents: SyncResult; }>; syncAll(clientId: string, data: { client?: UpdateTSCClientInput; addresses?: SyncItem[]; contactMethods?: SyncItem[]; bankAccounts?: SyncItem[]; documents?: SyncItem[]; linkedClients?: LinkedClientInput[]; }, options: { replaceMode: true; }): Promise<{ client: MexTSCClient; addresses: SyncResult; contactMethods: SyncResult; bankAccounts: SyncResult; documents: SyncResult; }>; syncAll(clientId: string, data: { client?: UpdateTSCClientInput; addresses?: SyncItem[]; contactMethods?: SyncItem[]; bankAccounts?: SyncItem[]; documents?: SyncItem[]; linkedClients?: LinkedClientInput[]; }, options?: { replaceMode?: boolean; }): Promise<{ client: MexTSCClient; addresses: SyncResult; contactMethods: SyncResult; bankAccounts: SyncResult; documents: SyncResult; }>; /** * Transforms TSC input to nested API format. * TSC has no additional fields, but we add the TSC activity marker. */ protected transformToNested(data: CreateTSCClientInput): CreateClientInput; /** * Transforms TSC update input to nested API format. * * NOTE: Always includes `actividadVulnerable: { TSC: {} }` even if no * TSC-specific fields are provided. This ensures that records touched via * the TSC SDK can be filtered by `activityCodes: { in: ["TSC"] }`. */ protected transformUpdateToNested(data: UpdateTSCClientInput): UpdateClientInput; protected instantiate(data: ClientData): MexTSCClient; /** Materializes a raw payload into a {@link MexTSCClient} (return type narrowed via the `instantiate` override). */ materialize(data: ClientData): MexTSCClient; /** * Transforms a flattened TSCClientSort to nested ClientSort format. * * Maps flattened field names to their full API paths using TSC-specific field mapping. */ protected applyScopeToSort(sort?: TSCClientSort): ClientSort | undefined; }