/** * TSC (Tarjetas de Servicio y Crédito) Alerts Resource * * Extends MexAlertsResource with TSC-specific behavior: * - Accepts flattened CreateTSCAlertInput (TSC fields at root level) * - Returns MexTSCAlert models */ import type { AlertClientItemFilter, AlertItemFilter, AlertItemSort, AlertSort, AlertTransactionItemFilter, AtomicBatchResult, ClientSort, CreateAlertInput, CreateAlertItemInput, CreateTSCAlertInput, CreateTSCAlertItemInput, GenerateResult, ListOptions, PaginatedResponse, PartialBatchResult, TransactionSort, TSCAlertClientItemFilter, TSCAlertFilter, TSCAlertItemFilter, TSCAlertSort, TSCAlertTransactionItemFilter, TSCClientSort, TSCTransactionSort, TscAlertDefaultsInput, UpdateAlertInput, UpdateAlertItemInput, UpdateTSCAlertInput, UpdateTSCAlertItemInput, UpsertResult, UpsertTSCAlertInput, ValidationResult } from "@artu-ai/shared"; import { ReportType } from "@artu-ai/shared"; import { type AlertClientItemData, type AlertData, type AlertItemData, type AlertTransactionItemData, MexTSCAlert, MexTSCAlertClientItem, MexTSCAlertItem, MexTSCAlertTransactionItem } from "../../../../models"; import { AlertItemsResource } from "../../../alert-items"; import { AVAlertsResource } from "../alerts"; /** * TSC (Tarjetas de Servicio y Crédito) scoped alerts resource. * * @example * ```typescript * const tscSdk = new ComplianceSDK({ * apiKey, * scope: "MX", * actividadVulnerable: CodigoActividad.TSC, * }); * * // Create with fully flattened input * const alert = await tscSdk.alerts.create({ * mesReportado: "202401", * }); * * // Returns MexTSCAlert * console.log(alert.mesReportado); * ``` */ export declare class TSCAlertsResource extends AVAlertsResource { create(data: CreateTSCAlertInput): Promise; retrieve(id: string, opts?: { crossScope?: boolean; }): Promise; retrieveByMetadata(key: string, value: string, opts?: { crossScope?: boolean; }): Promise; retrieveByExternalId(externalId: string, opts?: { crossScope?: boolean; }): Promise; update(id: string, data: UpdateTSCAlertInput): Promise; /** * Lists TSC alerts with optional filtering. * * Accepts flattened TSC filter (future TSC-specific alert fields at root level). */ list(options?: ListOptions & { crossScope?: boolean; }): Promise>; /** * Iterates over TSC alerts. * * Accepts flattened TSC filter (future TSC-specific alert fields at root level). */ iterate(options?: { filter?: TSCAlertFilter; sort?: TSCAlertSort; pageSize?: number; crossScope?: boolean; }): AsyncGenerator; /** * Counts TSC alerts matching the given filter. * * @param filter - Optional filter criteria (with TSC fields at root level) * @returns The count of matching alerts */ count(filter?: TSCAlertFilter, options?: { crossScope?: boolean; }): Promise; createMany(alerts: CreateTSCAlertInput[], options?: { atomic?: true; }): Promise>; createMany(alerts: CreateTSCAlertInput[], options: { atomic: false; }): Promise>; updateMany(updates: { id: string; data: UpdateTSCAlertInput; }[], options?: { atomic?: true; }): Promise>; updateMany(updates: { id: string; data: UpdateTSCAlertInput; }[], options: { atomic: false; }): Promise>; /** * Creates or updates a TSC alert by externalId. * * @param data - Alert upsert data with TSC fields at root level (must include externalId) * @returns The created or updated alert with action indicator */ upsertByExternalId(data: UpsertTSCAlertInput): Promise>; /** * Creates or updates multiple TSC alerts by externalId. * * @param alerts - Array of alert 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(alerts: UpsertTSCAlertInput[], options?: { atomic?: true; }): Promise>>; upsertManyByExternalId(alerts: UpsertTSCAlertInput[], options: { atomic: false; }): Promise>>; addItem(alertId: string, data: CreateTSCAlertItemInput): Promise; getItem(alertId: string, itemId: string): Promise; updateItem(alertId: string, itemId: string, data: UpdateTSCAlertItemInput): Promise; listItems(alertId: string, options?: ListOptions): Promise>; /** * Transforms a flattened TSCAlertItemFilter to nested AlertItemFilter format. */ protected applyScopeToItemFilter(filter?: TSCAlertItemFilter): AlertItemFilter | undefined; addItems(alertId: string, items: CreateTSCAlertItemInput[]): Promise<{ added: number; items: MexTSCAlertItem[]; }>; /** * Lists transactions linked to an alert with TSC-scoped filters/sorts. */ listTransactionItems(alertId: string, options?: ListOptions): Promise>; /** * Lists unique clients related to an alert with TSC-scoped filters/sorts. */ listClients(alertId: string, options?: ListOptions): Promise>; protected applyTransactionScopeToFilter(filter?: TSCAlertTransactionItemFilter): AlertTransactionItemFilter | undefined; protected applyClientScopeToFilter(filter?: TSCAlertClientItemFilter): AlertClientItemFilter | undefined; private buildAlertItemFilter; protected createItemsResource(): AlertItemsResource | undefined; } | undefined; alertType?: "100" | "9999" | "2201" | "2202" | "2203" | "2204" | "2205" | "2206" | "2207" | "2208" | "2209" | "2210" | "2211" | "2212" | "2213" | "2214" | "2215" | "2216" | { eq?: "100" | "9999" | "2201" | "2202" | "2203" | "2204" | "2205" | "2206" | "2207" | "2208" | "2209" | "2210" | "2211" | "2212" | "2213" | "2214" | "2215" | "2216" | undefined; in?: ("100" | "9999" | "2201" | "2202" | "2203" | "2204" | "2205" | "2206" | "2207" | "2208" | "2209" | "2210" | "2211" | "2212" | "2213" | "2214" | "2215" | "2216")[] | undefined; nin?: ("100" | "9999" | "2201" | "2202" | "2203" | "2204" | "2205" | "2206" | "2207" | "2208" | "2209" | "2210" | "2211" | "2212" | "2213" | "2214" | "2215" | "2216")[] | undefined; } | undefined; alertDescription?: string | { eq?: string | undefined; contains?: string | undefined; startsWith?: string | undefined; endsWith?: string | undefined; in?: string[] | undefined; nin?: string[] | undefined; } | undefined; }>; /** * Validates a TSC alert. * * Uses TSC-scoped validation input (scope and activity are implicit). * * @param alertId - The alert ID to validate * @param defaults - TSC alert defaults including rfc, alertType, etc. * * @example * ```typescript * const result = await tscSdk.alerts.validateReport(alert.id, { * rfc: "ABC200101XXX", * alertType: "100", * }); * ``` */ validateReport(alertId: string, defaults?: TscAlertDefaultsInput): Promise; /** * Generates XML for a TSC alert. * * Uses the same input as validateReport. * * @param alertId - The alert ID to generate XML for * @param defaults - TSC alert defaults including rfc, alertType, etc. */ generateReport(alertId: string, defaults?: TscAlertDefaultsInput): Promise; /** * Transforms a flattened TSCTransactionSort to nested TransactionSort format. */ protected applyTransactionScopeToSort(sort?: TSCTransactionSort): TransactionSort | undefined; /** * Transforms a flattened TSCClientSort to nested ClientSort format. */ protected applyClientScopeToSort(sort?: TSCClientSort): ClientSort | undefined; protected transformToNested(data: CreateTSCAlertInput): CreateAlertInput; /** * 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: UpdateTSCAlertInput): UpdateAlertInput; protected instantiate(data: AlertData): MexTSCAlert; /** Materializes a raw payload into a {@link MexTSCAlert} (return type narrowed via the `instantiate` override). */ materialize(data: AlertData): MexTSCAlert; protected instantiateItem(data: AlertItemData): MexTSCAlertItem; protected instantiateTransactionItem(data: AlertTransactionItemData): MexTSCAlertTransactionItem; protected instantiateClientItem(data: AlertClientItemData): MexTSCAlertClientItem; protected transformItemToNested(data: CreateTSCAlertItemInput): CreateAlertItemInput; protected transformItemUpdateToNested(data: UpdateTSCAlertItemInput): UpdateAlertItemInput; /** * Transforms a flattened TSCAlertSort to nested AlertSort format. * * Maps flattened field names to their full API paths using TSC-specific field mapping. */ protected applyScopeToSort(sort?: TSCAlertSort): AlertSort | undefined; /** * Transforms TSC defaults to nested API format for validate/generate. */ protected transformTscDefaultsToNested(alertId: string, defaults?: TscAlertDefaultsInput): { alertId: string; reportType: ReportType; defaults?: unknown; }; }