/** * JYS (Juegos y Sorteos) Clients Resource * * Extends MexClientsResource with JYS-specific behavior. * JYS clients have the same fields as Mexico clients (no additional activity fields). * Returns MexJYSClient models. */ import type { AtomicBatchResult, ClientRelationshipType, ClientSort, CreateBankAccountInput, CreateClientInput, CreateContactMethodInput, CreateJYSClientInput, CreateMexAddressInput, JYSClientFilter, JYSClientSort, LinkedClient as LinkedClientInput, ListOptions, PaginatedResponse, PartialBatchResult, SyncCreateDocumentInput, SyncItem, SyncResult, SyncUpdateDocumentInput, UpdateBankAccountInput, UpdateClientInput, UpdateContactMethodInput, UpdateJYSClientInput, UpdateMexAddressInput, UpsertJYSClientInput, UpsertResult } from "@artu-ai/shared"; import { type ClientData, ContactMethod, Document, LinkedClient, MexAddress, MexBankAccount, MexJYSClient } from "../../../../models"; import { type ClientIncludeMap } from "../../../clients"; import type { RelatedPartyParent, RelatedPartySubresource } from "../../../related-parties/base"; import { AVClientsResource } from "../clients"; /** * JYS (Juegos y Sorteos) scoped clients resource. * * @example * ```typescript * const jysSdk = new ComplianceSDK({ * apiKey, * environment: "test", * scope: "MX", * actividadVulnerable: CodigoActividad.JYS, * }); * * const client = await jysSdk.clients.create({ * type: ClientType.Person, * name: "Juan GarcĂ­a", * rfc: "GAJL850101ABC", * }); * * // Returns MexJYSClient * ``` */ export declare class JYSClientsResource extends AVClientsResource { readonly legalRepresentatives: RelatedPartySubresource; readonly controllingBeneficiaries: RelatedPartySubresource; protected relatedPartyParent(): RelatedPartyParent; create(data: CreateJYSClientInput): Promise; retrieve(id: string, options?: { include?: ClientIncludeMap; crossScope?: boolean; }): Promise; retrieveByExternalId(externalId: string, opts?: { crossScope?: boolean; }): Promise; update(id: string, data: UpdateJYSClientInput): Promise; /** * Lists JYS clients with optional filtering. * * Accepts flattened JYS 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 JYS clients. * * Accepts flattened JYS filter (MX fields at root level) and automatically * transforms to nested format before calling the API. */ iterate(options?: { filter?: JYSClientFilter; sort?: JYSClientSort; pageSize?: number; crossScope?: boolean; }): AsyncGenerator; /** * Counts JYS clients matching the given filter. * * @param filter - Optional filter criteria (with JYS fields at root level) * @returns The count of matching clients */ count(filter?: JYSClientFilter, options?: { includeNonPrimary?: boolean; crossScope?: boolean; }): Promise; createMany(clients: CreateJYSClientInput[], options?: { atomic?: true; }): Promise>; createMany(clients: CreateJYSClientInput[], options: { atomic: false; }): Promise>; updateMany(updates: { id: string; data: UpdateJYSClientInput; }[], options?: { atomic?: true; }): Promise>; updateMany(updates: { id: string; data: UpdateJYSClientInput; }[], options: { atomic: false; }): Promise>; /** * Creates or updates a JYS client by externalId. * * @param data - Client upsert data with JYS fields at root level (must include externalId) * @returns The created or updated client with action indicator */ upsertByExternalId(data: UpsertJYSClientInput): Promise>; /** * Creates or updates multiple JYS 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: UpsertJYSClientInput[], options?: { atomic?: true; }): Promise>>; upsertManyByExternalId(clients: UpsertJYSClientInput[], 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: CreateJYSClientInput; addresses?: SyncItem[]; contactMethods?: SyncItem[]; bankAccounts?: SyncItem[]; documents?: SyncItem[]; linkedClients?: LinkedClientInput[]; }, options?: { replaceMode?: boolean; }): Promise<{ client: MexJYSClient; addresses: SyncResult; contactMethods: SyncResult; bankAccounts: SyncResult; documents: SyncResult; }>; syncAll(clientId: string, data: { client?: UpdateJYSClientInput; addresses?: SyncItem[]; contactMethods?: SyncItem[]; bankAccounts?: SyncItem[]; documents?: SyncItem[]; linkedClients?: LinkedClientInput[]; }, options: { replaceMode: true; }): Promise<{ client: MexJYSClient; addresses: SyncResult; contactMethods: SyncResult; bankAccounts: SyncResult; documents: SyncResult; }>; syncAll(clientId: string, data: { client?: UpdateJYSClientInput; addresses?: SyncItem[]; contactMethods?: SyncItem[]; bankAccounts?: SyncItem[]; documents?: SyncItem[]; linkedClients?: LinkedClientInput[]; }, options?: { replaceMode?: boolean; }): Promise<{ client: MexJYSClient; addresses: SyncResult; contactMethods: SyncResult; bankAccounts: SyncResult; documents: SyncResult; }>; /** * Transforms a flattened JYSClientSort to nested ClientSort format. * * Maps flattened field names to their full API paths. */ protected applyScopeToSort(sort?: JYSClientSort): ClientSort | undefined; /** * Transforms JYS input to nested API format. * JYS has no additional fields, but we add the JYS activity marker. */ protected transformToNested(data: CreateJYSClientInput): CreateClientInput; /** * Transforms JYS update input to nested API format. * * NOTE: Always includes `actividadVulnerable: { JYS: {} }` even if no * JYS-specific fields are provided. This ensures that records touched via * the JYS SDK can be filtered by `activityCodes: { in: ["JYS"] }`. */ protected transformUpdateToNested(data: UpdateJYSClientInput): UpdateClientInput; protected instantiate(data: ClientData): MexJYSClient; /** Materializes a raw payload into a {@link MexJYSClient} (return type narrowed via the `instantiate` override). */ materialize(data: ClientData): MexJYSClient; }