/** * Mexico Addresses Resource * * Extends AddressesResource with Mexico-specific behavior: * - Accepts flattened CreateMexAddressInput (MX fields at root level) * - Returns MexAddress models with Mexico-specific accessors * * Note: Mexican address format can be used for addresses in any country. */ import type { AddressFilter, AddressSort, AddressType, AtomicBatchResult, CreateAddressInput, CreateMexAddressInput, ListOptions, MexAddressFilter, MexAddressSort, PaginatedResponse, PartialBatchResult, SyncItem, SyncResult, UpdateAddressInput, UpdateMexAddressInput, UpsertMexAddressInput, UpsertResult } from "@artu-ai/shared"; import { z } from "zod"; import { type AddressData, MexAddress } from "../../models"; import { AddressesResource } from "../addresses"; /** * Mexico-scoped addresses resource. * * Provides the same operations as AddressesResource but with: * - Flattened input types (MX fields like exteriorNumber, neighborhood at root level) * - MexAddress model return type with Mexico-specific accessors * * @example * ```typescript * const mexSdk = new ComplianceSDK({ * apiKey, * environment: "test", * scope: "MX", * }); * * // Create with flattened input * const address = await mexSdk.addresses.create({ * clientId: "client_123", * street: "Paseo de la Reforma", * exteriorNumber: "222", * interiorNumber: "Piso 5", * neighborhood: "Juárez", * city: "Ciudad de México", * state: "CDMX", * postalCode: "06600", * country: "MX", * type: "home", * }); * * // Returns MexAddress * console.log(address.exteriorNumber); * console.log(address.formattedMexican); * ``` */ export declare class MexAddressesResource extends AddressesResource { /** @override Returns the MX create schema */ protected get createSchema(): z.ZodObject<{ exteriorNumber: z.ZodString; interiorNumber: z.ZodOptional; neighborhood: z.ZodString; municipality: z.ZodOptional; betweenStreets: z.ZodOptional; reference: z.ZodOptional; clientId: z.ZodUUID; type: z.ZodDefault>; isPrimary: z.ZodOptional; street: z.ZodString; city: z.ZodString; state: z.ZodString; postalCode: z.ZodString; country: z.ZodPipe>, z.ZodUnion, z.ZodEnum<{ [x: string]: string; }>]>>, z.ZodTransform<"MX" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW", string>>; externalId: z.ZodOptional; metadata: z.ZodOptional>; }, z.core.$strip>; /** @override Returns the MX update schema */ protected get updateSchema(): z.ZodObject<{ type: z.ZodOptional>>; postalCode: z.ZodOptional; country: z.ZodOptional>, z.ZodUnion, z.ZodEnum<{ [x: string]: string; }>]>>, z.ZodTransform<"MX" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW", string>>>; metadata: z.ZodOptional>>; exteriorNumber: z.ZodOptional; interiorNumber: z.ZodOptional>; neighborhood: z.ZodOptional; municipality: z.ZodOptional>; betweenStreets: z.ZodOptional>; reference: z.ZodOptional>; isPrimary: z.ZodOptional>; street: z.ZodOptional; city: z.ZodOptional; state: z.ZodOptional; externalId: z.ZodOptional>; }, z.core.$strip>; /** @override Returns the MX upsert schema */ protected get upsertSchema(): z.ZodIntersection; neighborhood: z.ZodString; municipality: z.ZodOptional; betweenStreets: z.ZodOptional; reference: z.ZodOptional; clientId: z.ZodUUID; type: z.ZodDefault>; isPrimary: z.ZodOptional; street: z.ZodString; city: z.ZodString; state: z.ZodString; postalCode: z.ZodString; country: z.ZodPipe>, z.ZodUnion, z.ZodEnum<{ [x: string]: string; }>]>>, z.ZodTransform<"MX" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW", string>>; externalId: z.ZodOptional; metadata: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ externalId: z.ZodString; }, z.core.$strip>>; /** * Creates a new address with Mexico-format fields. */ create(data: CreateMexAddressInput): Promise; /** * Retrieves an address by ID. */ retrieve(id: string): Promise; retrieveByMetadata(key: string, value: string): Promise; retrieveByExternalId(externalId: string): Promise; /** * Updates an address with Mexico-format fields. */ update(id: string, data: UpdateMexAddressInput): Promise; /** * Lists addresses with optional filtering. * * Accepts flattened MX filter (MX-specific fields at root level). */ list(options?: ListOptions): Promise>; /** * Lists all addresses for a specific client. */ listByClient(clientId: string, options?: { cursor?: string; limit?: number; }): Promise>; /** * Gets the primary address for a client. */ getPrimary(clientId: string, type?: AddressType): Promise; /** * Counts addresses matching the given filter. * * @param filter - Optional filter criteria (with MX fields at root level) * @returns The count of matching addresses */ count(filter?: MexAddressFilter): Promise; /** * Iterates over addresses. * * Accepts flattened MX filter (MX-specific fields at root level). */ iterate(options?: { filter?: MexAddressFilter; sort?: TSort; pageSize?: number; }): AsyncGenerator; createMany(addresses: CreateMexAddressInput[], options?: { atomic?: true; }): Promise>; createMany(addresses: CreateMexAddressInput[], options: { atomic: false; }): Promise>; updateMany(updates: { id: string; data: UpdateMexAddressInput; }[], options?: { atomic?: true; }): Promise>; updateMany(updates: { id: string; data: UpdateMexAddressInput; }[], options: { atomic: false; }): Promise>; /** * Creates or updates a Mexico address by externalId. * * @param data - Address upsert data with MX fields at root level (must include externalId) * @returns The created or updated address with action indicator */ upsertByExternalId(data: UpsertMexAddressInput): Promise>; /** * Creates or updates multiple Mexico addresses by externalId. * * @param addresses - Array of address 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(addresses: UpsertMexAddressInput[], options?: { atomic?: true; }): Promise>>; upsertManyByExternalId(addresses: UpsertMexAddressInput[], options: { atomic: false; }): Promise>>; /** * Syncs addresses for a client with Mexico-format flattened input. */ sync(clientId: string, items: SyncItem[], options: { replaceMode: true; }): Promise>; sync(clientId: string, items: SyncItem[], options?: { replaceMode?: boolean; }): Promise>; /** * Transforms flattened MX filter to nested API format. * * Mexico-specific filter fields (neighborhood, municipality) are stored * in `scopeData.MX`. Base fields pass through unchanged. */ protected applyScopeToFilter(filter?: MexAddressFilter): AddressFilter; /** * Transforms a flattened MexAddressSort to nested AddressSort format. * * Maps flattened field names to their full API paths. * * Note: Uses unknown parameter to allow derived classes to override with their own sort types. */ protected applyScopeToSort(sort?: TSort): AddressSort | undefined; /** * Transforms flattened MX input to nested API format. * * Mexico-specific fields (exteriorNumber, interiorNumber, neighborhood, etc.) * are stored in `scopeData.MX`. The base `street` field is passed through. */ protected transformToNested(data: CreateMexAddressInput): CreateAddressInput; /** * Transforms flattened MX update input to nested API format. * * NOTE: Always includes `scopeData: { MX: {} }` even if no MX-specific * fields are provided. This ensures that records touched via the Mexico SDK * can be filtered by `availableJurisdictions: { in: ["MX"] }`. */ protected transformUpdateToNested(data: UpdateMexAddressInput): UpdateAddressInput; /** * Instantiates a MexAddress model. */ protected instantiate(data: AddressData): MexAddress; }